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:
@@ -343,7 +343,7 @@ public class LianLianController extends BaseController {
|
||||
String dataStr = new String(plainText, StandardCharsets.UTF_8);
|
||||
// 转换成相应对象
|
||||
QueryStartChargeDTO queryStartChargeDTO = JSONObject.parseObject(dataStr, QueryStartChargeDTO.class);
|
||||
queryStartChargeDTO.setOperatorID(dto.getOperatorID());
|
||||
queryStartChargeDTO.setOperatorId(dto.getOperatorID());
|
||||
Map<String, String> map = lianLianService.query_start_charge(queryStartChargeDTO);
|
||||
|
||||
return CommonResult.success(0, "请求启动充电成功!", map.get("Data"), map.get("Sig"));
|
||||
@@ -467,7 +467,7 @@ public class LianLianController extends BaseController {
|
||||
String dataStr = new String(plainText, StandardCharsets.UTF_8);
|
||||
// 转换成相应对象
|
||||
QueryStartChargeDTO queryStartChargeDTO = JSONObject.parseObject(dataStr, QueryStartChargeDTO.class);
|
||||
queryStartChargeDTO.setOperatorID(dto.getOperatorID());
|
||||
queryStartChargeDTO.setOperatorId(dto.getOperatorID());
|
||||
Map<String, String> map = lianLianService.query_stop_charge(queryStartChargeDTO);
|
||||
|
||||
return CommonResult.success(0, "请求停止充电成功!", map.get("Data"), map.get("Sig"));
|
||||
|
||||
@@ -17,14 +17,14 @@ public class QueryEquipmentDTO {
|
||||
* 27 字符
|
||||
*/
|
||||
@JsonProperty(value = "EquipAuthSeq")
|
||||
private String EquipAuthSeq;
|
||||
private String equipAuthSeq;
|
||||
|
||||
/**
|
||||
* 充电设备接口编码
|
||||
*/
|
||||
@JsonProperty(value = "ConnectorID")
|
||||
private String ConnectorID;
|
||||
private String connectorID;
|
||||
|
||||
@JsonProperty(value = "OperatorID")
|
||||
private String OperatorID;
|
||||
private String operatorID;
|
||||
}
|
||||
|
||||
@@ -15,32 +15,32 @@ public class QueryStartChargeDTO {
|
||||
* 充电订单号
|
||||
*/
|
||||
@JsonProperty(value = "StartChargeSeq")
|
||||
private String StartChargeSeq;
|
||||
private String startChargeSeq;
|
||||
|
||||
/**
|
||||
* 充电设备接口编码
|
||||
*/
|
||||
@JsonProperty(value = "ConnectorID")
|
||||
private String ConnectorID;
|
||||
private String connectorID;
|
||||
|
||||
/**
|
||||
* 二维码
|
||||
*/
|
||||
@JsonProperty(value = "QRCode")
|
||||
private String QRCode;
|
||||
private String qrCode;
|
||||
|
||||
/**
|
||||
* 用户手机号
|
||||
*/
|
||||
@JsonProperty(value = "PhoneNum")
|
||||
private String PhoneNum;
|
||||
private String phoneNum;
|
||||
|
||||
/**
|
||||
* 车牌号
|
||||
*/
|
||||
@JsonProperty(value = "PlateNum")
|
||||
private String PlateNum;
|
||||
private String plateNum;
|
||||
|
||||
@JsonProperty(value = "OperatorID")
|
||||
private String OperatorID;
|
||||
private String operatorId;
|
||||
}
|
||||
|
||||
@@ -605,7 +605,7 @@ public class LianLianServiceImpl implements LianLianService {
|
||||
// 平台已存在订单
|
||||
return null;
|
||||
}
|
||||
ThirdPartyPlatformConfig configInfo = thirdPartyPlatformConfigService.getInfoByOperatorId(dto.getOperatorID());
|
||||
ThirdPartyPlatformConfig configInfo = thirdPartyPlatformConfigService.getInfoByOperatorId(dto.getOperatorId());
|
||||
if (configInfo == null) {
|
||||
return null;
|
||||
}
|
||||
@@ -737,7 +737,7 @@ public class LianLianServiceImpl implements LianLianService {
|
||||
if (orderInfo == null) {
|
||||
return null;
|
||||
}
|
||||
ThirdPartyPlatformConfig configInfo = thirdPartyPlatformConfigService.getInfoByOperatorId(dto.getOperatorID());
|
||||
ThirdPartyPlatformConfig configInfo = thirdPartyPlatformConfigService.getInfoByOperatorId(dto.getOperatorId());
|
||||
if (configInfo == null) {
|
||||
return null;
|
||||
}
|
||||
@@ -752,6 +752,8 @@ public class LianLianServiceImpl implements LianLianService {
|
||||
vo.setStartChargeSeq(orderCode);
|
||||
vo.setStartChargeSeqStat(3); // 3-停止中
|
||||
}
|
||||
vo.setSuccStat(0);
|
||||
vo.setFailReason(0);
|
||||
// 加密
|
||||
Map<String, String> resultMap = Maps.newLinkedHashMap();
|
||||
// 加密数据
|
||||
|
||||
12
jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/yongchengboche/dto/YCBCGetTokenDTO.java
vendored
Normal file
12
jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/yongchengboche/dto/YCBCGetTokenDTO.java
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
package com.jsowell.thirdparty.yongchengboche.dto;
|
||||
|
||||
import com.jsowell.thirdparty.zhongdianlian.dto.ZDLGetTokenDTO;
|
||||
|
||||
/**
|
||||
* TODO
|
||||
*
|
||||
* @author Lemon
|
||||
* @Date 2023/10/30 15:49:51
|
||||
*/
|
||||
public class YCBCGetTokenDTO extends ZDLGetTokenDTO {
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.jsowell.thirdparty.yongchengboche.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.jsowell.thirdparty.lianlian.dto.CommonParamsDTO;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 甬城泊车通用请求参数DTO
|
||||
*
|
||||
* @author Lemon
|
||||
* @Date 2023/10/30 15:53:35
|
||||
*/
|
||||
@Data
|
||||
public class YCCommonParamsDTO extends CommonParamsDTO {
|
||||
|
||||
@JsonProperty(value = "AccessName")
|
||||
private String accessName;
|
||||
}
|
||||
105
jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/yongchengboche/service/YCBCService.java
vendored
Normal file
105
jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/yongchengboche/service/YCBCService.java
vendored
Normal file
@@ -0,0 +1,105 @@
|
||||
package com.jsowell.thirdparty.yongchengboche.service;
|
||||
|
||||
import com.jsowell.pile.dto.QueryEquipChargeStatusDTO;
|
||||
import com.jsowell.pile.dto.QueryEquipmentDTO;
|
||||
import com.jsowell.pile.dto.QueryStartChargeDTO;
|
||||
import com.jsowell.pile.dto.QueryStationInfoDTO;
|
||||
import com.jsowell.thirdparty.yongchengboche.dto.YCBCGetTokenDTO;
|
||||
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 甬城泊车 Service
|
||||
*
|
||||
* @author Lemon
|
||||
* @Date 2023/10/30 15:44:09
|
||||
*/
|
||||
public interface YCBCService {
|
||||
/**
|
||||
* 获取令牌
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
public String YCBCGetToken(YCBCGetTokenDTO dto);
|
||||
|
||||
/**
|
||||
* 查询站点信息
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
public Map<String, String> queryStationsInfo(QueryStationInfoDTO dto);
|
||||
|
||||
/**
|
||||
* 设备接口状态查询
|
||||
* 此接口用于批量查询设备实时状态
|
||||
*
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
Map<String, String> queryStationStatus(QueryStationInfoDTO dto);
|
||||
|
||||
|
||||
/**
|
||||
* 设备状态变化推送
|
||||
* @param pileConnectorCode
|
||||
* @param status
|
||||
* @return
|
||||
*/
|
||||
String notificationStationStatus(String pileConnectorCode, String status);
|
||||
|
||||
|
||||
/**
|
||||
* 请求设备认证
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
Map<String, String> queryEquipAuth(QueryEquipmentDTO dto);
|
||||
|
||||
/**
|
||||
* 请求开始充电
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
Map<String, String> queryStartCharge(QueryStartChargeDTO dto);
|
||||
|
||||
/**
|
||||
* 推送启动充电结果
|
||||
* @return
|
||||
*/
|
||||
String pushStartChargeResult(String orderCode);
|
||||
|
||||
/**
|
||||
* 查询充电状态
|
||||
* @param dto
|
||||
*/
|
||||
Map<String, String> queryEquipChargeStatus(QueryEquipChargeStatusDTO dto);
|
||||
|
||||
/**
|
||||
* 推送充电状态
|
||||
* @param orderCode
|
||||
* @return
|
||||
*/
|
||||
String pushChargeStatus(String orderCode) throws UnsupportedEncodingException;
|
||||
|
||||
/**
|
||||
* 请求停止充电
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
Map<String, String> queryStopCharge(QueryStartChargeDTO dto);
|
||||
|
||||
/**
|
||||
* 推送停止充电结果(仅在 0x19的帧类型中调用)
|
||||
* @param orderCode
|
||||
* @return
|
||||
*/
|
||||
String pushStopChargeResult(String orderCode);
|
||||
|
||||
/**
|
||||
* 推送充电订单信息
|
||||
* @param orderCode
|
||||
* @return
|
||||
*/
|
||||
String pushChargeOrderInfo(String orderCode);
|
||||
}
|
||||
@@ -0,0 +1,154 @@
|
||||
package com.jsowell.thirdparty.yongchengboche.service.impl;
|
||||
|
||||
import com.jsowell.pile.dto.QueryEquipChargeStatusDTO;
|
||||
import com.jsowell.pile.dto.QueryEquipmentDTO;
|
||||
import com.jsowell.pile.dto.QueryStartChargeDTO;
|
||||
import com.jsowell.pile.dto.QueryStationInfoDTO;
|
||||
import com.jsowell.thirdparty.lianlian.service.LianLianService;
|
||||
import com.jsowell.thirdparty.yongchengboche.dto.YCBCGetTokenDTO;
|
||||
import com.jsowell.thirdparty.yongchengboche.service.YCBCService;
|
||||
import com.jsowell.thirdparty.zhongdianlian.service.ZDLService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 甬城泊车 Service
|
||||
*
|
||||
* @author Lemon
|
||||
* @Date 2023/10/30 15:44:58
|
||||
*/
|
||||
@Service
|
||||
public class YCBCServiceImpl implements YCBCService {
|
||||
|
||||
@Autowired
|
||||
private ZDLService zdlService;
|
||||
|
||||
@Autowired
|
||||
private LianLianService lianLianService;
|
||||
|
||||
|
||||
/**
|
||||
* 获取令牌
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public String YCBCGetToken(YCBCGetTokenDTO dto) {
|
||||
return zdlService.ZDLGetToken(dto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取充电站信息
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Map<String, String> queryStationsInfo(QueryStationInfoDTO dto) {
|
||||
return zdlService.queryStationsInfo(dto);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 设备接口状态查询
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Map<String, String> queryStationStatus(QueryStationInfoDTO dto) {
|
||||
return zdlService.queryStationStatus(dto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 设备状态变化推送
|
||||
* @param pileConnectorCode
|
||||
* @param status
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public String notificationStationStatus(String pileConnectorCode, String status) {
|
||||
return zdlService.notificationStationStatus(pileConnectorCode, status);
|
||||
}
|
||||
|
||||
/**
|
||||
* 请求设备认证
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Map<String, String> queryEquipAuth(QueryEquipmentDTO dto) {
|
||||
return lianLianService.query_equip_auth(dto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 请求开始充电
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Map<String, String> queryStartCharge(QueryStartChargeDTO dto) {
|
||||
return lianLianService.query_start_charge(dto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 推送启动充电结果
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public String pushStartChargeResult(String orderCode) {
|
||||
return lianLianService.pushStartChargeResult(orderCode);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询充电状态
|
||||
* @param dto
|
||||
*/
|
||||
@Override
|
||||
public Map<String, String> queryEquipChargeStatus(QueryEquipChargeStatusDTO dto) {
|
||||
return lianLianService.query_equip_charge_status(dto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 推送充电状态
|
||||
* @param orderCode
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public String pushChargeStatus(String orderCode) throws UnsupportedEncodingException {
|
||||
return lianLianService.pushChargeStatus(orderCode);
|
||||
}
|
||||
|
||||
/**
|
||||
* 请求停止充电
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Map<String, String> queryStopCharge(QueryStartChargeDTO dto) {
|
||||
return lianLianService.query_stop_charge(dto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 推送停止充电结果(仅在 0x19的帧类型中调用)
|
||||
* @param orderCode
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public String pushStopChargeResult(String orderCode) {
|
||||
return lianLianService.pushStopChargeResult(orderCode);
|
||||
}
|
||||
|
||||
/**
|
||||
* 推送充电订单信息
|
||||
* @param orderCode
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public String pushChargeOrderInfo(String orderCode) {
|
||||
return lianLianService.pushChargeOrderInfo(orderCode);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user