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