| | |
| | | private String specificationModel; |
| | | |
| | | @ApiModelProperty(value = "已发货") |
| | | private String shippedQuantity; |
| | | private BigDecimal shippedQuantity; |
| | | |
| | | @ApiModelProperty(value = "未发货") |
| | | private String unshippedQuantity; |
| | | private BigDecimal unshippedQuantity; |
| | | |
| | | @ApiModelProperty(value = "总数量") |
| | | private BigDecimal totalQuantity; |
| | | } |
| | |
| | | |
| | | /** |
| | | * 查询已经绑定发票的开票台账 |
| | | * |
| | | * @param page |
| | | * @param receiptPaymentDto |
| | | * @return |
| | |
| | | |
| | | /** |
| | | * 开票台账详情 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 计算前多少条数据回款金额综合 |
| | | * |
| | | * @param customerId |
| | | * @param total |
| | | * @return |
| | |
| | | /** |
| | | * 查询回款记录分页 |
| | | */ |
| | | IPage<ReceiptPaymentDto> receiptPaymentHistoryListPage(Page page,@Param("params") ReceiptPaymentDto receiptPaymentDto); |
| | | IPage<ReceiptPaymentDto> receiptPaymentHistoryListPage(Page page, @Param("params") ReceiptPaymentDto receiptPaymentDto); |
| | | |
| | | /** |
| | | * 客户往来记录查询 |
| | | * |
| | | * @param receiptPaymentDto |
| | | * @return |
| | | */ |
| | | List<CustomerInteractionDto> customerInteractions (ReceiptPaymentDto receiptPaymentDto); |
| | | List<CustomerInteractionDto> customerInteractions(ReceiptPaymentDto receiptPaymentDto); |
| | | |
| | | /** |
| | | * 客户回款记录查询 |
| | | * |
| | | * @param invoiceLedgerDto |
| | | * @return |
| | | */ |
| | |
| | | /** |
| | | * 查询回款记录不分页 |
| | | */ |
| | | List<ReceiptPaymentDto> receiptPaymentHistoryListNoPage( @Param("params") ReceiptPaymentDto receiptPaymentDto); |
| | | List<ReceiptPaymentDto> receiptPaymentHistoryListNoPage(@Param("params") ReceiptPaymentDto receiptPaymentDto); |
| | | |
| | | /** |
| | | * 通过开票登记产品id查询是否已经有回款记录 |
| | | * |
| | | * @param invoiceRegistrationProductId |
| | | * @return |
| | | */ |
| | |
| | | |
| | | List<ReceiptPaymentDto> bindInvoiceNoRegListAll(); |
| | | |
| | | List<ReceiptPaymentExeclDto> bindInvoiceNoRegListByIds(List<Long> ids,Long tenantId); |
| | | List<ReceiptPaymentExeclDto> bindInvoiceNoRegListByIds(List<Long> ids, Long tenantId); |
| | | |
| | | |
| | | List<InvoiceLedgerDto> customerSalesInteractions(InvoiceLedgerDto receiptPaymentDto); |
| | | List<InvoiceLedgerDto> customerSalesInteractions(@Param("ew") InvoiceLedgerDto receiptPaymentDto); |
| | | } |
| | |
| | | import com.ruoyi.sales.dto.InvoiceLedgerDto; |
| | | import com.ruoyi.sales.dto.ReceiptPaymentDto; |
| | | import com.ruoyi.sales.dto.ReceiptPaymentExeclDto; |
| | | import com.ruoyi.sales.mapper.InvoiceLedgerMapper; |
| | | import com.ruoyi.sales.mapper.ReceiptPaymentMapper; |
| | | import com.ruoyi.sales.mapper.SalesLedgerMapper; |
| | | import com.ruoyi.sales.mapper.SalesLedgerProductMapper; |
| | | import com.ruoyi.sales.mapper.*; |
| | | import com.ruoyi.sales.pojo.ReceiptPayment; |
| | | import com.ruoyi.sales.pojo.SalesLedger; |
| | | import com.ruoyi.sales.pojo.SalesLedgerProduct; |
| | |
| | | |
| | | @Override |
| | | public List<InvoiceLedgerDto> customerSalesInteractions(InvoiceLedgerDto receiptPaymentDto) { |
| | | receiptPaymentDto.getCustomerId(); |
| | | return receiptPaymentMapper.customerSalesInteractions(receiptPaymentDto); |
| | | } |
| | | } |
| | |
| | | |
| | | <select id="invoiceLedgerSalesAccount" resultType="com.ruoyi.sales.dto.InvoiceLedgerDto"> |
| | | SELECT |
| | | T1.customer_id AS id, |
| | | T1.customer_name, |
| | | SUM(contract_amount) AS invoice_total, |
| | | c.id AS id, |
| | | c.customer_name, |
| | | IFNULL(SUM(T1.contract_amount), 0) AS invoice_total, |
| | | IFNULL(SUM(T2.receipt_payment_amount), 0) AS receipt_payment_amount, |
| | | IFNULL(SUM(contract_amount), 0) - IFNULL(SUM(T2.receipt_payment_amount), 0) AS unReceipt_payment_amount |
| | | FROM sales_ledger T1 |
| | | IFNULL(SUM(T1.contract_amount), 0) - IFNULL(SUM(T2.receipt_payment_amount), 0) AS unReceipt_payment_amount |
| | | FROM customer c |
| | | LEFT JOIN sales_ledger T1 ON c.id = T1.customer_id |
| | | LEFT JOIN receipt_payment T2 ON T1.id = T2.sales_ledger_id |
| | | <where> |
| | | <if test="invoiceLedgerDto.searchText != null and invoiceLedgerDto.searchText != '' "> |
| | | T1.customer_name LIKE CONCAT ('%',#{invoiceLedgerDto.searchText},'%') |
| | | c.customer_name LIKE CONCAT ('%',#{invoiceLedgerDto.searchText},'%') |
| | | </if> |
| | | </where> |
| | | GROUP BY T1.customer_id, T1.customer_name |
| | | GROUP BY c.id, c.customer_name |
| | | </select> |
| | | |
| | | <select id="invoiceLedgerProductInfo" resultType="com.ruoyi.sales.dto.InvoiceRegistrationProductDto"> |
| | |
| | | GROUP BY T1.id, T1.sales_contract_no, T1.contract_amount, T2.receipt_payment_date |
| | | </select> |
| | | |
| | | <select id="customerSalesInteractions" resultType="com.ruoyi.sales.dto.InvoiceLedgerDto"> |
| | | SELECT |
| | | wr.receive_unit, |
| | | wr.goods_name, |
| | | wr.specification, |
| | | wr.shippedQuantity, |
| | | SUM(slp.quantity) AS totalQuantity, |
| | | SUM(IFNULL(slp.quantity, 0)) - wr.shippedQuantity AS unshippedQuantity |
| | | FROM |
| | | (SELECT receive_unit, goods_name, specification, SUM(net_weight) AS shippedQuantity FROM weighing_record GROUP BY receive_unit, goods_name, specification) wr |
| | | LEFT JOIN sales_ledger sl ON sl.customer_name = wr.receive_unit |
| | | LEFT JOIN sales_ledger_product slp ON slp.sales_ledger_id = sl.id |
| | | AND slp.product_category = wr.goods_name |
| | | AND slp.specification_model = wr.specification |
| | | WHERE |
| | | sl.customer_id = #{ew.customerId} |
| | | GROUP BY |
| | | wr.receive_unit, |
| | | wr.goods_name, |
| | | wr.specification, |
| | | wr.shippedQuantity |
| | | </select> |
| | | </mapper> |