소스 검색

重构根据预警ID获取预警记录列表代码

tags/v1.2.0^2
wanjing 1 년 전
부모
커밋
92f16e325b
1개의 변경된 파일3개의 추가작업 그리고 20개의 파일을 삭제
  1. +3
    -20
      tuoheng-admin/src/main/java/com/tuoheng/admin/service/warningrecord/query/QueryWarningRecordListByWarningIdService.java

+ 3
- 20
tuoheng-admin/src/main/java/com/tuoheng/admin/service/warningrecord/query/QueryWarningRecordListByWarningIdService.java 파일 보기

@@ -68,11 +68,6 @@ public class QueryWarningRecordListByWarningIdService {

// 构造返回结果对象
List<WarningRecordVo> warningRecordVoList = this.buildWarningRecordVoList(warningRecordList);

for (WarningRecordVo warningRecordVo : warningRecordVoList) {
log.info("预警记录, warningRecordVo = {}", warningRecordVo);
}

return JsonResult.success(warningRecordVoList);
}

@@ -100,24 +95,12 @@ public class QueryWarningRecordListByWarningIdService {

private List<WarningRecordVo> buildWarningRecordVoList(List<WarningRecord> warningRecordList) {
List<WarningRecordVo> warningRecordVoList = WarningRecordConverMapper.INSTANCE.fromWarningRecordListToWarningRecordListVoList(warningRecordList);
ThMission oldMission;
ThMission newMission;
ThMission mission;
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::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;
}

Loading…
취소
저장