mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-06-13 03:39:55 +08:00
update
This commit is contained in:
@@ -16,6 +16,7 @@ public enum ThirdPlatformTypeEnum {
|
|||||||
NING_XIA_JIAO_TOU("5", "宁夏交投"),
|
NING_XIA_JIAO_TOU("5", "宁夏交投"),
|
||||||
XIN_DIAN_TU("6", "新电途平台"),
|
XIN_DIAN_TU("6", "新电途平台"),
|
||||||
HUA_WEI("7", "华为平台"),
|
HUA_WEI("7", "华为平台"),
|
||||||
|
HAI_NAN("8", "海南平台"),
|
||||||
;
|
;
|
||||||
|
|
||||||
private String code;
|
private String code;
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package com.jsowell.thirdparty.hainan.service;
|
|||||||
import com.github.pagehelper.PageInfo;
|
import com.github.pagehelper.PageInfo;
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
import com.jsowell.common.constant.Constants;
|
import com.jsowell.common.constant.Constants;
|
||||||
|
import com.jsowell.common.enums.thirdparty.ThirdPlatformTypeEnum;
|
||||||
import com.jsowell.common.util.PageUtils;
|
import com.jsowell.common.util.PageUtils;
|
||||||
import com.jsowell.common.util.StringUtils;
|
import com.jsowell.common.util.StringUtils;
|
||||||
import com.jsowell.pile.domain.ThirdPartyPlatformConfig;
|
import com.jsowell.pile.domain.ThirdPartyPlatformConfig;
|
||||||
@@ -10,7 +11,8 @@ import com.jsowell.pile.dto.QueryStationInfoDTO;
|
|||||||
import com.jsowell.pile.vo.base.ThirdPartyStationInfoVO;
|
import com.jsowell.pile.vo.base.ThirdPartyStationInfoVO;
|
||||||
import com.jsowell.pile.vo.uniapp.BillingPriceVO;
|
import com.jsowell.pile.vo.uniapp.BillingPriceVO;
|
||||||
import com.jsowell.thirdparty.hainan.domain.HNStationInfo;
|
import com.jsowell.thirdparty.hainan.domain.HNStationInfo;
|
||||||
import com.jsowell.thirdparty.platform.AbsInterfaceWithPlatformService;
|
import com.jsowell.thirdparty.platform.AbsInterfaceWithPlatformLogic;
|
||||||
|
import com.jsowell.thirdparty.platform.InterfaceWithPlatformLogicFactory;
|
||||||
import org.apache.commons.collections4.CollectionUtils;
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
@@ -26,7 +28,11 @@ import java.util.Map;
|
|||||||
* @Date 2024/1/18 10:05:23
|
* @Date 2024/1/18 10:05:23
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
public class HaiNanChargeService extends AbsInterfaceWithPlatformService {
|
public class HaiNanChargeService extends AbsInterfaceWithPlatformLogic {
|
||||||
|
@Override
|
||||||
|
public void afterPropertiesSet() throws Exception {
|
||||||
|
InterfaceWithPlatformLogicFactory.register(ThirdPlatformTypeEnum.HAI_NAN.getCode(), this);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 6.2 查询充电站信息
|
* 6.2 查询充电站信息
|
||||||
@@ -148,6 +154,8 @@ public class HaiNanChargeService extends AbsInterfaceWithPlatformService {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 身份认证
|
* 身份认证
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ import com.jsowell.thirdparty.lianlian.util.Encodes;
|
|||||||
import com.jsowell.thirdparty.lianlian.util.GBSignUtils;
|
import com.jsowell.thirdparty.lianlian.util.GBSignUtils;
|
||||||
import com.jsowell.thirdparty.lianlian.vo.AccessTokenVO;
|
import com.jsowell.thirdparty.lianlian.vo.AccessTokenVO;
|
||||||
import com.jsowell.thirdparty.zhongdianlian.service.ZDLService;
|
import com.jsowell.thirdparty.zhongdianlian.service.ZDLService;
|
||||||
|
import org.springframework.beans.factory.InitializingBean;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
|
||||||
import java.nio.charset.StandardCharsets;
|
import java.nio.charset.StandardCharsets;
|
||||||
@@ -25,7 +26,7 @@ import java.util.Map;
|
|||||||
/**
|
/**
|
||||||
* 对接第三方平台抽象类
|
* 对接第三方平台抽象类
|
||||||
*/
|
*/
|
||||||
public abstract class AbsInterfaceWithPlatformService {
|
public abstract class AbsInterfaceWithPlatformLogic implements InitializingBean {
|
||||||
@Autowired
|
@Autowired
|
||||||
protected PileStationInfoService pileStationInfoService;
|
protected PileStationInfoService pileStationInfoService;
|
||||||
|
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
package com.jsowell.thirdparty.platform;
|
||||||
|
|
||||||
|
import com.google.common.collect.Maps;
|
||||||
|
import com.jsowell.common.util.StringUtils;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工厂设计模式
|
||||||
|
* 对接第三方平台逻辑工厂类
|
||||||
|
*/
|
||||||
|
public class InterfaceWithPlatformLogicFactory {
|
||||||
|
|
||||||
|
private static final Map<String, AbsInterfaceWithPlatformLogic> platformMap = Maps.newHashMap();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 注册
|
||||||
|
* @param str
|
||||||
|
* @param handler
|
||||||
|
*/
|
||||||
|
public static void register(String str, AbsInterfaceWithPlatformLogic handler) {
|
||||||
|
if (StringUtils.isBlank(str) || Objects.isNull(handler)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
platformMap.put(str, handler);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取
|
||||||
|
* @param name
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static AbsInterfaceWithPlatformLogic getPlatformLogic(String name) {
|
||||||
|
return platformMap.get(name);
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user