update 对接第三方平台

This commit is contained in:
2024-03-27 11:46:11 +08:00
parent 5b9425fdc7
commit 12e7c34509
35 changed files with 353 additions and 197 deletions

View File

@@ -33,7 +33,7 @@ import com.jsowell.pile.vo.huawei.QueryEquipAuthVO;
import com.jsowell.pile.vo.huawei.QueryStartChargeVO;
import com.jsowell.pile.vo.web.PileStationVO;
import com.jsowell.thirdparty.huawei.HuaweiServiceV2;
import com.jsowell.thirdparty.platform.hainan.service.HaiNanPlatformLogic;
import com.jsowell.thirdparty.platform.hainan.service.HaiNanPlatformServiceImpl;
import com.jsowell.thirdparty.huawei.HuaWeiService;
import com.jsowell.thirdparty.lianlian.service.LianLianService;
import com.jsowell.thirdparty.lianlian.util.HttpRequestUtil;
@@ -109,7 +109,7 @@ public class CommonService {
private HuaweiServiceV2 huaweiServiceV2;
@Autowired
private HaiNanPlatformLogic haiNanChargeService;
private HaiNanPlatformServiceImpl haiNanChargeService;
@Autowired
private RedisCache redisCache;
@@ -123,7 +123,7 @@ public class CommonService {
ThirdPartyStationRelation relation = new ThirdPartyStationRelation();
relation.setStationId(dto.getStationId());
relation.setThirdPartyType(thirdPartyType);
if (StringUtils.equals(thirdPartyType, ThirdPlatformTypeEnum.HUA_WEI.getCode())) {
if (StringUtils.equals(thirdPartyType, ThirdPlatformTypeEnum.HUA_WEI.getTypeCode())) {
relation.setStartMode(Constants.ONE);
}
ThirdPartyStationRelationVO vo = thirdPartyStationRelationService.selectRelationInfo(relation);
@@ -148,27 +148,27 @@ public class CommonService {
StringBuilder finalResult = new StringBuilder();
for (String type : types) {
dto.setThirdPartyType(type);
if (StringUtils.equals(ThirdPlatformTypeEnum.LIAN_LIAN_PLATFORM.getCode(), dto.getThirdPartyType())) {
if (StringUtils.equals(ThirdPlatformTypeEnum.LIAN_LIAN_PLATFORM.getTypeCode(), dto.getThirdPartyType())) {
// 推送联联
// result = lianLianService.pushStationInfo(dto);
result = lianLianService.pushStationInfoV2(dto);
}
if (StringUtils.equals(ThirdPlatformTypeEnum.ZHONG_DIAN_LIAN_PLATFORM.getCode(), dto.getThirdPartyType())) {
if (StringUtils.equals(ThirdPlatformTypeEnum.ZHONG_DIAN_LIAN_PLATFORM.getTypeCode(), dto.getThirdPartyType())) {
// 中电联
// result = zdlService.pushStationInfo(dto);
result = zdlService.pushStationInfoV2(dto);
}
if (StringUtils.equals(ThirdPlatformTypeEnum.JIANG_SU_PLATFORM.getCode(), dto.getThirdPartyType())) {
if (StringUtils.equals(ThirdPlatformTypeEnum.JIANG_SU_PLATFORM.getTypeCode(), dto.getThirdPartyType())) {
// 江苏省平台
// result = nrService.pushStationInfo(dto);
result = nrService.pushStationInfoV2(dto);
}
if (StringUtils.equals(ThirdPlatformTypeEnum.YONG_CHENG_BO_CHE.getCode(), dto.getThirdPartyType())) {
if (StringUtils.equals(ThirdPlatformTypeEnum.YONG_CHENG_BO_CHE.getTypeCode(), dto.getThirdPartyType())) {
// 甬城泊车平台
// result = ycbcService.pushStationInfo(dto);
result = ycbcService.pushStationInfoV2(dto);
}
if (StringUtils.equals(ThirdPlatformTypeEnum.XIN_DIAN_TU.getCode(), dto.getThirdPartyType())) {
if (StringUtils.equals(ThirdPlatformTypeEnum.XIN_DIAN_TU.getTypeCode(), dto.getThirdPartyType())) {
// 新电途平台
result = xdtService.pushStationInfoV2(dto);
}
@@ -176,7 +176,7 @@ public class CommonService {
// // 华为
// result = huaWeiService.notificationOperationSystemInfo(dto);
// }
if(StringUtils.equals(ThirdPlatformTypeEnum.HAI_NAN_1.getCode(), dto.getThirdPartyType())) {
if(StringUtils.equals(ThirdPlatformTypeEnum.HAI_NAN_1.getTypeCode(), dto.getThirdPartyType())) {
// 海南
result = haiNanChargeService.pushStationInfoV2(dto);
}
@@ -225,7 +225,7 @@ public class CommonService {
// 如果是类似华为格式,不需要传
continue;
}
if (StringUtils.equals(ThirdPlatformTypeEnum.LIAN_LIAN_PLATFORM.getCode(), thirdPartyType)) {
if (StringUtils.equals(ThirdPlatformTypeEnum.LIAN_LIAN_PLATFORM.getTypeCode(), thirdPartyType)) {
// 联联
OrderBasicInfo orderInfo = orderBasicInfoService.getOrderInfoByTransactionCode(transactionCode);
if (orderInfo == null) {
@@ -241,12 +241,12 @@ public class CommonService {
// 推送充电状态
lianLianService.pushChargeStatus(orderInfo.getOrderCode());
}
if (StringUtils.equals(ThirdPlatformTypeEnum.ZHONG_DIAN_LIAN_PLATFORM.getCode(), thirdPartyType)) {
if (StringUtils.equals(ThirdPlatformTypeEnum.ZHONG_DIAN_LIAN_PLATFORM.getTypeCode(), thirdPartyType)) {
// 中电联
// log.info("推送中电联平台实时数据 pileConnectorCode:{}, connectorStatus:{}", pileConnectorCode, connectorStatus);
zdlService.notificationStationStatus(pileConnectorCode, changedStatus);
}
if (StringUtils.equals(ThirdPlatformTypeEnum.JIANG_SU_PLATFORM.getCode(), thirdPartyType)) {
if (StringUtils.equals(ThirdPlatformTypeEnum.JIANG_SU_PLATFORM.getTypeCode(), thirdPartyType)) {
// 先判断缓存中是否有数据
String redisKey = CacheConstants.JIANGSU_PUSH_PILE_STATUS + pileConnectorCode;
Object cacheObject = redisCache.getCacheObject(redisKey);
@@ -270,7 +270,7 @@ public class CommonService {
// log.info("推送江苏省平台实时数据 result:{}", result);
}
if (StringUtils.equals(ThirdPlatformTypeEnum.XIN_DIAN_TU.getCode(), thirdPartyType)) {
if (StringUtils.equals(ThirdPlatformTypeEnum.XIN_DIAN_TU.getTypeCode(), thirdPartyType)) {
// 新电途平台
log.info("新电途平台设备状态变化推送 pileConnectorCode:{}, changedStatus:{}", pileConnectorCode, changedStatus);
String result1 = xdtService.notificationStationStatus(pileConnectorCode, changedStatus);
@@ -292,11 +292,11 @@ public class CommonService {
// }
// huaWeiService.notificationEquipChargeStatus(orderInfo.getOrderCode());
// }
if (StringUtils.equals(ThirdPlatformTypeEnum.HAI_NAN_1.getCode(), thirdPartyType)) {
if (StringUtils.equals(ThirdPlatformTypeEnum.HAI_NAN_1.getTypeCode(), thirdPartyType)) {
// 海南平台
haiNanChargeService.notificationStationStatus(pileConnectorCode, changedStatus);
}
if (StringUtils.equals(ThirdPlatformTypeEnum.YONG_CHENG_BO_CHE.getCode(), thirdPartyType)) {
if (StringUtils.equals(ThirdPlatformTypeEnum.YONG_CHENG_BO_CHE.getTypeCode(), thirdPartyType)) {
// 甬城泊车
// log.info("推送甬城泊车平台设备状态变化推送 pileConnectorCode:{}, changedStatus:{}", pileConnectorCode, changedStatus);
// 设备状态变化推送 notification_stationStatus
@@ -336,7 +336,7 @@ public class CommonService {
// 如果是类似华为格式,不需要传
continue;
}
if (StringUtils.equals(ThirdPlatformTypeEnum.LIAN_LIAN_PLATFORM.getCode(), thirdPartyType)) {
if (StringUtils.equals(ThirdPlatformTypeEnum.LIAN_LIAN_PLATFORM.getTypeCode(), thirdPartyType)) {
// 联联平台
// 推送停止充电结果
lianLianService.pushStopChargeResult(orderBasicInfo.getOrderCode());
@@ -345,16 +345,16 @@ public class CommonService {
// 推送充电订单信息
lianLianService.pushChargeOrderInfo(orderBasicInfo.getOrderCode());
}
if (StringUtils.equals(ThirdPlatformTypeEnum.ZHONG_DIAN_LIAN_PLATFORM.getCode(), thirdPartyType)) {
if (StringUtils.equals(ThirdPlatformTypeEnum.ZHONG_DIAN_LIAN_PLATFORM.getTypeCode(), thirdPartyType)) {
// 中电联
zdlService.pushChargeOrderInfo(orderBasicInfo.getOrderCode());
}
if (StringUtils.equals(ThirdPlatformTypeEnum.JIANG_SU_PLATFORM.getCode(), thirdPartyType)) {
if (StringUtils.equals(ThirdPlatformTypeEnum.JIANG_SU_PLATFORM.getTypeCode(), thirdPartyType)) {
// 江苏平台
// 推送订单信息
nrService.pushOrderInfo(orderBasicInfo.getOrderCode());
}
if (StringUtils.equals(ThirdPlatformTypeEnum.XIN_DIAN_TU.getCode(), thirdPartyType)) {
if (StringUtils.equals(ThirdPlatformTypeEnum.XIN_DIAN_TU.getTypeCode(), thirdPartyType)) {
// 新电途平台
// 推送停止充电结果
xdtService.notificationStopChargeResult(orderBasicInfo.getOrderCode());
@@ -368,12 +368,12 @@ public class CommonService {
// // 推送订单信息
// result = huaWeiService.pushChargeOrderInfo(orderBasicInfo.getOrderCode());
// }
if (StringUtils.equals(ThirdPlatformTypeEnum.HAI_NAN_1.getCode(), thirdPartyType)) {
if (StringUtils.equals(ThirdPlatformTypeEnum.HAI_NAN_1.getTypeCode(), thirdPartyType)) {
// 海南平台
haiNanChargeService.notificationChargeOrderInfo(orderBasicInfo.getOrderCode());
}
if (StringUtils.equals(ThirdPlatformTypeEnum.YONG_CHENG_BO_CHE.getCode(), thirdPartyType)) {
if (StringUtils.equals(ThirdPlatformTypeEnum.YONG_CHENG_BO_CHE.getTypeCode(), thirdPartyType)) {
if (StringUtils.equals(orderBasicInfo.getStartMode(), StartModeEnum.THIRD_PARTY_PLATFORM.getValue())) {
// 甬城泊车
// 推送停止充电结果
@@ -436,7 +436,7 @@ public class CommonService {
String token = "";
String result = "";
if (StringUtils.equals(ThirdPlatformTypeEnum.YONG_CHENG_BO_CHE.getCode(), thirdPartyType)) {
if (StringUtils.equals(ThirdPlatformTypeEnum.YONG_CHENG_BO_CHE.getTypeCode(), thirdPartyType)) {
YCBCGetTokenDTO dto = new YCBCGetTokenDTO();
dto.setOperatorId(operatorId);
dto.setDataSecret(dataSecret);
@@ -514,9 +514,9 @@ public class CommonService {
String payMode = dto.getPayMode();
// 判断平台类型
if (StringUtils.equals(ThirdPlatformTypeEnum.HUA_WEI.getCode(), thirdPartyType)) {
if (StringUtils.equals(ThirdPlatformTypeEnum.HUA_WEI.getTypeCode(), thirdPartyType)) {
// 华为平台
String label = ThirdPlatformTypeEnum.getLabelByCode(thirdPartyType);
String label = ThirdPlatformTypeEnum.getTypeLabelByTypeCode(thirdPartyType);
// query_station_status 查询站点枪口详情
Map<String, String> map = huaweiServiceV2.queryStationStatus(stationIds);
String status = map.get(pileConnectorCode);
@@ -565,7 +565,7 @@ public class CommonService {
String thirdPartyType = dto.getThirdPartyType();
// 判断平台类型
if (StringUtils.equals(ThirdPlatformTypeEnum.HUA_WEI.getCode(), thirdPartyType)) {
if (StringUtils.equals(ThirdPlatformTypeEnum.HUA_WEI.getTypeCode(), thirdPartyType)) {
QueryStartChargeVO vo = huaweiServiceV2.queryStopCharge(orderBasicInfo.getOrderCode());
return String.valueOf(vo.getSuccStat());
}