From 3975d8885aa85d183153e240a5b40f7e3e0cbbd1 Mon Sep 17 00:00:00 2001 From: Ledo Date: Sat, 18 Jan 2025 15:04:07 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=9D=E5=AD=98=E5=90=8E=E6=8F=90=E4=BA=A4?= =?UTF-8?q?=E6=97=A0=E6=B3=95=E6=92=A4=E5=9B=9E=E9=97=AE=E9=A2=98=E8=A7=A3?= =?UTF-8?q?=E5=86=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../taskdispatch/TaskDispatchDetailDO.java | 1 - .../taskdispatch/TaskDispatchServiceImpl.java | 16 ++++++---------- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/taskdispatch/TaskDispatchDetailDO.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/taskdispatch/TaskDispatchDetailDO.java index d31856d..03a6a6f 100644 --- a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/taskdispatch/TaskDispatchDetailDO.java +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/taskdispatch/TaskDispatchDetailDO.java @@ -51,7 +51,6 @@ public class TaskDispatchDetailDO extends BaseDO { /** * 派工数量 */ - @TableField(exist = false) private Integer beforeAmount; /** * 工序要点 diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/taskdispatch/TaskDispatchServiceImpl.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/taskdispatch/TaskDispatchServiceImpl.java index 6c21cb4..c337c63 100644 --- a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/taskdispatch/TaskDispatchServiceImpl.java +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/taskdispatch/TaskDispatchServiceImpl.java @@ -127,7 +127,6 @@ public class TaskDispatchServiceImpl implements TaskDispatchService { throw exception(PROCESS_BOM_DETAIL_NOT_EXISTS); } } - // 更新 TaskDispatchDO updateObj = BeanUtils.toBean(updateReqVO, TaskDispatchDO.class); if(!updateObj.canOperate(operateTypeEnum)){ @@ -136,11 +135,9 @@ public class TaskDispatchServiceImpl implements TaskDispatchService { // 明细工序状态更新 if(operateTypeEnum == OperateTypeEnum.SUBMIT){ updateReqVO.getTaskDispatchDetails().forEach(taskDispatchDetailDO -> { - if(taskDispatchDetailDO.getProcedureStatus().intValue() == 0|| - (taskDispatchDetailDO.getBeforeAmount()!=null && taskDispatchDetailDO.getAmount()!=null && taskDispatchDetailDO.getAmount() != taskDispatchDetailDO.getBeforeAmount()) - || (taskDispatchDetailDO.getBeforeAmount() == null && taskDispatchDetailDO.getAmount() != null) - || (taskDispatchDetailDO.getBeforeAmount() != null && taskDispatchDetailDO.getAmount() == null) + if(taskDispatchDetailDO.getProcedureStatus().intValue() == 0||taskDispatchDetailDO.getBeforeAmount()!=taskDispatchDetailDO.getAmount() ){ + taskDispatchDetailDO.setBeforeAmount(taskDispatchDetailDO.getAmount()); taskDispatchDetailDO.setProcedureStatus(TaskDispatchProcedureStatusEnum.SUBMITTED.getCode()); } }); @@ -155,7 +152,7 @@ public class TaskDispatchServiceImpl implements TaskDispatchService { taskDispatchDetailDO.setProcedureStatus(TaskDispatchProcedureStatusEnum.DEFAULT.getCode()); } - }); + }); } updateObj.setDispatchStatus(TaskDispatchStatusEnum.valueOf(updateReqVO.getActive()).getCode()); taskDispatchMapper.updateById(updateObj); @@ -320,10 +317,6 @@ public class TaskDispatchServiceImpl implements TaskDispatchService { List taskDispatchDetailDOS = taskDispatchDetailMapper.selectListByDispatchId(dispatchId); for (TaskDispatchDetailDO taskDispatchDetailDO : taskDispatchDetailDOS) { taskDispatchDetailDO.setBeginProduce(taskReportMapper.hasReport(taskDispatchDetailDO.getId())) ; - if (taskDispatchDetailDO.getAmount()!=null){ - - taskDispatchDetailDO.setBeforeAmount(taskDispatchDetailDO.getAmount()); - } } return taskDispatchDetailDOS; } @@ -630,6 +623,9 @@ public class TaskDispatchServiceImpl implements TaskDispatchService { taskDispatchDetailMapper.updateBatch(updateList); } if(!insertList.isEmpty()) { + for (TaskDispatchDetailDO taskDispatchDetailDO : insertList) { + taskDispatchDetailDO.setBeforeAmount(taskDispatchDetailDO.getAmount()); + } taskDispatchDetailMapper.insertBatch(insertList); //如果插入不为空区分是按人还是按岗位 // Map> groupedByType = insertList.stream().collect(Collectors.groupingBy(vo -> vo.getDispatchType() == null ? 0: vo.getDispatchType()));