mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-06-12 19:29:52 +08:00
对接浙江平台
This commit is contained in:
@@ -3,7 +3,6 @@ package com.jsowell.api.thirdparty;
|
|||||||
import com.alibaba.fastjson2.JSON;
|
import com.alibaba.fastjson2.JSON;
|
||||||
import com.alibaba.fastjson2.JSONObject;
|
import com.alibaba.fastjson2.JSONObject;
|
||||||
import com.jsowell.common.annotation.Anonymous;
|
import com.jsowell.common.annotation.Anonymous;
|
||||||
import com.jsowell.common.core.controller.BaseController;
|
|
||||||
import com.jsowell.common.enums.thirdparty.ThirdPlatformTypeEnum;
|
import com.jsowell.common.enums.thirdparty.ThirdPlatformTypeEnum;
|
||||||
import com.jsowell.common.exception.BusinessException;
|
import com.jsowell.common.exception.BusinessException;
|
||||||
import com.jsowell.common.response.RestApiResponse;
|
import com.jsowell.common.response.RestApiResponse;
|
||||||
@@ -36,7 +35,7 @@ import java.util.Map;
|
|||||||
@Anonymous
|
@Anonymous
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/qinghai/evcs")
|
@RequestMapping("/qinghai/evcs")
|
||||||
public class QingHaiController extends BaseController {
|
public class QingHaiController extends ThirdPartyBaseController {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
@Qualifier("qingHaiPlatformServiceImpl")
|
@Qualifier("qingHaiPlatformServiceImpl")
|
||||||
|
|||||||
@@ -28,30 +28,9 @@ import java.util.Map;
|
|||||||
@RestController
|
@RestController
|
||||||
public class ThirdPartyBaseController extends BaseController {
|
public class ThirdPartyBaseController extends BaseController {
|
||||||
|
|
||||||
// @Autowired
|
|
||||||
// @Qualifier("zhongDianLianPlatformServiceImpl")
|
|
||||||
// private ThirdPartyPlatformService platformLogic;
|
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private ThirdpartySecretInfoService thirdpartySecretInfoService;
|
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
|
* 验证token
|
||||||
*/
|
*/
|
||||||
@@ -94,7 +73,6 @@ public class ThirdPartyBaseController extends BaseController {
|
|||||||
|
|
||||||
// 校验是否有operatorId, 没有就set
|
// 校验是否有operatorId, 没有就set
|
||||||
verifyOperatorId(dto, t);
|
verifyOperatorId(dto, t);
|
||||||
|
|
||||||
return 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
|
||||||
Class<? extends Object> tClass = t.getClass();
|
Class<? extends Object> tClass = t.getClass();
|
||||||
// 获取所有的属性数组
|
// 获取所有的属性数组
|
||||||
@@ -165,16 +143,13 @@ public class ThirdPartyBaseController extends BaseController {
|
|||||||
* 举例: @JsonProperty("roleIds")
|
* 举例: @JsonProperty("roleIds")
|
||||||
* private String roleIds;
|
* private String roleIds;
|
||||||
*/
|
*/
|
||||||
|
|
||||||
try {
|
try {
|
||||||
boolean has_JsonProperty = field.isAnnotationPresent(JsonProperty.class);
|
boolean has_JsonProperty = field.isAnnotationPresent(JsonProperty.class);
|
||||||
|
|
||||||
if (has_JsonProperty) {
|
if (has_JsonProperty) {
|
||||||
currentFieldName = field.getAnnotation(JsonProperty.class).value();
|
currentFieldName = field.getAnnotation(JsonProperty.class).value();
|
||||||
} else {
|
} else {
|
||||||
currentFieldName = field.getName();
|
currentFieldName = field.getName();
|
||||||
}
|
}
|
||||||
|
|
||||||
// 忽略大小写对比
|
// 忽略大小写对比
|
||||||
if (currentFieldName.equalsIgnoreCase(targetFieldName)) {
|
if (currentFieldName.equalsIgnoreCase(targetFieldName)) {
|
||||||
field.setAccessible(true);
|
field.setAccessible(true);
|
||||||
@@ -183,7 +158,6 @@ public class ThirdPartyBaseController extends BaseController {
|
|||||||
Method m = tClass.getMethod("get" + currentFieldName);
|
Method m = tClass.getMethod("get" + currentFieldName);
|
||||||
return m.invoke(t);
|
return m.invoke(t);
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (SecurityException e) {
|
} catch (SecurityException e) {
|
||||||
// 安全性异常
|
// 安全性异常
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
@@ -197,7 +171,6 @@ public class ThirdPartyBaseController extends BaseController {
|
|||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -215,7 +188,6 @@ public class ThirdPartyBaseController extends BaseController {
|
|||||||
}
|
}
|
||||||
// 校验签名,使用响应方的密钥
|
// 校验签名,使用响应方的密钥
|
||||||
String signSecret = secretInfoVO.getOurSigSecret();
|
String signSecret = secretInfoVO.getOurSigSecret();
|
||||||
|
|
||||||
Map<String, String> map = Maps.newLinkedHashMap();
|
Map<String, String> map = Maps.newLinkedHashMap();
|
||||||
String operatorID = dto.getOperatorID();
|
String operatorID = dto.getOperatorID();
|
||||||
if (StringUtils.isNotBlank(operatorID)) {
|
if (StringUtils.isNotBlank(operatorID)) {
|
||||||
@@ -237,7 +209,6 @@ public class ThirdPartyBaseController extends BaseController {
|
|||||||
if (StringUtils.isNotBlank(seq)) {
|
if (StringUtils.isNotBlank(seq)) {
|
||||||
map.put("Seq", seq);
|
map.put("Seq", seq);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 计算sign
|
// 计算sign
|
||||||
String sign = GBSignUtils.sign(map, signSecret);
|
String sign = GBSignUtils.sign(map, signSecret);
|
||||||
return StringUtils.equals(dto.getSig(), sign);
|
return StringUtils.equals(dto.getSig(), sign);
|
||||||
|
|||||||
@@ -105,6 +105,7 @@ public class YCBCController extends BaseController {
|
|||||||
String dataString = resultMap.get("Data");
|
String dataString = resultMap.get("Data");
|
||||||
String dataSecret = resultMap.get("DataSecret");
|
String dataSecret = resultMap.get("DataSecret");
|
||||||
String dataSecretIV = resultMap.get("DataSecretIV");
|
String dataSecretIV = resultMap.get("DataSecretIV");
|
||||||
|
|
||||||
// 解密data
|
// 解密data
|
||||||
byte[] plainText = Cryptos.aesDecrypt(Encodes.decodeBase64(dataString), dataSecret.getBytes(), dataSecretIV.getBytes());
|
byte[] plainText = Cryptos.aesDecrypt(Encodes.decodeBase64(dataString), dataSecret.getBytes(), dataSecretIV.getBytes());
|
||||||
String dataStr = new String(plainText, StandardCharsets.UTF_8);
|
String dataStr = new String(plainText, StandardCharsets.UTF_8);
|
||||||
|
|||||||
154
jsowell-admin/src/main/java/com/jsowell/api/thirdparty/ZheJiangController.java
vendored
Normal file
154
jsowell-admin/src/main/java/com/jsowell/api/thirdparty/ZheJiangController.java
vendored
Normal 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("查询充电站状态信息发生异常");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -3,7 +3,10 @@ package com.jsowell.pile.thirdparty.publicinfo;
|
|||||||
|
|
||||||
import com.alibaba.fastjson2.annotation.JSONField;
|
import com.alibaba.fastjson2.annotation.JSONField;
|
||||||
import com.jsowell.pile.thirdparty.EquipmentInfo;
|
import com.jsowell.pile.thirdparty.EquipmentInfo;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -13,6 +16,9 @@ import java.util.List;
|
|||||||
* 中电联协议定义
|
* 中电联协议定义
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@SuperBuilder
|
||||||
public class BaseStationInfo {
|
public class BaseStationInfo {
|
||||||
/**
|
/**
|
||||||
* 充电站ID Y
|
* 充电站ID Y
|
||||||
|
|||||||
@@ -5,9 +5,9 @@ import com.alibaba.fastjson2.annotation.JSONField;
|
|||||||
import com.jsowell.pile.thirdparty.EquipmentInfo;
|
import com.jsowell.pile.thirdparty.EquipmentInfo;
|
||||||
import com.jsowell.pile.thirdparty.publicinfo.BaseStationInfo;
|
import com.jsowell.pile.thirdparty.publicinfo.BaseStationInfo;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -18,7 +18,7 @@ import java.util.List;
|
|||||||
@Data
|
@Data
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@Builder
|
@SuperBuilder
|
||||||
public class StationInfo extends BaseStationInfo {
|
public class StationInfo extends BaseStationInfo {
|
||||||
/**
|
/**
|
||||||
* 充电站ID Y
|
* 充电站ID Y
|
||||||
@@ -123,7 +123,7 @@ public class StationInfo extends BaseStationInfo {
|
|||||||
* 可停放进行充电的车位总数(默认:0-未知)
|
* 可停放进行充电的车位总数(默认:0-未知)
|
||||||
*/
|
*/
|
||||||
@JSONField(name = "ParkNums")
|
@JSONField(name = "ParkNums")
|
||||||
private int parkNums;
|
private Integer parkNums = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 经度 Y
|
* 经度 Y
|
||||||
@@ -239,7 +239,7 @@ public class StationInfo extends BaseStationInfo {
|
|||||||
* 充电设备是否需要提前预约后才能使用。(0-不支持预约;1-支持预约) 不填默认为0
|
* 充电设备是否需要提前预约后才能使用。(0-不支持预约;1-支持预约) 不填默认为0
|
||||||
*/
|
*/
|
||||||
@JSONField(name = "SupportOrder")
|
@JSONField(name = "SupportOrder")
|
||||||
private int supportOrder;
|
private Integer supportOrder = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 备注 N
|
* 备注 N
|
||||||
|
|||||||
@@ -2,12 +2,18 @@ package com.jsowell.thirdparty.platform.domain;
|
|||||||
|
|
||||||
import com.alibaba.fastjson2.annotation.JSONField;
|
import com.alibaba.fastjson2.annotation.JSONField;
|
||||||
import com.jsowell.thirdparty.platform.common.StationInfo;
|
import com.jsowell.thirdparty.platform.common.StationInfo;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 内蒙古平台站点信息
|
* 内蒙古平台站点信息
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@SuperBuilder
|
||||||
public class SupStationInfo extends StationInfo {
|
public class SupStationInfo extends StationInfo {
|
||||||
/**
|
/**
|
||||||
* 充换电站唯一编码
|
* 充换电站唯一编码
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ import cn.hutool.http.HttpUtil;
|
|||||||
import cn.hutool.json.JSONUtil;
|
import cn.hutool.json.JSONUtil;
|
||||||
import com.alibaba.fastjson2.JSON;
|
import com.alibaba.fastjson2.JSON;
|
||||||
import com.google.common.collect.Maps;
|
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.DateUtils;
|
||||||
import com.jsowell.common.util.JWTUtils;
|
import com.jsowell.common.util.JWTUtils;
|
||||||
import com.jsowell.common.util.StringUtils;
|
import com.jsowell.common.util.StringUtils;
|
||||||
@@ -518,5 +517,4 @@ public interface ThirdPartyPlatformService extends InitializingBean {
|
|||||||
return StringUtils.equals(dto.getSig(), sign);
|
return StringUtils.equals(dto.getSig(), sign);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -108,28 +108,6 @@ public class LianLianPlatformServiceImpl implements ThirdPartyPlatformService {
|
|||||||
System.out.println("当前类名:" + this.getClass().getSimpleName());
|
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
|
@Override
|
||||||
public Map<String, String> queryToken(CommonParamsDTO dto) {
|
public Map<String, String> queryToken(CommonParamsDTO dto) {
|
||||||
AccessTokenVO vo = new AccessTokenVO();
|
AccessTokenVO vo = new AccessTokenVO();
|
||||||
|
|||||||
@@ -1092,6 +1092,8 @@ public class NinaXiaPlatformServiceImpl implements ThirdPartyPlatformService {
|
|||||||
.printerFlag(Integer.valueOf(pileStationInfo.getPrinterFlag()))
|
.printerFlag(Integer.valueOf(pileStationInfo.getPrinterFlag()))
|
||||||
.barrierFlag(Integer.valueOf(pileStationInfo.getBarrierFlag()))
|
.barrierFlag(Integer.valueOf(pileStationInfo.getBarrierFlag()))
|
||||||
.parkingLockFlag(Integer.valueOf(pileStationInfo.getParkingLockFlag()))
|
.parkingLockFlag(Integer.valueOf(pileStationInfo.getParkingLockFlag()))
|
||||||
|
// .parkNums()
|
||||||
|
// .supportOrder()
|
||||||
.build();
|
.build();
|
||||||
String areaCode = pileStationInfo.getAreaCode(); // 330000,330200,330213
|
String areaCode = pileStationInfo.getAreaCode(); // 330000,330200,330213
|
||||||
// 根据逗号分组
|
// 根据逗号分组
|
||||||
|
|||||||
@@ -240,4 +240,29 @@ public class ZheJiangPlatformServiceImpl implements ThirdPartyPlatformService {
|
|||||||
thirdPartySecretInfoVO.setOurOperatorId(Constants.OPERATORID_JIANG_SU);
|
thirdPartySecretInfoVO.setOurOperatorId(Constants.OPERATORID_JIANG_SU);
|
||||||
return thirdPartySecretInfoVO;
|
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
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user