mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-21 03:25:12 +08:00
update 华为Service
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user