update推送枪口状态的bug

This commit is contained in:
YAS\29473
2025-07-23 11:20:41 +08:00
parent a28d972b1c
commit 23c5044c8c
4 changed files with 25 additions and 3 deletions

View File

@@ -49,6 +49,7 @@ import com.jsowell.thirdparty.yongchengboche.service.YCBCService;
import com.jsowell.thirdparty.zhongdianlian.service.ZDLService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.logging.log4j.util.Strings;
import org.bouncycastle.crypto.CryptoException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@@ -418,6 +419,9 @@ public class CommonService {
String stationId = String.valueOf(pileBasicInfo.getStationId());
// 查询该站点是否推送第三方平台
List<ThirdPartySecretInfoVO> thirdPartySecretInfoVOS = thirdpartySecretInfoService.queryStationToPlatformList(stationId);
log.info("推送实时数据到第三方平台 stationId:{}, thirdPartySecretInfoVOS:{}", stationId, thirdPartySecretInfoVOS);
if (CollectionUtils.isEmpty(thirdPartySecretInfoVOS)) {
return;
}
@@ -432,10 +436,19 @@ public class CommonService {
notificationService.notificationStationStatus(dto);
log.info("交易流水号transactionCode:{}", transactionCode);
// 查询订单信息
OrderBasicInfo orderInfo = orderBasicInfoService.getOrderInfoByTransactionCode(transactionCode);
// 新运有三个平台,当这个transactionCode为null或orderInfo为null时,这里就不会继续推送其它两家平台,直接return了
// 也就是说,只要这台桩没有订单,为空闲状态,就只推送一家平台循环就终止了
//判断transactionCode和orderInfo是否为空,为空就不推送充电状态
if (Strings.isEmpty(transactionCode)){
// return;
continue;
}
if (Objects.isNull(orderInfo)) {
return;
continue;
}
dto.setOrderCode(orderInfo.getOrderCode());
notificationService.notificationConnectorChargeStatus(dto);

View File

@@ -917,8 +917,11 @@ public class HaiNanPlatformServiceImpl implements ThirdPartyPlatformService {
byte[] plainText = Cryptos.aesDecrypt(Encodes.decodeBase64(data),
thirdPartySecretInfoVO.getOurDataSecret().getBytes(), thirdPartySecretInfoVO.getOurDataSecretIv().getBytes());
String dataStr = new String(plainText, StandardCharsets.UTF_8);
logger.info("解密后的数据 dataStr:{}", dataStr);
JSONObject jsonObject = JSONObject.parseObject(dataStr);
// 转成对应的对象
QueryChargingStatusVO vo = JSONObject.parseObject(dataStr, QueryChargingStatusVO.class);
QueryChargingStatusVO vo = JSONObject.parseObject(jsonObject.toJSONString(), QueryChargingStatusVO.class);
String url = urlAddress + BusinessInformationExchangeEnum.NOTIFICATION_EQUIP_CHARGE_STATUS.getValue();
// 调用联联平台接口