|
|
@@ -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; |
|
|
|
} |
|
|
|
} |