|
@ -67,6 +67,9 @@ public class AdminService { |
|
|
@Autowired |
|
|
@Autowired |
|
|
private AdminDeviceService deviceService; |
|
|
private AdminDeviceService deviceService; |
|
|
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
|
private MatrixUserMapper userMapper; |
|
|
|
|
|
|
|
|
public static final int SUPER_ADMIN = 1;//超级管理员
|
|
|
public static final int SUPER_ADMIN = 1;//超级管理员
|
|
|
public static final int NORMAL_ADMIN = 2;//普通管理员
|
|
|
public static final int NORMAL_ADMIN = 2;//普通管理员
|
|
|
public static final int OTHER = 3;//普通账号
|
|
|
public static final int OTHER = 3;//普通账号
|
|
@ -141,14 +144,24 @@ public class AdminService { |
|
|
List<MatrixAdmin> adminList = adminMapper.selectList(null); |
|
|
List<MatrixAdmin> adminList = adminMapper.selectList(null); |
|
|
Map<Integer, String> adminMap = adminList.stream().collect(Collectors.toMap(MatrixAdmin::getId, MatrixAdmin::getName)); |
|
|
Map<Integer, String> adminMap = adminList.stream().collect(Collectors.toMap(MatrixAdmin::getId, MatrixAdmin::getName)); |
|
|
res.total = iPage.getTotal(); |
|
|
res.total = iPage.getTotal(); |
|
|
res.data = iPage.getRecords().stream().map(x -> { |
|
|
List<MatrixAdvRecord> records = iPage.getRecords(); |
|
|
|
|
|
List<Integer> uids = records.stream().map(MatrixAdvRecord::getUserId).toList(); |
|
|
|
|
|
Map<Integer, MatrixUser> uMap = new HashMap<>(); |
|
|
|
|
|
if (!CollectionUtils.isEmpty(uids)) { |
|
|
|
|
|
List<MatrixUser> uList = userMapper.selectBatchIds(uids); |
|
|
|
|
|
uMap = uList.stream().collect(Collectors.toMap(MatrixUser::getId, x -> x)); |
|
|
|
|
|
} |
|
|
|
|
|
for(MatrixAdvRecord x: records) { |
|
|
MatrixAdvRecordBo bo = new MatrixAdvRecordBo(x, appMap.get(x.getAppId())); |
|
|
MatrixAdvRecordBo bo = new MatrixAdvRecordBo(x, appMap.get(x.getAppId())); |
|
|
BeanUtils.copyProperties(x, bo); |
|
|
BeanUtils.copyProperties(x, bo); |
|
|
if (x.getAdminId() != null) { |
|
|
if (x.getAdminId() != null) { |
|
|
bo.adminName = adminMap.get(x.getAdminId()); |
|
|
bo.adminName = adminMap.get(x.getAdminId()); |
|
|
} |
|
|
} |
|
|
return bo; |
|
|
if (x.getUserId() != null) { |
|
|
}).toList(); |
|
|
bo.setUser(uMap.get(x.getUserId())); |
|
|
|
|
|
} |
|
|
|
|
|
res.addData(bo); |
|
|
|
|
|
} |
|
|
return res; |
|
|
return res; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|