Parcourir la source

Merge branch 'develop' of gitadmin/tuoheng_lc into release

tags/v1.2.0^2
wanjing il y a 1 an
Parent
révision
4d59213d57
6 fichiers modifiés avec 46 ajouts et 44 suppressions
  1. +7
    -2
      tuoheng-admin/src/main/java/com/tuoheng/admin/entity/domain/ThMission.java
  2. +2
    -2
      tuoheng-admin/src/main/java/com/tuoheng/admin/entity/request/emergency/QueryEmergencyListRequest.java
  3. +4
    -5
      tuoheng-admin/src/main/java/com/tuoheng/admin/enums/AccidentTaskEnum.java
  4. +5
    -25
      tuoheng-admin/src/main/java/com/tuoheng/admin/service/impl/ThInspectionServiceImpl.java
  5. +2
    -1
      tuoheng-admin/src/main/java/com/tuoheng/admin/service/mission/query/QueryEmergencyListService.java
  6. +26
    -9
      tuoheng-admin/src/main/java/com/tuoheng/admin/service/third/airport/PointFlightService.java

+ 7
- 2
tuoheng-admin/src/main/java/com/tuoheng/admin/entity/domain/ThMission.java Voir le fichier

@@ -194,8 +194,13 @@ public class ThMission extends BaseEntity implements Serializable {
private String requestId;

/**
* 机场飞行类型 0默认 1机场巡逻 2指点飞行
* 任务类型:0:巡检任务 1:应急任务
*/
private Integer airportFlyType;
private Integer accidentTask;

/**
* 应急任务关联数据任务ID
*/
private Integer emergencyDataMissionId;

}

+ 2
- 2
tuoheng-admin/src/main/java/com/tuoheng/admin/entity/request/emergency/QueryEmergencyListRequest.java Voir le fichier

@@ -21,8 +21,8 @@ public class QueryEmergencyListRequest implements Serializable {
@ApiModelProperty(value = "租户Id",hidden = true)
private Integer tenantId;

@ApiModelProperty(value = "机场飞行类型 0默认 1机场巡逻 2指点飞行")
private Integer airportFlyType;
@ApiModelProperty(value = "任务类型:0:巡检任务 1:应急任务")
private Integer accidentTask;

@ApiModelProperty(value = "任务状态:1任务待飞行 2任务飞行中 3任务执行失败 4任务飞行完成")
private List<String> statusList;

tuoheng-admin/src/main/java/com/tuoheng/admin/enums/AirportFlyTypeEnum.java → tuoheng-admin/src/main/java/com/tuoheng/admin/enums/AccidentTaskEnum.java Voir le fichier

@@ -10,13 +10,12 @@ import lombok.Getter;
* @date 2023-02-13
*/

public enum AirportFlyTypeEnum {
public enum AccidentTaskEnum {

NULL(0, "无"),
AIRPORT_PATROL(1,"机场巡逻"),
POINTING_FLIGHT(2,"指点飞行");
INSPECTION_TASK(0,"巡检任务"),
ACCIDENT_TASK(1,"应急任务");

AirportFlyTypeEnum(int code, String description){
AccidentTaskEnum(int code, String description){
this.code = code;
this.description = description;
}

+ 5
- 25
tuoheng-admin/src/main/java/com/tuoheng/admin/service/impl/ThInspectionServiceImpl.java Voir le fichier

@@ -16,7 +16,7 @@ import com.tuoheng.admin.entity.vo.AirLineVO;
import com.tuoheng.admin.entity.vo.AirPortVO;
import com.tuoheng.admin.entity.vo.AirWeatherVO;
import com.tuoheng.admin.entity.vo.InspectionVO;
import com.tuoheng.admin.enums.AirportFlyTypeEnum;
import com.tuoheng.admin.enums.AccidentTaskEnum;
import com.tuoheng.admin.enums.MarkTypeEnum;
import com.tuoheng.admin.enums.TaskStatusEnum;
import com.tuoheng.admin.enums.UpdateOrCreateEnum;
@@ -83,31 +83,11 @@ public class ThInspectionServiceImpl extends BaseServiceImpl<ThInspectionMapper,
if (ObjectUtil.isNull(mission)) {
throw new ServiceException("没有该任务记录");
}
if (ObjectUtil.isNotNull(mission.getAirportFlyType()) && AirportFlyTypeEnum.POINTING_FLIGHT.getCode() == mission.getAirportFlyType()) {
// 定点飞行
WarningRecord warningRecord = warningRecordMapper.selectOne(new LambdaQueryWrapper<WarningRecord>()
.eq(WarningRecord::getEmergencyMissionId, id)
.eq(WarningRecord::getMark, MarkTypeEnum.VALID.getCode())
.orderByDesc(WarningRecord::getCreateTime)
.last(" limit 1"));
if (ObjectUtil.isNull(warningRecord)) {
throw new ServiceException("该应急任务没有对应的预警记录");
}
ThMission oldMission = missionMapper.selectOne(new LambdaQueryWrapper<ThMission>()
.eq(ThMission::getId, warningRecord.getMissionId())
.eq(ThMission::getMark, MarkTypeEnum.VALID.getCode()));
if (ObjectUtil.isNull(oldMission)) {
throw new ServiceException("该应急任务没有对应的巡检任务记录");
}
if (mission.getAirportId().equals(oldMission.getAirportId())) {
// 原机场执行的应急任务,在查看应急任务轨迹时,查询的是原巡检任务的轨迹
id = oldMission.getId();
log.info("该任务是应急任务,执行的是原机场,id={}", id);
} else {
log.info("该任务是应急任务,执行的是新机场,id={}", id);
}
if (ObjectUtil.isNotNull(mission.getAccidentTask())
&& AccidentTaskEnum.ACCIDENT_TASK.getCode() == mission.getAccidentTask()
&& mission.getEmergencyDataMissionId() != 0) {
id = mission.getEmergencyDataMissionId();
}

LambdaQueryWrapper<ThInspection> lambdaQueryWrapper = new LambdaQueryWrapper<>();

lambdaQueryWrapper.eq(ThInspection::getMissionId, id)

+ 2
- 1
tuoheng-admin/src/main/java/com/tuoheng/admin/service/mission/query/QueryEmergencyListService.java Voir le fichier

@@ -7,6 +7,7 @@ import com.tuoheng.admin.entity.domain.Camera;
import com.tuoheng.admin.entity.domain.ThMission;
import com.tuoheng.admin.entity.request.camera.QueryCameraListRequest;
import com.tuoheng.admin.entity.request.emergency.QueryEmergencyListRequest;
import com.tuoheng.admin.enums.AccidentTaskEnum;
import com.tuoheng.admin.enums.MarkEnum;
import com.tuoheng.admin.enums.MissionEnum;
import com.tuoheng.admin.enums.TaskStatusEnum;
@@ -50,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(ObjectUtil.isNotEmpty(request.getAirportFlyType()), ThMission::getAirportFlyType, request.getAirportFlyType())
.eq(ThMission::getAccidentTask, AccidentTaskEnum.ACCIDENT_TASK.getCode())
.in(CollectionUtil.isNotEmpty(request.getStatusList()), ThMission::getStatus, request.getStatusList()));

if (CollectionUtil.isEmpty(missionList)) {

+ 26
- 9
tuoheng-admin/src/main/java/com/tuoheng/admin/service/third/airport/PointFlightService.java Voir le fichier

@@ -60,15 +60,29 @@ public class PointFlightService {
ThMission mission = this.createMission(user, request);

// 调用机场平台
if (oldMission.getAirportId().equals(request.getAirportId())) {
log.info("原机场执行定点飞行");
this.callOldAirpor(request);
} else {
log.info("新机场执行定点飞行");
// 修改原巡检任务状态为已完成
if (TaskStatusEnum.COMPLETE.getCode() == mission.getStatus()) {
log.info("执行定点飞行, 原巡检任务已完成");
// 巡检任务已经结束
// 再次选择原来机场进行定点飞行,
if (mission.getAirportId() == request.getAirportId()) {
log.info("新机场执行定点飞行");
} else {
log.info("新机场执行定点飞行");
}
this.callNewAirpor(tenant, request, mission.getId());
} else {
log.info("执行定点飞行, 原巡检任务在执行");
if (oldMission.getAirportId().equals(request.getAirportId())) {
log.info("原机场执行定点飞行");
oldMission.setEmergencyDataMissionId(mission.getId());
this.callOldAirpor(request);
} else {
log.info("新机场执行定点飞行");
this.callNewAirpor(tenant, request, mission.getId());
}
}

// 修改原巡检任务状态为已完成
oldMission.setStatus(TaskStatusEnum.COMPLETE.getCode());
missionMapper.updateById(oldMission);

@@ -128,9 +142,12 @@ public class PointFlightService {
if (ObjectUtil.isNotNull(warningRecord)) {
ThMission missionTmp = missionMapper.selectOne(new LambdaQueryWrapper<ThMission>()
.eq(ThMission::getId, warningRecord.getEmergencyMissionId())
.eq(ThMission::getStatus, TaskStatusEnum.FLIGHT.getCode())
.eq(ThMission::getMark, MarkEnum.VALID.getCode()));
if (ObjectUtil.isNotNull(missionTmp)) {
if (TaskStatusEnum.FLIGHT.getCode() == missionTmp.getStatus()) {
log.info("原机场正在执行任务");
throw new ServiceException("原机场正在执行任务");
}
if (TaskStatusEnum.COMPLETE.getCode() == missionTmp.getStatus()) {
log.info("原机场正在执行任务");
throw new ServiceException("原机场正在执行任务");
}
@@ -234,7 +251,7 @@ public class PointFlightService {
mission.setInspectionLineName("");
mission.setExecutionStartTime(DateUtils.now());
mission.setStatus(TaskStatusEnum.FLIGHT.getCode()); // 设置应急任务状态为飞行中
mission.setAirportFlyType(AirportFlyTypeEnum.POINTING_FLIGHT.getCode());
mission.setAccidentTask(AccidentTaskEnum.ACCIDENT_TASK.getCode());
mission.setCreateUser(user.getId());
mission.setCreateTime(DateUtils.now());
Integer count = missionMapper.insert(mission);

Chargement…
Annuler
Enregistrer