Merge remote-tracking branch 'origin/master'

master
赵嘉伟 3 years ago
commit 8d2dc663a2

@ -165,20 +165,24 @@
AND ZSD.SFC = #{sfc}
</if>
<if test="routerType != null and routerType != ''" >
<if test="routerType = 'C'.toString()" >
AND RU.ROUTER_TYPE = #{routerType}
</if>
<if test="routerType != 'C'.toString()" >
AND RU.ROUTER_TYPE != #{routerType}
</if>
<choose>
<when test="routerType != 'OTHER'.toString()">
AND RU.ROUTER_TYPE = #{routerType}
</when>
<otherwise>
AND RU.ROUTER_TYPE != 'C'
</otherwise>
</choose>
</if>
<if test="operationStatus != null and operationStatus != ''" >
<if test="operationStatus = 'OTHER'.toString()" >
AND ZSD.DISPATCH_STATUS != 'START' AND ZSD.DISPATCH_STATUS != 'COMPLETE' AND ZSD.DISPATCH_STATUS != 'CANCEL'
</if>
<if test="operationStatus != 'OTHER'.toString()" >
AND ZSD.DISPATCH_STATUS = #{operationStatus}
</if>
<choose>
<when test="operationStatus != 'OTHER'.toString()">
AND ZSD.DISPATCH_STATUS = #{operationStatus}
</when>
<otherwise>
AND ZSD.DISPATCH_STATUS != 'START' AND ZSD.DISPATCH_STATUS != 'COMPLETE' AND ZSD.DISPATCH_STATUS != 'CANCEL'
</otherwise>
</choose>
</if>
<if test="startFromDate != null and startFromDate != ''" >
AND ZSD.PLANNED_START_DATE >= TO_DATE(#{startFromDate}, 'YYYY-MM-DD') - 8/24

@ -206,6 +206,7 @@ public class ResourceRepairTaskServiceImpl extends ServiceImpl<ResourceRepairTas
String status = resourceRepairTask.getStatus();
String handle = resourceRepairTask.getHandle();
String user = CommonMethods.getUser();
LocalDateTime now = LocalDateTime.now();
ResourceRepairTask repairTask = resourceRepairTaskService.getById(handle);
String site = repairTask.getSite();
switch (status){
@ -215,12 +216,12 @@ public class ResourceRepairTaskServiceImpl extends ServiceImpl<ResourceRepairTas
spare.setCreateUser(user);
spare.setHandle(HandleEnum.RESOURCE_INSPECT_TASK_SPARE.getHandle(site,UUID.randomUUID().toString()));
spare.setResourceInspectTaskBo(handle);
spare.setCreatedDateTime(LocalDateTime.now());
spare.setCreatedDateTime(now);
}
resourceInspectTaskSpareService.saveBatch(spareList);
repairTask.setSpareList(spareList);
// 完成时间、维修人员
repairTask.setActualCompleteDate(LocalDateTime.now());
repairTask.setActualCompleteDate(now);
String repairUsers = resourceRepairTask.getRepairUsers();
String[] split = repairUsers.split(",");
for (int i = 0; i < split.length; i++) {
@ -251,16 +252,31 @@ public class ResourceRepairTaskServiceImpl extends ServiceImpl<ResourceRepairTas
ResourceInspectTask resourceInspectTask = new ResourceInspectTask();
resourceInspectTask.setSite(site);
resourceInspectTask.setCategory(Constants.INSPECTION_TYPE_DM);
LocalDate now = LocalDate.now();
LocalDateTime startDate = LocalDateTime.parse(now + "T00:00:00");
LocalDateTime endDate = LocalDateTime.parse(now.plusDays(1) + "T00:00:00");
LocalDate toDay = LocalDate.now();
LocalDateTime startDate = LocalDateTime.parse(toDay + "T00:00:00");
LocalDateTime endDate = LocalDateTime.parse(toDay.plusDays(1) + "T00:00:00");
resourceInspectTask.setPlanStartDate(startDate);
resourceInspectTask.setPlanCompleteDate(endDate);
resourceInspectTask.setResrce(resourceRepairTask.getResourceNo());
List<ResourceInspectTask> inspectTaskList = resourceInspectTaskMapper.getInspectTaskListByCondition(resourceInspectTask);
for (ResourceInspectTask inspectTask:inspectTaskList) {
// 查询到点检结果为NG的设备创建新的当日点检任务
if (Constants.RSESULT_NG.equals(inspectTask.getResult())){
resourceInspectPlanService.autoCreateTaskByResourceInspectTask(inspectTask);
String taskNo = inspectTask.getTaskNo();
String taskStr = taskNo+now;
inspectTask.setTaskNo(taskStr);
inspectTask.setHandle(HandleEnum.RESOURCE_INSPECT_TASK.getHandle(site,taskStr));
inspectTask.setResult("");
inspectTask.setActualCompleteDate(null);
inspectTask.setExecutor("");
inspectTask.setCreatedDateTime(now);
inspectTask.setTaskCreateDate(now);
inspectTask.setPlanStartDate(now);
inspectTask.setActualStartDate(null);
inspectTask.setStatus(Constants.INSPECTION_TASK_STATUS_NEW);
inspectTask.setModifyUser(null);
inspectTask.setModifiedDateTime(null);
resourceInspectTaskMapper.insert(inspectTask);
break;
}
}
@ -269,7 +285,7 @@ public class ResourceRepairTaskServiceImpl extends ServiceImpl<ResourceRepairTas
// 取消代码、取消描述、取消时间、取消人员
repairTask.setCancelCode(resourceRepairTask.getCancelCode());
repairTask.setCancelDescription(resourceRepairTask.getCancelDescription());
repairTask.setCancelDate(LocalDateTime.now());
repairTask.setCancelDate(now);
repairTask.setCancelUser(user);
NwaUser userByUserName = nwaUserService.findUserByUserName(user);
repairTask.setCancelUserName(userByUserName.getFullName());
@ -278,13 +294,13 @@ public class ResourceRepairTaskServiceImpl extends ServiceImpl<ResourceRepairTas
if (repairTask.getWaitStartDate() != null){
throw BusinessException.build("已有等待记录,不能再次进入等待状态!!!");
}else {
repairTask.setWaitStartDate(LocalDateTime.now());
repairTask.setWaitStartDate(now);
repairTask.setWaitDescription(resourceRepairTask.getWaitDescription());
}
break;
case "501":
// 结束时间、等待时长
repairTask.setWaitEndDate(LocalDateTime.now());
repairTask.setWaitEndDate(now);
Duration betweenTime = Duration.between(repairTask.getWaitStartDate(), repairTask.getWaitEndDate());
Long waitMinutes = betweenTime.toMinutes();
double waitHours = waitMinutes.doubleValue()/60.00;
@ -294,7 +310,7 @@ public class ResourceRepairTaskServiceImpl extends ServiceImpl<ResourceRepairTas
// 状态、修改人、修改时间
repairTask.setStatus(status);
repairTask.setModifyUser(user);
repairTask.setModifiedDateTime(LocalDateTime.now());
repairTask.setModifiedDateTime(now);
resourceRepairTaskService.saveOrUpdate(repairTask);
return repairTask;
}

@ -745,6 +745,7 @@
<if test="planStartDate != null">
AND ZRIT.TASK_CREATE_DATE &gt;= #{planStartDate}
</if>
ORDER BY ZRIT.TASK_CREATE_DATE DESC
</select>
<select id="findResourceTaskByResrceAndCategory" resultType="Integer">

Loading…
Cancel
Save