update pre数据库

This commit is contained in:
YAS\29473
2025-08-18 08:40:07 +08:00
parent 008441527e
commit 146bb86865
3 changed files with 61 additions and 123 deletions

View File

@@ -8,17 +8,17 @@ spring:
# redis 配置 # redis 配置
redis: redis:
# 地址 # 地址
host: r-uf6k0uet7mihr5z78f.redis.rds.aliyuncs.com # host: r-uf6k0uet7mihr5z78f.redis.rds.aliyuncs.com
# host: 106.14.94.149 host: 106.14.94.149
# 端口默认为6379 # 端口默认为6379
port: 6379 port: 6379
# 数据库索引 # 数据库索引
database: 0 database: 0
# 账号 # 账号
username: jsowell # username: jsowell
# 密码 # 密码
password: js@160829 # password: js@160829
# password: js160829 password: js160829
# 连接超时时间 # 连接超时时间
timeout: 10s timeout: 10s
lettuce: lettuce:
@@ -38,12 +38,12 @@ spring:
druid: druid:
# 主库数据源 # 主库数据源
master: master:
url: jdbc:mysql://rm-uf6ra51u33dc3798l.mysql.rds.aliyuncs.com:3306/jsowell_prd?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 # 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 # username: jsowell
password: js@160829 # password: js@160829
# url: jdbc:mysql://106.14.94.149:3306/jsowell_pre?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 url: jdbc:mysql://106.14.94.149:3306/jsowell_pre?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
# username: jsowell_pre username: jsowell_pre
# password: Js@160829 password: Js@160829
# 从库数据源 # 从库数据源
slave: slave:
# 从数据源开关/默认关闭 # 从数据源开关/默认关闭

View File

@@ -236,12 +236,13 @@ public class JsowellTask {
*/ */
public void pushStationRealTimePowerInfo() { public void pushStationRealTimePowerInfo() {
String env = SpringUtils.getActiveProfile(); String env = SpringUtils.getActiveProfile();
if (StringUtils.equalsIgnoreCase(env, "prd")) { if (StringUtils.equalsIgnoreCase(env, "pre")) {
log.debug("PRE环境不执行"); log.debug("PRE环境不执行");
return; return;
} }
List<String> thirdPartyTypeList = Lists.newArrayList(ThirdPlatformTypeEnum.GUI_ZHOU_PLATFORM.getTypeCode(), List<String> thirdPartyTypeList = Lists.newArrayList(
ThirdPlatformTypeEnum.GUI_ZHOU_PLATFORM.getTypeCode(),
ThirdPlatformTypeEnum.SI_CHUAN_PLATFORM.getTypeCode(), ThirdPlatformTypeEnum.SI_CHUAN_PLATFORM.getTypeCode(),
ThirdPlatformTypeEnum.JI_LIN_PLATFORM.getTypeCode() ThirdPlatformTypeEnum.JI_LIN_PLATFORM.getTypeCode()
); );
@@ -267,53 +268,6 @@ public class JsowellTask {
} }
} }
} }
// 查询出要推送的站点(贵州、)
// try {
// String thirdPartyType = ThirdPlatformTypeEnum.GUI_ZHOU_PLATFORM.getTypeCode();
// List<StationInfoVO> stationInfoVOS = thirdPartyStationRelationService.selectStationList(thirdPartyType);
//
// List<String> 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<StationInfoVO> stationInfoVOS2 = thirdPartyStationRelationService.selectStationList(thirdPartyType2);
//
// List<String> 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<StationInfoVO> stationInfoVOS3 = thirdPartyStationRelationService.selectStationList(thirdPartyType3);
//
// List<String> 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() { public void pushStatisticsInfo() {
String env = SpringUtils.getActiveProfile(); String env = SpringUtils.getActiveProfile();
if (StringUtils.equalsIgnoreCase(env, "prd")) { if (StringUtils.equalsIgnoreCase(env, "pre")) {
log.debug("PRE环境不执行"); log.debug("PRE环境不执行");
return; return;
} }
List<String> thirdPartyTypeList = Lists.newArrayList(ThirdPlatformTypeEnum.GUI_ZHOU_PLATFORM.getTypeCode(), List<String> thirdPartyTypeList = Lists.newArrayList(
ThirdPlatformTypeEnum.GUI_ZHOU_PLATFORM.getTypeCode(),
ThirdPlatformTypeEnum.SI_CHUAN_PLATFORM.getTypeCode(), ThirdPlatformTypeEnum.SI_CHUAN_PLATFORM.getTypeCode(),
ThirdPlatformTypeEnum.JI_LIN_PLATFORM.getTypeCode() ThirdPlatformTypeEnum.JI_LIN_PLATFORM.getTypeCode()
); );
@@ -353,59 +308,6 @@ public class JsowellTask {
} }
} }
} }
// 贵州推送充电站统计信息
/* try {
String thirdPartyType = ThirdPlatformTypeEnum.GUI_ZHOU_PLATFORM.getTypeCode();
List<StationInfoVO> stationInfoVOS = thirdPartyStationRelationService.selectStationList(thirdPartyType);
List<String> 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<StationInfoVO> stationInfoVOS2 = thirdPartyStationRelationService.selectStationList(thirdPartyType2);
List<String> 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<StationInfoVO> stationInfoVOS3 = thirdPartyStationRelationService.selectStationList(thirdPartyType3);
List<String> 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);
}*/
} }

View File

@@ -772,6 +772,13 @@ public class JiLinPlatformServiceImpl implements ThirdPartyPlatformService {
*/ */
@Override @Override
public String notificationStartChargeResult(String orderCode) { public String notificationStartChargeResult(String orderCode) {
// 校验是否是吉林平台订单
boolean needPushToThirdPartyPlatform = ThirdPartyPlatformUtils.isNeedPushToThirdPartyPlatform(orderCode , ThirdPlatformTypeEnum.JI_LIN_PLATFORM.getOperatorId());
if (!needPushToThirdPartyPlatform) {
return null;
}
// 根据订单号查询订单信息 // 根据订单号查询订单信息
OrderBasicInfo orderInfo = orderBasicInfoService.getOrderInfoByOrderCode(orderCode); OrderBasicInfo orderInfo = orderBasicInfoService.getOrderInfoByOrderCode(orderCode);
if (orderInfo == null) { if (orderInfo == null) {
@@ -816,6 +823,11 @@ public class JiLinPlatformServiceImpl implements ThirdPartyPlatformService {
String operatorID = dto.getOperatorID(); String operatorID = dto.getOperatorID();
String orderNo = dto.getOrderNo(); String orderNo = dto.getOrderNo();
dto.setStartChargeSeq(orderNo); dto.setStartChargeSeq(orderNo);
boolean needPushToThirdPartyPlatform = ThirdPartyPlatformUtils.isNeedPushToThirdPartyPlatform(orderNo , ThirdPlatformTypeEnum.JI_LIN_PLATFORM.getOperatorId());
if (!needPushToThirdPartyPlatform) {
return null;
}
// 通过订单号查询订单信息 // 通过订单号查询订单信息
OrderBasicInfo orderInfo = orderBasicInfoService.getOrderInfoByOrderCode(dto.getStartChargeSeq()); OrderBasicInfo orderInfo = orderBasicInfoService.getOrderInfoByOrderCode(dto.getStartChargeSeq());
// logger.info(operatorName + "查询订单信息 orderInfo:{}", orderInfo); // logger.info(operatorName + "查询订单信息 orderInfo:{}", orderInfo);
@@ -895,6 +907,11 @@ public class JiLinPlatformServiceImpl implements ThirdPartyPlatformService {
*/ */
@Override @Override
public String notificationEquipChargeStatus(String orderCode) { public String notificationEquipChargeStatus(String orderCode) {
boolean needPushToThirdPartyPlatform = ThirdPartyPlatformUtils.isNeedPushToThirdPartyPlatform(orderCode , ThirdPlatformTypeEnum.JI_LIN_PLATFORM.getOperatorId());
if (!needPushToThirdPartyPlatform) {
return null;
}
// 根据订单号查询订单信息 // 根据订单号查询订单信息
OrderBasicInfo orderInfo = orderBasicInfoService.getOrderInfoByOrderCode(orderCode); OrderBasicInfo orderInfo = orderBasicInfoService.getOrderInfoByOrderCode(orderCode);
OrderDetail orderDetail = orderBasicInfoService.getOrderDetailByOrderCode(orderInfo.getOrderCode()); OrderDetail orderDetail = orderBasicInfoService.getOrderDetailByOrderCode(orderInfo.getOrderCode());
@@ -992,6 +1009,12 @@ public class JiLinPlatformServiceImpl implements ThirdPartyPlatformService {
//使用orderNo接收的数据 //使用orderNo接收的数据
String orderCode = dto.getOrderNo(); String orderCode = dto.getOrderNo();
boolean needPushToThirdPartyPlatform = ThirdPartyPlatformUtils.isNeedPushToThirdPartyPlatform(orderCode , ThirdPlatformTypeEnum.JI_LIN_PLATFORM.getOperatorId());
if (!needPushToThirdPartyPlatform) {
return null;
}
int orderStatus = 2; int orderStatus = 2;
int succStat = 1; int succStat = 1;
ThirdPartySecretInfoVO jiLinSecretInfo = getJiLinSecretInfo(); ThirdPartySecretInfoVO jiLinSecretInfo = getJiLinSecretInfo();
@@ -1026,6 +1049,12 @@ public class JiLinPlatformServiceImpl implements ThirdPartyPlatformService {
*/ */
@Override @Override
public String notificationStopChargeResult(String orderCode) { public String notificationStopChargeResult(String orderCode) {
boolean needPushToThirdPartyPlatform = ThirdPartyPlatformUtils.isNeedPushToThirdPartyPlatform(orderCode , ThirdPlatformTypeEnum.JI_LIN_PLATFORM.getOperatorId());
if (!needPushToThirdPartyPlatform) {
return null;
}
// 根据订单号查询订单信息 // 根据订单号查询订单信息
OrderBasicInfo orderInfo = orderBasicInfoService.getOrderInfoByOrderCode(orderCode); OrderBasicInfo orderInfo = orderBasicInfoService.getOrderInfoByOrderCode(orderCode);
if (orderInfo == null) { if (orderInfo == null) {
@@ -1067,6 +1096,11 @@ public class JiLinPlatformServiceImpl implements ThirdPartyPlatformService {
*/ */
@Override @Override
public String notificationChargeOrderInfo(String orderCode) { public String notificationChargeOrderInfo(String orderCode) {
boolean needPushToThirdPartyPlatform = ThirdPartyPlatformUtils.isNeedPushToThirdPartyPlatform(orderCode , ThirdPlatformTypeEnum.JI_LIN_PLATFORM.getOperatorId());
if (!needPushToThirdPartyPlatform) {
return null;
}
// 根据订单号查询出信息 // 根据订单号查询出信息
OrderBasicInfo orderBasicInfo = orderBasicInfoService.getOrderInfoByOrderCode(orderCode); OrderBasicInfo orderBasicInfo = orderBasicInfoService.getOrderInfoByOrderCode(orderCode);
OrderDetail orderDetail = orderBasicInfoService.getOrderDetailByOrderCode(orderCode); OrderDetail orderDetail = orderBasicInfoService.getOrderDetailByOrderCode(orderCode);
@@ -1562,17 +1596,17 @@ public class JiLinPlatformServiceImpl implements ThirdPartyPlatformService {
list.add(supStationPowerInfo); list.add(supStationPowerInfo);
} }
log.info("推送充电站实时功率信息:{}", JSON.toJSONString(list));
// 获取推送配置密钥信息 // 获取推送配置密钥信息
ThirdPartySecretInfoVO guiZhouPlatformSecretInfo = getJiLinSecretInfo(); ThirdPartySecretInfoVO jiLinSecretInfo = getJiLinSecretInfo();
String operatorId = Constants.OPERATORID_JIANG_SU; String operatorId = Constants.OPERATORID_JIANG_SU;
String operatorSecret = guiZhouPlatformSecretInfo.getTheirOperatorSecret(); String operatorSecret = jiLinSecretInfo.getTheirOperatorSecret();
String signSecret = guiZhouPlatformSecretInfo.getTheirSigSecret(); String signSecret = jiLinSecretInfo.getTheirSigSecret();
String dataSecret = guiZhouPlatformSecretInfo.getTheirDataSecret(); String dataSecret = jiLinSecretInfo.getTheirDataSecret();
String dataSecretIv = guiZhouPlatformSecretInfo.getTheirDataSecretIv(); String dataSecretIv = jiLinSecretInfo.getTheirDataSecretIv();
String urlAddress = guiZhouPlatformSecretInfo.getTheirUrlPrefix(); String urlAddress = jiLinSecretInfo.getTheirUrlPrefix();
log.info("吉林平台信息:{}" , jiLinSecretInfo.toString());
String url = urlAddress + "notification_realtime_power_info"; String url = urlAddress + "notification_realtime_power_info";
// 获取令牌 // 获取令牌
@@ -1580,6 +1614,8 @@ public class JiLinPlatformServiceImpl implements ThirdPartyPlatformService {
if (StringUtils.isBlank(token)) { if (StringUtils.isBlank(token)) {
return null; return null;
} }
log.info("获取令牌成功:{}", token);
JSONObject json = new JSONObject(); JSONObject json = new JSONObject();
json.put("StationPowerInfos", list); json.put("StationPowerInfos", list);
String jsonString = JSON.toJSONString(json); String jsonString = JSON.toJSONString(json);