package cn.com.goldenwater.dcproj.service.impl.other;
import cn.com.goldenwater.core.service.AbstractCrudService;
import cn.com.goldenwater.dcproj.constValue.BisInspBsEnum;
import cn.com.goldenwater.dcproj.constValue.BisInspEnum;
import cn.com.goldenwater.dcproj.constValue.SimpleReportEnum;
import cn.com.goldenwater.dcproj.dao.*;
import cn.com.goldenwater.dcproj.dto.*;
import cn.com.goldenwater.dcproj.model.*;
import cn.com.goldenwater.dcproj.param.*;
import cn.com.goldenwater.dcproj.service.BisInspStatService;
import cn.com.goldenwater.dcproj.service.GwComFileService;
import cn.com.goldenwater.dcproj.service.OlBisInspOrgService;
import cn.com.goldenwater.dcproj.utils.DateUtils;
import cn.com.goldenwater.dcproj.utils.InspUtils;
import cn.com.goldenwater.util.common.SqlUtils;
import freemarker.template.Configuration;
import freemarker.template.Template;
import freemarker.template.TemplateException;
import org.apache.commons.collections.MapUtils;
import org.apache.commons.collections.map.HashedMap;
import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.io.*;
import java.nio.charset.StandardCharsets;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.stream.Collectors;
import static cn.com.goldenwater.dcproj.constValue.SimpleReportEnum.*;
import static cn.com.goldenwater.dcproj.utils.InspUtils.setOrgIds;
import static cn.com.goldenwater.dcproj.utils.WordUtils.getImageString;
/**
* 督查简报生成WORD 业务实现类。
*
*
使用FreeMarker技术生成WORD,进行数据的替换和填充
*
* @author lhc
* @author lyz
* @date 2019-10-16
* @date 2019-10-31
*/
@Service
@Transactional
public class BisInspStatServiceImpl extends AbstractCrudService implements BisInspStatService {
private Logger logger = LoggerFactory.getLogger(getClass());
@Value("${export.templatePath}" + "/dcjb/")
private String templatePath;
@Value("${small.upload-path}")
public String imgPathPrefix;
private static final String TEMP_FILE_NAME = "statDoc.ftl";
private static final String RSVR_TEMP_FILE_NAME = "rsvrDoc.ftl";
private Configuration configuration;
@Autowired
private BisInspStatDao bisInspStatDao;
@Autowired
private OlBisInspOrgService olBisInspOrgService;
@Autowired
private VersionDao versionDao;
@Autowired
private BisInspPblmDao bisInspPblmDao;
@Autowired
private GwComFileService gwComFileService;
@Autowired
private AttWagaRgstrDao attWagaRgstrDao;
@Autowired
private BisInspWtdstDao bisInspWtdstDao;
@Autowired
private BisInspRsvrRgstrDao bisInspRsvrRgstrDao;
/**
* 农饮工程列表
*/
@Autowired
private BisInspVlgdrinkProjManageDao bisInspVlgdrinkProjManageDao;
public BisInspStatServiceImpl(BisInspStatDao bisInspStatDao) {
super(bisInspStatDao);
this.bisInspStatDao = bisInspStatDao;
configuration = new Configuration(Configuration.DEFAULT_INCOMPATIBLE_IMPROVEMENTS);
configuration.setDefaultEncoding("utf-8");
}
@Override
public String getRsvrDocByTm(String fileName, String month, String persId, String currentOrgId) throws IOException {
Map dataMap = new HashMap<>();
String filePath = templatePath + "/" + fileName;
this.getRsvrDataMap(dataMap,persId, null ,month,currentOrgId);
/*
替换模板
dataMap 要填入模本的数据文件
设置模本装置方法和路径,FreeMarker支持多种模板装载方法。可以从servlet,classpath,数据库装载,
这里我们的模板是放在template包下面
*/
// 装载路径
configuration.setDirectoryForTemplateLoading(new File(templatePath));
// 通过模板名称获取模板
Template template = configuration.getTemplate(RSVR_TEMP_FILE_NAME);
// 开始装载并输出
if (template != null) {
//输出文档路径及名称
File outFile = new File(filePath);
Writer out = null;
FileOutputStream fos = null;
try {
fos = new FileOutputStream(outFile);
OutputStreamWriter oWriter = new OutputStreamWriter(fos, StandardCharsets.UTF_8);
//这个地方对流的编码不可或缺,使用main()单独调用时,应该可以,但是如果是web请求导出时导出后word文档就会打不开,并且包XML文件错误。主要是编码格式不正确,无法解析。
//out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(outFile)));
out = new BufferedWriter(oWriter);
//向模板里替换数据
template.process(dataMap, out);
} catch (FileNotFoundException | TemplateException e) {
e.printStackTrace();
} finally {
if (out != null) {
out.close();
}
if (fos != null) {
fos.close();
}
}
}
//输出文件到指定路径
return filePath;
}
private void getRsvrDataMap(Map dataMap, String persId , String ifCasePblm, String month, String currentOrgId) {
//设置组信息
String id = this.setGroupInfo(dataMap,persId,month,currentOrgId);
Map dtoMap = new HashedMap();
//设置登记信息
String rgstrId = this.setRgstrInfo(id,dataMap,persId,currentOrgId,dtoMap);
//问题统计信息
this.setPblmInfo(rgstrId,dataMap,"1",dtoMap);
}
/**
* 根据登记表id得到问题信息
* @param rgstrId
* @param dataMap
*/
private void setPblmInfo(String rgstrId, Map dataMap,String objType ,Map dtoMap) {
List pblmList = new ArrayList<>();
if (StringUtils.isNotBlank(rgstrId)) {
BisInspPblmParam pblmParam = new BisInspPblmParam();
pblmParam.setObjType(objType);
pblmParam.setRegid(rgstrId);
pblmList = this.bisInspPblmDao.getPblmListByRegId(pblmParam);
}
Long normal = new Long(0);
Long heavier = new Long(0);
Long serious = new Long(0);
Long superSerious = new Long(0);
Map> adCodeMap = new HashedMap();
Long allRsvr = new Long(0);
//统计信息
//三个责任人
Map> perMap = new HashedMap();//去重过滤
Long persSize = new Long(0);//责任人总数
Long pblmHasWiunWaoLegPers = new Long(0);//未落实行政责任人
Long pblmHasWiunWaoLegPersOne = new Long(0);
Long pblmHasWiunWaoLegPersTwo = new Long(0);
Map hasWiunWaoLegPersAdMap = new HashedMap();
Long pblmWiunWaoLegPersResu = new Long(0);//行政责任人履职差
Long pblmWiunWaoLegPersResuOne = new Long(0);
Long pblmWiunWaoLegPersResuTwo = new Long(0);
Long pblmWiunWaoLegPersTrain = new Long(0);//岗位培训
Long pblmWiunWaoLegPersTrainOne = new Long(0);//岗位培训
Long pblmWiunWaoLegPersTrainTwo = new Long(0);//岗位培训
Long pblmHasTechPers = new Long(0);//未落实责任人
Long pblmHasTechPersOne = new Long(0);
Long pblmHasTechPersTwo = new Long(0);
Map hasTechPersAdMap = new HashedMap();
Long pblmTechPersResu = new Long(0);//技术责任人履职差
Long pblmTechPersResuOne = new Long(0);
Long pblmTechPersResuTwo = new Long(0);
Long pblmTechPersResuTrain = new Long(0);//岗位培训
Long pblmTechPersResuTrainOne = new Long(0);//岗位培训
Long pblmTechPersResuTrainTwo = new Long(0);//岗位培训
Long pblmHasPatrolPers = new Long(0);//未落实责任人
Long pblmHasPatrolPersOne = new Long(0);
Long pblmHasPatrolPersTwo = new Long(0);
Map hasPatrolPersAdMap = new HashedMap();
Long pblmPatrolPersResu = new Long(0);//巡查责任人履职差
Long pblmPatrolPersResuOne = new Long(0);
Long pblmPatrolPersResuTwo = new Long(0);
Long pblmPatrolPersResuTrain = new Long(0);//岗位培训
Long pblmPatrolPersResuTrainOne = new Long(0);//岗位培训
Long pblmPatrolPersResuTrainTwo = new Long(0);//岗位培训
List rgstrIdList = new ArrayList<>();
//三个重点环节
Long pblmRainForc = new Long(0);//雨水情预测
Long pblmRainForcOne = new Long(0);
Long pblmRainForcTwo = new Long(0);
Long pblmSchPlanSameExta = new Long(0);
Long pblmSchPlanSameExtaOne = new Long(0);
Long pblmSchPlanSameExtaTwo = new Long(0);
Long pblmSchPlanSameAppr = new Long(0);
Long pblmSchPlanSameApprOne = new Long(0);
Long pblmSchPlanSameApprTwo = new Long(0);
Long pblmSchPlanSameEmer = new Long(0);
Long pblmSchPlanSameEmerOne = new Long(0);
Long pblmSchPlanSameEmerTwo = new Long(0);
Long pblmSchPlanSameSpeed = new Long(0);
Long pblmSchPlanSameSpeedOne = new Long(0);
Long pblmSchPlanSameSpeedTwo = new Long(0);
Long pblmEmerPlanSameExta = new Long(0);
Long pblmEmerPlanSameExtaOne = new Long(0);
Long pblmEmerPlanSameExtaTwo = new Long(0);
Long pblmEmerPlanSameAppr = new Long(0);
Long pblmEmerPlanSameApprOne = new Long(0);
Long pblmEmerPlanSameApprTwo = new Long(0);
Long pblmEmerPlanSameEmer = new Long(0);
Long pblmEmerPlanSameEmerOne = new Long(0);
Long pblmEmerPlanSameEmerTwo = new Long(0);
Long pblmEmerPlanSameSpeed = new Long(0);
Long pblmEmerPlanSameSpeedOne = new Long(0);
Long pblmEmerPlanSameSpeedTwo = new Long(0);
Long diskRunInfoOne = new Long(0);
Long diskRunInfoTwo = new Long(0);
Long hasSetMainFlOne = new Long(0);
Long hasSetMainFlTwo = new Long(0);
for (BisInspPblm bisInspPblm : pblmList) {
if (StringUtils.isBlank(bisInspPblm.getInspPblmCate())) {
continue;
}
if (StringUtils.isNotBlank(bisInspPblm.getPblmDesc())) {
if ( bisInspPblm.getPblmDesc().contains("渗漏范围和渗漏量不断增大,影响运行安全)混凝土或砌石坝坝")) {
diskRunInfoOne++;
}
if (bisInspPblm.getPblmDesc().contains("挡水建筑物存在明显变形、不稳定或有滑坡迹象")){
diskRunInfoTwo++;
}
if (bisInspPblm.getPblmDesc().contains("岸坡及边墙失稳") || bisInspPblm.getPblmDesc().contains("(泄洪建筑物位于土坝上或采用坝下泄洪洞)岸坡及")){
hasSetMainFlOne++;
}
if (bisInspPblm.getPblmDesc().contains("泄洪时冲刷坝体及下游坝脚")){
hasSetMainFlTwo++;
}
}
if ("1".equals(bisInspPblm.getIfCasePblm())) {
this.setPblmImgInfo(dataMap,bisInspPblm,adCodeMap,allRsvr);
}
if (!rgstrIdList.contains(bisInspPblm.getRgstrId())) {
rgstrIdList.add(bisInspPblm.getRgstrId());
persSize++;
}
switch (bisInspPblm.getInspPblmCate()) {
case "0":
normal++;
break;
case "1":
heavier++;
break;
case "2":
serious++;
break;
case "3":
superSerious++;
break;
}
if (StringUtils.isBlank(bisInspPblm.getRgstrId()) || dtoMap.get(bisInspPblm.getRgstrId()) == null) { continue;}
if (StringUtils.isBlank(bisInspPblm.getPblmDesc())) { continue;}
//三个责任人统计
if (bisInspPblm.getInspPblmName().contains(SimpleReportEnum.REVER_INFO2.getTitle())) {
if ("行政责任人".equals(bisInspPblm.getCheckPoint())) {
//根据问题描述来决定是哪个类别
if ("无行政责任人".equals(bisInspPblm.getPblmDesc())) {
boolean flag = false;
List rgstrIdList1 = perMap.get("wiunPer");
if (rgstrIdList1 == null) {
rgstrIdList1 = new ArrayList<>();
rgstrIdList1.add(bisInspPblm.getRgstrId());
flag =true;
perMap.put("wiunPer", rgstrIdList1);
} else {
if (!rgstrIdList1.contains(bisInspPblm.getRgstrId())) {
rgstrIdList1.add(bisInspPblm.getRgstrId());
flag = true;
}
}
if (flag) {
pblmHasWiunWaoLegPers++;
if ("4".equals(dtoMap.get(bisInspPblm.getRgstrId()).getEngScal())) {
pblmHasWiunWaoLegPersOne++;
} else if ("5".equals(dtoMap.get(bisInspPblm.getRgstrId()).getEngScal())) {
pblmHasWiunWaoLegPersTwo++;
}
}
if (StringUtils.isNotBlank(bisInspPblm.getAdFullName())) {
String[] adNames = bisInspPblm.getAdFullName().split("-");
if (StringUtils.isNotBlank(adNames[0])) {
if (hasWiunWaoLegPersAdMap.containsKey(adNames[0])) {
hasWiunWaoLegPersAdMap.put(adNames[0], hasWiunWaoLegPersAdMap.get(adNames[0]) + 1);
} else {
hasWiunWaoLegPersAdMap.put(adNames[0], new Long(1));
}
}
}
} else if (bisInspPblm.getPblmDesc().contains("履责情况差")) {
List rgstrIdList1 = perMap.get("wiunResu");
boolean flag = false;
if (rgstrIdList1 == null) {
rgstrIdList1 = new ArrayList<>();
rgstrIdList1.add(bisInspPblm.getRgstrId());
flag = true;
perMap.put("wiunResu", rgstrIdList1);
} else {
if (!rgstrIdList1.contains(bisInspPblm.getRgstrId())) {
flag=true;
rgstrIdList1.add(bisInspPblm.getRgstrId());
}
}
if (flag) {
pblmWiunWaoLegPersResu++;
if ("4".equals(dtoMap.get(bisInspPblm.getRgstrId()).getEngScal())) {
pblmWiunWaoLegPersResuOne++;
} else if ("5".equals(dtoMap.get(bisInspPblm.getRgstrId()).getEngScal())) {
pblmWiunWaoLegPersResuTwo++;
}
}
} else if (bisInspPblm.getPblmDesc().contains("未参加过岗位培训")) {
boolean flag = false;
List rgstrIdList1 = perMap.get("wiunTrain");
if (rgstrIdList1 == null) {
flag = true;
rgstrIdList1 = new ArrayList<>();
rgstrIdList1.add(bisInspPblm.getRgstrId());
perMap.put("wiunTrain", rgstrIdList1);
} else {
if (!rgstrIdList1.contains(bisInspPblm.getRgstrId())) {
flag = true;
rgstrIdList1.add(bisInspPblm.getRgstrId());
}
}
if (flag) {
pblmWiunWaoLegPersTrain++;
if ("4".equals(dtoMap.get(bisInspPblm.getRgstrId()).getEngScal())) {
pblmWiunWaoLegPersTrainOne++;
} else if ("5".equals(dtoMap.get(bisInspPblm.getRgstrId()).getEngScal())) {
pblmWiunWaoLegPersTrainTwo++;
}
}
}
}
else if ("技术责任人".equals(bisInspPblm.getCheckPoint())) {
//根据问题描述来决定是哪个类别
if ("无技术责任人".equals(bisInspPblm.getPblmDesc())){
List rgstrIdList1 = perMap.get("techPer");
boolean flage = false;
if (rgstrIdList1 == null) {
rgstrIdList1 = new ArrayList<>();
flage = true;
rgstrIdList1.add(bisInspPblm.getRgstrId());
perMap.put("techPer",rgstrIdList1);
} else {
if (!rgstrIdList1.contains(bisInspPblm.getRgstrId())) {
rgstrIdList1.add(bisInspPblm.getRgstrId());
flage = true;
}
}
if (flage) {
pblmHasTechPers++;
if ("4".equals(dtoMap.get(bisInspPblm.getRgstrId()).getEngScal())) {
pblmHasTechPersOne++;
} else if ("5".equals(dtoMap.get(bisInspPblm.getRgstrId()).getEngScal())) {
pblmHasTechPersTwo++;
}
}
if (StringUtils.isNotBlank(bisInspPblm.getAdFullName())){
String []adNames = bisInspPblm.getAdFullName().split("-");
if (StringUtils.isNotBlank(adNames[0])) {
if (hasTechPersAdMap.containsKey(adNames[0])) {
hasTechPersAdMap.put(adNames[0], hasTechPersAdMap.get(adNames[0] + 1));
} else {
hasTechPersAdMap.put(adNames[0], new Long(1));
}
}
}
} else if (bisInspPblm.getPblmDesc().contains("履责情况差")) {
boolean flage = false;
List rgstrIdList1 = perMap.get("techResu");
if (rgstrIdList1 == null) {
rgstrIdList1 = new ArrayList<>();
rgstrIdList1.add(bisInspPblm.getRgstrId());
perMap.put("techResu",rgstrIdList1);
flage = true;
} else {
if (!rgstrIdList1.contains(bisInspPblm.getRgstrId())) {
rgstrIdList1.add(bisInspPblm.getRgstrId());
flage = true;
}
}
if (flage) {
pblmTechPersResu++;
if ("4".equals(dtoMap.get(bisInspPblm.getRgstrId()).getEngScal())) {
pblmTechPersResuOne++;
} else if ("5".equals(dtoMap.get(bisInspPblm.getRgstrId()).getEngScal())) {
pblmTechPersResuTwo++;
}
}
} else if (bisInspPblm.getPblmDesc().contains("未参加过岗位培训")) {
boolean flage = false;
List rgstrIdList1 = perMap.get("techTrain");
if (rgstrIdList1 == null) {
rgstrIdList1 = new ArrayList<>();
flage =true;
rgstrIdList1.add(bisInspPblm.getRgstrId());
perMap.put("techTrain",rgstrIdList1);
} else {
if (!rgstrIdList1.contains(bisInspPblm.getRgstrId())) {
rgstrIdList1.add(bisInspPblm.getRgstrId());
flage = true;
}
}
if (flage) {
pblmTechPersResuTrain++;
if ("4".equals(dtoMap.get(bisInspPblm.getRgstrId()).getEngScal())) {
pblmTechPersResuTrainOne++;
} else if ("5".equals(dtoMap.get(bisInspPblm.getRgstrId()).getEngScal())) {
pblmTechPersResuTrainTwo++;
}
}
}
} else if ("巡查责任人".equals(bisInspPblm.getCheckPoint())) {
//根据问题描述来决定是哪个类别
if ("无巡查责任人".equals(bisInspPblm.getPblmDesc())){
boolean flage = false;
List rgstrIdList1 = perMap.get("patrolPer");
if (rgstrIdList1 == null) {
rgstrIdList1 = new ArrayList<>();
rgstrIdList1.add(bisInspPblm.getRgstrId());
perMap.put("patrolPer",rgstrIdList1);
flage = true;
} else {
if (!rgstrIdList1.contains(bisInspPblm.getRgstrId())) {
rgstrIdList1.add(bisInspPblm.getRgstrId());
flage = true;
}
}
if (flage) {
pblmHasPatrolPers++;
if ("4".equals(dtoMap.get(bisInspPblm.getRgstrId()).getEngScal())) {
pblmHasPatrolPersOne++;
} else if ("5".equals(dtoMap.get(bisInspPblm.getRgstrId()).getEngScal())) {
pblmHasPatrolPersTwo++;
}
}
if (StringUtils.isNotBlank(bisInspPblm.getAdFullName())){
String []adNames = bisInspPblm.getAdFullName().split("-");
if (StringUtils.isNotBlank(adNames[0])) {
if (hasPatrolPersAdMap.containsKey(adNames[0])) {
hasPatrolPersAdMap.put(adNames[0], (hasPatrolPersAdMap.get(adNames[0]) == null ? 0 : hasPatrolPersAdMap.get(adNames[0])) + 1);
} else {
hasPatrolPersAdMap.put(adNames[0], new Long(1));
}
}
}
} else if (bisInspPblm.getPblmDesc().contains("履责情况差")) {
boolean flage = false;
List rgstrIdList1 = perMap.get("patrolResu");
if (rgstrIdList1 == null) {
rgstrIdList1 = new ArrayList<>();
rgstrIdList1.add(bisInspPblm.getRgstrId());
flage = true;
perMap.put("patrolResu",rgstrIdList1);
} else {
if (!rgstrIdList1.contains(bisInspPblm.getRgstrId())) {
rgstrIdList1.add(bisInspPblm.getRgstrId());
flage = true;
}
}
if (flage) {
pblmPatrolPersResu++;
if ("4".equals(dtoMap.get(bisInspPblm.getRgstrId()).getEngScal())) {
pblmPatrolPersResuOne++;
} else if ("5".equals(dtoMap.get(bisInspPblm.getRgstrId()).getEngScal())) {
pblmPatrolPersResuTwo++;
}
}
} else if (bisInspPblm.getPblmDesc().contains("未参加过岗位培训")) {
boolean flage = false;
List rgstrIdList1 = perMap.get("patrolTrain");
if (rgstrIdList1 == null) {
rgstrIdList1 = new ArrayList<>();
rgstrIdList1.add(bisInspPblm.getRgstrId());
perMap.put("patrolTrain",rgstrIdList1);
flage =true;
} else {
if (!rgstrIdList1.contains(bisInspPblm.getRgstrId())) {
rgstrIdList1.add(bisInspPblm.getRgstrId());
flage = true;
}
}
if (flage) {
pblmPatrolPersResuTrain++;
if ("4".equals(dtoMap.get(bisInspPblm.getRgstrId()).getEngScal())) {
pblmPatrolPersResuTrainOne++;
} else if ("5".equals(dtoMap.get(bisInspPblm.getRgstrId()).getEngScal())) {
pblmPatrolPersResuTrainTwo++;
}
}
}
}
}
//三个重点环节统计
if (bisInspPblm.getInspPblmName().contains(SimpleReportEnum.REVER_INFO3.getTitle())) {
if (bisInspPblm.getCheckPoint().contains("预测预报能力")) {
boolean flag = false;
List rgstrIdList1 = perMap.get("rainForc");
if (rgstrIdList1 == null) {
rgstrIdList1 = new ArrayList<>();
rgstrIdList1.add(bisInspPblm.getRgstrId());
perMap.put("rainForc",rgstrIdList1);
flag = true;
} else {
if(!rgstrIdList1.contains(bisInspPblm.getRgstrId())) {
rgstrIdList1.add(bisInspPblm.getRgstrId());
flag = true;
}
}
if (flag) {
pblmRainForc++;
if ("4".equals(dtoMap.get(bisInspPblm.getRgstrId()).getEngScal())) {
pblmRainForcOne++;
} else if ("5".equals(dtoMap.get(bisInspPblm.getRgstrId()).getEngScal())) {
pblmRainForcTwo++;
}
}
}else if (bisInspPblm.getCheckPoint().contains("运用方案")){
//描述分类
if (bisInspPblm.getPblmDesc().contains("无水库调度运用方案")) {
boolean flag = false;
List rgstrIdList1 = perMap.get("pblmSchPlanSameExta");
if (rgstrIdList1 == null) {
rgstrIdList1 = new ArrayList<>();
rgstrIdList1.add(bisInspPblm.getRgstrId());
perMap.put("pblmSchPlanSameExta",rgstrIdList1);
flag = true;
} else {
if(!rgstrIdList1.contains(bisInspPblm.getRgstrId())) {
rgstrIdList1.add(bisInspPblm.getRgstrId());
flag = true;
}
}
if (flag) {
pblmSchPlanSameExta++;
if ("4".equals(dtoMap.get(bisInspPblm.getRgstrId()).getEngScal())) {
pblmSchPlanSameExtaOne++;
} else if ("5".equals(dtoMap.get(bisInspPblm.getRgstrId()).getEngScal())) {
pblmSchPlanSameExtaTwo++;
}
}
} else if (bisInspPblm.getPblmDesc().contains("未获得批复或未备案")) {
boolean flag = false;
List rgstrIdList1 = perMap.get("pblmSchPlanSameAppr");
if (rgstrIdList1 == null) {
rgstrIdList1 = new ArrayList<>();
rgstrIdList1.add(bisInspPblm.getRgstrId());
perMap.put("pblmSchPlanSameAppr",rgstrIdList1);
flag = true;
} else {
if(!rgstrIdList1.contains(bisInspPblm.getRgstrId())) {
rgstrIdList1.add(bisInspPblm.getRgstrId());
flag = true;
}
}
if (flag) {
pblmSchPlanSameAppr++;
if ("4".equals(dtoMap.get(bisInspPblm.getRgstrId()).getEngScal())) {
pblmSchPlanSameApprOne++;
} else if ("5".equals(dtoMap.get(bisInspPblm.getRgstrId()).getEngScal())) {
pblmSchPlanSameApprTwo++;
}
}
} else if (bisInspPblm.getPblmDesc().contains("进行演练")) {
boolean flag = false;
List rgstrIdList1 = perMap.get("pblmSchPlanSameEmer");
if (rgstrIdList1 == null) {
rgstrIdList1 = new ArrayList<>();
rgstrIdList1.add(bisInspPblm.getRgstrId());
perMap.put("pblmSchPlanSameEmer",rgstrIdList1);
flag = true;
} else {
if(!rgstrIdList1.contains(bisInspPblm.getRgstrId())) {
rgstrIdList1.add(bisInspPblm.getRgstrId());
flag = true;
}
}
if (flag) {
pblmSchPlanSameEmer++;
if ("4".equals(dtoMap.get(bisInspPblm.getRgstrId()).getEngScal())) {
pblmSchPlanSameEmerOne++;
} else if ("5".equals(dtoMap.get(bisInspPblm.getRgstrId()).getEngScal())) {
pblmSchPlanSameEmerTwo++;
}
}
} else if (bisInspPblm.getPblmDesc().contains("可操作性")) {
boolean flag = false;
List rgstrIdList1 = perMap.get("pblmSchPlanSameSpeed");
if (rgstrIdList1 == null) {
rgstrIdList1 = new ArrayList<>();
rgstrIdList1.add(bisInspPblm.getRgstrId());
perMap.put("pblmSchPlanSameSpeed",rgstrIdList1);
flag = true;
} else {
if(!rgstrIdList1.contains(bisInspPblm.getRgstrId())) {
rgstrIdList1.add(bisInspPblm.getRgstrId());
flag = true;
}
}
if (flag) {
pblmSchPlanSameSpeed++;
if ("4".equals(dtoMap.get(bisInspPblm.getRgstrId()).getEngScal())) {
pblmSchPlanSameSpeedOne++;
} else if ("5".equals(dtoMap.get(bisInspPblm.getRgstrId()).getEngScal())) {
pblmSchPlanSameSpeedTwo++;
}
}
}
} else if (bisInspPblm.getCheckPoint().contains("应急预案")) {
if (bisInspPblm.getPblmDesc().contains("无安全")) {
boolean flag = false;
List rgstrIdList1 = perMap.get("pblmEmerPlanSameExta");
if (rgstrIdList1 == null) {
rgstrIdList1 = new ArrayList<>();
rgstrIdList1.add(bisInspPblm.getRgstrId());
perMap.put("pblmEmerPlanSameExta",rgstrIdList1);
flag = true;
} else {
if(!rgstrIdList1.contains(bisInspPblm.getRgstrId())) {
rgstrIdList1.add(bisInspPblm.getRgstrId());
flag = true;
}
}
if (flag) {
pblmEmerPlanSameExta++;
if ("4".equals(dtoMap.get(bisInspPblm.getRgstrId()).getEngScal())) {
pblmEmerPlanSameExtaOne++;
} else if ("5".equals(dtoMap.get(bisInspPblm.getRgstrId()).getEngScal())) {
pblmEmerPlanSameExtaTwo++;
}
}
} else if (bisInspPblm.getPblmDesc().contains("未获得批复或未备案")) {
boolean flag = false;
List rgstrIdList1 = perMap.get("pblmEmerPlanSameAppr");
if (rgstrIdList1 == null) {
rgstrIdList1 = new ArrayList<>();
rgstrIdList1.add(bisInspPblm.getRgstrId());
perMap.put("pblmEmerPlanSameAppr",rgstrIdList1);
flag = true;
} else {
if(!rgstrIdList1.contains(bisInspPblm.getRgstrId())) {
rgstrIdList1.add(bisInspPblm.getRgstrId());
flag = true;
}
}
if (flag) {
pblmEmerPlanSameAppr++;
if ("4".equals(dtoMap.get(bisInspPblm.getRgstrId()).getEngScal())) {
pblmEmerPlanSameApprOne++;
} else if ("5".equals(dtoMap.get(bisInspPblm.getRgstrId()).getEngScal())) {
pblmEmerPlanSameApprTwo++;
}
}
} else if (bisInspPblm.getPblmDesc().contains("未进行演练")) {
boolean flag = false;
List rgstrIdList1 = perMap.get("pblmEmerPlanSameEmer");
if (rgstrIdList1 == null) {
flag = true;
rgstrIdList1 = new ArrayList<>();
rgstrIdList1.add(bisInspPblm.getRgstrId());
perMap.put("pblmEmerPlanSameEmer",rgstrIdList1);
} else {
if(!rgstrIdList1.contains(bisInspPblm.getRgstrId())) {
rgstrIdList1.add(bisInspPblm.getRgstrId());
flag = true;
}
}
if (flag) {
pblmEmerPlanSameEmer++;
if ("4".equals(dtoMap.get(bisInspPblm.getRgstrId()).getEngScal())) {
pblmEmerPlanSameEmerOne++;
} else if ("5".equals(dtoMap.get(bisInspPblm.getRgstrId()).getEngScal())) {
pblmEmerPlanSameEmerTwo++;
}
}
} else if (bisInspPblm.getPblmDesc().contains("可操作性")) {
boolean flag = false;
List rgstrIdList1 = perMap.get("pblmEmerPlanSameSpeed");
if (rgstrIdList1 == null) {
rgstrIdList1 = new ArrayList<>();
rgstrIdList1.add(bisInspPblm.getRgstrId());
flag = true;
perMap.put("pblmEmerPlanSameSpeed",rgstrIdList1);
} else {
if(!rgstrIdList1.contains(bisInspPblm.getRgstrId())) {
rgstrIdList1.add(bisInspPblm.getRgstrId());
flag = true;
}
}
if (flag) {
pblmEmerPlanSameSpeed++;
if ("4".equals(dtoMap.get(bisInspPblm.getRgstrId()).getEngScal())) {
pblmEmerPlanSameSpeedOne++;
} else if ("5".equals(dtoMap.get(bisInspPblm.getRgstrId()).getEngScal())) {
pblmEmerPlanSameSpeedTwo++;
}
}
}
}
}
}
dataMap.put("normal",normal);
dataMap.put("heavier",heavier);
dataMap.put("serious",serious);
dataMap.put("superSerious",superSerious);
dataMap.put("adCodeSize",adCodeMap.keySet().size());
dataMap.put("adCodeRsvr",allRsvr);
List