fix addBranchShop

This commit is contained in:
shuo.wang
2025-02-12 18:45:37 +08:00
parent ba1d1758f6
commit abfad1f11d

View File

@@ -263,12 +263,19 @@ public class ShopServiceImpl implements ShopService {
}
ShopInfoDO shopInfoDO = request.toDO(request, lineInfo);
List<ShopInfoDO> shopList = shopInfoDAO.getShopList(lineInfo.getId());
if(StringUtils.isBlank(request.getShopName())){
if (CollectionUtils.isNotEmpty(shopList)) {
shopInfoDO.setShopName("店铺"+NumberConverter.convertArabicToChinese(lineInfo.getWantShopNum() + 1));
}else{
shopInfoDO.setShopName("店铺"+NumberConverter.convertArabicToChinese(lineInfo.getWantShopNum()));
}
}else{
shopInfoDO.setShopName(request.getShopName());
}
if (CollectionUtils.isNotEmpty(shopList)) {
shopInfoDO.setShopName("店铺"+NumberConverter.convertArabicToChinese(lineInfo.getWantShopNum() + 1));
lineInfo.setWantShopNum(lineInfo.getWantShopNum() + 1);
lineInfoDAO.updateLineInfo(lineInfo);
}else {
shopInfoDO.setShopName("店铺"+NumberConverter.convertArabicToChinese(lineInfo.getWantShopNum()));
}
shopInfoDO.setCreateUserId(userId);
Long shopId = shopInfoDAO.addShopInfo(shopInfoDO);