From 96792d32c069ff6bf7498c29baa721e96810202f Mon Sep 17 00:00:00 2001 From: Kelvin Date: Sat, 4 Jan 2025 10:11:13 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E5=85=A5=E5=BA=93=E8=AE=A1=E5=88=92):=20?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=20=E6=8F=92=E5=85=A5=E5=B9=B6=E8=BF=90?= =?UTF-8?q?=E8=A1=8C=E5=85=A5=E5=BA=93=E8=AE=A1=E5=88=92=20=E6=9C=8D?= =?UTF-8?q?=E5=8A=A1=EF=BC=8C=E4=BC=98=E5=8C=96=E4=BA=8B=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ktg/mes/wm/service/IWmsInPlanService.java | 10 ++++++++-- .../mes/wm/service/impl/WmsInPlanServiceImpl.java | 14 +++++++++++--- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/ktg-mes/src/main/java/com/ktg/mes/wm/service/IWmsInPlanService.java b/ktg-mes/src/main/java/com/ktg/mes/wm/service/IWmsInPlanService.java index 14a349e..74cbafb 100644 --- a/ktg-mes/src/main/java/com/ktg/mes/wm/service/IWmsInPlanService.java +++ b/ktg-mes/src/main/java/com/ktg/mes/wm/service/IWmsInPlanService.java @@ -72,8 +72,14 @@ public interface IWmsInPlanService /** * 执行入库计划 + * * @param planId 入库计划ID - * @return 结果 */ - public int issueWmsInPlan(Long planId); + public void issueWmsInPlan(Long planId); + + /** + * 创建并执行入库计划 + * @param wmsInPlan 入库计划 + */ + public void insertAndIssueWmsInPlan(WmsInPlan wmsInPlan); } diff --git a/ktg-mes/src/main/java/com/ktg/mes/wm/service/impl/WmsInPlanServiceImpl.java b/ktg-mes/src/main/java/com/ktg/mes/wm/service/impl/WmsInPlanServiceImpl.java index 29366cb..6c50e14 100644 --- a/ktg-mes/src/main/java/com/ktg/mes/wm/service/impl/WmsInPlanServiceImpl.java +++ b/ktg-mes/src/main/java/com/ktg/mes/wm/service/impl/WmsInPlanServiceImpl.java @@ -83,6 +83,7 @@ public class WmsInPlanServiceImpl implements IWmsInPlanService { /** * 同步小型刀具库数据 */ + @Transactional @Override public int asyncSmallKnifeData() { // List ap0aeList = ap0AEMapper.selectInNewData(); @@ -90,7 +91,6 @@ public class WmsInPlanServiceImpl implements IWmsInPlanService { int count = 0; inventoryAdjustments.stream().filter(adjustment -> adjustment.getBillDate() != null).forEach(ap0ae -> { WmsInPlan wmsInPlan = new WmsInPlan(); - wmsInPlan.setPlanCode(MultiModuleCodeGenerator.generateTaskCode("RKP")); // 发布人 wmsInPlan.setPublishName(ap0ae.getDataEntryClerk()); // 计划日期 @@ -270,7 +270,8 @@ public class WmsInPlanServiceImpl implements IWmsInPlanService { * @param planId 入库计划ID */ @Override - public int issueWmsInPlan(Long planId) { + @Transactional + public void issueWmsInPlan(Long planId) { WmsInPlan wmsInPlan = selectWmsInPlanByPlanId(planId); WmsInTask wmsInTask = new WmsInTask(); @@ -298,6 +299,13 @@ public class WmsInPlanServiceImpl implements IWmsInPlanService { }); wmsInPlan.setState("1"); - return wmsInPlanMapper.updateWmsInPlan(wmsInPlan); + wmsInPlanMapper.updateWmsInPlan(wmsInPlan); + } + + @Transactional + @Override + public void insertAndIssueWmsInPlan(WmsInPlan wmsInPlan) { + this.insertWmsInPlan(wmsInPlan); + this.issueWmsInPlan(wmsInPlan.getPlanId()); } }