mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-20 02:55:04 +08:00
新增 华为相关 Service
This commit is contained in:
@@ -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<String, String> checkoutSign(CommonParamsDTO dto);
|
||||
|
||||
/**
|
||||
* 查询站点信息
|
||||
*
|
||||
* query_stations_info
|
||||
*
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
public Map<String, String> queryStationsInfo(QueryStationInfoDTO dto);
|
||||
|
||||
/**
|
||||
* 设备接口状态查询
|
||||
* 此接口用于批量查询设备实时状态
|
||||
*
|
||||
* query_station_status
|
||||
*
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
Map<String, String> queryStationStatus(QueryStationInfoDTO dto);
|
||||
|
||||
/**
|
||||
* 设备状态变化推送
|
||||
*
|
||||
* notification_stationStatus
|
||||
*
|
||||
* @param pileConnectorCode
|
||||
* @param status
|
||||
* @return
|
||||
*/
|
||||
String notificationStationStatus(String pileConnectorCode, String status);
|
||||
|
||||
/**
|
||||
* 请求设备认证
|
||||
*
|
||||
* query_equip_auth
|
||||
*
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
Map<String, String> queryEquipAuth(QueryEquipmentDTO dto);
|
||||
|
||||
/**
|
||||
* 请求开始充电
|
||||
*
|
||||
* query_start_charge
|
||||
*
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
Map<String, String> queryStartCharge(QueryStartChargeDTO dto);
|
||||
|
||||
/**
|
||||
* 推送启动充电结果
|
||||
*
|
||||
* notification_start_charge_result
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
String notificationStartChargeResult(String orderCode);
|
||||
|
||||
/**
|
||||
* 查询充电状态
|
||||
*
|
||||
* query_equip_charge_status
|
||||
*
|
||||
* @param dto
|
||||
*/
|
||||
Map<String, String> queryEquipChargeStatus(QueryEquipChargeStatusDTO dto);
|
||||
|
||||
/**
|
||||
* 推送充电状态
|
||||
*
|
||||
* notification_equip_charge_status
|
||||
*
|
||||
* @param orderCode
|
||||
* @return
|
||||
*/
|
||||
String notificationEquipChargeStatus(String orderCode) throws UnsupportedEncodingException;
|
||||
|
||||
/**
|
||||
* 请求停止充电
|
||||
*
|
||||
* query_stop_charge
|
||||
*
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
Map<String, String> 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);
|
||||
}
|
||||
|
||||
202
jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/huawei/impl/HuaWeiServiceImpl.java
vendored
Normal file
202
jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/huawei/impl/HuaWeiServiceImpl.java
vendored
Normal file
@@ -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<String, String> generateToken(CommonParamsDTO dto) throws UnsupportedEncodingException {
|
||||
return zdlService.generateToken(dto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验签名
|
||||
* @param dto
|
||||
*/
|
||||
@Override
|
||||
public Map<String, String> checkoutSign(CommonParamsDTO dto) {
|
||||
return zdlService.checkoutSign(dto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询站点信息
|
||||
*
|
||||
* query_stations_info
|
||||
*
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Map<String, String> queryStationsInfo(QueryStationInfoDTO dto) {
|
||||
return zdlService.queryStationsInfo(dto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 设备接口状态查询
|
||||
* 此接口用于批量查询设备实时状态
|
||||
*
|
||||
* query_station_status
|
||||
*
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Map<String, String> 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<String, String> queryEquipAuth(QueryEquipmentDTO dto) {
|
||||
return zdlService.queryEquipAuth(dto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 请求开始充电
|
||||
*
|
||||
* query_start_charge
|
||||
*
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Map<String, String> 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<String, String> 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<String, String> 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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user