| | |
| | | import com.ruoyi.common.core.utils.uuid.IdUtils; |
| | | import com.ruoyi.common.security.utils.CodeFactoryUtil; |
| | | import com.ruoyi.shop.domain.dto.*; |
| | | import com.ruoyi.shop.domain.pojo.shop.ShopTotal; |
| | | import com.ruoyi.shop.domain.pojo.shop.*; |
| | | import com.ruoyi.shop.domain.pojo.task.ShopFile; |
| | | import com.ruoyi.shop.domain.vo.*; |
| | |
| | | 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())); |
| | |
| | | mgtShopAuthCodeVo.setLegalValidationUrl(shopAuthentication.getLegalValidationUrl()); |
| | | return mgtShopAuthCodeVo; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * @description 获取商户下属代理商 |
| | | * @author jqs |
| | | * @date 2023/7/3 17:27 |
| | | * @param shopId |
| | | * @return List<Long> |
| | | */ |
| | | @Override |
| | | public List<Long> listShopIdByShopId(Long shopId){ |
| | | List<Long> shopIds = shopMapper.selectList( |
| | | new LambdaQueryWrapper<Shop>().eq(Shop::getDelFlag, 0).eq(Shop::getBelongShopId, shopId) |
| | | ).stream().map(Shop::getShopId).collect(Collectors.toList()); |
| | | return shopIds; |
| | | } |
| | | |
| | | /** |
| | | * @description 获取商户下属代理商 |
| | | * @author jqs |
| | | * @date 2023/7/3 18:18 |
| | | * @param shopId |
| | | * @return List<MgtSimpleShopVo> |
| | | */ |
| | | @Override |
| | | public List<MgtSimpleShopVo> listShopByShop(Long shopId){ |
| | | List<MgtSimpleShopVo> simpleShopVoList = shopMapper.selectList( |
| | | new LambdaQueryWrapper<Shop>().eq(Shop::getDelFlag, 0).eq(Shop::getBelongShopId, shopId)). |
| | | stream().map(shop->{ |
| | | MgtSimpleShopVo simpleShopVo = new MgtSimpleShopVo(); |
| | | simpleShopVo.setShopId(shop.getShopId()); |
| | | simpleShopVo.setShopName(shop.getShopName()); |
| | | return simpleShopVo; |
| | | }).collect(Collectors.toList()); |
| | | return simpleShopVoList; |
| | | } |
| | | } |