|
|
|
@ -106,6 +106,12 @@ public class ResourceInspectPlanServiceImpl extends ServiceImpl<ResourceInspectP
|
|
|
|
|
returnStatus = true;
|
|
|
|
|
resourceInspectPlan.setStatus("401");
|
|
|
|
|
}else{
|
|
|
|
|
ResourceInspectTask resourceInspectTask = new ResourceInspectTask();
|
|
|
|
|
resourceInspectTask.setResourceInspectPlanBo(planHandle.getHandle());
|
|
|
|
|
List<ResourceInspectTask> resourceInspectTasks = resourceInspectTaskService.selectList(resourceInspectTask);
|
|
|
|
|
if (!planHandle.getScheduleType().equals(resourceInspectPlan.getScheduleType()) && resourceInspectTasks.size() > 0){
|
|
|
|
|
throw BusinessException.build("已创建任务的点检计划,不能修改排程方式!");
|
|
|
|
|
}
|
|
|
|
|
// 保留创建人员和创建时间
|
|
|
|
|
String createUser = planHandle.getCreateUser();
|
|
|
|
|
LocalDateTime createdDateTime = planHandle.getCreatedDateTime();
|
|
|
|
@ -300,6 +306,9 @@ public class ResourceInspectPlanServiceImpl extends ServiceImpl<ResourceInspectP
|
|
|
|
|
ResourceInspectTask equipInspectTask = setResourceInspectTask(resourceInspectPlan, resourceInspectTask,sign);
|
|
|
|
|
resourceInspectTaskList.add(equipInspectTask);
|
|
|
|
|
taskCreateDate = addTime(frequencyUnit,frequency,taskCreateDate);
|
|
|
|
|
if (taskCreateDate.isAfter(indateEnd)){
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
taskNum--;
|
|
|
|
|
}
|
|
|
|
|
}else{
|
|
|
|
@ -313,12 +322,18 @@ public class ResourceInspectPlanServiceImpl extends ServiceImpl<ResourceInspectP
|
|
|
|
|
ResourceInspectTask equipInspectTask = setResourceInspectTask(resourceInspectPlan, resourceInspectTask,sign);
|
|
|
|
|
resourceInspectTaskList.add(equipInspectTask);
|
|
|
|
|
taskCreateDate = addTime(frequencyUnit,frequency,taskCreateDate);
|
|
|
|
|
if (taskCreateDate.isAfter(indateEnd)){
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}else {
|
|
|
|
|
while (taskCreateDate.isBefore(createdDateTime)){
|
|
|
|
|
taskCreateDate = addTime(frequencyUnit,frequency,taskCreateDate);
|
|
|
|
|
}
|
|
|
|
|
for (int i = 0;i < taskNum;i++){
|
|
|
|
|
if (taskCreateDate.isAfter(indateEnd)){
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
resourceInspectTask.setTaskCreateDate(taskCreateDate);
|
|
|
|
|
ResourceInspectTask equipInspectTask = setResourceInspectTask(resourceInspectPlan, resourceInspectTask,sign);
|
|
|
|
|
resourceInspectTaskList.add(equipInspectTask);
|
|
|
|
|