| | |
| | | put("F0000101228", Arrays.asList("F0000101195", "F0000101206", "F0000101217", "C0000101220")); |
| | | }}; |
| | | |
| | | private static final HashMap<String, List<String>> qhPoints = new HashMap<String, List<String>>() {{ |
| | | put("1", Arrays.asList("F0000100098", "F0000100099", "F0000100100", "F0000100101","F0000100105", "F0000100106", "F0000100107", "F0000100108","F0000100102", "F0000100103")); |
| | | }}; |
| | | |
| | | private boolean qhFlag1 = false; |
| | | private boolean qhFlag2 = false; |
| | | private boolean qhFlag135 = false; |
| | |
| | | public void run(String params) { |
| | | logger.info("RunMachineStateTask定时任务正在执行,参数为:{}", params); |
| | | try { |
| | | List<String> qhPointNos = qhPoints.values().stream().flatMap(List::stream).collect(Collectors.toList()); |
| | | Map<String, Object> qhPointsRealValue = dataPointApi.queryPointsRealValue(qhPointNos); |
| | | for (Map.Entry<String, List<String>> entry : qhPoints.entrySet()) { |
| | | ApiPointValueWriteDTO apiPointValueWriteDTO = new ApiPointValueWriteDTO(); |
| | | for (String pointNo : entry.getValue()) { |
| | | Double value = Double.valueOf(String.format("%.2f", Double.valueOf(qhPointsRealValue.get(pointNo).toString()))); |
| | | if ("F0000100098".equals(pointNo) && value == 0.00) { |
| | | apiPointValueWriteDTO.setValue(0); |
| | | apiPointValueWriteDTO.setPointNo("C0000101223"); |
| | | dataPointApi.writePointRealValue(apiPointValueWriteDTO); |
| | | apiPointValueWriteDTO.setPointNo("C0000101210"); |
| | | dataPointApi.writePointRealValue(apiPointValueWriteDTO); |
| | | apiPointValueWriteDTO.setPointNo("C0000101214"); |
| | | dataPointApi.writePointRealValue(apiPointValueWriteDTO); |
| | | }else if ("F0000100099".equals(pointNo) && value == 0.00) { |
| | | apiPointValueWriteDTO.setValue(0); |
| | | apiPointValueWriteDTO.setPointNo("C0000101224"); |
| | | dataPointApi.writePointRealValue(apiPointValueWriteDTO); |
| | | apiPointValueWriteDTO.setPointNo("C0000101211"); |
| | | dataPointApi.writePointRealValue(apiPointValueWriteDTO); |
| | | apiPointValueWriteDTO.setPointNo("C0000101215"); |
| | | dataPointApi.writePointRealValue(apiPointValueWriteDTO); |
| | | }else if ("F0000100100".equals(pointNo) && value == 0.00) { |
| | | apiPointValueWriteDTO.setValue(0); |
| | | apiPointValueWriteDTO.setPointNo("C0000101225"); |
| | | dataPointApi.writePointRealValue(apiPointValueWriteDTO); |
| | | apiPointValueWriteDTO.setPointNo("C0000101212"); |
| | | dataPointApi.writePointRealValue(apiPointValueWriteDTO); |
| | | apiPointValueWriteDTO.setPointNo("C0000101216"); |
| | | dataPointApi.writePointRealValue(apiPointValueWriteDTO); |
| | | }else if ("F0000100101".equals(pointNo) && value == 0.00) { |
| | | apiPointValueWriteDTO.setValue(0); |
| | | apiPointValueWriteDTO.setPointNo("C0000101226"); |
| | | dataPointApi.writePointRealValue(apiPointValueWriteDTO); |
| | | apiPointValueWriteDTO.setPointNo("C0000101213"); |
| | | dataPointApi.writePointRealValue(apiPointValueWriteDTO); |
| | | apiPointValueWriteDTO.setPointNo("C0000101217"); |
| | | dataPointApi.writePointRealValue(apiPointValueWriteDTO); |
| | | }else if ("F0000100105".equals(pointNo) && value == 0.00) { |
| | | apiPointValueWriteDTO.setValue(0); |
| | | apiPointValueWriteDTO.setPointNo("C0000101227"); |
| | | dataPointApi.writePointRealValue(apiPointValueWriteDTO); |
| | | }else if ("F0000100106".equals(pointNo) && value == 0.00) { |
| | | apiPointValueWriteDTO.setValue(0); |
| | | apiPointValueWriteDTO.setPointNo("C0000101228"); |
| | | dataPointApi.writePointRealValue(apiPointValueWriteDTO); |
| | | }else if ("F0000100107".equals(pointNo) && value == 0.00) { |
| | | apiPointValueWriteDTO.setValue(0); |
| | | apiPointValueWriteDTO.setPointNo("C0000101229"); |
| | | dataPointApi.writePointRealValue(apiPointValueWriteDTO); |
| | | }else if ("F0000100108".equals(pointNo) && value == 0.00) { |
| | | apiPointValueWriteDTO.setValue(0); |
| | | apiPointValueWriteDTO.setPointNo("C0000101230"); |
| | | dataPointApi.writePointRealValue(apiPointValueWriteDTO); |
| | | }else if ("F0000100102".equals(pointNo) && value == 0.00) { |
| | | apiPointValueWriteDTO.setValue(0); |
| | | apiPointValueWriteDTO.setPointNo("C0000101231"); |
| | | dataPointApi.writePointRealValue(apiPointValueWriteDTO); |
| | | apiPointValueWriteDTO.setPointNo("C0000101221"); |
| | | dataPointApi.writePointRealValue(apiPointValueWriteDTO); |
| | | apiPointValueWriteDTO.setPointNo("C0000101218"); |
| | | dataPointApi.writePointRealValue(apiPointValueWriteDTO); |
| | | }else if ("F0000100103".equals(pointNo) && value == 0.00) { |
| | | apiPointValueWriteDTO.setValue(0); |
| | | apiPointValueWriteDTO.setPointNo("C0000101232"); |
| | | dataPointApi.writePointRealValue(apiPointValueWriteDTO); |
| | | apiPointValueWriteDTO.setPointNo("C0000101222"); |
| | | dataPointApi.writePointRealValue(apiPointValueWriteDTO); |
| | | apiPointValueWriteDTO.setPointNo("C0000101219"); |
| | | dataPointApi.writePointRealValue(apiPointValueWriteDTO); |
| | | } |
| | | } |
| | | } |
| | | |
| | | List<String> partPointNos = partPoints.values().stream().flatMap(List::stream).collect(Collectors.toList()); |
| | | Map<String, Object> partPointsRealValue = dataPointApi.queryPointsRealValue(partPointNos); |
| | | for (Map.Entry<String, List<String>> entry : partPoints.entrySet()) { |