From e1d6947f7a22099d2e38726b7fd872969d2d5ef9 Mon Sep 17 00:00:00 2001 From: Lemon Date: Sun, 28 Apr 2024 10:35:37 +0800 Subject: [PATCH] =?UTF-8?q?update=20=20=E9=9D=92=E6=B5=B7=E5=B9=B3?= =?UTF-8?q?=E5=8F=B0=E6=8E=A8=E9=80=81=E7=AB=99=E7=82=B9=E5=8A=9F=E7=8E=87?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/application-dev.yml | 8 ++-- .../service/QingHaiPlatformServiceImpl.java | 42 +++++++++++++------ 2 files changed, 33 insertions(+), 17 deletions(-) diff --git a/jsowell-admin/src/main/resources/application-dev.yml b/jsowell-admin/src/main/resources/application-dev.yml index 4f55bc4c1..63d442743 100644 --- a/jsowell-admin/src/main/resources/application-dev.yml +++ b/jsowell-admin/src/main/resources/application-dev.yml @@ -36,10 +36,10 @@ spring: druid: # 主库数据源 master: - url: jdbc:mysql://192.168.2.2:3306/jsowell_dev?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 - username: jsowell_dev - #url: jdbc:mysql://192.168.2.2:3306/jsowell_prd_copy?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 - #username: jsowell_prd_copy +# url: jdbc:mysql://192.168.2.2:3306/jsowell_dev?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 +# username: jsowell_dev + url: jdbc:mysql://192.168.2.2:3306/jsowell_prd_copy?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 + username: jsowell_prd_copy password: 123456 # 从库数据源 slave: diff --git a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/qinghai/service/QingHaiPlatformServiceImpl.java b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/qinghai/service/QingHaiPlatformServiceImpl.java index 47b0d30b1..521cf830c 100644 --- a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/qinghai/service/QingHaiPlatformServiceImpl.java +++ b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/qinghai/service/QingHaiPlatformServiceImpl.java @@ -408,8 +408,15 @@ public class QingHaiPlatformServiceImpl implements ThirdPartyPlatformService { public String notificationPowerInfo(List stationIds) { SupStationPowerInfo supStationPowerInfo = null; List list = new ArrayList<>(); + + List supPileInfoList = null; SupStationPowerInfo .EquipmentPowerInfo supPileInfo = null; + + List connectorPowerInfoList = null; SupStationPowerInfo .EquipmentPowerInfo .ConnectorPowerInfo connectorPowerInfo = null; @@ -447,6 +454,7 @@ public class QingHaiPlatformServiceImpl implements ThirdPartyPlatformService { logger.error("推送充换电站实时功率 error, 查询枪口列表信息为空"); throw new BusinessException(ReturnCodeEnum.CODE_SELECT_INFO_IS_NULL); } + supPileInfoList = new ArrayList<>(); String dateTimeNow = DateUtils.dateTimeNow(DateUtils.YYYY_MM_DD_HH_MM_SS); for (PileBasicInfo pileBasicInfo : pileList) { supPileInfo = new SupStationPowerInfo.EquipmentPowerInfo(); @@ -454,28 +462,36 @@ public class QingHaiPlatformServiceImpl implements ThirdPartyPlatformService { supPileInfo.setEquipmentClassification(Constants.one); supPileInfo.setDataTime(dateTimeNow); BigDecimal pileInstantPower = BigDecimal.ZERO; - + connectorPowerInfoList = new ArrayList<>(); for (PileConnectorInfoVO pileConnectorInfoVO : connectorList) { - if (StringUtils.equals(pileBasicInfo.getSn(), pileConnectorInfoVO.getPileSn())) { - connectorPowerInfo = new SupStationPowerInfo - .EquipmentPowerInfo - .ConnectorPowerInfo(); - connectorPowerInfo.setConnectorID(pileConnectorInfoVO.getPileConnectorCode()); - connectorPowerInfo.setEquipmentClassification(Constants.one); - connectorPowerInfo.setDataTime(dateTimeNow); - BigDecimal InstantPower = pileConnectorInfoVO.getInstantPower().setScale(1, BigDecimal.ROUND_HALF_UP); - connectorPowerInfo.setConnectorRealTimePower(InstantPower); - // 计算桩此时实时功率 - pileInstantPower = pileInstantPower.add(InstantPower); + if (!StringUtils.equals(pileBasicInfo.getSn(), pileConnectorInfoVO.getPileSn())) { + continue; } + BigDecimal instantPower = pileConnectorInfoVO.getInstantPower() == null ? BigDecimal.ZERO : pileConnectorInfoVO.getInstantPower(); + connectorPowerInfo = new SupStationPowerInfo + .EquipmentPowerInfo + .ConnectorPowerInfo(); + connectorPowerInfo.setConnectorID(pileConnectorInfoVO.getPileConnectorCode()); + connectorPowerInfo.setEquipmentClassification(Constants.one); + connectorPowerInfo.setDataTime(dateTimeNow); + BigDecimal InstantPower = instantPower.setScale(1, BigDecimal.ROUND_HALF_UP); + connectorPowerInfo.setConnectorRealTimePower(InstantPower); + // 计算桩此时实时功率 + pileInstantPower = pileInstantPower.add(InstantPower); + + connectorPowerInfoList.add(connectorPowerInfo); } + supPileInfo.setConnectorPowerInfos(connectorPowerInfoList); // 桩实时功率 supPileInfo.setEquipRealTimePower(pileInstantPower); stationPower = stationPower.add(pileInstantPower); + + supPileInfoList.add(supPileInfo); } + supStationPowerInfo.setEquipmentPowerInfos(supPileInfoList); supStationPowerInfo.setStationRealTimePower(stationPower); - list.add(supStationPowerInfo); } + list.add(supStationPowerInfo); // 获取推送配置密钥信息 ThirdPartyStationRelationVO settingInfo = getQingHaiSettingInfo();