mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-20 11:05:18 +08:00
update
This commit is contained in:
@@ -95,7 +95,7 @@ public class XDTController extends BaseController {
|
||||
|
||||
/**
|
||||
* 新电途平台查询统计信息
|
||||
* http://localhost:8080/zdl/v1/query_stations_stats
|
||||
* http://localhost:8080/xindiantu/v1/query_stations_stats
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@@ -136,6 +136,50 @@ public class XDTController extends BaseController {
|
||||
return CommonResult.failed("查询统计信息发生异常");
|
||||
}
|
||||
|
||||
/**
|
||||
* 新电途平台查询业务策略信息结果
|
||||
* http://localhost:8080/xindiantu/v1/query_equip_business_policy
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/v1/query_equip_business_policy")
|
||||
public CommonResult<?> queryEquipBusinessPolicy(HttpServletRequest request, @RequestBody CommonParamsDTO dto) {
|
||||
logger.info("新电途平台查询业务策略信息 params:{}", JSONObject.toJSONString(dto));
|
||||
try {
|
||||
// 校验令牌
|
||||
String token = request.getHeader("Authorization");
|
||||
if (!JWTUtils.checkThirdPartyToken(token)) {
|
||||
// 校验失败
|
||||
return CommonResult.failed("令牌校验错误");
|
||||
}
|
||||
// 校验签名
|
||||
Map<String, String> resultMap = xdtService.checkoutSign(dto);
|
||||
if (resultMap == null) {
|
||||
// 签名错误
|
||||
return CommonResult.failed("签名校验错误");
|
||||
}
|
||||
String operatorSecret = resultMap.get("OperatorSecret");
|
||||
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);
|
||||
// 转换成相应对象
|
||||
QueryStartChargeDTO queryStartChargeDTO = JSONObject.parseObject(dataStr, QueryStartChargeDTO.class);
|
||||
queryStartChargeDTO.setOperatorId(dto.getOperatorID());
|
||||
Map<String, String> map = xdtService.queryEquipBusinessPolicy(queryStartChargeDTO);
|
||||
logger.info("新电途平台查询业务策略信息 result:{}", JSONObject.toJSONString(map));
|
||||
|
||||
return CommonResult.success(0, "查询业务策略信息!", map.get("Data"), map.get("Sig"));
|
||||
} catch (Exception e) {
|
||||
logger.info("新电途平台查询业务策略信息 error:", e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
return CommonResult.failed("查询业务策略信息发生异常");
|
||||
}
|
||||
|
||||
/**
|
||||
* 请求设备认证
|
||||
* @param request
|
||||
@@ -221,7 +265,7 @@ public class XDTController extends BaseController {
|
||||
|
||||
/**
|
||||
* 查询充电状态
|
||||
* http://localhost:8080/LianLian/query_equip_charge_status/{startChargeSeq}
|
||||
* http://localhost:8080/xindiantu/query_equip_charge_status/{startChargeSeq}
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@@ -303,7 +347,7 @@ public class XDTController extends BaseController {
|
||||
|
||||
/**
|
||||
* 新电途推送停止充电结果
|
||||
* http://localhost:8080/ycbc/pushStartChargeResult
|
||||
* http://localhost:8080/xindiantu/pushStartChargeResult
|
||||
* @param orderCode
|
||||
* @return
|
||||
*/
|
||||
@@ -327,7 +371,7 @@ public class XDTController extends BaseController {
|
||||
|
||||
/**
|
||||
* 新电途推送充电订单信息
|
||||
* http://localhost:8080/ycbc/pushChargeOrderInfo
|
||||
* http://localhost:8080/xindiantu/pushChargeOrderInfo
|
||||
* @param orderCode
|
||||
* @return
|
||||
*/
|
||||
@@ -351,7 +395,7 @@ public class XDTController extends BaseController {
|
||||
|
||||
/**
|
||||
* 新电途推送充电状态
|
||||
* http://localhost:8080/ycbc/pushStartChargeResult
|
||||
* http://localhost:8080/xindiantu/pushStartChargeResult
|
||||
* @param orderCode
|
||||
* @return
|
||||
*/
|
||||
@@ -375,7 +419,7 @@ public class XDTController extends BaseController {
|
||||
|
||||
/**
|
||||
* 新电途推送启动充电结果
|
||||
* http://localhost:8080/ycbc/pushStartChargeResult
|
||||
* http://localhost:8080/xindiantu/pushStartChargeResult
|
||||
* @param orderCode
|
||||
* @return
|
||||
*/
|
||||
@@ -399,7 +443,7 @@ public class XDTController extends BaseController {
|
||||
|
||||
/**
|
||||
* 新电途平台设备状态变化推送
|
||||
* http://localhost:8080/ycbc/pushStationStatus
|
||||
* http://localhost:8080/xindiantu/pushStationStatus
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user