修改增加意向门店接口

This commit is contained in:
shuo.wang
2025-01-10 18:00:32 +08:00
parent 2f962e4039
commit 0ee5a24a76
7 changed files with 29 additions and 17 deletions

View File

@@ -1,4 +1,13 @@
package com.cool.store.enums;/**
package com.cool.store.enums;
import com.cool.store.utils.StringUtil;
import org.apache.commons.lang3.StringUtils;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
/**
* @Author: WangShuo
* @Date: 2024/11/04/下午7:00
* @Version 1.0
@@ -23,15 +32,19 @@ public enum FranchiseBrandEnum {
public String getDesc() {
return desc;
}
public static String getDescByCode(Integer code) {
if (code == null){
public static String getDescByCode(String code) {
if (StringUtils.isBlank(code)){
return null;
}
List<Integer> integerList = Arrays.stream(code.split(","))
.map(Integer::parseInt)
.collect(Collectors.toList());
StringBuffer stringBuffer = new StringBuffer();
for (FranchiseBrandEnum e : FranchiseBrandEnum.values()) {
if (e.getCode() == code) {
return e.getDesc();
if (integerList.contains(e.getCode())) {
stringBuffer.append(e.getDesc()).append(",");
}
}
return null;
return stringBuffer.toString();
}
}