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,16 +390,19 @@ 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() {
try {
RequestAttributes reqs = RequestContextHolder.getRequestAttributes();
RequestContextHolder.setRequestAttributes(reqs, true);
planTaskService.taskExecution(null);
return CommonResponseUtil.success();
} catch (Exception e) {
e.printStackTrace();
log.error(e.getMessage(), e);
return CommonResponseUtil.failure();
if (Boolean.TRUE.equals(!isZxj)) {
try {
RequestAttributes reqs = RequestContextHolder.getRequestAttributes();
RequestContextHolder.setRequestAttributes(reqs, true);
planTaskService.taskExecution(null);
return CommonResponseUtil.success();
} catch (Exception e) {
e.printStackTrace();
log.error(e.getMessage(), e);
return CommonResponseUtil.failure();
}
}
return CommonResponseUtil.success();
}
/**
......@@ -403,9 +410,11 @@ public class PlanTaskController extends AbstractBaseController {
*/
@Scheduled(cron = "${jobs.cron}")
public void taskMessage() {
RequestAttributes reqs = RequestContextHolder.getRequestAttributes();
RequestContextHolder.setRequestAttributes(reqs, true);
planTaskService.taskMessage(null);
if (Boolean.TRUE.equals(!isZxj)) {
RequestAttributes reqs = RequestContextHolder.getRequestAttributes();
RequestContextHolder.setRequestAttributes(reqs, true);
planTaskService.taskMessage(null);
}
}
/**
......
......@@ -95,4 +95,7 @@ emqx.max-inflight=1000
file.url=http://172.16.11.201:9000/
##代码中有部分逻辑冲突需要处理 为区分机场和电力逻辑 增加开关 若为true 则为机场逻辑 为false 则为电力逻辑
logic=false
\ No newline at end of file
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