status = status == 1 ? 2 : 1; | status = status == 1 ? 2 : 1; | ||||
redisUtils.set("status",status); | redisUtils.set("status",status); | ||||
} | } | ||||
boolean status = (Integer) redisUtils.get("status")==1?true:false; | |||||
boolean status = (Integer) redisUtils.get("status") == 1; | |||||
return JsonResult.success(status); | return JsonResult.success(status); | ||||
} | } | ||||
} else if (ObjectUtil.isEmpty(jsonResult.getData()) && jsonResult.getCode() != 0) { | } else if (ObjectUtil.isEmpty(jsonResult.getData()) && jsonResult.getCode() != 0) { | ||||
return JsonResult.error(jsonResult.getMsg()); | return JsonResult.error(jsonResult.getMsg()); | ||||
} else { | } 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()); | return JsonResult.success(jsonResult.getMsg()); | ||||
} | } |
.ge(ThMission::getExecutionStatus, 1) | .ge(ThMission::getExecutionStatus, 1) | ||||
.eq(ThMission::getStatus, TaskStatusEnum.WAIT.getCode())); | .eq(ThMission::getStatus, TaskStatusEnum.WAIT.getCode())); | ||||
log.info("三秒钟一次"); | |||||
log.info("一秒钟一次"); | |||||
for (ThMission thMission : thMissions) { | for (ThMission thMission : thMissions) { | ||||
JsonResult jsonResult = inspectionService.executeTask(String.valueOf(thMission.getId())); | JsonResult jsonResult = inspectionService.executeTask(String.valueOf(thMission.getId())); |