新增提单管理和提单计费页面

This commit is contained in:
liuminghui
2026-11-11 16:36:17 +08:00
parent 7869205afc
commit efd92b5663
47 changed files with 1712 additions and 369 deletions
@@ -96,6 +96,39 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
update_time = sysdate()
</insert>
<insert id="insertMissingPayBills">
insert into prc_pay_bill (
pay_bill_id, bill_id, currency, pay_total,
belong_saler, belong_saler_code, settlement_man, settlement_man_code,
create_by, create_time, update_by, update_time
)
select replace(uuid(), '-', ''), o.bill_id, ifnull(nullif(o.currency, ''), 'CNY'), 0,
o.belong_saler, o.belong_saler_code, o.settlement_man, o.settlement_man_code,
#{operator}, sysdate(), #{operator}, sysdate()
from prc_order_bill o
where o.bill_id in
<foreach collection="billIds" item="billId" open="(" separator="," close=")">#{billId}</foreach>
and not exists (
select 1 from prc_pay_bill b where b.bill_id = o.bill_id
)
</insert>
<update id="refreshPayTotal">
update prc_pay_bill b
left join (
select bill_id, ifnull(sum(amount), 0) as total
from prc_pay_bill_fee
where ifnull(is_deleted, '0') = '0'
and bill_id in
<foreach collection="billIds" item="billId" open="(" separator="," close=")">#{billId}</foreach>
group by bill_id
) s on s.bill_id = b.bill_id
set b.pay_total = ifnull(s.total, 0),
b.update_time = sysdate()
where b.bill_id in
<foreach collection="billIds" item="billId" open="(" separator="," close=")">#{billId}</foreach>
</update>
<delete id="deleteByBillId" parameterType="String">
delete from prc_pay_bill where bill_id = #{billId}
</delete>