登记收款选择账单直接核销,附件上传支持拖动上传
This commit is contained in:
@@ -10,6 +10,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="arBillId" column="ar_bill_id"/>
|
||||
<result property="billNo" column="bill_no"/>
|
||||
<result property="customerId" column="customer_id"/>
|
||||
<result property="receiptId" column="receipt_id"/>
|
||||
<result property="accountId" column="account_id"/>
|
||||
<result property="currency" column="currency"/>
|
||||
<result property="writeoffAmount" column="writeoff_amount"/>
|
||||
@@ -28,7 +29,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectColumns">
|
||||
select w.writeoff_id, w.writeoff_no, w.ar_bill_id, w.bill_no, w.customer_id, w.account_id,
|
||||
select w.writeoff_id, w.writeoff_no, w.ar_bill_id, w.bill_no, w.customer_id, w.receipt_id, w.account_id,
|
||||
w.currency, w.writeoff_amount, w.balance_flow_id, w.reverse_flow_id,
|
||||
w.writeoff_date, w.status, w.remark, w.create_by, w.create_time,
|
||||
w.cancel_by, w.cancel_time, w.cancel_remark,
|
||||
@@ -40,11 +41,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<insert id="insertArBalanceWriteoff" parameterType="ArBalanceWriteoff"
|
||||
useGeneratedKeys="true" keyProperty="writeoffId">
|
||||
insert into ar_balance_writeoff (
|
||||
writeoff_no, ar_bill_id, bill_no, customer_id, account_id, currency,
|
||||
writeoff_no, ar_bill_id, bill_no, customer_id, receipt_id, account_id, currency,
|
||||
writeoff_amount, balance_flow_id, reverse_flow_id, writeoff_date,
|
||||
status, remark, create_by, create_time
|
||||
) values (
|
||||
#{writeoffNo}, #{arBillId}, #{billNo}, #{customerId}, #{accountId}, #{currency},
|
||||
#{writeoffNo}, #{arBillId}, #{billNo}, #{customerId}, #{receiptId}, #{accountId}, #{currency},
|
||||
#{writeoffAmount}, #{balanceFlowId}, #{reverseFlowId}, #{writeoffDate},
|
||||
#{status}, #{remark}, #{createBy}, sysdate()
|
||||
)
|
||||
|
||||
@@ -392,6 +392,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
where id = #{id} and status = 'PENDING' and del_flag = '0'
|
||||
</update>
|
||||
|
||||
<!-- 反核销联动:仅回写分配口径金额与收款类型,客户余额/额度不在此变动 -->
|
||||
<update id="updateReceiptAllocation" parameterType="com.bms.customer.customermoney.domain.CustomerReceipt">
|
||||
update ctr_customer_receipt
|
||||
set allocated_amount = #{allocatedAmount},
|
||||
unallocated_amount = #{unallocatedAmount},
|
||||
receipt_type = #{receiptType},
|
||||
update_by = #{updateBy},
|
||||
update_time = now()
|
||||
where id = #{id} and status = 'CONFIRMED' and del_flag = '0'
|
||||
</update>
|
||||
|
||||
<!-- ================= 余额流水 ================= -->
|
||||
<resultMap type="com.bms.customer.customermoney.domain.CustomerBalanceFlow" id="CustomerBalanceFlowResult">
|
||||
<id property="id" column="id" />
|
||||
|
||||
@@ -0,0 +1,89 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.bms.customer.customermoney.mapper.ReceiptWriteoffPlanMapper">
|
||||
|
||||
<resultMap id="ReceiptWriteoffPlanResult" type="com.bms.customer.customermoney.domain.ReceiptWriteoffPlan">
|
||||
<id property="planId" column="plan_id" />
|
||||
<result property="receiptId" column="receipt_id" />
|
||||
<result property="arBillId" column="ar_bill_id" />
|
||||
<result property="billNo" column="bill_no" />
|
||||
<result property="customerId" column="customer_id" />
|
||||
<result property="currency" column="currency" />
|
||||
<result property="writeoffAmount" column="writeoff_amount" />
|
||||
<result property="status" column="status" />
|
||||
<result property="writeoffId" column="writeoff_id" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="writeoffDate" column="writeoff_date" />
|
||||
<result property="billName" column="bill_name" />
|
||||
<result property="totalAmount" column="total_amount" />
|
||||
<result property="writtenOffAmount" column="written_off_amount"/>
|
||||
<result property="unwrittenAmount" column="unwritten_amount" />
|
||||
<result property="billStatus" column="bill_status" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectColumns">
|
||||
select p.plan_id, p.receipt_id, p.ar_bill_id, p.bill_no, p.customer_id, p.currency,
|
||||
p.writeoff_amount, p.status, p.writeoff_id, p.remark,
|
||||
p.create_by, p.create_time, p.update_by, p.update_time,
|
||||
w.writeoff_date,
|
||||
b.bill_name, b.total_amount, b.written_off_amount, b.unwritten_amount,
|
||||
b.status as bill_status
|
||||
from ctr_receipt_writeoff_plan p
|
||||
left join ar_balance_writeoff w on w.writeoff_id = p.writeoff_id
|
||||
left join ar_bill b on b.ar_bill_id = p.ar_bill_id
|
||||
</sql>
|
||||
|
||||
<insert id="insertPlan" parameterType="com.bms.customer.customermoney.domain.ReceiptWriteoffPlan"
|
||||
useGeneratedKeys="true" keyProperty="planId">
|
||||
insert into ctr_receipt_writeoff_plan (
|
||||
receipt_id, ar_bill_id, bill_no, customer_id, currency, writeoff_amount,
|
||||
status, writeoff_id, remark, create_by, create_time, del_flag
|
||||
) values (
|
||||
#{receiptId}, #{arBillId}, #{billNo}, #{customerId}, #{currency}, #{writeoffAmount},
|
||||
#{status}, #{writeoffId}, #{remark}, #{createBy}, sysdate(), '0'
|
||||
)
|
||||
</insert>
|
||||
|
||||
<select id="selectByReceiptId" resultMap="ReceiptWriteoffPlanResult">
|
||||
<include refid="selectColumns"/>
|
||||
where p.receipt_id = #{receiptId} and p.del_flag = '0'
|
||||
order by p.plan_id asc
|
||||
</select>
|
||||
|
||||
<update id="updateEffective">
|
||||
update ctr_receipt_writeoff_plan
|
||||
set status = 'EFFECTIVE',
|
||||
writeoff_id = #{writeoffId},
|
||||
update_by = #{updateBy},
|
||||
update_time = sysdate()
|
||||
where plan_id = #{planId} and status = 'PENDING' and del_flag = '0'
|
||||
</update>
|
||||
|
||||
<update id="cancelPendingByReceiptId">
|
||||
update ctr_receipt_writeoff_plan
|
||||
set status = 'CANCELLED',
|
||||
update_by = #{updateBy},
|
||||
update_time = sysdate()
|
||||
where receipt_id = #{receiptId} and status = 'PENDING' and del_flag = '0'
|
||||
</update>
|
||||
|
||||
<select id="selectEffectiveByWriteoffId" resultMap="ReceiptWriteoffPlanResult">
|
||||
<include refid="selectColumns"/>
|
||||
where p.writeoff_id = #{writeoffId} and p.status = 'EFFECTIVE' and p.del_flag = '0'
|
||||
limit 1
|
||||
</select>
|
||||
|
||||
<update id="updateReversedByWriteoffId">
|
||||
update ctr_receipt_writeoff_plan
|
||||
set status = 'REVERSED',
|
||||
update_by = #{updateBy},
|
||||
update_time = sysdate()
|
||||
where writeoff_id = #{writeoffId} and status = 'EFFECTIVE' and del_flag = '0'
|
||||
</update>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user