| | |
| | | package com.iailab.module.ansteel.job.task; |
| | | |
| | | import com.iailab.module.ansteel.page.service.PageParamService; |
| | | import com.iailab.module.data.api.point.DataPointApi; |
| | | import com.iailab.module.data.api.point.dto.ApiPointValueDTO; |
| | | import com.iailab.module.data.api.point.dto.ApiPointValueQueryDTO; |
| | |
| | | @Autowired |
| | | private McsApi mcsApi; |
| | | |
| | | // 望铁关口触发边界 |
| | | private final static double LIM = -20d; |
| | | @Autowired |
| | | private PageParamService pageParamService; |
| | | |
| | | private final static String POINT_NO = "C0000201107"; |
| | | |
| | |
| | | public void run(String params) { |
| | | logger.info("RunOnPowerOptimTask定时任务正在执行,参数为:{}", params); |
| | | try { |
| | | // 查询配置参数 |
| | | // 触发频率 |
| | | Integer cfpl = Integer.parseInt(pageParamService.getValue("")); |
| | | // 望铁关口触发边界 |
| | | Double wtbj = Double.parseDouble(pageParamService.getValue("")); |
| | | |
| | | Calendar calendar = Calendar.getInstance(); |
| | | calendar.set(Calendar.MILLISECOND, 0); |
| | | calendar.set(Calendar.SECOND, 0); |
| | | Date endTime = calendar.getTime(); |
| | | calendar.add(Calendar.MINUTE, -5); |
| | | calendar.add(Calendar.MINUTE, cfpl * -1); |
| | | Date startTime = calendar.getTime(); |
| | | |
| | | ApiPointValueQueryDTO pointValueQueryDTO = new ApiPointValueQueryDTO(); |
| | |
| | | flag = false; |
| | | } |
| | | for (ApiPointValueDTO apiPointValueDTO : valueList) { |
| | | if (apiPointValueDTO.getV() < LIM) { |
| | | if (apiPointValueDTO.getV() < wtbj) { |
| | | flag = false; |
| | | break; |
| | | } |