From 3d18ffe2196677fe9669f0ff2085413803d4a73c Mon Sep 17 00:00:00 2001 From: puzhibing <393733352@qq.com> Date: 星期五, 26 一月 2024 16:59:59 +0800 Subject: [PATCH] 修改数据权限bug --- ruoyi-modules/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/order/OrderServiceImpl.java | 63 +++++++++++++++++++------------ 1 files changed, 39 insertions(+), 24 deletions(-) diff --git a/ruoyi-modules/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/order/OrderServiceImpl.java b/ruoyi-modules/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/order/OrderServiceImpl.java index 1b7f67e..4332bf0 100644 --- a/ruoyi-modules/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/order/OrderServiceImpl.java +++ b/ruoyi-modules/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/order/OrderServiceImpl.java @@ -3031,7 +3031,9 @@ } //数据权限 List<Long> userId = remoteUserService.getScopeOfAuthorityUserId(); - List<Shop> shops = remoteShopService.getShopBySysUserIds(userId); + BoardMemberTotalDto boardMemberTotalDto = new BoardMemberTotalDto(); + boardMemberTotalDto.setUserIds(userId); + List<Shop> shops = remoteShopService.getShopBySysUserIds(boardMemberTotalDto); if (!shops.isEmpty()) { List<Long> collect = shops.stream().map(Shop::getShopId).collect(Collectors.toList()); String join = collect.stream().map(Object::toString).collect(Collectors.joining(",")); @@ -3126,7 +3128,9 @@ } //数据权限 List<Long> userId = remoteUserService.getScopeOfAuthorityUserId(); - List<Shop> shops = remoteShopService.getShopBySysUserIds(userId); + BoardMemberTotalDto boardMemberTotalDto = new BoardMemberTotalDto(); + boardMemberTotalDto.setUserIds(userId); + List<Shop> shops = remoteShopService.getShopBySysUserIds(boardMemberTotalDto); if (!shops.isEmpty()) { List<Long> collect = shops.stream().map(Shop::getShopId).collect(Collectors.toList()); String join = collect.stream().map(Object::toString).collect(Collectors.joining(",")); @@ -3187,7 +3191,9 @@ } //数据权限 List<Long> userId = remoteUserService.getScopeOfAuthorityUserId(); - List<Shop> shops = remoteShopService.getShopBySysUserIds(userId); + BoardMemberTotalDto boardMemberTotalDto = new BoardMemberTotalDto(); + boardMemberTotalDto.setUserIds(userId); + List<Shop> shops = remoteShopService.getShopBySysUserIds(boardMemberTotalDto); if (!shops.isEmpty()) { List<Long> collect = shops.stream().map(Shop::getShopId).collect(Collectors.toList()); String join = collect.stream().map(Object::toString).collect(Collectors.joining(",")); @@ -3360,7 +3366,9 @@ */ @Override public MgtBulletinBoardVo boardOrderTotal(List<Long> userIds) { - List<Shop> shopList = remoteShopService.getShopBySysUserIds(userIds); + BoardMemberTotalDto boardMemberTotalDto = new BoardMemberTotalDto(); + boardMemberTotalDto.setUserIds(userIds); + List<Shop> shopList = remoteShopService.getShopBySysUserIds(boardMemberTotalDto); List<Long> collect = shopList.stream().map(Shop::getShopId).collect(Collectors.toList()); MgtBulletinBoardVo mgtBulletinBoardVo = orderMapper.boardOrderTotal(collect); Integer activityUserTotal = orderMapper.activityUserTotal(collect); @@ -3871,14 +3879,16 @@ } } //数据权限 - List<Long> userIdList = mgtBasePlatformDto.getUserIdList(); List<Long> userIds = remoteUserService.getScopeOfAuthorityUserId(); - if(null != userIdList){ - userIdList.addAll(userIds); - }else{ - userIdList = userIds; + if(null != userIds){ + List<Long> userIdList = mgtBasePlatformDto.getUserIdList(); + if(null != userIdList){ + userIdList.addAll(userIds); + }else{ + userIdList = userIds; + } + mgtBasePlatformDto.setUserIdList(userIdList); } - mgtBasePlatformDto.setUserIdList(userIdList); List<Long> shopIdList = new ArrayList<>(); @@ -4222,6 +4232,14 @@ return totalActivityTotalVo; } + //数据权限 + List<Long> userIds = remoteUserService.getScopeOfAuthorityUserId(); + if(null != userIds){ + List<Long> userIdList = mgtBasePlatformDto.getUserIdList(); + userIdList.addAll(userIds); + mgtBasePlatformDto.setUserIdList(userIdList); + } + List<Long> shopIdList = remoteShopService.listShopIdByPlTotal(mgtBasePlatformDto).getData(); if (StringUtils.isNotBlank(mgtBasePlatformDto.getShopProvinceCode()) || StringUtils.isNotBlank(mgtBasePlatformDto.getShopCityCode()) || StringUtils.isNotBlank(mgtBasePlatformDto.getShopAreaCode())) { if(shopIdList==null||shopIdList.isEmpty()){ @@ -4232,16 +4250,7 @@ shopIdList = new ArrayList<>(); shopIdList.add(mgtBasePlatformDto.getShopId()); } - //数据权限 - List<Long> userIds = remoteUserService.getScopeOfAuthorityUserId(); - List<Shop> shopList = remoteShopService.getShopBySysUserIds(userIds); - List<Long> collect = shopList.stream().map(Shop::getShopId).collect(Collectors.toList()); - if(null != shopIdList){ - shopIdList.addAll(collect); - }else{ - shopIdList = collect; - } - mgtBasePlatformDto.setShopIdList(shopIdList); + //获取基础统计 MgtPlTotalActivityTotalVo mgtTotalActivityTotalVo = orderMapper.getPlTotalActivityTotal(mgtBasePlatformDto); totalActivityTotalVo.setOrderTotal(mgtTotalActivityTotalVo.getOrderTotal()); @@ -4348,8 +4357,10 @@ } HashSet<String> set = new HashSet<>(); // 遍历MgtMemberOrderPageVoList,获取shopId并添加到set中 - for (Long shopId : mgtBasePlatformDto.getShopIdList()) { - set.add(shopId.toString()); + if(null != mgtBasePlatformDto.getShopIdList()){ + for (Long shopId : mgtBasePlatformDto.getShopIdList()) { + set.add(shopId.toString()); + } } // 将set中的shopId转换为逗号分隔的字符串 String joinedString = String.join(",", set); @@ -4450,7 +4461,9 @@ } List<Long> userIds = remoteUserService.getScopeOfAuthorityUserId(); - List<Shop> shopList = remoteShopService.getShopBySysUserIds(userIds); + BoardMemberTotalDto boardMemberTotalDto = new BoardMemberTotalDto(); + boardMemberTotalDto.setUserIds(userIds); + List<Shop> shopList = remoteShopService.getShopBySysUserIds(boardMemberTotalDto); List<Long> collect = shopList.stream().map(Shop::getShopId).collect(Collectors.toList()); if(null != shopIdList){ shopIdList.addAll(collect); @@ -4521,7 +4534,9 @@ } //数据权限 List<Long> userIds = remoteUserService.getScopeOfAuthorityUserId(); - List<Shop> shopList = remoteShopService.getShopBySysUserIds(userIds); + BoardMemberTotalDto boardMemberTotalDto = new BoardMemberTotalDto(); + boardMemberTotalDto.setUserIds(userIds); + List<Shop> shopList = remoteShopService.getShopBySysUserIds(boardMemberTotalDto); List<Long> collect = shopList.stream().map(Shop::getShopId).collect(Collectors.toList()); if(null != shopIdList){ shopIdList.addAll(collect); -- Gitblit v1.7.1