|
|
@@ -241,18 +241,18 @@ public class TaskServiceImpl implements ITaskService { |
|
|
|
.eq(InspectionFile::getInspectionId, record.getInspectionId()) |
|
|
|
.eq(InspectionFile::getMark, 1)); |
|
|
|
|
|
|
|
if(null != record.getWorkCreateTime()){ |
|
|
|
if (null != record.getWorkCreateTime()) { |
|
|
|
ArrayList<Long> leaveTimeList = new ArrayList<>(); |
|
|
|
if(StringUtils.isNotEmpty(inspectionFileList)){ |
|
|
|
if (StringUtils.isNotEmpty(inspectionFileList)) { |
|
|
|
for (InspectionFile inspectionFile : inspectionFileList) { |
|
|
|
ThQuestionType thQuestionType = questionTypeMapper.selectById(inspectionFile.getQuestionTypeId()); |
|
|
|
|
|
|
|
if(ObjectUtils.isNotNull(thQuestionType)){ |
|
|
|
if (ObjectUtils.isNotNull(thQuestionType)) { |
|
|
|
long leaveTimeLong = getLeaveTimeLong(record.getWorkCreateTime(), thQuestionType.getRectification()); |
|
|
|
leaveTimeList.add(leaveTimeLong); |
|
|
|
} |
|
|
|
} |
|
|
|
if(StringUtils.isNotEmpty(leaveTimeList)){ |
|
|
|
if (StringUtils.isNotEmpty(leaveTimeList)) { |
|
|
|
String leaveTimeStr = getLeaveTimeStr(Collections.max(leaveTimeList)); |
|
|
|
record.setLeaveTime(leaveTimeStr); |
|
|
|
} |
|
|
@@ -931,6 +931,15 @@ public class TaskServiceImpl implements ITaskService { |
|
|
|
inspectionQuestionUpdateWrapper.set(ThInspectionQuestion::getWorkCompleteTime, DateUtils.now()); |
|
|
|
inspectionQuestionMapper.update(null, inspectionQuestionUpdateWrapper); |
|
|
|
// 问题处理完成,生成巡检报告 |
|
|
|
Report report = reportMapper.selectOne(Wrappers.<Report>lambdaQuery() |
|
|
|
.eq(BaseEntity::getMark, 1) |
|
|
|
.eq(Report::getTenantId, tenantId) |
|
|
|
.eq(Report::getInspectionId, inspection.getId())); |
|
|
|
|
|
|
|
if (StringUtils.isNotNull(report)) { |
|
|
|
report.setMark(0); |
|
|
|
reportMapper.updateById(report); |
|
|
|
} |
|
|
|
generatePatrolReport(inspectionQuestionItem.getInspectionId()); |
|
|
|
} else { |
|
|
|
Inspection inspectionQuery = inspectionMapper.selectById(inspectionQuestionItem.getInspectionId()); |
|
|
@@ -1126,7 +1135,7 @@ public class TaskServiceImpl implements ITaskService { |
|
|
|
return thDspServiceInst.getDspServiceInstId(); |
|
|
|
} |
|
|
|
|
|
|
|
private long getLeaveTimeLong(Date beginTime, Integer rectification){ |
|
|
|
private long getLeaveTimeLong(Date beginTime, Integer rectification) { |
|
|
|
//进行时间计算 |
|
|
|
DateTime nowTime = DateUtil.date(); |
|
|
|
long leaveTime = 0L; |
|
|
@@ -1143,7 +1152,7 @@ public class TaskServiceImpl implements ITaskService { |
|
|
|
return leaveTime; |
|
|
|
} |
|
|
|
|
|
|
|
private String getLeaveTimeStr(long between){ |
|
|
|
private String getLeaveTimeStr(long between) { |
|
|
|
//进行时间计算 |
|
|
|
DateTime nowTime = DateUtil.date(); |
|
|
|
String leaveTime = ""; |