|
|
@@ -29,29 +29,13 @@ public class UpdateEmergencyMissionStatusService { |
|
|
|
*/ |
|
|
|
public void updateStatus(ThMission oldMission, Integer status) { |
|
|
|
log.info("修改应急任务数据, type:{}, emergencyDataMissionId:{}, status={}", oldMission.getType(), oldMission.getEmergencyDataMissionId(), status); |
|
|
|
WarningRecord warningRecord = warningRecordMapper.selectOne(new LambdaQueryWrapper<WarningRecord>() |
|
|
|
.eq(WarningRecord::getMissionId, oldMission.getId()) |
|
|
|
.eq(WarningRecord::getMark, MarkTypeEnum.VALID.getCode()) |
|
|
|
.orderByDesc(WarningRecord::getCreateTime) |
|
|
|
.last(" limit 1")); |
|
|
|
if (ObjectUtil.isNull(warningRecord)) { |
|
|
|
log.info("修改应急任务数据,该巡检任务没有产生预警记录"); |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
ThMission emergencyMission = thMissionMapper.selectOne(new LambdaQueryWrapper<ThMission>() |
|
|
|
.eq(ThMission::getId, warningRecord.getEmergencyMissionId()) |
|
|
|
.eq(ThMission::getEmergencyDataMissionId, oldMission.getId()) |
|
|
|
.eq(ThMission::getMark, MarkEnum.VALID.getCode())); |
|
|
|
if (ObjectUtil.isNull(emergencyMission)) { |
|
|
|
log.info("修改应急任务数据,应急任务不存在"); |
|
|
|
log.info("修改应急任务数据,该巡检任务没有对应的应急任务"); |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
if (0 == emergencyMission.getEmergencyDataMissionId()) { |
|
|
|
log.info("修改应急任务数据,该应急任务,作为独立的任务"); |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
// 在查询一次,保证数据是最新的 |
|
|
|
ThMission mission = thMissionMapper.selectOne(new LambdaQueryWrapper<ThMission>() |
|
|
|
.eq(ThMission::getId, oldMission.getId()) |