diff --git a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/service/impl/LianLianPlatformServiceImpl.java b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/service/impl/LianLianPlatformServiceImpl.java index 58227478f..dd41bb664 100644 --- a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/service/impl/LianLianPlatformServiceImpl.java +++ b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/service/impl/LianLianPlatformServiceImpl.java @@ -206,7 +206,7 @@ public class LianLianPlatformServiceImpl implements ThirdPartyPlatformService { stationInfo.setStationID(stationId); // MerchantInfoVO merchantInfo = pileMerchantInfoService.getMerchantInfo(String.valueOf(pileStationInfo.getMerchantId())); stationInfo.setOperatorID(Constants.OPERATORID_LIANLIAN); // 组织机构代码 - stationInfo.setEquipmentOwnerID(String.valueOf(pileStationInfo.getMerchantId())); + stationInfo.setEquipmentOwnerID(Constants.OPERATORID_LIANLIAN); stationInfo.setStationName(pileStationInfo.getStationName()); stationInfo.setIsAloneApply(Integer.valueOf(pileStationInfo.getAloneApply())); stationInfo.setIsPublicParkingLot(Integer.valueOf(pileStationInfo.getPublicParking())); @@ -235,6 +235,21 @@ 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); + } List pileList = pileBasicInfoService.getPileListForLianLian(stationId); if (CollectionUtils.isNotEmpty(pileList)) { @@ -550,7 +565,7 @@ public class LianLianPlatformServiceImpl implements ThirdPartyPlatformService { * 设备状态变化推送 notification_stationStatus * 推送充电设备接口状态信息 supervise_notification_station_status * - * @param dto 枪口状态 + * @param dto 枪口状态 * @throws UnsupportedOperationException 未实现异常 */ @Override @@ -744,6 +759,10 @@ public class LianLianPlatformServiceImpl implements ThirdPartyPlatformService { if (MerchantUtils.isXiXiaoMerchant(orderBasicInfo.getMerchantId())) { orderInfo.setEquipmentOwnerID(Constants.OPERATORID_XI_XIAO); } + if (StringUtils.equals("36", String.valueOf(orderBasicInfo.getMerchantId()))) { + // 远大 + orderInfo.setEquipmentOwnerID(Constants.OPERATORID_YUAN_DA); + } // 支付方式 if (StringUtils.equals(orderBasicInfo.getPayMode(), OrderPayModeEnum.PAYMENT_OF_WECHATPAY.getValue())) { // 微信支付 @@ -863,6 +882,10 @@ public class LianLianPlatformServiceImpl implements ThirdPartyPlatformService { if (MerchantUtils.isXiXiaoMerchant(orderBasicInfo.getMerchantId())) { orderInfo.setEquipmentOwnerID(Constants.OPERATORID_XI_XIAO); } + if (StringUtils.equals("36", String.valueOf(orderBasicInfo.getMerchantId()))) { + // 远大 + orderInfo.setEquipmentOwnerID(Constants.OPERATORID_YUAN_DA); + } // 支付方式 if (StringUtils.equals(orderBasicInfo.getPayMode(), OrderPayModeEnum.PAYMENT_OF_WECHATPAY.getValue())) { // 微信支付 @@ -1193,11 +1216,11 @@ public class LianLianPlatformServiceImpl implements ThirdPartyPlatformService { .succStat(0) .failReason(0) .build(); - String type = ThirdPartyOperatorIdEnum.getTypeByOperatorId(dto.getOperatorId()); - if (StringUtils.equals(ThirdPlatformTypeEnum.XIN_DIAN_TU.getTypeCode(), type)) { - // 如果是新电途平台,则将 startChargeSeqStat 改为 1-启动中 - vo.setStartChargeSeqStat(1); - } + // String type = ThirdPartyOperatorIdEnum.getTypeByOperatorId(dto.getOperatorId()); + // if (StringUtils.equals(ThirdPlatformTypeEnum.XIN_DIAN_TU.getTypeCode(), type)) { + // // 如果是新电途平台,则将 startChargeSeqStat 改为 1-启动中 + // vo.setStartChargeSeqStat(1); + // } // 异步推送启动充电结果 2024.01.25改为在0x33帧类型中统一回复 // CompletableFuture.runAsync(() -> { // try { @@ -1259,10 +1282,10 @@ public class LianLianPlatformServiceImpl implements ThirdPartyPlatformService { vo.setFailReason(0); String type = ThirdPartyOperatorIdEnum.getTypeByOperatorId(dto.getOperatorId()); - if (StringUtils.equals(ThirdPlatformTypeEnum.XIN_DIAN_TU.getTypeCode(), type)) { - // 如果是新电途平台,则将 startChargeSeqStat 改为 3-停止中 - vo.setStartChargeSeqStat(3); - } + // if (StringUtils.equals(ThirdPlatformTypeEnum.XIN_DIAN_TU.getTypeCode(), type)) { + // // 如果是新电途平台,则将 startChargeSeqStat 改为 3-停止中 + // vo.setStartChargeSeqStat(3); + // } // 加密 Map resultMap = ThirdPartyPlatformUtils.generateResultMapV2(vo, thirdPartySecretInfoVO.getOurDataSecret(), thirdPartySecretInfoVO.getOurDataSecretIv(), thirdPartySecretInfoVO.getTheirSigSecret()); @@ -1299,7 +1322,7 @@ public class LianLianPlatformServiceImpl implements ThirdPartyPlatformService { if (StringUtils.equals(orderStatus, OrderStatusEnum.IN_THE_CHARGING.getValue())) { // 充电中 orderStatus = "2"; - }else if (StringUtils.equals(orderStatus, OrderStatusEnum.ORDER_COMPLETE.getValue())) { + } else if (StringUtils.equals(orderStatus, OrderStatusEnum.ORDER_COMPLETE.getValue())) { // 充电完成 orderStatus = "4"; } else { @@ -1312,7 +1335,7 @@ public class LianLianPlatformServiceImpl implements ThirdPartyPlatformService { // 查询当前枪口状态 PileConnectorInfoVO connectorInfoVO = pileConnectorInfoService.getPileConnectorInfoByConnectorCode(orderInfo.getPileConnectorCode()); connectorStatus = connectorInfoVO.getStatus(); - }else { + } else { connectorStatus = Integer.parseInt(status); } BigDecimal totalElectricityAmount = orderDetail.getTotalElectricityAmount() == null ? BigDecimal.ZERO : orderDetail.getTotalElectricityAmount();