fix addBranchShop

This commit is contained in:
shuo.wang
2025-01-22 11:43:29 +08:00
parent 07cd613e32
commit 58d571f1a4
2 changed files with 8 additions and 2 deletions

View File

@@ -23,7 +23,6 @@ public class AddBranchShopRequest {
@NotNull
private Long lineId;
@ApiModelProperty("门店名称")
@NotBlank
private String shopName;
@ApiModelProperty("意向开店区域")
@NotNull

View File

@@ -261,12 +261,19 @@ public class ShopServiceImpl implements ShopService {
if (lineInfo.getWorkflowSubStageStatus() < WorkflowSubStageStatusEnum.PAY_DEPOSIT_45.getCode()) {
throw new ServiceException(ErrorCodeEnum.LINE_STATUS_NOT_ALLOW_OPERATE);
}
ShopInfoDO shopInfoDO = request.toDO(request, lineInfo.getPartnerId());
List<ShopInfoDO> shopList = shopInfoDAO.getShopList(lineInfo.getId());
if (CollectionUtils.isNotEmpty(shopList)) {
if (StringUtils.isBlank(request.getShopName())) {
shopInfoDO.setShopName("店铺" + NumberConverter.convertArabicToChinese(lineInfo.getWantShopNum()+1));
}
lineInfo.setWantShopNum(lineInfo.getWantShopNum() + 1);
lineInfoDAO.updateLineInfo(lineInfo);
}else {
if (StringUtils.isBlank(request.getShopName())) {
shopInfoDO.setShopName("店铺" + NumberConverter.convertArabicToChinese(lineInfo.getWantShopNum()));
}
}
ShopInfoDO shopInfoDO = request.toDO(request, lineInfo.getPartnerId());
shopInfoDO.setCreateUserId(userId);
Long shopId = shopInfoDAO.addShopInfo(shopInfoDO);
if (lineInfo.getWorkflowSubStageStatus().equals(WorkflowSubStageStatusEnum.SIGN_INTENT_AGREEMENT_125.getCode())) {