| | |
| | | String[] relUserIdArray = relUserIds.split(","); |
| | | ShopRelUser shopRelUser; |
| | | Long userId; |
| | | for (String str : relUserIdArray) { |
| | | userId = Long.valueOf(str); |
| | | shopRelUser = shopRelUserService.getByUserId(userId); |
| | | if(shopRelUser!=null){ |
| | | throw new ServiceException(AppErrorConstant.SHOP_USER_DOUBLE); |
| | | if(mgtEditShopDto.getShopId()!=null){ |
| | | for (String str : relUserIdArray) { |
| | | userId = Long.valueOf(str); |
| | | shopRelUser = shopRelUserService.getByUserId(userId); |
| | | if(shopRelUser!=null&&!shopRelUser.getShopId().equals(mgtEditShopDto.getShopId())){ |
| | | throw new ServiceException(AppErrorConstant.SHOP_USER_DOUBLE); |
| | | } |
| | | } |
| | | }else { |
| | | for (String str : relUserIdArray) { |
| | | userId = Long.valueOf(str); |
| | | shopRelUser = shopRelUserService.getByUserId(userId); |
| | | if(shopRelUser!=null){ |
| | | throw new ServiceException(AppErrorConstant.SHOP_USER_DOUBLE); |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | //验证商户名唯一 |
| | | Shop shopSame = this.getOne(new LambdaQueryWrapper<Shop>().eq(Shop::getDelFlag,0).eq(Shop::getShopName,mgtEditShopDto.getShopName())); |