|
|
@@ -1,20 +1,17 @@ |
|
|
|
package com.tuoheng.admin.task; |
|
|
|
|
|
|
|
import cn.hutool.core.util.ObjectUtil; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
import com.tuoheng.admin.entity.domain.ThMission; |
|
|
|
import com.tuoheng.admin.enums.MarkTypeEnum; |
|
|
|
import com.tuoheng.admin.enums.TaskStatusEnum; |
|
|
|
import com.tuoheng.admin.enums.UpdateOrCreateEnum; |
|
|
|
import com.tuoheng.admin.mapper.ThMissionMapper; |
|
|
|
import com.tuoheng.admin.service.IMissionService; |
|
|
|
import com.tuoheng.admin.service.IThInspectionService; |
|
|
|
import com.tuoheng.common.utils.JsonResult; |
|
|
|
import com.tuoheng.common.utils.StringUtils; |
|
|
|
import com.xxl.job.core.handler.annotation.XxlJob; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.scheduling.annotation.Scheduled; |
|
|
|
import org.springframework.stereotype.Component; |
|
|
|
|
|
|
|
import java.text.SimpleDateFormat; |
|
|
@@ -57,15 +54,13 @@ public class ScheduledTask { |
|
|
|
JsonResult jsonResult = inspectionService.executeTask(String.valueOf(thMission.getId()), null); |
|
|
|
log.info("执行定时执行飞行任务result:" + jsonResult); |
|
|
|
|
|
|
|
ThMission thMissionUpdate = new ThMission(UpdateOrCreateEnum.UPDATE.getCode()); |
|
|
|
thMissionUpdate.setId(thMission.getId()); |
|
|
|
thMissionUpdate.setExecutionStatus(2); |
|
|
|
|
|
|
|
if(jsonResult.getCode()!=0){ |
|
|
|
if(jsonResult.getCode() != 0){ |
|
|
|
ThMission thMissionUpdate = new ThMission(UpdateOrCreateEnum.UPDATE.getCode()); |
|
|
|
thMissionUpdate.setId(thMission.getId()); |
|
|
|
log.error("执行定时执行机场起飞失败" + thMission.getId()); |
|
|
|
thMissionUpdate.setStatus(TaskStatusEnum.FAIL.getCode()); |
|
|
|
missionMapper.updateById(thMissionUpdate); |
|
|
|
} |
|
|
|
missionMapper.updateById(thMissionUpdate); |
|
|
|
} |
|
|
|
} |
|
|
|
|