Commit 8ef52046 authored by chenzhao's avatar chenzhao

Merge remote-tracking branch 'origin/develop_ccs' into develop_ccs

parents c0b012a6 93fa1342
......@@ -23,6 +23,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.google.common.collect.Lists;
import com.itextpdf.text.log.SysoCounter;
import com.yeejoin.amos.boot.biz.common.utils.MenuFrom;
import com.yeejoin.amos.boot.biz.common.utils.TreeParser;
import com.yeejoin.amos.boot.module.common.api.dto.FireStationDto;
......@@ -226,7 +227,7 @@ public class FireStationServiceImpl extends BaseService<FireStationDto, FireStat
if(buildingMapList==null || buildingMapList.size()<1) {
return null;
}
List<Map<String, Object>> childrens = ((List<Map<String, Object>>) buildingMapList.get(0).get("children")).stream().filter(i->i.get("bizOrgCode").toString().contains(bizOrgCode)).collect(Collectors.toList());
List<Map<String, Object>> childrens = ((List<Map<String, Object>>) buildingMapList.get(0).get("children")).stream().filter(i-> i.containsKey("bizOrgCode") && i.get("bizOrgCode").toString().contains(bizOrgCode)).collect(Collectors.toList());
return parseTree(childrens,FireStationCountMap);
}
......@@ -320,5 +321,4 @@ public class FireStationServiceImpl extends BaseService<FireStationDto, FireStat
}
return resultList;
}
}
......@@ -417,7 +417,7 @@ public class KeySiteServiceImpl extends BaseService<KeySiteDto, KeySite, KeySite
if (buildingMapList == null || buildingMapList.size() < 1) {
return null;
}
List<Map<String, Object>> childrens = ((List<Map<String, Object>>) buildingMapList.get(0).get("children")).stream().filter(i->i.get("bizOrgCode").toString().contains(bizOrgCode)).collect(Collectors.toList());
List<Map<String, Object>> childrens = ((List<Map<String, Object>>) buildingMapList.get(0).get("children")).stream().filter(i->i.containsKey("bizOrgCode") && i.get("bizOrgCode").toString().contains(bizOrgCode)).collect(Collectors.toList());
Map<String, Object> reMap = parseTree(childrens,
keySiteCountMap, allCount);
Map<String, Object> fristMap = buildingMapList.get(0);
......
......@@ -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);
......@@ -688,6 +723,7 @@ public class ExcelServiceImpl {
if (item.getFireTeam() != null) {
Long fireTeamId = Long.valueOf(item.getFireTeam().split("@")[1]);
firefighters.setFireTeamId(fireTeamId);
firefighters.setFireTeamName(item.getFireTeam().split("@")[0]);
}
if (firefighters.getCertificatesType() != null) {
String[] certificates = firefighters.getCertificatesType().split("@");
......@@ -713,7 +749,7 @@ public class ExcelServiceImpl {
firefighters.setCompanyName(tempCompany[0]);
firefighters.setCompany(tempCompany[1]);
firefighters.setBizOrgName(tempCompany[0]);
firefighters.setBizOrgCode(tempCompany[1]);
firefighters.setBizOrgCode(tempCompany[2]);
}
if (firefighters.getNativePlaceValue() != null) {
String[] tempCity = firefighters.getNativePlaceValue().split("@");
......@@ -1758,7 +1794,7 @@ public class ExcelServiceImpl {
ReginParams params = JSONObject.parseObject(redisUtils.get(RedisKey.buildReginKey(keyString, token)).toString(),
ReginParams.class);
userModel.setRecUserId(params.getUserModel().getUserId());
userModel.setRecUserName(params.getUserModel().getUserName());
userModel.setRecUserName(params.getUserModel().getRealName());
userModel.setRecDate(new Date());
return userModel;
}
......
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