mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-20 02:55:04 +08:00
update 添加为空校验,修改联联设置equipmentOwnerId
This commit is contained in:
@@ -184,6 +184,12 @@ public class ThirdPartyStationRelationServiceImpl implements ThirdPartyStationRe
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void updateThirdPartyStationRelationV2(ThirdPartyStationRelationDTO dto) {
|
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()));
|
ThirdPartyStationRelation thirdPartyStationRelation = thirdPartyStationRelationMapper.selectThirdPartyStationRelationById(Long.parseLong(dto.getId()));
|
||||||
if (thirdPartyStationRelation == null) {
|
if (thirdPartyStationRelation == null) {
|
||||||
log.error("修改站点、第三方推送平台配置对应信息失败,站点、第三方推送平台配置对应不存在, id:{}", dto.getId());
|
log.error("修改站点、第三方推送平台配置对应信息失败,站点、第三方推送平台配置对应不存在, id:{}", dto.getId());
|
||||||
|
|||||||
@@ -301,7 +301,7 @@ public class LianLianPlatformServiceImpl implements ThirdPartyPlatformService {
|
|||||||
stationInfo.setStationID(stationId);
|
stationInfo.setStationID(stationId);
|
||||||
// MerchantInfoVO merchantInfo = pileMerchantInfoService.getMerchantInfo(String.valueOf(pileStationInfo.getMerchantId()));
|
// MerchantInfoVO merchantInfo = pileMerchantInfoService.getMerchantInfo(String.valueOf(pileStationInfo.getMerchantId()));
|
||||||
stationInfo.setOperatorID(Constants.OPERATORID_LIANLIAN); // 组织机构代码
|
stationInfo.setOperatorID(Constants.OPERATORID_LIANLIAN); // 组织机构代码
|
||||||
stationInfo.setEquipmentOwnerID(Constants.OPERATORID_LIANLIAN);
|
|
||||||
stationInfo.setStationName(pileStationInfo.getStationName());
|
stationInfo.setStationName(pileStationInfo.getStationName());
|
||||||
stationInfo.setIsAloneApply(Integer.valueOf(pileStationInfo.getAloneApply()));
|
stationInfo.setIsAloneApply(Integer.valueOf(pileStationInfo.getAloneApply()));
|
||||||
stationInfo.setIsPublicParkingLot(Integer.valueOf(pileStationInfo.getPublicParking()));
|
stationInfo.setIsPublicParkingLot(Integer.valueOf(pileStationInfo.getPublicParking()));
|
||||||
@@ -331,30 +331,8 @@ public class LianLianPlatformServiceImpl implements ThirdPartyPlatformService {
|
|||||||
stationInfo.setPrinterFlag(Integer.valueOf(pileStationInfo.getPrinterFlag()));
|
stationInfo.setPrinterFlag(Integer.valueOf(pileStationInfo.getPrinterFlag()));
|
||||||
stationInfo.setBarrierFlag(Integer.valueOf(pileStationInfo.getBarrierFlag()));
|
stationInfo.setBarrierFlag(Integer.valueOf(pileStationInfo.getBarrierFlag()));
|
||||||
stationInfo.setParkingLockFlag(Integer.valueOf(pileStationInfo.getParkingLockFlag()));
|
stationInfo.setParkingLockFlag(Integer.valueOf(pileStationInfo.getParkingLockFlag()));
|
||||||
// 截取运营商组织机构代码(去除最后一位后的最后九位)
|
|
||||||
MerchantInfoVO merchantInfo = pileMerchantInfoService.getMerchantInfoVO(String.valueOf(pileStationInfo.getMerchantId()));
|
stationInfo.setEquipmentOwnerID(pileStationInfo.getEquipmentOwnerId());
|
||||||
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);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
List<EquipmentInfo> pileList = pileBasicInfoService.getPileListForLianLian(stationId);
|
List<EquipmentInfo> pileList = pileBasicInfoService.getPileListForLianLian(stationId);
|
||||||
@@ -604,37 +582,17 @@ public class LianLianPlatformServiceImpl implements ThirdPartyPlatformService {
|
|||||||
// 只取最后一部分 330213
|
// 只取最后一部分 330213
|
||||||
String subAreaCode = split[split.length - 1];
|
String subAreaCode = split[split.length - 1];
|
||||||
info.setAreaCode(subAreaCode);
|
info.setAreaCode(subAreaCode);
|
||||||
// 截取运营商组织机构代码(去除最后一位后的最后九位)
|
|
||||||
String organizationCode = "";
|
|
||||||
if (StringUtils.equals(ThirdPlatformTypeEnum.LIAN_LIAN_PLATFORM.getTypeCode(), thirdPlatformType)) {
|
ThirdPartyStationRelation build = ThirdPartyStationRelation.builder()
|
||||||
// 联联平台先使用自己运营商的组织机构代码
|
.stationId(Long.valueOf(stationId))
|
||||||
organizationCode = Constants.OPERATORID_LIANLIAN;
|
.thirdPartyType(thirdPlatformType)
|
||||||
info.setEquipmentOwnerID(organizationCode);
|
.build();
|
||||||
} else {
|
|
||||||
MerchantInfoVO merchantInfo = pileMerchantInfoService.getMerchantInfoVO(String.valueOf(pileStationInfo.getMerchantId()));
|
List<ThirdPartyStationRelation> thirdPartyStationRelations = thirdPartyStationRelationMapper.selectThirdPartyStationRelationList(build);
|
||||||
organizationCode = merchantInfo.getOrganizationCode();
|
|
||||||
if (StringUtils.isNotBlank(organizationCode) && organizationCode.length() == 18) {
|
info.setEquipmentOwnerID(thirdPartyStationRelations.get(0).getEquipmentOwnerId());
|
||||||
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);
|
|
||||||
}
|
|
||||||
|
|
||||||
String payment = StationPaymentEnum.getPaymentByCode(pileStationInfo.getPayment());
|
String payment = StationPaymentEnum.getPaymentByCode(pileStationInfo.getPayment());
|
||||||
info.setPayment(payment);
|
info.setPayment(payment);
|
||||||
@@ -970,7 +928,7 @@ public class LianLianPlatformServiceImpl implements ThirdPartyPlatformService {
|
|||||||
// 拼装成联联平台所需格式对象
|
// 拼装成联联平台所需格式对象
|
||||||
OrderInfo orderInfo = OrderInfo.builder()
|
OrderInfo orderInfo = OrderInfo.builder()
|
||||||
.operatorID(operatorId)
|
.operatorID(operatorId)
|
||||||
.equipmentOwnerID(Constants.OPERATORID_LIANLIAN)
|
|
||||||
.stationID("LC" + orderBasicInfo.getStationId())
|
.stationID("LC" + orderBasicInfo.getStationId())
|
||||||
.equipmentID(orderBasicInfo.getPileSn())
|
.equipmentID(orderBasicInfo.getPileSn())
|
||||||
.connectorID(orderBasicInfo.getPileConnectorCode())
|
.connectorID(orderBasicInfo.getPileConnectorCode())
|
||||||
@@ -988,24 +946,17 @@ public class LianLianPlatformServiceImpl implements ThirdPartyPlatformService {
|
|||||||
.stopReason(0)
|
.stopReason(0)
|
||||||
// .chargeDetails()
|
// .chargeDetails()
|
||||||
.build();
|
.build();
|
||||||
if (MerchantUtils.isXiXiaoMerchant(orderBasicInfo.getMerchantId())) {
|
|
||||||
orderInfo.setEquipmentOwnerID(Constants.OPERATORID_XI_XIAO);
|
ThirdPartyStationRelation build = ThirdPartyStationRelation.builder()
|
||||||
}
|
.stationId(Long.valueOf(orderInfo.getStationID()))
|
||||||
if (MerchantUtils.isYuanDaMerchant(orderBasicInfo.getMerchantId())) {
|
.thirdPartyType(thirdPlatformType)
|
||||||
logger.info("订单号:{} 为远大运营商订单", orderBasicInfo.getOrderCode());
|
.build();
|
||||||
// 远大
|
|
||||||
orderInfo.setEquipmentOwnerID(Constants.OPERATORID_YUAN_DA);
|
List<ThirdPartyStationRelation> thirdPartyStationRelations = thirdPartyStationRelationMapper.selectThirdPartyStationRelationList(build);
|
||||||
}
|
|
||||||
if (MerchantUtils.isZhiHeMerchant(orderBasicInfo.getMerchantId())) {
|
orderInfo.setEquipmentOwnerID(thirdPartyStationRelations.get(0).getEquipmentOwnerId());
|
||||||
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);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 支付方式
|
// 支付方式
|
||||||
if (StringUtils.equals(orderBasicInfo.getPayMode(), OrderPayModeEnum.PAYMENT_OF_WECHATPAY.getValue())) {
|
if (StringUtils.equals(orderBasicInfo.getPayMode(), OrderPayModeEnum.PAYMENT_OF_WECHATPAY.getValue())) {
|
||||||
|
|||||||
Reference in New Issue
Block a user