mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-21 19:45:09 +08:00
update 对接第三方平台
This commit is contained in:
@@ -9,53 +9,87 @@ import com.jsowell.common.util.StringUtils;
|
||||
* @Date 2023/10/23 8:21:33
|
||||
*/
|
||||
public enum ThirdPlatformTypeEnum {
|
||||
LIAN_LIAN_PLATFORM("1", "上海联联平台"),
|
||||
ZHONG_DIAN_LIAN_PLATFORM("2", "中电联平台"),
|
||||
JIANG_SU_PLATFORM("3", "江苏省平台"),
|
||||
YONG_CHENG_BO_CHE("4", "甬城泊车平台"),
|
||||
NING_XIA_JIAO_TOU("5", "宁夏交投"),
|
||||
XIN_DIAN_TU("6", "新电途平台"),
|
||||
HAI_NAN_1("7", "海南一张网(监管平台)"),
|
||||
HAI_NAN_2("8", "海南一张网(充电平台)"),
|
||||
HUA_WEI("9", "华为平台"),
|
||||
NEI_MENG_GU_PLATFORM("10", "内蒙古平台"),
|
||||
LIAN_LIAN_PLATFORM("1", "上海联联平台", "425010765"),
|
||||
ZHONG_DIAN_LIAN_PLATFORM("2", "中电联平台", "14405899X"),
|
||||
JIANG_SU_PLATFORM("3", "江苏省平台", "726079387"),
|
||||
YONG_CHENG_BO_CHE("4", "甬城泊车平台", "330205020"),
|
||||
NING_XIA_JIAO_TOU("5", "宁夏交投", "MA771QENX"),
|
||||
XIN_DIAN_TU("6", "新电途平台", "MA25CNM38"),
|
||||
HAI_NAN_1("7", "海南一张网(监管平台)", "578725200"),
|
||||
HAI_NAN_2("8", "海南一张网(充电平台)", "MAA9A0PP1"),
|
||||
HUA_WEI("9", "华为平台", "MA5GTQ528"),
|
||||
NEI_MENG_GU_PLATFORM("10", "内蒙古平台", ""),
|
||||
;
|
||||
|
||||
private String code;
|
||||
private String typeCode;
|
||||
|
||||
private String label;
|
||||
private String typeLabel;
|
||||
|
||||
public String getCode() {
|
||||
return code;
|
||||
private String operatorId;
|
||||
|
||||
public String getTypeCode() {
|
||||
return typeCode;
|
||||
}
|
||||
|
||||
public void setCode(String code) {
|
||||
this.code = code;
|
||||
public void setTypeCode(String typeCode) {
|
||||
this.typeCode = typeCode;
|
||||
}
|
||||
|
||||
public String getLabel() {
|
||||
return label;
|
||||
public String getTypeLabel() {
|
||||
return typeLabel;
|
||||
}
|
||||
|
||||
public void setLabel(String label) {
|
||||
this.label = label;
|
||||
public void setTypeLabel(String typeLabel) {
|
||||
this.typeLabel = typeLabel;
|
||||
}
|
||||
|
||||
ThirdPlatformTypeEnum(String code, String label) {
|
||||
this.code = code;
|
||||
this.label = label;
|
||||
public String getOperatorId() {
|
||||
return operatorId;
|
||||
}
|
||||
|
||||
public void setOperatorId(String operatorId) {
|
||||
this.operatorId = operatorId;
|
||||
}
|
||||
|
||||
ThirdPlatformTypeEnum(String typeCode, String typeLabel, String operatorId) {
|
||||
this.typeCode = typeCode;
|
||||
this.typeLabel = typeLabel;
|
||||
this.operatorId = operatorId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据code获取停止原因描述
|
||||
*
|
||||
* @param code 编码
|
||||
* @return 停止原因描述
|
||||
* 根据 type 获取 label
|
||||
*/
|
||||
public static String getLabelByCode(String code) {
|
||||
public static String getTypeLabelByTypeCode(String typeCode) {
|
||||
for (ThirdPlatformTypeEnum item : ThirdPlatformTypeEnum.values()) {
|
||||
if (StringUtils.equals(item.getCode(), code)) {
|
||||
return item.getLabel();
|
||||
if (StringUtils.equals(item.getTypeCode(), typeCode)) {
|
||||
return item.getTypeLabel();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据 type 获取 operatorId
|
||||
*/
|
||||
public static String getOperatorIdByCode(String typeCode) {
|
||||
for (ThirdPlatformTypeEnum item : ThirdPlatformTypeEnum.values()) {
|
||||
if (StringUtils.equals(item.getTypeCode(), typeCode)) {
|
||||
return item.getOperatorId();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据operatorId获取平台类型code
|
||||
* @param operatorId
|
||||
* @return
|
||||
*/
|
||||
public static String getTypeCodeByOperatorId(String operatorId) {
|
||||
for (ThirdPlatformTypeEnum item : ThirdPlatformTypeEnum.values()) {
|
||||
if (StringUtils.equals(item.getOperatorId(), operatorId)) {
|
||||
return item.getTypeCode();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user