整合导出数据权限

This commit is contained in:
zhn
2022-08-17 11:10:32 +08:00
parent 7c84913aaa
commit 1c1efef5d9
@@ -414,6 +414,12 @@ public class LawsMonthlyReportWriteEOServiceImpl extends ServiceImpl<LawsMonthly
if(StringUtils.isNotBlank(lawsMonthlyReportWriteEO.getIds())){
wrapper.in(LawsMonthlyReportWriteEO::getId,Arrays.asList(lawsMonthlyReportWriteEO.getIds().split(",")));
}
//管理员查看全部数据,其余人只能查看自己的数据
LoginUser currentUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
List<String> rolesList = sysBaseApi.getRolesByUsername(currentUser.getUsername());
if(!rolesList.contains(ProjectRoleEnum.ADMIN.getCode())){
wrapper.in(LawsMonthlyReportWriteEO::getCreateBy,currentUser.getUsername());
}
List<LawsMonthlyReportWriteEO> lawsMonthlyReportWriteEOS = this.list(wrapper);
List<String> lawsMonthlyReportIdList = lawsMonthlyReportWriteEOS.stream().map(LawsMonthlyReportWriteEO::getId).collect(Collectors.toList());
@@ -591,7 +597,7 @@ public class LawsMonthlyReportWriteEOServiceImpl extends ServiceImpl<LawsMonthly
//内容英文版
XWPFDocument documentContentEn = new XWPFDocument();
FileOutputStream outContentEn = new FileOutputStream(wordFileContentEn);
wordContent(lawsMonthlyReportWriteEOS, lawsMonthlyReportTitleTemplateEOS, reportTitleOneList, titleCN, documentContentEn,CutEnum.EN.getValue());
wordContent(lawsMonthlyReportWriteEOS, lawsMonthlyReportTitleTemplateEOS, reportTitleOneList, titleEN, documentContentEn,CutEnum.EN.getValue());
documentContentEn.write(outContentEn);
} catch (IOException e) {