From c62cee9d60f0e7dbc319b410f28397ef4ff759f3 Mon Sep 17 00:00:00 2001
From: wujianwei <wjw@11.com>
Date: 星期一, 22 十二月 2025 15:59:49 +0800
Subject: [PATCH] 应收费用日志
---
service/src/main/resources/mapper/cwgl/PendingSettlementBusinessMapper.xml | 46 ++++++++++++++++++++++++++++++++++------------
1 files changed, 34 insertions(+), 12 deletions(-)
diff --git a/service/src/main/resources/mapper/cwgl/PendingSettlementBusinessMapper.xml b/service/src/main/resources/mapper/cwgl/PendingSettlementBusinessMapper.xml
index da9ee00..63b954d 100644
--- a/service/src/main/resources/mapper/cwgl/PendingSettlementBusinessMapper.xml
+++ b/service/src/main/resources/mapper/cwgl/PendingSettlementBusinessMapper.xml
@@ -60,10 +60,11 @@
<result property="confirmedTotalCost" column="confirmed_total_cost" />
<result property="isIncomeMatched" column="is_income_matched" />
<result property="isCostMatched" column="is_cost_matched" />
+ <result property="relatedBillStatus" column="related_bill_status" />
</resultMap>
<sql id="selectPendingSettlementBusinessVo">
- select thisTab.id, thisTab.booking_no, thisTab.customer_id, thisTab.carrier_id, thisTab.project_name, thisTab.dispatch_no, thisTab.created_time, thisTab.transport_mode, thisTab.product_id, thisTab.customer_name, thisTab.operation_mode, thisTab.carrier_name, thisTab.departure_location, thisTab.arrival_location, thisTab.vehicle_id, thisTab.license_plate_number, thisTab.vehicle_type, thisTab.main_driver, thisTab.assistant_driver, thisTab.point_num, thisTab.business_contact, thisTab.estimated_total_income, thisTab.estimated_total_cost, thisTab.estimated_profit, thisTab.electronic_lock, thisTab.re_weighing_weight, thisTab.quantity, thisTab.actual_departure_time, thisTab.required_arrival_time, thisTab.actual_arrival_time, thisTab.be_return, thisTab.dispatch_quantity, thisTab.dispatch_weight, thisTab.dispatch_volume, thisTab.empty_mileage, thisTab.empty_fuel, thisTab.heavy_mileage, thisTab.heavy_fuel, thisTab.be_scheduled, thisTab.tracking_no, thisTab.seal_no, thisTab.schedule_no, thisTab.transport_status, thisTab.estimated_bill_id, thisTab.settlement_bill_id, thisTab.bill_id, thisTab.settlement_status, thisTab.create_time, thisTab.update_time, thisTab.is_create, thisTab.bill_name, thisTab.confirmed_total_income, thisTab.confirmed_total_cost, thisTab.is_income_matched, thisTab.is_cost_matched from pending_settlement_business AS thisTab
+ select thisTab.id, thisTab.booking_no, thisTab.customer_id, thisTab.carrier_id, thisTab.project_name, thisTab.dispatch_no, thisTab.created_time, thisTab.transport_mode, thisTab.product_id, thisTab.customer_name, thisTab.operation_mode, thisTab.carrier_name, thisTab.departure_location, thisTab.arrival_location, thisTab.vehicle_id, thisTab.license_plate_number, thisTab.vehicle_type, thisTab.main_driver, thisTab.assistant_driver, thisTab.point_num, thisTab.business_contact, thisTab.estimated_total_income, thisTab.estimated_total_cost, thisTab.estimated_profit, thisTab.electronic_lock, thisTab.re_weighing_weight, thisTab.quantity, thisTab.actual_departure_time, thisTab.required_arrival_time, thisTab.actual_arrival_time, thisTab.be_return, thisTab.dispatch_quantity, thisTab.dispatch_weight, thisTab.dispatch_volume, thisTab.empty_mileage, thisTab.empty_fuel, thisTab.heavy_mileage, thisTab.heavy_fuel, thisTab.be_scheduled, thisTab.tracking_no, thisTab.seal_no, thisTab.schedule_no, thisTab.transport_status, thisTab.estimated_bill_id, thisTab.settlement_bill_id, thisTab.bill_id, thisTab.settlement_status, thisTab.create_time, thisTab.update_time, thisTab.is_create, thisTab.bill_name, thisTab.confirmed_total_income, thisTab.confirmed_total_cost, thisTab.is_income_matched, thisTab.is_cost_matched, thisTab.related_bill_status from pending_settlement_business AS thisTab
</sql>
<sql id="selectPendingSettlementBusinessVoCount">
select count(0) from pending_settlement_business as thisTab
@@ -75,7 +76,6 @@
<if test="carrierId != null and carrierId != ''"> and thisTab.carrier_id = #{carrierId}</if>
<if test="projectName != null and projectName != ''"> and thisTab.project_name like concat('%', #{projectName}, '%')</if>
<if test="dispatchNo != null and dispatchNo != ''"> and thisTab.dispatch_no = #{dispatchNo}</if>
- <if test="createdTime != null "> and thisTab.created_time = #{createdTime}</if>
<if test="transportMode != null and transportMode != ''"> and thisTab.transport_mode = #{transportMode}</if>
<if test="productId != null and productId != ''"> and thisTab.product_id = #{productId}</if>
<if test="customerName != null and customerName != ''"> and thisTab.customer_name like concat('%', #{customerName}, '%')</if>
@@ -99,6 +99,7 @@
<if test="actualDepartureTimeBegin != null and actualDepartureTimeBegin != '' and actualDepartureTimeEnd != null and actualDepartureTimeEnd != ''"> and thisTab.actual_departure_time between #{actualDepartureTimeBegin} and #{actualDepartureTimeEnd}</if>
<if test="requiredArrivalTimeBegin != null and requiredArrivalTimeBegin != '' and requiredArrivalTimeEnd != null and requiredArrivalTimeEnd != ''"> and thisTab.required_arrival_time between #{requiredArrivalTimeBegin} and #{requiredArrivalTimeEnd}</if>
<if test="actualArrivalTimeBegin != null and actualArrivalTimeBegin != '' and actualArrivalTimeEnd != null and actualArrivalTimeEnd != ''"> and thisTab.actual_arrival_time between #{actualArrivalTimeBegin} and #{actualArrivalTimeEnd}</if>
+ <if test="createdTimeBegin != null and createdTimeBegin != '' and createdTimeEnd != null and createdTimeEnd != ''"> and thisTab.created_time between #{createdTimeBegin} and #{createdTimeEnd}</if>
<if test="beReturn != null and beReturn != ''"> and thisTab.be_return = #{beReturn}</if>
<if test="dispatchQuantity != null "> and thisTab.dispatch_quantity = #{dispatchQuantity}</if>
<if test="dispatchWeight != null "> and thisTab.dispatch_weight = #{dispatchWeight}</if>
@@ -409,11 +410,11 @@
<insert id="insertPendingSettlementBusinessBatch" parameterType="java.util.List">
insert into pending_settlement_business
<trim prefix="(" suffix=") values" suffixOverrides=",">
- booking_no,customer_id,carrier_id,project_name,dispatch_no,created_time,transport_mode,product_id,customer_name,operation_mode,carrier_name,departure_location,arrival_location,vehicle_id,license_plate_number,vehicle_type,main_driver,assistant_driver,point_num,business_contact,estimated_total_income,estimated_total_cost,estimated_profit,electronic_lock,re_weighing_weight,quantity,actual_departure_time,required_arrival_time,actual_arrival_time,be_return,dispatch_quantity,dispatch_weight,dispatch_volume,empty_mileage,empty_fuel,heavy_mileage,heavy_fuel,be_scheduled,tracking_no,seal_no,schedule_no,transport_status,estimated_bill_id,settlement_bill_id,settlement_status,create_time,update_time,is_create,
+ booking_no,customer_id,carrier_id,project_name,dispatch_no,created_time,transport_mode,product_id,customer_name,operation_mode,carrier_name,departure_location,arrival_location,vehicle_id,license_plate_number,vehicle_type,main_driver,assistant_driver,point_num,business_contact,estimated_total_income,estimated_total_cost,estimated_profit,electronic_lock,re_weighing_weight,quantity,actual_departure_time,required_arrival_time,actual_arrival_time,be_return,dispatch_quantity,dispatch_weight,dispatch_volume,empty_mileage,empty_fuel,heavy_mileage,heavy_fuel,be_scheduled,tracking_no,seal_no,schedule_no,transport_status,estimated_bill_id,settlement_bill_id,settlement_status,create_time,update_time,is_create,is_income_matched,is_cost_matched,
</trim>
<foreach item="item" index="index" collection="list" separator=",">
<trim prefix="(" suffix=") " suffixOverrides=",">
- #{item.bookingNo},#{item.customerId},#{item.carrierId},#{item.projectName},#{item.dispatchNo},#{item.createdTime},#{item.transportMode},#{item.productId},#{item.customerName},#{item.operationMode},#{item.carrierName},#{item.departureLocation},#{item.arrivalLocation},#{item.vehicleId},#{item.licensePlateNumber},#{item.vehicleType},#{item.mainDriver},#{item.assistantDriver},#{item.pointNum},#{item.businessContact},#{item.estimatedTotalIncome},#{item.estimatedTotalCost},#{item.estimatedProfit},#{item.electronicLock},#{item.reWeighingWeight},#{item.quantity},#{item.actualDepartureTime},#{item.requiredArrivalTime},#{item.actualArrivalTime},#{item.beReturn},#{item.dispatchQuantity},#{item.dispatchWeight},#{item.dispatchVolume},#{item.emptyMileage},#{item.emptyFuel},#{item.heavyMileage},#{item.heavyFuel},#{item.beScheduled},#{item.trackingNo},#{item.sealNo},#{item.scheduleNo},#{item.transportStatus},#{item.estimatedBillId},#{item.settlementBillId},#{item.settlementStatus},#{item.createTime},#{item.updateTime},#{item.isCreate},
+ #{item.bookingNo},#{item.customerId},#{item.carrierId},#{item.projectName},#{item.dispatchNo},#{item.createdTime},#{item.transportMode},#{item.productId},#{item.customerName},#{item.operationMode},#{item.carrierName},#{item.departureLocation},#{item.arrivalLocation},#{item.vehicleId},#{item.licensePlateNumber},#{item.vehicleType},#{item.mainDriver},#{item.assistantDriver},#{item.pointNum},#{item.businessContact},#{item.estimatedTotalIncome},#{item.estimatedTotalCost},#{item.estimatedProfit},#{item.electronicLock},#{item.reWeighingWeight},#{item.quantity},#{item.actualDepartureTime},#{item.requiredArrivalTime},#{item.actualArrivalTime},#{item.beReturn},#{item.dispatchQuantity},#{item.dispatchWeight},#{item.dispatchVolume},#{item.emptyMileage},#{item.emptyFuel},#{item.heavyMileage},#{item.heavyFuel},#{item.beScheduled},#{item.trackingNo},#{item.sealNo},#{item.scheduleNo},#{item.transportStatus},#{item.estimatedBillId},#{item.settlementBillId},#{item.settlementStatus},#{item.createTime},#{item.updateTime},#{item.isCreate},#{item.isIncomeMatched},#{item.isCostMatched},
</trim>
</foreach>
</insert>
@@ -531,7 +532,7 @@
</foreach>
</update>
<update id="updeteCwData">
- update pending_settlement_business set IS_SYNC = 1
+ update tms_shipment set IS_SYNC = 1
where ID in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
@@ -539,18 +540,32 @@
</update>
<update id="updatePendingSettlementBusinessIsCreate">
-
UPDATE pending_settlement_business
- SET is_create = 1 ,bill_id = #{id},bill_name = #{billName}
+ SET
+ is_create = 1,
+ bill_id = #{id},
+ bill_name = #{billName},
+ related_bill_status = 1
WHERE dispatch_no IN
<foreach item="item" collection="list" open="(" separator="," close=")">
#{item}
</foreach>
</update>
<update id="updatePendingSettlementBusinessByBillId">
- UPDATE pending_settlement_business set bill_name = #{billName}
- where bill_id = #{id}
-
+ UPDATE pending_settlement_business p
+ JOIN estimated_receivable e ON p.dispatch_no = e.dispatch_no
+ SET
+ p.bill_name = #{billName},
+ e.related_bill_name = #{billName}
+ WHERE p.bill_id = #{id}
+ </update>
+ <update id="updateEstimatedReceivableBillStatus">
+ UPDATE pending_settlement_business
+ SET related_bill_status = #{status}
+ WHERE dispatch_no IN
+ <foreach item="item" collection="list" open="(" separator="," close=")">
+ #{item}
+ </foreach>
</update>
<!--鍒犻櫎-->
@@ -564,8 +579,15 @@
</foreach>
</delete>
<delete id="cancelRelevancy">
- UPDATE pending_settlement_business set bill_id = null ,bill_name = null,is_create = 0
- where id = #{id}
+ UPDATE pending_settlement_business p
+LEFT JOIN estimated_receivable e ON p.dispatch_no = e.dispatch_no
+SET
+ p.bill_id = NULL,
+ p.bill_name = NULL,
+ p.is_create = 0,
+ p.related_bill_status = 0,
+ e.related_bill_name = NULL
+ WHERE p.id = #{id}
</delete>
</mapper>
\ No newline at end of file
--
Gitblit v1.8.0