mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-05-03 17:40:13 +08:00
update 联联平台请求设备认证接口
This commit is contained in:
@@ -53,7 +53,7 @@ public interface LianLianService {
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
EquipmentAuthVO query_equip_auth(QueryEquipmentDTO dto);
|
||||
Map<String, String> query_equip_auth(QueryEquipmentDTO dto);
|
||||
|
||||
/**
|
||||
* 请求开始充电
|
||||
|
||||
@@ -492,7 +492,7 @@ public class LianLianServiceImpl implements LianLianService {
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public EquipmentAuthVO query_equip_auth(QueryEquipmentDTO dto) {
|
||||
public Map<String, String> query_equip_auth(QueryEquipmentDTO dto) {
|
||||
EquipmentAuthVO vo = new EquipmentAuthVO();
|
||||
|
||||
String equipAuthSeq = dto.getEquipAuthSeq();
|
||||
@@ -506,7 +506,11 @@ public class LianLianServiceImpl implements LianLianService {
|
||||
if (pileBasicInfo == null) {
|
||||
vo.setFailReason(2); // 设备检测失败
|
||||
vo.setFailReasonMsg("未查到该桩的数据");
|
||||
throw new BusinessException("", "");
|
||||
return null;
|
||||
}
|
||||
DockingPlatformConfig configInfo = dockingPlatformConfigService.getInfoByOperatorId(dto.getOperatorID());
|
||||
if (configInfo == null) {
|
||||
return null;
|
||||
}
|
||||
if (pileBasicInfo.getMerchantId() == Long.parseLong(merchantId)) {
|
||||
vo.setSuccStat(0);
|
||||
@@ -526,7 +530,19 @@ public class LianLianServiceImpl implements LianLianService {
|
||||
vo.setEquipAuthSeq(equipAuthSeq);
|
||||
vo.setConnectorID(pileConnectorCode);
|
||||
|
||||
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