diff --git a/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/service/impl/CallItemServiceImpl.java b/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/service/impl/CallItemServiceImpl.java index 961023f5..f1ecba2b 100644 --- a/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/service/impl/CallItemServiceImpl.java +++ b/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/service/impl/CallItemServiceImpl.java @@ -159,6 +159,7 @@ public class CallItemServiceImpl extends ServiceImpl i List list = new ArrayList<>(); list.add("CJZR"); list.add("ADMINISTRATORS"); + list.add("CJDD"); callItem.setCallType(Constants.CALL_TYPE_MATERIAL); Integer cnt = userGroupMapper.findUserGroupByUser(site, user, list); if (cnt > 0){ diff --git a/equip/src/main/java/com/foreverwin/mesnac/equip/controller/ResourceInspectPlanController.java b/equip/src/main/java/com/foreverwin/mesnac/equip/controller/ResourceInspectPlanController.java index 13383658..6fd60238 100644 --- a/equip/src/main/java/com/foreverwin/mesnac/equip/controller/ResourceInspectPlanController.java +++ b/equip/src/main/java/com/foreverwin/mesnac/equip/controller/ResourceInspectPlanController.java @@ -175,7 +175,7 @@ public class ResourceInspectPlanController { try { resourceInspectPlanService.deleteInspectionPlanByHandle(resourceInspectPlan); } catch (Exception e) { - R.failed("计划删除失败:" + e.getMessage()); + return R.failed("计划删除失败:" + e.getMessage()); } return R.ok(); } diff --git a/equip/src/main/java/com/foreverwin/mesnac/equip/service/impl/ResourceInspectPlanServiceImpl.java b/equip/src/main/java/com/foreverwin/mesnac/equip/service/impl/ResourceInspectPlanServiceImpl.java index 3acc29fb..6114482e 100644 --- a/equip/src/main/java/com/foreverwin/mesnac/equip/service/impl/ResourceInspectPlanServiceImpl.java +++ b/equip/src/main/java/com/foreverwin/mesnac/equip/service/impl/ResourceInspectPlanServiceImpl.java @@ -106,6 +106,12 @@ public class ResourceInspectPlanServiceImpl extends ServiceImpl resourceInspectTasks = resourceInspectTaskService.selectList(resourceInspectTask); + if (!planHandle.getScheduleType().equals(resourceInspectPlan.getScheduleType()) && resourceInspectTasks.size() > 0){ + throw BusinessException.build("已创建任务的点检计划,不能修改排程方式!"); + } // 保留创建人员和创建时间 String createUser = planHandle.getCreateUser(); LocalDateTime createdDateTime = planHandle.getCreatedDateTime(); @@ -209,6 +215,12 @@ public class ResourceInspectPlanServiceImpl extends ServiceImpl resourceInspectTasks = resourceInspectTaskService.selectList(resourceInspectTask); + if (resourceInspectTasks != null && resourceInspectTasks.size() > 0){ + throw BusinessException.build("当前计划已创建任务,不允许删除!"); + } // 设备清单表数据删除 ResourceInspectResource resourceInspectResource = new ResourceInspectResource(); resourceInspectResource.setResourceInspectPlanBo(handle); @@ -294,6 +306,9 @@ public class ResourceInspectPlanServiceImpl extends ServiceImpl resourceInspectTaskList = resourceInspectTaskMapper.findResourceInspectTaskList(resourceInspectTaskDto); - if (resourceInspectTaskList.size() == 1){ + if (resourceInspectTaskList.size() > 0 ){ ResourceInspectTask resourceInspectTask = new ResourceInspectTask(); resourceInspectTask.setHandle(resourceInspectTaskList.get(0).getHandle()); ResourceInspectTask resourceInspectTaskAll = resourceInspectTaskService.getResourceInspectTaskAll(resourceInspectTask); @@ -241,9 +242,9 @@ public class ResourceInspectTaskServiceImpl extends ServiceImpl 1){ + /*if (resourceInspectTaskList.size() > 1){ throw BusinessException.build("当前设备当日点检任务不止一个!"); - } + }*/ throw BusinessException.build("未找到当日的点检任务!"); } diff --git a/equip/src/main/resources/mapper/ResourceInspectTaskMapper.xml b/equip/src/main/resources/mapper/ResourceInspectTaskMapper.xml index 401c19b7..30a34cd2 100644 --- a/equip/src/main/resources/mapper/ResourceInspectTaskMapper.xml +++ b/equip/src/main/resources/mapper/ResourceInspectTaskMapper.xml @@ -660,6 +660,7 @@ WHERE (ZG.USER_GROUP_BO IS NULL OR (ZG.USER_GROUP_BO IS NOT NULL AND UGM.USER_OR_GROUP_GBO = #{currentUser})) AND RIK.SITE = #{site} + AND TASK_CREATE_DATE <= (SELECT TO_DATE(TO_CHAR(SYSDATE+1,'yyyy-mm-dd') || ' 00:00:00','yyyy-MM-dd hh24:mi-ss') -8/24 FROM DUAL) AND RIK.TASK_NO = #{taskNo} @@ -687,7 +688,7 @@ AND WCM.WORK_CENTER_BO = #{workCenter} - ORDER BY RIK.TASK_NO ASC + ORDER BY RIK.TASK_CREATE_DATE DESC @@ -711,9 +712,13 @@ diff --git a/production/src/main/resources/mapper/SfcCrossMapper.xml b/production/src/main/resources/mapper/SfcCrossMapper.xml index b3798e1d..656b6743 100644 --- a/production/src/main/resources/mapper/SfcCrossMapper.xml +++ b/production/src/main/resources/mapper/SfcCrossMapper.xml @@ -160,7 +160,7 @@