Commit e682d724 authored by zhangsen's avatar zhangsen

巡检添加中心级/站端标识 -> 是否跑定时任务

parent 576fbc9b
......@@ -28,6 +28,7 @@ import io.swagger.annotations.ApiParam;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.domain.Page;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.util.ObjectUtils;
......@@ -58,6 +59,9 @@ public class PlanTaskController extends AbstractBaseController {
@Autowired
private IRouteService routeService;
@Value("${params.isPush:false}")
private Boolean isZxj;
@Autowired
private RemoteSecurityService remoteSecurityService;
......@@ -386,6 +390,7 @@ public class PlanTaskController extends AbstractBaseController {
@ApiOperation(value = "定时执行任务表生成(<font color='blue'>release</font>)", notes = "定时执行任务表生成")
@RequestMapping(value = "/queryOmission", method = RequestMethod.GET, produces = "application/json;charset=UTF-8")
public CommonResponse pushCarData() {
if (Boolean.TRUE.equals(!isZxj)) {
try {
RequestAttributes reqs = RequestContextHolder.getRequestAttributes();
RequestContextHolder.setRequestAttributes(reqs, true);
......@@ -397,16 +402,20 @@ public class PlanTaskController extends AbstractBaseController {
return CommonResponseUtil.failure();
}
}
return CommonResponseUtil.success();
}
/**
* 定时任务推送巡检待办任务消息
*/
@Scheduled(cron = "${jobs.cron}")
public void taskMessage() {
if (Boolean.TRUE.equals(!isZxj)) {
RequestAttributes reqs = RequestContextHolder.getRequestAttributes();
RequestContextHolder.setRequestAttributes(reqs, true);
planTaskService.taskMessage(null);
}
}
/**
* 模拟发送巡检待办任务消息定时任务
......
......@@ -96,3 +96,6 @@ file.url=http://172.16.11.201:9000/
##代码中有部分逻辑冲突需要处理 为区分机场和电力逻辑 增加开关 若为true 则为机场逻辑 为false 则为电力逻辑
logic=false
#是否为中心级系统 true-中心级系统 false-站端系统
is.zxj=true
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment