This commit is contained in:
Lemon
2024-08-08 14:04:39 +08:00
18 changed files with 754 additions and 272 deletions

View File

@@ -29,7 +29,7 @@ public class NingXiaController extends ThirdPartyBaseController {
private final String platformName = "宁夏平台";
@Autowired
@Qualifier("ninaXiaPlatformServiceImpl")
@Qualifier("ningXiaPlatformServiceImpl")
private ThirdPartyPlatformService platformLogic;
/**

View File

@@ -3,7 +3,6 @@ package com.jsowell.api.thirdparty;
import com.alibaba.fastjson2.JSON;
import com.alibaba.fastjson2.JSONObject;
import com.jsowell.common.annotation.Anonymous;
import com.jsowell.common.core.controller.BaseController;
import com.jsowell.common.enums.thirdparty.ThirdPlatformTypeEnum;
import com.jsowell.common.exception.BusinessException;
import com.jsowell.common.response.RestApiResponse;
@@ -36,7 +35,7 @@ import java.util.Map;
@Anonymous
@RestController
@RequestMapping("/qinghai/evcs")
public class QingHaiController extends BaseController {
public class QingHaiController extends ThirdPartyBaseController {
@Autowired
@Qualifier("qingHaiPlatformServiceImpl")

View File

@@ -28,30 +28,9 @@ import java.util.Map;
@RestController
public class ThirdPartyBaseController extends BaseController {
// @Autowired
// @Qualifier("zhongDianLianPlatformServiceImpl")
// private ThirdPartyPlatformService platformLogic;
@Autowired
private ThirdpartySecretInfoService thirdpartySecretInfoService;
/**
* 获取token接口
* http://localhost:8080/query_token
*/
// @PostMapping("/query_token")
// public CommonResult<?> queryToken(@RequestBody CommonParamsDTO dto) {
// logger.info("平台请求令牌 params:{}", JSON.toJSONString(dto));
// try {
// Map<String, String> map = platformLogic.queryToken(dto);
// logger.info("平台请求令牌 result:{}", JSON.toJSONString(map));
// return CommonResult.success(0, "请求令牌成功!", map.get("Data"), map.get("Sig"));
// } catch (Exception e) {
// logger.error("平台请求令牌接口 异常", e);
// return CommonResult.failed("获取token发生异常");
// }
// }
/**
* 验证token
*/
@@ -94,7 +73,6 @@ public class ThirdPartyBaseController extends BaseController {
// 校验是否有operatorId, 没有就set
verifyOperatorId(dto, t);
return t;
}
@@ -146,7 +124,7 @@ public class ThirdPartyBaseController extends BaseController {
/**
* 使用反射获取字段值
*/
private <T> Object getFieldValueByObject(T t, String targetFieldName) throws NoSuchFieldException, IllegalAccessException {
private <T> Object getFieldValueByObject(T t, String targetFieldName) {
// 获取该对象的class
Class<? extends Object> tClass = t.getClass();
// 获取所有的属性数组
@@ -165,16 +143,13 @@ public class ThirdPartyBaseController extends BaseController {
* 举例: @JsonProperty("roleIds")
* private String roleIds;
*/
try {
boolean has_JsonProperty = field.isAnnotationPresent(JsonProperty.class);
if (has_JsonProperty) {
currentFieldName = field.getAnnotation(JsonProperty.class).value();
} else {
currentFieldName = field.getName();
}
// 忽略大小写对比
if (currentFieldName.equalsIgnoreCase(targetFieldName)) {
field.setAccessible(true);
@@ -183,7 +158,6 @@ public class ThirdPartyBaseController extends BaseController {
Method m = tClass.getMethod("get" + currentFieldName);
return m.invoke(t);
}
} catch (SecurityException e) {
// 安全性异常
e.printStackTrace();
@@ -197,7 +171,6 @@ public class ThirdPartyBaseController extends BaseController {
throw new RuntimeException(e);
}
}
return null;
}
@@ -215,7 +188,6 @@ public class ThirdPartyBaseController extends BaseController {
}
// 校验签名,使用响应方的密钥
String signSecret = secretInfoVO.getOurSigSecret();
Map<String, String> map = Maps.newLinkedHashMap();
String operatorID = dto.getOperatorID();
if (StringUtils.isNotBlank(operatorID)) {
@@ -237,7 +209,6 @@ public class ThirdPartyBaseController extends BaseController {
if (StringUtils.isNotBlank(seq)) {
map.put("Seq", seq);
}
// 计算sign
String sign = GBSignUtils.sign(map, signSecret);
return StringUtils.equals(dto.getSig(), sign);

View File

@@ -105,6 +105,7 @@ public class YCBCController extends BaseController {
String dataString = resultMap.get("Data");
String dataSecret = resultMap.get("DataSecret");
String dataSecretIV = resultMap.get("DataSecretIV");
// 解密data
byte[] plainText = Cryptos.aesDecrypt(Encodes.decodeBase64(dataString), dataSecret.getBytes(), dataSecretIV.getBytes());
String dataStr = new String(plainText, StandardCharsets.UTF_8);

View File

@@ -0,0 +1,154 @@
package com.jsowell.api.thirdparty;
import com.alibaba.fastjson2.JSON;
import com.jsowell.common.annotation.Anonymous;
import com.jsowell.common.enums.thirdparty.ThirdPartyReturnCodeEnum;
import com.jsowell.common.exception.BusinessException;
import com.jsowell.pile.dto.QueryOperatorInfoDTO;
import com.jsowell.pile.dto.QueryStationInfoDTO;
import com.jsowell.pile.thirdparty.CommonParamsDTO;
import com.jsowell.thirdparty.lianlian.common.CommonResult;
import com.jsowell.thirdparty.platform.service.ThirdPartyPlatformService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
import java.util.Map;
/**
* 浙江省平台
*/
@Anonymous
@RestController
@RequestMapping("/zj")
public class ZheJiangController extends ThirdPartyBaseController {
private final String platformName = "浙江省平台";
@Autowired
@Qualifier("zheJiangPlatformServiceImpl")
private ThirdPartyPlatformService platformLogic;
/**
* getToken
*/
@PostMapping("/v1/query_token")
public CommonResult<?> queryToken(@RequestBody CommonParamsDTO dto) {
// logger.info("{}-请求令牌 params:{}", platformName, JSON.toJSONString(dto));
try {
Map<String, String> map = platformLogic.queryToken(dto);
logger.info("{}-请求令牌, params:{}, result:{}", platformName, JSON.toJSONString(dto), JSON.toJSONString(map));
return CommonResult.success(0, "请求令牌成功!", map.get("Data"), map.get("Sig"));
} catch (Exception e) {
logger.error("{}-获取token接口, 异常, params:{}", platformName, JSON.toJSONString(dto));
return CommonResult.failed("获取token发生异常");
}
}
/**
* 查询充电站信息
* supervise_query_stations_info
*/
@PostMapping("/v1/supervise_query_stations_info")
public CommonResult<?> query_stations_info(HttpServletRequest request, @RequestBody CommonParamsDTO dto) {
logger.info("{}-查询充电站信息 params:{}", platformName, JSON.toJSONString(dto));
try {
// 校验令牌
if (!verifyToken(request.getHeader("Authorization"))) {
// 校验失败
return CommonResult.failed(ThirdPartyReturnCodeEnum.TOKEN_ERROR);
}
// 校验签名
if (!verifySignature(dto)) {
// 签名错误
return CommonResult.failed(ThirdPartyReturnCodeEnum.SIGN_ERROR);
}
// 解析入参
QueryStationInfoDTO queryStationInfoDTO = parseParamsDTO(dto, QueryStationInfoDTO.class);
// 执行逻辑
Map<String, String> map = platformLogic.queryStationsInfo(queryStationInfoDTO);
return CommonResult.success(0, "查询充电站信息成功!", map.get("Data"), map.get("Sig"));
} catch (Exception e) {
logger.info("{}-查询充电站信息 error:", platformName, e);
}
return CommonResult.failed("查询充电站信息发生异常");
}
/**
* 查询运营商信息
* supervise_query_operator_info
*/
@PostMapping("/v1/supervise_query_operator_info")
public CommonResult<?> queryOperatorInfo(HttpServletRequest request, @RequestBody CommonParamsDTO dto) {
logger.info("{}-查询运营商信息 params:{}", platformName, JSON.toJSONString(dto));
try {
// 校验令牌
boolean verifyToken = verifyToken(request.getHeader("Authorization"));
if (!verifyToken) {
// 校验失败
return CommonResult.failed(ThirdPartyReturnCodeEnum.TOKEN_ERROR);
}
// 校验签名
if (!verifySignature(dto)) {
// 签名错误
return CommonResult.failed(ThirdPartyReturnCodeEnum.SIGN_ERROR);
}
// 解析入参
QueryOperatorInfoDTO paramDTO = parseParamsDTO(dto, QueryOperatorInfoDTO.class);
// 执行逻辑
Map<String, String> map = platformLogic.queryOperatorInfo(paramDTO);
logger.info("{}-查询运营商信息 result:{}", platformName, JSON.toJSONString(map));
return CommonResult.success(0, "操作成功!", map.get("Data"), map.get("Sig"));
} catch (BusinessException e) {
return CommonResult.failed(Integer.parseInt(e.getCode()), e.getMessage());
} catch (Exception e) {
logger.error("{}-查询运营商信息 异常", platformName, e);
return CommonResult.failed("查询运营商信息发生异常");
}
}
/**
* 查询充电站状态信息
* supervise_query_station_status
*/
@PostMapping("/v1/supervise_query_station_status")
public CommonResult<?> queryStationStatus(HttpServletRequest request, @RequestBody CommonParamsDTO dto) {
logger.info("{}-查询充电站状态信息 params:{}", platformName, JSON.toJSONString(dto));
try {
// 校验令牌
if (!verifyToken(request.getHeader("Authorization"))) {
// 校验失败
return CommonResult.failed(ThirdPartyReturnCodeEnum.TOKEN_ERROR);
}
// 校验签名
if (!verifySignature(dto)) {
// 签名错误
return CommonResult.failed(ThirdPartyReturnCodeEnum.SIGN_ERROR);
}
// 解析入参
QueryStationInfoDTO queryStationInfoDTO = parseParamsDTO(dto, QueryStationInfoDTO.class);
// 执行逻辑
Map<String, String> map = platformLogic.queryStationStatus(queryStationInfoDTO);
return CommonResult.success(0, "查询充电站状态信息成功!", map.get("Data"), map.get("Sig"));
} catch (Exception e) {
logger.error("{}-查询充电站状态信息 error:", platformName, e);
}
return CommonResult.failed("查询充电站状态信息发生异常");
}
}

View File

@@ -0,0 +1,65 @@
package com.jsowell.pile.thirdparty.publicinfo;
import com.alibaba.fastjson2.annotation.JSONField;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* 公共信息对象-基础设施运营商信息
* 中电联协议定义
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class BaseOperatorInfo {
/**
* 运营商ID Y
* 组织机构代码
* 9字符
*/
@JSONField(name = "OperatorID")
private String operatorID;
/**
* 运营商名称 Y
* 机构全称
* <=64字符
*/
@JSONField(name = "OperatorName")
private String operatorName;
/**
* 运营商电话1 Y
* 运营商客服电话1
* <=32字符
*/
@JSONField(name = "OperatorTel1")
private String operatorTel1;
/**
* 运营商电话2 N
* 运营商客服电话2
* <=32字符
*/
@JSONField(name = "OperatorTel2")
private String operatorTel2;
/**
* 运营商注册地址 N
* 运营商注册地址
* <=64字符
*/
@JSONField(name = "OperatorRegAddress")
private String operatorRegAddress;
/**
* 备注 N
* 备注信息
* <=255字符
*/
@JSONField(name = "OperatorNote")
private String operatorNote;
}

View File

@@ -0,0 +1,259 @@
package com.jsowell.pile.thirdparty.publicinfo;
import com.alibaba.fastjson2.annotation.JSONField;
import com.jsowell.pile.thirdparty.EquipmentInfo;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;
import java.math.BigDecimal;
import java.util.List;
/**
* 公共信息对象-充电站信息
* 中电联协议定义
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
@SuperBuilder
public class BaseStationInfo {
/**
* 充电站ID Y
* 对接平台自定义的唯一编码
* <=20字符
*/
@JSONField(name = "StationID")
private String stationID;
/**
* 运营商ID Y
* 运营商ID
* 9字符
*/
@JSONField(name = "OperatorID")
private String operatorID;
/**
* 设备所属运营商ID Y
* 设备所属运营商组织机构代码
* 9字符
*/
@JSONField(name = "EquipmentOwnerID")
private String equipmentOwnerID;
/**
* 充电站名称 Y
* 充电站名称的描述
* <=50字符
*/
@JSONField(name = "StationName")
private String stationName;
/**
* 充电站国家代码 Y
* 比如CN
* 2字符
*/
@JSONField(name = "CountryCode")
private String countryCode;
/**
* 充电站省市辖区编码 Y
* 填写内容为参照GB/T 2260-2007
* 20字符
*/
@JSONField(name = "AreaCode")
private String areaCode;
/**
* 详细地址 Y
* <=50字符
*/
@JSONField(name = "Address")
private String address;
/**
* 站点电话 Y
* 能够联系场站工作人员进行协助的联系电话
* <=30字符
*/
@JSONField(name = "StationTel")
private String stationTel;
/**
* 服务电话 Y
* 平台服务电话,例如400的电话
* <=30字符
*/
@JSONField(name = "ServiceTel")
private String serviceTel;
/**
* 站点类型 Y
* 1-公共
* 50-个人
* 100-公交(专用)
* 101-环卫(专用)
* 102-物流(专用)
* 103-出租车(专用)
* 104-分时租赁(专用)
* 105-小区共享(专用)
* 106-单位(专用)
* 255-其他
*/
@JSONField(name = "StationType")
private Integer stationType;
/**
* 站点状态 Y
* 0未知
* 1建设中
* 5关闭下线
* 6维护中
* 50正常使用
*/
@JSONField(name = "StationStatus")
private Integer stationStatus;
/**
* 车位数量 Y
* 可停放进行充电的车位总数(默认0-未知)
*/
@JSONField(name = "ParkNums")
private int parkNums;
/**
* 经度 Y
* GCJ-02坐标系
* 保留小数点后6位
*/
@JSONField(name = "StationLng")
private BigDecimal stationLng;
/**
* 纬度 Y
* GCJ-02坐标系
* 保留小数点后6位
*/
@JSONField(name = "StationLat")
private BigDecimal stationLat;
/**
* 站点引导 N
* 描述性文字,用于引导车主找到充电车位
* <=100字符
*/
@JSONField(name = "SiteGuide")
private String siteGuide;
/**
* 建设场所 Y
* 1居民区
* 2公共机构
* 3企事业单位
* 4写字楼
* 5工业园区
* 6交通枢纽
* 7大型文体设施
* 8城市绿地
* 9大型建筑配建停车场
* 10路边停车位
* 11城际高速服务区
* 12风景区
* 13公交场站
* 14加油加气站
* 15出租车
* 255其他
*/
@JSONField(name = "Construction")
private Integer construction;
/**
* 站点照片 N
* 充电设备照片、充电车位照片、停车场入口照片
*/
@JSONField(name = "Pictures")
private List<String> pictures;
/**
* 使用车型描述 N
* 描述该站点接受的车大小以及类型,如大巴、物流车、私家乘用车、出租车等
* <=100字符
*/
@JSONField(name = "MatchCars")
private String matchCars;
/**
* 车位楼层及数量描述 N
* 车位楼层以及数量信息
* <=100字符
*/
@JSONField(name = "ParkInfo")
private String parkInfo;
/**
* 营业时间 N
* 营业时间描述,推荐格式周一至周日00:00-24:00
* <=100字符
*/
@JSONField(name = "BusineHours")
private String busineHours;
/**
* 充电电费率 N
* 充电费描述,推荐格式XX 元/度
* <=256字符
*/
@JSONField(name = "ElectricityFee")
private String electricityFee;
/**
* 服务费率 N
* 服务费率描述,推荐格式XX 元/度
* <=100字符
*/
@JSONField(name = "ServiceFee")
private String serviceFee;
/**
* 停车费 N
* 停车费率描述
* <=100字符
*/
@JSONField(name = "ParkFree")
private Integer parkFree;
/**
* 支付方式 N
* 支付方式:刷卡、线上、现金 其中电子钱包类卡为刷卡,身份鉴权卡、微信/ 支付宝、APP为线上
* <=20字符
*/
@JSONField(name = "Payment")
private String payment;
/**
* 是否支持预约 N
* 充电设备是否需要提前预约后才能使用。(0-不支持预约;1-支持预约) 不填默认为0
*/
@JSONField(name = "SupportOrder")
private int supportOrder;
/**
* 备注 N
* 其他备注信息
* <=100字符
*/
@JSONField(name = "Remark")
private String remark;
/**
* 充电设备信息列表 Y
* 该充电站所有充电设备信息对象集合
*/
@JSONField(name = "EquipmentInfos")
private List<EquipmentInfo> equipmentInfos;
}

View File

@@ -36,7 +36,7 @@ import com.jsowell.thirdparty.platform.service.impl.DianXingPlatformServiceImpl;
import com.jsowell.thirdparty.platform.service.impl.HaiNanPlatformServiceImpl;
import com.jsowell.thirdparty.huawei.HuaWeiService;
import com.jsowell.thirdparty.lianlian.service.LianLianService;
import com.jsowell.thirdparty.platform.service.impl.NinaXiaPlatformServiceImpl;
import com.jsowell.thirdparty.platform.service.impl.NingXiaPlatformServiceImpl;
import com.jsowell.thirdparty.platform.service.impl.QingHaiPlatformServiceImpl;
import com.jsowell.thirdparty.platform.util.HttpRequestUtil;
import com.jsowell.thirdparty.lutongyunting.service.LTYTService;
@@ -48,7 +48,6 @@ import com.jsowell.thirdparty.yongchengboche.dto.YCBCGetTokenDTO;
import com.jsowell.thirdparty.yongchengboche.service.YCBCService;
import com.jsowell.thirdparty.zhongdianlian.service.ZDLService;
import lombok.extern.slf4j.Slf4j;
import lombok.val;
import org.apache.commons.collections4.CollectionUtils;
import org.bouncycastle.crypto.CryptoException;
import org.springframework.beans.factory.annotation.Autowired;
@@ -123,7 +122,7 @@ public class CommonService {
private QingHaiPlatformServiceImpl qingHaiPlatformService;
@Autowired
private NinaXiaPlatformServiceImpl ninaXiaPlatformService;
private NingXiaPlatformServiceImpl ninaXiaPlatformService;
@Autowired
private DianXingPlatformServiceImpl dianXingPlatformService;

View File

@@ -9,8 +9,6 @@ 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;
@@ -30,6 +28,9 @@ import com.jsowell.pile.domain.*;
import com.jsowell.pile.domain.ykcCommond.StartChargingCommand;
import com.jsowell.pile.dto.*;
import com.jsowell.pile.service.*;
import com.jsowell.pile.thirdparty.CommonParamsDTO;
import com.jsowell.pile.thirdparty.ConnectorInfo;
import com.jsowell.pile.thirdparty.EquipmentInfo;
import com.jsowell.pile.util.MerchantUtils;
import com.jsowell.pile.vo.base.*;
import com.jsowell.pile.vo.lianlian.AccumulativeInfoVO;
@@ -40,8 +41,8 @@ import com.jsowell.pile.vo.web.PileModelInfoVO;
import com.jsowell.pile.vo.web.PileStationVO;
import com.jsowell.thirdparty.common.CommonService;
import com.jsowell.thirdparty.lianlian.domain.*;
import com.jsowell.pile.thirdparty.CommonParamsDTO;
import com.jsowell.thirdparty.lianlian.service.LianLianService;
import com.jsowell.thirdparty.lianlian.vo.*;
import com.jsowell.thirdparty.platform.common.ChargeDetail;
import com.jsowell.thirdparty.platform.common.OrderInfo;
import com.jsowell.thirdparty.platform.common.StationInfo;
@@ -49,7 +50,6 @@ import com.jsowell.thirdparty.platform.util.Cryptos;
import com.jsowell.thirdparty.platform.util.Encodes;
import com.jsowell.thirdparty.platform.util.GBSignUtils;
import com.jsowell.thirdparty.platform.util.HttpRequestUtil;
import com.jsowell.thirdparty.lianlian.vo.*;
import com.jsowell.thirdparty.yongchengboche.dto.YCBCGetTokenDTO;
import com.jsowell.thirdparty.yongchengboche.service.YCBCService;
import org.apache.commons.collections4.CollectionUtils;

View File

@@ -3,33 +3,35 @@ package com.jsowell.thirdparty.platform.common;
import com.alibaba.fastjson2.annotation.JSONField;
import com.jsowell.pile.thirdparty.EquipmentInfo;
import com.jsowell.pile.thirdparty.publicinfo.BaseStationInfo;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;
import java.math.BigDecimal;
import java.util.List;
/**
* 充电站信息
* 第三方平台使用
*/
@Builder
@AllArgsConstructor
@NoArgsConstructor
@Data
public class StationInfo {
@NoArgsConstructor
@AllArgsConstructor
@SuperBuilder
public class StationInfo extends BaseStationInfo {
/**
* 充电站ID Y
* 对接平台自定义的唯一编码
* <=20字符
*/
@JSONField(name = "StationID")
private String stationID;
/**
* 对接平台ID Y
* 组织机构代码
* 运营商ID Y
* 运营商ID
* 9字符
*/
@JSONField(name = "OperatorID")
private String operatorID;
@@ -37,6 +39,7 @@ public class StationInfo {
/**
* 设备所属运营商ID Y
* 设备所属运营商组织机构代码
* 9字符
*/
@JSONField(name = "EquipmentOwnerID")
private String equipmentOwnerID;
@@ -44,10 +47,215 @@ public class StationInfo {
/**
* 充电站名称 Y
* 充电站名称的描述
* <=50字符
*/
@JSONField(name = "StationName")
private String stationName;
/**
* 充电站国家代码 Y
* 比如CN
* 2字符
*/
@JSONField(name = "CountryCode")
private String countryCode;
/**
* 充电站省市辖区编码 Y
* 填写内容为参照GB/T 2260-2007
* 20字符
*/
@JSONField(name = "AreaCode")
private String areaCode;
/**
* 详细地址 Y
* <=50字符
*/
@JSONField(name = "Address")
private String address;
/**
* 站点电话 Y
* 能够联系场站工作人员进行协助的联系电话
* <=30字符
*/
@JSONField(name = "StationTel")
private String stationTel;
/**
* 服务电话 Y
* 平台服务电话,例如400的电话
* <=30字符
*/
@JSONField(name = "ServiceTel")
private String serviceTel;
/**
* 站点类型 Y
* 1-公共
* 50-个人
* 100-公交(专用)
* 101-环卫(专用)
* 102-物流(专用)
* 103-出租车(专用)
* 104-分时租赁(专用)
* 105-小区共享(专用)
* 106-单位(专用)
* 255-其他
*/
@JSONField(name = "StationType")
private Integer stationType;
/**
* 站点状态 Y
* 0未知
* 1建设中
* 5关闭下线
* 6维护中
* 50正常使用
*/
@JSONField(name = "StationStatus")
private Integer stationStatus;
/**
* 车位数量 Y
* 可停放进行充电的车位总数(默认0-未知)
*/
@JSONField(name = "ParkNums")
private Integer parkNums = 0;
/**
* 经度 Y
* GCJ-02坐标系
* 保留小数点后6位
*/
@JSONField(name = "StationLng")
private BigDecimal stationLng;
/**
* 纬度 Y
* GCJ-02坐标系
* 保留小数点后6位
*/
@JSONField(name = "StationLat")
private BigDecimal stationLat;
/**
* 站点引导 N
* 描述性文字,用于引导车主找到充电车位
* <=100字符
*/
@JSONField(name = "SiteGuide")
private String siteGuide;
/**
* 建设场所 Y
* 1居民区
* 2公共机构
* 3企事业单位
* 4写字楼
* 5工业园区
* 6交通枢纽
* 7大型文体设施
* 8城市绿地
* 9大型建筑配建停车场
* 10路边停车位
* 11城际高速服务区
* 12风景区
* 13公交场站
* 14加油加气站
* 15出租车
* 255其他
*/
@JSONField(name = "Construction")
private Integer construction;
/**
* 站点照片 N
* 充电设备照片、充电车位照片、停车场入口照片
*/
@JSONField(name = "Pictures")
private List<String> pictures;
/**
* 使用车型描述 N
* 描述该站点接受的车大小以及类型,如大巴、物流车、私家乘用车、出租车等
* <=100字符
*/
@JSONField(name = "MatchCars")
private String matchCars;
/**
* 车位楼层及数量描述 N
* 车位楼层以及数量信息
* <=100字符
*/
@JSONField(name = "ParkInfo")
private String parkInfo;
/**
* 营业时间 N
* 营业时间描述,推荐格式周一至周日00:00-24:00
* <=100字符
*/
@JSONField(name = "BusineHours")
private String busineHours;
/**
* 充电电费率 N
* 充电费描述,推荐格式XX 元/度
* <=256字符
*/
@JSONField(name = "ElectricityFee")
private String electricityFee;
/**
* 服务费率 N
* 服务费率描述,推荐格式XX 元/度
* <=100字符
*/
@JSONField(name = "ServiceFee")
private String serviceFee;
/**
* 停车费 N
* 停车费率描述
* <=100字符
*/
@JSONField(name = "ParkFree")
private Integer parkFree;
/**
* 支付方式 N
* 支付方式:刷卡、线上、现金 其中电子钱包类卡为刷卡,身份鉴权卡、微信/ 支付宝、APP为线上
* <=20字符
*/
@JSONField(name = "Payment")
private String payment;
/**
* 是否支持预约 N
* 充电设备是否需要提前预约后才能使用。(0-不支持预约;1-支持预约) 不填默认为0
*/
@JSONField(name = "SupportOrder")
private Integer supportOrder = 0;
/**
* 备注 N
* 其他备注信息
* <=100字符
*/
@JSONField(name = "Remark")
private String remark;
/**
* 充电设备信息列表 Y
* 该充电站所有充电设备信息对象集合
*/
@JSONField(name = "EquipmentInfos")
private List<EquipmentInfo> equipmentInfos;
/**
* 是否独立报桩 (0-否;1-是) Y
* 如果是独立报桩需要填写户号以及容量
@@ -83,133 +291,6 @@ public class StationInfo {
@JSONField(name = "ParkingLotNumber")
private String parkingLotNumber;
/**
* 充电站国家代码 Y
* 比如CN
*/
@JSONField(name = "CountryCode")
private String countryCode;
/**
* 充电站省市辖区编码 Y
* 填写内容为参照 GB/T2260-2015
*/
@JSONField(name = "AreaCode")
private String areaCode;
/**
* 详细地址 Y
*/
@JSONField(name = "Address")
private String address;
/**
* 站点电话 N
* 能够联系场站工作人员进行协助的联系电话
*/
// private String StationTel;
/**
* 服务电话 Y
* 平台服务电话例如400 的电话
*/
@JSONField(name = "ServiceTel")
private String serviceTel;
/**
* 站点类型 Y
* 1-公共
* 50-个人
* 100-公交(专用)
* 101-环卫(专用)
* 102-物流(专用)
* 103-出租车(专用)
* 104-分时租赁(专用)
* 105-小区共享(专用)
* 106-单位(专用)
* 255-其他
*/
@JSONField(name = "StationType")
private Integer stationType;
/**
* 站点状态 Y
* 0未知
* 1建设中
* 5关闭下线
* 6维护中
* 50正常使用
*/
@JSONField(name = "StationStatus")
private Integer stationStatus;
/**
* 车位数量 Y
* 可停放进行充电的车位总数(默认0-未知)
*/
@JSONField(name = "ParkNums")
private Integer parkNums;
/**
* 经度 Y
* GCJ-02坐标系
*/
@JSONField(name = "StationLng")
private BigDecimal stationLng;
/**
* 纬度 Y
* GCJ-02坐标系
*/
@JSONField(name = "StationLat")
private BigDecimal stationLat;
/**
* 站点引导 N
* 描述性文字,用于引导车主找到充电车位
*/
private String SiteGuide;
/**
* 建设场所 Y
* 1居民区
* 2公共机构
* 3企事业单位
* 4写字楼
* 5工业园区
* 6交通枢纽
* 7大型文体设施
* 8城市绿地
* 9大型建筑配建停车场
* 10路边停车位
* 11城际高速服务区
* 12风景区
* 13公交场站
* 14加油加气站
* 15出租车
* 255其他
*/
@JSONField(name = "Construction")
private Integer construction;
/**
* 站点照片 N
* 充电设备照片、充电车位照片、停车场入口照片
*/
private List<String> Pictures;
/**
* 使用车型描述 N
* 描述该站点接受的车大小以及类型,如大巴、物流车、私家乘用车、出租车等
*/
private String MatchCars;
/**
* 车位楼层及数量描述 N
* 车位楼层以及数量信息
*/
private String ParkInfo;
/**
* 停车场产权方 N
* 停车场产权人
@@ -229,11 +310,6 @@ public class StationInfo {
@JSONField(name = "OpenAllDay")
private Integer openAllDay;
/**
* 营业时间 N
* 营业时间描述,推荐格式周一至周日00:00-24:00
*/
// private String BusinessHours;
/**
* 最低单价 Y
@@ -242,26 +318,6 @@ public class StationInfo {
@JSONField(name = "MinElectricityPrice")
private BigDecimal minElectricityPrice;
/**
* 充电电费率 Y
* 充电费描述,推荐格式XX 元/度
*/
@JSONField(name = "ElectricityFee")
private String electricityFee;
/**
* 服务费率 Y
* 服务费率描述,推荐格式XX 元/度
*/
@JSONField(name = "ServiceFee")
private String serviceFee;
/**
* 免费停车 Y
* 是否停车免费(0-否1-是)
*/
@JSONField(name = "ParkFree")
private Integer parkFree;
/**
* 停车费 N
@@ -269,32 +325,6 @@ public class StationInfo {
*/
// private String ParkFee;
/**
* 支付方式 Y
* 支付方式:刷卡、线上、现金 其中电子钱包类卡为刷卡,身份鉴权卡、微信/ 支付宝、APP为线上
*/
@JSONField(name = "Payment")
private String payment;
/**
* 是否支持预约 Y
* 充电设备是否需要提前预约后才能使用。(0-不支持预约;1-支持预约) 不填默认为0
*/
@JSONField(name = "SupportOrder")
private Integer supportOrder;
/**
* 备注 N
* 其他备注信息
*/
// private String Remark;
/**
* 充电设备信息列表 Y
* 该充电站所有充电设备信息对象集合
*/
@JSONField(name = "EquipmentInfos")
private List<EquipmentInfo> equipmentInfos;
/**
* 停车收费类型 Y
@@ -354,10 +384,4 @@ public class StationInfo {
@JSONField(name = "ParkingLockFlag")
private Integer parkingLockFlag;
/**
* 站点联系电话
*/
@JSONField(name = "StationTel")
private String stationTel;
}

View File

@@ -5,13 +5,15 @@ import com.jsowell.thirdparty.platform.common.StationInfo;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;
/**
* 内蒙古平台站点信息
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@AllArgsConstructor
@SuperBuilder
public class SupStationInfo extends StationInfo {
/**
* 充换电站唯一编码

View File

@@ -4,7 +4,6 @@ import cn.hutool.http.HttpUtil;
import cn.hutool.json.JSONUtil;
import com.alibaba.fastjson2.JSON;
import com.google.common.collect.Maps;
import com.jsowell.common.core.domain.ykc.RealTimeMonitorData;
import com.jsowell.common.util.DateUtils;
import com.jsowell.common.util.JWTUtils;
import com.jsowell.common.util.StringUtils;
@@ -518,5 +517,4 @@ public interface ThirdPartyPlatformService extends InitializingBean {
return StringUtils.equals(dto.getSig(), sign);
}
}

View File

@@ -62,7 +62,7 @@ import java.util.Map;
import java.util.stream.Collectors;
/**
* TODO
* 海南平台
*
* @author Lemon
* @Date 2024/1/18 10:05:23

View File

@@ -37,11 +37,11 @@ import com.jsowell.pile.vo.web.PileConnectorInfoVO;
import com.jsowell.pile.vo.web.PileStationVO;
import com.jsowell.thirdparty.lianlian.domain.*;
import com.jsowell.thirdparty.lianlian.vo.*;
import com.jsowell.thirdparty.platform.service.ThirdPartyPlatformService;
import com.jsowell.thirdparty.platform.common.ChargeDetail;
import com.jsowell.thirdparty.platform.common.OrderInfo;
import com.jsowell.thirdparty.platform.common.StationInfo;
import com.jsowell.thirdparty.platform.factory.ThirdPartyPlatformFactory;
import com.jsowell.thirdparty.platform.service.ThirdPartyPlatformService;
import com.jsowell.thirdparty.platform.util.*;
import com.jsowell.thirdparty.service.ThirdpartySecretInfoService;
import org.apache.commons.collections4.CollectionUtils;
@@ -56,6 +56,9 @@ import java.math.RoundingMode;
import java.util.*;
import java.util.stream.Collectors;
/**
* 上海联联平台
*/
@Service
public class LianLianPlatformServiceImpl implements ThirdPartyPlatformService {
Logger logger = LoggerFactory.getLogger(this.getClass());
@@ -108,28 +111,6 @@ public class LianLianPlatformServiceImpl implements ThirdPartyPlatformService {
System.out.println("当前类名:" + this.getClass().getSimpleName());
}
// @Override
public Map<String, String> queryTokenOld(CommonParamsDTO dto) {
String operatorId = dto.getOperatorID();
// 通过operatorId 查出 operatorSecret
ThirdPartyPlatformConfig platformConfig = thirdPartyPlatformConfigService.getInfoByOperatorId(operatorId);
if (platformConfig == null) {
return null;
}
String operatorSecret = platformConfig.getOperatorSecret();
String dataSecret = platformConfig.getDataSecret();
String dataSecretIv = platformConfig.getDataSecretIv();
String signSecret = platformConfig.getSignSecret();
// 使用公共方法生成token
Map<String, String> resultMap = generateToken(operatorSecret, dataSecret, dataSecretIv, signSecret, operatorId, dto.getData());
// 拼装
// 加密
return resultMap;
}
@Override
public Map<String, String> queryToken(CommonParamsDTO dto) {
AccessTokenVO vo = new AccessTokenVO();

View File

@@ -41,8 +41,8 @@ import com.jsowell.thirdparty.lianlian.domain.StationStatusInfo;
import com.jsowell.thirdparty.lianlian.vo.AccessTokenVO;
import com.jsowell.thirdparty.platform.common.StationInfo;
import com.jsowell.thirdparty.platform.domain.*;
import com.jsowell.thirdparty.platform.service.ThirdPartyPlatformService;
import com.jsowell.thirdparty.platform.factory.ThirdPartyPlatformFactory;
import com.jsowell.thirdparty.platform.service.ThirdPartyPlatformService;
import com.jsowell.thirdparty.platform.util.Cryptos;
import com.jsowell.thirdparty.platform.util.HttpRequestUtil;
import com.jsowell.thirdparty.platform.util.ThirdPartyPlatformUtils;
@@ -56,8 +56,11 @@ import java.util.*;
import java.util.function.Function;
import java.util.stream.Collectors;
/**
* 宁夏平台
*/
@Service
public class NinaXiaPlatformServiceImpl implements ThirdPartyPlatformService {
public class NingXiaPlatformServiceImpl implements ThirdPartyPlatformService {
// 平台类型
private final String thirdPlatformType = ThirdPlatformTypeEnum.NING_XIA_PLATFORM.getTypeCode();
@@ -1092,6 +1095,8 @@ public class NinaXiaPlatformServiceImpl implements ThirdPartyPlatformService {
.printerFlag(Integer.valueOf(pileStationInfo.getPrinterFlag()))
.barrierFlag(Integer.valueOf(pileStationInfo.getBarrierFlag()))
.parkingLockFlag(Integer.valueOf(pileStationInfo.getParkingLockFlag()))
// .parkNums()
// .supportOrder()
.build();
String areaCode = pileStationInfo.getAreaCode(); // 330000,330200,330213
// 根据逗号分组

View File

@@ -5,7 +5,6 @@ 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.thirdparty.BusinessInformationExchangeEnum;
@@ -18,30 +17,31 @@ import com.jsowell.common.util.JWTUtils;
import com.jsowell.common.util.PageUtils;
import com.jsowell.common.util.StringUtils;
import com.jsowell.pile.domain.OrderBasicInfo;
import com.jsowell.pile.domain.ThirdPartyPlatformConfig;
import com.jsowell.pile.domain.ThirdPartyStationRelation;
import com.jsowell.pile.dto.PushRealTimeInfoDTO;
import com.jsowell.pile.dto.QueryStationInfoDTO;
import com.jsowell.pile.service.*;
import com.jsowell.pile.thirdparty.CommonParamsDTO;
import com.jsowell.pile.thirdparty.EquipmentInfo;
import com.jsowell.pile.thirdparty.ZDLStationInfo;
import com.jsowell.pile.vo.ThirdPartySecretInfoVO;
import com.jsowell.pile.vo.base.ConnectorInfoVO;
import com.jsowell.pile.vo.base.ThirdPartyStationInfoVO;
import com.jsowell.pile.vo.base.ThirdPartyStationRelationVO;
import com.jsowell.pile.vo.lianlian.AccumulativeInfoVO;
import com.jsowell.pile.vo.web.OrderListVO;
import com.jsowell.pile.vo.web.PileConnectorInfoVO;
import com.jsowell.pile.vo.web.PileStationVO;
import com.jsowell.thirdparty.lianlian.domain.*;
import com.jsowell.thirdparty.lianlian.domain.ConnectorChargeStatusInfo;
import com.jsowell.thirdparty.lianlian.domain.ConnectorStatusInfo;
import com.jsowell.thirdparty.lianlian.domain.StationStatusInfo;
import com.jsowell.thirdparty.lianlian.vo.AccessTokenVO;
import com.jsowell.thirdparty.platform.common.StationInfo;
import com.jsowell.thirdparty.platform.domain.BMSInfo;
import com.jsowell.thirdparty.platform.domain.StationChargeStatsInfo;
import com.jsowell.thirdparty.platform.factory.ThirdPartyPlatformFactory;
import com.jsowell.thirdparty.platform.service.ThirdPartyPlatformService;
import com.jsowell.thirdparty.platform.util.*;
import com.jsowell.thirdparty.platform.util.Cryptos;
import com.jsowell.thirdparty.platform.util.HttpRequestUtil;
import com.jsowell.thirdparty.platform.util.ThirdPartyPlatformUtils;
import com.jsowell.thirdparty.service.ThirdpartySecretInfoService;
import org.apache.commons.collections4.CollectionUtils;
import org.slf4j.Logger;

View File

@@ -240,4 +240,29 @@ public class ZheJiangPlatformServiceImpl implements ThirdPartyPlatformService {
thirdPartySecretInfoVO.setOurOperatorId(Constants.OPERATORID_JIANG_SU);
return thirdPartySecretInfoVO;
}
/**
* 推送充电站信息
* supervise_notification_station_info
*/
/**
* 推送充电设备接口状态信息
* supervise_notification_connector_status
*/
/**
* 推送充电状态信息
* supervise_notification_equip_charge_status
*/
/**
* 推送充电订单信息
* supervise_notification_charge_order_info
*/
/**
* 推送充电站实时功率信息
* supervise_notification_realtime_power_info
*/
}

View File

@@ -5,12 +5,11 @@ import com.google.common.collect.Lists;
import com.jsowell.common.enums.thirdparty.ThirdPlatformTypeEnum;
import com.jsowell.common.util.JWTUtils;
import com.jsowell.common.util.StringUtils;
import com.jsowell.pile.service.ThirdPartyPlatformConfigService;
import com.jsowell.pile.thirdparty.CommonParamsDTO;
import com.jsowell.pile.vo.ThirdPartySecretInfoVO;
import com.jsowell.thirdparty.lianlian.vo.AccessTokenVO;
import com.jsowell.thirdparty.platform.service.ThirdPartyPlatformService;
import com.jsowell.thirdparty.platform.factory.ThirdPartyPlatformFactory;
import com.jsowell.thirdparty.platform.service.ThirdPartyPlatformService;
import com.jsowell.thirdparty.platform.util.Cryptos;
import com.jsowell.thirdparty.platform.util.ThirdPartyPlatformUtils;
import com.jsowell.thirdparty.service.ThirdpartySecretInfoService;
@@ -20,14 +19,14 @@ import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;
/**
* 中电联
*/
@Service
public class ZhongDianLianPlatformServiceImpl implements ThirdPartyPlatformService {
// 平台类型
private final String thirdPlatformType = ThirdPlatformTypeEnum.NING_BO_PLATFORM.getTypeCode();
@Autowired
private ThirdPartyPlatformConfigService thirdPartyPlatformConfigService;
@Autowired
private ThirdpartySecretInfoService thirdpartySecretInfoService;