Просмотр исходного кода

Merge branch 'develop' into release

tags/v1.1.0^2
wanghaoran 1 год назад
Родитель
Сommit
a59089f6ce
2 измененных файлов: 6 добавлений и 15 удалений
  1. +2
    -12
      tuoheng-admin/src/main/java/com/tuoheng/admin/service/impl/ThInspectionServiceImpl.java
  2. +4
    -3
      tuoheng-admin/src/main/java/com/tuoheng/admin/task/ScheduledTask.java

+ 2
- 12
tuoheng-admin/src/main/java/com/tuoheng/admin/service/impl/ThInspectionServiceImpl.java Просмотреть файл

@@ -161,20 +161,10 @@ public class ThInspectionServiceImpl extends BaseServiceImpl<ThInspectionMapper,
return JsonResult.error("机场接口返回数据为空");
}
JsonResult jsonResult = JacksonUtil.json2pojo(airPortStr, JsonResult.class);
if (ObjectUtil.isEmpty(jsonResult) || (!ObjectUtil.isEmpty(Objects.requireNonNull(jsonResult).getData()) && jsonResult.getCode() != 0)) {
assert jsonResult != null;
return JsonResult.error(JSONObject.parseArray(JSONObject.parseObject(JSONObject.toJSONString(jsonResult.getData())).get("data").toString(), AirExecuteTaskVO.class), "执行任务失败!");
} else if (ObjectUtil.isEmpty(jsonResult.getData()) && jsonResult.getCode() != 0) {
if (jsonResult.getCode() != 0) {
return JsonResult.error(jsonResult.getMsg());
} else {
ThMission thMissionUpdate = new ThMission(UpdateOrCreateEnum.UPDATE.getCode());
thMissionUpdate.setId(Integer.parseInt(missionId));
//修改执行时间为当前
thMissionUpdate.setExecutionStartTime(new Date());
missionMapper.updateById(thMissionUpdate);
//返回执行结果
return JsonResult.success(jsonResult.getMsg());
}
return JsonResult.success();
}

@Override

+ 4
- 3
tuoheng-admin/src/main/java/com/tuoheng/admin/task/ScheduledTask.java Просмотреть файл

@@ -56,13 +56,14 @@ public class ScheduledTask {
log.info("执行定时执行飞行任务:" + thMission.getId());
JsonResult jsonResult = inspectionService.executeTask(String.valueOf(thMission.getId()), null);
log.info("执行定时执行飞行任务result:" + jsonResult);
thMission.setExecutionStatus(2);

ThMission thMissionUpdate = new ThMission(UpdateOrCreateEnum.UPDATE.getCode());
thMissionUpdate.setId(thMission.getId());
thMissionUpdate.setExecutionStatus(2);
if(jsonResult.getCode()!=0 && ObjectUtil.isEmpty(jsonResult.getData())){
thMission.setStatus(TaskStatusEnum.FAIL.getCode());

if(jsonResult.getCode()!=0){
log.error("执行定时执行机场起飞失败" + thMission.getId());
thMissionUpdate.setStatus(TaskStatusEnum.FAIL.getCode());
}
missionMapper.updateById(thMissionUpdate);
}

Загрузка…
Отмена
Сохранить