update 对接第三方平台

This commit is contained in:
2024-03-26 17:13:00 +08:00
parent 7db83ee738
commit 79caa6f0bb
24 changed files with 750 additions and 544 deletions

View File

@@ -122,7 +122,7 @@ public class CommonService {
ThirdPartyStationRelation relation = new ThirdPartyStationRelation();
relation.setStationId(dto.getStationId());
relation.setThirdPartyType(thirdPartyType);
if (StringUtils.equals(thirdPartyType, ThirdPlatformTypeEnum.HUA_WEI.getCode())) {
if (StringUtils.equals(thirdPartyType, ThirdPlatformTypeEnum.HUA_WEI.getTypeCode())) {
relation.setStartMode(Constants.ONE);
}
ThirdPartyStationRelationVO vo = thirdPartyStationRelationService.selectRelationInfo(relation);
@@ -147,27 +147,27 @@ public class CommonService {
StringBuilder finalResult = new StringBuilder();
for (String type : types) {
dto.setThirdPartyType(type);
if (StringUtils.equals(ThirdPlatformTypeEnum.LIAN_LIAN_PLATFORM.getCode(), dto.getThirdPartyType())) {
if (StringUtils.equals(ThirdPlatformTypeEnum.LIAN_LIAN_PLATFORM.getTypeCode(), dto.getThirdPartyType())) {
// 推送联联
// result = lianLianService.pushStationInfo(dto);
result = lianLianService.pushStationInfoV2(dto);
}
if (StringUtils.equals(ThirdPlatformTypeEnum.ZHONG_DIAN_LIAN_PLATFORM.getCode(), dto.getThirdPartyType())) {
if (StringUtils.equals(ThirdPlatformTypeEnum.ZHONG_DIAN_LIAN_PLATFORM.getTypeCode(), dto.getThirdPartyType())) {
// 中电联
// result = zdlService.pushStationInfo(dto);
result = zdlService.pushStationInfoV2(dto);
}
if (StringUtils.equals(ThirdPlatformTypeEnum.JIANG_SU_PLATFORM.getCode(), dto.getThirdPartyType())) {
if (StringUtils.equals(ThirdPlatformTypeEnum.JIANG_SU_PLATFORM.getTypeCode(), dto.getThirdPartyType())) {
// 江苏省平台
// result = nrService.pushStationInfo(dto);
result = nrService.pushStationInfoV2(dto);
}
if (StringUtils.equals(ThirdPlatformTypeEnum.YONG_CHENG_BO_CHE.getCode(), dto.getThirdPartyType())) {
if (StringUtils.equals(ThirdPlatformTypeEnum.YONG_CHENG_BO_CHE.getTypeCode(), dto.getThirdPartyType())) {
// 甬城泊车平台
// result = ycbcService.pushStationInfo(dto);
result = ycbcService.pushStationInfoV2(dto);
}
if (StringUtils.equals(ThirdPlatformTypeEnum.XIN_DIAN_TU.getCode(), dto.getThirdPartyType())) {
if (StringUtils.equals(ThirdPlatformTypeEnum.XIN_DIAN_TU.getTypeCode(), dto.getThirdPartyType())) {
// 新电途平台
result = xdtService.pushStationInfoV2(dto);
}
@@ -175,7 +175,7 @@ public class CommonService {
// // 华为
// result = huaWeiService.notificationOperationSystemInfo(dto);
// }
if(StringUtils.equals(ThirdPlatformTypeEnum.HAI_NAN_1.getCode(), dto.getThirdPartyType())) {
if(StringUtils.equals(ThirdPlatformTypeEnum.HAI_NAN_1.getTypeCode(), dto.getThirdPartyType())) {
// 海南
result = haiNanChargeService.pushStationInfoV2(dto);
}
@@ -224,7 +224,7 @@ public class CommonService {
// 如果是类似华为格式,不需要传
continue;
}
if (StringUtils.equals(ThirdPlatformTypeEnum.LIAN_LIAN_PLATFORM.getCode(), thirdPartyType)) {
if (StringUtils.equals(ThirdPlatformTypeEnum.LIAN_LIAN_PLATFORM.getTypeCode(), thirdPartyType)) {
// 联联
OrderBasicInfo orderInfo = orderBasicInfoService.getOrderInfoByTransactionCode(transactionCode);
if (orderInfo == null) {
@@ -240,12 +240,12 @@ public class CommonService {
// 推送充电状态
lianLianService.pushChargeStatus(orderInfo.getOrderCode());
}
if (StringUtils.equals(ThirdPlatformTypeEnum.ZHONG_DIAN_LIAN_PLATFORM.getCode(), thirdPartyType)) {
if (StringUtils.equals(ThirdPlatformTypeEnum.ZHONG_DIAN_LIAN_PLATFORM.getTypeCode(), thirdPartyType)) {
// 中电联
// log.info("推送中电联平台实时数据 pileConnectorCode:{}, connectorStatus:{}", pileConnectorCode, connectorStatus);
zdlService.notificationStationStatus(pileConnectorCode, changedStatus);
}
if (StringUtils.equals(ThirdPlatformTypeEnum.JIANG_SU_PLATFORM.getCode(), thirdPartyType)) {
if (StringUtils.equals(ThirdPlatformTypeEnum.JIANG_SU_PLATFORM.getTypeCode(), thirdPartyType)) {
// 先判断缓存中是否有数据
String redisKey = CacheConstants.JIANGSU_PUSH_PILE_STATUS + pileConnectorCode;
Object cacheObject = redisCache.getCacheObject(redisKey);
@@ -269,7 +269,7 @@ public class CommonService {
// log.info("推送江苏省平台实时数据 result:{}", result);
}
if (StringUtils.equals(ThirdPlatformTypeEnum.XIN_DIAN_TU.getCode(), thirdPartyType)) {
if (StringUtils.equals(ThirdPlatformTypeEnum.XIN_DIAN_TU.getTypeCode(), thirdPartyType)) {
// 新电途平台
log.info("新电途平台设备状态变化推送 pileConnectorCode:{}, changedStatus:{}", pileConnectorCode, changedStatus);
String result1 = xdtService.notificationStationStatus(pileConnectorCode, changedStatus);
@@ -282,7 +282,7 @@ public class CommonService {
String result = xdtService.notificationEquipChargeStatus(orderInfo.getOrderCode());
log.info("推送新电途平台 充电状态 result:{}", result);
}
if (StringUtils.equals(ThirdPlatformTypeEnum.HUA_WEI.getCode(), thirdPartyType)) {
if (StringUtils.equals(ThirdPlatformTypeEnum.HUA_WEI.getTypeCode(), thirdPartyType)) {
// 华为平台
huaWeiService.notificationStationStatus(pileConnectorCode, changedStatus);
OrderBasicInfo orderInfo = orderBasicInfoService.getOrderInfoByTransactionCode(transactionCode);
@@ -291,11 +291,11 @@ public class CommonService {
}
huaWeiService.notificationEquipChargeStatus(orderInfo.getOrderCode());
}
if (StringUtils.equals(ThirdPlatformTypeEnum.HAI_NAN_1.getCode(), thirdPartyType)) {
if (StringUtils.equals(ThirdPlatformTypeEnum.HAI_NAN_1.getTypeCode(), thirdPartyType)) {
// 海南平台
haiNanChargeService.notificationStationStatus(pileConnectorCode, changedStatus);
}
if (StringUtils.equals(ThirdPlatformTypeEnum.YONG_CHENG_BO_CHE.getCode(), thirdPartyType)) {
if (StringUtils.equals(ThirdPlatformTypeEnum.YONG_CHENG_BO_CHE.getTypeCode(), thirdPartyType)) {
// 甬城泊车
// log.info("推送甬城泊车平台设备状态变化推送 pileConnectorCode:{}, changedStatus:{}", pileConnectorCode, changedStatus);
// 设备状态变化推送 notification_stationStatus
@@ -335,7 +335,7 @@ public class CommonService {
// 如果是类似华为格式,不需要传
continue;
}
if (StringUtils.equals(ThirdPlatformTypeEnum.LIAN_LIAN_PLATFORM.getCode(), thirdPartyType)) {
if (StringUtils.equals(ThirdPlatformTypeEnum.LIAN_LIAN_PLATFORM.getTypeCode(), thirdPartyType)) {
// 联联平台
// 推送停止充电结果
lianLianService.pushStopChargeResult(orderBasicInfo.getOrderCode());
@@ -344,16 +344,16 @@ public class CommonService {
// 推送充电订单信息
lianLianService.pushChargeOrderInfo(orderBasicInfo.getOrderCode());
}
if (StringUtils.equals(ThirdPlatformTypeEnum.ZHONG_DIAN_LIAN_PLATFORM.getCode(), thirdPartyType)) {
if (StringUtils.equals(ThirdPlatformTypeEnum.ZHONG_DIAN_LIAN_PLATFORM.getTypeCode(), thirdPartyType)) {
// 中电联
zdlService.pushChargeOrderInfo(orderBasicInfo.getOrderCode());
}
if (StringUtils.equals(ThirdPlatformTypeEnum.JIANG_SU_PLATFORM.getCode(), thirdPartyType)) {
if (StringUtils.equals(ThirdPlatformTypeEnum.JIANG_SU_PLATFORM.getTypeCode(), thirdPartyType)) {
// 江苏平台
// 推送订单信息
nrService.pushOrderInfo(orderBasicInfo.getOrderCode());
}
if (StringUtils.equals(ThirdPlatformTypeEnum.XIN_DIAN_TU.getCode(), thirdPartyType)) {
if (StringUtils.equals(ThirdPlatformTypeEnum.XIN_DIAN_TU.getTypeCode(), thirdPartyType)) {
// 新电途平台
// 推送停止充电结果
xdtService.notificationStopChargeResult(orderBasicInfo.getOrderCode());
@@ -367,12 +367,12 @@ public class CommonService {
// // 推送订单信息
// result = huaWeiService.pushChargeOrderInfo(orderBasicInfo.getOrderCode());
// }
if (StringUtils.equals(ThirdPlatformTypeEnum.HAI_NAN_1.getCode(), thirdPartyType)) {
if (StringUtils.equals(ThirdPlatformTypeEnum.HAI_NAN_1.getTypeCode(), thirdPartyType)) {
// 海南平台
haiNanChargeService.notificationChargeOrderInfo(orderBasicInfo.getOrderCode());
}
if (StringUtils.equals(ThirdPlatformTypeEnum.YONG_CHENG_BO_CHE.getCode(), thirdPartyType)) {
if (StringUtils.equals(ThirdPlatformTypeEnum.YONG_CHENG_BO_CHE.getTypeCode(), thirdPartyType)) {
if (StringUtils.equals(orderBasicInfo.getStartMode(), StartModeEnum.THIRD_PARTY_PLATFORM.getValue())) {
// 甬城泊车
// 推送停止充电结果
@@ -435,7 +435,7 @@ public class CommonService {
String token = "";
String result = "";
if (StringUtils.equals(ThirdPlatformTypeEnum.YONG_CHENG_BO_CHE.getCode(), thirdPartyType)) {
if (StringUtils.equals(ThirdPlatformTypeEnum.YONG_CHENG_BO_CHE.getTypeCode(), thirdPartyType)) {
YCBCGetTokenDTO dto = new YCBCGetTokenDTO();
dto.setOperatorId(operatorId);
dto.setDataSecret(dataSecret);
@@ -513,9 +513,9 @@ public class CommonService {
String payMode = dto.getPayMode();
// 判断平台类型
if (StringUtils.equals(ThirdPlatformTypeEnum.HUA_WEI.getCode(), thirdPartyType)) {
if (StringUtils.equals(ThirdPlatformTypeEnum.HUA_WEI.getTypeCode(), thirdPartyType)) {
// 华为平台
String label = ThirdPlatformTypeEnum.getLabelByCode(thirdPartyType);
String label = ThirdPlatformTypeEnum.getTypeLabelByTypeCode(thirdPartyType);
// query_station_status 查询站点枪口详情
Map<String, String> map = huaweiServiceV2.queryStationStatus(stationIds);
String status = map.get(pileConnectorCode);

View File

@@ -31,8 +31,6 @@ import com.jsowell.pile.dto.huawei.*;
import com.jsowell.pile.service.*;
import com.jsowell.pile.service.programlogic.AbstractProgramLogic;
import com.jsowell.pile.service.programlogic.ProgramLogicFactory;
import com.jsowell.pile.transaction.dto.OrderTransactionDTO;
import com.jsowell.pile.transaction.service.TransactionService;
import com.jsowell.pile.vo.huawei.QueryChargeStatusVO;
import com.jsowell.pile.vo.huawei.QueryEquipAuthVO;
import com.jsowell.pile.vo.huawei.QueryStartChargeVO;
@@ -50,7 +48,6 @@ import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.io.UnsupportedEncodingException;
import java.math.BigDecimal;
import java.math.RoundingMode;
@@ -120,7 +117,7 @@ public class HuaweiServiceV2 {
}
// 通过华为的type查询出密钥配置
ThirdPartySettingInfo info = new ThirdPartySettingInfo();
info.setType(ThirdPlatformTypeEnum.HUA_WEI.getCode());
info.setType(ThirdPlatformTypeEnum.HUA_WEI.getTypeCode());
ThirdPartySettingInfo settingInfo = thirdPartySettingInfoService.selectSettingInfo(info);
String operatorSecret = settingInfo.getOperatorSecret();
@@ -938,7 +935,7 @@ public class HuaweiServiceV2 {
private ThirdPartySettingInfo getHuaWeiSettingInfo() {
// 通过华为的type查询出密钥配置
ThirdPartySettingInfo info = new ThirdPartySettingInfo();
info.setType(ThirdPlatformTypeEnum.HUA_WEI.getCode());
info.setType(ThirdPlatformTypeEnum.HUA_WEI.getTypeCode());
ThirdPartySettingInfo settingInfo = thirdPartySettingInfoService.selectSettingInfo(info);
return settingInfo;
}

View File

@@ -317,7 +317,7 @@ public class LianLianServiceImpl implements LianLianService {
info.setAreaCode(subAreaCode);
// 截取运营商组织机构代码(去除最后一位后的最后九位)
String organizationCode = "";
if (StringUtils.equals(ThirdPlatformTypeEnum.LIAN_LIAN_PLATFORM.getCode(), dto.getThirdPartyType())) {
if (StringUtils.equals(ThirdPlatformTypeEnum.LIAN_LIAN_PLATFORM.getTypeCode(), dto.getThirdPartyType())) {
// 联联平台先使用自己运营商的组织机构代码
organizationCode = Constants.OPERATORID_LIANLIAN;
info.setEquipmentOwnerID(organizationCode);
@@ -797,7 +797,7 @@ public class LianLianServiceImpl implements LianLianService {
.build();
String type = ThirdPartyOperatorIdEnum.getTypeByOperatorId(dto.getOperatorId());
if (StringUtils.equals(ThirdPlatformTypeEnum.XIN_DIAN_TU.getCode(), type)) {
if (StringUtils.equals(ThirdPlatformTypeEnum.XIN_DIAN_TU.getTypeCode(), type)) {
// 如果是新电途平台,则将 startChargeSeqStat 改为 1-启动中
vo.setStartChargeSeqStat(1);
}
@@ -837,7 +837,7 @@ public class LianLianServiceImpl implements LianLianService {
public Map<String, String> query_equip_charge_status(QueryEquipChargeStatusDTO dto) {
String operatorID = dto.getOperatorID();
String type = ThirdPartyOperatorIdEnum.getTypeByOperatorId(operatorID);
String operatorName = ThirdPlatformTypeEnum.getLabelByCode(type);
String operatorName = ThirdPlatformTypeEnum.getTypeLabelByTypeCode(type);
// 通过订单号查询订单信息
OrderBasicInfo orderInfo = orderBasicInfoService.getOrderInfoByOrderCode(dto.getStartChargeSeq());
// logger.info(operatorName + "查询订单信息 orderInfo:{}", orderInfo);
@@ -950,7 +950,7 @@ public class LianLianServiceImpl implements LianLianService {
vo.setFailReason(0);
String type = ThirdPartyOperatorIdEnum.getTypeByOperatorId(dto.getOperatorId());
if (StringUtils.equals(ThirdPlatformTypeEnum.XIN_DIAN_TU.getCode(), type)) {
if (StringUtils.equals(ThirdPlatformTypeEnum.XIN_DIAN_TU.getTypeCode(), type)) {
// 如果是新电途平台,则将 startChargeSeqStat 改为 3-停止中
vo.setStartChargeSeqStat(3);
}
@@ -1070,7 +1070,7 @@ public class LianLianServiceImpl implements LianLianService {
// 获取令牌
String result = "";
String token = "";
if (StringUtils.equals(ThirdPlatformTypeEnum.YONG_CHENG_BO_CHE.getCode(), thirdPartyType)) {
if (StringUtils.equals(ThirdPlatformTypeEnum.YONG_CHENG_BO_CHE.getTypeCode(), thirdPartyType)) {
YCBCGetTokenDTO dto = new YCBCGetTokenDTO();
dto.setOperatorId(operatorId);
dto.setDataSecret(dataSecret);
@@ -1273,7 +1273,7 @@ public class LianLianServiceImpl implements LianLianService {
String token = "";
String result = "";
if (StringUtils.equals(ThirdPlatformTypeEnum.YONG_CHENG_BO_CHE.getCode(), thirdPartyType)) {
if (StringUtils.equals(ThirdPlatformTypeEnum.YONG_CHENG_BO_CHE.getTypeCode(), thirdPartyType)) {
YCBCGetTokenDTO dto = new YCBCGetTokenDTO();
dto.setOperatorId(operatorId);
dto.setDataSecret(dataSecret);
@@ -1343,7 +1343,7 @@ public class LianLianServiceImpl implements LianLianService {
// 获取令牌
String token = "";
String result = "";
if (StringUtils.equals(ThirdPlatformTypeEnum.YONG_CHENG_BO_CHE.getCode(), thirdPartyType)) {
if (StringUtils.equals(ThirdPlatformTypeEnum.YONG_CHENG_BO_CHE.getTypeCode(), thirdPartyType)) {
YCBCGetTokenDTO ycbcGetTokenDTO = new YCBCGetTokenDTO();
ycbcGetTokenDTO.setOperatorId(operatorId);
ycbcGetTokenDTO.setDataSecret(dataSecret);
@@ -1419,7 +1419,7 @@ public class LianLianServiceImpl implements LianLianService {
// 获取token
String token = "";
String result = "";
if (StringUtils.equals(ThirdPlatformTypeEnum.YONG_CHENG_BO_CHE.getCode(), thirdPartyType)) {
if (StringUtils.equals(ThirdPlatformTypeEnum.YONG_CHENG_BO_CHE.getTypeCode(), thirdPartyType)) {
YCBCGetTokenDTO dto = new YCBCGetTokenDTO();
dto.setOperatorId(operatorId);
dto.setDataSecret(dataSecret);
@@ -1491,7 +1491,7 @@ public class LianLianServiceImpl implements LianLianService {
// 获取令牌
String token = "";
String result = "";
if (StringUtils.equals(ThirdPlatformTypeEnum.YONG_CHENG_BO_CHE.getCode(), thirdPartyType)) {
if (StringUtils.equals(ThirdPlatformTypeEnum.YONG_CHENG_BO_CHE.getTypeCode(), thirdPartyType)) {
YCBCGetTokenDTO dto = new YCBCGetTokenDTO();
dto.setOperatorId(operatorId);
dto.setDataSecret(dataSecret);

View File

@@ -125,7 +125,7 @@ public class HttpRequestUtil {
String dataSecretIV, String operatorId, String sigSecret,
String thirdPlatformType) {
String type = ThirdPartyOperatorIdEnum.getTypeByOperatorId(operatorId);
String label = ThirdPlatformTypeEnum.getLabelByCode(type);
String label = ThirdPlatformTypeEnum.getTypeLabelByTypeCode(type);
if(StringUtils.isBlank(label)) {
label = operatorId + "(" + url + ")";
}
@@ -143,7 +143,7 @@ public class HttpRequestUtil {
params.put("Seq", "001");
// 此处是与其他获取令牌方法唯一不同之处,甬城泊车获取令牌需要添加此字段
if (ThirdPlatformTypeEnum.YONG_CHENG_BO_CHE.getCode().equals(thirdPlatformType)) {
if (ThirdPlatformTypeEnum.YONG_CHENG_BO_CHE.getTypeCode().equals(thirdPlatformType)) {
params.put("Portname", "wcc-pro");
}

View File

@@ -21,8 +21,8 @@ import com.jsowell.thirdparty.lianlian.util.Encodes;
import com.jsowell.thirdparty.lianlian.util.GBSignUtils;
import com.jsowell.thirdparty.lianlian.vo.AccessTokenVO;
import com.jsowell.thirdparty.lianlian.vo.LianLianResultVO;
import com.jsowell.thirdparty.zhongdianlian.domain.ZDLConnectorInfo;
import com.jsowell.thirdparty.zhongdianlian.domain.ZDLEquipmentInfo;
import com.jsowell.pile.thirdparty.ZDLConnectorInfo;
import com.jsowell.pile.thirdparty.ZDLEquipmentInfo;
import com.jsowell.thirdparty.zhongdianlian.service.ZDLService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

View File

@@ -0,0 +1,372 @@
package com.jsowell.thirdparty.platform;
import cn.hutool.http.HttpUtil;
import cn.hutool.json.JSONUtil;
import com.alibaba.fastjson2.JSON;
import com.jsowell.common.util.DateUtils;
import com.jsowell.pile.dto.*;
import com.jsowell.pile.dto.ningxiajiaotou.NXJTQueryStationInfoDTO;
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.vo.LianLianResultVO;
import java.nio.charset.StandardCharsets;
import java.util.Date;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
public interface ThirdPartyPlatformService {
// =================================================================================== //
// ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ 由我方平台实现此接口,对方平台调用的查询接口 ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ //
// =================================================================================== //
/**
* 查询运营商信息 query_operator_info
* supervise_query_operator_info
*
* @param dto 查询运营商信息DTO
* @throws UnsupportedOperationException 未实现异常
*/
default Map<String, String> queryOperatorInfo(QueryOperatorInfoDTO dto) {
throw new UnsupportedOperationException("This method is not yet implemented");
}
/**
* 查询充电站信息 query_stations_info
* 此接口用于查询对接平台的充电站的信息
*
* @param dto 查询站点信息dto
* @throws UnsupportedOperationException 未实现异常
*/
default Map<String, String> queryStationsInfo(QueryStationInfoDTO dto){
throw new UnsupportedOperationException("This method is not yet implemented");
}
/**
* 设备接口状态查询 query_station_status
*
* @param dto 查询站点信息dto
* @throws UnsupportedOperationException 未实现异常
*/
default Map<String, String> queryStationStatus(QueryStationInfoDTO dto) {
throw new UnsupportedOperationException("This method is not yet implemented");
}
/**
* 查询统计信息 query_station_stats
*
* @param dto 查询站点信息dto
* @throws UnsupportedOperationException 未实现异常
*/
default Map<String, String> queryStationStats(QueryStationInfoDTO dto) {
throw new UnsupportedOperationException("This method is not yet implemented");
}
/**
* 查询充电电量信息 query_order_info
*
* @throws UnsupportedOperationException 未实现异常
*/
default Map<String, String> queryOrderInfo(String orderCode) {
throw new UnsupportedOperationException("This method is not yet implemented");
}
/**
* 请求设备认证 query_equip_auth
* 业务信息交换
*
* @param dto 联联平台请求设备认证
* @throws UnsupportedOperationException 未实现异常
*/
default Map<String, String> queryEquipAuth(QueryEquipmentDTO dto) {
throw new UnsupportedOperationException("This method is not yet implemented");
}
/**
* 请求启动充电 query_start_charge
*
* @param dto 请求启动充电DTO
* @throws UnsupportedOperationException 未实现异常
*/
default Map<String, String> queryStartCharge(QueryStartChargeDTO dto) {
throw new UnsupportedOperationException("This method is not yet implemented");
}
/**
* 查询充电状态 query_equip_charge_status
*
* @param dto 查询充电状态DTO
* @throws UnsupportedOperationException 未实现异常
*/
default Map<String, String> queryEquipChargeStatus(QueryEquipChargeStatusDTO dto) {
throw new UnsupportedOperationException("This method is not yet implemented");
}
/**
* 请求停止充电 query_stop_charge
*
* @param dto 请求启动充电DTO
* @throws UnsupportedOperationException 未实现异常
*/
default Map<String, String> queryStopCharge(QueryStartChargeDTO dto) {
throw new UnsupportedOperationException("This method is not yet implemented");
}
/**
* 充电站内充电桩空闲状态查询 query_free_pile_number
*
* @throws UnsupportedOperationException 未实现异常
*/
default Map<String, String> queryFreePileNumber(NXJTQueryStationInfoDTO dto) {
throw new UnsupportedOperationException("This method is not yet implemented");
}
/**
* 某车牌号消费记录查询 query_orders_info_by_Plate_number
*
* @throws UnsupportedOperationException 未实现异常
*/
default Map<String, String> queryOrdersInfoByPlateNumber(NXJTQueryStationInfoDTO dto) {
throw new UnsupportedOperationException("This method is not yet implemented");
}
/**
* 某段时间内消费记录查询 query_orders_info
*
* @throws UnsupportedOperationException 未实现异常
*/
default Map<String, String> queryOrdersInfo(NXJTQueryStationInfoDTO dto) {
throw new UnsupportedOperationException("This method is not yet implemented");
}
/**
* 查询业务策略信息结果
* 请求计费策略 request_equip_business_policy
*
* @param dto 请求启动充电DTO
* @throws UnsupportedOperationException 未实现异常
*/
default Map<String, String> queryEquipBusinessPolicy(QueryStartChargeDTO dto) {
throw new UnsupportedOperationException("This method is not yet implemented");
}
/**
* VIN码充电 insert_start_charge
* 华为平台
*
* @throws UnsupportedOperationException 未实现异常
*/
default Map<String, String> insertStartCharge(QueryStationInfoDTO dto) {
throw new UnsupportedOperationException("This method is not yet implemented");
}
/**
* 下发计费策略响应 notification_deliver_equip_business_policy_result
* 华为平台
*
* @throws UnsupportedOperationException 未实现异常
*/
default Map<String, String> notificationDeliverEquipBusinessPolicyResult(QueryStationInfoDTO dto) {
throw new UnsupportedOperationException("This method is not yet implemented");
}
// =================================================================================== //
// ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ 由对方平台实现此接口,我方平台调用的通知接口 ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ //
// =================================================================================== //
/**
* 充电站信息变化推送 notification_stationInfo
* 新站需要推送。当站点信息发生变化时,推送新的信息通知到市级平台
*
* @param stationId 充电站id
* @throws UnsupportedOperationException 未实现异常
*/
default String notificationStationInfo(String stationId) {
throw new UnsupportedOperationException("This method is not yet implemented");
}
/**
* 设备状态变化推送 notification_stationStatus
* 推送充电设备接口状态信息 supervise_notification_station_status
*
* @param pileConnectorCode 充电枪口编号
* @param status 枪口状态
* @throws UnsupportedOperationException 未实现异常
*/
default String notificationStationStatus(String pileConnectorCode, String status) {
throw new UnsupportedOperationException("This method is not yet implemented");
}
/**
* 设备充电中状态变化推送 notification_connector_charge_status
*
* @param orderCode 订单编号
* @throws UnsupportedOperationException 未实现异常
*/
default String notificationConnectorChargeStatus(String orderCode) {
throw new UnsupportedOperationException("This method is not yet implemented");
}
/**
* 订单信息推送 notification_orderInfo
*
* @throws UnsupportedOperationException 未实现异常
*/
default String notificationOrderInfo(String orderCode) {
throw new UnsupportedOperationException("This method is not yet implemented");
}
/**
* 站点费率变化推送 notification_stationFee
*
* @throws UnsupportedOperationException 未实现异常
*/
default String notificationStationFee(String stationId) {
throw new UnsupportedOperationException("This method is not yet implemented");
}
/**
* 充电订单推送 notification_charge_order_info
* TODO 海南一张网文档中的接口检查一下是否和订单信息推送notification_orderInfo一致
* TODO 甬城泊车平台文档中的接口检查一下是否和订单信息推送notification_orderInfo一致
* TODO 华为平台文档中的接口检查一下是否和订单信息推送notification_orderInfo一致
* TODO 内蒙古平台文档中的接口检查一下是否和订单信息推送notification_orderInfo一致
*
* @param orderCode 订单编号
* @throws UnsupportedOperationException 未实现异常
*/
default String notificationChargeOrderInfo(String orderCode) {
throw new UnsupportedOperationException("This method is not yet implemented");
}
/**
* 告警信息推送 notification_alarmInfo
*
* @throws UnsupportedOperationException 未实现异常
*/
default String notificationAlarmInfo() {
throw new UnsupportedOperationException("This method is not yet implemented");
}
/**
* 推送启动充电结果 notification_start_charge_result
*
* @param orderCode 订单编号
* @throws UnsupportedOperationException 未实现异常
*/
default String notificationStartChargeResult(String orderCode) {
throw new UnsupportedOperationException("This method is not yet implemented");
}
/**
* 推送充电状态 notification_equip_charge_status
* 推送充电状态信息 supervise_notification_equip_charge_status
*
* @param orderCode 订单编号
* @throws UnsupportedOperationException 未实现异常
*/
default String notificationEquipChargeStatus(String orderCode) {
throw new UnsupportedOperationException("This method is not yet implemented");
}
/**
* 推送停止充电结果 notification_stop_charge_result
*
* @param orderCode 订单编号
* @throws UnsupportedOperationException 未实现异常
*/
default String notificationStopChargeResult(String orderCode) {
throw new UnsupportedOperationException("This method is not yet implemented");
}
/**
* 华为平台
* 平台充电设备编码同步 notification_operation_system_info
*
* @throws UnsupportedOperationException 未实现异常
*/
default String notificationOperationSystemInfo(String orderCode) {
throw new UnsupportedOperationException("This method is not yet implemented");
}
/**
* 推送充换电站用能统计信息 supervise_notification_operation_stats_info
*
* @throws UnsupportedOperationException 未实现异常
*/
default String notificationOperationStatsInfo(String stationId) {
throw new UnsupportedOperationException("This method is not yet implemented");
}
/**
* 推送充电站历史充电订单信息 supervise_notification_charge_order_info_history
*
* @throws UnsupportedOperationException 未实现异常
*/
default String notificationChargeOrderInfoHistory(String stationId) {
throw new UnsupportedOperationException("This method is not yet implemented");
}
// -------------------------------------- 以下是公用方法 --------------------------------------- //
/**
* 从联联平台获取令牌
*
* @param operatorId 运营商id
* @param operatorSecret
* @return
*/
default String getToken(String urlAddress, String operatorId, String operatorSecret,
String dataSecretIv, String signSecret, String dataSecret) {
String token = "";
try {
// 请求地址
String requestUrl = urlAddress + "query_token";
// 请求data
Map<String, String> data = new HashMap<>();
data.put("OperatorID", operatorId);
data.put("OperatorSecret", operatorSecret);
data.put("DataSecretIV", dataSecretIv);
String dataJson = JSONUtil.toJsonStr(data);
// 加密
byte[] encryptText = Cryptos.aesEncrypt(dataJson.getBytes(StandardCharsets.UTF_8),
dataSecret.getBytes(), dataSecretIv.getBytes());
String strData = Encodes.encodeBase64(encryptText);
Map<String, String> request = new LinkedHashMap<>();
request.put("OperatorID", operatorId);
request.put("Data", strData);
request.put("TimeStamp", DateUtils.parseDateToStr(DateUtils.YYYYMMDDHHMMSS, new Date()));
request.put("Seq", "0001");
// 生成签名
String sig = GBSignUtils.sign(request, signSecret);
request.put("Sig", sig);
String tokenRequest = JSONUtil.toJsonStr(request);
String response = HttpUtil.post(requestUrl, tokenRequest);
LianLianResultVO result = JSON.parseObject(response, LianLianResultVO.class);
// logger.info("获取令牌 result:{}", result);
if (result.getRet() == 0) {
// 解密data
byte[] plainText = Cryptos.aesDecrypt(Encodes.decodeBase64((String) result.getData()),
dataSecret.getBytes(), dataSecretIv.getBytes());
String dataStr = new String(plainText, StandardCharsets.UTF_8);
Map<String, String> resultMap = (Map<String, String>) JSON.parse(dataStr);
token = resultMap.get("AccessToken");
// logger.info("token: {}", token);
}
// logger.info("获取令牌 result:{}, token: {}", result, token);
} catch (Exception e) {
return token;
}
return token;
}
}

View File

@@ -1,7 +1,7 @@
package com.jsowell.thirdparty.platform.hainan.domain;
import com.alibaba.fastjson2.annotation.JSONField;
import com.jsowell.thirdparty.zhongdianlian.domain.ZDLStationInfo;
import com.jsowell.pile.thirdparty.ZDLStationInfo;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

View File

@@ -20,7 +20,7 @@ import com.jsowell.common.util.StringUtils;
import com.jsowell.pile.domain.*;
import com.jsowell.pile.domain.ykcCommond.StartChargingCommand;
import com.jsowell.pile.dto.*;
import com.jsowell.pile.dto.ningxiajiaotou.NXJTQueryStationInfoDTO;
import com.jsowell.pile.service.*;
import com.jsowell.pile.vo.base.ConnectorInfoVO;
import com.jsowell.pile.vo.base.ThirdPartyStationInfoVO;
import com.jsowell.pile.vo.base.ThirdPartyStationRelationVO;
@@ -40,13 +40,17 @@ import com.jsowell.thirdparty.lianlian.vo.EquipmentAuthVO;
import com.jsowell.thirdparty.lianlian.vo.QueryChargingStatusVO;
import com.jsowell.thirdparty.lianlian.vo.QueryStartChargeVO;
import com.jsowell.thirdparty.lianlian.vo.QueryStopChargeVO;
import com.jsowell.thirdparty.platform.AbsInterfaceWithPlatformLogic;
import com.jsowell.thirdparty.platform.InterfaceWithPlatformLogicFactory;
import com.jsowell.thirdparty.platform.ThirdPartyPlatformService;
import com.jsowell.thirdparty.platform.hainan.domain.HNStationInfo;
import com.jsowell.thirdparty.zhongdianlian.domain.ZDLEquipmentInfo;
import com.jsowell.pile.thirdparty.ZDLEquipmentInfo;
import com.jsowell.thirdparty.zhongdianlian.service.ZDLService;
import org.apache.commons.collections4.CollectionUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.nio.charset.StandardCharsets;
@@ -63,30 +67,61 @@ import java.util.stream.Collectors;
* @Date 2024/1/18 10:05:23
*/
@Service
public class HaiNanPlatformLogic extends AbsInterfaceWithPlatformLogic {
@Override
public void afterPropertiesSet() throws Exception {
InterfaceWithPlatformLogicFactory.register(ThirdPlatformTypeEnum.HAI_NAN_1.getCode(), this);
}
public class HaiNanPlatformLogic implements ThirdPartyPlatformService {
Logger logger = LoggerFactory.getLogger(HaiNanPlatformLogic.class);
// 平台类型
private final String platformType = ThirdPlatformTypeEnum.HAI_NAN_1.getTypeCode();
@Autowired
private PileMerchantInfoService pileMerchantInfoService;
@Autowired
private PileStationInfoService pileStationInfoService;
@Autowired
private PileBasicInfoService pileBasicInfoService;
@Autowired
private PileConnectorInfoService pileConnectorInfoService;
@Autowired
private PileBillingTemplateService pileBillingTemplateService;
@Autowired
private OrderBasicInfoService orderBasicInfoService;
@Autowired
private ThirdPartyPlatformConfigService thirdPartyPlatformConfigService;
@Autowired
private ThirdPartySettingInfoService thirdPartySettingInfoService;
@Resource
private ThirdPartyStationRelationService thirdPartyStationRelationService;
@Autowired
private YKCPushCommandService ykcPushCommandService;
@Autowired
private PileRemoteService pileRemoteService;
@Autowired
private ZDLService zdlService;
// @Override
// public void afterPropertiesSet() throws Exception {
// InterfaceWithPlatformLogicFactory.register(platformType, this);
// }
public String pushStationInfoV2(PushStationInfoDTO dto) {
return zdlService.pushStationInfoV2(dto);
}
/**
* 查询运营商信息
*
* @param dto 查询运营商信息DTO
*/
@Override
public Map<String, String> queryOperatorInfo(QueryOperatorInfoDTO dto) {
//方法未实现,抛出异常
throw new UnsupportedOperationException("This method is not yet implemented");
}
/**
* 6.2 查询充电站信息
*/
@Override
public Map<String, String> queryStationsInfo(QueryStationInfoDTO dto) {
// 查询出要查询的充电站id并set进 dto 的stationIds
if (StringUtils.isNotBlank(dto.getThirdPlatformType())) {
@@ -154,7 +189,7 @@ public class HaiNanPlatformLogic extends AbsInterfaceWithPlatformLogic {
stationInfo.setPictures(Lists.newArrayList());
}
List<ZDLEquipmentInfo> pileList = getPileList(pileStationInfo);
List<ZDLEquipmentInfo> pileList = pileBasicInfoService.getPileListForZDL(stationId);
if (CollectionUtils.isNotEmpty(pileList)) {
stationInfo.setEquipmentInfos(pileList); // 充电设备信息列表
}
@@ -278,40 +313,6 @@ public class HaiNanPlatformLogic extends AbsInterfaceWithPlatformLogic {
return result;
}
/**
* 设备充电中状态变化推送 notification_connector_charge_status
*
* @param pileConnectorCode 充电枪口编号
* @param status 枪口状态
*/
@Override
public String notificationConnectorChargeStatus(String orderCode) {
//方法未实现,抛出异常
throw new UnsupportedOperationException("This method is not yet implemented");
}
/**
* 订单信息推送 notification_orderInfo
*
* @param orderCode
*/
@Override
public String notificationOrderInfo(String orderCode) {
//方法未实现,抛出异常
throw new UnsupportedOperationException("This method is not yet implemented");
}
/**
* 站点费率变化推送 notification_stationFee
*
* @param stationId
*/
@Override
public String notificationStationFee(String stationId) {
//方法未实现,抛出异常
throw new UnsupportedOperationException("This method is not yet implemented");
}
/**
* 6.4 充电订单推送
*
@@ -360,15 +361,6 @@ public class HaiNanPlatformLogic extends AbsInterfaceWithPlatformLogic {
return result;
}
/**
* 告警信息推送 notification_alarmInfo
*/
@Override
public String notificationAlarmInfo() {
//方法未实现,抛出异常
throw new UnsupportedOperationException("This method is not yet implemented");
}
/**
* 6.5 设备接口状态查询
*
@@ -559,29 +551,6 @@ public class HaiNanPlatformLogic extends AbsInterfaceWithPlatformLogic {
return resultMap;
}
/**
* 查询充电电量信息 query_order_info
*
* @param orderCode
*/
@Override
public Map<String, String> queryOrderInfo(String orderCode) {
//方法未实现,抛出异常
throw new UnsupportedOperationException("This method is not yet implemented");
}
/**
* 充电站信息变化推送 notification_stationInfo
* 新站需要推送。当站点信息发生变化时,推送新的信息通知到市级平台
*
* @param stationId 充电站id
*/
@Override
public String notificationStationInfo(String stationId) {
//方法未实现,抛出异常
throw new UnsupportedOperationException("This method is not yet implemented");
}
/**
* 请求设备认证
*
@@ -700,29 +669,6 @@ public class HaiNanPlatformLogic extends AbsInterfaceWithPlatformLogic {
return resultMap;
}
/**
* VIN码充电 insert_start_charge
* 华为平台
*
* @param dto
*/
@Override
public Map<String, String> insertStartCharge(QueryStationInfoDTO dto) {
//方法未实现,抛出异常
throw new UnsupportedOperationException("This method is not yet implemented");
}
/**
* 下发计费策略响应 notification_deliver_equip_business_policy_result
* 华为平台
*
* @param dto
*/
@Override
public Map<String, String> notificationDeliverEquipBusinessPolicyResult(QueryStationInfoDTO dto) {
//方法未实现,抛出异常
throw new UnsupportedOperationException("This method is not yet implemented");
}
/**
* 推送启动充电结果
@@ -827,7 +773,7 @@ public class HaiNanPlatformLogic extends AbsInterfaceWithPlatformLogic {
.build();
String type = ThirdPartyOperatorIdEnum.getTypeByOperatorId(dto.getOperatorId());
if (StringUtils.equals(ThirdPlatformTypeEnum.XIN_DIAN_TU.getCode(), type)) {
if (StringUtils.equals(ThirdPlatformTypeEnum.XIN_DIAN_TU.getTypeCode(), type)) {
// 如果是新电途平台,则将 startChargeSeqStat 改为 1-启动中
vo.setStartChargeSeqStat(1);
}
@@ -855,7 +801,7 @@ public class HaiNanPlatformLogic extends AbsInterfaceWithPlatformLogic {
public Map<String, String> queryEquipChargeStatus(QueryEquipChargeStatusDTO dto) {
String operatorID = dto.getOperatorID();
String type = ThirdPartyOperatorIdEnum.getTypeByOperatorId(operatorID);
String operatorName = ThirdPlatformTypeEnum.getLabelByCode(type);
String operatorName = ThirdPlatformTypeEnum.getTypeLabelByTypeCode(type);
// 通过订单号查询订单信息
OrderBasicInfo orderInfo = orderBasicInfoService.getOrderInfoByOrderCode(dto.getStartChargeSeq());
// logger.info(operatorName + "查询订单信息 orderInfo:{}", orderInfo);
@@ -1017,7 +963,7 @@ public class HaiNanPlatformLogic extends AbsInterfaceWithPlatformLogic {
vo.setFailReason(0);
String type = ThirdPartyOperatorIdEnum.getTypeByOperatorId(dto.getOperatorId());
if (StringUtils.equals(ThirdPlatformTypeEnum.XIN_DIAN_TU.getCode(), type)) {
if (StringUtils.equals(ThirdPlatformTypeEnum.XIN_DIAN_TU.getTypeCode(), type)) {
// 如果是新电途平台,则将 startChargeSeqStat 改为 3-停止中
vo.setStartChargeSeqStat(3);
}
@@ -1035,39 +981,6 @@ public class HaiNanPlatformLogic extends AbsInterfaceWithPlatformLogic {
return resultMap;
}
/**
* 充电站内充电桩空闲状态查询 query_free_pile_number
*
* @param dto
*/
@Override
public Map<String, String> queryFreePileNumber(NXJTQueryStationInfoDTO dto) {
//方法未实现,抛出异常
throw new UnsupportedOperationException("This method is not yet implemented");
}
/**
* 某车牌号消费记录查询 query_orders_info_by_Plate_number
*
* @param dto
*/
@Override
public Map<String, String> queryOrdersInfoByPlateNumber(NXJTQueryStationInfoDTO dto) {
//方法未实现,抛出异常
throw new UnsupportedOperationException("This method is not yet implemented");
}
/**
* 某段时间内消费记录查询 query_orders_info
*
* @param dto
*/
@Override
public Map<String, String> queryOrdersInfo(NXJTQueryStationInfoDTO dto) {
//方法未实现,抛出异常
throw new UnsupportedOperationException("This method is not yet implemented");
}
/**
* 推送停止充电结果
*
@@ -1114,38 +1027,4 @@ public class HaiNanPlatformLogic extends AbsInterfaceWithPlatformLogic {
return result;
}
/**
* 华为平台
* 平台充电设备编码同步 notification_operation_system_info
*
* @param orderCode
*/
@Override
public String notificationOperationSystemInfo(String orderCode) {
//方法未实现,抛出异常
throw new UnsupportedOperationException("This method is not yet implemented");
}
/**
* 推送充换电站用能统计信息 supervise_notification_operation_stats_info
*
* @param stationId
*/
@Override
public String notificationOperationStatsInfo(String stationId) {
//方法未实现,抛出异常
throw new UnsupportedOperationException("This method is not yet implemented");
}
/**
* 推送充电站历史充电订单信息 supervise_notification_charge_order_info_history
*
* @param stationId
*/
@Override
public String notificationChargeOrderInfoHistory(String stationId) {
//方法未实现,抛出异常
throw new UnsupportedOperationException("This method is not yet implemented");
}
}

View File

@@ -18,8 +18,8 @@ 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.dto.QueryStationInfoDTO;
import com.jsowell.pile.service.*;
import com.jsowell.pile.thirdparty.EquipmentInfo;
import com.jsowell.pile.vo.base.*;
import com.jsowell.pile.vo.lianlian.AccumulativeInfoVO;
@@ -31,10 +31,12 @@ 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 com.jsowell.thirdparty.platform.ThirdPartyPlatformService;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.LinkedHashMap;
@@ -42,27 +44,43 @@ import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
public class LianLianPlatformLogic extends AbsInterfaceWithPlatformLogic {
@Service
public class LianLianPlatformLogic implements ThirdPartyPlatformService {
// 平台类型
private final String platformType = ThirdPlatformTypeEnum.LIAN_LIAN_PLATFORM.getCode();
private final String platformType = ThirdPlatformTypeEnum.LIAN_LIAN_PLATFORM.getTypeCode();
@Override
public void afterPropertiesSet() throws Exception {
InterfaceWithPlatformLogicFactory.register(platformType, this);
}
@Autowired
private PileMerchantInfoService pileMerchantInfoService;
/**
* 查询运营商信息 query_operator_info
* supervise_query_operator_info
*
* @param dto 查询运营商信息DTO
* @throws UnsupportedOperationException 未实现异常
*/
@Override
public Map<String, String> queryOperatorInfo(QueryOperatorInfoDTO dto) {
//方法未实现,抛出异常
throw new UnsupportedOperationException("This method is not yet implemented");
}
@Autowired
private PileStationInfoService pileStationInfoService;
@Autowired
private PileBasicInfoService pileBasicInfoService;
@Autowired
private PileConnectorInfoService pileConnectorInfoService;
@Autowired
private PileBillingTemplateService pileBillingTemplateService;
@Autowired
private OrderBasicInfoService orderBasicInfoService;
@Autowired
private ThirdPartyPlatformConfigService thirdPartyPlatformConfigService;
@Autowired
private ThirdPartySettingInfoService thirdPartySettingInfoService;
@Resource
private ThirdPartyStationRelationService thirdPartyStationRelationService;
// @Override
// public void afterPropertiesSet() throws Exception {
// InterfaceWithPlatformLogicFactory.register(platformType, this);
// }
/**
* 查询充电站信息 query_stations_info
@@ -90,7 +108,8 @@ public class LianLianPlatformLogic extends AbsInterfaceWithPlatformLogic {
PageInfo<ThirdPartyStationInfoVO> pageInfo = new PageInfo<>(stationInfos);
for (ThirdPartyStationInfoVO pileStationInfo : pageInfo.getList()) {
StationInfo stationInfo = new StationInfo();
stationInfo.setStationID(String.valueOf(pileStationInfo.getId()));
String stationId = String.valueOf(pileStationInfo.getId());
stationInfo.setStationID(stationId);
// MerchantInfoVO merchantInfo = pileMerchantInfoService.getMerchantInfo(String.valueOf(pileStationInfo.getMerchantId()));
stationInfo.setOperatorID(Constants.OPERATORID_LIANLIAN); // 组织机构代码
stationInfo.setEquipmentOwnerID(String.valueOf(pileStationInfo.getMerchantId()));
@@ -123,7 +142,7 @@ public class LianLianPlatformLogic extends AbsInterfaceWithPlatformLogic {
stationInfo.setBarrierFlag(Integer.valueOf(pileStationInfo.getBarrierFlag()));
stationInfo.setParkingLockFlag(Integer.valueOf(pileStationInfo.getParkingLockFlag()));
List<EquipmentInfo> pileList = pileBasicInfoService.getPileList(pileStationInfo);
List<EquipmentInfo> pileList = pileBasicInfoService.getPileListForLianLian(stationId);
if (CollectionUtils.isNotEmpty(pileList)) {
stationInfo.setEquipmentInfos(pileList); // 充电设备信息列表
}
@@ -168,7 +187,7 @@ public class LianLianPlatformLogic extends AbsInterfaceWithPlatformLogic {
}
ConnectorStatusInfo connectorStatusInfo;
for (String stationId : stationIds) {
StationStatusInfo stationStatusInfo= new StationStatusInfo();
StationStatusInfo stationStatusInfo = new StationStatusInfo();
stationStatusInfo.setStationId(stationId);
// 根据站点id查询
List<ConnectorInfoVO> list = pileConnectorInfoService.getConnectorListForLianLian(Long.parseLong(stationId));
@@ -183,7 +202,7 @@ public class LianLianPlatformLogic extends AbsInterfaceWithPlatformLogic {
continue;
}
List<RealTimeMonitorData> chargingRealTimeData = orderBasicInfoService.getChargingRealTimeData(orderBasicInfo.getTransactionCode());
if(CollectionUtils.isNotEmpty(chargingRealTimeData)) {
if (CollectionUtils.isNotEmpty(chargingRealTimeData)) {
RealTimeMonitorData realTimeMonitorData = chargingRealTimeData.get(0);
info.setStartChargeSeq(orderBasicInfo.getOrderCode());
@@ -342,141 +361,6 @@ public class LianLianPlatformLogic extends AbsInterfaceWithPlatformLogic {
return resultMap;
}
/**
* 查询充电电量信息 query_order_info
*
* @param orderCode
* @throws UnsupportedOperationException 未实现异常
*/
@Override
public Map<String, String> queryOrderInfo(String orderCode) {
//方法未实现,抛出异常
throw new UnsupportedOperationException("This method is not yet implemented");
}
/**
* 请求设备认证 query_equip_auth
* 业务信息交换
*
* @param dto 联联平台请求设备认证
* @throws UnsupportedOperationException 未实现异常
*/
@Override
public Map<String, String> queryEquipAuth(QueryEquipmentDTO dto) {
//方法未实现,抛出异常
throw new UnsupportedOperationException("This method is not yet implemented");
}
/**
* 请求启动充电 query_start_charge
*
* @param dto 请求启动充电DTO
* @throws UnsupportedOperationException 未实现异常
*/
@Override
public Map<String, String> queryStartCharge(QueryStartChargeDTO dto) {
//方法未实现,抛出异常
throw new UnsupportedOperationException("This method is not yet implemented");
}
/**
* 查询充电状态 query_equip_charge_status
*
* @param dto 查询充电状态DTO
* @throws UnsupportedOperationException 未实现异常
*/
@Override
public Map<String, String> queryEquipChargeStatus(QueryEquipChargeStatusDTO dto) {
//方法未实现,抛出异常
throw new UnsupportedOperationException("This method is not yet implemented");
}
/**
* 请求停止充电 query_stop_charge
*
* @param dto 请求启动充电DTO
* @throws UnsupportedOperationException 未实现异常
*/
@Override
public Map<String, String> queryStopCharge(QueryStartChargeDTO dto) {
//方法未实现,抛出异常
throw new UnsupportedOperationException("This method is not yet implemented");
}
/**
* 充电站内充电桩空闲状态查询 query_free_pile_number
*
* @param dto
* @throws UnsupportedOperationException 未实现异常
*/
@Override
public Map<String, String> queryFreePileNumber(NXJTQueryStationInfoDTO dto) {
//方法未实现,抛出异常
throw new UnsupportedOperationException("This method is not yet implemented");
}
/**
* 某车牌号消费记录查询 query_orders_info_by_Plate_number
*
* @param dto
* @throws UnsupportedOperationException 未实现异常
*/
@Override
public Map<String, String> queryOrdersInfoByPlateNumber(NXJTQueryStationInfoDTO dto) {
//方法未实现,抛出异常
throw new UnsupportedOperationException("This method is not yet implemented");
}
/**
* 某段时间内消费记录查询 query_orders_info
*
* @param dto
* @throws UnsupportedOperationException 未实现异常
*/
@Override
public Map<String, String> queryOrdersInfo(NXJTQueryStationInfoDTO dto) {
//方法未实现,抛出异常
throw new UnsupportedOperationException("This method is not yet implemented");
}
/**
* 查询业务策略信息结果
* 请求计费策略 request_equip_business_policy
*
* @param dto 请求启动充电DTO
* @throws UnsupportedOperationException 未实现异常
*/
@Override
public Map<String, String> queryEquipBusinessPolicy(QueryStartChargeDTO dto) {
//方法未实现,抛出异常
throw new UnsupportedOperationException("This method is not yet implemented");
}
/**
* VIN码充电 insert_start_charge
* 华为平台
*
* @param dto
* @throws UnsupportedOperationException 未实现异常
*/
@Override
public Map<String, String> insertStartCharge(QueryStationInfoDTO dto) {
//方法未实现,抛出异常
throw new UnsupportedOperationException("This method is not yet implemented");
}
/**
* 下发计费策略响应 notification_deliver_equip_business_policy_result
* 华为平台
*
* @param dto
* @throws UnsupportedOperationException 未实现异常
*/
@Override
public Map<String, String> notificationDeliverEquipBusinessPolicyResult(QueryStationInfoDTO dto) {
//方法未实现,抛出异常
throw new UnsupportedOperationException("This method is not yet implemented");
}
/**
* 充电站信息变化推送 notification_stationInfo
@@ -541,11 +425,11 @@ public class LianLianPlatformLogic extends AbsInterfaceWithPlatformLogic {
info.setAreaCode(subAreaCode);
// 截取运营商组织机构代码(去除最后一位后的最后九位)
String organizationCode = "";
if (StringUtils.equals(ThirdPlatformTypeEnum.LIAN_LIAN_PLATFORM.getCode(), platformType)) {
if (StringUtils.equals(ThirdPlatformTypeEnum.LIAN_LIAN_PLATFORM.getTypeCode(), platformType)) {
// 联联平台先使用自己运营商的组织机构代码
organizationCode = Constants.OPERATORID_LIANLIAN;
info.setEquipmentOwnerID(organizationCode);
}else {
} else {
MerchantInfoVO merchantInfo = pileMerchantInfoService.getMerchantInfoVO(String.valueOf(pileStationInfo.getMerchantId()));
organizationCode = merchantInfo.getOrganizationCode();
if (StringUtils.isNotBlank(organizationCode) && organizationCode.length() == 18) {
@@ -576,7 +460,7 @@ public class LianLianPlatformLogic extends AbsInterfaceWithPlatformLogic {
if (StringUtils.isNotBlank(String.valueOf(pileStationInfo.getCapacity()))) {
info.setCapacity(pileStationInfo.getCapacity().setScale(4, BigDecimal.ROUND_HALF_UP));
}
List<EquipmentInfo> pileList = pileBasicInfoService.getPileList(pileStationInfo);
List<EquipmentInfo> pileList = pileBasicInfoService.getPileListForLianLian(stationId);
if (CollectionUtils.isNotEmpty(pileList)) {
info.setEquipmentInfos(pileList); // 充电设备信息列表
}
@@ -884,105 +768,5 @@ public class LianLianPlatformLogic extends AbsInterfaceWithPlatformLogic {
return result;
}
/**
* 充电订单推送 notification_charge_order_info
* TODO 海南一张网文档中的接口检查一下是否和订单信息推送notification_orderInfo一致
* TODO 甬城泊车平台文档中的接口检查一下是否和订单信息推送notification_orderInfo一致
* TODO 华为平台文档中的接口检查一下是否和订单信息推送notification_orderInfo一致
* TODO 内蒙古平台文档中的接口检查一下是否和订单信息推送notification_orderInfo一致
*
* @param orderCode 订单编号
* @throws UnsupportedOperationException 未实现异常
*/
@Override
public String notificationChargeOrderInfo(String orderCode) {
//方法未实现,抛出异常
throw new UnsupportedOperationException("This method is not yet implemented");
}
/**
* 告警信息推送 notification_alarmInfo
*
* @throws UnsupportedOperationException 未实现异常
*/
@Override
public String notificationAlarmInfo() {
//方法未实现,抛出异常
throw new UnsupportedOperationException("This method is not yet implemented");
}
/**
* 推送启动充电结果 notification_start_charge_result
*
* @param orderCode 订单编号
* @throws UnsupportedOperationException 未实现异常
*/
@Override
public String notificationStartChargeResult(String orderCode) {
//方法未实现,抛出异常
throw new UnsupportedOperationException("This method is not yet implemented");
}
/**
* 推送充电状态 notification_equip_charge_status
* 推送充电状态信息 supervise_notification_equip_charge_status
*
* @param orderCode 订单编号
* @throws UnsupportedOperationException 未实现异常
*/
@Override
public String notificationEquipChargeStatus(String orderCode) throws UnsupportedOperationException {
//方法未实现,抛出异常
throw new UnsupportedOperationException("This method is not yet implemented");
}
/**
* 推送停止充电结果 notification_stop_charge_result
*
* @param orderCode 订单编号
* @throws UnsupportedOperationException 未实现异常
*/
@Override
public String notificationStopChargeResult(String orderCode) {
//方法未实现,抛出异常
throw new UnsupportedOperationException("This method is not yet implemented");
}
/**
* 华为平台
* 平台充电设备编码同步 notification_operation_system_info
*
* @param orderCode
* @throws UnsupportedOperationException 未实现异常
*/
@Override
public String notificationOperationSystemInfo(String orderCode) {
//方法未实现,抛出异常
throw new UnsupportedOperationException("This method is not yet implemented");
}
/**
* 推送充换电站用能统计信息 supervise_notification_operation_stats_info
*
* @param stationId
* @throws UnsupportedOperationException 未实现异常
*/
@Override
public String notificationOperationStatsInfo(String stationId) {
//方法未实现,抛出异常
throw new UnsupportedOperationException("This method is not yet implemented");
}
/**
* 推送充电站历史充电订单信息 supervise_notification_charge_order_info_history
*
* @param stationId
* @throws UnsupportedOperationException 未实现异常
*/
@Override
public String notificationChargeOrderInfoHistory(String stationId) {
//方法未实现,抛出异常
throw new UnsupportedOperationException("This method is not yet implemented");
}
}

View File

@@ -5,17 +5,21 @@ import com.jsowell.pile.dto.*;
import com.jsowell.pile.dto.ningxiajiaotou.NXJTQueryStationInfoDTO;
import com.jsowell.thirdparty.platform.AbsInterfaceWithPlatformLogic;
import com.jsowell.thirdparty.platform.InterfaceWithPlatformLogicFactory;
import org.springframework.stereotype.Service;
import java.util.Map;
/**
* 内蒙古监测平台逻辑
*/
@Service
public class NeiMengGuPlatformLogic extends AbsInterfaceWithPlatformLogic {
// 平台类型
private final String platformType = ThirdPlatformTypeEnum.NEI_MENG_GU_PLATFORM.getTypeCode();
@Override
public void afterPropertiesSet() throws Exception {
InterfaceWithPlatformLogicFactory.register(ThirdPlatformTypeEnum.NEI_MENG_GU_PLATFORM.getCode(), this);
InterfaceWithPlatformLogicFactory.register(platformType, this);
}
/**

View File

@@ -1,9 +1,6 @@
package com.jsowell.thirdparty.xindiantu.service.impl;
import com.jsowell.common.enums.thirdparty.ThirdPartyOperatorIdEnum;
import com.jsowell.common.enums.thirdparty.ThirdPlatformTypeEnum;
import com.jsowell.common.util.StringUtils;
import com.jsowell.pile.domain.PileStationInfo;
import com.jsowell.pile.domain.ThirdPartyStationRelation;
import com.jsowell.pile.dto.*;
import com.jsowell.pile.service.PileStationInfoService;
@@ -80,7 +77,7 @@ public class XDTServiceImpl implements XDTService {
public Map<String, String> queryStationsInfo(QueryStationInfoDTO dto) {
// 查询出要查询的充电站id并set进 dto 的stationIds
ThirdPartyStationRelation relation = new ThirdPartyStationRelation();
relation.setThirdPartyType(ThirdPlatformTypeEnum.XIN_DIAN_TU.getCode());
relation.setThirdPartyType(ThirdPlatformTypeEnum.XIN_DIAN_TU.getTypeCode());
List<ThirdPartyStationRelation> xdtList = relationService.selectThirdPartyStationRelationList(relation);
if (CollectionUtils.isNotEmpty(xdtList)) {
List<String> stationList = xdtList.stream()

View File

@@ -157,7 +157,7 @@ public class YCBCServiceImpl implements YCBCService {
public Map<String, String> queryStationsInfo(QueryStationInfoDTO dto) {
// 查询出要查询的充电站id并set进 dto 的stationIds
ThirdPartyStationRelation relation = new ThirdPartyStationRelation();
relation.setThirdPartyType(ThirdPlatformTypeEnum.YONG_CHENG_BO_CHE.getCode());
relation.setThirdPartyType(ThirdPlatformTypeEnum.YONG_CHENG_BO_CHE.getTypeCode());
List<ThirdPartyStationRelation> ycbcList = relationService.selectThirdPartyStationRelationList(relation);
if (CollectionUtils.isNotEmpty(ycbcList)) {
List<String> stationList = ycbcList.stream()

View File

@@ -1,40 +0,0 @@
package com.jsowell.thirdparty.zhongdianlian.domain;
import com.alibaba.fastjson2.annotation.JSONField;
import lombok.Data;
import java.math.BigDecimal;
/**
* TODO
*
* @author Lemon
* @Date 2023/9/7 14:03
*/
@Data
public class ZDLConnectorInfo {
@JSONField(name = "ConnectorID")
private String connectorId;
@JSONField(name = "ConnectorType")
private Integer connectorType;
@JSONField(name = "VoltageUpperLimits")
private Integer voltageUpperLimits;
@JSONField(name = "VoltageLowerLimits")
private Integer voltageLowerLimits;
@JSONField(name = "Current")
private Integer current;
@JSONField(name = "ParkNo")
private String parkNo;
@JSONField(name = "Power")
private BigDecimal power;
@JSONField(name = "NationalStandard")
private Integer nationalStandard;
}

View File

@@ -1,28 +0,0 @@
package com.jsowell.thirdparty.zhongdianlian.domain;
import com.alibaba.fastjson2.annotation.JSONField;
import lombok.Data;
import java.math.BigDecimal;
import java.util.List;
/**
* 设备基本信息
*
* @author Lemon
* @Date 2023/9/5 15:16
*/
@Data
public class ZDLEquipmentInfo {
@JSONField(name = "EquipmentID")
private String equipmentId;
@JSONField(name = "EquipmentType")
private Integer equipmentType;
@JSONField(name = "Power")
private BigDecimal power;
@JSONField(name = "ConnectorInfos")
private List<ZDLConnectorInfo> connectorInfos;
}

View File

@@ -1,73 +0,0 @@
package com.jsowell.thirdparty.zhongdianlian.domain;
import com.alibaba.fastjson2.annotation.JSONField;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.math.BigDecimal;
import java.util.List;
/**
* 站点基本信息
*
* @author Lemon
* @Date 2023/9/5 14:10
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class ZDLStationInfo {
@JSONField(name = "StationID")
private String stationId;
@JSONField(name = "OperatorID")
private String operatorId;
@JSONField(name = "EquipmentOwnerID")
private String equipmentOwnerId;
@JSONField(name = "StationName")
private String stationName;
@JSONField(name = "CountryCode")
private String countryCode;
@JSONField(name = "AreaCode")
private String areaCode;
@JSONField(name = "Address")
private String address;
@JSONField(name = "ServiceTel")
private String serviceTel;
@JSONField(name = "StationType")
private Integer stationType;
@JSONField(name = "StationStatus")
private Integer stationStatus;
@JSONField(name = "ParkNums")
private Integer parkNums;
@JSONField(name = "StationLng")
private BigDecimal stationLng;
@JSONField(name = "StationLat")
private BigDecimal stationLat;
@JSONField(name = "Construction")
private Integer construction;
@JSONField(name = "ParkFee")
private String parkFee;
@JSONField(name = "Pictures")
private List<String> pictures;
@JSONField(name = "EquipmentInfos")
private List<ZDLEquipmentInfo> equipmentInfos;
}

View File

@@ -27,9 +27,9 @@ import com.jsowell.thirdparty.lianlian.util.GBSignUtils;
import com.jsowell.thirdparty.lianlian.util.HttpRequestUtil;
import com.jsowell.thirdparty.yongchengboche.dto.YCBCGetTokenDTO;
import com.jsowell.thirdparty.yongchengboche.service.YCBCService;
import com.jsowell.thirdparty.zhongdianlian.domain.ZDLConnectorInfo;
import com.jsowell.thirdparty.zhongdianlian.domain.ZDLEquipmentInfo;
import com.jsowell.thirdparty.zhongdianlian.domain.ZDLStationInfo;
import com.jsowell.pile.thirdparty.ZDLConnectorInfo;
import com.jsowell.pile.thirdparty.ZDLEquipmentInfo;
import com.jsowell.pile.thirdparty.ZDLStationInfo;
import com.jsowell.thirdparty.zhongdianlian.dto.ZDLGetTokenDTO;
import com.jsowell.thirdparty.zhongdianlian.service.ZDLService;
import org.apache.commons.collections4.CollectionUtils;
@@ -172,7 +172,7 @@ public class ZDLServiceImpl implements ZDLService {
// 获取令牌
String token = "";
String result = "";
if (StringUtils.equals(ThirdPlatformTypeEnum.YONG_CHENG_BO_CHE.getCode(), thirdPartyType)) {
if (StringUtils.equals(ThirdPlatformTypeEnum.YONG_CHENG_BO_CHE.getTypeCode(), thirdPartyType)) {
YCBCGetTokenDTO ycbcGetTokenDTO = new YCBCGetTokenDTO();
ycbcGetTokenDTO.setOperatorId(operatorId);
ycbcGetTokenDTO.setDataSecret(dataSecret);
@@ -261,7 +261,7 @@ public class ZDLServiceImpl implements ZDLService {
// 获取令牌
String token = "";
String result = "";
if (StringUtils.equals(ThirdPlatformTypeEnum.YONG_CHENG_BO_CHE.getCode(), dto.getThirdPartyType())) {
if (StringUtils.equals(ThirdPlatformTypeEnum.YONG_CHENG_BO_CHE.getTypeCode(), dto.getThirdPartyType())) {
YCBCGetTokenDTO ycbcGetTokenDTO = new YCBCGetTokenDTO();
ycbcGetTokenDTO.setOperatorId(operatorId);
ycbcGetTokenDTO.setDataSecret(dataSecret);