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();