|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 构造返回结果对象 |
|
|
// 构造返回结果对象 |
|
|
List<WarningRecordVo> warningRecordVoList = this.buildWarningRecordVoList(warningRecordList); |
|
|
List<WarningRecordVo> warningRecordVoList = this.buildWarningRecordVoList(warningRecordList); |
|
|
|
|
|
|
|
|
for (WarningRecordVo warningRecordVo : warningRecordVoList) { |
|
|
|
|
|
log.info("预警记录, warningRecordVo = {}", warningRecordVo); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return JsonResult.success(warningRecordVoList); |
|
|
return JsonResult.success(warningRecordVoList); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private List<WarningRecordVo> buildWarningRecordVoList(List<WarningRecord> warningRecordList) { |
|
|
private List<WarningRecordVo> buildWarningRecordVoList(List<WarningRecord> warningRecordList) { |
|
|
List<WarningRecordVo> warningRecordVoList = WarningRecordConverMapper.INSTANCE.fromWarningRecordListToWarningRecordListVoList(warningRecordList); |
|
|
List<WarningRecordVo> warningRecordVoList = WarningRecordConverMapper.INSTANCE.fromWarningRecordListToWarningRecordListVoList(warningRecordList); |
|
|
ThMission oldMission; |
|
|
|
|
|
ThMission newMission; |
|
|
|
|
|
|
|
|
ThMission mission; |
|
|
for (WarningRecordVo warningRecordVo : warningRecordVoList) { |
|
|
for (WarningRecordVo warningRecordVo : warningRecordVoList) { |
|
|
oldMission = missionMapper.selectOne(new LambdaQueryWrapper<ThMission>() |
|
|
|
|
|
.eq(ThMission::getId, warningRecordVo.getMissionId()) |
|
|
|
|
|
.eq(ThMission::getMark, MarkTypeEnum.VALID.getCode())); |
|
|
|
|
|
newMission = missionMapper.selectOne(new LambdaQueryWrapper<ThMission>() |
|
|
|
|
|
|
|
|
mission = missionMapper.selectOne(new LambdaQueryWrapper<ThMission>() |
|
|
.eq(ThMission::getId, warningRecordVo.getEmergencyMissionId()) |
|
|
.eq(ThMission::getId, warningRecordVo.getEmergencyMissionId()) |
|
|
.eq(ThMission::getMark, MarkTypeEnum.VALID.getCode())); |
|
|
.eq(ThMission::getMark, MarkTypeEnum.VALID.getCode())); |
|
|
if (oldMission.getAirportId().equals(newMission.getAirportId())) { |
|
|
|
|
|
if (0 == oldMission.getEmergencyDataMissionId()) { |
|
|
|
|
|
warningRecordVo.setStatus(oldMission.getStatus()); |
|
|
|
|
|
} else { |
|
|
|
|
|
warningRecordVo.setStatus(newMission.getStatus()); |
|
|
|
|
|
} |
|
|
|
|
|
} else { |
|
|
|
|
|
warningRecordVo.setStatus(newMission.getStatus()); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
warningRecordVo.setStatus(mission.getStatus()); |
|
|
} |
|
|
} |
|
|
return warningRecordVoList; |
|
|
return warningRecordVoList; |
|
|
} |
|
|
} |