|
|
@@ -164,6 +164,9 @@ public class InspectAppServiceImpl extends ServiceImpl<InspectAppMapper, TauvIns |
|
|
|
if (inspectApp == null) { |
|
|
|
return response.failure("巡检任务不存在"); |
|
|
|
} |
|
|
|
if (inspectApp.getStatus() == 3) { |
|
|
|
return response.failure("当前任务已结束,无需再次结束"); |
|
|
|
} |
|
|
|
inspectApp.setStatus(3); |
|
|
|
inspectApp.setEndTime(DateUtil.now()); |
|
|
|
int result = inspectAppMapper.updateById(inspectApp); |
|
|
@@ -189,7 +192,10 @@ public class InspectAppServiceImpl extends ServiceImpl<InspectAppMapper, TauvIns |
|
|
|
if (inspectApp == null) { |
|
|
|
return response.failure("巡检任务不存在"); |
|
|
|
} |
|
|
|
inspectApp.setStatus(3); |
|
|
|
if (inspectApp.getStatus() != 1) { |
|
|
|
return response.failure("当前任务无法暂停"); |
|
|
|
} |
|
|
|
inspectApp.setStatus(2); |
|
|
|
int result = inspectAppMapper.updateById(inspectApp); |
|
|
|
if (result == 0) { |
|
|
|
return response.failure("巡检任务状态更新失败"); |
|
|
@@ -197,6 +203,36 @@ public class InspectAppServiceImpl extends ServiceImpl<InspectAppMapper, TauvIns |
|
|
|
return response.success("巡检暂停成功"); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 重新开启巡检 |
|
|
|
* |
|
|
|
* @param inspectPauseDto 参数 |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public Response inspectReStart(InspectPauseDto inspectPauseDto) { |
|
|
|
// 巡检ID验证 |
|
|
|
if (inspectPauseDto.getInspectId() == null || inspectPauseDto.getInspectId() <= 0) { |
|
|
|
return response.failure("巡检任务不存在"); |
|
|
|
} |
|
|
|
TauvInspectApp inspectApp = inspectAppMapper.selectById(inspectPauseDto.getInspectId()); |
|
|
|
if (inspectApp == null) { |
|
|
|
return response.failure("巡检任务不存在"); |
|
|
|
} |
|
|
|
if (inspectApp.getStatus() == 1) { |
|
|
|
return response.failure("当前任务正在进行中,无需重新开始"); |
|
|
|
} |
|
|
|
if (inspectApp.getStatus() == 3) { |
|
|
|
return response.failure("当前任务已完整,无法重新开始"); |
|
|
|
} |
|
|
|
inspectApp.setStatus(1); |
|
|
|
int result = inspectAppMapper.updateById(inspectApp); |
|
|
|
if (result == 0) { |
|
|
|
return response.failure("操作失败"); |
|
|
|
} |
|
|
|
return response.success("操作成功"); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 获取巡检记录列表 |
|
|
|
* |