Browse Source

根据ID获取预警信息,增加机场和航线字段

tags/v1.2.0^2
wanjing 1 year ago
parent
commit
d6ac2ca000
2 changed files with 46 additions and 13 deletions
  1. +20
    -0
      tuoheng-admin/src/main/java/com/tuoheng/admin/entity/vo/warning/WarningVo.java
  2. +26
    -13
      tuoheng-admin/src/main/java/com/tuoheng/admin/service/warning/query/QueryWarningByIdService.java

+ 20
- 0
tuoheng-admin/src/main/java/com/tuoheng/admin/entity/vo/warning/WarningVo.java View File

@@ -77,6 +77,26 @@ public class WarningVo extends BaseEntity implements Serializable {
*/
private Integer messageRead;

/**
* 巡检机场
*/
private Integer airportId;

/**
* 巡检机场名称
*/
private String airportName;

/**
* 巡检线路
*/
private Integer inspectionLine;

/**
* 巡检线路名称
*/
private String inspectionLineName;


/**
* 问题类型

+ 26
- 13
tuoheng-admin/src/main/java/com/tuoheng/admin/service/warning/query/QueryWarningByIdService.java View File

@@ -5,11 +5,13 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.tuoheng.admin.conver.WarningConverMapper;
import com.tuoheng.admin.entity.domain.Question;
import com.tuoheng.admin.entity.domain.ThMission;
import com.tuoheng.admin.entity.domain.Warning;
import com.tuoheng.admin.entity.vo.warning.WarningListVo;
import com.tuoheng.admin.entity.vo.warning.WarningVo;
import com.tuoheng.admin.enums.MarkEnum;
import com.tuoheng.admin.mapper.QuestionMapper;
import com.tuoheng.admin.mapper.ThMissionMapper;
import com.tuoheng.admin.mapper.WarningMapper;
import com.tuoheng.common.exception.ServiceException;
import com.tuoheng.common.utils.JsonResult;
@@ -36,13 +38,17 @@ public class QueryWarningByIdService {
@Autowired
private WarningMapper warningMapper;

@Autowired
private ThMissionMapper missionMapper;

@Autowired
private QuestionMapper questionMapper;

public JsonResult getOneById(Integer id) {
// log.info("进入根据查询Id查询预警信息业务");
User user = ShiroUtils.getUserInfo();
Integer tenantId = user.getTenantId();
// User user = ShiroUtils.getUserInfo();
// Integer tenantId = user.getTenantId();
Integer tenantId = 2;
JsonResult result = this.check(tenantId, id);
if (0 != result.getCode()) {
log.info("根据Id查询预警信息业务:校验失败:{}", result.getMsg());
@@ -84,21 +90,28 @@ public class QueryWarningByIdService {
*/
private WarningVo buildWarningVo(Warning warning) {
WarningVo warningVo = WarningConverMapper.INSTANCE.fromWarningToWarningVo(warning);
// ThMission mission = missionMapper.selectById(warningVo.getMissionId());
ThMission mission = missionMapper.selectById(168);
if (ObjectUtil.isNotNull(mission)) {
warningVo.setAirportId(mission.getAirportId());
warningVo.setAirportName(mission.getAirportName());
warningVo.setInspectionLine(mission.getInspectionLine());
warningVo.setInspectionLineName(mission.getInspectionLineName());
}
Question question = questionMapper.selectOne(Wrappers.<Question>lambdaQuery()
.eq(Question::getId, warning.getQuestionId())
.eq(Question::getMark, MarkEnum.VALID.getCode()));
if (ObjectUtil.isNull(question)) {
return warningVo;
if (ObjectUtil.isNotNull(question)) {
warningVo.setQuestionType(question.getType());
warningVo.setQuestionName(question.getQuestionName());
warningVo.setQuestionDesc(question.getQuestionDesc());
warningVo.setFileCode(question.getFileCode());
warningVo.setFileName(question.getFileName());
warningVo.setFileOriginalUrl(question.getFileOriginalUrl());
warningVo.setFileMarkerUrl(question.getFileMarkerUrl());
warningVo.setLng(question.getLng());
warningVo.setLat(question.getLat());
}
warningVo.setQuestionType(question.getType());
warningVo.setQuestionName(question.getQuestionName());
warningVo.setQuestionDesc(question.getQuestionDesc());
warningVo.setFileCode(question.getFileCode());
warningVo.setFileName(question.getFileName());
warningVo.setFileOriginalUrl(question.getFileOriginalUrl());
warningVo.setFileMarkerUrl(question.getFileMarkerUrl());
warningVo.setLng(question.getLng());
warningVo.setLat(question.getLat());
return warningVo;
}
}

Loading…
Cancel
Save