From 268a18c9465dbbe6baefc1c3d89ef12068d00608 Mon Sep 17 00:00:00 2001 From: fengyuan_yang <1976974459@qq.com> Date: Thu, 27 Nov 2025 11:50:04 +0800 Subject: [PATCH] =?UTF-8?q?2025-11-27=20pda=E8=B0=83=E6=95=B4=E6=89=AB?= =?UTF-8?q?=E6=8F=8F=E3=80=81=E6=9F=A5=E8=AF=A2=E3=80=81=E7=A1=AE=E8=AE=A4?= =?UTF-8?q?=E9=80=BB=E8=BE=91=EF=BC=88=E5=85=B6=E4=BB=96=E5=85=A5=E5=BA=93?= =?UTF-8?q?=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/OtherInboundController.java | 9 +++++---- .../service/OtherInboundService.java | 2 +- .../service/impl/OtherInboundServiceImpl.java | 8 ++++---- .../mapper/schedule/ScheduleMapper.xml | 19 +++++-------------- 4 files changed, 15 insertions(+), 23 deletions(-) diff --git a/src/main/java/com/gaotao/modules/otherInbound/controller/OtherInboundController.java b/src/main/java/com/gaotao/modules/otherInbound/controller/OtherInboundController.java index 2987acc..6d895cf 100644 --- a/src/main/java/com/gaotao/modules/otherInbound/controller/OtherInboundController.java +++ b/src/main/java/com/gaotao/modules/otherInbound/controller/OtherInboundController.java @@ -128,6 +128,7 @@ public class OtherInboundController extends AbstractController { String warehouseId = (String) params.get("warehouseId"); String operationType = (String) params.get("operationType"); String documentType = (String) params.get("documentType"); + String rollNo = (String) params.get("labelCode"); if (site == null || site.trim().isEmpty()) { return R.error("站点不能为空"); @@ -135,9 +136,9 @@ public class OtherInboundController extends AbstractController { if (inboundNo == null || inboundNo.trim().isEmpty()) { return R.error("入库单号不能为空"); } - if (materialCode == null || materialCode.trim().isEmpty()) { - return R.error("物料编码不能为空"); - } +// if (materialCode == null || materialCode.trim().isEmpty()) { +// return R.error("物料编码不能为空"); +// } if (operationType == null || operationType.trim().isEmpty()) { return R.error("操作类型不能为空"); } @@ -159,7 +160,7 @@ public class OtherInboundController extends AbstractController { // 调用存储过程GetScanLabelVerification otherInboundService.validateLabelWithOtherInbound( - site, buNo, inboundNo, materialCode, actualQty, batchNo, warehouseId, operationType, documentType, userName); + site, buNo, inboundNo, materialCode, actualQty, batchNo, warehouseId, operationType, documentType, userName, rollNo); return R.ok("操作成功"); } catch (Exception e) { logger.error("验证标签失败", e); diff --git a/src/main/java/com/gaotao/modules/otherInbound/service/OtherInboundService.java b/src/main/java/com/gaotao/modules/otherInbound/service/OtherInboundService.java index 4a7eebe..b829afc 100644 --- a/src/main/java/com/gaotao/modules/otherInbound/service/OtherInboundService.java +++ b/src/main/java/com/gaotao/modules/otherInbound/service/OtherInboundService.java @@ -59,7 +59,7 @@ public interface OtherInboundService { */ void validateLabelWithOtherInbound(String site, String buNo, String inboundNo, String materialCode, Double actualQty, String batchNo, String warehouseId, - String operationType, String documentType, String userName); + String operationType, String documentType, String userName, String rollNo); /** * 获取已扫描标签列表(从ScannedRollTempTable缓存表) diff --git a/src/main/java/com/gaotao/modules/otherInbound/service/impl/OtherInboundServiceImpl.java b/src/main/java/com/gaotao/modules/otherInbound/service/impl/OtherInboundServiceImpl.java index 7318b2c..5b3a5cf 100644 --- a/src/main/java/com/gaotao/modules/otherInbound/service/impl/OtherInboundServiceImpl.java +++ b/src/main/java/com/gaotao/modules/otherInbound/service/impl/OtherInboundServiceImpl.java @@ -60,9 +60,9 @@ public class OtherInboundServiceImpl implements OtherInboundService { @Override public void validateLabelWithOtherInbound(String site, String buNo, String inboundNo, String materialCode, Double actualQty, String batchNo, String warehouseId, - String operationType, String documentType, String userName) { - logger.info("调用GetScanLabelVerification存储过程,站点: {}, 入库单: {}, 物料: {}, 数量: {}, 批次: {}, 操作类型: {}, 单据类型: {}, 用户: {}", - site, inboundNo, materialCode, actualQty, batchNo, operationType, documentType, userName); + String operationType, String documentType, String userName, String rollNo) { + logger.info("调用GetScanLabelVerification存储过程,站点: {}, 入库单: {}, 物料: {}, 数量: {}, 批次: {}, 操作类型: {}, 单据类型: {}, 用户: {}, rollNo:{}", + site, inboundNo, materialCode, actualQty, batchNo, operationType, documentType, userName, rollNo); try { // 调用存储过程 GetScanLabelVerification(参考采购入库功能) @@ -75,7 +75,7 @@ public class OtherInboundServiceImpl implements OtherInboundService { params.add(""); // 参数5: 空字符串 params.add(materialCode != null ? materialCode : ""); // 参数6: 物料编码 params.add(actualQty != null ? actualQty : 0.0); // 参数7: 数量 - params.add(""); // 参数8: 空字符串 + params.add(rollNo != null ? rollNo : ""); // 参数8: rollNo params.add(batchNo != null ? batchNo : ""); // 参数9: 批次号 params.add("其他入库"); // 参数10: 单据类型 params.add(operationType != null ? operationType : ""); // 参数11: 操作类型 I-添加 D-移除 diff --git a/src/main/resources/mapper/schedule/ScheduleMapper.xml b/src/main/resources/mapper/schedule/ScheduleMapper.xml index e31c6f2..ec97b18 100644 --- a/src/main/resources/mapper/schedule/ScheduleMapper.xml +++ b/src/main/resources/mapper/schedule/ScheduleMapper.xml @@ -940,20 +940,10 @@ sfr.RollQty rollQty, sfr.FirstLevelRollNo firstLevelRollNo, sfr.VirtualRollFlag virtualRollFlag, - B.good_qty goodQty, - B.defect_qty defectQty, - B.total_qty totalQty, - CASE - WHEN total_qty = 0 THEN - CAST (0 AS DECIMAL(18, 2)) - ELSE - CAST ( - ROUND( - CAST (good_qty AS DECIMAL(20, 6)) / total_qty * 100, - 2 - ) AS DECIMAL (18, 2) - ) - END AS yieldRate + SUM(B.good_qty) AS goodQty, + SUM(B.defect_qty) AS defectQty, + SUM(B.total_qty) AS totalQty, + CASE WHEN SUM(B.total_qty) = 0 THEN CAST(0 AS DECIMAL(18, 2)) ELSE CAST( ROUND( CAST(SUM(B.good_qty) AS DECIMAL(20, 6)) / SUM(B.total_qty) * 100, 2) AS DECIMAL(18, 2) ) END AS yieldRate FROM SFDC_Rolls sfr LEFT JOIN ProductionReport B ON sfr.Site = B.site @@ -978,6 +968,7 @@ AND sfr.RollNo = #{rollNo} + GROUP BY sfr.Site,sfr.OrderNo,sfr.RollNo,sfr.CreatedDate,sfr.Createdby,sfr.CurrentOpsItemNo,sfr.LastFinishedOpsItemNo,sfr.FinishedDate,sfr.FinishedFlag,sfr.OnLineFlag,sfr.PauseFlag,sfr.OriRollNo,sfr.StartOpsItemNo,sfr.RollType,sfr.CreatedOpsItemNo,sfr.CreatedOpsSeqNo,sfr.RollQty,sfr.FirstLevelRollNo,sfr.VirtualRollFlag ORDER BY sfr.RollNo