mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-20 02:55:04 +08:00
update吉林省地锁控制
This commit is contained in:
40
jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/dto/QueryParkingLockDTO.java
vendored
Normal file
40
jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/dto/QueryParkingLockDTO.java
vendored
Normal file
@@ -0,0 +1,40 @@
|
||||
package com.jsowell.thirdparty.platform.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class QueryParkingLockDTO {
|
||||
|
||||
/**
|
||||
* 运营商Id
|
||||
*/
|
||||
@JsonProperty(value = "OperatorID")
|
||||
private String operatorID;
|
||||
|
||||
/**
|
||||
* 充电接口编码
|
||||
*/
|
||||
@JsonProperty(value = "ConnectorID")
|
||||
private String connectorID;
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
@JsonProperty(value = "UserID")
|
||||
private String userID;
|
||||
|
||||
/**
|
||||
* 控制地锁code
|
||||
* 0降1升
|
||||
*/
|
||||
@JsonProperty(value = "LockCode")
|
||||
private String lockCode;
|
||||
|
||||
}
|
||||
@@ -22,6 +22,7 @@ import com.jsowell.thirdparty.lianlian.vo.AccessTokenVO;
|
||||
import com.jsowell.thirdparty.lianlian.vo.LianLianResultVO;
|
||||
import com.jsowell.thirdparty.platform.domain.SupOperatorInfo;
|
||||
import com.jsowell.thirdparty.platform.dto.QueryOrderDTO;
|
||||
import com.jsowell.thirdparty.platform.dto.QueryParkingLockDTO;
|
||||
import com.jsowell.thirdparty.platform.util.Cryptos;
|
||||
import com.jsowell.thirdparty.platform.util.Encodes;
|
||||
import com.jsowell.thirdparty.platform.util.GBSignUtils;
|
||||
@@ -280,6 +281,15 @@ public interface ThirdPartyPlatformService extends InitializingBean {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 地锁控制
|
||||
* query_parking_lock
|
||||
*/
|
||||
default Map<String, String> queryParkingLock(QueryParkingLockDTO dto) {
|
||||
throw new UnsupportedOperationException("This method is not yet implemented");
|
||||
}
|
||||
|
||||
|
||||
// =================================================================================== //
|
||||
// ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ 由对方平台实现此接口,我方平台调用的通知接口 ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ //
|
||||
// =================================================================================== //
|
||||
|
||||
@@ -14,6 +14,7 @@ import com.jsowell.common.enums.ykc.*;
|
||||
import com.jsowell.common.exception.BusinessException;
|
||||
import com.jsowell.common.util.*;
|
||||
import com.jsowell.pile.domain.*;
|
||||
import com.jsowell.pile.domain.ykcCommond.RemoteControlGroundLockCommand;
|
||||
import com.jsowell.pile.domain.ykcCommond.StartChargingCommand;
|
||||
import com.jsowell.pile.dto.*;
|
||||
import com.jsowell.pile.mapper.PileBasicInfoMapper;
|
||||
@@ -37,6 +38,7 @@ import com.jsowell.thirdparty.lianlian.domain.*;
|
||||
import com.jsowell.thirdparty.lianlian.vo.*;
|
||||
import com.jsowell.thirdparty.platform.domain.*;
|
||||
import com.jsowell.thirdparty.platform.dto.ChargeOrderInfoDTO;
|
||||
import com.jsowell.thirdparty.platform.dto.QueryParkingLockDTO;
|
||||
import com.jsowell.thirdparty.platform.dto.SupStationInfoDTO;
|
||||
import com.jsowell.thirdparty.platform.factory.ThirdPartyPlatformFactory;
|
||||
import com.jsowell.thirdparty.platform.service.ThirdPartyPlatformService;
|
||||
@@ -1580,7 +1582,43 @@ public class JiLinPlatformServiceImpl implements ThirdPartyPlatformService {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 控制地锁
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Map<String, String> queryParkingLock(QueryParkingLockDTO dto) {
|
||||
JSONObject result = new JSONObject();
|
||||
ThirdPartySecretInfoVO thirdPartySecretInfoVO = getJiLinSecretInfo();
|
||||
|
||||
try {
|
||||
if (dto.getConnectorID() == null || dto.getConnectorID().isEmpty()) {
|
||||
throw new BusinessException(ReturnCodeEnum.valueOf("枪口信息错误"));
|
||||
}
|
||||
// 获取桩号
|
||||
String pileSn = dto.getConnectorID().substring(0, dto.getConnectorID().length() - 2);
|
||||
// 获取枪口号
|
||||
String connectorCode = dto.getConnectorID().substring(dto.getConnectorID().length() - 2);
|
||||
RemoteControlGroundLockCommand remoteControlGroundLockCommand = new RemoteControlGroundLockCommand();
|
||||
|
||||
remoteControlGroundLockCommand.setPileSn(pileSn);
|
||||
remoteControlGroundLockCommand.setConnectorCode(connectorCode);
|
||||
remoteControlGroundLockCommand.setOperate(dto.getLockCode()); // 0降1升
|
||||
|
||||
pileRemoteService.remoteControlGroundLock(remoteControlGroundLockCommand);
|
||||
|
||||
result.put("SuccStat", 0);
|
||||
result.put("FailReason", 0);
|
||||
|
||||
} catch (Exception e) {
|
||||
result.put("SuccStat", 1);
|
||||
result.put("FailReason", e.getMessage()); // 使用异常信息作为失败原因
|
||||
log.error("Error occurred during remote control ground lock operation", e);
|
||||
} finally {
|
||||
return ThirdPartyPlatformUtils.generateResultMap(result, thirdPartySecretInfoVO);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user