| | |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 同步能源日报 |
| | | * 0 10 0 * * ? |
| | | * |
| | | * |
| | | * @author PanZhibao |
| | | * @Description |
| | | * @createTime 2025年06月13日 |
| | |
| | | logger.info("responseStr is null"); |
| | | return; |
| | | } |
| | | logger.info("responseStr={}", responseStr); |
| | | Map<String, BigDecimal> dataMap1 = new HashMap<>(); |
| | | Map<String, BigDecimal> dataMap2 = new HashMap<>(); |
| | | JSONArray jsonArray = JSONArray.parseArray(responseStr); |
| | |
| | | logger.info("DutyReportEntity list is empty"); |
| | | return; |
| | | } |
| | | logger.info("DutyReportEntity list size={}", list.size()); |
| | | logger.info("dataMap1={}", JSONObject.toJSONString(dataMap1)); |
| | | logger.info("dataMap2={}", JSONObject.toJSONString(dataMap2)); |
| | | for (DutyReportEntity dutyReportEntity : list) { |
| | | if (dataMap1.get(dutyReportEntity.getCdeIndex()) != null) { |
| | | |
| | | if (dataMap1.get(dutyReportEntity.getCdeIndex()) != null && StringUtils.isNotBlank(dutyReportEntity.getPointNo1())) { |
| | | ApiPointValueWriteDTO writeDTO = new ApiPointValueWriteDTO(); |
| | | writeDTO.setPointNo(dutyReportEntity.getPointNo1()); |
| | | writeDTO.setValue(dataMap1.get(dutyReportEntity.getCdeIndex())); |
| | | logger.info("writeDTO={}", JSONObject.toJSONString(writeDTO)); |
| | | dataPointApi.writePointRealValue(writeDTO); |
| | | } |
| | | if (dataMap2.get(dutyReportEntity.getCdeIndex()) != null) { |
| | | |
| | | if (dataMap2.get(dutyReportEntity.getCdeIndex()) != null && StringUtils.isNotBlank(dutyReportEntity.getPointNo2())) { |
| | | ApiPointValueWriteDTO writeDTO = new ApiPointValueWriteDTO(); |
| | | writeDTO.setPointNo(dutyReportEntity.getPointNo2()); |
| | | writeDTO.setValue(dataMap2.get(dutyReportEntity.getCdeIndex())); |
| | | logger.info("writeDTO={}", JSONObject.toJSONString(writeDTO)); |
| | | dataPointApi.writePointRealValue(writeDTO); |
| | | } |
| | | } |