From 384fc6565e37f0b34af6ea366adb488cf53f2176 Mon Sep 17 00:00:00 2001 From: aike <17730485278@139.com> Date: Wed, 20 Aug 2025 14:48:02 +0800 Subject: [PATCH 1/3] =?UTF-8?q?demand:=20=20TMS-=E8=BF=90=E8=BE=93?= =?UTF-8?q?=E7=AE=A1=E7=90=86-=E6=BC=8F=E7=BB=84=E6=89=B9=E6=AC=A1?= =?UTF-8?q?=E6=89=AB=E6=8F=8F-=E9=92=88=E5=AF=B9=E5=88=86=E6=89=B9?= =?UTF-8?q?=E7=BB=84=E6=89=B9=E6=AC=A1=E5=88=A4=E6=96=AD=E4=B8=8D=E5=87=86?= =?UTF-8?q?=E7=A1=AE=E9=97=AE=E9=A2=98=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit committer: heyu --- .../erp/emis/service/EmisBaseService.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/emis-biz/src/main/java/com/xdadan/erp/emis/service/EmisBaseService.java b/emis-biz/src/main/java/com/xdadan/erp/emis/service/EmisBaseService.java index a679d058a..13405c5fe 100644 --- a/emis-biz/src/main/java/com/xdadan/erp/emis/service/EmisBaseService.java +++ b/emis-biz/src/main/java/com/xdadan/erp/emis/service/EmisBaseService.java @@ -4656,6 +4656,23 @@ public class EmisBaseService { batch.getSupplierCode())) { continue; } + + // 检查明细列表中是否有waybillBatchStatus=2的记录,如果有则不合并 + boolean hasWaybillBatchStatus2 = false; + if (batch.getBatchDtlList() != null && !batch.getBatchDtlList().isEmpty()) { + for (EmisTmsSiteBatchDtl dtl : batch.getBatchDtlList()) { + if ("2".equals(dtl.getWaybillBatchStatus())) { + hasWaybillBatchStatus2 = true; + break; + } + } + } + + // 如果有waybillBatchStatus=2的记录,跳过合并 + if (hasWaybillBatchStatus2) { + continue; + } + String key = batch.getStartSiteCode() + "_" + batch.getNextSiteCode(); if (mergedBatches.containsKey(key)) { EmisTmsSiteBatch existingBatch = mergedBatches.get(key); From ed9a360929af3ffc0eaa23c50129ad6bb622a7a0 Mon Sep 17 00:00:00 2001 From: aike <17730485278@139.com> Date: Wed, 20 Aug 2025 16:22:34 +0800 Subject: [PATCH 2/3] =?UTF-8?q?demand:=20=20TMS-=E8=BF=90=E8=BE=93?= =?UTF-8?q?=E7=AE=A1=E7=90=86-=E6=BC=8F=E7=BB=84=E6=89=B9=E6=AC=A1?= =?UTF-8?q?=E6=89=AB=E6=8F=8F-=E9=92=88=E5=AF=B9=E5=88=86=E6=89=B9?= =?UTF-8?q?=E7=BB=84=E6=89=B9=E6=AC=A1=E5=88=A4=E6=96=AD=E4=B8=8D=E5=87=86?= =?UTF-8?q?=E7=A1=AE=E9=97=AE=E9=A2=98=E4=BF=AE=E5=A4=8D=20=20=20=E8=BF=90?= =?UTF-8?q?=E5=8D=95=E6=80=BB=E8=BF=90=E8=B4=B9=E8=AE=A1=E7=AE=97=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E9=80=89=E6=8B=A9=E5=A4=9A=E4=B8=AA=E4=BA=A7=E5=93=81?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit committer: heyu --- .../erp/emis/service/EmisBaseService.java | 13 ++++++- .../mapper/EmisTmsSiteBatchMapper.xml | 36 ++++++++++--------- .../resources/mapper/EmisWaybillMapper.xml | 5 +-- 3 files changed, 34 insertions(+), 20 deletions(-) diff --git a/emis-biz/src/main/java/com/xdadan/erp/emis/service/EmisBaseService.java b/emis-biz/src/main/java/com/xdadan/erp/emis/service/EmisBaseService.java index 13405c5fe..d7b099901 100644 --- a/emis-biz/src/main/java/com/xdadan/erp/emis/service/EmisBaseService.java +++ b/emis-biz/src/main/java/com/xdadan/erp/emis/service/EmisBaseService.java @@ -4651,6 +4651,7 @@ public class EmisBaseService { // 合并相同起始网点和下一网点的批次 Map mergedBatches = new HashMap<>(); + int status2Index = 0; for (EmisTmsSiteBatch batch : waybillBatches) { if (StringUtils.isAnyBlank(batch.getStartSiteCode(), batch.getNextSiteCode(), batch.getSupplierCode())) { @@ -4668,8 +4669,18 @@ public class EmisBaseService { } } - // 如果有waybillBatchStatus=2的记录,跳过合并 + // 如果有waybillBatchStatus=2的记录,不合并supplierCode,但添加到mergedBatches if (hasWaybillBatchStatus2) { + String specialKey = batch.getStartSiteCode() + "_" + batch.getNextSiteCode() + "_S2_" + + (status2Index++); + EmisTmsSiteBatch newBatch = new EmisTmsSiteBatch(); + BeanUtils.copyProperties(batch, newBatch); + Set supplierSet = new TreeSet<>(); + if (StringUtils.isNotBlank(batch.getSupplierCode())) { + supplierSet.addAll(Arrays.asList(batch.getSupplierCode().split(","))); + } + newBatch.setSupplierCode(String.join(",", supplierSet)); + mergedBatches.put(specialKey, newBatch); continue; } diff --git a/emis-biz/src/main/resources/mapper/EmisTmsSiteBatchMapper.xml b/emis-biz/src/main/resources/mapper/EmisTmsSiteBatchMapper.xml index ef08d19fd..6c0d77703 100644 --- a/emis-biz/src/main/resources/mapper/EmisTmsSiteBatchMapper.xml +++ b/emis-biz/src/main/resources/mapper/EmisTmsSiteBatchMapper.xml @@ -64,6 +64,7 @@ + @@ -527,7 +528,8 @@ - select distinct b.id, b.batch_no, b.batch_name, b.batch_date, b.supplier_code, b.trans_line_type, - b.product_type, b.batch_type, b.trans_type, b.start_site_code, b.send_country, - b.next_site_code, b.air_billl_no, b.etd, b.eta, b.car_no, b.ship_no, - b.clearance_res_status, b.declare_res_status, b.dest_country, b.dest_country_name, - b.trans_weight, b.pack_num, b.total_waybill_qty, b.total_settlement_weight, - b.op_man, b.remark, b.tenant_id, b.del_flag, b.create_by, b.create_time, + select distinct b.id, b.batch_no, b.batch_name, b.batch_date, b.supplier_code, b.trans_line_type, + b.product_type, b.batch_type, b.trans_type, b.start_site_code, b.send_country, + b.next_site_code, b.air_billl_no, b.etd, b.eta, b.car_no, b.ship_no, + b.clearance_res_status, b.declare_res_status, b.dest_country, b.dest_country_name, + b.trans_weight, b.pack_num, b.total_waybill_qty, b.total_settlement_weight, + b.op_man, b.remark, b.tenant_id, b.del_flag, b.create_by, b.create_time, b.update_by, b.update_time, b.create_site, b.update_site, b.bl_entering, - CASE + CASE WHEN COALESCE(MAX(d.batch_volume), 0) = 0 THEN COALESCE(w.total_volume, 0) ELSE COALESCE(MAX(d.batch_volume), 0) END as total_volume, - CASE + CASE WHEN COALESCE(MAX(d.batch_parcel_qty), 0) = 0 THEN COALESCE(w.parcel_qty, 0) ELSE COALESCE(MAX(d.batch_parcel_qty), 0) END as total_parcel_qty, - CASE + CASE WHEN COALESCE(MAX(d.batch_weight), 0) = 0 THEN COALESCE(w.bill_weight, 0) ELSE COALESCE(MAX(d.batch_weight), 0) END as total_weight @@ -568,13 +570,13 @@ and b.del_flag = '0' and d.del_flag = '0' AND d.id != #{id} - group by b.id, b.batch_no, b.batch_name, b.batch_date, b.supplier_code, b.trans_line_type, - b.product_type, b.batch_type, b.trans_type, b.start_site_code, b.send_country, - b.next_site_code, b.air_billl_no, b.etd, b.eta, b.car_no, b.ship_no, - b.clearance_res_status, b.declare_res_status, b.dest_country, b.dest_country_name, - b.trans_weight, b.pack_num, b.total_waybill_qty, b.total_settlement_weight, - b.op_man, b.remark, b.tenant_id, b.del_flag, b.create_by, b.create_time, + group by b.id, b.batch_no, b.batch_name, b.batch_date, b.supplier_code, b.trans_line_type, + b.product_type, b.batch_type, b.trans_type, b.start_site_code, b.send_country, + b.next_site_code, b.air_billl_no, b.etd, b.eta, b.car_no, b.ship_no, + b.clearance_res_status, b.declare_res_status, b.dest_country, b.dest_country_name, + b.trans_weight, b.pack_num, b.total_waybill_qty, b.total_settlement_weight, + b.op_man, b.remark, b.tenant_id, b.del_flag, b.create_by, b.create_time, b.update_by, b.update_time, b.create_site, b.update_site, b.bl_entering, w.total_volume, w.parcel_qty, w.total_weight - \ No newline at end of file + diff --git a/emis-biz/src/main/resources/mapper/EmisWaybillMapper.xml b/emis-biz/src/main/resources/mapper/EmisWaybillMapper.xml index 2f0883b98..e217d8836 100644 --- a/emis-biz/src/main/resources/mapper/EmisWaybillMapper.xml +++ b/emis-biz/src/main/resources/mapper/EmisWaybillMapper.xml @@ -2073,7 +2073,7 @@ and cust_no like concat('%', #{custNo}, '%') and cust_name like concat('%', #{custName}, '%') and trans_line_type=#{transLineType} - and product_type=#{productType} + and FIND_IN_SET(product_type,#{productType}) and time_type like concat('%', #{timeType}, '%') and meter_type like concat('%', #{meterType}, '%') and FIND_IN_SET(a.carry_type,#{carryType}) @@ -3851,6 +3851,7 @@ and ((a.virtual_remark is null or a.virtual_remark = '' or a.virtual_remark = ' ')or a.receive_country != '0095') and a.order_status not in ('0','2') + and a.bill_code='T7080300154556' and not exists ( select 1 from emis_waybill_batch_status b where a.bill_code = b.bill_code and b.site_batch_status = '1' and b.del_flag = '0' ) @@ -3891,4 +3892,4 @@ limit 1 - \ No newline at end of file + From 8cce2fa7f486a3e5c26e01793dfac0f126ab65bf Mon Sep 17 00:00:00 2001 From: aike <17730485278@139.com> Date: Wed, 20 Aug 2025 17:27:19 +0800 Subject: [PATCH 3/3] =?UTF-8?q?demand:=20=20TMS-=E8=BF=90=E8=BE=93?= =?UTF-8?q?=E7=AE=A1=E7=90=86-=E6=BC=8F=E7=BB=84=E6=89=B9=E6=AC=A1?= =?UTF-8?q?=E6=89=AB=E6=8F=8F-=E9=92=88=E5=AF=B9=E5=88=86=E6=89=B9?= =?UTF-8?q?=E7=BB=84=E6=89=B9=E6=AC=A1=E5=88=A4=E6=96=AD=E4=B8=8D=E5=87=86?= =?UTF-8?q?=E7=A1=AE=E9=97=AE=E9=A2=98=E4=BF=AE=E5=A4=8D=20=20=20=E8=BF=90?= =?UTF-8?q?=E5=8D=95=E6=80=BB=E8=BF=90=E8=B4=B9=E8=AE=A1=E7=AE=97=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E9=80=89=E6=8B=A9=E5=A4=9A=E4=B8=AA=E4=BA=A7=E5=93=81?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit committer: heyu --- emis-biz/src/main/resources/mapper/EmisWaybillMapper.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/emis-biz/src/main/resources/mapper/EmisWaybillMapper.xml b/emis-biz/src/main/resources/mapper/EmisWaybillMapper.xml index e217d8836..cd53168f0 100644 --- a/emis-biz/src/main/resources/mapper/EmisWaybillMapper.xml +++ b/emis-biz/src/main/resources/mapper/EmisWaybillMapper.xml @@ -3851,7 +3851,6 @@ and ((a.virtual_remark is null or a.virtual_remark = '' or a.virtual_remark = ' ')or a.receive_country != '0095') and a.order_status not in ('0','2') - and a.bill_code='T7080300154556' and not exists ( select 1 from emis_waybill_batch_status b where a.bill_code = b.bill_code and b.site_batch_status = '1' and b.del_flag = '0' )