From 467b1e15486c2d09451ce0c69a4c037fe157562e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B1=A4=E9=94=A6=E7=A7=91?= <32996823@qq.com> Date: Thu, 28 Nov 2024 10:52:31 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=84=E8=A3=85=E4=BB=BB=E5=8A=A1=E5=9F=BA?= =?UTF-8?q?=E7=A1=80=E7=89=A9=E6=96=99=E5=87=BA=E5=BA=93=E6=B5=81=E7=A8=8B?= =?UTF-8?q?=E6=8B=86=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../md/controller/WmsOutPlanController.java | 6 +-- .../service/impl/WmsOutTaskServiceImpl.java | 48 ++++++++++++++++++- .../wm/service/impl/WmsZdTaskServiceImpl.java | 5 +- 3 files changed, 52 insertions(+), 7 deletions(-) diff --git a/ktg-mes/src/main/java/com/ktg/mes/md/controller/WmsOutPlanController.java b/ktg-mes/src/main/java/com/ktg/mes/md/controller/WmsOutPlanController.java index 6233cb9..297f517 100644 --- a/ktg-mes/src/main/java/com/ktg/mes/md/controller/WmsOutPlanController.java +++ b/ktg-mes/src/main/java/com/ktg/mes/md/controller/WmsOutPlanController.java @@ -51,9 +51,9 @@ public class WmsOutPlanController extends BaseController { @PreAuthorize("@ss.hasPermi('md:PLAN:list')") @GetMapping("/list") public TableDataInfo list(WmsOutPlan wmsOutPlan) { - System.out.println("==================================================="); - System.out.println(JSON.toJSONString(this.aP0AEService.selectAllAP0AE())); - System.out.println("==================================================="); +// System.out.println("==================================================="); +// System.out.println(JSON.toJSONString(this.aP0AEService.selectAllAP0AE())); +// System.out.println("==================================================="); startPage(); List list = wmsOutPlanService.selectWmsOutPlanList(wmsOutPlan); diff --git a/ktg-mes/src/main/java/com/ktg/mes/md/service/impl/WmsOutTaskServiceImpl.java b/ktg-mes/src/main/java/com/ktg/mes/md/service/impl/WmsOutTaskServiceImpl.java index f7a8323..246d159 100644 --- a/ktg-mes/src/main/java/com/ktg/mes/md/service/impl/WmsOutTaskServiceImpl.java +++ b/ktg-mes/src/main/java/com/ktg/mes/md/service/impl/WmsOutTaskServiceImpl.java @@ -5,7 +5,9 @@ import com.ktg.mes.md.domain.*; import com.ktg.mes.md.mapper.*; import com.ktg.mes.md.service.IWmsOutTaskService; import com.ktg.mes.wm.domain.WmStorageArea; +import com.ktg.mes.wm.domain.WmsZdTask; import com.ktg.mes.wm.mapper.WmStorageAreaMapper; +import com.ktg.mes.wm.mapper.WmsZdTaskMapper; import com.ktg.mes.wm.service.IWmStorageAreaService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -47,6 +49,9 @@ public class WmsOutTaskServiceImpl implements IWmsOutTaskService { @Autowired private WmStorageAreaMapper wmStorageAreaMapper; + @Autowired + private WmsZdTaskMapper wmsZdTaskMapper; + @Autowired private MyConfig myConfig; @@ -217,16 +222,57 @@ public class WmsOutTaskServiceImpl implements IWmsOutTaskService { 1 ); - this.toolSetting(wmsOutPlanDetailEntity); +// this.toolSetting(wmsOutPlanDetailEntity); } // 更新出库任务状态 wmsOutTask.setTaskState("1"); wmsOutTaskMapper.updateWmsOutTask(wmsOutTask); + + // 完成标识 + boolean flag = true; + + // 判断是否来自组装任务 + WmsZdTask wmsZdTaskWrapper = new WmsZdTask(); + wmsZdTaskWrapper.setCode(wmsOutTask.getWmsOutPlanCode()); + List wmsZdTaskList = wmsZdTaskMapper.selectWmsZdTaskList(wmsZdTaskWrapper); + if (!wmsZdTaskList.isEmpty()){ + // 获取组装任务 + WmsZdTask wmsZdTask = wmsZdTaskList.get(0); + + // 检测是否完成 + WmsOutTask wmsOutTaskWrapper = new WmsOutTask(); + wmsOutTaskWrapper.setWmsOutPlanCode(wmsZdTask.getCode()); + List wmsOutTaskList = wmsOutTaskMapper.selectWmsOutTaskList(wmsOutTaskWrapper); + + // 遍历状态 + for (WmsOutTask item: wmsOutTaskList){ + if (Objects.equals("0", item.getTaskState())) { + flag = false; + break; + } + } + } + + if (flag) { this.wmsZdTaskFinish(wmsOutTask.getWmsOutPlanCode()); } } + return true; } + public void wmsZdTaskFinish(String planCode){ + WmsZdTask wmsZdTaskWrapper = new WmsZdTask(); + wmsZdTaskWrapper.setCode(planCode); + List wmsZdTaskList = wmsZdTaskMapper.selectWmsZdTaskList(wmsZdTaskWrapper); + + if (!wmsZdTaskList.isEmpty()) { + // 获取组装任务 更新状态 + WmsZdTask wmsZdTask = wmsZdTaskList.get(0); + wmsZdTask.setStatus("1"); + wmsZdTaskMapper.updateWmsZdTask(wmsZdTask); + } + } + public void toolSetting(WmsOutPlanDetailEntity wmsOutPlanDetailEntity) throws JAXBException { // 读取xml配置文件 File xmlFile = new File(myConfig.getToolSettingXmlPath()); diff --git a/ktg-mes/src/main/java/com/ktg/mes/wm/service/impl/WmsZdTaskServiceImpl.java b/ktg-mes/src/main/java/com/ktg/mes/wm/service/impl/WmsZdTaskServiceImpl.java index e7d58e7..4d25949 100644 --- a/ktg-mes/src/main/java/com/ktg/mes/wm/service/impl/WmsZdTaskServiceImpl.java +++ b/ktg-mes/src/main/java/com/ktg/mes/wm/service/impl/WmsZdTaskServiceImpl.java @@ -254,7 +254,6 @@ public class WmsZdTaskServiceImpl implements IWmsZdTaskService if ("ITEM".equals(wmsBaseKnife.getItemOrProduct())) rfid = wmsBaseKnife.getRfid(); wmsBaseKnife.setZdTaskId(zdTask.getWmsZdTaskId()); wmsBaseKnife.setIsLocked(1); - wmsBaseKnife.setKnifeFineState(2); wmsBaseKnife.setLockedStartTime(technologyBom.getLockedStartTime()); wmsBaseKnife.setLockedEndTime(technologyBom.getLockedEndTime()); wmsBaseKnife.setParentId(baseKnife.getBaseKnifeId()); @@ -353,7 +352,7 @@ public class WmsZdTaskServiceImpl implements IWmsZdTaskService wmsOutTask.setMdItemCode(outPlanDetail.getMdItemCode()); wmsOutTask.setMdItemName(outPlanDetail.getMdItemName()); wmsOutTask.setMdItemUnit(outPlanDetail.getMdItemUnit()); - wmsOutTask.setTaskState("1"); + wmsOutTask.setTaskState("0"); wmsOutTask.setRecipientUsername(""); wmsOutTask.setCreateBy(getUsername()); wmsOutTask.setCreateTime(DateUtils.getNowDate()); @@ -362,7 +361,7 @@ public class WmsZdTaskServiceImpl implements IWmsZdTaskService }); // 更新组装任务 - zdTask.setStatus("1"); + zdTask.setStatus("3"); wmsZdTaskMapper.updateWmsZdTask(zdTask); return AjaxResult.success(); }