提单费用均摊处理
This commit is contained in:
@@ -11,7 +11,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="feeType" column="fee_type" />
|
||||
<result property="feeName" column="fee_name" />
|
||||
<result property="scId" column="sc_id" />
|
||||
<result property="feeLevel" column="fee_level" />
|
||||
<result property="amount" column="amount" />
|
||||
<result property="feeSource" column="fee_source" />
|
||||
<result property="currency" column="currency" />
|
||||
<result property="roundMode" column="round_mode" />
|
||||
<result property="remark" column="remark" />
|
||||
@@ -21,8 +23,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</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,
|
||||
source_id, is_deleted, create_time
|
||||
select fee_id, bill_id, pay_bill_id, fee_type, fee_name, sc_id, fee_level, amount, currency, round_mode, remark,
|
||||
fee_source, source_id, is_deleted, create_time
|
||||
from prc_pay_bill_fee
|
||||
where bill_id = #{billId}
|
||||
and is_deleted = '0'
|
||||
@@ -31,25 +33,46 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
|
||||
<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,
|
||||
source_id, is_deleted, create_time
|
||||
fee_id, bill_id, pay_bill_id, fee_type, fee_name, sc_id, fee_level, amount, currency, round_mode, remark,
|
||||
fee_source, source_id, is_deleted, create_time
|
||||
) values (
|
||||
#{feeId}, #{billId}, #{payBillId}, #{feeType}, #{feeName}, #{scId}, #{amount}, #{currency}, #{roundMode}, #{remark},
|
||||
#{sourceId}, ifnull(#{isDeleted}, '0'), sysdate()
|
||||
#{feeId}, #{billId}, #{payBillId}, #{feeType}, #{feeName}, #{scId}, #{feeLevel}, #{amount}, #{currency}, #{roundMode}, #{remark},
|
||||
ifnull(#{feeSource}, 'CALC'), #{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,
|
||||
source_id, is_deleted, create_time
|
||||
fee_id, bill_id, pay_bill_id, fee_type, fee_name, sc_id, fee_level, amount, currency, round_mode, remark,
|
||||
fee_source, 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}, #{item.sourceId}, ifnull(#{item.isDeleted}, '0'), sysdate())
|
||||
(#{item.feeId}, #{item.billId}, #{item.payBillId}, #{item.feeType}, #{item.feeName}, #{item.scId}, #{item.feeLevel},
|
||||
#{item.amount}, #{item.currency}, #{item.roundMode}, #{item.remark}, ifnull(#{item.feeSource}, 'CALC'),
|
||||
#{item.sourceId}, ifnull(#{item.isDeleted}, '0'), sysdate())
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<select id="selectBilledOrderNo" resultType="String">
|
||||
select e.order_no
|
||||
from prc_pay_bill_fee f
|
||||
inner join prc_order_bill_ext e on e.bill_id = f.bill_id
|
||||
where f.fee_source = 'LADING'
|
||||
and f.sc_id = #{feeId}
|
||||
and ifnull(f.is_deleted, '0') = '0'
|
||||
and e.is_meet = 1
|
||||
order by e.order_no
|
||||
limit 1
|
||||
</select>
|
||||
|
||||
<update id="markLadingFeeDeleted">
|
||||
update prc_pay_bill_fee
|
||||
set is_deleted = '1'
|
||||
where fee_source = 'LADING'
|
||||
and sc_id = #{feeId}
|
||||
and ifnull(is_deleted, '0') = '0'
|
||||
</update>
|
||||
|
||||
<delete id="deleteByBillId" parameterType="String">
|
||||
delete from prc_pay_bill_fee
|
||||
where bill_id = #{billId}
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
<?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.price.mapper.SrvBillAirAllocMapper">
|
||||
|
||||
<select id="selectPendingFees" resultType="com.bms.price.airbill.domain.SrvBillAirAllocFee">
|
||||
select f.id, f.bill_code as billCode, a.guid as ladingId, f.fee_level as feeLevel,
|
||||
f.bill_fee_status as billFeeStatus, sc.sc_name as feeName, f.price, f.currency,
|
||||
f.alloc_dim as allocDim
|
||||
from srv_bill_air_fee f
|
||||
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
|
||||
when ifnull(b.charge_weight, 0) > 0 then b.charge_weight
|
||||
when ifnull(b.actual_weight, 0) > 0 then b.actual_weight
|
||||
when ifnull(b.receive_weight, 0) > 0 then b.receive_weight
|
||||
else 0
|
||||
end as chargeWeight
|
||||
from prc_order_bill_ext e
|
||||
inner join prc_order_bill b on b.bill_id = e.bill_id
|
||||
where trim(e.air_no_old) in
|
||||
<foreach collection="billCodes" item="code" open="(" separator="," close=")">#{code}</foreach>
|
||||
order by e.air_no_old, e.order_no, e.bill_id
|
||||
</select>
|
||||
|
||||
<select id="selectPayBills" resultType="com.bms.price.domain.PrcPayBill">
|
||||
select bill_id as billId, pay_bill_id as payBillId
|
||||
from prc_pay_bill
|
||||
where bill_id in
|
||||
<foreach collection="billIds" item="id" open="(" separator="," close=")">#{id}</foreach>
|
||||
</select>
|
||||
|
||||
<update id="markAllocated">
|
||||
update srv_bill_air_fee
|
||||
set bill_fee_status = '1',
|
||||
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>
|
||||
</update>
|
||||
</mapper>
|
||||
@@ -12,6 +12,7 @@
|
||||
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'
|
||||
and ifnull(f.bill_fee_status, '0') <> '2'
|
||||
order by f.id
|
||||
</select>
|
||||
|
||||
@@ -26,6 +27,7 @@
|
||||
where f.id = #{id}
|
||||
and f.bill_code = #{billCode}
|
||||
and f.del_flag = '0'
|
||||
and ifnull(f.bill_fee_status, '0') <> '2'
|
||||
</select>
|
||||
|
||||
<insert id="insertFee" useGeneratedKeys="true" keyProperty="id">
|
||||
@@ -52,6 +54,30 @@
|
||||
where id = #{id}
|
||||
and bill_code = #{billCode}
|
||||
and del_flag = '0'
|
||||
and ifnull(bill_fee_status, '0') not in ('1', '3')
|
||||
</update>
|
||||
|
||||
<update id="confirmFee">
|
||||
update srv_bill_air_fee
|
||||
set bill_fee_status = '3',
|
||||
update_by = #{updateBy},
|
||||
update_time = #{updateTime}
|
||||
where id = #{id}
|
||||
and bill_code = #{billCode}
|
||||
and del_flag = '0'
|
||||
and bill_fee_status = '1'
|
||||
</update>
|
||||
|
||||
<update id="voidFee">
|
||||
update srv_bill_air_fee
|
||||
set del_flag = '1',
|
||||
bill_fee_status = '2',
|
||||
update_by = #{updateBy},
|
||||
update_time = #{updateTime}
|
||||
where id = #{id}
|
||||
and bill_code = #{billCode}
|
||||
and del_flag = '0'
|
||||
and bill_fee_status in ('1', '3')
|
||||
</update>
|
||||
|
||||
<update id="deleteFee">
|
||||
@@ -62,6 +88,7 @@
|
||||
where id = #{id}
|
||||
and bill_code = #{billCode}
|
||||
and del_flag = '0'
|
||||
and ifnull(bill_fee_status, '0') not in ('1', '3')
|
||||
</update>
|
||||
|
||||
<insert id="insertLog" useGeneratedKeys="true" keyProperty="logId">
|
||||
|
||||
Reference in New Issue
Block a user