修改增加意向门店接口
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ public class PreparationDTO {
|
||||
|
||||
private Date createTime;
|
||||
|
||||
private Integer franchiseBrand;
|
||||
private String franchiseBrand;
|
||||
|
||||
private Integer joinMode;
|
||||
|
||||
|
||||
@@ -118,7 +118,7 @@ public class ShopInfoDO {
|
||||
private Integer joinMode;
|
||||
|
||||
@Column(name = "franchise_brand")
|
||||
private Integer franchiseBrand;
|
||||
private String franchiseBrand;
|
||||
|
||||
@Column(name = "development_manager")
|
||||
private String developmentManager;
|
||||
|
||||
@@ -34,18 +34,16 @@ public class AddBranchShopRequest {
|
||||
@Max(3)
|
||||
@ApiModelProperty(" 加盟模式//'1-社会加盟模式/加盟部加盟店 2-强加盟模式/加盟公司加盟店 3-加盟公司自有店',")
|
||||
private Integer joinMode;
|
||||
@NotNull
|
||||
@Min(1)
|
||||
@Max(6)
|
||||
@NotBlank
|
||||
@ApiModelProperty("'加盟品牌1,\"正新鸡排\",2,\"正新三明治\",3,\"正烧记\"4,\"大鼓米线\"5,\"串小妹\"6,\"茂掌柜\"'")
|
||||
private Integer franchiseBrand;
|
||||
private String franchiseBrand;
|
||||
@ApiModelProperty("督导")
|
||||
private String investmentManagerUserId;
|
||||
@NotNull
|
||||
@ApiModelProperty("所属大区")
|
||||
private Long regionId;
|
||||
|
||||
public ShopInfoDO toDO(AddBranchShopRequest request,String partnerId){
|
||||
public ShopInfoDO toDO(AddBranchShopRequest request, String partnerId) {
|
||||
ShopInfoDO shopInfoDO = new ShopInfoDO();
|
||||
shopInfoDO.setLineId(request.getLineId());
|
||||
shopInfoDO.setShopName(request.getShopName());
|
||||
|
||||
@@ -5,6 +5,7 @@ import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.Max;
|
||||
import javax.validation.constraints.Min;
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
@@ -26,7 +27,7 @@ public class BranchShopDetailRequest {
|
||||
@Max(3)
|
||||
@ApiModelProperty("加盟模式 1-社会加盟模式/加盟部加盟店 2-强加盟模式/加盟公司加盟店 3-加盟公司自有店")
|
||||
private Integer joinMode;
|
||||
@NotNull
|
||||
@NotBlank
|
||||
@ApiModelProperty("加盟品牌")
|
||||
private Integer franchiseBrand;
|
||||
private String franchiseBrand;
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ public class BranchShopDetailResponse {
|
||||
private Integer completionColumn;
|
||||
|
||||
@ApiModelProperty("所属品牌 1,\"正新鸡排\",2,\"正新三明治\",3,\"正烧记\"4,\"大鼓米线\"5,\"串小妹\"6,\"茂掌柜\"")
|
||||
private Integer franchiseBrand;
|
||||
private String franchiseBrand;
|
||||
|
||||
@ApiModelProperty("预估完成时间")
|
||||
private Date planCompletionTime;
|
||||
|
||||
@@ -271,7 +271,7 @@ public class ShopServiceImpl implements ShopService {
|
||||
response.setShopName(shopInfo.getShopName());
|
||||
response.setJoinMode(shopInfo.getJoinMode());
|
||||
response.setShopCode(shopInfo.getShopCode());
|
||||
response.setFranchiseBrand(shopInfo.getFranchiseBrand());
|
||||
response.setFranchiseBrand(FranchiseBrandEnum.getDescByCode(shopInfo.getFranchiseBrand()));
|
||||
if (CollectionUtils.isNotEmpty(shopContractActualCompletionTime)) {
|
||||
ScheduleDTO scheduleDTO = shopContractActualCompletionTime.get(CommonConstants.ZERO);
|
||||
response.setCompletionColumn(scheduleDTO.getCompletionColumn());
|
||||
|
||||
Reference in New Issue
Block a user