From 54e6a00a79fccf21107011dea792722bea5012ce Mon Sep 17 00:00:00 2001 From: Lemon Date: Sat, 13 Jan 2024 10:10:14 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20=20=E5=8D=8E=E4=B8=BA?= =?UTF-8?q?=E7=9B=B8=E5=85=B3=20Service?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../thirdparty/huawei/HuaWeiService.java | 114 +++++++++- .../huawei/impl/HuaWeiServiceImpl.java | 202 ++++++++++++++++++ 2 files changed, 314 insertions(+), 2 deletions(-) create mode 100644 jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/huawei/impl/HuaWeiServiceImpl.java diff --git a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/huawei/HuaWeiService.java b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/huawei/HuaWeiService.java index 4a8d1cbc2..afd69c7f2 100644 --- a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/huawei/HuaWeiService.java +++ b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/huawei/HuaWeiService.java @@ -1,6 +1,10 @@ package com.jsowell.thirdparty.huawei; +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.dto.CommonParamsDTO; import com.jsowell.thirdparty.zhongdianlian.dto.ZDLGetTokenDTO; @@ -8,7 +12,7 @@ import java.io.UnsupportedEncodingException; import java.util.Map; /** - * TODO + * 华为 Service * * @author Lemon * @Date 2024/1/11 9:06:52 @@ -20,7 +24,7 @@ public interface HuaWeiService { * @param dto * @return */ - public String ZDLGetToken(ZDLGetTokenDTO dto); + public String HWGetToken(ZDLGetTokenDTO dto); /** * 生成token @@ -35,7 +39,113 @@ public interface HuaWeiService { */ Map checkoutSign(CommonParamsDTO dto); + /** + * 查询站点信息 + * + * query_stations_info + * + * @param dto + * @return + */ + public Map queryStationsInfo(QueryStationInfoDTO dto); + /** + * 设备接口状态查询 + * 此接口用于批量查询设备实时状态 + * + * query_station_status + * + * @param dto + * @return + */ + Map queryStationStatus(QueryStationInfoDTO dto); + /** + * 设备状态变化推送 + * + * notification_stationStatus + * + * @param pileConnectorCode + * @param status + * @return + */ + String notificationStationStatus(String pileConnectorCode, String status); + /** + * 请求设备认证 + * + * query_equip_auth + * + * @param dto + * @return + */ + Map queryEquipAuth(QueryEquipmentDTO dto); + + /** + * 请求开始充电 + * + * query_start_charge + * + * @param dto + * @return + */ + Map queryStartCharge(QueryStartChargeDTO dto); + + /** + * 推送启动充电结果 + * + * notification_start_charge_result + * + * @return + */ + String notificationStartChargeResult(String orderCode); + + /** + * 查询充电状态 + * + * query_equip_charge_status + * + * @param dto + */ + Map queryEquipChargeStatus(QueryEquipChargeStatusDTO dto); + + /** + * 推送充电状态 + * + * notification_equip_charge_status + * + * @param orderCode + * @return + */ + String notificationEquipChargeStatus(String orderCode) throws UnsupportedEncodingException; + + /** + * 请求停止充电 + * + * query_stop_charge + * + * @param dto + * @return + */ + Map queryStopCharge(QueryStartChargeDTO dto); + + /** + * 推送停止充电结果 + * + * notification_stop_charge_result + * + * @param orderCode + * @return + */ + String notificationStopChargeResult(String orderCode); + + /** + * 推送充电订单信息 + * + * notification_charge_order_info + * + * @param orderCode + * @return + */ + String pushChargeOrderInfo(String orderCode); } diff --git a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/huawei/impl/HuaWeiServiceImpl.java b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/huawei/impl/HuaWeiServiceImpl.java new file mode 100644 index 000000000..e0de462a6 --- /dev/null +++ b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/huawei/impl/HuaWeiServiceImpl.java @@ -0,0 +1,202 @@ +package com.jsowell.thirdparty.huawei.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.huawei.HuaWeiService; +import com.jsowell.thirdparty.lianlian.dto.CommonParamsDTO; +import com.jsowell.thirdparty.zhongdianlian.dto.ZDLGetTokenDTO; +import com.jsowell.thirdparty.zhongdianlian.service.ZDLService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.io.UnsupportedEncodingException; +import java.util.Map; + +/** + * 华为 Service + * + * @author Lemon + * @Date 2024/1/13 9:57:12 + */ +@Service +@Slf4j +public class HuaWeiServiceImpl implements HuaWeiService { + + @Autowired + private ZDLService zdlService; + + /** + * 获取令牌 + * @param dto + * @return + */ + @Override + public String HWGetToken(ZDLGetTokenDTO dto) { + return zdlService.ZDLGetToken(dto); + } + + /** + * 生成token + * @param dto + * @return + */ + @Override + public Map generateToken(CommonParamsDTO dto) throws UnsupportedEncodingException { + return zdlService.generateToken(dto); + } + + /** + * 校验签名 + * @param dto + */ + @Override + public Map checkoutSign(CommonParamsDTO dto) { + return zdlService.checkoutSign(dto); + } + + /** + * 查询站点信息 + * + * query_stations_info + * + * @param dto + * @return + */ + @Override + public Map queryStationsInfo(QueryStationInfoDTO dto) { + return zdlService.queryStationsInfo(dto); + } + + /** + * 设备接口状态查询 + * 此接口用于批量查询设备实时状态 + * + * query_station_status + * + * @param dto + * @return + */ + @Override + public Map queryStationStatus(QueryStationInfoDTO dto) { + return zdlService.queryStationsInfo(dto); + } + + /** + * 设备状态变化推送 + * + * notification_stationStatus + * + * @param pileConnectorCode + * @param status + * @return + */ + @Override + public String notificationStationStatus(String pileConnectorCode, String status) { + return zdlService.notificationStationStatus(pileConnectorCode, status); + } + + /** + * 请求设备认证 + * + * query_equip_auth + * + * @param dto + * @return + */ + @Override + public Map queryEquipAuth(QueryEquipmentDTO dto) { + return zdlService.queryEquipAuth(dto); + } + + /** + * 请求开始充电 + * + * query_start_charge + * + * @param dto + * @return + */ + @Override + public Map queryStartCharge(QueryStartChargeDTO dto) { + return zdlService.queryStartCharge(dto); + } + + /** + * 推送启动充电结果 + * + * notification_start_charge_result + * + * @return + */ + @Override + public String notificationStartChargeResult(String orderCode) { + return zdlService.notificationStartChargeResult(orderCode); + } + + /** + * 查询充电状态 + * + * query_equip_charge_status + * + * @param dto + */ + @Override + public Map queryEquipChargeStatus(QueryEquipChargeStatusDTO dto) { + return zdlService.queryEquipChargeStatus(dto); + } + + /** + * 推送充电状态 + * + * notification_equip_charge_status + * + * @param orderCode + * @return + */ + @Override + public String notificationEquipChargeStatus(String orderCode) throws UnsupportedEncodingException { + return zdlService.notificationEquipChargeStatus(orderCode); + } + + /** + * 请求停止充电 + * + * query_stop_charge + * + * @param dto + * @return + */ + @Override + public Map queryStopCharge(QueryStartChargeDTO dto) { + return zdlService.queryStopCharge(dto); + } + + /** + * 推送停止充电结果 + * + * notification_stop_charge_result + * + * @param orderCode + * @return + */ + @Override + public String notificationStopChargeResult(String orderCode) { + return zdlService.notificationStopChargeResult(orderCode); + } + + /** + * 推送充电订单信息 + * + * notification_charge_order_info + * + * @param orderCode + * @return + */ + @Override + public String pushChargeOrderInfo(String orderCode) { + return zdlService.pushChargeOrderInfo(orderCode); + } +}