Commit 1a2a5d18 authored by chenhao's avatar chenhao

添加excle 导出时的权限过滤

parent 3cd111fe
......@@ -83,7 +83,6 @@ import com.yeejoin.amos.boot.module.common.api.entity.FirefightersContacts;
import com.yeejoin.amos.boot.module.common.api.entity.FirefightersEducation;
import com.yeejoin.amos.boot.module.common.api.entity.FirefightersPost;
import com.yeejoin.amos.boot.module.common.api.entity.FirefightersWorkexperience;
import com.yeejoin.amos.boot.module.common.api.entity.KeySite;
import com.yeejoin.amos.boot.module.common.api.entity.MaintenanceCompany;
import com.yeejoin.amos.boot.module.common.api.entity.OrgUsr;
import com.yeejoin.amos.boot.module.common.api.entity.RescueEquipment;
......@@ -212,6 +211,12 @@ public class ExcelServiceImpl {
}
public void commonExport(HttpServletResponse response, ExcelDto excelDto, Map par) {
ReginParams reginParams = JSONObject.parseObject(redisUtils.get(RedisKey.buildReginKey(RequestContext.getExeUserId(), RequestContext.getToken())).toString(), ReginParams.class);
String bizOrgCode= reginParams.getPersonIdentity().getBizOrgCode();
boolean authFalg= false;
if(org.apache.commons.lang3.StringUtils.isBlank(bizOrgCode)){
authFalg=true;
}
switch (excelDto.getType()) {
case "WHP":
......@@ -249,6 +254,11 @@ public class ExcelServiceImpl {
FireExpertsDto.class, dataSourcesImpl, false);
break;
case "SYXX":
if(authFalg) {
ExcelUtil.createTemplate(response, excelDto.getFileName(), excelDto.getSheetName(), null,
WaterResourceDto.class, dataSourcesImpl, false);
break;
}
List<WaterResourceDto> waterResourceDtoList = null;
if(par.size()>0) {
waterResourceDtoList = waterResourceServiceImpl.exportToExcel(true,par.containsKey("name")?par.get("name").toString():null,
......@@ -271,11 +281,21 @@ public class ExcelServiceImpl {
AircraftDto.class, dataSourcesImpl, false);
break;
case "XFDW":
if(authFalg) {
ExcelUtil.createTemplate(response, excelDto.getFileName(), excelDto.getSheetName(), null,
FireTeamDto.class, dataSourcesImpl, false);
break;
}
List<FireTeamDto> fireTeamDtoList = fireTeamService.queryFireTeamForList(false, par);
ExcelUtil.createTemplate(response, excelDto.getFileName(), excelDto.getSheetName(), fireTeamDtoList,
FireTeamDto.class, dataSourcesImpl, false);
break;
case "WXXFZ":
if(authFalg) {
ExcelUtil.createTemplate(response, excelDto.getFileName(), excelDto.getSheetName(), null,
FireStationDto.class, null, false);
break;
}
String nameString =null;
Long bizCompanyId =null;
if(par!=null && par.size()>0) {
......@@ -287,6 +307,11 @@ public class ExcelServiceImpl {
FireStationDto.class, null, false);
break;
case "XFRY":
if(authFalg) {
ExcelUtil.createTemplate(response, excelDto.getFileName(), excelDto.getSheetName(),
null, FirefightersExcelDto.class, null, false);
break;
}
List<FirefightersExcelDto> firefightersExcelDtoList = firefightersService.exportToExcel(false, par);
ExcelUtil.createTemplate(response, excelDto.getFileName(), excelDto.getSheetName(),
firefightersExcelDtoList, FirefightersExcelDto.class, null, false);
......@@ -298,6 +323,11 @@ public class ExcelServiceImpl {
maintenancePersonExcelDtoList, MaintenancePersonExcleDto.class, null, false);
break;
case "KEYSITE":
if(authFalg) {
ExcelUtil.createTemplate(response, excelDto.getFileName(), excelDto.getSheetName(), null,
KeySiteExcleDto.class, null, false);
break;
}
List<KeySiteExcleDto> keySiteDtoList = null;
if(par.size()>0) {
keySiteDtoList = keySiteService.exportToExcel(par.containsKey("name")?par.get("name").toString():null,
......@@ -313,6 +343,11 @@ public class ExcelServiceImpl {
KeySiteExcleDto.class, null, false);
break;
case "JCDWRY":
if(authFalg) {
ExcelUtil.createTemplate(response, excelDto.getFileName(), excelDto.getSheetName(), null,
OrgUsrExcelDto.class, null, false);
break;
}
List<OrgUsrExcelDto> orgUsrList = orgUsrService.exportToExcel(par);
ExcelUtil.createTemplate(response, excelDto.getFileName(), excelDto.getSheetName(), orgUsrList,
OrgUsrExcelDto.class, null, false);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment