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; ...@@ -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.FirefightersEducation;
import com.yeejoin.amos.boot.module.common.api.entity.FirefightersPost; 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.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.MaintenanceCompany;
import com.yeejoin.amos.boot.module.common.api.entity.OrgUsr; import com.yeejoin.amos.boot.module.common.api.entity.OrgUsr;
import com.yeejoin.amos.boot.module.common.api.entity.RescueEquipment; import com.yeejoin.amos.boot.module.common.api.entity.RescueEquipment;
...@@ -212,6 +211,12 @@ public class ExcelServiceImpl { ...@@ -212,6 +211,12 @@ public class ExcelServiceImpl {
} }
public void commonExport(HttpServletResponse response, ExcelDto excelDto, Map par) { 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()) { switch (excelDto.getType()) {
case "WHP": case "WHP":
...@@ -249,6 +254,11 @@ public class ExcelServiceImpl { ...@@ -249,6 +254,11 @@ public class ExcelServiceImpl {
FireExpertsDto.class, dataSourcesImpl, false); FireExpertsDto.class, dataSourcesImpl, false);
break; break;
case "SYXX": case "SYXX":
if(authFalg) {
ExcelUtil.createTemplate(response, excelDto.getFileName(), excelDto.getSheetName(), null,
WaterResourceDto.class, dataSourcesImpl, false);
break;
}
List<WaterResourceDto> waterResourceDtoList = null; List<WaterResourceDto> waterResourceDtoList = null;
if(par.size()>0) { if(par.size()>0) {
waterResourceDtoList = waterResourceServiceImpl.exportToExcel(true,par.containsKey("name")?par.get("name").toString():null, waterResourceDtoList = waterResourceServiceImpl.exportToExcel(true,par.containsKey("name")?par.get("name").toString():null,
...@@ -271,11 +281,21 @@ public class ExcelServiceImpl { ...@@ -271,11 +281,21 @@ public class ExcelServiceImpl {
AircraftDto.class, dataSourcesImpl, false); AircraftDto.class, dataSourcesImpl, false);
break; break;
case "XFDW": case "XFDW":
if(authFalg) {
ExcelUtil.createTemplate(response, excelDto.getFileName(), excelDto.getSheetName(), null,
FireTeamDto.class, dataSourcesImpl, false);
break;
}
List<FireTeamDto> fireTeamDtoList = fireTeamService.queryFireTeamForList(false, par); List<FireTeamDto> fireTeamDtoList = fireTeamService.queryFireTeamForList(false, par);
ExcelUtil.createTemplate(response, excelDto.getFileName(), excelDto.getSheetName(), fireTeamDtoList, ExcelUtil.createTemplate(response, excelDto.getFileName(), excelDto.getSheetName(), fireTeamDtoList,
FireTeamDto.class, dataSourcesImpl, false); FireTeamDto.class, dataSourcesImpl, false);
break; break;
case "WXXFZ": case "WXXFZ":
if(authFalg) {
ExcelUtil.createTemplate(response, excelDto.getFileName(), excelDto.getSheetName(), null,
FireStationDto.class, null, false);
break;
}
String nameString =null; String nameString =null;
Long bizCompanyId =null; Long bizCompanyId =null;
if(par!=null && par.size()>0) { if(par!=null && par.size()>0) {
...@@ -287,6 +307,11 @@ public class ExcelServiceImpl { ...@@ -287,6 +307,11 @@ public class ExcelServiceImpl {
FireStationDto.class, null, false); FireStationDto.class, null, false);
break; break;
case "XFRY": case "XFRY":
if(authFalg) {
ExcelUtil.createTemplate(response, excelDto.getFileName(), excelDto.getSheetName(),
null, FirefightersExcelDto.class, null, false);
break;
}
List<FirefightersExcelDto> firefightersExcelDtoList = firefightersService.exportToExcel(false, par); List<FirefightersExcelDto> firefightersExcelDtoList = firefightersService.exportToExcel(false, par);
ExcelUtil.createTemplate(response, excelDto.getFileName(), excelDto.getSheetName(), ExcelUtil.createTemplate(response, excelDto.getFileName(), excelDto.getSheetName(),
firefightersExcelDtoList, FirefightersExcelDto.class, null, false); firefightersExcelDtoList, FirefightersExcelDto.class, null, false);
...@@ -298,6 +323,11 @@ public class ExcelServiceImpl { ...@@ -298,6 +323,11 @@ public class ExcelServiceImpl {
maintenancePersonExcelDtoList, MaintenancePersonExcleDto.class, null, false); maintenancePersonExcelDtoList, MaintenancePersonExcleDto.class, null, false);
break; break;
case "KEYSITE": case "KEYSITE":
if(authFalg) {
ExcelUtil.createTemplate(response, excelDto.getFileName(), excelDto.getSheetName(), null,
KeySiteExcleDto.class, null, false);
break;
}
List<KeySiteExcleDto> keySiteDtoList = null; List<KeySiteExcleDto> keySiteDtoList = null;
if(par.size()>0) { if(par.size()>0) {
keySiteDtoList = keySiteService.exportToExcel(par.containsKey("name")?par.get("name").toString():null, keySiteDtoList = keySiteService.exportToExcel(par.containsKey("name")?par.get("name").toString():null,
...@@ -313,6 +343,11 @@ public class ExcelServiceImpl { ...@@ -313,6 +343,11 @@ public class ExcelServiceImpl {
KeySiteExcleDto.class, null, false); KeySiteExcleDto.class, null, false);
break; break;
case "JCDWRY": case "JCDWRY":
if(authFalg) {
ExcelUtil.createTemplate(response, excelDto.getFileName(), excelDto.getSheetName(), null,
OrgUsrExcelDto.class, null, false);
break;
}
List<OrgUsrExcelDto> orgUsrList = orgUsrService.exportToExcel(par); List<OrgUsrExcelDto> orgUsrList = orgUsrService.exportToExcel(par);
ExcelUtil.createTemplate(response, excelDto.getFileName(), excelDto.getSheetName(), orgUsrList, ExcelUtil.createTemplate(response, excelDto.getFileName(), excelDto.getSheetName(), orgUsrList,
OrgUsrExcelDto.class, null, false); 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