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()); } }