From 55dbe9e74e7251d94144e676293edc304922a357 Mon Sep 17 00:00:00 2001 From: wr <1754607820@qq.com> Date: Tue, 20 Jun 2023 14:15:25 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../PowerDistributionareaServiceImpl.java | 24 +++++++++---------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/src/main/java/com/njcn/syncdata/service/impl/PowerDistributionareaServiceImpl.java b/src/main/java/com/njcn/syncdata/service/impl/PowerDistributionareaServiceImpl.java index cc339c4..aa97c83 100644 --- a/src/main/java/com/njcn/syncdata/service/impl/PowerDistributionareaServiceImpl.java +++ b/src/main/java/com/njcn/syncdata/service/impl/PowerDistributionareaServiceImpl.java @@ -194,7 +194,8 @@ public class PowerDistributionareaServiceImpl extends ReplenishMybatisServiceImp //初始化集合 List info = new ArrayList<>(); List orgID = new ArrayList<>(); - String token = null; + List opeID = new ArrayList<>(); + String token = LoginToken(); //1.获取数据台账信息 //获取数据中台数据 @@ -289,8 +290,7 @@ public class PowerDistributionareaServiceImpl extends ReplenishMybatisServiceImp continue; } if (StrUtil.isBlank(area.getOperationName())) { - orgID.add(area.getOperationId()); - continue; + opeID.add(area.getOperationId()); } //判断传入的电压等级,台区区域,使用性质是否为空 if(StrUtil.hasBlank(pwopTransformerPSR.getVOLTAGELEVEL_ID(), @@ -299,12 +299,6 @@ public class PowerDistributionareaServiceImpl extends ReplenishMybatisServiceImp ){ continue; } - if(StrUtil.hasBlank(pwopTransformerPSR.getVOLTAGELEVEL_ID(), - pwopTransformerPSR.getREGION_TYPE(), - pwopTransformerPSR.getUse_nature()) - ){ - continue; - } //todo 要做处理(处理) area.setVoltageLevel(getAlgoDescribe(pwopTransformerPSR.getVOLTAGELEVEL_ID(), devVoltage)); //todo 要做处理(处理) @@ -340,16 +334,20 @@ public class PowerDistributionareaServiceImpl extends ReplenishMybatisServiceImp } } } + log.info(Thread.currentThread().getName() + "4.数据添加 info:" + info + "结束----!"); if (CollUtil.isNotEmpty(info)) { - log.info(Thread.currentThread().getName() + "4.数据添加 info:" + info + "结束----!"); LambdaQueryWrapper lambdaQueryWrapper = new LambdaQueryWrapper<>(); lambdaQueryWrapper.eq(PowerDistributionarea::getInputStatus, 1); this.remove(lambdaQueryWrapper); this.insertBatchBySlice(info, 1000); } - if (CollUtil.isNotEmpty(orgID)) { - log.info(Thread.currentThread().getName() + "5.数据添加 orgID:" + orgID + "结束----!"); - return message + "数据存在未知部门:" + String.join(",", orgID); + if (CollUtil.isNotEmpty(orgID)||CollUtil.isNotEmpty(opeID)) { + List orgDept = orgID.stream().distinct().collect(Collectors.toList()); + List opeDept = opeID.stream().distinct().collect(Collectors.toList()); + log.info(Thread.currentThread().getName() + "5.数据添加 orgID:" + orgDept + "结束----!"); + return message + "1.数据存在未知部门:" + String.join(",", orgDept)+System.getProperty("line.separator")+ + "2.数据存在未知运维单位部门:" + String.join(",", opeDept); + } } catch (Exception e) { log.error(Thread.currentThread().getName() + "链接" + e + "失败");