枚举值维护

This commit is contained in:
guohb
2024-05-17 15:58:44 +08:00
parent b463d7666f
commit 061789e27b
2 changed files with 15 additions and 5 deletions

View File

@@ -6,9 +6,9 @@ import java.util.function.Function;
import java.util.stream.Collectors;
public enum PassengerFlowEnum {
BELOW_1000(0,"1000以下"),
TO_1000_10000(1,"1000-1万"),
MORE_THAN_10000(2,"1万以上"),
BELOW_1000(0,"1000以下",10),
TO_1000_10000(1,"1000-1万",20),
MORE_THAN_10000(2,"1万以上",30),
@@ -16,10 +16,12 @@ public enum PassengerFlowEnum {
private Integer code;
private String desc;
private Integer type;
PassengerFlowEnum(Integer code, String desc) {
PassengerFlowEnum(Integer code, String desc,Integer type) {
this.code = code;
this.desc = desc;
this.type = type;
}
public Integer getCode() {
@@ -38,6 +40,14 @@ public enum PassengerFlowEnum {
this.desc = desc;
}
public Integer getType() {
return type;
}
public void setType(Integer type) {
this.type = type;
}
public static final Map<Integer, PassengerFlowEnum> map
= Arrays.stream(values()).collect(Collectors.toMap(PassengerFlowEnum::getCode, Function.identity()));

View File

@@ -383,7 +383,7 @@ public class SysStoreAppServiceImpl implements SysStoreAppService, AuditResultSe
// zmdzt
newStoreRequest.setZmdzt(10);
// zmrjkllzs1
newStoreRequest.setZmrjkllzs1(sysStoreAppRequest.getStoreDetail().getAverageDailyRs());
newStoreRequest.setZmrjkllzs1(PassengerFlowEnum.getByCode(sysStoreAppRequest.getStoreDetail().getAverageDailyRs()).getType());
// zppsyfy
newStoreRequest.setZppsyfy(0.05);
// zq