feat:addBranchShop

This commit is contained in:
苏竹红
2025-01-22 14:04:57 +08:00
parent 58d571f1a4
commit 492f2999ee
2 changed files with 7 additions and 11 deletions

View File

@@ -1,10 +1,13 @@
package com.cool.store.request;
import com.cool.store.entity.LineInfoDO;
import com.cool.store.entity.ShopInfoDO;
import com.cool.store.enums.point.ShopStageEnum;
import com.cool.store.enums.point.ShopStatusEnum;
import com.cool.store.utils.NumberConverter;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.apache.commons.lang3.StringUtils;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
@@ -42,10 +45,10 @@ public class AddBranchShopRequest {
@ApiModelProperty("所属大区")
private Long regionId;
public ShopInfoDO toDO(AddBranchShopRequest request, String partnerId) {
public ShopInfoDO toDO(AddBranchShopRequest request, LineInfoDO lineInfo) {
ShopInfoDO shopInfoDO = new ShopInfoDO();
shopInfoDO.setLineId(request.getLineId());
shopInfoDO.setShopName(request.getShopName());
shopInfoDO.setShopName(StringUtils.isNotBlank(request.getShopName())?request.getShopName():"店铺" + NumberConverter.convertArabicToChinese(lineInfo.getWantShopNum()+1));
shopInfoDO.setRegionId(request.getRegionId());
shopInfoDO.setShopName(request.getShopName());
shopInfoDO.setWantShopAreaId(request.getWantShopAreaId());
@@ -56,7 +59,7 @@ public class AddBranchShopRequest {
shopInfoDO.setCreateTime(new Date());
shopInfoDO.setShopStatus(ShopStatusEnum.ING.getCode());
shopInfoDO.setShopStage(ShopStageEnum.SHOP_STAGE_1.getShopStage());
shopInfoDO.setPartnerId(partnerId);
shopInfoDO.setPartnerId(lineInfo.getPartnerId());
shopInfoDO.setFranchiseBrand(request.getFranchiseBrand());
return shopInfoDO;
}