| | |
| | | List<Long> userIdList = new ArrayList<>(); |
| | | if (mgtBasePlatformDto.getUserId() != null) { |
| | | userIdList.add(mgtBasePlatformDto.getUserId()); |
| | | } else { |
| | | MgtUserIdByDept mgtUserIdByDept = new MgtUserIdByDept(); |
| | | mgtUserIdByDept.setDeptId(mgtBasePlatformDto.getUserId()); |
| | | mgtUserIdByDept = remoteConfigService.getUserIdByDept(mgtUserIdByDept).getData(); |
| | | userIdList = mgtUserIdByDept.getUserIdList(); |
| | | } |
| | | else { |
| | | // 如果当前登陆人的可视权限是仅个人 只选择了部门也只能看自己的数据 |
| | | SysUser sysUser = SecurityUtils.getSysUser(); |
| | | if (sysUser.getDataScope().equals("5")){ |
| | | userIdList.add(sysUser.getUserId()); |
| | | }else{ |
| | | MgtUserIdByDept mgtUserIdByDept = new MgtUserIdByDept(); |
| | | mgtUserIdByDept.setDeptId(mgtBasePlatformDto.getDeptId()); |
| | | mgtUserIdByDept = remoteConfigService.getUserIdByDept(mgtUserIdByDept).getData(); |
| | | userIdList = mgtUserIdByDept.getUserIdList(); |
| | | } |
| | | } |
| | | if (!userIdList.isEmpty()) { |
| | | mgtBasePlatformDto.setUserIdList(userIdList); |
| | | } |
| | | }else{ |
| | | // 没有选择筛选部门和员工 获取当前登陆人的可视权限 |
| | | SysUser sysUser = SecurityUtils.getSysUser(); |
| | | // 如果当前登陆人是查看个人数据 |
| | | Long userId1 = null; |
| | | // 如果当前登陆人权限是查看部门数据 |
| | | List<Long> userList = new ArrayList<>(); |
| | | if (sysUser!=null){ |
| | | String dataScope = sysUser.getDataScope(); |
| | | if (!sysUser.getUserName().equals("admin")){ |
| | | if (org.springframework.util.StringUtils.hasLength(dataScope)){ |
| | | switch (dataScope){ |
| | | case "3": |
| | | // 本部门数据 查询当前登陆人属于哪个部门 查询这个部门下所有员工关联的所有店铺 |
| | | MgtUserIdByDept mgtUserIdByDept = new MgtUserIdByDept(); |
| | | mgtUserIdByDept.setDeptId(sysUser.getDeptId()); |
| | | mgtUserIdByDept = remoteConfigService.getUserIdByDept(mgtUserIdByDept).getData(); |
| | | userList = mgtUserIdByDept.getUserIdList(); |
| | | mgtBasePlatformDto.setDeptId(sysUser.getDeptId()); |
| | | mgtBasePlatformDto.setUserIdList(userList); |
| | | case "5": |
| | | // 仅个人数据 查询当前登陆人关联店铺下的用户 |
| | | userId1 = sysUser.getUserId(); |
| | | userList.add(userId1); |
| | | mgtBasePlatformDto.setDeptId(sysUser.getDeptId()); |
| | | mgtBasePlatformDto.setUserIdList(userList); |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | //数据权限 |
| | |
| | | mgtTotalOrderTotalVo.setGoodsTypeMoneyList(Lists.newArrayList()); |
| | | mgtTotalOrderTotalVo.setGoodsRankList(Lists.newArrayList()); |
| | | mgtTotalOrderTotalVo.setOrderFromRankList(Lists.newArrayList()); |
| | | |
| | | List<Long> shopIdList = remoteShopService.listShopIdByPlTotal(mgtBasePlatformDto).getData(); |
| | | if (mgtBasePlatformDto.getUserId() != null || StringUtils.isNotBlank(mgtBasePlatformDto.getShopProvinceCode()) || StringUtils.isNotBlank(mgtBasePlatformDto.getShopCityCode()) || StringUtils.isNotBlank(mgtBasePlatformDto.getShopAreaCode())) { |
| | | if(shopIdList==null||shopIdList.isEmpty()){ |