update 添加为空校验,修改联联设置equipmentOwnerId

This commit is contained in:
YAS\29473
2025-12-09 10:54:48 +08:00
parent 90803807ab
commit fa33b6028e
2 changed files with 32 additions and 75 deletions

View File

@@ -184,6 +184,12 @@ public class ThirdPartyStationRelationServiceImpl implements ThirdPartyStationRe
*/
@Override
public void updateThirdPartyStationRelationV2(ThirdPartyStationRelationDTO dto) {
if (dto == null) {
return;
}
if (dto.getEquipmentOwnerId().isEmpty()||dto.getThirdPartyType().isEmpty()){
throw new RuntimeException("未设置设备所属Id");
}
ThirdPartyStationRelation thirdPartyStationRelation = thirdPartyStationRelationMapper.selectThirdPartyStationRelationById(Long.parseLong(dto.getId()));
if (thirdPartyStationRelation == null) {
log.error("修改站点、第三方推送平台配置对应信息失败,站点、第三方推送平台配置对应不存在, id:{}", dto.getId());

View File

@@ -301,7 +301,7 @@ public class LianLianPlatformServiceImpl implements ThirdPartyPlatformService {
stationInfo.setStationID(stationId);
// MerchantInfoVO merchantInfo = pileMerchantInfoService.getMerchantInfo(String.valueOf(pileStationInfo.getMerchantId()));
stationInfo.setOperatorID(Constants.OPERATORID_LIANLIAN); // 组织机构代码
stationInfo.setEquipmentOwnerID(Constants.OPERATORID_LIANLIAN);
stationInfo.setStationName(pileStationInfo.getStationName());
stationInfo.setIsAloneApply(Integer.valueOf(pileStationInfo.getAloneApply()));
stationInfo.setIsPublicParkingLot(Integer.valueOf(pileStationInfo.getPublicParking()));
@@ -331,30 +331,8 @@ public class LianLianPlatformServiceImpl implements ThirdPartyPlatformService {
stationInfo.setPrinterFlag(Integer.valueOf(pileStationInfo.getPrinterFlag()));
stationInfo.setBarrierFlag(Integer.valueOf(pileStationInfo.getBarrierFlag()));
stationInfo.setParkingLockFlag(Integer.valueOf(pileStationInfo.getParkingLockFlag()));
// 截取运营商组织机构代码(去除最后一位后的最后九位)
MerchantInfoVO merchantInfo = pileMerchantInfoService.getMerchantInfoVO(String.valueOf(pileStationInfo.getMerchantId()));
String organizationCode = merchantInfo.getOrganizationCode();
if (StringUtils.isNotBlank(organizationCode) && organizationCode.length() == 18) {
String equipmentOwnerId = StringUtils.substring(organizationCode, organizationCode.length() - 10, organizationCode.length() - 1);
stationInfo.setEquipmentOwnerID(equipmentOwnerId);
}
if (StringUtils.equals("36", String.valueOf(pileStationInfo.getMerchantId()))) {
// 远大
stationInfo.setEquipmentOwnerID(Constants.OPERATORID_YUAN_DA);
}
if (MerchantUtils.isXiXiaoMerchant(String.valueOf(pileStationInfo.getMerchantId()))) {
// 如果是希晓运营商则把equipmentOwnerID换成希晓
stationInfo.setEquipmentOwnerID(Constants.OPERATORID_XI_XIAO);
}
if (MerchantUtils.isZhiHeMerchant(String.valueOf(pileStationInfo.getMerchantId()))) {
stationInfo.setEquipmentOwnerID(Constants.OPERATORID_ZHI_HE);
}
if( MerchantUtils.isPaiHeMerchant(String.valueOf(pileStationInfo.getMerchantId()))){
stationInfo.setEquipmentOwnerID(Constants.OPERATORID_PAI_HE);
}
if (MerchantUtils.isHongPeng(String.valueOf(pileStationInfo.getMerchantId()))) {
stationInfo.setEquipmentOwnerID(Constants.OPERATORID_HONG_PENG);
}
stationInfo.setEquipmentOwnerID(pileStationInfo.getEquipmentOwnerId());
List<EquipmentInfo> pileList = pileBasicInfoService.getPileListForLianLian(stationId);
@@ -604,37 +582,17 @@ public class LianLianPlatformServiceImpl implements ThirdPartyPlatformService {
// 只取最后一部分 330213
String subAreaCode = split[split.length - 1];
info.setAreaCode(subAreaCode);
// 截取运营商组织机构代码(去除最后一位后的最后九位)
String organizationCode = "";
if (StringUtils.equals(ThirdPlatformTypeEnum.LIAN_LIAN_PLATFORM.getTypeCode(), thirdPlatformType)) {
// 联联平台先使用自己运营商的组织机构代码
organizationCode = Constants.OPERATORID_LIANLIAN;
info.setEquipmentOwnerID(organizationCode);
} else {
MerchantInfoVO merchantInfo = pileMerchantInfoService.getMerchantInfoVO(String.valueOf(pileStationInfo.getMerchantId()));
organizationCode = merchantInfo.getOrganizationCode();
if (StringUtils.isNotBlank(organizationCode) && organizationCode.length() == 18) {
String equipmentOwnerId = StringUtils.substring(organizationCode, organizationCode.length() - 10, organizationCode.length() - 1);
info.setEquipmentOwnerID(equipmentOwnerId);
}
}
if (StringUtils.equals("36", String.valueOf(pileStationInfo.getMerchantId()))) {
// 远大
info.setEquipmentOwnerID(Constants.OPERATORID_YUAN_DA);
}
if (MerchantUtils.isXiXiaoMerchant(String.valueOf(pileStationInfo.getMerchantId()))) {
// 如果是希晓运营商则把equipmentOwnerID换成希晓
info.setEquipmentOwnerID(Constants.OPERATORID_XI_XIAO);
}
if (MerchantUtils.isZhiHeMerchant(String.valueOf(pileStationInfo.getMerchantId()))) {
info.setEquipmentOwnerID(Constants.OPERATORID_ZHI_HE);
}
if( MerchantUtils.isPaiHeMerchant(String.valueOf(pileStationInfo.getMerchantId()))){
info.setEquipmentOwnerID(Constants.OPERATORID_PAI_HE);
}
if (MerchantUtils.isHongPeng(String.valueOf(pileStationInfo.getMerchantId()))) {
info.setEquipmentOwnerID(Constants.OPERATORID_HONG_PENG);
}
ThirdPartyStationRelation build = ThirdPartyStationRelation.builder()
.stationId(Long.valueOf(stationId))
.thirdPartyType(thirdPlatformType)
.build();
List<ThirdPartyStationRelation> thirdPartyStationRelations = thirdPartyStationRelationMapper.selectThirdPartyStationRelationList(build);
info.setEquipmentOwnerID(thirdPartyStationRelations.get(0).getEquipmentOwnerId());
String payment = StationPaymentEnum.getPaymentByCode(pileStationInfo.getPayment());
info.setPayment(payment);
@@ -970,7 +928,7 @@ public class LianLianPlatformServiceImpl implements ThirdPartyPlatformService {
// 拼装成联联平台所需格式对象
OrderInfo orderInfo = OrderInfo.builder()
.operatorID(operatorId)
.equipmentOwnerID(Constants.OPERATORID_LIANLIAN)
.stationID("LC" + orderBasicInfo.getStationId())
.equipmentID(orderBasicInfo.getPileSn())
.connectorID(orderBasicInfo.getPileConnectorCode())
@@ -988,24 +946,17 @@ public class LianLianPlatformServiceImpl implements ThirdPartyPlatformService {
.stopReason(0)
// .chargeDetails()
.build();
if (MerchantUtils.isXiXiaoMerchant(orderBasicInfo.getMerchantId())) {
orderInfo.setEquipmentOwnerID(Constants.OPERATORID_XI_XIAO);
}
if (MerchantUtils.isYuanDaMerchant(orderBasicInfo.getMerchantId())) {
logger.info("订单号:{} 为远大运营商订单", orderBasicInfo.getOrderCode());
// 远大
orderInfo.setEquipmentOwnerID(Constants.OPERATORID_YUAN_DA);
}
if (MerchantUtils.isZhiHeMerchant(orderBasicInfo.getMerchantId())) {
logger.info("订单号:{} 为之禾运营商订单", orderBasicInfo.getOrderCode());
orderInfo.setEquipmentOwnerID(Constants.OPERATORID_ZHI_HE);
}
if( MerchantUtils.isPaiHeMerchant(String.valueOf(orderBasicInfo.getMerchantId()))){
orderInfo.setEquipmentOwnerID(Constants.OPERATORID_PAI_HE);
}
if (MerchantUtils.isHongPeng(String.valueOf(orderBasicInfo.getMerchantId()))) {
orderInfo.setEquipmentOwnerID(Constants.OPERATORID_HONG_PENG);
}
ThirdPartyStationRelation build = ThirdPartyStationRelation.builder()
.stationId(Long.valueOf(orderInfo.getStationID()))
.thirdPartyType(thirdPlatformType)
.build();
List<ThirdPartyStationRelation> thirdPartyStationRelations = thirdPartyStationRelationMapper.selectThirdPartyStationRelationList(build);
orderInfo.setEquipmentOwnerID(thirdPartyStationRelations.get(0).getEquipmentOwnerId());
// 支付方式
if (StringUtils.equals(orderBasicInfo.getPayMode(), OrderPayModeEnum.PAYMENT_OF_WECHATPAY.getValue())) {