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

@@ -37,7 +37,7 @@ public enum ThirdPlatformTypeEnum {
HU_ZHOU_PLATFORM("24", "湖州市监管平台", "MA27U00HZ"),
CHANG_ZHOU_PLATFORM("25", "新运常畅充", "0585PCW57"),
SI_CHUAN_PLATFORM("26", "四川省平台", "MA01H3BQ2"),
JI_LIN_PLATFORM("27", "吉林省平台", ""),
JI_LIN_PLATFORM("27", "吉林省平台", "723195753"),
;
private String typeCode;

View File

@@ -358,6 +358,12 @@ public class UploadRealTimeMonitorHandler extends AbstractYkcHandler {
// 异步推送第三方平台实时数据V2
CompletableFuture.runAsync(() -> {
try {
log.info("thirdpartyTaskExecutor状态活跃线程数={}, 队列大小={}, 任务总数={}, 拒绝任务数={}",
thirdpartyTaskExecutor.getActiveCount(),
thirdpartyTaskExecutor.getThreadPoolExecutor().getQueue().size(),
thirdpartyTaskExecutor.getThreadPoolExecutor().getTaskCount(),
thirdpartyTaskExecutor.getThreadPoolExecutor().getRejectedExecutionHandler().toString());
commonService.pushRealTimeInfoV2(pileSn, connectorCode, connectorStatus, realTimeMonitorData, transactionCode);
// log.info("统一推送第三方平台实时数据V2 success, pileSn:{}, connectorCode:{}, connectorStatus:{}, realTimeMonitorData:{}, transactionCode:{}", pileSn, connectorCode, connectorStatus, realTimeMonitorData, transactionCode);
} catch (Exception e) {

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();
// 调用联联平台接口