无关风月
2024-11-14 8a025d3351fe4c6087c0dbf430624f4349e33d69
xinquan-modules/xinquan-system/src/main/java/com/xinquan/system/controller/SysUserController.java
@@ -96,7 +96,14 @@
        for (SysUserVO record : list.getRecords()) {
            List<Long> collect1 = sysUserRoleService.lambdaQuery().eq(SysUserRole::getUserId, record.getUserId())
                    .list().stream().map(SysUserRole::getRoleId).collect(Collectors.toList());
            record.setRole(collect1);
            List<Long> longs1 = new ArrayList<>();
            for (Long l : collect1) {
                SysRole sysDept = roleService.selectRoleById(l);
                if (sysDept!=null){
                    longs1.add(sysDept.getRoleId());
                }
            }
            record.setRole(longs1);
            List<String> strings1 = new ArrayList<>();
            if (record.getRole()!=null && (!record.getRole().isEmpty())){
                for (Long l : collect1) {
@@ -109,7 +116,14 @@
            record.setRoleNames(strings1);
            List<Long> collect2 = sysUserDeptService.lambdaQuery().eq(SysUserDept::getUserId, record.getUserId())
                    .list().stream().map(SysUserDept::getDeptId).collect(Collectors.toList());
            record.setDeptIds(collect2);
            List<Long> longs2 = new ArrayList<>();
            for (Long l : collect2) {
                SysDept sysDept = deptService.selectDeptById(l);
                if (sysDept!=null){
                    longs2.add(sysDept.getDeptId());
                }
            }
            record.setDeptIds(longs2);
            List<String> strings = new ArrayList<>();
            if (record.getDeptIds()!=null && (!record.getDeptIds().isEmpty())){
                for (Long deptId : record.getDeptIds()) {