修改增加意向门店接口

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 * @Author: WangShuo
* @Date: 2024/11/04/下午7:00 * @Date: 2024/11/04/下午7:00
* @Version 1.0 * @Version 1.0
@@ -23,15 +32,19 @@ public enum FranchiseBrandEnum {
public String getDesc() { public String getDesc() {
return desc; return desc;
} }
public static String getDescByCode(Integer code) { public static String getDescByCode(String code) {
if (code == null){ if (StringUtils.isBlank(code)){
return null; return null;
} }
List<Integer> integerList = Arrays.stream(code.split(","))
.map(Integer::parseInt)
.collect(Collectors.toList());
StringBuffer stringBuffer = new StringBuffer();
for (FranchiseBrandEnum e : FranchiseBrandEnum.values()) { for (FranchiseBrandEnum e : FranchiseBrandEnum.values()) {
if (e.getCode() == code) { if (integerList.contains(e.getCode())) {
return e.getDesc(); stringBuffer.append(e.getDesc()).append(",");
} }
} }
return null; return stringBuffer.toString();
} }
} }

View File

@@ -43,7 +43,7 @@ public class PreparationDTO {
private Date createTime; private Date createTime;
private Integer franchiseBrand; private String franchiseBrand;
private Integer joinMode; private Integer joinMode;

View File

@@ -118,7 +118,7 @@ public class ShopInfoDO {
private Integer joinMode; private Integer joinMode;
@Column(name = "franchise_brand") @Column(name = "franchise_brand")
private Integer franchiseBrand; private String franchiseBrand;
@Column(name = "development_manager") @Column(name = "development_manager")
private String developmentManager; private String developmentManager;

View File

@@ -34,18 +34,16 @@ public class AddBranchShopRequest {
@Max(3) @Max(3)
@ApiModelProperty(" 加盟模式//'1-社会加盟模式/加盟部加盟店 2-强加盟模式/加盟公司加盟店 3-加盟公司自有店',") @ApiModelProperty(" 加盟模式//'1-社会加盟模式/加盟部加盟店 2-强加盟模式/加盟公司加盟店 3-加盟公司自有店',")
private Integer joinMode; private Integer joinMode;
@NotNull @NotBlank
@Min(1)
@Max(6)
@ApiModelProperty("'加盟品牌1,\"正新鸡排\"2,\"正新三明治\"3,\"正烧记\"4,\"大鼓米线\"5,\"串小妹\"6,\"茂掌柜\"'") @ApiModelProperty("'加盟品牌1,\"正新鸡排\"2,\"正新三明治\"3,\"正烧记\"4,\"大鼓米线\"5,\"串小妹\"6,\"茂掌柜\"'")
private Integer franchiseBrand; private String franchiseBrand;
@ApiModelProperty("督导") @ApiModelProperty("督导")
private String investmentManagerUserId; private String investmentManagerUserId;
@NotNull @NotNull
@ApiModelProperty("所属大区") @ApiModelProperty("所属大区")
private Long regionId; private Long regionId;
public ShopInfoDO toDO(AddBranchShopRequest request,String partnerId){ public ShopInfoDO toDO(AddBranchShopRequest request, String partnerId) {
ShopInfoDO shopInfoDO = new ShopInfoDO(); ShopInfoDO shopInfoDO = new ShopInfoDO();
shopInfoDO.setLineId(request.getLineId()); shopInfoDO.setLineId(request.getLineId());
shopInfoDO.setShopName(request.getShopName()); shopInfoDO.setShopName(request.getShopName());

View File

@@ -5,6 +5,7 @@ import lombok.Data;
import javax.validation.constraints.Max; import javax.validation.constraints.Max;
import javax.validation.constraints.Min; import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
/** /**
@@ -26,7 +27,7 @@ public class BranchShopDetailRequest {
@Max(3) @Max(3)
@ApiModelProperty("加盟模式 1-社会加盟模式/加盟部加盟店 2-强加盟模式/加盟公司加盟店 3-加盟公司自有店") @ApiModelProperty("加盟模式 1-社会加盟模式/加盟部加盟店 2-强加盟模式/加盟公司加盟店 3-加盟公司自有店")
private Integer joinMode; private Integer joinMode;
@NotNull @NotBlank
@ApiModelProperty("加盟品牌") @ApiModelProperty("加盟品牌")
private Integer franchiseBrand; private String franchiseBrand;
} }

View File

@@ -38,7 +38,7 @@ public class BranchShopDetailResponse {
private Integer completionColumn; private Integer completionColumn;
@ApiModelProperty("所属品牌 1,\"正新鸡排\"2,\"正新三明治\"3,\"正烧记\"4,\"大鼓米线\"5,\"串小妹\"6,\"茂掌柜\"") @ApiModelProperty("所属品牌 1,\"正新鸡排\"2,\"正新三明治\"3,\"正烧记\"4,\"大鼓米线\"5,\"串小妹\"6,\"茂掌柜\"")
private Integer franchiseBrand; private String franchiseBrand;
@ApiModelProperty("预估完成时间") @ApiModelProperty("预估完成时间")
private Date planCompletionTime; private Date planCompletionTime;

View File

@@ -271,7 +271,7 @@ public class ShopServiceImpl implements ShopService {
response.setShopName(shopInfo.getShopName()); response.setShopName(shopInfo.getShopName());
response.setJoinMode(shopInfo.getJoinMode()); response.setJoinMode(shopInfo.getJoinMode());
response.setShopCode(shopInfo.getShopCode()); response.setShopCode(shopInfo.getShopCode());
response.setFranchiseBrand(shopInfo.getFranchiseBrand()); response.setFranchiseBrand(FranchiseBrandEnum.getDescByCode(shopInfo.getFranchiseBrand()));
if (CollectionUtils.isNotEmpty(shopContractActualCompletionTime)) { if (CollectionUtils.isNotEmpty(shopContractActualCompletionTime)) {
ScheduleDTO scheduleDTO = shopContractActualCompletionTime.get(CommonConstants.ZERO); ScheduleDTO scheduleDTO = shopContractActualCompletionTime.get(CommonConstants.ZERO);
response.setCompletionColumn(scheduleDTO.getCompletionColumn()); response.setCompletionColumn(scheduleDTO.getCompletionColumn());