Quellcode durchsuchen

任务状态被改变

tags/v1.1.0
qiujinyang vor 2 Jahren
Ursprung
Commit
44e8666fb7
3 geänderte Dateien mit 6 neuen und 4 gelöschten Zeilen
  1. +1
    -1
      tuoheng-admin/src/main/java/com/tuoheng/admin/controller/ParamController.java
  2. +4
    -2
      tuoheng-admin/src/main/java/com/tuoheng/admin/service/impl/ThInspectionServiceImpl.java
  3. +1
    -1
      tuoheng-admin/src/main/java/com/tuoheng/admin/task/ScheduledTask.java

+ 1
- 1
tuoheng-admin/src/main/java/com/tuoheng/admin/controller/ParamController.java Datei anzeigen

@@ -29,7 +29,7 @@ public class ParamController {
status = status == 1 ? 2 : 1;
redisUtils.set("status",status);
}
boolean status = (Integer) redisUtils.get("status")==1?true:false;
boolean status = (Integer) redisUtils.get("status") == 1;
return JsonResult.success(status);
}


+ 4
- 2
tuoheng-admin/src/main/java/com/tuoheng/admin/service/impl/ThInspectionServiceImpl.java Datei anzeigen

@@ -148,9 +148,11 @@ public class ThInspectionServiceImpl extends BaseServiceImpl<ThInspectionMapper,
} else if (ObjectUtil.isEmpty(jsonResult.getData()) && jsonResult.getCode() != 0) {
return JsonResult.error(jsonResult.getMsg());
} else {
ThMission thMissionUpdate=new ThMission(UpdateOrCreateEnum.UPDATE.getCode());
thMissionUpdate.setId(thMission.getId());
//修改执行时间为当前
thMission.setExecutionStartTime(new Date());
missionMapper.updateById(thMission);
thMissionUpdate.setExecutionStartTime(new Date());
missionMapper.updateById(thMissionUpdate);
//返回执行结果
return JsonResult.success(jsonResult.getMsg());
}

+ 1
- 1
tuoheng-admin/src/main/java/com/tuoheng/admin/task/ScheduledTask.java Datei anzeigen

@@ -46,7 +46,7 @@ public class ScheduledTask {
.ge(ThMission::getExecutionStatus, 1)
.eq(ThMission::getStatus, TaskStatusEnum.WAIT.getCode()));

log.info("秒钟一次");
log.info("秒钟一次");

for (ThMission thMission : thMissions) {
JsonResult jsonResult = inspectionService.executeTask(String.valueOf(thMission.getId()));

Laden…
Abbrechen
Speichern