diff --git a/jsowell-admin/src/main/resources/application-pre.yml b/jsowell-admin/src/main/resources/application-pre.yml index 793a9ba7f..a970fb4c5 100644 --- a/jsowell-admin/src/main/resources/application-pre.yml +++ b/jsowell-admin/src/main/resources/application-pre.yml @@ -8,17 +8,17 @@ spring: # redis 配置 redis: # 地址 - host: r-uf6k0uet7mihr5z78f.redis.rds.aliyuncs.com -# host: 106.14.94.149 +# host: r-uf6k0uet7mihr5z78f.redis.rds.aliyuncs.com + host: 106.14.94.149 # 端口,默认为6379 port: 6379 # 数据库索引 database: 0 # 账号 - username: jsowell +# username: jsowell # 密码 - password: js@160829 -# password: js160829 +# password: js@160829 + password: js160829 # 连接超时时间 timeout: 10s lettuce: @@ -38,12 +38,12 @@ spring: druid: # 主库数据源 master: - url: jdbc:mysql://rm-uf6ra51u33dc3798l.mysql.rds.aliyuncs.com:3306/jsowell_prd?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 - username: jsowell - password: js@160829 -# url: jdbc:mysql://106.14.94.149:3306/jsowell_pre?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 -# username: jsowell_pre -# password: Js@160829 +# url: jdbc:mysql://rm-uf6ra51u33dc3798l.mysql.rds.aliyuncs.com:3306/jsowell_prd?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 +# username: jsowell +# password: js@160829 + url: jdbc:mysql://106.14.94.149:3306/jsowell_pre?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 + username: jsowell_pre + password: Js@160829 # 从库数据源 slave: # 从数据源开关/默认关闭 diff --git a/jsowell-quartz/src/main/java/com/jsowell/quartz/task/JsowellTask.java b/jsowell-quartz/src/main/java/com/jsowell/quartz/task/JsowellTask.java index 915c9bf7a..5d7a48221 100644 --- a/jsowell-quartz/src/main/java/com/jsowell/quartz/task/JsowellTask.java +++ b/jsowell-quartz/src/main/java/com/jsowell/quartz/task/JsowellTask.java @@ -236,12 +236,13 @@ public class JsowellTask { */ public void pushStationRealTimePowerInfo() { String env = SpringUtils.getActiveProfile(); - if (StringUtils.equalsIgnoreCase(env, "prd")) { + if (StringUtils.equalsIgnoreCase(env, "pre")) { log.debug("PRE环境不执行"); return; } - List thirdPartyTypeList = Lists.newArrayList(ThirdPlatformTypeEnum.GUI_ZHOU_PLATFORM.getTypeCode(), + List thirdPartyTypeList = Lists.newArrayList( + ThirdPlatformTypeEnum.GUI_ZHOU_PLATFORM.getTypeCode(), ThirdPlatformTypeEnum.SI_CHUAN_PLATFORM.getTypeCode(), ThirdPlatformTypeEnum.JI_LIN_PLATFORM.getTypeCode() ); @@ -267,53 +268,6 @@ public class JsowellTask { } } } - - - // 查询出要推送的站点(贵州、) - // try { - // String thirdPartyType = ThirdPlatformTypeEnum.GUI_ZHOU_PLATFORM.getTypeCode(); - // List stationInfoVOS = thirdPartyStationRelationService.selectStationList(thirdPartyType); - // - // List stationIdList = stationInfoVOS.stream() - // .map(StationInfoVO::getStationId) - // .collect(Collectors.toList()); - // - // GuiZhouPlatformServiceImpl guiZhouPlatformService = new GuiZhouPlatformServiceImpl(); - // guiZhouPlatformService.notificationPowerInfo(stationIdList); - // } catch (Exception e) { - // log.error("贵州省平台推送充电站实时功率失败", e); - // } - - //四川省平台推送充电站实时功率 - // try { - // String thirdPartyType2 = ThirdPlatformTypeEnum.SI_CHUAN_PLATFORM.getTypeCode(); - // List stationInfoVOS2 = thirdPartyStationRelationService.selectStationList(thirdPartyType2); - // - // List stationIdList2 = stationInfoVOS2.stream() - // .map(StationInfoVO::getStationId) - // .collect(Collectors.toList()); - // - // SiChuanPlatformServiceImpl sichuanPlatformService = new SiChuanPlatformServiceImpl(); - // sichuanPlatformService.notificationPowerInfo(stationIdList2); - // } catch (Exception e) { - // log.error("四川省平台推送充电站实时功率失败", e); - // } - - // 吉林省平台推送充电站实时功率 - // try { - // String thirdPartyType3 = ThirdPlatformTypeEnum.JI_LIN_PLATFORM.getTypeCode(); - // List stationInfoVOS3 = thirdPartyStationRelationService.selectStationList(thirdPartyType3); - // - // List stationIdList3 = stationInfoVOS3.stream() - // .map(StationInfoVO::getStationId) - // .collect(Collectors.toList()); - // - // JiLinPlatformServiceImpl jiLinPlatformService = new JiLinPlatformServiceImpl(); - // jiLinPlatformService.notificationPowerInfo(stationIdList3); - // } catch (Exception e) { - // log.error("吉林省平台推送充电站实时功率失败", e); - // } - } @@ -322,12 +276,13 @@ public class JsowellTask { */ public void pushStatisticsInfo() { String env = SpringUtils.getActiveProfile(); - if (StringUtils.equalsIgnoreCase(env, "prd")) { + if (StringUtils.equalsIgnoreCase(env, "pre")) { log.debug("PRE环境不执行"); return; } - List thirdPartyTypeList = Lists.newArrayList(ThirdPlatformTypeEnum.GUI_ZHOU_PLATFORM.getTypeCode(), + List thirdPartyTypeList = Lists.newArrayList( + ThirdPlatformTypeEnum.GUI_ZHOU_PLATFORM.getTypeCode(), ThirdPlatformTypeEnum.SI_CHUAN_PLATFORM.getTypeCode(), ThirdPlatformTypeEnum.JI_LIN_PLATFORM.getTypeCode() ); @@ -353,59 +308,6 @@ public class JsowellTask { } } } - - - - - - - // 贵州推送充电站统计信息 - /* try { - String thirdPartyType = ThirdPlatformTypeEnum.GUI_ZHOU_PLATFORM.getTypeCode(); - List stationInfoVOS = thirdPartyStationRelationService.selectStationList(thirdPartyType); - - List stationIdList = stationInfoVOS.stream() - .map(StationInfoVO::getStationId) - .collect(Collectors.toList()); - GuiZhouPlatformServiceImpl guiZhouPlatformService = new GuiZhouPlatformServiceImpl(); - for (String stationId : stationIdList) { - guiZhouPlatformService.notificationOperationStatsInfo(stationId); - } - } catch (Exception e) { - log.error("贵州省平台推送充电站统计信息失败", e); - } - - //四川省平台推送用能统计 - try { - String thirdPartyType2 = ThirdPlatformTypeEnum.SI_CHUAN_PLATFORM.getTypeCode(); - List stationInfoVOS2 = thirdPartyStationRelationService.selectStationList(thirdPartyType2); - - List stationIdList2 = stationInfoVOS2.stream() - .map(StationInfoVO::getStationId) - .collect(Collectors.toList()); - SiChuanPlatformServiceImpl sichuanPlatformService = new SiChuanPlatformServiceImpl(); - for (String stationId : stationIdList2) { - sichuanPlatformService.notificationOperationStatsInfo(stationId); - } - } catch (Exception e) { - log.error("四川省平台推送用能统计失败", e); - } - - // 吉林省平台推送充电站用能统计 - try { - String thirdPartyType3 = ThirdPlatformTypeEnum.JI_LIN_PLATFORM.getTypeCode(); - List stationInfoVOS3 = thirdPartyStationRelationService.selectStationList(thirdPartyType3); - - List stationIdList3 = stationInfoVOS3.stream() - .map(StationInfoVO::getStationId) - .collect(Collectors.toList()); - JiLinPlatformServiceImpl jiLinPlatformService = new JiLinPlatformServiceImpl(); - for (String stationId : stationIdList3) { - jiLinPlatformService.notificationOperationStatsInfo(stationId); - } - } catch (Exception e) { - log.error("吉林省平台推送充电站用能统计失败", e); - }*/ } diff --git a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/service/impl/JiLinPlatformServiceImpl.java b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/service/impl/JiLinPlatformServiceImpl.java index 2913a14ef..75f56a6a2 100644 --- a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/service/impl/JiLinPlatformServiceImpl.java +++ b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/service/impl/JiLinPlatformServiceImpl.java @@ -772,6 +772,13 @@ public class JiLinPlatformServiceImpl implements ThirdPartyPlatformService { */ @Override public String notificationStartChargeResult(String orderCode) { + // 校验是否是吉林平台订单 + boolean needPushToThirdPartyPlatform = ThirdPartyPlatformUtils.isNeedPushToThirdPartyPlatform(orderCode , ThirdPlatformTypeEnum.JI_LIN_PLATFORM.getOperatorId()); + + if (!needPushToThirdPartyPlatform) { + return null; + } + // 根据订单号查询订单信息 OrderBasicInfo orderInfo = orderBasicInfoService.getOrderInfoByOrderCode(orderCode); if (orderInfo == null) { @@ -816,6 +823,11 @@ public class JiLinPlatformServiceImpl implements ThirdPartyPlatformService { String operatorID = dto.getOperatorID(); String orderNo = dto.getOrderNo(); dto.setStartChargeSeq(orderNo); + boolean needPushToThirdPartyPlatform = ThirdPartyPlatformUtils.isNeedPushToThirdPartyPlatform(orderNo , ThirdPlatformTypeEnum.JI_LIN_PLATFORM.getOperatorId()); + + if (!needPushToThirdPartyPlatform) { + return null; + } // 通过订单号查询订单信息 OrderBasicInfo orderInfo = orderBasicInfoService.getOrderInfoByOrderCode(dto.getStartChargeSeq()); // logger.info(operatorName + "查询订单信息 orderInfo:{}", orderInfo); @@ -895,6 +907,11 @@ public class JiLinPlatformServiceImpl implements ThirdPartyPlatformService { */ @Override public String notificationEquipChargeStatus(String orderCode) { + boolean needPushToThirdPartyPlatform = ThirdPartyPlatformUtils.isNeedPushToThirdPartyPlatform(orderCode , ThirdPlatformTypeEnum.JI_LIN_PLATFORM.getOperatorId()); + + if (!needPushToThirdPartyPlatform) { + return null; + } // 根据订单号查询订单信息 OrderBasicInfo orderInfo = orderBasicInfoService.getOrderInfoByOrderCode(orderCode); OrderDetail orderDetail = orderBasicInfoService.getOrderDetailByOrderCode(orderInfo.getOrderCode()); @@ -992,6 +1009,12 @@ public class JiLinPlatformServiceImpl implements ThirdPartyPlatformService { //使用orderNo接收的数据 String orderCode = dto.getOrderNo(); + boolean needPushToThirdPartyPlatform = ThirdPartyPlatformUtils.isNeedPushToThirdPartyPlatform(orderCode , ThirdPlatformTypeEnum.JI_LIN_PLATFORM.getOperatorId()); + + if (!needPushToThirdPartyPlatform) { + return null; + } + int orderStatus = 2; int succStat = 1; ThirdPartySecretInfoVO jiLinSecretInfo = getJiLinSecretInfo(); @@ -1026,6 +1049,12 @@ public class JiLinPlatformServiceImpl implements ThirdPartyPlatformService { */ @Override public String notificationStopChargeResult(String orderCode) { + + boolean needPushToThirdPartyPlatform = ThirdPartyPlatformUtils.isNeedPushToThirdPartyPlatform(orderCode , ThirdPlatformTypeEnum.JI_LIN_PLATFORM.getOperatorId()); + + if (!needPushToThirdPartyPlatform) { + return null; + } // 根据订单号查询订单信息 OrderBasicInfo orderInfo = orderBasicInfoService.getOrderInfoByOrderCode(orderCode); if (orderInfo == null) { @@ -1067,6 +1096,11 @@ public class JiLinPlatformServiceImpl implements ThirdPartyPlatformService { */ @Override public String notificationChargeOrderInfo(String orderCode) { + boolean needPushToThirdPartyPlatform = ThirdPartyPlatformUtils.isNeedPushToThirdPartyPlatform(orderCode , ThirdPlatformTypeEnum.JI_LIN_PLATFORM.getOperatorId()); + + if (!needPushToThirdPartyPlatform) { + return null; + } // 根据订单号查询出信息 OrderBasicInfo orderBasicInfo = orderBasicInfoService.getOrderInfoByOrderCode(orderCode); OrderDetail orderDetail = orderBasicInfoService.getOrderDetailByOrderCode(orderCode); @@ -1562,17 +1596,17 @@ public class JiLinPlatformServiceImpl implements ThirdPartyPlatformService { list.add(supStationPowerInfo); } - log.info("推送充电站实时功率信息:{}", JSON.toJSONString(list)); - // 获取推送配置密钥信息 - ThirdPartySecretInfoVO guiZhouPlatformSecretInfo = getJiLinSecretInfo(); + ThirdPartySecretInfoVO jiLinSecretInfo = getJiLinSecretInfo(); String operatorId = Constants.OPERATORID_JIANG_SU; - String operatorSecret = guiZhouPlatformSecretInfo.getTheirOperatorSecret(); - String signSecret = guiZhouPlatformSecretInfo.getTheirSigSecret(); - String dataSecret = guiZhouPlatformSecretInfo.getTheirDataSecret(); - String dataSecretIv = guiZhouPlatformSecretInfo.getTheirDataSecretIv(); - String urlAddress = guiZhouPlatformSecretInfo.getTheirUrlPrefix(); + String operatorSecret = jiLinSecretInfo.getTheirOperatorSecret(); + String signSecret = jiLinSecretInfo.getTheirSigSecret(); + String dataSecret = jiLinSecretInfo.getTheirDataSecret(); + String dataSecretIv = jiLinSecretInfo.getTheirDataSecretIv(); + String urlAddress = jiLinSecretInfo.getTheirUrlPrefix(); + + log.info("吉林平台信息:{}" , jiLinSecretInfo.toString()); String url = urlAddress + "notification_realtime_power_info"; // 获取令牌 @@ -1580,6 +1614,8 @@ public class JiLinPlatformServiceImpl implements ThirdPartyPlatformService { if (StringUtils.isBlank(token)) { return null; } + log.info("获取令牌成功:{}", token); + JSONObject json = new JSONObject(); json.put("StationPowerInfos", list); String jsonString = JSON.toJSONString(json);