鞍钢鲅鱼圈能源管控系统后端代码
潘志宝
2025-06-13 a32f38f32d6155d92849782e59b33ac685f19fc8
ansteel-biz/src/main/java/com/iailab/module/ansteel/job/task/SyncDutyReportTask.java
@@ -22,6 +22,10 @@
import java.util.Map;
/**
 * 同步能源日报
 * 0 10 0 * * ?
 *
 *
 * @author PanZhibao
 * @Description
 * @createTime 2025年06月13日
@@ -62,8 +66,8 @@
            JSONArray jsonArray = JSONArray.parseArray(responseStr);
            for (int i = 0; i < jsonArray.size(); i++) {
                JSONObject jsonObject = jsonArray.getJSONObject(i);
                dataMap1.put(jsonObject.getString("cdeIndex"), new BigDecimal(jsonObject.get("valAct").toString()));
                dataMap2.put(jsonObject.getString("cdeIndex"), new BigDecimal(jsonObject.get("monthAvgValue").toString()));
                dataMap1.put(jsonObject.getString("nameIndex"), new BigDecimal(jsonObject.get("valAct").toString()));
                dataMap2.put(jsonObject.getString("nameIndex"), new BigDecimal(jsonObject.get("monthAvgValue").toString()));
            }
            List<DutyReportEntity> list = dutyReportService.list();
@@ -72,16 +76,16 @@
                return;
            }
            for (DutyReportEntity dutyReportEntity : list) {
                if (dataMap1.get(dutyReportEntity.getCdeIndex()) != null && StringUtils.isNotBlank(dutyReportEntity.getPointNo1())) {
                if (dataMap1.get(dutyReportEntity.getNameIndex()) != null && StringUtils.isNotBlank(dutyReportEntity.getPointNo1())) {
                    ApiPointValueWriteDTO writeDTO = new ApiPointValueWriteDTO();
                    writeDTO.setPointNo(dutyReportEntity.getPointNo1());
                    writeDTO.setValue(dataMap1.get(dutyReportEntity.getCdeIndex()));
                    writeDTO.setValue(dataMap1.get(dutyReportEntity.getNameIndex()));
                    dataPointApi.writePointRealValue(writeDTO);
                }
                if (dataMap2.get(dutyReportEntity.getCdeIndex()) != null && StringUtils.isNotBlank(dutyReportEntity.getPointNo2())) {
                if (dataMap2.get(dutyReportEntity.getNameIndex()) != null && StringUtils.isNotBlank(dutyReportEntity.getPointNo2())) {
                    ApiPointValueWriteDTO writeDTO = new ApiPointValueWriteDTO();
                    writeDTO.setPointNo(dutyReportEntity.getPointNo2());
                    writeDTO.setValue(dataMap2.get(dutyReportEntity.getCdeIndex()));
                    writeDTO.setValue(dataMap2.get(dutyReportEntity.getNameIndex()));
                    dataPointApi.writePointRealValue(writeDTO);
                }
            }