Browse Source

1、解决bug3657,直播页面轨迹接口报错;2、解决bug3618,手动执行和定时任务同时执行飞行任务,任务飞行失败;

tags/v1.2.0^2
wanjing 1 year ago
parent
commit
f0d3892bb5
1 changed files with 13 additions and 2 deletions
  1. +13
    -2
      tuoheng-admin/src/main/java/com/tuoheng/admin/service/impl/ThInspectionServiceImpl.java

+ 13
- 2
tuoheng-admin/src/main/java/com/tuoheng/admin/service/impl/ThInspectionServiceImpl.java View File

@@ -79,8 +79,10 @@ public class ThInspectionServiceImpl extends BaseServiceImpl<ThInspectionMapper,
ThMission mission = missionMapper.selectOne(new LambdaQueryWrapper<ThMission>()
.eq(ThMission::getId, id)
.eq(ThMission::getMark, 1));

if (AirportFlyTypeEnum.POINTING_FLIGHT.getCode() == mission.getAirportFlyType()) {
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)
@@ -169,7 +171,16 @@ public class ThInspectionServiceImpl extends BaseServiceImpl<ThInspectionMapper,
@Override
public JsonResult executeTask(String missionId, PushAndPullURLRequest pushAndPull) throws ServiceException {
log.info("executeTask准备就绪");

ThMission thMission = missionMapper.selectById(Integer.parseInt(missionId));
if (ObjectUtil.isNull(thMission)) {
log.error("该任务不存在,missionId={}", missionId);
return JsonResult.error("该任务不存在");
}
if (2 == thMission.getExecutionStatus()) {
log.error("该任务已经被执行,missionId={}", missionId);
return JsonResult.error("该任务已经被执行");
}
log.info("mission查询完成");
User user = userMapper.selectById(thMission.getCreateUser());
log.info("user查询完成");

Loading…
Cancel
Save