|
|
|
|
|
|
|
|
//分页参数校验 |
|
|
//分页参数校验 |
|
|
query.checkParam(); |
|
|
query.checkParam(); |
|
|
//开启分页 |
|
|
//开启分页 |
|
|
IPage<TenantVo> page = new Page<>(query.getPage(), query.getLimit()); |
|
|
|
|
|
IPage<TenantVo> pageData = tenantMapper.findList(page, query); |
|
|
|
|
|
pageData.convert(x -> { |
|
|
|
|
|
|
|
|
List<TenantVo> tenantVos = tenantMapper.findList(query); |
|
|
|
|
|
List<TenantVo> collect = tenantVos.stream().map(x -> { |
|
|
TenantVo vo = new TenantVo(); |
|
|
TenantVo vo = new TenantVo(); |
|
|
BeanUtils.copyProperties(x, vo); |
|
|
BeanUtils.copyProperties(x, vo); |
|
|
//并不是真正意义上的租户id |
|
|
//并不是真正意义上的租户id |
|
|
|
|
|
|
|
|
businessSystemVoList = businessSystemVoList.stream().distinct().collect(Collectors.toList()); |
|
|
businessSystemVoList = businessSystemVoList.stream().distinct().collect(Collectors.toList()); |
|
|
vo.setList(businessSystemVoList); |
|
|
vo.setList(businessSystemVoList); |
|
|
return vo; |
|
|
return vo; |
|
|
}); |
|
|
|
|
|
return JsonResult.success(pageData); |
|
|
|
|
|
|
|
|
}).filter(x -> x != null).collect(Collectors.toList()); |
|
|
|
|
|
//粗暴的分页 |
|
|
|
|
|
Integer pageNum = query.getPage(); |
|
|
|
|
|
Integer pageSize = query.getLimit(); |
|
|
|
|
|
int startIndex = (pageNum - 1) * pageSize; |
|
|
|
|
|
int endIndex = Math.min(startIndex + pageSize, collect.size()); |
|
|
|
|
|
List<TenantVo> subList = collect.subList(startIndex, endIndex); |
|
|
|
|
|
IPage<TenantVo> page = new Page<>(pageNum, pageSize); |
|
|
|
|
|
page.setTotal(collect.size()); |
|
|
|
|
|
return JsonResult.success(page.setRecords(subList)); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |