瀏覽代碼

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

tags/v1.2.0^2
wanjing 1 年之前
父節點
當前提交
d6ac2ca000
共有 2 個文件被更改,包括 46 次插入13 次删除
  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 查看文件

*/ */
private Integer messageRead; 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 查看文件

import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.tuoheng.admin.conver.WarningConverMapper; import com.tuoheng.admin.conver.WarningConverMapper;
import com.tuoheng.admin.entity.domain.Question; 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.domain.Warning;
import com.tuoheng.admin.entity.vo.warning.WarningListVo; import com.tuoheng.admin.entity.vo.warning.WarningListVo;
import com.tuoheng.admin.entity.vo.warning.WarningVo; import com.tuoheng.admin.entity.vo.warning.WarningVo;
import com.tuoheng.admin.enums.MarkEnum; import com.tuoheng.admin.enums.MarkEnum;
import com.tuoheng.admin.mapper.QuestionMapper; import com.tuoheng.admin.mapper.QuestionMapper;
import com.tuoheng.admin.mapper.ThMissionMapper;
import com.tuoheng.admin.mapper.WarningMapper; import com.tuoheng.admin.mapper.WarningMapper;
import com.tuoheng.common.exception.ServiceException; import com.tuoheng.common.exception.ServiceException;
import com.tuoheng.common.utils.JsonResult; import com.tuoheng.common.utils.JsonResult;
@Autowired @Autowired
private WarningMapper warningMapper; private WarningMapper warningMapper;


@Autowired
private ThMissionMapper missionMapper;

@Autowired @Autowired
private QuestionMapper questionMapper; private QuestionMapper questionMapper;


public JsonResult getOneById(Integer id) { public JsonResult getOneById(Integer id) {
// log.info("进入根据查询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); JsonResult result = this.check(tenantId, id);
if (0 != result.getCode()) { if (0 != result.getCode()) {
log.info("根据Id查询预警信息业务:校验失败:{}", result.getMsg()); log.info("根据Id查询预警信息业务:校验失败:{}", result.getMsg());
*/ */
private WarningVo buildWarningVo(Warning warning) { private WarningVo buildWarningVo(Warning warning) {
WarningVo warningVo = WarningConverMapper.INSTANCE.fromWarningToWarningVo(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() Question question = questionMapper.selectOne(Wrappers.<Question>lambdaQuery()
.eq(Question::getId, warning.getQuestionId()) .eq(Question::getId, warning.getQuestionId())
.eq(Question::getMark, MarkEnum.VALID.getCode())); .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; return warningVo;
} }
} }

Loading…
取消
儲存