优化店铺初始化方法
This commit is contained in:
@@ -54,8 +54,13 @@ public class ShopServiceImpl implements ShopService {
|
||||
throw new ServiceException(ErrorCodeEnum.LINE_ID_IS_NOT_EXIST);
|
||||
}
|
||||
Integer wantShopNum = lineInfo.getWantShopNum();
|
||||
List<ShopInfoDO> shopList = shopInfoDAO.getShopList(lineInfo.getId());
|
||||
int shopSize = shopList.size();
|
||||
if(shopSize >= wantShopNum){
|
||||
return 0;
|
||||
}
|
||||
List<ShopInfoDO> addShopList = new ArrayList<>();
|
||||
for (int i = 0; i < wantShopNum; i++) {
|
||||
for (int i = shopSize; i < wantShopNum; i++) {
|
||||
ShopInfoDO shopInfo = new ShopInfoDO();
|
||||
shopInfo.setRegionId(lineInfo.getRegionId());
|
||||
shopInfo.setLineId(lineInfo.getId());
|
||||
|
||||
Reference in New Issue
Block a user