update 宁波市平台

This commit is contained in:
Lemon
2024-10-31 14:21:08 +08:00
parent f5a2b78fd0
commit 43fcb320f9
2 changed files with 31 additions and 42 deletions

View File

@@ -173,11 +173,11 @@ public class CommonService {
// result = lianLianService.pushStationInfo(dto);
result = lianLianService.pushStationInfoV2(dto);
}
if (StringUtils.equals(ThirdPlatformTypeEnum.NING_BO_PLATFORM.getTypeCode(), dto.getThirdPartyType())) {
// 中电联
// result = zdlService.pushStationInfo(dto);
result = zdlService.pushStationInfoV2(dto);
}
// if (StringUtils.equals(ThirdPlatformTypeEnum.NING_BO_PLATFORM.getTypeCode(), dto.getThirdPartyType())) {
// // 中电联
// // result = zdlService.pushStationInfo(dto);
// result = zdlService.pushStationInfoV2(dto);
// }
if (StringUtils.equals(ThirdPlatformTypeEnum.JIANG_SU_PLATFORM.getTypeCode(), dto.getThirdPartyType())) {
// 江苏省平台
// result = nrService.pushStationInfo(dto);
@@ -259,12 +259,12 @@ public class CommonService {
lianLianService.pushChargeStatus(orderInfo.getOrderCode());
}
}
if (StringUtils.equals(ThirdPlatformTypeEnum.NING_BO_PLATFORM.getTypeCode(), thirdPartyType)) {
// 中电联
dto.setThirdPartyType(ThirdPlatformTypeEnum.NING_BO_PLATFORM.getTypeCode());
// log.info("推送中电联平台实时数据 pileConnectorCode:{}, connectorStatus:{}", pileConnectorCode, connectorStatus);
zdlService.notificationStationStatus(dto);
}
// if (StringUtils.equals(ThirdPlatformTypeEnum.NING_BO_PLATFORM.getTypeCode(), thirdPartyType)) {
// // 中电联
// dto.setThirdPartyType(ThirdPlatformTypeEnum.NING_BO_PLATFORM.getTypeCode());
// // log.info("推送中电联平台实时数据 pileConnectorCode:{}, connectorStatus:{}", pileConnectorCode, connectorStatus);
// zdlService.notificationStationStatus(dto);
// }
if (StringUtils.equals(ThirdPlatformTypeEnum.JIANG_SU_PLATFORM.getTypeCode(), thirdPartyType)) {
// 先判断缓存中是否有数据
String redisKey = CacheConstants.JIANGSU_PUSH_PILE_STATUS + pileConnectorCode;
@@ -455,10 +455,10 @@ public class CommonService {
// 推送充电订单信息
lianLianService.pushChargeOrderInfo(orderBasicInfo.getOrderCode());
}
if (StringUtils.equals(ThirdPlatformTypeEnum.NING_BO_PLATFORM.getTypeCode(), thirdPartyType)) {
// 中电联
zdlService.pushChargeOrderInfo(orderBasicInfo.getOrderCode());
}
// if (StringUtils.equals(ThirdPlatformTypeEnum.NING_BO_PLATFORM.getTypeCode(), thirdPartyType)) {
// // 中电联
// zdlService.pushChargeOrderInfo(orderBasicInfo.getOrderCode());
// }
if (StringUtils.equals(ThirdPlatformTypeEnum.JIANG_SU_PLATFORM.getTypeCode(), thirdPartyType)) {
// 江苏平台
// 推送订单信息

View File

@@ -163,12 +163,13 @@ public class ZhongDianLianPlatformServiceImpl implements ThirdPartyPlatformServi
*/
@Override
public String notificationStationInfo(String stationId) {
List<SupStationInfo> stationInfos = new ArrayList<>();
// 通过id查询站点相关信息
PileStationInfo pileStationInfo = pileStationInfoService.selectPileStationInfoById(Long.parseLong(stationId));
// 查询相关配置信息
ThirdPartySecretInfoVO ningBoSecretInfoVO = getNingBoSecretInfoVO();
String operatorId = ningBoSecretInfoVO.getTheirOperatorId();
String operatorId = ningBoSecretInfoVO.getOurOperatorId();
String operatorSecret = ningBoSecretInfoVO.getTheirOperatorSecret();
String signSecret = ningBoSecretInfoVO.getTheirSigSecret();
String dataSecret = ningBoSecretInfoVO.getTheirDataSecret();
@@ -214,25 +215,18 @@ public class ZhongDianLianPlatformServiceImpl implements ThirdPartyPlatformServi
if (CollectionUtils.isNotEmpty(pileList)) {
info.setEquipmentInfos(pileList); // 充电设备信息列表
}
stationInfos.add(info);
// 调用中电联平台接口
String url = urlAddress + "notification_stationInfo";
JSONObject data = new JSONObject();
data.put("StationInfo", info);
data.put("StationInfos", stationInfos);
String jsonString = JSON.toJSONString(data);
System.out.println("jsonString : " + jsonString);
// 获取令牌
ZDLGetTokenDTO tokenDTO = ZDLGetTokenDTO.builder()
.urlAddress(urlAddress)
.operatorId(operatorId)
.operatorSecret(operatorSecret)
.dataSecret(dataSecret)
.dataSecretIv(dataSecretIv)
.signSecret(signSecret)
.build();
String token = getToken(urlAddress, operatorId, operatorSecret, dataSecretIv, signSecret, dataSecret);
String result = HttpRequestUtil.sendPost(token, jsonString, url, dataSecret, dataSecretIv, operatorId, signSecret);
@@ -261,7 +255,6 @@ public class ZhongDianLianPlatformServiceImpl implements ThirdPartyPlatformServi
List<SupStationInfo> resultList = new ArrayList<>();
for (ThirdPartyStationInfoVO pileStationInfo : pageInfo.getList()) {
SupStationInfo stationInfo = new SupStationInfo();
String stationId = String.valueOf(pileStationInfo.getId());
stationInfo.setStationID(String.valueOf(pileStationInfo.getId()));
stationInfo.setOperatorID(Constants.OPERATORID_JIANG_SU); // 组织机构代码
String organizationCode = pileStationInfo.getOrganizationCode();
@@ -475,16 +468,13 @@ public class ZhongDianLianPlatformServiceImpl implements ThirdPartyPlatformServi
/**
* 枪口状态变化 notification_station_status
* @param dto
* @return
*/
@Override
public String notificationStationStatus(PushRealTimeInfoDTO dto) {
String pileConnectorCode = dto.getPileConnectorCode();
String status = dto.getStatus();
public String notificationStationStatus(String stationId, String pileConnectorCode, String status, ThirdPartySecretInfoVO secretInfoVO) {
ThirdPartySecretInfoVO ningBoSecretInfoVO = getNingBoSecretInfoVO();
String operatorId = ningBoSecretInfoVO.getTheirOperatorId();
String operatorId = ningBoSecretInfoVO.getOurOperatorId();
String operatorSecret = ningBoSecretInfoVO.getTheirOperatorSecret();
String signSecret = ningBoSecretInfoVO.getTheirSigSecret();
String dataSecret = ningBoSecretInfoVO.getTheirDataSecret();
@@ -516,17 +506,16 @@ public class ZhongDianLianPlatformServiceImpl implements ThirdPartyPlatformServi
* @throws CryptoException
*/
@Override
public String notificationChargeOrderInfo(String orderCode) throws NoSuchAlgorithmException, InvalidKeySpecException, NoSuchProviderException, CryptoException {
public String notificationChargeOrderInfo(String orderCode, ThirdPartySecretInfoVO thirdPartySecretInfoVO) {
OrderBasicInfo orderBasicInfo = orderBasicInfoService.getOrderInfoByOrderCode(orderCode);
OrderDetail orderDetail = orderBasicInfoService.getOrderDetailByOrderCode(orderCode);
ThirdPartySecretInfoVO ningBoSecretInfoVO = getNingBoSecretInfoVO();
String operatorId = ningBoSecretInfoVO.getTheirOperatorId();
String operatorSecret = ningBoSecretInfoVO.getTheirOperatorSecret();
String signSecret = ningBoSecretInfoVO.getTheirSigSecret();
String dataSecret = ningBoSecretInfoVO.getTheirDataSecret();
String dataSecretIv = ningBoSecretInfoVO.getTheirDataSecretIv();
String urlAddress = ningBoSecretInfoVO.getTheirUrlPrefix();
String operatorId = thirdPartySecretInfoVO.getOurOperatorId();
String operatorSecret = thirdPartySecretInfoVO.getTheirOperatorSecret();
String signSecret = thirdPartySecretInfoVO.getTheirSigSecret();
String dataSecret = thirdPartySecretInfoVO.getTheirDataSecret();
String dataSecretIv = thirdPartySecretInfoVO.getTheirDataSecretIv();
String urlAddress = thirdPartySecretInfoVO.getTheirUrlPrefix();
String url = urlAddress + BusinessInformationExchangeEnum.NOTIFICATION_CHARGE_ORDER_INFO.getValue();
Date chargeStartTime = orderBasicInfo.getChargeStartTime();
@@ -799,7 +788,7 @@ public class ZhongDianLianPlatformServiceImpl implements ThirdPartyPlatformServi
return null;
}
ThirdPartySecretInfoVO ningBoSecretInfoVO = getNingBoSecretInfoVO();
String operatorId = ningBoSecretInfoVO.getTheirOperatorId();
String operatorId = ningBoSecretInfoVO.getOurOperatorId();
String operatorSecret = ningBoSecretInfoVO.getTheirOperatorSecret();
String signSecret = ningBoSecretInfoVO.getTheirSigSecret();
String dataSecret = ningBoSecretInfoVO.getTheirDataSecret();
@@ -836,7 +825,7 @@ public class ZhongDianLianPlatformServiceImpl implements ThirdPartyPlatformServi
return null;
}
ThirdPartySecretInfoVO ningBoSecretInfoVO = getNingBoSecretInfoVO();
String operatorId = ningBoSecretInfoVO.getTheirOperatorId();
String operatorId = ningBoSecretInfoVO.getOurOperatorId();
String operatorSecret = ningBoSecretInfoVO.getTheirOperatorSecret();
String signSecret = ningBoSecretInfoVO.getTheirSigSecret();
String dataSecret = ningBoSecretInfoVO.getTheirDataSecret();
@@ -874,7 +863,7 @@ public class ZhongDianLianPlatformServiceImpl implements ThirdPartyPlatformServi
// 查询相关配置信息
ThirdPartySecretInfoVO ningBoSecretInfoVO = getNingBoSecretInfoVO();
String operatorId = ningBoSecretInfoVO.getTheirOperatorId();
String operatorId = ningBoSecretInfoVO.getOurOperatorId();
String operatorSecret = ningBoSecretInfoVO.getTheirOperatorSecret();
String signSecret = ningBoSecretInfoVO.getTheirSigSecret();
String dataSecret = ningBoSecretInfoVO.getTheirDataSecret();