From 86fa4d99b55a959714b0d00439bead60d3f90611 Mon Sep 17 00:00:00 2001 From: aike <17730485278@139.com> Date: Tue, 8 Jul 2025 12:00:29 +0800 Subject: [PATCH] =?UTF-8?q?demand:=20=20=E5=A4=A7=E5=AE=A2=E6=88=B7?= =?UTF-8?q?=E5=8D=95=E7=8B=AC=E6=8A=A5=E4=BB=B7=E4=BF=AE=E6=94=B9bug?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=20committer:=20heyu?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/EmisTmsSiteBatchMissServiceImpl.java | 27 +++++++++++++++++++ .../resources/mapper/EmisQuotePriceMapper.xml | 1 + .../resources/mapper/EmisWaybillMapper.xml | 8 ++---- 3 files changed, 30 insertions(+), 6 deletions(-) diff --git a/emis-biz/src/main/java/com/xdadan/erp/emis/service/impl/EmisTmsSiteBatchMissServiceImpl.java b/emis-biz/src/main/java/com/xdadan/erp/emis/service/impl/EmisTmsSiteBatchMissServiceImpl.java index 96f1c20b3..91c265534 100644 --- a/emis-biz/src/main/java/com/xdadan/erp/emis/service/impl/EmisTmsSiteBatchMissServiceImpl.java +++ b/emis-biz/src/main/java/com/xdadan/erp/emis/service/impl/EmisTmsSiteBatchMissServiceImpl.java @@ -1,6 +1,7 @@ package com.xdadan.erp.emis.service.impl; import java.util.*; +import java.util.function.Function; import java.util.stream.Collectors; import java.util.concurrent.ExecutorService; import java.util.concurrent.Future; @@ -198,6 +199,32 @@ public class EmisTmsSiteBatchMissServiceImpl extends EmisBaseService implements // 关闭线程池 executorService.shutdown(); + // 构建运单号到EmisWaybill的映射 + Map waybillMap = allWaybills.stream() + .collect(Collectors.toMap(EmisWaybill::getBillCode, Function.identity(), (a, b) -> a)); + + allWaybills = allWaybills.stream() + .filter(wb -> { + String virtualRemark = wb.getVirtualRemark(); + if (StringUtils.isBlank(virtualRemark)) { + return true; + } + // 解析virtualRemark中的运单号 + String[] relatedNos = virtualRemark.split(","); + for (String no : relatedNos) { + EmisWaybill related = waybillMap.get(no.trim()); + if (related != null && Objects.equals(related.getProblemType(), 173)) { + return false; // 只要有一个关联运单problemType=173,则过滤掉 + } + } + return true; + }) + .collect(Collectors.toList()); + + allWaybills = allWaybills.stream() + .filter(wb -> !Objects.equals(wb.getProblemType(), 170)) + .collect(Collectors.toList()); + // 按1000条数据分组处理 List> batches = new ArrayList<>(); for (int i = 0; i < allWaybills.size(); i += pageSize) { diff --git a/emis-biz/src/main/resources/mapper/EmisQuotePriceMapper.xml b/emis-biz/src/main/resources/mapper/EmisQuotePriceMapper.xml index 2f70bce1a..0608b74b2 100644 --- a/emis-biz/src/main/resources/mapper/EmisQuotePriceMapper.xml +++ b/emis-biz/src/main/resources/mapper/EmisQuotePriceMapper.xml @@ -168,6 +168,7 @@ - select a.id, a.bill_code,a.trans_line_type, a.product_type,a.start_site_code,a.send_site_code + select a.id, a.bill_code,a.trans_line_type, a.product_type,a.start_site_code,a.send_site_code,a.problem_type from emis_waybill a left join emis_waybill_batch_status b on a.bill_code = b.bill_code where a.del_flag = '0' @@ -3822,11 +3822,7 @@ and a.send_date ]]> '2025-01-01 00:00:00' and a.send_date DATE_SUB(CURDATE(), INTERVAL 7 DAY) - and ( - (a.receive_country = '0086' and a.problem_type not in (173,170,151)) - or - (a.receive_country != '0086' and (a.virtual_remark is null or a.virtual_remark = '' or a.virtual_remark = ' ')and (a.problem_type is null or a.problem_type != 151)) - ) + and a.problem_type != 151 and a.order_status not in ('0','2') order by a.create_time desc limit #{offset}, #{pageSize}