From 38a1a1d436135f75e5a70d6f75376c5292a240d9 Mon Sep 17 00:00:00 2001 From: wr <1754607820@qq.com> Date: Thu, 27 Jul 2023 16:15:00 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=A1=E5=88=92=E7=9B=91=E7=9D=A3bug?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=EF=BC=8C=E6=B7=BB=E5=8A=A0=E9=83=A8=E5=88=86?= =?UTF-8?q?json=E5=B1=9E=E6=80=A7=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/SupvPushGwServiceImpl.java | 60 ++++++++++--------- 1 file changed, 32 insertions(+), 28 deletions(-) diff --git a/pqs-process/process-boot/src/main/java/com/njcn/process/service/impl/SupvPushGwServiceImpl.java b/pqs-process/process-boot/src/main/java/com/njcn/process/service/impl/SupvPushGwServiceImpl.java index ff4bb5e54..aa392d6b6 100644 --- a/pqs-process/process-boot/src/main/java/com/njcn/process/service/impl/SupvPushGwServiceImpl.java +++ b/pqs-process/process-boot/src/main/java/com/njcn/process/service/impl/SupvPushGwServiceImpl.java @@ -168,8 +168,8 @@ public class SupvPushGwServiceImpl implements SupvPushGwService { //电站等级 if(mapVoltage.containsKey(supvPlan.getSubstationVoltageLevel())) { - supvPlan.setSubstationVoltageLevel(String.format("%02d", mapVoltage.get(supvPlan.getSubstationVoltageLevel()).getAlgoDescribe())); supvPlan.setSubstationVoltageLevelName(mapVoltage.get(supvPlan.getSubstationVoltageLevel()).getName()); + supvPlan.setSubstationVoltageLevel(String.format("%02d", mapVoltage.get(supvPlan.getSubstationVoltageLevel()).getAlgoDescribe())); } @@ -179,11 +179,15 @@ public class SupvPushGwServiceImpl implements SupvPushGwService { supvPlan.setObjVoltageLevelName(dictData.getName()); } - + //判断用户是否存在 if (map.containsKey(supvPlan.getPlanUserId())) { supvPlan.setPlanUserName(map.get(supvPlan.getPlanUserId()).getName()); } - + //添加计划单位名称 + if(mapCode.containsKey(supvPlan.getPlanOrgId())){ + pvTerminalTreeVO = mapCode.get(supvPlan.getPlanOrgId()); + supvPlan.setPlanOrgName(pvTerminalTreeVO.getName()); + } } if(supvPlanList.size()>100){ throw new BusinessException("一次最多上送100条数据"); @@ -194,15 +198,15 @@ public class SupvPushGwServiceImpl implements SupvPushGwService { //TODO 调用国网接口 // Map map = postStatsUrl(getUrl(1), null, supvPlanList); - JSONArray objects = new JSONArray(Collections.singletonList(supvPlanList)); + JSONArray objects = new JSONArray(Collections.singletonList(supvPlanList)); String s = objects.toString(); log.info(Thread.currentThread().getName() + "获取返回体 推送技术监督工作计划:" + s + "结束----!"); - for(SupvPlan supvPlan: supvPlanList){ - SupvPlan supvPlanPO = new SupvPlan(); - supvPlanPO.setPlanId(supvPlan.getPlanId()); - supvPlanPO.setIsUploadHead(1); - supvPlanMapper.updateById(supvPlanPO); - } +// for(SupvPlan supvPlan: supvPlanList){ +// SupvPlan supvPlanPO = new SupvPlan(); +// supvPlanPO.setPlanId(supvPlan.getPlanId()); +// supvPlanPO.setIsUploadHead(1); +// supvPlanMapper.updateById(supvPlanPO); +// } @@ -235,7 +239,7 @@ public class SupvPushGwServiceImpl implements SupvPushGwService { supvProblem.setMonitorType(String.format("%02d",mapMonitorType.get(supvProblem.getMonitorType()).getAlgoDescribe())); } if(mapProblemType.containsKey(supvProblem.getProblemType())){ - supvProblem.setProblemType(String.format("%02d",mapProblemType.get(supvProblem.getMonitorType()).getAlgoDescribe())); + supvProblem.setProblemType(String.format("%02d",mapProblemType.get(supvProblem.getProblemType()).getAlgoDescribe())); } if(mapRe.containsKey(supvProblem.getRectificationMeasure())){ supvProblem.setRectificationMeasure(String.format("%02d",mapRe.get(supvProblem.getRectificationMeasure()).getAlgoDescribe())); @@ -253,12 +257,12 @@ public class SupvPushGwServiceImpl implements SupvPushGwService { JSONArray objects = new JSONArray(Collections.singletonList(supvProblemList)); String s = objects.toString(); log.info(Thread.currentThread().getName() + "获取返回体 推送技术监督实施问题:" + s + "结束----!"); - for(SupvProblem supvProblem:supvProblemList){ - SupvProblem supvProblemPO = new SupvProblem(); - supvProblemPO.setProblemId(supvProblem.getProblemId()); - supvProblemPO.setIsUploadHead(1); - supvProblemMapper.updateById(supvProblemPO); - } +// for(SupvProblem supvProblem:supvProblemList){ +// SupvProblem supvProblemPO = new SupvProblem(); +// supvProblemPO.setProblemId(supvProblem.getProblemId()); +// supvProblemPO.setIsUploadHead(1); +// supvProblemMapper.updateById(supvProblemPO); +// } return true; } @@ -294,12 +298,12 @@ public class SupvPushGwServiceImpl implements SupvPushGwService { JSONArray objects = new JSONArray(Collections.singletonList(supvReportMList)); String s = objects.toString(); log.info(Thread.currentThread().getName() + "获取返回体 推送技术监督月报统计数据接口:" + s + "结束----!"); - for(SupvReportM supvReportM : supvReportMList){ - SupvReportM supvReportMPO = new SupvReportM(); - supvReportMPO.setMonthReportId(supvReportM.getMonthReportId()); - supvReportMPO.setIsUploadHead(1); - supvReportMMapper.updateById(supvReportMPO); - } +// for(SupvReportM supvReportM : supvReportMList){ +// SupvReportM supvReportMPO = new SupvReportM(); +// supvReportMPO.setMonthReportId(supvReportM.getMonthReportId()); +// supvReportMPO.setIsUploadHead(1); +// supvReportMMapper.updateById(supvReportMPO); +// } return true; } @@ -326,10 +330,10 @@ public class SupvPushGwServiceImpl implements SupvPushGwService { JSONArray objects = new JSONArray(Collections.singletonList(supvPlanList)); String s = objects.toString(); log.info(Thread.currentThread().getName() + "获取返回体 取消电能质量技术监督工作计划接口:" + s + "结束----!"); - for(SupvPlan supvPlan : supvPlanList) { - supvPlan.setIsUploadHead(2); - supvPlanMapper.updateById(supvPlan); - } +// for(SupvPlan supvPlan : supvPlanList) { +// supvPlan.setIsUploadHead(2); +// supvPlanMapper.updateById(supvPlan); +// } return true; } @@ -424,7 +428,7 @@ public class SupvPushGwServiceImpl implements SupvPushGwService { * @return */ public static String getUrl(Integer type){ - String url="http://25.36.214.86:32234"; + String url="http://25.36.214.86:32234/CSB"; switch (type){ case 1: