提单费用调整

This commit is contained in:
liuminghui
2026-11-10 15:21:03 +08:00
parent e6a9fcf0a2
commit da9efc422e
16 changed files with 911 additions and 170 deletions
@@ -47,7 +47,7 @@
e.supplier_name as supplierName,
(select group_concat(concat(ifnull(nullif(trim(f.fee_name), ''), ifnull(f.fee_type, '费用')), ' ', format(f.amount, 2))
order by field(f.fee_type, 'BASIC_FREIGHT', 'REGISTRATION_FEE', 'SURCHARGE', 'REFUND'), f.fee_id separator ';')
from prc_pay_bill_fee f where f.bill_id = o.bill_id) as feeText,
from prc_pay_bill_fee f where f.bill_id = o.bill_id and f.is_deleted = '0') as feeText,
(select b.bill_no from pay_bill_line l
inner join pay_bill b on b.bill_id = l.bill_id
where l.order_bill_id = o.bill_id and b.status <> 'VOID'
@@ -81,9 +81,11 @@
</select>
<select id="selectOrderFees" resultType="com.bms.price.domain.PrcPayBillFee">
select fee_id as feeId, bill_id as billId, fee_name as feeName, amount, currency, fee_source as feeSource
select fee_id as feeId, bill_id as billId, fee_name as feeName, amount, currency, fee_source as feeSource,
source_id as sourceId, is_deleted as isDeleted
from prc_pay_bill_fee
where bill_id in
where is_deleted = '0'
and bill_id in
<foreach collection="billIds" item="id" open="(" separator="," close=")">#{id}</foreach>
order by bill_id, fee_id
</select>
@@ -15,31 +15,38 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="currency" column="currency" />
<result property="roundMode" column="round_mode" />
<result property="remark" column="remark" />
<result property="sourceId" column="source_id" />
<result property="isDeleted" column="is_deleted" />
<result property="createTime" column="create_time" />
</resultMap>
<select id="selectByBillId" parameterType="String" resultMap="PrcPayBillFeeResult">
select fee_id, bill_id, pay_bill_id, fee_type, fee_name, sc_id, amount, currency, round_mode, remark, create_time
select fee_id, bill_id, pay_bill_id, fee_type, fee_name, sc_id, amount, currency, round_mode, remark,
source_id, is_deleted, create_time
from prc_pay_bill_fee
where bill_id = #{billId}
and is_deleted = '0'
order by field(fee_type, 'BASIC_FREIGHT', 'REGISTRATION_FEE', 'SURCHARGE', 'REFUND'), fee_id
</select>
<insert id="insertPrcPayBillFee" parameterType="PrcPayBillFee">
insert into prc_pay_bill_fee (
fee_id, bill_id, pay_bill_id, fee_type, fee_name, sc_id, amount, currency, round_mode, remark, create_time
fee_id, bill_id, pay_bill_id, fee_type, fee_name, sc_id, amount, currency, round_mode, remark,
source_id, is_deleted, create_time
) values (
#{feeId}, #{billId}, #{payBillId}, #{feeType}, #{feeName}, #{scId}, #{amount}, #{currency}, #{roundMode}, #{remark}, sysdate()
#{feeId}, #{billId}, #{payBillId}, #{feeType}, #{feeName}, #{scId}, #{amount}, #{currency}, #{roundMode}, #{remark},
#{sourceId}, ifnull(#{isDeleted}, '0'), sysdate()
)
</insert>
<insert id="insertBatch" parameterType="java.util.List">
insert into prc_pay_bill_fee (
fee_id, bill_id, pay_bill_id, fee_type, fee_name, sc_id, amount, currency, round_mode, remark, create_time
fee_id, bill_id, pay_bill_id, fee_type, fee_name, sc_id, amount, currency, round_mode, remark,
source_id, is_deleted, create_time
) values
<foreach collection="list" item="item" separator=",">
(#{item.feeId}, #{item.billId}, #{item.payBillId}, #{item.feeType}, #{item.feeName}, #{item.scId}, #{item.amount},
#{item.currency}, #{item.roundMode}, #{item.remark}, sysdate())
#{item.currency}, #{item.roundMode}, #{item.remark}, #{item.sourceId}, ifnull(#{item.isDeleted}, '0'), sysdate())
</foreach>
</insert>
@@ -3,31 +3,37 @@
<mapper namespace="com.bms.price.mapper.SrvBillAirFeeMapper">
<select id="selectByBillCode" resultType="com.bms.price.airbill.domain.SrvBillAirFee">
select id, bill_code as billCode, fee_type as feeType, price, currency, remark,
create_by as createBy, create_time as createTime, update_by as updateBy,
update_time as updateTime, del_flag as delFlag
from srv_bill_air_fee
where bill_code = #{billCode}
and del_flag = '0'
order by id
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,
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.bill_code = #{billCode}
and f.del_flag = '0'
order by f.id
</select>
<select id="selectLive" resultType="com.bms.price.airbill.domain.SrvBillAirFee">
select id, bill_code as billCode, fee_type as feeType, price, currency, remark,
create_by as createBy, create_time as createTime, update_by as updateBy,
update_time as updateTime, del_flag as delFlag
from srv_bill_air_fee
where id = #{id}
and bill_code = #{billCode}
and del_flag = '0'
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,
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.id = #{id}
and f.bill_code = #{billCode}
and f.del_flag = '0'
</select>
<insert id="insertFee" useGeneratedKeys="true" keyProperty="id">
insert into srv_bill_air_fee (
bill_code, fee_type, price, currency, remark,
bill_code, fee_type, fee_level, bill_fee_status, alloc_flag, alloc_dim, price, currency, remark,
create_by, create_time, update_by, update_time, del_flag
) values (
#{billCode}, #{feeType}, #{price}, #{currency}, #{remark},
#{billCode}, #{feeType}, #{feeLevel}, '0', #{allocFlag}, #{allocDim}, #{price}, #{currency}, #{remark},
#{createBy}, #{createTime}, #{updateBy}, #{updateTime}, '0'
)
</insert>
@@ -35,6 +41,9 @@
<update id="updateFee">
update srv_bill_air_fee
set fee_type = #{feeType},
fee_level = #{feeLevel},
alloc_flag = #{allocFlag},
alloc_dim = #{allocDim},
price = #{price},
currency = #{currency},
remark = #{remark},