From cc98d768e05aebcf265e019329a09347219f6784 Mon Sep 17 00:00:00 2001 From: "autumn.g@foxmail.com" Date: Tue, 26 Mar 2024 15:26:34 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E5=AF=B9=E6=8E=A5=E8=81=94=E8=81=94?= =?UTF-8?q?=E5=B9=B3=E5=8F=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../enums/thirdparty/ThirdPartyApiEnum.java | 35 + .../pile/service/PileBasicInfoService.java | 7 + .../ThirdPartyStationRelationService.java | 2 + .../impl/PileBasicInfoServiceImpl.java | 102 ++- .../impl/PileConnectorInfoServiceImpl.java | 14 +- .../ThirdPartyStationRelationServiceImpl.java | 22 + .../pile/thirdparty}/ConnectorInfo.java | 2 +- .../pile/thirdparty}/EquipmentInfo.java | 2 +- .../lianlian/domain/StationInfo.java | 2 + .../service/impl/LianLianServiceImpl.java | 7 +- .../AbsInterfaceWithPlatformLogic.java | 13 +- .../hainan/service/HaiNanPlatformLogic.java | 6 +- .../service/LianLianPlatformLogic.java | 713 +++++++++++++++++- .../service/NeiMengGuPlatformLogic.java | 45 +- 14 files changed, 888 insertions(+), 84 deletions(-) create mode 100644 jsowell-common/src/main/java/com/jsowell/common/enums/thirdparty/ThirdPartyApiEnum.java rename {jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/lianlian/domain => jsowell-pile/src/main/java/com/jsowell/pile/thirdparty}/ConnectorInfo.java (97%) rename {jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/lianlian/domain => jsowell-pile/src/main/java/com/jsowell/pile/thirdparty}/EquipmentInfo.java (97%) diff --git a/jsowell-common/src/main/java/com/jsowell/common/enums/thirdparty/ThirdPartyApiEnum.java b/jsowell-common/src/main/java/com/jsowell/common/enums/thirdparty/ThirdPartyApiEnum.java new file mode 100644 index 000000000..1a57ff360 --- /dev/null +++ b/jsowell-common/src/main/java/com/jsowell/common/enums/thirdparty/ThirdPartyApiEnum.java @@ -0,0 +1,35 @@ +package com.jsowell.common.enums.thirdparty; + +public enum ThirdPartyApiEnum { + NOTIFICATION_STATION_STATUS("notification_stationStatus", "设备状态变化推送"), + NOTIFICATION_CHARGE_ORDER_INFO("notification_charge_order_info", "推送充电订单信息"), + NOTIFICATION_START_CHARGE_RESULT("notification_start_charge_result", "推送启动充电结果"), + NOTIFICATION_EQUIP_CHARGE_STATUS("notification_equip_charge_status", "推送充电状态"), + NOTIFICATION_STOP_CHARGE_RESULT("notification_stop_charge_result", "推送停止充电结果"), + CHECK_CHARGE_ORDERS("check_charge_orders", "推送订单对账结果信息"), + ; + private String value; + + private String label; + + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + + public String getLabel() { + return label; + } + + public void setLabel(String label) { + this.label = label; + } + + ThirdPartyApiEnum(String value, String label) { + this.value = value; + this.label = label; + } +} diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/service/PileBasicInfoService.java b/jsowell-pile/src/main/java/com/jsowell/pile/service/PileBasicInfoService.java index 689f600f9..41ca31a75 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/service/PileBasicInfoService.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/service/PileBasicInfoService.java @@ -1,7 +1,10 @@ package com.jsowell.pile.service; +import com.jsowell.pile.thirdparty.ConnectorInfo; +import com.jsowell.pile.thirdparty.EquipmentInfo; import com.jsowell.common.core.domain.ykc.RealTimeMonitorData; import com.jsowell.pile.domain.PileBasicInfo; +import com.jsowell.pile.domain.PileStationInfo; import com.jsowell.pile.dto.IndexQueryDTO; import com.jsowell.pile.dto.QueryPileDTO; import com.jsowell.pile.dto.ReplaceMerchantStationDTO; @@ -190,4 +193,8 @@ public interface PileBasicInfoService { * 获取最新建一条桩的信息 */ PileBasicInfo getMaxNumPileInfo(); + + List getPileList(PileStationInfo pileStationInfo); + + List getConnectorList(PileBasicInfo pileBasicInfo); } diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/service/ThirdPartyStationRelationService.java b/jsowell-pile/src/main/java/com/jsowell/pile/service/ThirdPartyStationRelationService.java index d4afd8826..c339538d7 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/service/ThirdPartyStationRelationService.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/service/ThirdPartyStationRelationService.java @@ -12,6 +12,8 @@ import java.util.List; * @date 2023-06-06 */ public interface ThirdPartyStationRelationService { + // 保存到数据库 + int insertInfo2DataBase(String thirdPartyType, String stationId); /** * 查询站点、第三方推送平台配置对应 * diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/PileBasicInfoServiceImpl.java b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/PileBasicInfoServiceImpl.java index 17076973b..f2ad75f73 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/PileBasicInfoServiceImpl.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/PileBasicInfoServiceImpl.java @@ -4,21 +4,22 @@ import com.alibaba.fastjson2.JSON; import com.google.common.collect.Lists; import com.jsowell.common.constant.CacheConstants; import com.jsowell.common.constant.Constants; +import com.jsowell.pile.thirdparty.ConnectorInfo; +import com.jsowell.pile.thirdparty.EquipmentInfo; import com.jsowell.common.core.domain.vo.AuthorizedDeptVO; import com.jsowell.common.core.domain.ykc.GroundLockData; import com.jsowell.common.core.domain.ykc.RealTimeMonitorData; import com.jsowell.common.core.domain.ykc.YKCFrameTypeCode; import com.jsowell.common.core.redis.RedisCache; import com.jsowell.common.enums.DelFlagEnum; +import com.jsowell.common.enums.lianlian.LianLianPileStatusEnum; import com.jsowell.common.enums.ykc.PileConnectorDataBaseStatusEnum; import com.jsowell.common.enums.ykc.PileConnectorStatusEnum; +import com.jsowell.common.enums.ykc.PileStatusEnum; import com.jsowell.common.enums.ykc.ReturnCodeEnum; import com.jsowell.common.exception.BusinessException; import com.jsowell.common.util.*; -import com.jsowell.pile.domain.PileBasicInfo; -import com.jsowell.pile.domain.PileConnectorInfo; -import com.jsowell.pile.domain.PileModelInfo; -import com.jsowell.pile.domain.PileSimInfo; +import com.jsowell.pile.domain.*; import com.jsowell.pile.dto.IndexQueryDTO; import com.jsowell.pile.dto.QueryPileDTO; import com.jsowell.pile.dto.ReplaceMerchantStationDTO; @@ -927,4 +928,97 @@ public class PileBasicInfoServiceImpl implements PileBasicInfoService { public PileBasicInfo getMaxNumPileInfo() { return pileBasicInfoMapper.getMaxNumPileInfo(); } + + /** + * 获取桩列表信息 + * + * @param pileStationInfo + * @return + */ + @Override + public List getPileList(PileStationInfo pileStationInfo) { + List resultList = new ArrayList<>(); + // 通过站点id查询桩基本信息 + List list = this.getPileListByStationId(String.valueOf(pileStationInfo.getId())); + // MerchantInfoVO merchantInfo = pileMerchantInfoService.getMerchantInfo(String.valueOf(pileStationInfo.getMerchantId())); + // 封装成联联平台对象 + for (PileBasicInfo pileBasicInfo : list) { + EquipmentInfo equipmentInfo = new EquipmentInfo(); + String pileSn = pileBasicInfo.getSn(); + + equipmentInfo.setEquipmentID(pileSn); + equipmentInfo.setManufacturerID(Constants.OPERATORID_LIANLIAN); + equipmentInfo.setConstructionTime(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD, pileBasicInfo.getCreateTime())); + + PileModelInfoVO modelInfo = pileModelInfoService.getPileModelInfoByPileSn(pileSn); + equipmentInfo.setEquipmentType(Integer.valueOf(modelInfo.getSpeedType())); + + // Map pileStatus = pileConnectorInfoService.getPileStatus(Lists.newArrayList(pileBasicInfo.getSn())); + Map pileStatusMap = pileConnectorInfoService.getPileStatus(Lists.newArrayList(pileSn)); + String pileStatus = pileStatusMap.get(pileSn); + if (StringUtils.equals(PileStatusEnum.ON_LINE.getValue(), pileStatus)) { + // 1-在线 + pileStatus = LianLianPileStatusEnum.NORMAL.getCode(); + } else if (StringUtils.equals(PileStatusEnum.OFF_LINE.getValue(), pileStatus)) { + // 2-离线 + pileStatus = LianLianPileStatusEnum.CLOSE_OFFLINE.getCode(); + } else if (StringUtils.equals(PileStatusEnum.FAULT.getValue(), pileStatus)) { + // 3-故障 + pileStatus = LianLianPileStatusEnum.UNDER_MAINTENANCE.getCode(); + } + equipmentInfo.setEquipmentStatus(Integer.valueOf(pileStatus)); + equipmentInfo.setEquipmentPower(new BigDecimal(modelInfo.getRatedPower()).setScale(1, BigDecimal.ROUND_HALF_UP)); + equipmentInfo.setNewNationalStandard(1); + equipmentInfo.setVinFlag(1); + + List connectorList = getConnectorList(pileBasicInfo); + equipmentInfo.setConnectorInfos(connectorList); + + resultList.add(equipmentInfo); + } + return resultList; + } + + /** + * 获取枪口列表 + * + * @param pileBasicInfo + * @return + */ + @Override + public List getConnectorList(PileBasicInfo pileBasicInfo) { + List resultList = new ArrayList<>(); + + List list = pileConnectorInfoService.selectPileConnectorInfoList(pileBasicInfo.getSn()); + for (PileConnectorInfo pileConnectorInfo : list) { + ConnectorInfo connectorInfo = new ConnectorInfo(); + + connectorInfo.setConnectorID(pileConnectorInfo.getPileConnectorCode()); + String pileSn = pileConnectorInfo.getPileSn(); + PileModelInfoVO modelInfo = pileModelInfoService.getPileModelInfoByPileSn(pileSn); + int connectorType = StringUtils.equals("1", modelInfo.getSpeedType()) ? 4 : 3; + + connectorInfo.setConnectorType(connectorType); + // 车位号 + if (StringUtils.isNotBlank(pileConnectorInfo.getParkNo())) { + connectorInfo.setParkNo(pileConnectorInfo.getParkNo()); + } + connectorInfo.setVoltageUpperLimits(Integer.valueOf(modelInfo.getRatedVoltage())); + connectorInfo.setVoltageLowerLimits(Integer.valueOf(modelInfo.getRatedVoltage())); + + connectorInfo.setCurrent(Integer.valueOf(modelInfo.getRatedCurrent())); + if (!StringUtils.equals(modelInfo.getConnectorNum(), "1")) { + // 如果不是单枪,则枪口功率需要除以枪口数量 + String ratedPowerStr = modelInfo.getRatedPower(); + BigDecimal ratedPower = new BigDecimal(ratedPowerStr); + connectorInfo.setPower(ratedPower.divide(new BigDecimal(modelInfo.getConnectorNum()), 1, BigDecimal.ROUND_HALF_UP)); + }else { + connectorInfo.setPower(new BigDecimal(modelInfo.getRatedPower()).setScale(1, BigDecimal.ROUND_HALF_UP)); + } + + resultList.add(connectorInfo); + } + + return resultList; + } } diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/PileConnectorInfoServiceImpl.java b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/PileConnectorInfoServiceImpl.java index ce5e568e2..bdee87381 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/PileConnectorInfoServiceImpl.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/PileConnectorInfoServiceImpl.java @@ -26,7 +26,6 @@ import com.jsowell.pile.mapper.PileBasicInfoMapper; import com.jsowell.pile.mapper.PileConnectorInfoMapper; import com.jsowell.pile.service.*; import com.jsowell.pile.vo.base.ConnectorInfoVO; -import com.jsowell.pile.vo.base.ThirdPartyStationRelationVO; import com.jsowell.pile.vo.web.PileConnectorInfoVO; import com.jsowell.pile.vo.web.PileDetailVO; import com.jsowell.pile.vo.web.PileModelInfoVO; @@ -145,8 +144,7 @@ public class PileConnectorInfoServiceImpl implements PileConnectorInfoService { } if (StringUtils.isNotBlank(pileConnectorCode)) { - // 删除充电桩枪口状态缓存 - keys.add(CacheConstants.PILE_CONNECTOR_STATUS_KEY + pileConnectorCode); + keys.add(CacheConstants.PILE_CONNECTOR_STATUS_KEY + pileConnectorCode); // 删除充电桩枪口状态缓存 } // 批量删除 @@ -584,7 +582,7 @@ public class PileConnectorInfoServiceImpl implements PileConnectorInfoService { if (StringUtils.isBlank(pileConnectorCode) || StringUtils.isBlank(status)) { return num; } - String redisKey = CacheConstants.PILE_CONNECTOR_STATUS_KEY + pileConnectorCode; + String redisKey = CacheConstants.PILE_CONNECTOR_STATUS_KEY + pileConnectorCode; // 获取缓存 String redisStatus = redisCache.getCacheObject(redisKey); // log.info("更新枪口状态-枪口编号:{}, redisKey:{}, 缓存状态:{}, 传来的状态:{}, 状态描述:{}", pileConnectorCode, redisKey, // redisStatus, status, PileConnectorDataBaseStatusEnum.getStatusDescription(status)); @@ -706,10 +704,10 @@ public class PileConnectorInfoServiceImpl implements PileConnectorInfoService { if (CollectionUtils.isNotEmpty(connectorList)) { // 批量查询redis中的枪口状态 - List redisKeyList = connectorList.stream() - .map(x -> CacheConstants.PILE_CONNECTOR_STATUS_KEY + x.getPileConnectorCode()) - .collect(Collectors.toList()); - List statusList = redisCache.multiGet(redisKeyList); + // List redisKeyList = connectorList.stream() + // .map(x -> CacheConstants.PILE_CONNECTOR_STATUS_KEY + x.getPileConnectorCode()) + // .collect(Collectors.toList()); + // List statusList = redisCache.multiGet(redisKeyList); for (ConnectorInfoVO connectorVO : connectorList) { String redisKey = CacheConstants.PILE_CONNECTOR_STATUS_KEY + connectorVO.getPileConnectorCode(); diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/ThirdPartyStationRelationServiceImpl.java b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/ThirdPartyStationRelationServiceImpl.java index 88088f74d..db143bc03 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/ThirdPartyStationRelationServiceImpl.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/ThirdPartyStationRelationServiceImpl.java @@ -1,6 +1,9 @@ package com.jsowell.pile.service.impl; +import com.jsowell.common.constant.Constants; +import com.jsowell.common.enums.thirdparty.ThirdPlatformTypeEnum; import com.jsowell.common.util.SecurityUtils; +import com.jsowell.common.util.StringUtils; import com.jsowell.pile.domain.ThirdPartyStationRelation; import com.jsowell.pile.mapper.ThirdPartyStationRelationMapper; import com.jsowell.pile.service.ThirdPartyStationRelationService; @@ -21,6 +24,25 @@ public class ThirdPartyStationRelationServiceImpl implements ThirdPartyStationRe @Autowired private ThirdPartyStationRelationMapper thirdPartyStationRelationMapper; + @Override + public int insertInfo2DataBase(String thirdPartyType, String stationId) { + if (StringUtils.isBlank(thirdPartyType) || StringUtils.isBlank(stationId)) { + return 0; + } + ThirdPartyStationRelation relation = new ThirdPartyStationRelation(); + relation.setStationId(Long.parseLong(stationId)); + relation.setThirdPartyType(thirdPartyType); + if (StringUtils.equals(thirdPartyType, ThirdPlatformTypeEnum.HUA_WEI.getCode())) { + relation.setStartMode(Constants.ONE); + } + ThirdPartyStationRelationVO vo = this.selectRelationInfo(relation); + if (vo != null) { + return 0; + } + // 新增数据库 + return this.insertThirdPartyStationRelation(relation); + } + /** * 查询站点、第三方推送平台配置对应 * diff --git a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/lianlian/domain/ConnectorInfo.java b/jsowell-pile/src/main/java/com/jsowell/pile/thirdparty/ConnectorInfo.java similarity index 97% rename from jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/lianlian/domain/ConnectorInfo.java rename to jsowell-pile/src/main/java/com/jsowell/pile/thirdparty/ConnectorInfo.java index f32bd8bae..3ad310b00 100644 --- a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/lianlian/domain/ConnectorInfo.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/thirdparty/ConnectorInfo.java @@ -1,4 +1,4 @@ -package com.jsowell.thirdparty.lianlian.domain; +package com.jsowell.pile.thirdparty; import com.alibaba.fastjson2.annotation.JSONField; import lombok.AllArgsConstructor; diff --git a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/lianlian/domain/EquipmentInfo.java b/jsowell-pile/src/main/java/com/jsowell/pile/thirdparty/EquipmentInfo.java similarity index 97% rename from jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/lianlian/domain/EquipmentInfo.java rename to jsowell-pile/src/main/java/com/jsowell/pile/thirdparty/EquipmentInfo.java index d2ed499ac..d40c0a1d9 100644 --- a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/lianlian/domain/EquipmentInfo.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/thirdparty/EquipmentInfo.java @@ -1,4 +1,4 @@ -package com.jsowell.thirdparty.lianlian.domain; +package com.jsowell.pile.thirdparty; import com.alibaba.fastjson2.annotation.JSONField; import lombok.AllArgsConstructor; diff --git a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/lianlian/domain/StationInfo.java b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/lianlian/domain/StationInfo.java index d0395cab0..c31f7c913 100644 --- a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/lianlian/domain/StationInfo.java +++ b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/lianlian/domain/StationInfo.java @@ -2,6 +2,7 @@ package com.jsowell.thirdparty.lianlian.domain; import com.alibaba.fastjson2.annotation.JSONField; +import com.jsowell.pile.thirdparty.EquipmentInfo; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -12,6 +13,7 @@ import java.util.List; /** * 充电站信息 + * 第三方平台使用 */ @Builder @AllArgsConstructor diff --git a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/lianlian/service/impl/LianLianServiceImpl.java b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/lianlian/service/impl/LianLianServiceImpl.java index b8d7eb945..0e04274ea 100644 --- a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/lianlian/service/impl/LianLianServiceImpl.java +++ b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/lianlian/service/impl/LianLianServiceImpl.java @@ -9,6 +9,8 @@ import com.github.pagehelper.PageInfo; import com.google.common.collect.Lists; import com.google.common.collect.Maps; import com.jsowell.common.constant.Constants; +import com.jsowell.pile.thirdparty.ConnectorInfo; +import com.jsowell.pile.thirdparty.EquipmentInfo; import com.jsowell.common.core.domain.ykc.RealTimeMonitorData; import com.jsowell.common.enums.lianlian.LianLianPileStatusEnum; import com.jsowell.common.enums.lianlian.PayChannelEnum; @@ -256,11 +258,6 @@ public class LianLianServiceImpl implements LianLianService { // } public String pushStationInfoV2(PushStationInfoDTO dto) { - // String OperatorID = "987654321"; - // String SigSecret = "1234567890abcdef"; // 签名秘钥 - // String DataSecret = "1234567890abcdef"; // 消息密钥 - // String DataSecretIV = "1234567890abcdef"; // 消息密钥初始化向量 - // String token = "c548f9276c1c4ea8b88b1f7b1eb7cf07"; //QueryToken类查询接口获取到的token // 通过id查询站点相关信息 PileStationInfo pileStationInfo = pileStationInfoService.selectPileStationInfoById(dto.getStationId()); diff --git a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/AbsInterfaceWithPlatformLogic.java b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/AbsInterfaceWithPlatformLogic.java index 613f8c1d9..49e5ac916 100644 --- a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/AbsInterfaceWithPlatformLogic.java +++ b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/AbsInterfaceWithPlatformLogic.java @@ -39,12 +39,18 @@ import java.util.*; public abstract class AbsInterfaceWithPlatformLogic implements InitializingBean { protected final Logger logger = LoggerFactory.getLogger(this.getClass()); + @Autowired + protected PileMerchantInfoService pileMerchantInfoService; + @Autowired protected PileStationInfoService pileStationInfoService; @Autowired protected ThirdPartyPlatformConfigService thirdPartyPlatformConfigService; + @Autowired + protected ThirdPartySettingInfoService thirdPartySettingInfoService; + @Autowired protected PileBillingTemplateService pileBillingTemplateService; @@ -54,9 +60,6 @@ public abstract class AbsInterfaceWithPlatformLogic implements InitializingBean @Autowired protected PileConnectorInfoService pileConnectorInfoService; - @Autowired - protected ThirdPartyStationRelationService relationService; - @Autowired protected PileModelInfoService pileModelInfoService; @@ -104,7 +107,7 @@ public abstract class AbsInterfaceWithPlatformLogic implements InitializingBean public abstract Map queryStationStatus(QueryStationInfoDTO dto); /** - * 查询统计信息 + * 查询统计信息 query_station_stats * * @param dto 查询站点信息dto * @exception UnsupportedOperationException 未实现异常 @@ -224,7 +227,7 @@ public abstract class AbsInterfaceWithPlatformLogic implements InitializingBean * @param status 枪口状态 * @exception UnsupportedOperationException 未实现异常 */ - public abstract String notificationConnectorChargeStatus(String pileConnectorCode, String status); + public abstract String notificationConnectorChargeStatus(String orderCode); /** * 订单信息推送 notification_orderInfo diff --git a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/hainan/service/HaiNanPlatformLogic.java b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/hainan/service/HaiNanPlatformLogic.java index 4d03f65d5..e411846f2 100644 --- a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/hainan/service/HaiNanPlatformLogic.java +++ b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/hainan/service/HaiNanPlatformLogic.java @@ -89,7 +89,7 @@ public class HaiNanPlatformLogic extends AbsInterfaceWithPlatformLogic { public Map queryStationsInfo(QueryStationInfoDTO dto) { // 查询出要查询的充电站id并set进 dto 的stationIds if (StringUtils.isNotBlank(dto.getThirdPlatformType())) { - List xdtList = relationService.selectThirdPartyStationRelationList(dto.getThirdPlatformType()); + List xdtList = thirdPartyStationRelationService.selectThirdPartyStationRelationList(dto.getThirdPlatformType()); if (CollectionUtils.isNotEmpty(xdtList)) { List stationList = xdtList.stream() .map(x -> String.valueOf(x.getStationId())) @@ -284,7 +284,7 @@ public class HaiNanPlatformLogic extends AbsInterfaceWithPlatformLogic { * @param status 枪口状态 */ @Override - public String notificationConnectorChargeStatus(String pileConnectorCode, String status) { + public String notificationConnectorChargeStatus(String orderCode) { return null; } @@ -456,7 +456,7 @@ public class HaiNanPlatformLogic extends AbsInterfaceWithPlatformLogic { } /** - * 查询统计信息 + * 查询统计信息 query_station_stats * * @param dto */ diff --git a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/lianlian/service/LianLianPlatformLogic.java b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/lianlian/service/LianLianPlatformLogic.java index a10b8b30c..8f9efdf81 100644 --- a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/lianlian/service/LianLianPlatformLogic.java +++ b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/lianlian/service/LianLianPlatformLogic.java @@ -1,18 +1,54 @@ package com.jsowell.thirdparty.platform.lianlian.service; +import cn.hutool.core.util.PageUtil; +import com.alibaba.fastjson2.JSON; +import com.alibaba.fastjson2.JSONObject; +import com.github.pagehelper.PageInfo; +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import com.jsowell.common.constant.Constants; +import com.jsowell.common.core.domain.ykc.RealTimeMonitorData; +import com.jsowell.common.enums.lianlian.PayChannelEnum; +import com.jsowell.common.enums.lianlian.StationPaymentEnum; +import com.jsowell.common.enums.thirdparty.BusinessInformationExchangeEnum; import com.jsowell.common.enums.thirdparty.ThirdPlatformTypeEnum; +import com.jsowell.common.enums.ykc.OrderPayModeEnum; +import com.jsowell.common.enums.ykc.PileConnectorDataBaseStatusEnum; +import com.jsowell.common.util.DateUtils; +import com.jsowell.common.util.PageUtils; +import com.jsowell.common.util.StringUtils; +import com.jsowell.pile.domain.*; import com.jsowell.pile.dto.*; import com.jsowell.pile.dto.ningxiajiaotou.NXJTQueryStationInfoDTO; +import com.jsowell.pile.thirdparty.EquipmentInfo; +import com.jsowell.pile.vo.base.*; +import com.jsowell.pile.vo.lianlian.AccumulativeInfoVO; +import com.jsowell.pile.vo.lianlian.PushStationFeeVO; +import com.jsowell.pile.vo.uniapp.BillingPriceVO; +import com.jsowell.pile.vo.web.PileStationVO; +import com.jsowell.thirdparty.lianlian.domain.*; +import com.jsowell.thirdparty.lianlian.util.Cryptos; +import com.jsowell.thirdparty.lianlian.util.Encodes; +import com.jsowell.thirdparty.lianlian.util.GBSignUtils; +import com.jsowell.thirdparty.lianlian.util.HttpRequestUtil; import com.jsowell.thirdparty.platform.AbsInterfaceWithPlatformLogic; import com.jsowell.thirdparty.platform.InterfaceWithPlatformLogicFactory; +import org.apache.commons.collections4.CollectionUtils; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.LinkedHashMap; +import java.util.List; import java.util.Map; +import java.util.stream.Collectors; public class LianLianPlatformLogic extends AbsInterfaceWithPlatformLogic { + // 平台类型 + private final String platformType = ThirdPlatformTypeEnum.LIAN_LIAN_PLATFORM.getCode(); @Override public void afterPropertiesSet() throws Exception { - InterfaceWithPlatformLogicFactory.register(ThirdPlatformTypeEnum.LIAN_LIAN_PLATFORM.getCode(), this); + InterfaceWithPlatformLogicFactory.register(platformType, this); } /** @@ -37,7 +73,82 @@ public class LianLianPlatformLogic extends AbsInterfaceWithPlatformLogic { */ @Override public Map queryStationsInfo(QueryStationInfoDTO dto) { - return null; + List resultList = new ArrayList<>(); + int pageNo = dto.getPageNo() == null ? 1 : dto.getPageNo(); + int pageSize = dto.getPageSize() == null ? 10 : dto.getPageSize(); + + PageUtils.startPage(pageNo, pageSize); + List stationInfos = pileStationInfoService.getStationInfosByThirdParty(dto); + if (CollectionUtils.isEmpty(stationInfos)) { + // 未查到数据 + return null; + } + ThirdPartyPlatformConfig configInfo = thirdPartyPlatformConfigService.getInfoByOperatorId(dto.getOperatorId()); + if (configInfo == null) { + return null; + } + PageInfo pageInfo = new PageInfo<>(stationInfos); + for (ThirdPartyStationInfoVO pileStationInfo : pageInfo.getList()) { + StationInfo stationInfo = new StationInfo(); + stationInfo.setStationID(String.valueOf(pileStationInfo.getId())); + // MerchantInfoVO merchantInfo = pileMerchantInfoService.getMerchantInfo(String.valueOf(pileStationInfo.getMerchantId())); + stationInfo.setOperatorID(Constants.OPERATORID_LIANLIAN); // 组织机构代码 + stationInfo.setEquipmentOwnerID(String.valueOf(pileStationInfo.getMerchantId())); + stationInfo.setStationName(pileStationInfo.getStationName()); + stationInfo.setIsAloneApply(Integer.valueOf(pileStationInfo.getAloneApply())); + stationInfo.setIsPublicParkingLot(Integer.valueOf(pileStationInfo.getPublicParking())); + stationInfo.setCountryCode(pileStationInfo.getCountryCode()); + stationInfo.setAreaCode(pileStationInfo.getAreaCode()); + stationInfo.setAddress(pileStationInfo.getAddress()); + stationInfo.setServiceTel(pileStationInfo.getStationTel()); + stationInfo.setStationType(Integer.valueOf(pileStationInfo.getStationType())); + stationInfo.setParkNums(Integer.valueOf(pileStationInfo.getParkNums())); + stationInfo.setStationLng(new BigDecimal(pileStationInfo.getStationLng())); + stationInfo.setStationLat(new BigDecimal(pileStationInfo.getStationLat())); + stationInfo.setConstruction(Integer.valueOf(pileStationInfo.getConstruction())); + stationInfo.setOpenAllDay(Integer.valueOf(pileStationInfo.getOpenAllDay())); + // stationInfo.setMinElectricityPrice(pileStationInfo); // 最低充电电费率 + // stationInfo.setElectricityFee(); // 电费 xx元/度 + // stationInfo.setServiceFee(); // 服务费 xx元/度 + stationInfo.setParkFree(Integer.valueOf(pileStationInfo.getParkFree())); + stationInfo.setPayment(pileStationInfo.getPayment()); + stationInfo.setSupportOrder(Integer.valueOf(pileStationInfo.getSupportOrder())); + // stationInfo.setParkFeeType(pileStationInfo); // 停车收费类型 + stationInfo.setToiletFlag(Integer.valueOf(pileStationInfo.getToiletFlag())); + stationInfo.setStoreFlag(Integer.valueOf(pileStationInfo.getStoreFlag())); + stationInfo.setRestaurantFlag(Integer.valueOf(pileStationInfo.getRestaurantFlag())); + stationInfo.setLoungeFlag(Integer.valueOf(pileStationInfo.getLoungeFlag())); + stationInfo.setCanopyFlag(Integer.valueOf(pileStationInfo.getCanopyFlag())); + stationInfo.setPrinterFlag(Integer.valueOf(pileStationInfo.getPrinterFlag())); + stationInfo.setBarrierFlag(Integer.valueOf(pileStationInfo.getBarrierFlag())); + stationInfo.setParkingLockFlag(Integer.valueOf(pileStationInfo.getParkingLockFlag())); + + List pileList = pileBasicInfoService.getPileList(pileStationInfo); + if (CollectionUtils.isNotEmpty(pileList)) { + stationInfo.setEquipmentInfos(pileList); // 充电设备信息列表 + } + + resultList.add(stationInfo); + } + Map map = new LinkedHashMap<>(); + map.put("PageNo", pageInfo.getPageNum()); + map.put("PageCount", pageInfo.getPages()); + map.put("ItemSize", resultList.size()); + map.put("StationInfos", resultList); + + // 加密 + Map resultMap = Maps.newLinkedHashMap(); + // 加密数据 + byte[] encryptText = Cryptos.aesEncrypt(JSON.toJSONString(map).getBytes(), + configInfo.getDataSecret().getBytes(), configInfo.getDataSecretIv().getBytes()); + String encryptData = Encodes.encodeBase64(encryptText); + + resultMap.put("Data", encryptData); + // 生成sig + String resultSign = GBSignUtils.sign(resultMap, configInfo.getSignSecret()); + resultMap.put("Sig", resultSign); + + return resultMap; } /** @@ -48,18 +159,187 @@ public class LianLianPlatformLogic extends AbsInterfaceWithPlatformLogic { */ @Override public Map queryStationStatus(QueryStationInfoDTO dto) { - return null; + List stationIds = dto.getStationIds(); + List StationStatusInfos = new ArrayList<>(); + List ConnectorStatusInfos = new ArrayList<>(); + ThirdPartyPlatformConfig configInfo = thirdPartyPlatformConfigService.getInfoByOperatorId(dto.getOperatorId()); + if (configInfo == null) { + return null; + } + ConnectorStatusInfo connectorStatusInfo; + for (String stationId : stationIds) { + StationStatusInfo stationStatusInfo= new StationStatusInfo(); + stationStatusInfo.setStationId(stationId); + // 根据站点id查询 + List list = pileConnectorInfoService.getConnectorListForLianLian(Long.parseLong(stationId)); + for (ConnectorInfoVO connectorInfoVO : list) { + + String connectorStatus = connectorInfoVO.getConnectorStatus(); + if (StringUtils.equals(connectorStatus, PileConnectorDataBaseStatusEnum.OCCUPIED_CHARGING.getValue())) { + // 充电中 + ConnectorChargeStatusInfo info = new ConnectorChargeStatusInfo(); + OrderBasicInfo orderBasicInfo = orderBasicInfoService.queryChargingByPileConnectorCode(connectorInfoVO.getPileConnectorCode()); + if (orderBasicInfo == null) { + continue; + } + List chargingRealTimeData = orderBasicInfoService.getChargingRealTimeData(orderBasicInfo.getTransactionCode()); + if(CollectionUtils.isNotEmpty(chargingRealTimeData)) { + RealTimeMonitorData realTimeMonitorData = chargingRealTimeData.get(0); + + info.setStartChargeSeq(orderBasicInfo.getOrderCode()); + info.setConnectorID(orderBasicInfo.getPileConnectorCode()); + info.setConnectorStatus(Integer.valueOf(connectorInfoVO.getConnectorStatus())); + info.setCurrentA(new BigDecimal(realTimeMonitorData.getOutputCurrent())); + info.setVoltageA(new BigDecimal(realTimeMonitorData.getOutputVoltage())); + info.setSoc(new BigDecimal(realTimeMonitorData.getSOC())); + info.setStartTime(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, orderBasicInfo.getChargeStartTime())); + info.setEndTime(DateUtils.getDateTime()); // 本次采样时间 + info.setTotalPower(new BigDecimal(realTimeMonitorData.getChargingDegree())); // 累计充电量 + // info.setElecMoney(); // 累计电费 + // info.setSeviceMoney(); // 累计服务费 + info.setTotalMoney(new BigDecimal(realTimeMonitorData.getChargingAmount())); + + ConnectorStatusInfos.add(info); + } + } else { + // 其他 + connectorStatusInfo = new ConnectorStatusInfo(); + connectorStatusInfo.setConnectorID(connectorInfoVO.getPileConnectorCode()); + connectorStatusInfo.setStatus(Integer.parseInt(connectorInfoVO.getConnectorStatus())); + + ConnectorStatusInfos.add(connectorStatusInfo); + } + } + stationStatusInfo.setConnectorStatusInfos(ConnectorStatusInfos); + StationStatusInfos.add(stationStatusInfo); + } + // 将 StationStatusInfos 分页 + int pageNum = 1; + int pageSize = 10; + List collect = StationStatusInfos.stream() + .skip((pageNum - 1) * pageSize) + .limit(pageSize) + .collect(Collectors.toList()); + + int total = StationStatusInfos.size(); + int pages = PageUtil.totalPage(total, pageSize); + + Map map = new LinkedHashMap<>(); + map.put("Total", total); + map.put("StationStatusInfos", collect); + + // 加密 + Map resultMap = Maps.newLinkedHashMap(); + // 加密数据 + byte[] encryptText = Cryptos.aesEncrypt(JSON.toJSONString(map).getBytes(), + configInfo.getDataSecret().getBytes(), configInfo.getDataSecretIv().getBytes()); + String encryptData = Encodes.encodeBase64(encryptText); + + resultMap.put("Data", encryptData); + // 生成sig + String resultSign = GBSignUtils.sign(resultMap, configInfo.getSignSecret()); + resultMap.put("Sig", resultSign); + + return resultMap; } /** - * 查询统计信息 + * 查询统计信息 query_station_stats * * @param dto 查询站点信息dto * @throws UnsupportedOperationException 未实现异常 */ @Override public Map queryStationStats(QueryStationInfoDTO dto) { - return null; + ThirdPartyPlatformConfig configInfo = thirdPartyPlatformConfigService.getInfoByOperatorId(dto.getOperatorId()); + if (configInfo == null) { + return null; + } + // 根据站点id 查出这段时间的充电量 + List list = orderBasicInfoService.getAccumulativeInfoForLianLian(dto); + if (CollectionUtils.isEmpty(list)) { + return null; + } + + // 根据充电桩编号分组 key=充电桩编号 + Map> pileMap = list.stream() + .collect(Collectors.groupingBy(AccumulativeInfoVO::getPileSn)); + + // 存放所有充电桩设备 + List equipmentStatsInfoList = Lists.newArrayList(); + // 站点用电量 + BigDecimal stationElectricity = BigDecimal.ZERO; + // 用于记录枪口用电量 在循环每个枪口的时候初始化 + BigDecimal pileElec; + for (String pileSn : pileMap.keySet()) { + // 该充电桩下 所有枪口的用电数据 + List accumulativeInfoVOS = pileMap.get(pileSn); + if (CollectionUtils.isEmpty(accumulativeInfoVOS)) { + continue; + } + + // 存放充电桩用电量 + pileElec = BigDecimal.ZERO; + + // key=枪口编号 value 该枪口的用电数据 + Map> collect = accumulativeInfoVOS.stream() + .collect(Collectors.groupingBy(AccumulativeInfoVO::getPileConnectorCode)); + + List connectorStatsInfos = Lists.newArrayList(); + for (Map.Entry> entry : collect.entrySet()) { + String pileConnectorCode = entry.getKey(); + List value = entry.getValue(); + // 枪口用电量求和 + BigDecimal connectorElec = value.stream() + .map(AccumulativeInfoVO::getConnectorElectricity) + .map(BigDecimal::new) + .reduce(BigDecimal.ZERO, BigDecimal::add); + + connectorStatsInfos.add( + ConnectorStatsInfo.builder() + .connectorID(pileConnectorCode) + .connectorElectricity(connectorElec) + .build() + ); + // 充电桩电量为枪口用电量累计 + pileElec = pileElec.add(connectorElec); + } + + EquipmentStatsInfo build = EquipmentStatsInfo.builder() + .equipmentID(pileSn) + .equipmentElectricity(pileElec) + .connectorStatsInfos(connectorStatsInfos) + .build(); + equipmentStatsInfoList.add(build); + + // 所有充电桩用电量之和 + stationElectricity = stationElectricity.add(pileElec); + } + + StationStatsInfo stationStatsInfo = StationStatsInfo.builder() + .stationID(dto.getStationID()) + .startTime(dto.getStartTime()) + .endTime(dto.getEndTime()) + .stationElectricity(stationElectricity) + .equipmentStatsInfos(equipmentStatsInfoList) // 设备列表 + .build(); + + Map map = new LinkedHashMap<>(); + map.put("StationStats", stationStatsInfo); + + // 加密 + Map resultMap = Maps.newLinkedHashMap(); + // 加密数据 + byte[] encryptText = Cryptos.aesEncrypt(JSON.toJSONString(map).getBytes(), + configInfo.getDataSecret().getBytes(), configInfo.getDataSecretIv().getBytes()); + String encryptData = Encodes.encodeBase64(encryptText); + + resultMap.put("Data", encryptData); + // 生成sig + String resultSign = GBSignUtils.sign(resultMap, configInfo.getSignSecret()); + resultMap.put("Sig", resultSign); + + return resultMap; } /** @@ -70,7 +350,8 @@ public class LianLianPlatformLogic extends AbsInterfaceWithPlatformLogic { */ @Override public Map queryOrderInfo(String orderCode) { - return null; + //方法未实现,抛出异常 + throw new UnsupportedOperationException("This method is not yet implemented"); } /** @@ -82,7 +363,8 @@ public class LianLianPlatformLogic extends AbsInterfaceWithPlatformLogic { */ @Override public Map queryEquipAuth(QueryEquipmentDTO dto) { - return null; + //方法未实现,抛出异常 + throw new UnsupportedOperationException("This method is not yet implemented"); } /** @@ -93,7 +375,8 @@ public class LianLianPlatformLogic extends AbsInterfaceWithPlatformLogic { */ @Override public Map queryStartCharge(QueryStartChargeDTO dto) { - return null; + //方法未实现,抛出异常 + throw new UnsupportedOperationException("This method is not yet implemented"); } /** @@ -104,7 +387,8 @@ public class LianLianPlatformLogic extends AbsInterfaceWithPlatformLogic { */ @Override public Map queryEquipChargeStatus(QueryEquipChargeStatusDTO dto) { - return null; + //方法未实现,抛出异常 + throw new UnsupportedOperationException("This method is not yet implemented"); } /** @@ -115,7 +399,8 @@ public class LianLianPlatformLogic extends AbsInterfaceWithPlatformLogic { */ @Override public Map queryStopCharge(QueryStartChargeDTO dto) { - return null; + //方法未实现,抛出异常 + throw new UnsupportedOperationException("This method is not yet implemented"); } /** @@ -126,7 +411,8 @@ public class LianLianPlatformLogic extends AbsInterfaceWithPlatformLogic { */ @Override public Map queryFreePileNumber(NXJTQueryStationInfoDTO dto) { - return null; + //方法未实现,抛出异常 + throw new UnsupportedOperationException("This method is not yet implemented"); } /** @@ -137,7 +423,8 @@ public class LianLianPlatformLogic extends AbsInterfaceWithPlatformLogic { */ @Override public Map queryOrdersInfoByPlateNumber(NXJTQueryStationInfoDTO dto) { - return null; + //方法未实现,抛出异常 + throw new UnsupportedOperationException("This method is not yet implemented"); } /** @@ -148,7 +435,8 @@ public class LianLianPlatformLogic extends AbsInterfaceWithPlatformLogic { */ @Override public Map queryOrdersInfo(NXJTQueryStationInfoDTO dto) { - return null; + //方法未实现,抛出异常 + throw new UnsupportedOperationException("This method is not yet implemented"); } /** @@ -160,7 +448,8 @@ public class LianLianPlatformLogic extends AbsInterfaceWithPlatformLogic { */ @Override public Map queryEquipBusinessPolicy(QueryStartChargeDTO dto) { - return null; + //方法未实现,抛出异常 + throw new UnsupportedOperationException("This method is not yet implemented"); } /** @@ -172,7 +461,8 @@ public class LianLianPlatformLogic extends AbsInterfaceWithPlatformLogic { */ @Override public Map insertStartCharge(QueryStationInfoDTO dto) { - return null; + //方法未实现,抛出异常 + throw new UnsupportedOperationException("This method is not yet implemented"); } /** @@ -184,7 +474,8 @@ public class LianLianPlatformLogic extends AbsInterfaceWithPlatformLogic { */ @Override public Map notificationDeliverEquipBusinessPolicyResult(QueryStationInfoDTO dto) { - return null; + //方法未实现,抛出异常 + throw new UnsupportedOperationException("This method is not yet implemented"); } /** @@ -196,7 +487,118 @@ public class LianLianPlatformLogic extends AbsInterfaceWithPlatformLogic { */ @Override public String notificationStationInfo(String stationId) { - return null; + // 通过id查询站点相关信息 + PileStationInfo pileStationInfo = pileStationInfoService.selectPileStationInfoById(Long.parseLong(stationId)); + // 通过第三方配置类型查询相关配置信息 + ThirdPartySettingInfo settingInfo = new ThirdPartySettingInfo(); + settingInfo.setType(platformType); + ThirdPartySettingInfo thirdPartySettingInfo = thirdPartySettingInfoService.selectSettingInfo(settingInfo); + + String operatorId = thirdPartySettingInfo.getOperatorId(); + String operatorSecret = thirdPartySettingInfo.getOperatorSecret(); + String signSecret = thirdPartySettingInfo.getSignSecret(); + String dataSecret = thirdPartySettingInfo.getDataSecret(); + String dataSecretIv = thirdPartySettingInfo.getDataSecretIv(); + String urlAddress = thirdPartySettingInfo.getUrlAddress(); + + // 组装联联平台所需要的数据格式 + StationInfo info = StationInfo.builder() + .stationID("LC" + stationId) + .operatorID(operatorId) + .stationName(pileStationInfo.getStationName()) + .isAloneApply(Integer.valueOf(pileStationInfo.getAloneApply())) + .isPublicParkingLot(Integer.valueOf(pileStationInfo.getPublicParking())) + .countryCode(pileStationInfo.getCountryCode()) + .address(pileStationInfo.getAddress()) + .serviceTel(pileStationInfo.getStationTel()) + .stationType(Integer.valueOf(pileStationInfo.getStationType())) + .stationStatus(Integer.valueOf(pileStationInfo.getStationStatus())) + .parkNums(Integer.valueOf(pileStationInfo.getParkNums())) + .stationLng(new BigDecimal(pileStationInfo.getStationLng())) + .stationLat(new BigDecimal(pileStationInfo.getStationLat())) + .construction(Integer.valueOf(pileStationInfo.getConstruction())) + .openAllDay(Integer.valueOf(pileStationInfo.getOpenAllDay())) + .minElectricityPrice(new BigDecimal(Constants.ZERO)) + .electricityFee(Constants.ZERO) + .serviceFee(Constants.ZERO) + .parkFree(Integer.valueOf(pileStationInfo.getParkFree())) + .supportOrder(Integer.valueOf(pileStationInfo.getSupportOrder())) + .parkFeeType(0) + .toiletFlag(Integer.valueOf(pileStationInfo.getToiletFlag())) + .storeFlag(Integer.valueOf(pileStationInfo.getStoreFlag())) + .restaurantFlag(Integer.valueOf(pileStationInfo.getRestaurantFlag())) + .loungeFlag(Integer.valueOf(pileStationInfo.getLoungeFlag())) + .canopyFlag(Integer.valueOf(pileStationInfo.getCanopyFlag())) + .printerFlag(Integer.valueOf(pileStationInfo.getPrinterFlag())) + .barrierFlag(Integer.valueOf(pileStationInfo.getBarrierFlag())) + .parkingLockFlag(Integer.valueOf(pileStationInfo.getParkingLockFlag())) + .build(); + String areaCode = pileStationInfo.getAreaCode(); // 330000,330200,330213 + // 根据逗号分组 + String[] split = StringUtils.split(areaCode, ","); + // 只取最后一部分 330213 + String subAreaCode = split[split.length - 1]; + info.setAreaCode(subAreaCode); + // 截取运营商组织机构代码(去除最后一位后的最后九位) + String organizationCode = ""; + if (StringUtils.equals(ThirdPlatformTypeEnum.LIAN_LIAN_PLATFORM.getCode(), platformType)) { + // 联联平台先使用自己运营商的组织机构代码 + 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 (StringUtils.equals("35", String.valueOf(pileStationInfo.getMerchantId()))) { + // 如果是希晓运营商,则把equipmentOwnerID换成希晓 + info.setEquipmentOwnerID(Constants.OPERATORID_XI_XIAO); + } + String payment = StationPaymentEnum.getPaymentByCode(pileStationInfo.getPayment()); + info.setPayment(payment); + if (StringUtils.isNotBlank(pileStationInfo.getParkingNumber())) { + info.setIsPublicParkingLot(1); + info.setParkingLotNumber(pileStationInfo.getParkingNumber()); + } + // 户号 + if (StringUtils.isNotBlank(pileStationInfo.getAccountNumber())) { + info.setAccountNumber(pileStationInfo.getAccountNumber()); + } + + // 容量 + if (StringUtils.isNotBlank(String.valueOf(pileStationInfo.getCapacity()))) { + info.setCapacity(pileStationInfo.getCapacity().setScale(4, BigDecimal.ROUND_HALF_UP)); + } + List pileList = pileBasicInfoService.getPileList(pileStationInfo); + if (CollectionUtils.isNotEmpty(pileList)) { + info.setEquipmentInfos(pileList); // 充电设备信息列表 + } + + // 调用联联平台接口 + String url = urlAddress + "notification_stationInfo"; + + String jsonStr = JSON.toJSONString(info); + JSONObject data = new JSONObject(); + data.put("StationInfo", jsonStr); + + String jsonString = JSON.toJSONString(data); + System.out.println("jsonString : " + jsonString); + + // 获取令牌 + String token = getToken(urlAddress, operatorId, operatorSecret, dataSecretIv, signSecret, dataSecret); + String result = HttpRequestUtil.sendPost(token, jsonString, url, dataSecret + , dataSecretIv, operatorId, signSecret); + + // 新增数据库 + thirdPartyStationRelationService.insertInfo2DataBase(platformType, stationId); + return platformType + ":" + result; } /** @@ -209,19 +611,90 @@ public class LianLianPlatformLogic extends AbsInterfaceWithPlatformLogic { */ @Override public String notificationStationStatus(String pileConnectorCode, String status) { - return null; + // 查出该桩所属哪个站点 + String pileSn = StringUtils.substring(pileConnectorCode, 0, 14); + PileStationVO stationVO = pileStationInfoService.getStationInfoByPileSn(pileSn); + // 通过站点id查询相关配置信息 + ThirdPartyStationRelationVO relationInfo = thirdPartyStationRelationService.selectRelationInfo(stationVO.getId()); + if (relationInfo == null) { + return null; + } + String operatorId = relationInfo.getOperatorId(); + String operatorSecret = relationInfo.getOperatorSecret(); + String signSecret = relationInfo.getSignSecret(); + String dataSecret = relationInfo.getDataSecret(); + String dataSecretIv = relationInfo.getDataSecretIv(); + String urlAddress = relationInfo.getUrlAddress(); + + String url = urlAddress + BusinessInformationExchangeEnum.NOTIFICATION_STATION_STATUS.getValue(); + ConnectorStatusInfo info = ConnectorStatusInfo.builder() + .connectorID(pileConnectorCode) + .status(Integer.parseInt(status)) + .build(); + // 调用联联平台接口 + JSONObject json = new JSONObject(); + json.put("ConnectorStatusInfo", info); + String jsonString = JSON.toJSONString(json); + // 获取令牌 + String token = getToken(urlAddress, operatorId, operatorSecret, dataSecretIv, signSecret, dataSecret); + String result = HttpRequestUtil.sendPost(token, jsonString, url, dataSecret, dataSecretIv, operatorId, signSecret); + return result; } /** * 设备充电中状态变化推送 notification_connector_charge_status * - * @param pileConnectorCode 充电枪口编号 - * @param status 枪口状态 - * @throws UnsupportedOperationException 未实现异常 + * @param orderCode 订单编号 */ @Override - public String notificationConnectorChargeStatus(String pileConnectorCode, String status) { - return null; + public String notificationConnectorChargeStatus(String orderCode) { + // 通过订单号查询信息 + OrderBasicInfo orderInfo = orderBasicInfoService.getOrderInfoByOrderCode(orderCode); + // 根据枪口号查询充电实时状态 + // OrderBasicInfo orderBasicInfo = orderBasicInfoService.queryChargingByPileConnectorCode(orderInfo.getPileConnectorCode()); + List list = orderBasicInfoService.getChargingRealTimeData(orderInfo.getTransactionCode()); + RealTimeMonitorData realTimeMonitorData = list.get(0); + // 拼装联联参数 + ConnectorChargeStatusInfo info = ConnectorChargeStatusInfo.builder() + .startChargeSeq(orderCode) + .connectorID(orderInfo.getPileConnectorCode()) + .connectorStatus(Integer.valueOf(realTimeMonitorData.getConnectorStatus())) + .currentA(new BigDecimal(realTimeMonitorData.getOutputCurrent())) + .voltageA(new BigDecimal(realTimeMonitorData.getOutputVoltage())) + .soc(new BigDecimal(realTimeMonitorData.getSOC())) + .startTime(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, orderInfo.getChargeStartTime())) + .endTime(DateUtils.getDateTime()) + .totalPower(new BigDecimal(realTimeMonitorData.getChargingDegree())) + .elecMoney(new BigDecimal("0")) // TODO + .seviceMoney(new BigDecimal("0")) // TODO + .totalMoney(new BigDecimal(realTimeMonitorData.getChargingAmount()).setScale(2, BigDecimal.ROUND_HALF_UP)) + .build(); + + // 通过站点id查询相关配置信息 + ThirdPartyStationRelationVO relationInfo = thirdPartyStationRelationService.selectRelationInfo(orderInfo.getStationId()); + if (relationInfo == null) { + return null; + } + String operatorId = relationInfo.getOperatorId(); + String operatorSecret = relationInfo.getOperatorSecret(); + String signSecret = relationInfo.getSignSecret(); + String dataSecret = relationInfo.getDataSecret(); + String dataSecretIv = relationInfo.getDataSecretIv(); + String urlAddress = relationInfo.getUrlAddress(); + + String url = urlAddress + "notification_connector_charge_status"; + + // 获取令牌 + String token = getToken(urlAddress, operatorId, operatorSecret, dataSecretIv, signSecret, dataSecret); + if (StringUtils.isBlank(token)) { + return null; + } + JSONObject json = new JSONObject(); + json.put("ConnectorChargeStatusInfo", info); + String jsonString = JSON.toJSONString(json); + // 发送请求 + String result = HttpRequestUtil.sendPost(token, jsonString, url, dataSecret, dataSecretIv, operatorId, signSecret); + return result; } /** @@ -232,7 +705,121 @@ public class LianLianPlatformLogic extends AbsInterfaceWithPlatformLogic { */ @Override public String notificationOrderInfo(String orderCode) { - return null; + + // 根据订单号查询出信息 + OrderBasicInfo orderBasicInfo = orderBasicInfoService.getOrderInfoByOrderCode(orderCode); + OrderDetail orderDetail = orderBasicInfoService.getOrderDetailByOrderCode(orderCode); + + // 通过站点id查询相关配置信息 + ThirdPartyStationRelationVO relationInfo = thirdPartyStationRelationService.selectRelationInfo(orderBasicInfo.getStationId()); + if (relationInfo == null) { + return null; + } + String operatorId = relationInfo.getOperatorId(); + String operatorSecret = relationInfo.getOperatorSecret(); + String signSecret = relationInfo.getSignSecret(); + String dataSecret = relationInfo.getDataSecret(); + String dataSecretIv = relationInfo.getDataSecretIv(); + String urlAddress = relationInfo.getUrlAddress(); + + String url = urlAddress + "notification_orderInfo"; + + // 拼装成联联平台所需格式对象 + OrderInfo orderInfo = OrderInfo.builder() + .operatorID(operatorId) + .equipmentOwnerID(Constants.OPERATORID_LIANLIAN) + .stationID("LC" + orderBasicInfo.getStationId()) + .equipmentID(orderBasicInfo.getPileSn()) + .connectorID(orderBasicInfo.getPileConnectorCode()) + .startChargeSeq(orderCode) + .userChargeType(Constants.one) + .money(new BigDecimal(String.valueOf(orderBasicInfo.getOrderAmount())).setScale(2, BigDecimal.ROUND_HALF_UP)) + .electMoney(new BigDecimal(String.valueOf(orderDetail.getTotalElectricityAmount())).setScale(2, BigDecimal.ROUND_HALF_UP)) + .serviceMoney(new BigDecimal(String.valueOf(orderDetail.getTotalServiceAmount())).setScale(2, BigDecimal.ROUND_HALF_UP)) + .elect(new BigDecimal(String.valueOf(orderDetail.getTotalUsedElectricity())).setScale(2, BigDecimal.ROUND_HALF_UP)) + .startTime(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, orderBasicInfo.getChargeStartTime())) + .endTime(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, orderBasicInfo.getChargeEndTime())) + .paymentAmount(orderBasicInfo.getPayAmount()) + // .payChannel() + .stopReason(0) + // .chargeDetails() + .build(); + if (StringUtils.equals("35", orderBasicInfo.getMerchantId())) { + orderInfo.setEquipmentOwnerID(Constants.OPERATORID_XI_XIAO); + } + // 支付方式 + if (StringUtils.equals(orderBasicInfo.getPayMode(), OrderPayModeEnum.PAYMENT_OF_WECHATPAY.getValue())) { + // 微信支付 + orderInfo.setPayChannel(Integer.valueOf(PayChannelEnum.WEXIN_PAY.getCode())); + } else if (StringUtils.equals(orderBasicInfo.getPayMode(), OrderPayModeEnum.PAYMENT_OF_ALIPAY.getValue())) { + // 支付宝支付 + orderInfo.setPayChannel(Integer.valueOf(PayChannelEnum.ALI_PAY.getCode())); + } else { + // 其他 + orderInfo.setPayChannel(Integer.valueOf(PayChannelEnum.OTHER.getCode())); + } + // 订单详情 + ChargeDetail detail; + + List billingList = pileBillingTemplateService.queryBillingPrice(orderBasicInfo.getStationId()); + // 先将list按照 尖、峰、平、谷 时段排序 + // List collect = billingList.stream().sorted(Comparator.comparing(BillingPriceVO::getTimeType)).collect(Collectors.toList()); + // 再循环该list,拼装对应的充电价格、费率 + List chargeDetails = new ArrayList<>(); + for (BillingPriceVO billingPriceVO : billingList) { + detail = new ChargeDetail(); + if (StringUtils.equals(billingPriceVO.getTimeType(), "1")) { + // 尖时段 + detail.setDetailStartTime(billingPriceVO.getStartTime()); + detail.setDetailEndTime(billingPriceVO.getEndTime()); + detail.setElecPrice(new BigDecimal(billingPriceVO.getElectricityPrice()).setScale(4, BigDecimal.ROUND_HALF_UP)); + detail.setSevicePrice(new BigDecimal(billingPriceVO.getServicePrice()).setScale(4, BigDecimal.ROUND_HALF_UP)); + detail.setDetailPower(orderDetail.getSharpUsedElectricity()); + detail.setDetailElecMoney(orderDetail.getSharpElectricityPrice()); + detail.setDetailSeviceMoney(orderDetail.getSharpServicePrice()); + } else if (StringUtils.equals(billingPriceVO.getTimeType(), "2")) { + // 峰时段 + detail.setDetailStartTime(billingPriceVO.getStartTime()); + detail.setDetailEndTime(billingPriceVO.getEndTime()); + detail.setElecPrice(new BigDecimal(billingPriceVO.getElectricityPrice()).setScale(4, BigDecimal.ROUND_HALF_UP)); + detail.setSevicePrice(new BigDecimal(billingPriceVO.getServicePrice()).setScale(4, BigDecimal.ROUND_HALF_UP)); + detail.setDetailPower(orderDetail.getPeakUsedElectricity()); + detail.setDetailElecMoney(orderDetail.getPeakElectricityPrice()); + detail.setDetailSeviceMoney(orderDetail.getPeakServicePrice()); + } else if (StringUtils.equals(billingPriceVO.getTimeType(), "3")) { + // 平时段 + detail.setDetailStartTime(billingPriceVO.getStartTime()); + detail.setDetailEndTime(billingPriceVO.getEndTime()); + detail.setElecPrice(new BigDecimal(billingPriceVO.getElectricityPrice()).setScale(4, BigDecimal.ROUND_HALF_UP)); + detail.setSevicePrice(new BigDecimal(billingPriceVO.getServicePrice()).setScale(4, BigDecimal.ROUND_HALF_UP)); + detail.setDetailPower(orderDetail.getFlatUsedElectricity()); + detail.setDetailElecMoney(orderDetail.getFlatElectricityPrice()); + detail.setDetailSeviceMoney(orderDetail.getFlatServicePrice()); + } else if (StringUtils.equals(billingPriceVO.getTimeType(), "4")) { + // 谷时段 + detail.setDetailStartTime(billingPriceVO.getStartTime()); + detail.setDetailEndTime(billingPriceVO.getEndTime()); + detail.setElecPrice(new BigDecimal(billingPriceVO.getElectricityPrice()).setScale(4, BigDecimal.ROUND_HALF_UP)); + detail.setSevicePrice(new BigDecimal(billingPriceVO.getServicePrice()).setScale(4, BigDecimal.ROUND_HALF_UP)); + detail.setDetailPower(orderDetail.getValleyUsedElectricity()); + detail.setDetailElecMoney(orderDetail.getValleyElectricityPrice()); + detail.setDetailSeviceMoney(orderDetail.getValleyServicePrice()); + } + chargeDetails.add(detail); + } + orderInfo.setChargeDetails(chargeDetails); + + // 获取令牌 + String token = getToken(urlAddress, operatorId, operatorSecret, dataSecretIv, signSecret, dataSecret); + if (StringUtils.isBlank(token)) { + return null; + } + // 调用联联平台接口 + JSONObject json = new JSONObject(); + json.put("OrderInfo", orderInfo); + String jsonString = JSON.toJSONString(json); + String result = HttpRequestUtil.sendPost(token, jsonString, url, dataSecret, dataSecretIv, operatorId, signSecret); + return result; } /** @@ -243,7 +830,58 @@ public class LianLianPlatformLogic extends AbsInterfaceWithPlatformLogic { */ @Override public String notificationStationFee(String stationId) { - return null; + PushStationFeeVO vo = new PushStationFeeVO(); + List chargeFeeDetailList = new ArrayList<>(); + PushStationFeeVO.ChargeFeeDetail chargeFeeDetail = null; + // 根据站点 id 查询出正在使用的计费模板详情 + List billingPriceVOList = pileBillingTemplateService.queryBillingPrice(stationId); + // 查询设备列表 + List pileDetailVOS = pileBasicInfoService.queryPileDetailList(Lists.newArrayList(stationId)); + vo.setOperatorId(Constants.OPERATORID_LIANLIAN); + vo.setStationId(stationId); + for (PileInfoVO pileInfoVO : pileDetailVOS) { + for (BillingPriceVO billingPriceVO : billingPriceVOList) { + chargeFeeDetail = new PushStationFeeVO.ChargeFeeDetail(); + + chargeFeeDetail.setEquipmentType(Integer.parseInt(pileInfoVO.getSpeedType())); + String startTime = billingPriceVO.getStartTime(); + String endTime = billingPriceVO.getEndTime(); + + chargeFeeDetail.setStartTime(startTime); + chargeFeeDetail.setEndTime(endTime); + chargeFeeDetail.setElectricityFee(new BigDecimal(billingPriceVO.getElectricityPrice()).setScale(2, BigDecimal.ROUND_DOWN)); + chargeFeeDetail.setServiceFee(new BigDecimal(billingPriceVO.getServicePrice()).setScale(2, BigDecimal.ROUND_DOWN)); + + chargeFeeDetailList.add(chargeFeeDetail); + } + } + vo.setChargeFeeDetail(chargeFeeDetailList); + + // 通过站点id查询相关配置信息 + ThirdPartyStationRelationVO relationInfo = thirdPartyStationRelationService.selectRelationInfo(stationId); + if (relationInfo == null) { + return null; + } + String operatorId = relationInfo.getOperatorId(); + String operatorSecret = relationInfo.getOperatorSecret(); + String signSecret = relationInfo.getSignSecret(); + String dataSecret = relationInfo.getDataSecret(); + String dataSecretIv = relationInfo.getDataSecretIv(); + String urlAddress = relationInfo.getUrlAddress(); + + String url = urlAddress + "notification_stationFee"; + + // 获取令牌 + String token = getToken(urlAddress, operatorId, operatorSecret, dataSecretIv, signSecret, dataSecret); + if (StringUtils.isBlank(token)) { + return null; + } + JSONObject json = new JSONObject(); + json.put("StationFee", vo); + String jsonString = JSON.toJSONString(json); + // 发送请求 + String result = HttpRequestUtil.sendPost(token, jsonString, url, dataSecret, dataSecretIv, operatorId, signSecret); + return result; } /** @@ -258,7 +896,8 @@ public class LianLianPlatformLogic extends AbsInterfaceWithPlatformLogic { */ @Override public String notificationChargeOrderInfo(String orderCode) { - return null; + //方法未实现,抛出异常 + throw new UnsupportedOperationException("This method is not yet implemented"); } /** @@ -268,7 +907,8 @@ public class LianLianPlatformLogic extends AbsInterfaceWithPlatformLogic { */ @Override public String notificationAlarmInfo() { - return null; + //方法未实现,抛出异常 + throw new UnsupportedOperationException("This method is not yet implemented"); } /** @@ -279,7 +919,8 @@ public class LianLianPlatformLogic extends AbsInterfaceWithPlatformLogic { */ @Override public String notificationStartChargeResult(String orderCode) { - return null; + //方法未实现,抛出异常 + throw new UnsupportedOperationException("This method is not yet implemented"); } /** @@ -291,7 +932,8 @@ public class LianLianPlatformLogic extends AbsInterfaceWithPlatformLogic { */ @Override public String notificationEquipChargeStatus(String orderCode) throws UnsupportedOperationException { - return null; + //方法未实现,抛出异常 + throw new UnsupportedOperationException("This method is not yet implemented"); } /** @@ -302,7 +944,8 @@ public class LianLianPlatformLogic extends AbsInterfaceWithPlatformLogic { */ @Override public String notificationStopChargeResult(String orderCode) { - return null; + //方法未实现,抛出异常 + throw new UnsupportedOperationException("This method is not yet implemented"); } /** @@ -314,7 +957,8 @@ public class LianLianPlatformLogic extends AbsInterfaceWithPlatformLogic { */ @Override public String notificationOperationSystemInfo(String orderCode) { - return null; + //方法未实现,抛出异常 + throw new UnsupportedOperationException("This method is not yet implemented"); } /** @@ -325,7 +969,8 @@ public class LianLianPlatformLogic extends AbsInterfaceWithPlatformLogic { */ @Override public String notificationOperationStatsInfo(String stationId) { - return null; + //方法未实现,抛出异常 + throw new UnsupportedOperationException("This method is not yet implemented"); } /** @@ -336,8 +981,8 @@ public class LianLianPlatformLogic extends AbsInterfaceWithPlatformLogic { */ @Override public String notificationChargeOrderInfoHistory(String stationId) { - return null; + //方法未实现,抛出异常 + throw new UnsupportedOperationException("This method is not yet implemented"); } - } diff --git a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/neimenggu/service/NeiMengGuPlatformLogic.java b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/neimenggu/service/NeiMengGuPlatformLogic.java index b99303289..48f268227 100644 --- a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/neimenggu/service/NeiMengGuPlatformLogic.java +++ b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/neimenggu/service/NeiMengGuPlatformLogic.java @@ -25,7 +25,7 @@ public class NeiMengGuPlatformLogic extends AbsInterfaceWithPlatformLogic { */ @Override public Map queryOperatorInfo(QueryOperatorInfoDTO dto) { - return null; + throw new UnsupportedOperationException("This method is not yet implemented"); } /** @@ -35,7 +35,7 @@ public class NeiMengGuPlatformLogic extends AbsInterfaceWithPlatformLogic { */ @Override public Map queryStationsInfo(QueryStationInfoDTO dto) { - return null; + throw new UnsupportedOperationException("This method is not yet implemented"); } /** @@ -46,18 +46,17 @@ public class NeiMengGuPlatformLogic extends AbsInterfaceWithPlatformLogic { */ @Override public String notificationStationStatus(String pileConnectorCode, String status) { - return null; + throw new UnsupportedOperationException("This method is not yet implemented"); } /** * 设备充电中状态变化推送 notification_connector_charge_status * - * @param pileConnectorCode 充电枪口编号 - * @param status 枪口状态 + * @param orderCode 订单号 */ @Override - public String notificationConnectorChargeStatus(String pileConnectorCode, String status) { - return null; + public String notificationConnectorChargeStatus(String orderCode) { + throw new UnsupportedOperationException("This method is not yet implemented"); } /** @@ -67,7 +66,7 @@ public class NeiMengGuPlatformLogic extends AbsInterfaceWithPlatformLogic { */ @Override public String notificationOrderInfo(String orderCode) { - return null; + throw new UnsupportedOperationException("This method is not yet implemented"); } /** @@ -77,7 +76,7 @@ public class NeiMengGuPlatformLogic extends AbsInterfaceWithPlatformLogic { */ @Override public String notificationStationFee(String stationId) { - return null; + throw new UnsupportedOperationException("This method is not yet implemented"); } /** @@ -87,7 +86,7 @@ public class NeiMengGuPlatformLogic extends AbsInterfaceWithPlatformLogic { */ @Override public String notificationChargeOrderInfo(String orderCode) { - return null; + throw new UnsupportedOperationException("This method is not yet implemented"); } /** @@ -95,7 +94,7 @@ public class NeiMengGuPlatformLogic extends AbsInterfaceWithPlatformLogic { */ @Override public String notificationAlarmInfo() { - return null; + throw new UnsupportedOperationException("This method is not yet implemented"); } /** @@ -105,17 +104,17 @@ public class NeiMengGuPlatformLogic extends AbsInterfaceWithPlatformLogic { */ @Override public Map queryStationStatus(QueryStationInfoDTO dto) { - return null; + throw new UnsupportedOperationException("This method is not yet implemented"); } /** - * 查询统计信息 + * 查询统计信息 query_station_stats * * @param dto */ @Override public Map queryStationStats(QueryStationInfoDTO dto) { - return null; + throw new UnsupportedOperationException("This method is not yet implemented"); } /** @@ -125,7 +124,7 @@ public class NeiMengGuPlatformLogic extends AbsInterfaceWithPlatformLogic { */ @Override public Map queryOrderInfo(String orderCode) { - return null; + throw new UnsupportedOperationException("This method is not yet implemented"); } /** @@ -136,7 +135,7 @@ public class NeiMengGuPlatformLogic extends AbsInterfaceWithPlatformLogic { */ @Override public Map queryEquipAuth(QueryEquipmentDTO dto) { - return null; + throw new UnsupportedOperationException("This method is not yet implemented"); } /** @@ -146,7 +145,7 @@ public class NeiMengGuPlatformLogic extends AbsInterfaceWithPlatformLogic { */ @Override public Map queryEquipBusinessPolicy(QueryStartChargeDTO dto) { - return null; + throw new UnsupportedOperationException("This method is not yet implemented"); } /** @@ -157,7 +156,7 @@ public class NeiMengGuPlatformLogic extends AbsInterfaceWithPlatformLogic { */ @Override public Map insertStartCharge(QueryStationInfoDTO dto) { - return null; + throw new UnsupportedOperationException("This method is not yet implemented"); } /** @@ -168,7 +167,7 @@ public class NeiMengGuPlatformLogic extends AbsInterfaceWithPlatformLogic { */ @Override public Map notificationDeliverEquipBusinessPolicyResult(QueryStationInfoDTO dto) { - return null; + throw new UnsupportedOperationException("This method is not yet implemented"); } /** @@ -179,7 +178,7 @@ public class NeiMengGuPlatformLogic extends AbsInterfaceWithPlatformLogic { */ @Override public String notificationStationInfo(String stationId) { - return null; + throw new UnsupportedOperationException("This method is not yet implemented"); } /** @@ -189,7 +188,7 @@ public class NeiMengGuPlatformLogic extends AbsInterfaceWithPlatformLogic { */ @Override public Map queryStartCharge(QueryStartChargeDTO dto) { - return null; + throw new UnsupportedOperationException("This method is not yet implemented"); } /** @@ -199,7 +198,7 @@ public class NeiMengGuPlatformLogic extends AbsInterfaceWithPlatformLogic { */ @Override public String notificationStartChargeResult(String orderCode) { - return null; + throw new UnsupportedOperationException("This method is not yet implemented"); } /** @@ -232,7 +231,7 @@ public class NeiMengGuPlatformLogic extends AbsInterfaceWithPlatformLogic { */ @Override public Map queryStopCharge(QueryStartChargeDTO dto) { - return null; + throw new UnsupportedOperationException("This method is not yet implemented"); } /**