mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-21 11:35:12 +08:00
update 联联平台请求启动充电接口
This commit is contained in:
@@ -60,7 +60,7 @@ public interface LianLianService {
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
QueryStartChargeVO query_start_charge(QueryStartChargeDTO dto);
|
||||
Map<String, String> query_start_charge(QueryStartChargeDTO dto);
|
||||
|
||||
/**
|
||||
* 查询充电状态
|
||||
|
||||
@@ -551,22 +551,25 @@ public class LianLianServiceImpl implements LianLianService {
|
||||
*
|
||||
* @param dto
|
||||
*/
|
||||
public QueryStartChargeVO query_start_charge(QueryStartChargeDTO dto) {
|
||||
public Map<String, String> query_start_charge(QueryStartChargeDTO dto) {
|
||||
// 通过传过来的订单号和枪口号生成订单
|
||||
// String orderCode = dto.getStartChargeSeq();
|
||||
String pileConnectorCode = dto.getConnectorID();
|
||||
OrderBasicInfo orderInfo = orderBasicInfoService.getOrderInfoByOrderCode(dto.getStartChargeSeq());
|
||||
if (orderInfo != null) {
|
||||
// 平台已存在订单
|
||||
throw new BusinessException("", "平台已存在订单");
|
||||
return null;
|
||||
}
|
||||
DockingPlatformConfig configInfo = dockingPlatformConfigService.getInfoByOperatorId(dto.getOperatorID());
|
||||
if (configInfo == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
Map<String, Object> map = orderBasicInfoService.generateOrderForLianLian(dto);
|
||||
String orderCode = (String) map.get("orderCode");
|
||||
String transactionCode = (String) map.get("transactionCode");
|
||||
OrderBasicInfo orderBasicInfo = (OrderBasicInfo) map.get("orderBasicInfo");
|
||||
|
||||
|
||||
// 发送启机指令
|
||||
StartChargingCommand command = StartChargingCommand.builder()
|
||||
.pileSn(orderBasicInfo.getPileSn())
|
||||
.connectorCode(orderBasicInfo.getConnectorCode())
|
||||
@@ -589,8 +592,19 @@ public class LianLianServiceImpl implements LianLianService {
|
||||
// 推送启动充电结果
|
||||
pushStartChargeResult(orderCode);
|
||||
|
||||
return vo;
|
||||
// 加密
|
||||
Map<String, String> resultMap = Maps.newLinkedHashMap();
|
||||
// 加密数据
|
||||
byte[] encryptText = Cryptos.aesEncrypt(JSONObject.toJSONString(vo).getBytes(),
|
||||
configInfo.getOperatorSecret().getBytes(), configInfo.getDataSecretIv().getBytes());
|
||||
String encryptData = Encodes.encodeBase64(encryptText);
|
||||
|
||||
resultMap.put("Data", encryptData);
|
||||
// 生成sig
|
||||
String resultSign = GBSignUtils.sign(resultMap, configInfo.getOperatorSecret());
|
||||
resultMap.put("Sig", resultSign);
|
||||
|
||||
return resultMap;
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user