Преглед изворни кода

修改立即执行 接口

tags/v1.1.0^2
wanghaoran пре 1 година
родитељ
комит
d0bd2b2cd3
2 измењених фајлова са 11 додато и 9 уклоњено
  1. +7
    -0
      tuoheng-admin/src/main/java/com/tuoheng/admin/service/impl/ThInspectionServiceImpl.java
  2. +4
    -9
      tuoheng-admin/src/main/java/com/tuoheng/admin/task/ScheduledTask.java

+ 7
- 0
tuoheng-admin/src/main/java/com/tuoheng/admin/service/impl/ThInspectionServiceImpl.java Прегледај датотеку

@@ -164,6 +164,13 @@ public class ThInspectionServiceImpl extends BaseServiceImpl<ThInspectionMapper,
if (jsonResult.getCode() != 0) {
return JsonResult.error(jsonResult.getMsg());
}

//将任务执行状态修改为已执行
ThMission thMissionUpdate = new ThMission(UpdateOrCreateEnum.UPDATE.getCode());
thMissionUpdate.setId(thMission.getId());
thMissionUpdate.setExecutionStatus(2);
missionMapper.updateById(thMissionUpdate);

return JsonResult.success();
}


+ 4
- 9
tuoheng-admin/src/main/java/com/tuoheng/admin/task/ScheduledTask.java Прегледај датотеку

@@ -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);
}
}


Loading…
Откажи
Сачувај