收款管理

This commit is contained in:
luojiaquan
2026-10-13 10:38:50 +08:00
parent 4d27887d4a
commit 3ae8d536cd
7 changed files with 1655 additions and 4 deletions
@@ -51,6 +51,12 @@ public class CustomerReceipt extends BaseEntity
/** 客户ID */
private Long customerId;
/** 客户编码(列表关联查询,仅展示) */
private String customerCode;
/** 客户名称(列表关联查询,仅展示) */
private String customerName;
/** 客户账户ID(预留) */
private Long accountId;
@@ -83,6 +83,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="currency != null and currency != ''">and w.currency = #{currency}</if>
<if test="writeoffNo != null and writeoffNo != ''">and w.writeoff_no like concat('%', #{writeoffNo}, '%')</if>
<if test="billNo != null and billNo != ''">and w.bill_no like concat('%', #{billNo}, '%')</if>
<if test="receiptId != null">and w.receipt_id = #{receiptId}</if>
<if test="params != null and params.beginTime != null and params.beginTime != ''">
and date_format(w.writeoff_date,'%y%m%d') &gt;= date_format(#{params.beginTime},'%y%m%d')
</if>
<if test="params != null and params.endTime != null and params.endTime != ''">
and date_format(w.writeoff_date,'%y%m%d') &lt;= date_format(#{params.endTime},'%y%m%d')
</if>
</where>
order by w.create_time desc, w.writeoff_id desc
</select>
@@ -236,6 +236,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<id property="id" column="id" />
<result property="receiptNo" column="receipt_no" />
<result property="customerId" column="customer_id" />
<result property="customerCode" column="customer_code" />
<result property="customerName" column="customer_name" />
<result property="accountId" column="account_id" />
<result property="receiptType" column="receipt_type" />
<result property="amount" column="amount" />
@@ -268,7 +270,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql id="selectCustomerReceiptVo">
select r.id, r.receipt_no, r.customer_id, r.account_id, r.receipt_type, r.amount, r.allocated_amount,
select r.id, r.receipt_no, r.customer_id, c.customer_code, c.customer_name, r.account_id, r.receipt_type,
r.amount, r.allocated_amount,
r.unallocated_amount, r.currency, r.exchange_rate, r.rate_source, r.rate_source_desc,
r.base_amount, r.pay_method, r.bank_account_id, r.bank_account_name,
r.bank_account_no, r.bank_name, r.bank_transaction_no,
@@ -278,6 +281,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
(select count(1) from ctr_customer_attachment a
where a.biz_id = r.id and a.attachment_type = '3' and a.del_flag = '0') as attachment_count
from ctr_customer_receipt r
left join ctr_customer c on c.customer_id = r.customer_id
</sql>
<select id="selectReceiptList" parameterType="com.bms.customer.customermoney.domain.CustomerReceipt"
@@ -286,7 +290,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<where>
r.del_flag = '0'
<if test="customerId != null"> and r.customer_id = #{customerId}</if>
<if test="customerCode != null and customerCode != ''"> and c.customer_code like concat('%', #{customerCode}, '%')</if>
<if test="customerName != null and customerName != ''"> and c.customer_name like concat('%', #{customerName}, '%')</if>
<if test="receiptNo != null and receiptNo != ''"> and r.receipt_no like concat('%', #{receiptNo}, '%')</if>
<if test="receiptType != null and receiptType != ''"> and r.receipt_type = #{receiptType}</if>
<if test="status != null and status != ''"> and r.status = #{status}</if>
@@ -295,11 +300,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="bankTransactionNo != null and bankTransactionNo != ''">
and r.bank_transaction_no like concat('%', #{bankTransactionNo}, '%')
</if>
<!-- 收款时间精确到时分秒:入参为 yyyy-MM-dd HH:mm:ss 直接比较;
兼容客户余额页传入的纯日期 yyyy-MM-dd(开始补 00:00:00、结束补 23:59:59) -->
<if test="params != null and params.beginTime != null and params.beginTime != ''">
and date_format(r.received_at,'%y%m%d') &gt;= date_format(#{params.beginTime},'%y%m%d')
and r.received_at &gt;= concat(#{params.beginTime},
case when char_length(#{params.beginTime}) = 10 then ' 00:00:00' else '' end)
</if>
<if test="params != null and params.endTime != null and params.endTime != ''">
and date_format(r.received_at,'%y%m%d') &lt;= date_format(#{params.endTime},'%y%m%d')
and r.received_at &lt;= concat(#{params.endTime},
case when char_length(#{params.endTime}) = 10 then ' 23:59:59' else '' end)
</if>
</where>
order by r.received_at desc, r.id desc