根据意向区域找大区id

This commit is contained in:
wangxiaopeng
2024-03-29 13:30:24 +08:00
parent c5f8f25380
commit 271c5f4f8e
4 changed files with 54 additions and 2 deletions

View File

@@ -0,0 +1,44 @@
package com.cool.store.enums;
import java.util.Arrays;
import java.util.Map;
import java.util.function.Function;
import java.util.stream.Collectors;
/**
* 区域类型 0-根;1=大区;2=战区;3=小区(督导区);4=门店
* @author wxp
*/
public enum ThirdRegionTypeEnum {
ROOT("0",""),
LARGE_REGION("1","大区"),
WAR_REGION("2","战区"),
COMMUNITY_REGION("3","小区"),
STORE("4","门店");
private String code;
private String desc;
public static final Map<String, ThirdRegionTypeEnum> map = Arrays.stream(values()).collect(
Collectors.toMap(ThirdRegionTypeEnum::getCode, Function.identity()));
ThirdRegionTypeEnum(String code, String desc) {
this.code = code;
this.desc = desc;
}
public String getCode() {
return code;
}
public String getDesc() {
return desc;
}
public static ThirdRegionTypeEnum getByCode(String code) {
return map.get(code);
}
}