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

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
@@ -949,6 +949,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where bill_id = #{billId}
</update>
<update id="refreshPayTotalFromFees">
update prc_order_bill o
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 = o.bill_id
set o.pay_total = ifnull(s.total, 0),
o.update_time = sysdate()
where o.bill_id in
<foreach collection="billIds" item="billId" open="(" separator="," close=")">#{billId}</foreach>
</update>
<update id="updateOrderBillAmounts">
update prc_order_bill
set surcharge_amount = #{surchargeAmount},
@@ -65,6 +65,25 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
limit 1
</select>
<update id="bindPayBillId">
update prc_pay_bill_fee f
inner join prc_pay_bill b on b.bill_id = f.bill_id
set f.pay_bill_id = b.pay_bill_id
where (f.pay_bill_id is null or f.pay_bill_id = '')
and f.bill_id in
<foreach collection="billIds" item="billId" open="(" separator="," close=")">#{billId}</foreach>
</update>
<select id="selectBillIdsByLadingFee" resultType="String">
select distinct bill_id
from prc_pay_bill_fee
where fee_source = 'LADING'
and sc_id = #{feeId}
and ifnull(is_deleted, '0') = '0'
and bill_id is not null
and bill_id != ''
</select>
<update id="markLadingFeeDeleted">
update prc_pay_bill_fee
set is_deleted = '1'
@@ -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>
@@ -35,6 +35,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and ifnull(is_del, '0') = '0'
</select>
<select id="selectByExactName" resultMap="PrcSurchargeResult">
<include refid="selectPrcSurchargeVo"/>
where ifnull(is_del, '0') = '0'
and sc_name = #{scName}
and lower(ifnull(ss_code, '')) &lt;&gt; 'vd'
</select>
<select id="selectPrcSurchargeList" parameterType="PrcSurcharge" resultMap="PrcSurchargeResult">
<include refid="selectPrcSurchargeVo"/>
<where>
@@ -10,21 +10,12 @@
left join srv_bill_air a on a.bill_code = f.bill_code
left join prc_surcharge sc on sc.sc_id = f.fee_type and ifnull(sc.is_del, '0') = '0'
where f.del_flag = '0'
and f.alloc_flag = '1'
and f.bill_fee_status = '0'
and f.bill_code in
<foreach collection="billCodes" item="code" open="(" separator="," close=")">#{code}</foreach>
order by f.bill_code, f.id
</select>
<select id="selectLadingWeight" resultType="com.bms.price.airbill.domain.SrvBillAirAllocFee">
select a.bill_code as billCode, a.actual_weight as actualWeight, fl.band_box_weight as bandBoxWeight
from srv_bill_air a
left join srv_bill_air_flight fl on fl.bill_code = a.bill_code
where a.bill_code in
<foreach collection="billCodes" item="code" open="(" separator="," close=")">#{code}</foreach>
</select>
<select id="selectOrders" resultType="com.bms.price.airbill.domain.SrvBillAirAllocOrder">
select trim(e.air_no_old) as billCode, e.order_no as orderNo, e.bill_id as billId,
case
@@ -50,10 +41,11 @@
<update id="markAllocated">
update srv_bill_air_fee
set bill_fee_status = '1',
alloc_flag = '1',
alloc_dim = '2',
update_by = #{updateBy},
update_time = #{updateTime}
where del_flag = '0'
and alloc_flag = '1'
and bill_fee_status = '0'
and id in
<foreach collection="ids" item="id" open="(" separator="," close=")">#{id}</foreach>
@@ -16,6 +16,53 @@
order by f.id
</select>
<sql id="roleFeeDataScope">
<if test="params != null and params.dataScope != null and params.dataScope != ''">
AND EXISTS (
SELECT 1 FROM sys_user su
WHERE su.del_flag = '0'
AND su.user_name COLLATE utf8mb4_general_ci = f.create_by COLLATE utf8mb4_general_ci
${params.dataScope}
)
</if>
</sql>
<select id="selectRoleFees" parameterType="com.bms.price.airbill.domain.SrvBillAirRoleFeeQuery" resultType="com.bms.price.airbill.domain.SrvBillAirFee">
select f.id, f.bill_code as billCode, f.fee_type as feeType, sc.sc_name as feeName,
f.fee_level as feeLevel, f.fee_scene as feeScene, f.bill_fee_status as billFeeStatus,
f.alloc_flag as allocFlag, f.alloc_dim as allocDim, f.price, f.currency, f.remark,
f.create_by as createBy, f.create_time as createTime, f.update_by as updateBy,
f.update_time as updateTime, f.del_flag as delFlag
from srv_bill_air_fee f
left join prc_surcharge sc on sc.sc_id = f.fee_type and ifnull(sc.is_del, '0') = '0'
where f.del_flag = '0'
and ifnull(f.bill_fee_status, '0') &lt;&gt; '2'
and f.fee_scene = #{feeScene}
and f.bill_code in
<foreach collection="billCodes" item="code" open="(" separator="," close=")">#{code}</foreach>
<include refid="roleFeeDataScope"/>
order by f.bill_code, f.id
</select>
<select id="selectRoleFeeVisible" resultType="com.bms.price.airbill.domain.SrvBillAirFee">
select f.id, f.bill_code as billCode, f.fee_scene as feeScene, f.create_by as createBy
from srv_bill_air_fee f
where f.id = #{id}
and f.bill_code = #{billCode}
and f.del_flag = '0'
and ifnull(f.bill_fee_status, '0') &lt;&gt; '2'
and f.fee_scene = #{query.feeScene}
<if test="query.params != null and query.params.dataScope != null and query.params.dataScope != ''">
AND EXISTS (
SELECT 1 FROM sys_user su
WHERE su.del_flag = '0'
AND su.user_name COLLATE utf8mb4_general_ci = f.create_by COLLATE utf8mb4_general_ci
${query.params.dataScope}
)
</if>
limit 1
</select>
<select id="selectLive" resultType="com.bms.price.airbill.domain.SrvBillAirFee">
select f.id, f.bill_code as billCode, f.fee_type as feeType, sc.sc_name as feeName,
f.fee_level as feeLevel, f.bill_fee_status as billFeeStatus,
@@ -32,10 +79,10 @@
<insert id="insertFee" useGeneratedKeys="true" keyProperty="id">
insert into srv_bill_air_fee (
bill_code, fee_type, fee_level, bill_fee_status, alloc_flag, alloc_dim, price, currency, remark,
bill_code, fee_type, fee_level, fee_scene, bill_fee_status, alloc_flag, alloc_dim, price, currency, remark,
create_by, create_time, update_by, update_time, del_flag
) values (
#{billCode}, #{feeType}, #{feeLevel}, '0', #{allocFlag}, #{allocDim}, #{price}, #{currency}, #{remark},
#{billCode}, #{feeType}, #{feeLevel}, #{feeScene}, '0', #{allocFlag}, #{allocDim}, #{price}, #{currency}, #{remark},
#{createBy}, #{createTime}, #{updateBy}, #{updateTime}, '0'
)
</insert>
@@ -26,6 +26,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="actualVolume" column="actual_volume"/>
<result property="volumeWeight" column="volume_weight"/>
<result property="firstLandingTime" column="first_landing_time"/>
<result property="boardNo" column="board_no"/>
<result property="bandBoxWeight" column="band_box_weight"/>
<result property="airNo" column="air_no"/>
<result property="actualAirNo" column="actual_air_no"/>
<result property="airCompanyAgent" column="air_ompany_agent"/>
@@ -33,6 +35,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="declareCode" column="declare_code"/>
<result property="clearanceCode" column="clearance_code"/>
<result property="qingguanAgent" column="qingguan_agent"/>
<result property="clearanceOpCode" column="clearance_op_code"/>
<result property="stockAddr" column="stock_addr"/>
<result property="shippingDate" column="shipping_date"/>
<result property="startTime" column="start_time"/>
@@ -66,6 +69,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
a.actual_volume,
a.volume_weight,
fl.first_landing_time,
fl.board_no,
fl.band_box_weight,
fl.air_no,
fl.actual_air_no,
fl.air_ompany_agent,
@@ -73,6 +78,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
o.declare_code,
o.clearance_code,
o.qingguan_agent,
o.clearance_op_code,
o.stock_addr,
t.shipping_date,
t.start_time,