@@ -65,4 +65,6 @@ public interface InspectionMapper extends BaseMapper<Inspection> { | |||
List<Inspection> getListByBox(@Param("boxSn") String boxSn); | |||
List<Inspection> selectInspectionList(@Param("tenantId") String tenantId); | |||
} |
@@ -166,8 +166,6 @@ public class AddInspectionService { | |||
*/ | |||
private Inspection buildInspection(User user, String tenantId, AddInspectionRequest addInspectionRequest) { | |||
Inspection inspection = InspectionConverMapper.INSTANCE.fromAddInspectionRequestToInspection(addInspectionRequest); | |||
//Inspection inspection = new Inspection(); | |||
//BeanUtils.copyProperties(addInspectionRequest,inspection); | |||
String code = DateUtils.generateCode("XJRW"); | |||
inspection.setType(1); | |||
inspection.setCode(code); | |||
@@ -182,8 +180,8 @@ public class AddInspectionService { | |||
.eq(DspServiceInst::getIsDefault, CommonConstants.ONE)); | |||
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); | |||
} | |||
return inspection; |
@@ -38,14 +38,9 @@ public class QueryInspectionListDataService { | |||
log.info("进入查询任务列表数据失败:{}",jsonResult.getMsg()); | |||
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); | |||
} | |||
@@ -44,8 +44,9 @@ public class AddPilotTaskService { | |||
pilotTaskRequest.setTaskStartTime(inspection.getInspectionTime()); | |||
pilotTaskRequest.setRemark(inspection.getNote()); | |||
//直播 | |||
pilotTaskRequest.setIsLive(inspection.getIsLive()); | |||
//直播 大气飞手任务只有直播 | |||
pilotTaskRequest.setIsLive(1); | |||
//pilotTaskRequest.setIsLive(inspection.getIsLive()); | |||
//经纬度 | |||
pilotTaskRequest.setStartLatitude(inspection.getStartLatitude()); |
@@ -107,6 +107,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | |||
and status = 10 | |||
and mark = 1 | |||
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> | |||
<update id="update" parameterType="com.tuoheng.admin.entity.domain.Inspection"> |