From 11fee8fe11e6d07069ad810fda473df39a5aa5c6 Mon Sep 17 00:00:00 2001 From: qiankanghui Date: Tue, 9 Jun 2026 17:25:59 +0800 Subject: [PATCH] =?UTF-8?q?feat(order):=20=E6=96=B0=E5=A2=9EPO=E6=98=8E?= =?UTF-8?q?=E7=BB=86=E7=AE=A1=E7=90=86=E6=9C=8D=E5=8A=A1=E5=8F=8A=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E9=AA=8C=E8=B4=A7=E7=94=B3=E8=AF=B7=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 新增PODetailServiceImpl完整实现包括CRD/ETA自动计算逻辑 - 添加批量导入PO明细功能支持Excel文件上传处理 - 实现PO明细批量更新时的校验逻辑和端口运输方式映射 - 优化验货申请删除权限控制增加已审核状态允许删除 - 修复查询PO页面时的XML格式化问题移除多余换行 - 移除验货申请服务中冗余的站点自动设置代码 - 简化删除操作注释保持代码整洁性 --- .../impl/InspectionRequestServiceImpl.java | 11 ++-------- .../service/Impl/PODetailServiceImpl.java | 20 ++++++++++++++++--- .../InspectionRequestHeaderMapper.xml | 3 +-- .../resources/mapper/order/PODetailMapper.xml | 2 -- 4 files changed, 20 insertions(+), 16 deletions(-) diff --git a/src/main/java/com/xujie/modules/inspection/service/impl/InspectionRequestServiceImpl.java b/src/main/java/com/xujie/modules/inspection/service/impl/InspectionRequestServiceImpl.java index bb60f8a..ef41f02 100644 --- a/src/main/java/com/xujie/modules/inspection/service/impl/InspectionRequestServiceImpl.java +++ b/src/main/java/com/xujie/modules/inspection/service/impl/InspectionRequestServiceImpl.java @@ -106,10 +106,6 @@ public class InspectionRequestServiceImpl extends ServiceImpl page = baseMapper.queryPoPage(new Page<>(data.getPage(), data.getLimit()), data); return new PageUtils(page); @@ -280,7 +276,7 @@ public class InspectionRequestServiceImpl extends ServiceImpl i throw new RuntimeException("当前用户site为空!"); } + Map ref2Counter = new HashMap<>(); // 用于收集错误信息 List errorMessages = new ArrayList<>(); @@ -496,6 +497,7 @@ public class PODetailServiceImpl extends ServiceImpl i // 设置默认值 poHeader.setCurrency("USA"); poHeader.setCurrencyRate(1.0); + poHeader.setStatus("已下达"); // 供应商 if (excelDTO.getSupplierName() != null && !excelDTO.getSupplierName().isEmpty()) { @@ -541,9 +543,21 @@ public class PODetailServiceImpl extends ServiceImpl i // 关联 poDetailVo.setPoHeaderId(savedHeader.getId()); - // 设置 order_ref1 和 order_ref2 - poDetailVo.setOrderRef1(excelDTO.getPoNo()); - poDetailVo.setOrderRef2("1"); + String ref1 = excelDTO.getPoNo(); + poDetailVo.setOrderRef1(ref1); + + Integer currentMax = ref2Counter.get(ref1); + + if (currentMax == null) { + Integer dbMax = baseMapper.getMaxOrderRef2(ref1); + currentMax = (dbMax == null ? 0 : dbMax); + } + + int next = currentMax + 1; + + ref2Counter.put(ref1, next); + + poDetailVo.setOrderRef2(String.valueOf(next)); // 业务字段 - 款号保存到 part_no 字段 poDetailVo.setPartNo(excelDTO.getItem()); diff --git a/src/main/resources/mapper/inspection/InspectionRequestHeaderMapper.xml b/src/main/resources/mapper/inspection/InspectionRequestHeaderMapper.xml index ecf73a6..b621c36 100644 --- a/src/main/resources/mapper/inspection/InspectionRequestHeaderMapper.xml +++ b/src/main/resources/mapper/inspection/InspectionRequestHeaderMapper.xml @@ -53,8 +53,7 @@ order by h.request_date desc - SELECT pod.site, pod.order_no, diff --git a/src/main/resources/mapper/order/PODetailMapper.xml b/src/main/resources/mapper/order/PODetailMapper.xml index d1fb41a..fa411b0 100644 --- a/src/main/resources/mapper/order/PODetailMapper.xml +++ b/src/main/resources/mapper/order/PODetailMapper.xml @@ -504,6 +504,4 @@ FROM PODetail WHERE order_ref1 = #{orderRef1} - -