update 华为Service

This commit is contained in:
Lemon
2024-04-01 16:17:00 +08:00
parent 7064f4e4b2
commit 60d54f8fea
12 changed files with 338 additions and 163 deletions

View File

@@ -132,6 +132,9 @@ public class OrderService {
@Autowired
private ThirdPartyStationRelationService thirdPartyStationRelationService;
@Autowired
private IThirdpartySnRelationService snRelationService;
@Autowired
private CommonService commonService;
@@ -1323,31 +1326,55 @@ public class OrderService {
}
/**
* 异步判断是否对接了类似华为平台的第三方平台,并启动充电
* 判断是否对接了类似华为平台的第三方平台,并启动充电
* @param orderCode
*/
private void checkThirdPartyQueryStartCharge(String orderCode) {
private boolean checkThirdPartyQueryStartCharge(String orderCode) {
// 根据订单号查询订单信息
OrderBasicInfo orderInfoByOrderCode = orderBasicInfoService.getOrderInfoByOrderCode(orderCode);
String stationId = orderInfoByOrderCode.getStationId();
// 判断是否对接了类似华为平台
List<ThirdPartyStationRelationVO> relationInfoList = thirdPartyStationRelationService.getRelationInfoList(stationId);
if (CollectionUtils.isEmpty(relationInfoList)) {
return;
}
for (ThirdPartyStationRelationVO vo : relationInfoList) {
String startMode = vo.getStartMode();
if (StringUtils.equals(Constants.TWO, startMode)) {
continue;
}
ThirdPartyCommonStartChargeDTO dto = new ThirdPartyCommonStartChargeDTO();
dto.setPayMode(orderInfoByOrderCode.getPayMode());
dto.setStationIds(Lists.newArrayList(stationId));
dto.setPileConnectorCode(orderInfoByOrderCode.getPileConnectorCode());
dto.setThirdPartyType(vo.getThirdPartyType());
OrderBasicInfo orderInfo = orderBasicInfoService.getOrderInfoByOrderCode(orderCode);
String stationId = orderInfo.getStationId();
String pileSn = orderInfo.getPileSn();
String result = commonService.commonQueryStartCharge(dto);
log.info("异步判断是否对接第三方平台 result:{}", result);
// 根据 stationId 查询 pile_sn_relation 表
List<ThirdPartySnRelationVO> snRelations = snRelationService.selectSnRelationListByParams(stationId, pileSn);
if (CollectionUtils.isEmpty(snRelations)) {
return false;
}
for (ThirdPartySnRelationVO snRelation : snRelations) {
String startMode = snRelation.getStartMode();
String thirdPartyType = snRelation.getThirdPartyType();
if (StringUtils.equals(Constants.ONE, startMode)) {
// 如果 startMode 为 1则调用第三方平台启动充电接口
ThirdPartyCommonStartChargeDTO dto = new ThirdPartyCommonStartChargeDTO();
dto.setPayMode(orderInfo.getPayMode());
dto.setStationIds(Lists.newArrayList(stationId));
dto.setPileConnectorCode(orderInfo.getPileConnectorCode());
dto.setThirdPartyType(thirdPartyType);
String result = commonService.commonQueryStartCharge(dto);
log.info("异步判断是否对接第三方平台 stationId:{}, thirdPartyType:{}, result:{}", stationId, thirdPartyType, result);
}
}
// 判断是否对接了类似华为平台
// List<ThirdPartyStationRelationVO> relationInfoList = thirdPartyStationRelationService.getRelationInfoList(stationId);
// if (CollectionUtils.isEmpty(relationInfoList)) {
// return false;
// }
// for (ThirdPartyStationRelationVO vo : relationInfoList) {
// String startMode = vo.getStartMode();
// if (StringUtils.equals(Constants.TWO, startMode)) {
// continue;
// }
// ThirdPartyCommonStartChargeDTO dto = new ThirdPartyCommonStartChargeDTO();
// dto.setPayMode(orderInfo.getPayMode());
// dto.setStationIds(Lists.newArrayList(stationId));
// dto.setPileConnectorCode(orderInfo.getPileConnectorCode());
// dto.setThirdPartyType(vo.getThirdPartyType());
//
// String result = commonService.commonQueryStartCharge(dto);
// log.info("异步判断是否对接第三方平台 result:{}", result);
// }
return true;
}
}