Browse Source

报告管理列表数据权限控制

tags/v1.0.0^2
chengwang 1 year ago
parent
commit
737bbe840b
1 changed files with 7 additions and 6 deletions
  1. +7
    -6
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/report/query/QueryReportPageListService.java

+ 7
- 6
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/report/query/QueryReportPageListService.java View File

@@ -60,7 +60,6 @@ public class QueryReportPageListService {
public JsonResult getPageList(QueryReportPageListRequest request) {
// log.info("进入查询报告分页列表业务");
User user = CurrentUserUtil.getUserInfo();
String userId = user.getId();
String tenantId = user.getTenantId();
request.setTenantId(tenantId);

@@ -93,17 +92,19 @@ public class QueryReportPageListService {
reportsData = this.getListByDept(reportList, user);
}
if(CollectionUtil.isEmpty(reportsData) || reportsData.size() == 0){
return JsonResult.success(pageData);
return JsonResult.success("当前用户对应数据权限下查询报告数据为空");
}

IPage<Report> reportIPage = pageData.setRecords(reportsData);

// 构造返回结果对象
List<ReportPageListVo> reportPageListVoList = this.buildReportPageListVoList(reportsData);
// 重写返回结果对象
IPage<ReportPageListVo> reportVoPageData = new Page<>();
reportVoPageData.setPages(pageData.getPages());
reportVoPageData.setCurrent(pageData.getCurrent());
reportVoPageData.setSize(pageData.getSize());
reportVoPageData.setTotal(pageData.getTotal());
reportVoPageData.setPages(reportIPage.getPages());
reportVoPageData.setCurrent(reportIPage.getCurrent());
reportVoPageData.setSize(reportIPage.getSize());
reportVoPageData.setTotal(reportIPage.getTotal());
reportVoPageData.setRecords(reportPageListVoList);

return JsonResult.success(reportVoPageData);

Loading…
Cancel
Save