diff --git a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/xindiantu/service/XDTService.java b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/xindiantu/service/XDTService.java new file mode 100644 index 000000000..60b0ec743 --- /dev/null +++ b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/xindiantu/service/XDTService.java @@ -0,0 +1,116 @@ +package com.jsowell.thirdparty.xindiantu.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.lianlian.dto.CommonParamsDTO; +import com.jsowell.thirdparty.zhongdianlian.dto.ZDLGetTokenDTO; + +import java.io.UnsupportedEncodingException; +import java.util.Map; + +/** + * 新电途Service + * + * @author Lemon + * @Date 2023/12/27 14:27:42 + */ +public interface XDTService { + /** + * 获取令牌 + * @param dto + * @return + */ + public String getToken(ZDLGetTokenDTO dto); + + /** + * 生成token + * @param dto + * @return + */ + Map generateToken(CommonParamsDTO dto) throws UnsupportedEncodingException; + + /** + * 查询站点信息 + * @param dto + * @return + */ + public Map queryStationsInfo(QueryStationInfoDTO dto); + + /** + * 查询统计信息 + * @param dto + * @return + */ + Map queryStationStats(QueryStationInfoDTO dto); + + /** + * 请求设备认证 + * @param dto + * @return + */ + Map queryEquipAuth(QueryEquipmentDTO dto); + + /** + * 请求开始充电 + * @param dto + * @return + */ + Map queryStartCharge(QueryStartChargeDTO dto); + + /** + * 查询业务策略信息结果 + * @param dto + * @return + */ + Map queryEquipBusinessPolicy(QueryStartChargeDTO dto); + + /** + * 设备状态变化推送 + * @param pileConnectorCode + * @param status + * @return + */ + String notificationStationStatus(String pileConnectorCode, String status); + + /** + * 推送充电订单信息 + * @param orderCode + * @return + */ + String pushChargeOrderInfo(String orderCode); + + /** + * 查询充电状态 + * @param dto + */ + Map queryEquipChargeStatus(QueryEquipChargeStatusDTO dto); + + /** + * 请求停止充电 + * @param dto + * @return + */ + Map queryStopCharge(QueryStartChargeDTO dto); + + /** + * 推送启动充电结果 + * @return + */ + String notificationStartChargeResult(String orderCode); + + /** + * 推送停止充电结果(仅在 0x19的帧类型中调用) + * @param orderCode + * @return + */ + String notificationStopChargeResult(String orderCode); + + /** + * 推送充电状态 + * @param orderCode + * @return + */ + String notificationEquipChargeStatus(String orderCode) throws UnsupportedEncodingException; +} \ No newline at end of file diff --git a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/xindiantu/service/impl/XDTServiceImpl.java b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/xindiantu/service/impl/XDTServiceImpl.java new file mode 100644 index 000000000..406a07a81 --- /dev/null +++ b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/xindiantu/service/impl/XDTServiceImpl.java @@ -0,0 +1,166 @@ +package com.jsowell.thirdparty.xindiantu.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.dto.CommonParamsDTO; +import com.jsowell.thirdparty.xindiantu.service.XDTService; +import com.jsowell.thirdparty.zhongdianlian.dto.ZDLGetTokenDTO; +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/12/28 11:02:42 + */ +@Service +public class XDTServiceImpl implements XDTService { + @Autowired + private ZDLService zdlService; + + /** + * 获取令牌 + * @param dto + * @return + */ + @Override + public String getToken(ZDLGetTokenDTO dto) { + return zdlService.ZDLGetToken(dto); + } + + /** + * 生成token + * @param dto + * @return + */ + @Override + public Map generateToken(CommonParamsDTO dto) throws UnsupportedEncodingException { + return zdlService.generateToken(dto); + } + + /** + * 查询站点信息 + * @param dto + * @return + */ + @Override + public Map queryStationsInfo(QueryStationInfoDTO dto) { + return zdlService.queryStationsInfo(dto); + } + + /** + * 查询统计信息 + * @param dto + * @return + */ + @Override + public Map queryStationStats(QueryStationInfoDTO dto) { + return zdlService.queryStationStats(dto); + } + + /** + * 请求设备认证 + * @param dto + * @return + */ + @Override + public Map queryEquipAuth(QueryEquipmentDTO dto) { + return zdlService.queryEquipAuth(dto); + } + + /** + * 请求开始充电 + * @param dto + * @return + */ + @Override + public Map queryStartCharge(QueryStartChargeDTO dto) { + return zdlService.queryStartCharge(dto); + } + + /** + * 查询业务策略信息结果 + * @param dto + * @return + */ + @Override + public Map queryEquipBusinessPolicy(QueryStartChargeDTO dto) { + return zdlService.queryEquipBusinessPolicy(dto); + } + + /** + * 设备状态变化推送 + * @param pileConnectorCode + * @param status + * @return + */ + @Override + public String notificationStationStatus(String pileConnectorCode, String status) { + return zdlService.notificationStationStatus(pileConnectorCode, status); + } + + /** + * 推送充电订单信息 + * @param orderCode + * @return + */ + @Override + public String pushChargeOrderInfo(String orderCode) { + return zdlService.pushChargeOrderInfo(orderCode); + } + + /** + * 查询充电状态 + * @param dto + */ + @Override + public Map queryEquipChargeStatus(QueryEquipChargeStatusDTO dto) { + return zdlService.queryEquipChargeStatus(dto); + } + + /** + * 请求停止充电 + * @param dto + * @return + */ + @Override + public Map queryStopCharge(QueryStartChargeDTO dto) { + return zdlService.queryStopCharge(dto); + } + + /** + * 推送启动充电结果 + * @return + */ + @Override + public String notificationStartChargeResult(String orderCode) { + return zdlService.notificationStartChargeResult(orderCode); + } + + /** + * 推送停止充电结果(仅在 0x19的帧类型中调用) + * @param orderCode + * @return + */ + @Override + public String notificationStopChargeResult(String orderCode) { + return zdlService.notificationStopChargeResult(orderCode); + } + + /** + * 推送充电状态 + * @param orderCode + * @return + */ + @Override + public String notificationEquipChargeStatus(String orderCode) throws UnsupportedEncodingException { + return zdlService.notificationEquipChargeStatus(orderCode); + } +} diff --git a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/zhongdianlian/service/ZDLService.java b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/zhongdianlian/service/ZDLService.java index 942ccef49..20dde13ce 100644 --- a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/zhongdianlian/service/ZDLService.java +++ b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/zhongdianlian/service/ZDLService.java @@ -1,7 +1,6 @@ package com.jsowell.thirdparty.zhongdianlian.service; -import com.jsowell.pile.dto.PushStationInfoDTO; -import com.jsowell.pile.dto.QueryStationInfoDTO; +import com.jsowell.pile.dto.*; import com.jsowell.thirdparty.lianlian.dto.CommonParamsDTO; import com.jsowell.thirdparty.zhongdianlian.dto.ZDLGetTokenDTO; @@ -77,4 +76,58 @@ public interface ZDLService { * @return */ Map generateToken(CommonParamsDTO dto) throws UnsupportedEncodingException; + + /** + * 请求设备认证 + * @param dto + * @return + */ + Map queryEquipAuth(QueryEquipmentDTO dto); + + /** + * 请求开始充电 + * @param dto + * @return + */ + Map queryStartCharge(QueryStartChargeDTO dto); + + /** + * 查询业务策略信息结果 + * @param dto + * @return + */ + Map queryEquipBusinessPolicy(QueryStartChargeDTO dto); + + /** + * 查询充电状态 + * @param dto + */ + Map queryEquipChargeStatus(QueryEquipChargeStatusDTO dto); + + /** + * 请求停止充电 + * @param dto + * @return + */ + Map queryStopCharge(QueryStartChargeDTO dto); + + /** + * 推送启动充电结果 + * @return + */ + String notificationStartChargeResult(String orderCode); + + /** + * 推送停止充电结果(仅在 0x19的帧类型中调用) + * @param orderCode + * @return + */ + String notificationStopChargeResult(String orderCode); + + /** + * 推送充电状态 + * @param orderCode + * @return + */ + String notificationEquipChargeStatus(String orderCode) throws UnsupportedEncodingException; } diff --git a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/zhongdianlian/service/impl/ZDLServiceImpl.java b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/zhongdianlian/service/impl/ZDLServiceImpl.java index a2035ea0a..ab51e635a 100644 --- a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/zhongdianlian/service/impl/ZDLServiceImpl.java +++ b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/zhongdianlian/service/impl/ZDLServiceImpl.java @@ -8,8 +8,7 @@ import com.jsowell.common.enums.thirdparty.ThirdPlatformTypeEnum; import com.jsowell.common.util.PageUtils; import com.jsowell.common.util.StringUtils; import com.jsowell.pile.domain.*; -import com.jsowell.pile.dto.PushStationInfoDTO; -import com.jsowell.pile.dto.QueryStationInfoDTO; +import com.jsowell.pile.dto.*; import com.jsowell.pile.service.*; import com.jsowell.pile.vo.base.MerchantInfoVO; import com.jsowell.pile.vo.base.ThirdPartyStationInfoVO; @@ -333,6 +332,84 @@ public class ZDLServiceImpl implements ZDLService { return lianLianService.generateToken(dto); } + /** + * 请求设备认证 + * @param dto + * @return + */ + @Override + public Map queryEquipAuth(QueryEquipmentDTO dto) { + return lianLianService.query_equip_auth(dto); + } + + /** + * 请求开始充电 + * @param dto + * @return + */ + @Override + public Map queryStartCharge(QueryStartChargeDTO dto) { + return lianLianService.query_start_charge(dto); + } + + /** + * TODO 查询业务策略信息结果 + * @param dto + * @return + */ + @Override + public Map queryEquipBusinessPolicy(QueryStartChargeDTO dto) { + return null; + } + + /** + * 查询充电状态 + * @param dto + */ + @Override + public Map queryEquipChargeStatus(QueryEquipChargeStatusDTO dto) { + return lianLianService.query_equip_charge_status(dto); + } + + /** + * 请求停止充电 + * @param dto + * @return + */ + @Override + public Map queryStopCharge(QueryStartChargeDTO dto) { + return lianLianService.query_stop_charge(dto); + } + + /** + * 推送启动充电结果 + * @return + */ + @Override + public String notificationStartChargeResult(String orderCode) { + return lianLianService.pushStartChargeResult(orderCode); + } + + /** + * 推送停止充电结果(仅在 0x19的帧类型中调用) + * @param orderCode + * @return + */ + @Override + public String notificationStopChargeResult(String orderCode) { + return lianLianService.pushStopChargeResult(orderCode); + } + + /** + * 推送充电状态 + * @param orderCode + * @return + */ + @Override + public String notificationEquipChargeStatus(String orderCode) throws UnsupportedEncodingException { + return lianLianService.pushChargeStatus(orderCode); + } + /** * 获取桩列表信息 *