@@ -49,7 +49,7 @@ public class ThMission extends BaseEntity implements Serializable { | |||
private String name; | |||
/** | |||
* 巡检任务类型 1 日常,2 应急巡检 | |||
* 任务类型:1:巡检任务 2:应急任务 | |||
*/ | |||
private Integer type; | |||
@@ -193,11 +193,6 @@ public class ThMission extends BaseEntity implements Serializable { | |||
*/ | |||
private String requestId; | |||
/** | |||
* 任务类型:0:巡检任务 1:应急任务 | |||
*/ | |||
private Integer accidentTask; | |||
/** | |||
* 应急任务关联数据任务ID | |||
*/ |
@@ -80,13 +80,11 @@ public class ThInspectionServiceImpl extends BaseServiceImpl<ThInspectionMapper, | |||
public List<InspectionVO> track(Integer id) { | |||
ThMission mission = missionMapper.selectOne(new LambdaQueryWrapper<ThMission>() | |||
.eq(ThMission::getId, id) | |||
.eq(ThMission::getMark, 1)); | |||
.eq(ThMission::getMark, MarkTypeEnum.VALID.getCode())); | |||
if (ObjectUtil.isNull(mission)) { | |||
throw new ServiceException("没有该任务记录"); | |||
} | |||
if (ObjectUtil.isNotNull(mission.getAccidentTask()) | |||
&& AccidentTaskEnum.ACCIDENT_TASK.getCode() == mission.getAccidentTask() | |||
&& mission.getEmergencyDataMissionId() != 0) { | |||
if (2 == mission.getType() && mission.getEmergencyDataMissionId() != 0) { | |||
id = mission.getEmergencyDataMissionId(); | |||
} | |||
LambdaQueryWrapper<ThInspection> lambdaQueryWrapper = new LambdaQueryWrapper<>(); |
@@ -51,7 +51,7 @@ public class QueryEmergencyListService { | |||
List<ThMission> missionList = thMissionMapper.selectList(new LambdaQueryWrapper<ThMission>() | |||
.eq(ThMission::getMark, MarkEnum.VALID.getCode()) | |||
.eq(ThMission::getTenantId, tenantId) | |||
.eq(ThMission::getAccidentTask, AccidentTaskEnum.ACCIDENT_TASK.getCode()) | |||
.eq(ThMission::getType, 2) | |||
.in(CollectionUtil.isNotEmpty(request.getStatusList()), ThMission::getStatus, request.getStatusList())); | |||
if (CollectionUtil.isEmpty(missionList)) { |
@@ -24,10 +24,7 @@ public class UpdateEmergencyMissionStatusService { | |||
*/ | |||
public void updateStatus(ThMission oldMission, Integer status) { | |||
log.info("进入修改应急任务数据"); | |||
if (ObjectUtil.isNull(oldMission.getAccidentTask())) { | |||
return; | |||
} | |||
if (AccidentTaskEnum.INSPECTION_TASK.getCode() == oldMission.getAccidentTask()) { | |||
if (1 == oldMission.getType()) { | |||
return; | |||
} | |||
if (0 == oldMission.getEmergencyDataMissionId()) { |
@@ -58,6 +58,7 @@ public class PointFlightService { | |||
// 创建应急任务 | |||
ThMission mission = this.createMission(user, request); | |||
// 调用机场平台 | |||
// 修改原巡检任务状态为已完成 | |||
if (TaskStatusEnum.COMPLETE.getCode() == mission.getStatus()) { | |||
@@ -239,6 +240,7 @@ public class PointFlightService { | |||
mission.setCode(code); | |||
mission.setName("应急任务" + code); | |||
mission.setTenantId(user.getTenantId()); | |||
mission.setStatus(2); | |||
mission.setInspectionType(InspectionTypeEnum.AIRPORT.getCode()); | |||
mission.setAirportId(request.getAirportId()); | |||
mission.setAirportName(request.getAirportName()); | |||
@@ -246,7 +248,6 @@ public class PointFlightService { | |||
mission.setInspectionLineName(""); | |||
mission.setExecutionStartTime(DateUtils.now()); | |||
mission.setStatus(TaskStatusEnum.FLIGHT.getCode()); // 设置应急任务状态为飞行中 | |||
mission.setAccidentTask(AccidentTaskEnum.ACCIDENT_TASK.getCode()); | |||
mission.setCreateUser(user.getId()); | |||
mission.setCreateTime(DateUtils.now()); | |||
Integer count = missionMapper.insert(mission); |