From 1395356d3b3423f8cb90ded6b5fe8eb2eb52af23 Mon Sep 17 00:00:00 2001 From: wujianwei <wjw@11.com> Date: 星期一, 18 八月 2025 10:43:01 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/yagwly_fa_master' into yagwly_fa_master --- service/src/main/resources/mapper/cwgl/DispatchOrderMapper.xml | 191 +++++++++++++++++++++++++++++++++++++++++++++-- 1 files changed, 183 insertions(+), 8 deletions(-) diff --git a/service/src/main/resources/mapper/cwgl/DispatchOrderMapper.xml b/service/src/main/resources/mapper/cwgl/DispatchOrderMapper.xml index 9701818..e07ec65 100644 --- a/service/src/main/resources/mapper/cwgl/DispatchOrderMapper.xml +++ b/service/src/main/resources/mapper/cwgl/DispatchOrderMapper.xml @@ -7,6 +7,7 @@ <resultMap type="com.ruoyi.cwgl.domain.DispatchOrder" id="DispatchOrderResult"> <result property="id" column="id" /> <result property="dispatchNo" column="dispatch_no" /> + <result property="customerName" column="customer_name" /> <result property="transportMode" column="transport_mode" /> <result property="productName" column="product_name" /> <result property="carrierName" column="carrier_name" /> @@ -64,6 +65,29 @@ <if test="status != null and status != ''"> and thisTab.status = #{status}</if> <if test="isDeleted != null "> and thisTab.is_deleted = #{isDeleted}</if> </sql> + <sql id="whereCondition2"> + <if test="dispatchNo != null and dispatchNo != ''"> and ts.DISPATCH_NO like concat('%', #{dispatchNo}, '%')</if> + <if test="customerName != null and customerName != ''"> and customer.`NAME` like concat('%', #{customerName}, '%')</if> + <if test="transportMode != null and transportMode != ''"> and ts.TRANSPORT_MODE = #{transportMode}</if> + <if test="productName != null and productName != ''"> and ts.PRODUCT_ID like concat('%', #{productName}, '%')</if> + <if test="carrierName != null and carrierName != ''"> and bp.NAME like concat('%', #{carrierName}, '%')</if> + <if test="departureLocationName != null and departureLocationName != ''"> and location_d.NAME_TREE like concat('%', #{departureLocationName}, '%')</if> + <if test="arrivalLocationName != null and arrivalLocationName != ''"> and location_a.NAME_TREE like concat('%', #{arrivalLocationName}, '%')</if> + <if test="licensePlateNumber != null and licensePlateNumber != ''"> and vhc.LICENSE_PLATE_NUMBER = #{licensePlateNumber}</if> + <if test="vehiclePlateId != null and vehiclePlateId != ''"> and ts.VEHICLE_PLATE_ID = #{vehiclePlateId}</if> + <if test="mainDriverName != null and mainDriverName != ''"> and driver_m.NAME like concat('%', #{mainDriverName}, '%')</if> + <if test="assistantDriverName != null and assistantDriverName != ''"> and driver_a.NAME like concat('%', #{assistantDriverName}, '%')</if> + <if test="pointNum != null "> and ts.POINT_NUM = #{pointNum}</if> + <if test="quantity != null "> and ts.QUANTITY = #{quantity}</if> + <if test="actualDepartureTimeBegin != null and actualDepartureTimeBegin!='' and actualDepartureTimeEnd != null and actualDepartureTimeEnd!='' "> and ts.ACTUAL_DEPARTURE_TIME between #{actualDepartureTimeBegin} and #{actualDepartureTimeEnd}</if> + <if test="requiredArrivalTimeBegin != null and requiredArrivalTimeBegin!='' and requiredArrivalTimeEnd != null and requiredArrivalTimeEnd!='' "> and ts.REQUIRED_ARRIVAL_TIME between #{requiredArrivalTimeBegin} and #{requiredArrivalTimeEnd}</if> + <if test="actualArrivalTimeBegin != null and actualArrivalTimeBegin!='' and actualArrivalTimeEnd != null and actualArrivalTimeEnd!='' "> and ts.ACTUAL_ARRIVAL_TIME between #{actualArrivalTimeBegin} and #{actualArrivalTimeEnd}</if> + <if test="beReturn != null and beReturn != ''"> and ts.BE_RETURN = #{beReturn}</if> + <if test="dispatchQuantity != null "> and ts.DISPATCH_QUANTITY = #{dispatchQuantity}</if> + <if test="dispatchWeight != null "> and ts.DISPATCH_WEIGHT = #{dispatchWeight}</if> + <if test="dispatchVolume != null "> and ts.DISPATCH_VOLUME = #{dispatchVolume}</if> + <if test="status != null and status != ''"> and ts.STATUS = #{status}</if> + </sql> <!--鏌ヨ--> <select id="selectDispatchOrderById" parameterType="Integer" resultMap="DispatchOrderResult"> @@ -89,17 +113,18 @@ <select id="selectDispatchOrderList2" parameterType="com.ruoyi.cwgl.domain.DispatchOrder" resultMap="DispatchOrderResult"> SELECT ts.DISPATCH_NO as 'dispatch_no', + customer.`NAME` as 'customer_name', ts.TRANSPORT_MODE as 'transport_mode', ts.PRODUCT_ID as 'product_name', - bp.`NAME` as 'carrier_name', + bp.NAME as 'carrier_name', location_d.NAME_TREE as 'departure_location_name', -- ts.ARRIVAL_LOCATION_ID '鐩殑鍦癐D', location_a.NAME_TREE as 'arrival_location_name', -- ts.VEHICLE_ID '杩愯緭宸ュ叿ID', vhc.LICENSE_PLATE_NUMBER as 'license_plate_number', ts.VEHICLE_PLATE_ID as 'vehicle_plate_id', - driver_m.`NAME` as 'main_driver_name', - driver_a.`NAME` as 'assistant_driver_name', + driver_m.NAME as 'main_driver_name', + driver_a.NAME as 'assistant_driver_name', ts.POINT_NUM as 'point_num', -- ts.ELECTRONIC_LOCK '鐢靛瓙閿�', -- ts.RE_WEIGHING_WEIGHT '澶嶇閲嶉噺', @@ -110,6 +135,7 @@ ts.BE_RETURN as 'be_return', ts.DISPATCH_QUANTITY as 'dispatch_quantity', ts.DISPATCH_WEIGHT as 'dispatch_weight', + ts.CREATED_TIME as 'create_time', ts.DISPATCH_VOLUME as 'dispatch_volume', -- ts.EMPTY_MILEAGE '绌鸿浇閲岀▼锛堝叕閲岋級', -- ts.EMPTY_FUEL '绌鸿浇娌硅�楋紙鍗囷級', @@ -119,7 +145,7 @@ -- ts.TRACKING_NO '蹇�掑崟鍙�', -- ts.SEAL_NO '閾呭皝鍙�', -- ts.SCHEDULE_NO '鐝鍙�', - CASE ts.`STATUS` AS 'status', + ts.STATUS AS 'status', -- ts.ESTIMATED_COST '棰勪及璐圭敤', -- ts.ESTIMATED_CARRIER_NUM '棰勪及鎵胯繍鍟嗘暟', -- ts.ESTIMATED_COST_SAVING '棰勪及鑺傜害璐圭敤', @@ -132,7 +158,8 @@ FROM tms_shipment ts -- 璁㈠崟琛� - -- LEFT JOIN oms_order ord ON ts.DISPATCH_NO = ord.DISPATCH_CODE + LEFT JOIN oms_order ord ON ts.DISPATCH_NO = ord.DISPATCH_CODE + LEFT join base_customer customer on customer.ID=ord.CUSTOMER_ID left join tms_vehicle vhc on ts.VEHICLE_ID=vhc.id left join base_provider bp on bp.ID=ts.CARRIER_ID -- 鍙告満琛� @@ -144,12 +171,160 @@ -- 鍦板尯琛� left join base_location location_d on location_d.ID =ts.DEPARTURE_LOCATION_ID -- where ts.CREATED_TIME >'2025-07-01 00:00:01' - <!-- <where> - <include refid="whereCondition"/> - </where>--> + <where> + <include refid="whereCondition2"/> + </where> order by ts.CREATED_TIME desc </select> + <select id="selectDispatchOrderItemByNos" resultType="com.ruoyi.cwgl.domain.DispatchOrderItem"> + SELECT + bfd.ENTITY_ID as 'dispatch_no', + bfd.CREATED_TIME AS feeDataCreatedTime, + bfd.CHECK_STATUS AS checkStatus, + bfd.CURRENCY_TYPE AS currencyType, + bfd.FEE_ITEM AS feeItem, + bfd.FEE_TIME AS feeTime, + bfd.REMARK AS remark, + bfd.SETTLE_FEE AS settleFee, + bfd.STATUS AS feeDataStatus, + + bill.NAME AS billName, + bill.STATUS AS billStatus, + + fb.TYPE AS billType, + bt.FIELDS AS settableFeeItems + + FROM bms_fee_data bfd + LEFT JOIN bms_bill bill ON bill.ID = bfd.BILL_ID + LEFT JOIN bms_fee_book fb ON fb.ID = bill.FEE_BOOK_ID + LEFT JOIN bms_bill_template bt ON bt.ID = bill.BILL_TEMPLATE_ID + LEFT JOIN oms_order ord ON bfd.ENTITY_ID = ord.DISPATCH_CODE + + WHERE bfd.ENTITY_ID in + <foreach collection="nos" item="no" open="(" separator="," close=")"> + #{no} + </foreach> + + + </select> + + + + <select id="selectDispatchOrderItemByNo" resultType="com.ruoyi.cwgl.domain.DispatchOrderItem"> + SELECT +ts.CREATED_TIME as createdTime, +ts.DISPATCH_NO as dispatchNo, +ts.TRANSPORT_MODE as transportMode, +ts.LOAD_MODE as loadMode, +ts.PRODUCT_ID as productId, +bp.NAME as carrierName, +ts.VEHICLE_TYPE_ID as vehicleTypeId, +vhc.LICENSE_PLATE_NUMBER as licensePlateNumber, +ts.VEHICLE_PLATE_ID as vehiclePlateId, +-- ts.MAIN_DRIVER_ID '涓婚┚椹跺憳ID', +-- ts.ASSISTANT_DRIVER_ID '鍓┚椹跺憳ID', +driver_m.NAME as mainDriverName, +driver_a.NAME as assistantDriverName, +ts.POINT_NUM as pointNum, +ts.RE_WEIGHING_WEIGHT as reWeighingWeight, +ts.QUANTITY as quantity, +ts.REQUIRED_ARRIVAL_TIME as requiredArrivalTime, +ts.ACTUAL_DEPARTURE_TIME as actualDepartureTime, +ts.ACTUAL_ARRIVAL_TIME as actualArrivalTime, +-- ts.BE_RETURN '鏄惁鍥炵▼', +ts.DISPATCH_QUANTITY as dispatchQuantity, +ts.DISPATCH_WEIGHT as dispatchWeight, +ts.DISPATCH_VOLUME as dispatchVolume, +-- bfd.ID '璐﹀崟鏄庣粏Id', +ts.STATUS as status, +ts.TRANSPORT_LINE as transportLine, +-- ts.REMARK '璋冨害鍗曞娉�', +-- ts.ROUTE_CODE '绾胯矾鍙�', +-- ts.DEPARTURE_LOCATION_ID '鍑哄彂鍦癐D', +location_d.NAME_TREE as departureLocationName, +-- ts.ARRIVAL_LOCATION_ID '鐩殑鍦癐D', +location_a.NAME_TREE as arrivalLocationName, +-- bill.id '璐﹀崟ID', +fb.type AS billType, + +bfd.CREATED_TIME as feeDataCreatedTime, +-- bfd.BILL_ID '璐﹀崟鏄庣粏ID', +bfd.CHECK_STATUS as checkStatus, +bfd.CURRENCY_TYPE as currencyType, +-- bfd.ENTITY_LEVEL2 '浜岀骇涓讳綋', +-- bfd.ENTITY_LEVEL3 '涓夌骇涓讳綋', +-- bfd.FEE_BOOK_ID '璐︽湰ID', +bfd.FEE_ITEM as feeItem, +-- bfd.FEE_SOURCE '璐圭敤鏉ユ簮', +bfd.FEE_TIME as feeTime, +bfd.REMARK as remark, +bfd.SETTLE_FEE as settleFee, +bfd.STATUS as feeDataStatus, +bt.FIELDS as settableFeeItems, +bill.NAME as billName, +-- bill.CHECK_ONLINE'鍦ㄧ嚎瀵硅处', + bill.STATUS AS billStatus +FROM +-- 璐﹀崟鏄庣粏琛� + bms_fee_data bfd +-- 璁㈠崟琛� + LEFT JOIN oms_order ord + ON bfd.ENTITY_ID = ord.DISPATCH_CODE +-- 璋冨害鍗曡〃 + LEFT JOIN tms_shipment ts + ON ts.DISPATCH_NO = ord.DISPATCH_CODE +-- 璐﹀崟涓昏〃 + left join bms_bill bill on bill.id= bfd.BILL_ID +-- 璐﹀唽琛� + LEFT JOIN bms_fee_book fb ON fb.id = bill.FEE_BOOK_ID +-- 杩愯緭宸ュ叿琛� + left join tms_vehicle vhc on ts.VEHICLE_ID=vhc.id +-- 鎵胯繍鍟嗚〃 + left join base_provider bp on bp.ID=ts.CARRIER_ID +-- 鍙告満琛� + left join tms_driver driver_m on driver_m.ID=ts.MAIN_DRIVER_ID +-- 鍙告満琛� + left join tms_driver driver_a on driver_a.ID=ts.ASSISTANT_DRIVER_ID +-- 鍦板尯琛� + left join base_location location_a on location_a.ID =ts.ARRIVAL_LOCATION_ID + -- 鍦板尯琛� + left join base_location location_d on location_d.ID =ts.DEPARTURE_LOCATION_ID + -- 璐﹀崟妯℃澘琛� + left join bms_bill_template bt on bt.ID=bill.BILL_TEMPLATE_ID +WHERE + bfd.ENTITY_ID = #{no} + + </select> + <select id="selectDispatchOrderAttachment" resultType="com.ruoyi.cwgl.domain.vo.DispatchOrderAttachmentVo"> +SELECT +-- image.PATH, + CONCAT('https://tms.ygalogisticspark.com/ImageViewServlet?id=',image.id) as imageUrl, + -- tof.FEE_TYPE_ID '璐圭敤绫诲瀷ID', + bfi.FEE_TYPE as feeItem, + tof.account as account, + case tof.CURRENCY_ID + when 1 then '娓竵' + when 2 then '浜烘皯甯�' + else '鏈煡' + end as currency + +FROM +-- 鍏朵粬璐圭敤琛� + Tms_Other_Fee tof +-- 璋冨害鍗曡〃 + LEFT JOIN tms_shipment ts ON tof.dispatch_Order_Id = ts.id +-- 闄勪欢琛� + LEFT JOIN Thorn_Attachment image ON image.OBJ_ID = tof.id +-- 璐圭敤绫诲瀷琛� + left join base_fee_item bfi on bfi.id=tof.FEE_TYPE_ID +WHERE + ts.DISPATCH_NO = #{no} + AND image.biz_Type = 'com.vtradex.tms.core.model.entity.fee.TmsOtherFee' + + + </select> + <!-- 鏂板 --> <insert id="insertDispatchOrder" parameterType="com.ruoyi.cwgl.domain.DispatchOrder" useGeneratedKeys="true" keyProperty="id"> insert into dispatch_order -- Gitblit v1.8.0