List<Inspection> getListByBox(@Param("boxSn") String boxSn); | List<Inspection> getListByBox(@Param("boxSn") String boxSn); | ||||
List<Inspection> selectInspectionList(@Param("tenantId") String tenantId); | |||||
} | } |
*/ | */ | ||||
private Inspection buildInspection(User user, String tenantId, AddInspectionRequest addInspectionRequest) { | private Inspection buildInspection(User user, String tenantId, AddInspectionRequest addInspectionRequest) { | ||||
Inspection inspection = InspectionConverMapper.INSTANCE.fromAddInspectionRequestToInspection(addInspectionRequest); | Inspection inspection = InspectionConverMapper.INSTANCE.fromAddInspectionRequestToInspection(addInspectionRequest); | ||||
//Inspection inspection = new Inspection(); | |||||
//BeanUtils.copyProperties(addInspectionRequest,inspection); | |||||
String code = DateUtils.generateCode("XJRW"); | String code = DateUtils.generateCode("XJRW"); | ||||
inspection.setType(1); | inspection.setType(1); | ||||
inspection.setCode(code); | inspection.setCode(code); | ||||
.eq(DspServiceInst::getIsDefault, CommonConstants.ONE)); | .eq(DspServiceInst::getIsDefault, CommonConstants.ONE)); | ||||
inspection.setDspServiceInstId(dspServiceInst.getDspServiceInstId()); | inspection.setDspServiceInstId(dspServiceInst.getDspServiceInstId()); | ||||
} | } | ||||
if (InspectionTypeEnum.AIRPORT.getCode() == addInspectionRequest.getInspectionType()) { | |||||
// 机场巡逻,只有直播,将isLive设置为1 | |||||
if (InspectionTypeEnum.AIRPORT.getCode() == addInspectionRequest.getInspectionType() || | |||||
InspectionTypeEnum.MABNNEDFLIGHT.getCode() == addInspectionRequest.getInspectionType()) { | |||||
inspection.setIsLive(1); | inspection.setIsLive(1); | ||||
} | } | ||||
return inspection; | return inspection; |
log.info("进入查询任务列表数据失败:{}",jsonResult.getMsg()); | log.info("进入查询任务列表数据失败:{}",jsonResult.getMsg()); | ||||
return JsonResult.error("查询任务数据失败"); | return JsonResult.error("查询任务数据失败"); | ||||
} | } | ||||
List<Inspection> inspectionList = inspectionMapper.selectList(Wrappers.<Inspection>lambdaQuery() | |||||
.eq(Inspection::getMark, MarkEnum.VALID.getCode()) | |||||
.eq(Inspection::getTenantId, tenantId) | |||||
.notIn(Inspection::getStatus, InspectionStatusEnum.FLIGHT_FAILED.getCode()) | |||||
.orderByAsc(Inspection::getStatus) | |||||
.orderByDesc(Inspection::getCreateTime) | |||||
.last("limit 5")); | |||||
return JsonResult.success(inspectionList); | |||||
List<Inspection> inspectionsList = inspectionMapper.selectInspectionList(tenantId); | |||||
log.info("查询出来任务列表:{}",inspectionsList); | |||||
return JsonResult.success(inspectionsList); | |||||
} | } | ||||
pilotTaskRequest.setTaskStartTime(inspection.getInspectionTime()); | pilotTaskRequest.setTaskStartTime(inspection.getInspectionTime()); | ||||
pilotTaskRequest.setRemark(inspection.getNote()); | pilotTaskRequest.setRemark(inspection.getNote()); | ||||
//直播 | |||||
pilotTaskRequest.setIsLive(inspection.getIsLive()); | |||||
//直播 大气飞手任务只有直播 | |||||
pilotTaskRequest.setIsLive(1); | |||||
//pilotTaskRequest.setIsLive(inspection.getIsLive()); | |||||
//经纬度 | //经纬度 | ||||
pilotTaskRequest.setStartLatitude(inspection.getStartLatitude()); | pilotTaskRequest.setStartLatitude(inspection.getStartLatitude()); |
and status = 10 | and status = 10 | ||||
and mark = 1 | and mark = 1 | ||||
order by update_time desc | order by update_time desc | ||||
</select> | |||||
<!--根据任务状态进行自定义排序--> | |||||
<select id="selectInspectionList" resultType="com.tuoheng.admin.entity.domain.Inspection"> | |||||
<include refid="selectInspectionVo"/> | |||||
<where> | |||||
mark = 1 and status in (5,6,10,15) | |||||
<if test="tenantId != null and tenantId != ''">and tenant_id = #{tenantId}</if> | |||||
</where> | |||||
order by field(status,10,6,5,15), create_time desc | |||||
limit 5 | |||||
</select> | </select> | ||||
<update id="update" parameterType="com.tuoheng.admin.entity.domain.Inspection"> | <update id="update" parameterType="com.tuoheng.admin.entity.domain.Inspection"> |