|
|
@ -67,6 +67,9 @@ public class AdminService { |
|
|
|
@Autowired |
|
|
|
private AdminDeviceService deviceService; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private MatrixUserMapper userMapper; |
|
|
|
|
|
|
|
public static final int SUPER_ADMIN = 1;//超级管理员
|
|
|
|
public static final int NORMAL_ADMIN = 2;//普通管理员
|
|
|
|
public static final int OTHER = 3;//普通账号
|
|
|
@ -141,14 +144,24 @@ public class AdminService { |
|
|
|
List<MatrixAdmin> adminList = adminMapper.selectList(null); |
|
|
|
Map<Integer, String> adminMap = adminList.stream().collect(Collectors.toMap(MatrixAdmin::getId, MatrixAdmin::getName)); |
|
|
|
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())); |
|
|
|
BeanUtils.copyProperties(x, bo); |
|
|
|
if (x.getAdminId() != null) { |
|
|
|
bo.adminName = adminMap.get(x.getAdminId()); |
|
|
|
} |
|
|
|
return bo; |
|
|
|
}).toList(); |
|
|
|
if (x.getUserId() != null) { |
|
|
|
bo.setUser(uMap.get(x.getUserId())); |
|
|
|
} |
|
|
|
res.addData(bo); |
|
|
|
} |
|
|
|
return res; |
|
|
|
} |
|
|
|
|
|
|
|