|
|
@@ -50,7 +50,7 @@ import java.util.stream.Collectors;
|
|
|
public class PlatformNotifyServiceImpl implements PlatformNotifyService {
|
|
|
private static final Logger LOGGER = LoggerFactory.getLogger(PlatformNotifyServiceImpl.class);
|
|
|
public final StringRedisTemplate redisTemplate;
|
|
|
- private final PlatformApiService enPlusService;
|
|
|
+ private final PlatformApiService platformApiService;
|
|
|
private final ChargeOrderService chargeOrderService;
|
|
|
private final ChargeService chargeService;
|
|
|
private final AccountService accountService;
|
|
|
@@ -63,8 +63,8 @@ public class PlatformNotifyServiceImpl implements PlatformNotifyService {
|
|
|
@Value("${kym.notify-email}")
|
|
|
private String notifyEmail;
|
|
|
|
|
|
- public PlatformNotifyServiceImpl(PlatformApiService enPlusService, ChargeOrderService chargeOrderService, ChargeService chargeService, AccountService accountService, WalletDetailService walletDetailService, MonitorLogService monitorLogService, EquipmentInfoService equipmentInfoService, ConnectorInfoService connectorInfoService, StringRedisTemplate redisTemplate, UserStationService userStationService) {
|
|
|
- this.enPlusService = enPlusService;
|
|
|
+ public PlatformNotifyServiceImpl(PlatformApiService platformApiService, ChargeOrderService chargeOrderService, ChargeService chargeService, AccountService accountService, WalletDetailService walletDetailService, MonitorLogService monitorLogService, EquipmentInfoService equipmentInfoService, ConnectorInfoService connectorInfoService, StringRedisTemplate redisTemplate, UserStationService userStationService) {
|
|
|
+ this.platformApiService = platformApiService;
|
|
|
this.chargeOrderService = chargeOrderService;
|
|
|
this.chargeService = chargeService;
|
|
|
this.accountService = accountService;
|
|
|
@@ -83,7 +83,7 @@ public class PlatformNotifyServiceImpl implements PlatformNotifyService {
|
|
|
|
|
|
@Override
|
|
|
public String queryToken(String platformName, JSONObject json) {
|
|
|
- var data = enPlusService.signValidation(platformName, json);
|
|
|
+ var data = platformApiService.signValidation(platformName, json);
|
|
|
LOGGER.info("【{}互联互通平台推送】收到请求快与慢Token:{},解密数据:{}", platformName, json, data);
|
|
|
var platform = PlatformCache.INSTANCE.getPlatformByName(platformName);
|
|
|
// 查询缓存,存在则返回值和过期时间,不存在则重新生成并缓存
|
|
|
@@ -118,7 +118,7 @@ public class PlatformNotifyServiceImpl implements PlatformNotifyService {
|
|
|
@Override
|
|
|
@DS("db-admin")
|
|
|
public String handleNotificationStationStatus(String platformName, JSONObject json) {
|
|
|
- var data = enPlusService.signValidation(platformName, json);
|
|
|
+ var data = platformApiService.signValidation(platformName, json);
|
|
|
LOGGER.info("【{}互联互通平台推送】收到充电桩设备状态变化推送:{},解密数据:{}", platformName, json, data);
|
|
|
// 更新数据库,存入redis,发送邮件通知
|
|
|
var connectorStatusInfo = JSONObject.parseObject(data).getJSONObject("ConnectorStatusInfo").toJavaObject(PlatformConnectorStatusInfo.class);
|
|
|
@@ -182,8 +182,8 @@ public class PlatformNotifyServiceImpl implements PlatformNotifyService {
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
@DS("db-miniapp")
|
|
|
public String handleNotificationStartChargeResult(String platformName, JSONObject json) {
|
|
|
- var data = enPlusService.signValidation(platformName, json);
|
|
|
- LOGGER.info("【EN+推送】收到启动充电结果推送:{},解密数据:{}", json, data);
|
|
|
+ var data = platformApiService.signValidation(platformName, json);
|
|
|
+ LOGGER.info("【{}互联互通平台推送】收到启动充电结果推送:{},解密数据:{}", platformName, json, data);
|
|
|
var obj = JSONObject.parseObject(data);
|
|
|
var startChargeSeq = obj.getString("StartChargeSeq");
|
|
|
var startChargeSeqStat = obj.getIntValue("StartChargeSeqStat");
|
|
|
@@ -219,9 +219,9 @@ public class PlatformNotifyServiceImpl implements PlatformNotifyService {
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public String handleNotificationEquipChargeStatus(String platformName, JSONObject json) {
|
|
|
- var dataStr = enPlusService.signValidation(platformName, json);
|
|
|
+ var dataStr = platformApiService.signValidation(platformName, json);
|
|
|
var data = JSONObject.parseObject(dataStr);
|
|
|
- LOGGER.info("【EN+推送】 :{},解密数据:{}", json, data);
|
|
|
+ LOGGER.info("【{}互联互通平台推送】 :{},解密数据:{}", platformName, json, data);
|
|
|
var startChargeSeq = data.getString("StartChargeSeq");
|
|
|
var chargeOrder = chargeOrderService.getChargingOrderByStartChargeSeq(startChargeSeq);
|
|
|
// 更新订单信息
|
|
|
@@ -257,9 +257,9 @@ public class PlatformNotifyServiceImpl implements PlatformNotifyService {
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public String handleNotificationStopChargeResult(String platformName, JSONObject json) {
|
|
|
- var dataStr = enPlusService.signValidation(platformName, json);
|
|
|
+ var dataStr = platformApiService.signValidation(platformName, json);
|
|
|
var data = JSONObject.parseObject(dataStr);
|
|
|
- LOGGER.info("【EN+推送】收到停止充电结果推送:{},解密数据:{}", json, data);
|
|
|
+ LOGGER.info("【{}互联互通平台推送】收到停止充电结果推送:{},解密数据:{}", platformName, json, data);
|
|
|
var startChargeSeq = data.getString("StartChargeSeq");
|
|
|
var chargeOrder = chargeOrderService.getChargingOrderByStartChargeSeq(startChargeSeq);
|
|
|
if (data.containsKey("SuccStat") && data.getIntValue("SuccStat") == 0) {
|
|
|
@@ -286,9 +286,9 @@ public class PlatformNotifyServiceImpl implements PlatformNotifyService {
|
|
|
@Override
|
|
|
@DSTransactional(rollbackFor = Exception.class)
|
|
|
public String handleNotificationChargeOrderInfo(String platformName, JSONObject json) {
|
|
|
- var dataStr = enPlusService.signValidation(platformName, json);
|
|
|
+ var dataStr = platformApiService.signValidation(platformName, json);
|
|
|
var data = JSONObject.parseObject(dataStr);
|
|
|
- LOGGER.info("【EN+推送】收到充电订单信息推送:{},解密数据:{}", json, data);
|
|
|
+ LOGGER.info("【{}互联互通平台推送】收到充电订单信息推送:{},解密数据:{}", platformName, json, data);
|
|
|
var startChargeSeq = data.getString("StartChargeSeq");
|
|
|
var chargeOrder = chargeOrderService.getChargingOrderByStartChargeSeq(startChargeSeq);
|
|
|
|