| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203 |
- 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 业务实现类。
- *
- * <p>使用FreeMarker技术生成WORD,进行数据的替换和填充
- *
- * @author lhc
- * @author lyz
- * @date 2019-10-16
- * @date 2019-10-31
- */
- @Service
- @Transactional
- public class BisInspStatServiceImpl extends AbstractCrudService<BisInspStat, BisInspStatParam> 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<String, Object> 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<String, Object> dataMap, String persId , String ifCasePblm, String month, String currentOrgId) {
- //设置组信息
- String id = this.setGroupInfo(dataMap,persId,month,currentOrgId);
- Map<String,BisInspStatRsvrInfoDto> 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<String, Object> dataMap,String objType ,Map<String,BisInspStatRsvrInfoDto> dtoMap) {
- List<BisInspPblm> 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<String,List<String>> adCodeMap = new HashedMap();
- Long allRsvr = new Long(0);
- //统计信息
- //三个责任人
- Map<String,List<String>> perMap = new HashedMap();//去重过滤
- Long persSize = new Long(0);//责任人总数
- Long pblmHasWiunWaoLegPers = new Long(0);//未落实行政责任人
- Long pblmHasWiunWaoLegPersOne = new Long(0);
- Long pblmHasWiunWaoLegPersTwo = new Long(0);
- Map<String,Long> 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<String,Long> 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<String,Long> 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<String> 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<String> 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<String> 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<String> 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<String> 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<String> 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<String> 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<String> 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<String> 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<String> 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<String> 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<String> 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<String> 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<String> 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<String> 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<String> 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<String> 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<String> 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<String> 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<Map<String,Object>> adList = new LinkedList<>();
- for (String key : adCodeMap.keySet()) {
- Map<String,Object> map = new HashedMap();
- map.put("adName",key);
- map.put("rsvrSize",adCodeMap.get(key).size());
- adList.add(map);
- }
- dataMap.put("adList",adList);
- dataMap.put("pblmHasWiunWaoLegPers",pblmHasWiunWaoLegPers);
- dataMap.put("pblmHasWiunWaoLegPersOne",pblmHasWiunWaoLegPersOne);
- dataMap.put("pblmHasWiunWaoLegPersTwo",pblmHasWiunWaoLegPersTwo);
- dataMap.put("pblmHasWiunWaoLegPersPer",pblmHasWiunWaoLegPers == 0?0:pblmHasWiunWaoLegPers * 100 / persSize);
- dataMap.put("pblmWiunWaoLegPersResu",pblmWiunWaoLegPersResu);
- dataMap.put("pblmWiunWaoLegPersResuOne",pblmWiunWaoLegPersResuOne);
- dataMap.put("pblmWiunWaoLegPersResuTwo",pblmWiunWaoLegPersResuTwo);
- dataMap.put("pblmWiunWaoLegPersResuPer",pblmWiunWaoLegPersResu == 0?0:pblmWiunWaoLegPersResu * 100 / persSize);
- dataMap.put("pblmWiunWaoLegPersTrain",pblmWiunWaoLegPersTrain);
- dataMap.put("pblmWiunWaoLegPersTrainOne",pblmWiunWaoLegPersTrainOne);
- dataMap.put("pblmWiunWaoLegPersTrainTwo",pblmWiunWaoLegPersTrainTwo);
- dataMap.put("pblmWiunWaoLegPersTrainPer",pblmWiunWaoLegPersTrain == 0?0:pblmWiunWaoLegPersTrain * 100 / persSize);
- dataMap.put("pblmHasTechPers",pblmHasTechPers);
- dataMap.put("pblmHasTechPersOne",pblmHasTechPersOne);
- dataMap.put("pblmHasTechPersTwo",pblmHasTechPersTwo);
- dataMap.put("pblmHasTechPersPer",pblmHasTechPers == 0?0:pblmHasTechPers * 100 / persSize);
- dataMap.put("pblmTechPersResu",pblmTechPersResu);
- dataMap.put("pblmTechPersResuOne",pblmTechPersResuOne);
- dataMap.put("pblmTechPersResuTwo",pblmTechPersResuTwo);
- dataMap.put("pblmTechPersResuPer",pblmTechPersResu == 0?0:pblmTechPersResu * 100 / persSize);
- dataMap.put("pblmTechPersResuTrain",pblmTechPersResuTrain);
- dataMap.put("pblmTechPersResuTrainOne",pblmTechPersResuTrainOne);
- dataMap.put("pblmTechPersResuTrainTwo",pblmTechPersResuTrainTwo);
- dataMap.put("pblmTechPersResuTrainPer",pblmTechPersResuTrain == 0?0:pblmTechPersResuTrain * 100 / persSize);
- dataMap.put("pblmHasPatrolPers",pblmHasPatrolPers);
- dataMap.put("pblmHasPatrolPersOne",pblmHasPatrolPersOne);
- dataMap.put("pblmHasPatrolPersTwo",pblmHasPatrolPersTwo);
- dataMap.put("pblmHasPatrolPersPer",pblmHasPatrolPers == 0?0:pblmHasPatrolPers * 100 / persSize);
- dataMap.put("pblmPatrolPersResu",pblmPatrolPersResu);
- dataMap.put("pblmPatrolPersResuOne",pblmPatrolPersResuOne);
- dataMap.put("pblmPatrolPersResuTwo",pblmPatrolPersResuTwo);
- dataMap.put("pblmPatrolPersResuPer",pblmPatrolPersResu == 0?0:pblmPatrolPersResu * 100 / persSize);
- dataMap.put("pblmPatrolPersResuTrain",pblmPatrolPersResuTrain);
- dataMap.put("pblmPatrolPersResuTrainOne",pblmPatrolPersResuTrainOne);
- dataMap.put("pblmPatrolPersResuTrainTwo",pblmPatrolPersResuTrainTwo);
- dataMap.put("pblmPatrolPersResuTrainPer",pblmPatrolPersResuTrain == 0?0:pblmPatrolPersResuTrain * 100 / persSize);
- //区域列表
- List<Map<String,Object>> wiunAdList = new LinkedList<>();
- for (String key : hasWiunWaoLegPersAdMap.keySet()) {
- Map<String,Object> map = new HashedMap();
- map.put("adName",key);
- map.put("rsvrSize",hasWiunWaoLegPersAdMap.get(key) == null ? 0 :hasWiunWaoLegPersAdMap.get(key) );
- wiunAdList.add(map);
- }
- dataMap.put("wiunAdList",wiunAdList);
- List<Map<String,Object>> techAdList = new LinkedList<>();
- for (String key : hasTechPersAdMap.keySet()) {
- Map<String,Object> map = new HashedMap();
- map.put("adName",key);
- map.put("rsvrSize",hasTechPersAdMap.get(key) ==null?0:hasTechPersAdMap.get(key));
- techAdList.add(map);
- }
- dataMap.put("techAdList",techAdList);
- List<Map<String,Object>> patrolAdList = new LinkedList<>();
- for (String key : hasPatrolPersAdMap.keySet()) {
- Map<String,Object> map = new HashedMap();
- map.put("adName",key);
- map.put("rsvrSize",hasPatrolPersAdMap.get(key) == null?0 : hasPatrolPersAdMap.get(key));
- patrolAdList.add(map);
- }
- dataMap.put("patrolAdList",patrolAdList);
- dataMap.put("pblmRainForc",pblmRainForc);
- dataMap.put("pblmRainForcOne",pblmRainForcOne);
- dataMap.put("pblmRainForcTwo",pblmRainForcTwo);
- dataMap.put("pblmRainForcPer",pblmRainForc == 0?0:pblmRainForc*100/persSize);
- dataMap.put("pblmSchPlanSameExta",pblmSchPlanSameExta);
- dataMap.put("pblmSchPlanSameExtaOne",pblmSchPlanSameExtaOne);
- dataMap.put("pblmSchPlanSameExtaTwo",pblmSchPlanSameExtaTwo);
- dataMap.put("pblmSchPlanSameExtaPer",pblmSchPlanSameExta == 0?0:pblmSchPlanSameExta*100/persSize);
- dataMap.put("pblmSchPlanSameAppr",pblmSchPlanSameAppr);
- dataMap.put("pblmSchPlanSameApprOne",pblmSchPlanSameApprOne);
- dataMap.put("pblmSchPlanSameApprTwo",pblmSchPlanSameApprTwo);
- dataMap.put("pblmSchPlanSameApprPer",pblmSchPlanSameAppr == 0?0:pblmSchPlanSameAppr*100/persSize);
- dataMap.put("pblmSchPlanSameEmer",pblmSchPlanSameEmer);
- dataMap.put("pblmSchPlanSameEmerOne",pblmSchPlanSameEmerOne);
- dataMap.put("pblmSchPlanSameEmerTwo",pblmSchPlanSameEmerTwo);
- dataMap.put("pblmSchPlanSameEmerPer",pblmSchPlanSameEmer == 0?0:pblmSchPlanSameEmer*100/persSize);
- dataMap.put("pblmSchPlanSameSpeed",pblmSchPlanSameSpeed);
- dataMap.put("pblmSchPlanSameSpeedOne",pblmSchPlanSameSpeedOne);
- dataMap.put("pblmSchPlanSameSpeedTwo",pblmSchPlanSameSpeedTwo);
- dataMap.put("pblmSchPlanSameSpeedPer",pblmSchPlanSameSpeed == 0?0:pblmSchPlanSameSpeed*100/persSize);
- dataMap.put("pblmEmerPlanSameExta",pblmEmerPlanSameExta);
- dataMap.put("pblmEmerPlanSameExtaOne",pblmEmerPlanSameExtaOne);
- dataMap.put("pblmEmerPlanSameExtaTwo",pblmEmerPlanSameExtaTwo);
- dataMap.put("pblmEmerPlanSameExtaPer",pblmEmerPlanSameExta == 0?0:pblmEmerPlanSameExta*100/persSize);
- dataMap.put("pblmEmerPlanSameAppr",pblmEmerPlanSameAppr);
- dataMap.put("pblmEmerPlanSameApprOne",pblmEmerPlanSameApprOne);
- dataMap.put("pblmEmerPlanSameApprTwo",pblmEmerPlanSameApprTwo);
- dataMap.put("pblmEmerPlanSameApprPer",pblmEmerPlanSameAppr == 0?0:pblmEmerPlanSameAppr*100/persSize);
- dataMap.put("pblmEmerPlanSameEmer",pblmEmerPlanSameEmer);
- dataMap.put("pblmEmerPlanSameEmerOne",pblmEmerPlanSameEmerOne);
- dataMap.put("pblmEmerPlanSameEmerTwo",pblmEmerPlanSameEmerTwo);
- dataMap.put("pblmEmerPlanSameEmerPer",pblmEmerPlanSameEmer == 0?0:pblmEmerPlanSameEmer*100/persSize);
- dataMap.put("pblmEmerPlanSameSpeed",pblmEmerPlanSameSpeed);
- dataMap.put("pblmEmerPlanSameSpeedOne",pblmEmerPlanSameSpeedOne);
- dataMap.put("pblmEmerPlanSameSpeedTwo",pblmEmerPlanSameSpeedTwo);
- dataMap.put("pblmEmerPlanSameSpeedPer",pblmEmerPlanSameSpeed == 0?0:pblmEmerPlanSameSpeed*100/persSize);
- dataMap.put("diskRunInfoOne",diskRunInfoOne);
- dataMap.put("diskRunInfoTwo",diskRunInfoTwo);
- dataMap.put("hasSetMainFlOne",hasSetMainFlOne);
- dataMap.put("hasSetMainFlTwo",hasSetMainFlTwo);
- dataMap.put("diskRunInfoOnePer",diskRunInfoOne == 0?0:diskRunInfoOne/Long.valueOf(dataMap.get("rsvrSize").toString()));
- dataMap.put("diskRunInfoTwoPer",diskRunInfoTwo == 0?0:diskRunInfoTwo/Long.valueOf(dataMap.get("rsvrSize").toString()));
- dataMap.put("hasSetMainFlOnePer",hasSetMainFlOne == 0?0:hasSetMainFlOne/Long.valueOf(dataMap.get("rsvrSize").toString()));
- dataMap.put("hasSetMainFlTwoPer",hasSetMainFlTwo == 0?0:hasSetMainFlTwo/Long.valueOf(dataMap.get("rsvrSize").toString()));
- if (!dataMap.containsKey("SK_ZeRenRen")) {
- dataMap.put("SK_ZeRenRen", new ArrayList<>());
- }
- if (!dataMap.containsKey("SK_ZhongDianHuanJie")) {
- dataMap.put("SK_ZhongDianHuanJie", new ArrayList<>());
- }
- if (!dataMap.containsKey("SK_YunXingGuanLi")) {
- dataMap.put("SK_YunXingGuanLi", new ArrayList<>());
- }
- if (!dataMap.containsKey("SK_AnQuanJianDing")) {
- dataMap.put("SK_AnQuanJianDing", new ArrayList<>());
- }
- if (!dataMap.containsKey("SK_GongChengShiTi")) {
- dataMap.put("SK_GongChengShiTi", new ArrayList<>());
- }
- if (!dataMap.containsKey("SK_SheBeiSheShi")) {
- dataMap.put("SK_SheBeiSheShi", new ArrayList<>());
- }
- }
- private void setPblmImgInfo(Map<String, Object> dataMap, BisInspPblm bisInspPblm,Map<String,List<String>> adCodeMap, Long allRsvr) {
- //是否包含在六个枚举中
- String key = null;
- if (bisInspPblm.getInspPblmName().contains(SimpleReportEnum.REVER_INFO2.getTitle())) {
- key = SimpleReportEnum.REVER_INFO2.getValue();
- } else if (bisInspPblm.getInspPblmName().contains(SimpleReportEnum.REVER_INFO3.getTitle())){
- key = SimpleReportEnum.REVER_INFO3.getValue();
- } else if (SimpleReportEnum.REVER_INFO5.getTitle().equals(bisInspPblm.getInspPblmName())) {
- //运行管理,安全鉴定
- if ("安全鉴定".equals(bisInspPblm.getCheckPoint())) {
- key = "SK_AnQuanJianDing";
- } else {
- key = SimpleReportEnum.REVER_INFO5.getValue();
- }
- } else if (SimpleReportEnum.REVER_INFO1.getTitle().equals(bisInspPblm.getInspPblmName())) {
- key = SimpleReportEnum.REVER_INFO5.getValue();
- } else if (SimpleReportEnum.REVER_INFO6.getTitle().equals(bisInspPblm.getInspPblmName())) {
- if ("除险加固".equals(bisInspPblm.getCheckPoint())) {
- key = "SK_AnQuanJianDing";
- } else {
- key = SimpleReportEnum.REVER_INFO6.getValue();
- }
- } else if (SimpleReportEnum.REVER_INFO7.getTitle().equals(bisInspPblm.getInspPblmName())) {
- if ("金结机电设备".equals(bisInspPblm.getCheckPoint())){
- key = SimpleReportEnum.REVER_INFO7.getValue();
- }
- }
- if (key == null) {
- return;
- }
- List list = null;
- if (dataMap.containsKey(key)) {
- list = (List) dataMap.get(key);
- } else {
- list = new LinkedList();
- }
- HashMap<String, Object> itemMap = new HashMap<>(2);
- itemMap.put("index",list.size() + 1);
- itemMap.put("rsvrNm",bisInspPblm.getRsName());
- if (StringUtils.isNotBlank(bisInspPblm.getAdFullName())) {
- String []adNames = bisInspPblm.getAdFullName().split("-");
- itemMap.put("pro",(adNames != null && adNames.length > 0 )? adNames[0] : "xx");
- itemMap.put("city",(adNames != null && adNames.length > 1 )? adNames[1] : "xx");
- itemMap.put("country",(adNames != null && adNames.length > 2 )? adNames[2] : "xx");
- if (adCodeMap.containsKey(adNames[0])) {
- List<String> rgstrList = adCodeMap.get(adNames[0]);
- if (!rgstrList.contains(bisInspPblm.getRgstrId())) {
- rgstrList.add(bisInspPblm.getRgstrId());
- allRsvr++;
- }
- } else {
- allRsvr++;
- List<String> rgstrList = new ArrayList<>();
- rgstrList.add(bisInspPblm.getRgstrId());
- adCodeMap.put(adNames[0],rgstrList);
- }
- }
- itemMap.put("inspPblmDesc",bisInspPblm.getInspPblmDesc());
- // 获取图片列表
- List<GwComFile> gwFiles = gwComFileService.findFileByBiz(bisInspPblm.getPblmId());
- itemMap.put("imgs", new LinkedList<HashMap<String, String>>() {{
- Optional.ofNullable(gwFiles).orElse(new ArrayList<GwComFile>() {{
- add(new GwComFile());
- }}).forEach(y -> {
- add(new HashMap<String, String>(2) {{
- String href = imgPathPrefix.replace("/upload", "") + y.getFilePath() + ".jpg";
- logger.debug("图片路径:" + href);
- put("href", getImageString(href));
- put("desc", y.getAbs() == null ? "图片描述" + y.getFilePath() : y.getAbs());
- put("name", y.getFilePath());
- put("src", y.getFilePath());
- }});
- });
- }});
- list.add(itemMap);
- dataMap.put(key,list);
- }
- /**
- * 设置组信息,返回组id
- * @param dataMap
- * @param persId
- * @param currentOrgId
- * @return
- */
- private String setGroupInfo(Map<String, Object> dataMap, String persId, String month, String currentOrgId) {
- String[] date = month.split("-");
- List<BisInspStatGroupInfoDto> bisInspStatGroupInfoDtoList = bisInspStatDao.getGroupInfo("001",persId,date[0], date[1],currentOrgId);
- int groupSize = bisInspStatGroupInfoDtoList.size();
- String id = bisInspStatGroupInfoDtoList.stream().map(x -> x.getId()).collect(Collectors.joining(","));
- Integer perSize = 0;
- if (StringUtils.isNotBlank(id)) {
- perSize = bisInspStatDao.getPersonCount(InspUtils.setOrgIds(id));
- }
- dataMap.put("groupSize",groupSize);
- dataMap.put("perSize", perSize);
- dataMap.put("month", Integer.valueOf(date[1]).toString());
- return id;
- }
- private String setRgstrInfo(String id,Map<String, Object> dataMap, String persId, String currentOrgId, Map<String,BisInspStatRsvrInfoDto> dtoMap) {
- //查询列表
- List<BisInspStatRsvrInfoDto> list = new ArrayList<>();
- if (StringUtils.isNotBlank(id)) {
- list = bisInspStatDao.getRsvrInfoList(InspUtils.setOrgIds(id));
- }
- String rgstrId = null;//上一个rgstrId,排除重复值
- //水库数量
- Long rsvrSize = new Long(0);
- Long rsvrSizeLitOne = new Long(0);//小一
- Long rsveSizeLitTwo = new Long(0);//小二
- List<String> proList = new ArrayList<>();//省
- List<String> cityList = new ArrayList<>();//市
- List<String> countryList = new ArrayList<>();//县
- List<String> countryPertList = new ArrayList<>();//贫困县
- //水库发挥效益
- Long benefitsSize = new Long(0);//发挥效益水库数量
- Long ifEffective = new Long(0);//是否发挥效益
- Long ifEffectiveNo = new Long(0);
- Double wsfdws = new Double(0);//发挥效益的饮用水源供水量
- Double areaIrr = new Double(0);
- //运行管理
- Long mngrnSize = new Long(0);//运行管理水库数量
- Long safeCommentPerfect = new Long(0);//安全总体评价1正常安全运行
- Long safeCommentGood = new Long(0);
- Long safeCommentBad = new Long(0);
- Long ifFsltdzRun = new Long(0);
- Long ifFsltdzRunNo = new Long(0);
- Long ifFsltdzNoOne = new Long(0);
- Long ifFsltdzNoTwo = new Long(0);
- Long hasWdEmnic = new Long(0);//需要无经费来源
- Long ifManageRegRel = new Long(0);
- Long ifManageRegRelNo = new Long(0);
- Long ifManageReg = new Long(0);//需错误注册信息
- Long ifDamWarnLogo = new Long(0);
- Long ifDamWarnLogoNo = new Long(0);
- //三个责任人
- Long dutySize = new Long(0);//三个责任人水库数量
- //行政责任人
- Long hasWiunWaoLegPers = new Long(0);
- Map<String,List<String>> hasWiunWaoLegPersMap = new HashedMap();
- Long hasWiunWaoLegPersNo = new Long(0);
- Long hasWiunWaoLegPersNoOne = new Long(0);
- Long hasWiunWaoLegPersNoTwo = new Long(0);
- Long wiunWaoLegPersResuPerfect = new Long(0);
- Long wiunWaoLegPersResuGood = new Long(0);
- Long wiunWaoLegPersResuBad = new Long(0);
- Long wiunWaoLegPersResuBadOne = new Long(0);
- Long wiunWaoLegPersResuBadTwo = new Long(0);
- Long wiunWaoLegPersTrain = new Long(0);
- Long wiunWaoLegPersTrainNo = new Long(0);
- Long wiunWaoLegPersTrainNoOne = new Long(0);
- Long wiunWaoLegPersTrainNoTwo = new Long(0);
- //技术责任人
- Long hasTechPers = new Long(0);
- Long hasTechPersNo = new Long(0);
- Long techPersResuPerfect = new Long(0);
- Long techPersResuGood = new Long(0);
- Long techPersResuBad = new Long(0);
- Long techPersTrain = new Long(0);
- Long techPersTrainNo = new Long(0);
- //巡查责任人
- Long hasPatrolPers = new Long(0);
- Long patrolPersResuPerfect = new Long(0);
- Long patrolPersResuGood = new Long(0);
- Long patrolPersResuBad = new Long(0);
- Long patrolPersTrain = new Long(0);
- Long patrolPersTrainNo = new Long(0);
- Long hasAttendTrain = new Long(0);
- /*** **/
- //三个重点
- Long thrqSize = new Long(0);
- Long rainForc = new Long(0);
- Long rainForcNo = new Long(0);
- Long rainForcNote = new Long(0);
- Long rainForcNoteNo = new Long(0);
- //调度运用方案
- Long schPlanSameExta = new Long(0);
- Long schPlanSameExtaNo = new Long(0);
- Long schPlanSameAppr = new Long(0);
- Long schPlanSameApprNo = new Long(0);
- Long schPlanSameSpeedPerfect = new Long(0);
- Long schPlanSameSpeedGood = new Long(0);
- Long schPlanSameSpeedBad = new Long(0);
- //安全应急预案
- Long emerPlanSameExta = new Long(0);
- Long emerPlanSameExtaNo = new Long(0);
- Long emerPlanSameAppr = new Long(0);
- Long emerPlanSameApprNo = new Long(0);
- Long emerPlanSameEme = new Long(0);
- Long emerPlanSameEmeNo = new Long(0);
- Long emerPlanSameSpeedPerfect = new Long(0);
- Long emerPlanSameSpeedGood = new Long(0);
- Long emerPlanSameSpeedBad = new Long(0);
- /**** **/
- //工程实体
- Long proSize = new Long(0);
- //挡水建筑物运行状况
- Long diskRunInfoPerfect = new Long(0);
- Long diskRunInfoGood = new Long(0);
- Long diskRunInfoBad = new Long(0);
- //泄洪建筑物
- Long hasSetMainFl = new Long(0);
- Long isMainFlNormalPerfect = new Long(0);
- Long isMainFlNormalGood = new Long(0);
- Long isMainFlNormalBad = new Long(0);
- //放水建筑物
- Long hasSetPourFl = new Long(0);
- Long pourFyIsNormalPerfect = new Long(0);
- Long pourFyIsNormalGood = new Long(0);
- Long pourFyIsNormalBad = new Long(0);
- //安全鉴定
- Long ifDamSafeReq = new Long(0);
- Long ifDamSafeReqNo = new Long(0);
- Long ifDamSafe = new Long(0); //未开展水库数量,其他水库
- Long notReinForce = new Long(0);
- Long ifDamSafeRul = new Long(0);
- Long ifDamSafeRulNo = new Long(0);
- Long ifDamSafeDepRul = new Long(0);
- Long ifDamSafeDepRulNo = new Long(0);
- Long ifDamSafeThr = new Long(0);
- Long ifReinForceOne = new Long(0);//已实施除险加固
- Long reinForceRunPerfect = new Long(0);
- Long reinForceRunGood = new Long(0);
- Long reinForceRunBad = new Long(0);
- Long reinForceRun3 = new Long(0);
- Long reinForceRun3No = new Long(0);
- Long ifReinForceTwo = new Long(0);//正在进行除险加固
- Long ifReinImpGve = new Long(0);
- Long ifReinImpGveNo = new Long(0);
- Long ifReinImpGveOne = new Long(0);
- Long ifReinImpGveOneNo = new Long(0);
- Long ifReinImpPlan = new Long(0);
- Long ifReinImpPlanNo = new Long(0);
- StringBuilder sb = new StringBuilder("");
- if (list != null && !list.isEmpty()) {
- sb.append("and t.regid in (");
- }
- //开始轮询登记表信息
- for (BisInspStatRsvrInfoDto dto : list) {
- if (dto.getRgstrId().equals(rgstrId)) {
- //过滤重复数据
- continue;
- }
- rgstrId = dto.getRgstrId();
- dtoMap.put(rgstrId,dto);
- //水库基本信息
- rsvrSize++;
- if (rsvrSize % 1000 == 0) {
- sb.delete(sb.length() -1,sb.length()).append(" ) or t.regid in (");
- } else {
- sb.append("'").append(rgstrId).append("'").append(",");
- }
- if ("4".equals(dto.getEngScal())) {
- rsvrSizeLitOne++;
- } else if ("5".equals(dto.getEngScal())) {
- rsveSizeLitTwo++;
- }
- if (StringUtils.isNotBlank(dto.getAdCode())) {
- String proCode = dto.getAdCode().substring(0,2);
- if (!proList.contains(proCode)) {
- proList.add(proCode);
- }
- String cityCode = dto.getAdCode().substring(0,4);
- if (!cityList.contains(cityCode)) {
- cityList.add(cityCode);
- }
- String countrCode = dto.getAdCode().substring(0,6);
- if (!countryList.contains(countrCode)) {
- countryList.add(countrCode);
- }
- if ("1".equals(dto.getIsPoveryt())) {
- if (!countryPertList.contains(countrCode)) {
- countryPertList.add(cityCode);
- }
- }
- }
- //水库发挥效益
- if (StringUtils.isNotBlank(dto.getBenefitsId())) {
- benefitsSize++;
- if (dto.getWsfdws() != null) {
- wsfdws = wsfdws + dto.getWsfdws();
- }
- if (StringUtils.isNotBlank(dto.getAreaIrr())) {
- areaIrr += Double.valueOf(dto.getAreaIrr());
- }
- if (StringUtils.isNotBlank(dto.getIfEffective())) {
- Map<String,Long> map = this.setCommonInfo(dto.getIfEffective(),ifEffective,ifEffectiveNo,null);
- ifEffective = map.get("1");
- ifEffectiveNo = map.get("2");
- }
- }
- //运行管理
- if (StringUtils.isNotBlank(dto.getMngrnId())) {
- mngrnSize++;
- Map<String,Long> map = null;
- map = this.setCommonInfo(dto.getSafeComment(),safeCommentPerfect,safeCommentGood,safeCommentBad);
- safeCommentPerfect = map==null? safeCommentPerfect: map.get("1");
- safeCommentGood = map==null?safeCommentGood: map.get("2");
- safeCommentBad = map==null?safeCommentBad: map.get("3");
- map = this.setCommonInfo(dto.getIfFsltdzRun(),ifFsltdzRun,ifFsltdzRunNo,null);
- ifFsltdzRun = map==null?ifFsltdzRun:map.get("1");
- ifFsltdzRunNo = map==null?ifFsltdzRunNo:map.get("2");
- map = this.setCommonInfo(dto.getIfFsltdzNo(),ifFsltdzNoOne,ifFsltdzNoTwo,null);
- ifFsltdzNoOne = map==null?ifFsltdzNoOne: map.get("1");
- ifFsltdzNoTwo = map==null?ifFsltdzNoTwo:map.get("2");
- map = this.setCommonInfo(dto.getHasWdEmnic(),null,hasWdEmnic,null);
- hasWdEmnic =map==null?hasWdEmnic: map.get("2");
- map = this.setCommonInfo(dto.getIfManageRegRel(),null,ifManageReg,null);
- ifManageReg = map==null?ifManageReg:map.get("2");
- map = this.setCommonInfo(dto.getIfManageReg(),ifManageRegRel,ifManageRegRelNo,null);
- ifManageRegRel = map==null?ifManageRegRel:map.get("1");
- ifManageRegRelNo = map==null?ifManageRegRelNo:map.get("2");
- map = this.setCommonInfo(dto.getIfDamWarnLogo(),ifDamWarnLogo,ifDamWarnLogoNo,null);
- ifDamWarnLogo = map==null?ifDamWarnLogo:map.get("1");
- ifDamWarnLogoNo = map==null?ifDamWarnLogoNo:map.get("2");
- }
- //三个责任人
- if (StringUtils.isNotBlank(dto.getDutyId())) {
- dutySize++;
- Map<String,Long> map = null;
- map = this.setCommonInfo(dto.getHasWiunWaoLegPers(),hasWiunWaoLegPers,hasWiunWaoLegPersNo,null);
- hasWiunWaoLegPers = map==null?hasWiunWaoLegPers:map.get("1");
- hasWiunWaoLegPersNo = map==null?hasWiunWaoLegPersNo:map.get("2");
- if ("2".equals(dto.getHasWiunWaoLegPers())) {
- //区域
- if ("4".equals(dto.getEngScal())) {
- hasWiunWaoLegPersNoOne++;
- } else if ("5".equals(dto.getEngScal())) {
- hasWiunWaoLegPersNoTwo++;
- }
- }
- map = this.setCommonInfo(dto.getWiunWaoLegPersResu(),wiunWaoLegPersResuPerfect,wiunWaoLegPersResuGood,wiunWaoLegPersResuBad);
- wiunWaoLegPersResuPerfect = map==null? wiunWaoLegPersResuPerfect: map.get("1");
- wiunWaoLegPersResuGood = map==null?wiunWaoLegPersResuGood: map.get("2");
- wiunWaoLegPersResuBad = map==null?wiunWaoLegPersResuBad: map.get("3");
- if ("3".equals(dto.getWiunWaoLegPersResu())){
- if ("4".equals(dto.getEngScal())) {
- wiunWaoLegPersResuBadOne++;
- } else if ("5".equals(dto.getEngScal())) {
- wiunWaoLegPersResuBadTwo++;
- }
- }
- map = this.setCommonInfo(dto.getWiunWaoLegPersTrain(),wiunWaoLegPersTrain,wiunWaoLegPersTrainNo,null);
- wiunWaoLegPersTrain = map==null? wiunWaoLegPersTrain: map.get("1");
- wiunWaoLegPersTrainNo = map==null?wiunWaoLegPersTrainNo: map.get("2");
- if ("2".equals(dto.getWiunWaoLegPersTrain())) {
- if ("4".equals(dto.getEngScal())) {
- wiunWaoLegPersTrainNoOne++;
- } else if ("5".equals(dto.getEngScal())) {
- wiunWaoLegPersTrainNoTwo++;
- }
- }
- map = this.setCommonInfo(dto.getHasTechPers(),hasTechPers,hasTechPersNo,null);
- hasTechPers = map==null? hasTechPers: map.get("1");
- hasTechPersNo = map==null?hasTechPersNo: map.get("2");
- map = this.setCommonInfo(dto.getTechPersResu(),techPersResuPerfect,techPersResuGood,techPersResuBad);
- techPersResuPerfect = map==null? techPersResuPerfect: map.get("1");
- techPersResuGood = map==null?techPersResuGood: map.get("2");
- techPersResuBad = map==null?techPersResuBad: map.get("3");
- map = this.setCommonInfo(dto.getTechPersTrain(),techPersTrain,techPersTrainNo,null);
- techPersTrain = map==null? techPersTrain: map.get("1");
- techPersTrainNo = map==null?techPersTrainNo: map.get("2");
- map = this.setCommonInfo(dto.getHasPatrolPers(),hasPatrolPers,null,null);
- hasPatrolPers = map==null? hasPatrolPers: map.get("1");
- map = this.setCommonInfo(dto.getPatrolPersResu(),patrolPersResuPerfect,patrolPersResuGood,patrolPersResuBad);
- patrolPersResuPerfect = map==null? patrolPersResuPerfect: map.get("1");
- patrolPersResuGood = map==null?patrolPersResuGood: map.get("2");
- patrolPersResuBad = map==null?patrolPersResuBad: map.get("3");
- map = this.setCommonInfo(dto.getPatrolPersTrain(),patrolPersTrain,patrolPersTrainNo,null);
- patrolPersTrain = map==null? patrolPersTrain: map.get("1");
- patrolPersTrainNo = map==null?patrolPersTrainNo: map.get("2");
- map = this.setCommonInfo(dto.getHasAttendTrain(),hasAttendTrain,null,null);
- hasAttendTrain = map==null? hasAttendTrain: map.get("1");
- }
- //三个重点
- if(StringUtils.isNotBlank(dto.getThrqId())) {
- thrqSize++;
- Map<String,Long> map = null;
- map = this.setCommonInfo(dto.getRainForc(),rainForc,rainForcNo,null);
- rainForc = map==null? rainForc: map.get("1");
- rainForcNo = map==null?rainForcNo: map.get("2");
- map = this.setCommonInfo(dto.getRainForcNote(),rainForcNote,rainForcNoteNo,null);
- rainForcNote = map==null? rainForcNote: map.get("1");
- rainForcNoteNo = map==null?rainForcNoteNo: map.get("2");
- map = this.setCommonInfo(dto.getSchPlanSameExta(),schPlanSameExta,schPlanSameExtaNo,null);
- schPlanSameExta = map==null? schPlanSameExta: map.get("1");
- schPlanSameExtaNo = map==null?schPlanSameExtaNo: map.get("2");
- map = this.setCommonInfo(dto.getSchPlanSameAppr(),schPlanSameAppr,schPlanSameApprNo,null);
- schPlanSameAppr = map==null? schPlanSameAppr: map.get("1");
- schPlanSameApprNo = map==null?schPlanSameApprNo: map.get("2");
- map = this.setCommonInfo(dto.getSchPlanSameSpeed(),schPlanSameSpeedPerfect,schPlanSameSpeedGood,schPlanSameSpeedBad);
- schPlanSameSpeedPerfect = map==null? schPlanSameSpeedPerfect: map.get("1");
- schPlanSameSpeedGood = map==null?schPlanSameSpeedGood: map.get("2");
- schPlanSameSpeedBad = map==null?schPlanSameSpeedBad: map.get("3");
- map = this.setCommonInfo(dto.getEmerPlanSameExta(),emerPlanSameExta,emerPlanSameExtaNo,null);
- emerPlanSameExta = map==null? emerPlanSameExta: map.get("1");
- emerPlanSameExtaNo = map==null?emerPlanSameExtaNo: map.get("2");
- map = this.setCommonInfo(dto.getEmerPlanSameAppr(),emerPlanSameAppr,emerPlanSameApprNo,null);
- emerPlanSameAppr = map==null? emerPlanSameAppr: map.get("1");
- emerPlanSameApprNo = map==null?emerPlanSameApprNo: map.get("2");
- map = this.setCommonInfo(dto.getEmerPlanSameEme(),emerPlanSameEme,emerPlanSameEmeNo,null);
- emerPlanSameEme = map==null? emerPlanSameEme: map.get("1");
- emerPlanSameEmeNo = map==null?emerPlanSameEmeNo: map.get("2");
- map = this.setCommonInfo(dto.getEmerPlanSameSpeed(),emerPlanSameSpeedPerfect,emerPlanSameSpeedGood,emerPlanSameSpeedBad);
- emerPlanSameSpeedPerfect = map==null? emerPlanSameSpeedPerfect: map.get("1");
- emerPlanSameSpeedGood = map==null?emerPlanSameSpeedGood: map.get("2");
- emerPlanSameSpeedBad = map==null?emerPlanSameSpeedBad: map.get("3");
- }
- //工程实体
- if (StringUtils.isNotBlank(dto.getProId())) {
- proSize++;
- Map<String,Long> map = null;
- map = this.setCommonInfo(dto.getDiskRunInfo(),diskRunInfoPerfect,diskRunInfoGood,diskRunInfoBad);
- diskRunInfoPerfect = map==null? diskRunInfoPerfect: map.get("1");
- diskRunInfoGood = map==null?diskRunInfoGood: map.get("2");
- diskRunInfoBad = map==null?diskRunInfoBad: map.get("3");
- map = this.setCommonInfo(dto.getHasSetMainFl(),hasSetMainFl,null,null);
- hasSetMainFl = map==null? hasSetMainFl: map.get("1");
- map = this.setCommonInfo(dto.getIsMainFlNormal(),isMainFlNormalPerfect,isMainFlNormalGood,isMainFlNormalBad);
- isMainFlNormalPerfect = map==null? isMainFlNormalPerfect: map.get("1");
- isMainFlNormalGood = map==null?isMainFlNormalGood: map.get("2");
- isMainFlNormalBad = map==null?isMainFlNormalBad: map.get("3");
- map = this.setCommonInfo(dto.getHasSetPourFl(),hasSetPourFl,null,null);
- hasSetPourFl = map==null? hasSetPourFl: map.get("1");
- if ("1".equals(dto.getHasSetPourFl())) {
- map = this.setCommonInfo(dto.getPourFyIsNormal(), pourFyIsNormalPerfect, pourFyIsNormalGood, pourFyIsNormalBad);
- pourFyIsNormalPerfect = map == null ? pourFyIsNormalPerfect : map.get("1");
- pourFyIsNormalGood = map == null ? pourFyIsNormalGood : map.get("2");
- pourFyIsNormalBad = map == null ? pourFyIsNormalBad : map.get("3");
- }
- map = this.setCommonInfo(dto.getIfDamSafeReq(),ifDamSafeReq,ifDamSafeReqNo,null);
- ifDamSafeReq = map==null? ifDamSafeReq: map.get("1");
- ifDamSafeReqNo = map==null? ifDamSafeReqNo: map.get("2");
- map = this.setCommonInfo(dto.getIfDamSafe(),null,ifDamSafe,null);
- ifDamSafe = map==null?ifDamSafe: map.get("2");
- map = this.setCommonInfo(dto.getNotReinForce(),notReinForce,null,null);
- notReinForce = map==null? notReinForce: map.get("1");
- map = this.setCommonInfo(dto.getIfDamSafeRul(),ifDamSafeRul,ifDamSafeRulNo,null);
- ifDamSafeRul = map==null? ifDamSafeRul: map.get("1");
- ifDamSafeRulNo = map==null?ifDamSafeRulNo: map.get("2");
- map = this.setCommonInfo(dto.getIfDamSafeDepRul(),ifDamSafeDepRul,ifDamSafeDepRulNo,null);
- ifDamSafeDepRul = map==null? ifDamSafeDepRul: map.get("1");
- ifDamSafeDepRulNo = map==null?ifDamSafeDepRulNo: map.get("2");
- map = this.setCommonInfo(dto.getIfDamSafeThr(),ifDamSafeThr,null,null);
- ifDamSafeThr = map==null? ifDamSafeThr: map.get("1");
- if ("1".equals(dto.getIfDamSafeThr())) {
- map = this.setCommonInfo(dto.getIfReinForce(), ifReinForceOne, ifReinForceTwo, null);
- ifReinForceOne = map == null ? ifReinForceOne : map.get("1");
- ifReinForceTwo = map == null ? ifReinForceTwo : map.get("2");
- if ("1".equals(dto.getIfReinForce())) {
- map = this.setCommonInfo(dto.getIfReinImpGve(),ifReinImpGveOne,ifReinImpGveOneNo,null);
- ifReinImpGveOne = map==null? ifReinImpGve: map.get("1");
- ifReinImpGveOneNo = map==null?ifReinImpGveNo: map.get("2");
- map = this.setCommonInfo(dto.getReinForceRun(),reinForceRunPerfect,reinForceRunGood,reinForceRunBad);
- reinForceRunPerfect = map==null? reinForceRunPerfect: map.get("1");
- reinForceRunGood = map==null?reinForceRunGood: map.get("2");
- reinForceRunBad = map==null?reinForceRunBad: map.get("3");
- map = this.setCommonInfo(dto.getReinForceRun3(),reinForceRun3,reinForceRun3No,null);
- reinForceRun3 = map==null? reinForceRun3: map.get("1");
- reinForceRun3No = map==null?reinForceRun3No: map.get("2");
- } else if ("2".equals(dto.getIfReinForce())) {
- map = this.setCommonInfo(dto.getIfReinImpGve(),ifReinImpGve,ifReinImpGveNo,null);
- ifReinImpGve = map==null? ifReinImpGve: map.get("1");
- ifReinImpGveNo = map==null?ifReinImpGveNo: map.get("2");
- map = this.setCommonInfo(dto.getIfReinImpPlan(),ifReinImpPlan,ifReinImpPlanNo,null);
- ifReinImpPlan = map==null? ifReinImpPlan: map.get("1");
- ifReinImpPlanNo = map==null?ifReinImpPlanNo: map.get("2");
- }
- }
- }
- }
- //字段写入
- dataMap.put("rsvrSize",rsvrSize);
- dataMap.put("rsvrSizeLitOne",rsvrSizeLitOne);
- dataMap.put("rsveSizeLitTwo",rsveSizeLitTwo);
- dataMap.put("provinceSize",proList.size());
- dataMap.put("citySize",cityList.size());
- dataMap.put("countrtSize",countryList.size());
- dataMap.put("countryPertSize",countryPertList.size());
- dataMap.put("benefitsSize",benefitsSize);
- dataMap.put("ifEffective",ifEffective);
- dataMap.put("ifEffectiveNo",ifEffectiveNo);
- dataMap.put("ifEffectivePer",ifEffective == 0 ? 0 : ifEffective * 100 / benefitsSize);
- dataMap.put("ifEffectiveNoPer",ifEffectiveNo == 0 ? 0 : ifEffectiveNo * 100 / benefitsSize);
- dataMap.put("wsfdws",wsfdws / 10000);
- dataMap.put("areaIrr",areaIrr / 10000);
- dataMap.put("mngrnSize",mngrnSize);
- dataMap.put("safeCommentPerfect",safeCommentPerfect);
- dataMap.put("safeCommentGood",safeCommentGood);
- dataMap.put("safeCommentBad",safeCommentBad);
- dataMap.put("safeCommentPerfectPer",safeCommentPerfect==0?0 : safeCommentPerfect * 100 / rsvrSize);
- dataMap.put("safeCommentGoodPer",safeCommentGood == 0?0:safeCommentGood * 100 /rsvrSize);
- dataMap.put("safeCommentBadPer",safeCommentBad == 0 ? 0:safeCommentBad * 100 / rsvrSize);
- dataMap.put("ifFsltdzRun",ifFsltdzRun);
- dataMap.put("ifFsltdzRunNo",ifFsltdzRunNo);
- dataMap.put("ifFsltdzNoOne",ifFsltdzNoOne);
- dataMap.put("ifFsltdzNoTwo",ifFsltdzNoTwo);
- dataMap.put("hasWdEmnic",hasWdEmnic);
- dataMap.put("ifManageRegRel",ifManageRegRel);
- dataMap.put("ifManageRegRelNo",ifManageRegRelNo);
- dataMap.put("ifManageReg",ifManageReg);
- dataMap.put("ifDamWarnLogo",ifDamWarnLogo);
- dataMap.put("ifDamWarnLogoNo",ifDamWarnLogoNo);
- dataMap.put("ifFsltdzRunPer",ifFsltdzRun ==0 ? 0:ifFsltdzRun * 100 /mngrnSize);
- dataMap.put("ifFsltdzRunNoPer", ifFsltdzRunNo ==0 ? 0:ifFsltdzRunNo * 100 /mngrnSize);
- dataMap.put("ifFsltdzNoOnePer", ifFsltdzNoOne ==0 ? 0:ifFsltdzNoOne * 100 /mngrnSize);
- dataMap.put("ifFsltdzNoTwoPer", ifFsltdzNoTwo ==0 ? 0:ifFsltdzNoTwo * 100 /mngrnSize);
- dataMap.put("hasWdEmnicPer", hasWdEmnic ==0 ? 0:hasWdEmnic * 100 /mngrnSize);
- dataMap.put("ifManageRegRelPer", ifManageRegRel ==0 ? 0:ifManageRegRel * 100 /mngrnSize);
- dataMap.put("ifManageRegRelNoPer", ifManageRegRelNo ==0 ? 0:ifManageRegRelNo * 100 /mngrnSize);
- dataMap.put("ifManageRegPer", ifManageReg ==0 ? 0:ifManageReg * 100 /mngrnSize);
- dataMap.put("ifDamWarnLogoPer", ifDamWarnLogo ==0 ? 0:ifDamWarnLogo * 100 /mngrnSize);
- dataMap.put("ifDamWarnLogoNoPer", ifDamWarnLogoNo ==0 ? 0:ifDamWarnLogoNo * 100 /mngrnSize);
- dataMap.put("dutySize",dutySize);
- dataMap.put("hasWiunWaoLegPers",hasWiunWaoLegPers);
- dataMap.put("hasWiunWaoLegPersPer",hasWiunWaoLegPers == 0 ? 0: hasWiunWaoLegPers * 100 / dutySize);
- dataMap.put("hasWiunWaoLegPersNo",hasWiunWaoLegPersNo);
- dataMap.put("hasWiunWaoLegPersNoOne",hasWiunWaoLegPersNoOne);
- dataMap.put("hasWiunWaoLegPersNoTwo",hasWiunWaoLegPersNoTwo);
- dataMap.put("hasWiunWaoLegPersNoPer",hasWiunWaoLegPersNo == 0 ? 0: hasWiunWaoLegPersNo * 100 / dutySize);
- dataMap.put("wiunWaoLegPersResuPerfect",wiunWaoLegPersResuPerfect);
- dataMap.put("wiunWaoLegPersResuGood",wiunWaoLegPersResuGood);
- dataMap.put("wiunWaoLegPersResuBad",wiunWaoLegPersResuBad);
- dataMap.put("wiunWaoLegPersResuPerfectPer",wiunWaoLegPersResuPerfect == 0? 0 : wiunWaoLegPersResuPerfect * 100 / dutySize);
- dataMap.put("wiunWaoLegPersResuGoodPer",wiunWaoLegPersResuGood == 0?0 : wiunWaoLegPersResuGood * 100/dutySize);
- dataMap.put("wiunWaoLegPersResuBadPer",wiunWaoLegPersResuBad == 0?0 : wiunWaoLegPersResuBad * 100/dutySize);
- dataMap.put("wiunWaoLegPersTrain",wiunWaoLegPersTrain);
- dataMap.put("wiunWaoLegPersTrainNo",wiunWaoLegPersTrainNo);
- dataMap.put("wiunWaoLegPersTrainPer",wiunWaoLegPersTrain == 0? 0: wiunWaoLegPersTrain* 100/dutySize);
- dataMap.put("wiunWaoLegPersTrainNoPer",wiunWaoLegPersTrainNo == 0? 0: wiunWaoLegPersTrainNo*100/dutySize);
- dataMap.put("hasTechPers",hasTechPers);
- dataMap.put("hasTechPersNo",hasTechPersNo);
- dataMap.put("hasTechPersNoPer",hasTechPersNo == 0 ? 0 : hasTechPersNo * 100 /dutySize);
- dataMap.put("techPersResuPerfect",techPersResuPerfect);
- dataMap.put("techPersResuGood",techPersResuGood);
- dataMap.put("techPersResuBad",techPersResuBad);
- dataMap.put("techPersTrain",techPersTrain);
- dataMap.put("techPersTrainNo",techPersTrainNo);
- dataMap.put("hasTechPersPer",hasTechPers == 0? 0: hasTechPers* 100/dutySize);
- dataMap.put("techPersResuPerfectPer",techPersResuPerfect == 0?0 :techPersResuPerfect*100/dutySize);
- dataMap.put("techPersResuGoodPer",techPersResuGood == 0?0 :techPersResuGood*100/dutySize);
- dataMap.put("techPersResuBadPer", techPersResuBad == 0?0 :techPersResuBad*100/dutySize);
- dataMap.put("techPersTrainPer", techPersTrain == 0?0 :techPersTrain*100/dutySize);
- dataMap.put("techPersTrainNoPer", techPersTrainNo == 0?0 :techPersTrainNo*100/dutySize);
- dataMap.put("hasPatrolPers",hasPatrolPers);
- dataMap.put("patrolPersResuPerfect",patrolPersResuPerfect);
- dataMap.put("patrolPersResuGood",patrolPersResuGood);
- dataMap.put("patrolPersResuBad",patrolPersResuBad);
- dataMap.put("patrolPersTrain",patrolPersTrain);
- dataMap.put("patrolPersTrainNo",patrolPersTrainNo);
- dataMap.put("hasAttendTrain",hasAttendTrain);
- dataMap.put("hasPatrolPersPer", hasPatrolPers == 0?0 :hasPatrolPers*100/dutySize);
- dataMap.put("patrolPersResuPerfectPer", patrolPersResuPerfect == 0?0 :patrolPersResuPerfect*100/dutySize);
- dataMap.put("patrolPersResuGoodPer", patrolPersResuGood == 0?0 :patrolPersResuGood*100/dutySize);
- dataMap.put("patrolPersResuBadPer", patrolPersResuBad == 0?0 :patrolPersResuBad*100/dutySize);
- dataMap.put("patrolPersTrainPer", patrolPersTrain == 0?0 :patrolPersTrain*100/dutySize);
- dataMap.put("patrolPersTrainNoPer", patrolPersTrainNo == 0?0 :patrolPersTrainNo*100/dutySize);
- dataMap.put("hasAttendTrainPer", hasAttendTrain == 0?0 :hasAttendTrain*100/dutySize);
- dataMap.put("thrqSize",thrqSize);
- dataMap.put("rainForc",rainForc);
- dataMap.put("rainForcPer",rainForc == 0?0: rainForc*100/thrqSize);
- dataMap.put("rainForcNo",rainForcNo);
- dataMap.put("rainForcNoPer",rainForcNo == 0?0 : rainForcNo * 100/thrqSize);
- dataMap.put("rainForcNote",rainForcNote);
- dataMap.put("rainForcNoteNo",rainForcNoteNo);
- dataMap.put("rainForcNotePer", rainForcNote == 0?0: rainForcNote*100/thrqSize);
- dataMap.put("rainForcNoteNoPer", rainForcNoteNo == 0?0: rainForcNoteNo*100/thrqSize);
- dataMap.put("schPlanSameExta",schPlanSameExta);
- dataMap.put("schPlanSameExtaNo",schPlanSameExtaNo);
- dataMap.put("schPlanSameAppr",schPlanSameAppr);
- dataMap.put("schPlanSameApprNo",schPlanSameApprNo);
- dataMap.put("schPlanSameSpeedPerfect",schPlanSameSpeedPerfect);
- dataMap.put("schPlanSameSpeedGood",schPlanSameSpeedGood);
- dataMap.put("schPlanSameSpeedBad",schPlanSameSpeedBad);
- dataMap.put("schPlanSameExtaPer", schPlanSameExta == 0?0: schPlanSameExta*100/thrqSize);
- dataMap.put("schPlanSameExtaNoPer", schPlanSameExtaNo == 0?0: schPlanSameExtaNo*100/thrqSize);
- dataMap.put("schPlanSameApprPer", schPlanSameAppr == 0?0: schPlanSameAppr*100/thrqSize);
- dataMap.put("schPlanSameApprNoPer", schPlanSameApprNo == 0?0: schPlanSameApprNo*100/thrqSize);
- dataMap.put("schPlanSameSpeedPerfectPer", schPlanSameSpeedPerfect == 0?0: schPlanSameSpeedPerfect*100/thrqSize);
- dataMap.put("schPlanSameSpeedGoodPer", schPlanSameSpeedGood == 0?0: schPlanSameSpeedGood*100/thrqSize);
- dataMap.put("schPlanSameSpeedBadPer", schPlanSameSpeedBad == 0?0: schPlanSameSpeedBad*100/thrqSize);
- dataMap.put("emerPlanSameExta",emerPlanSameExta);
- dataMap.put("emerPlanSameExtaNo",emerPlanSameExtaNo);
- dataMap.put("emerPlanSameAppr",emerPlanSameAppr);
- dataMap.put("emerPlanSameApprNo",emerPlanSameApprNo);
- dataMap.put("emerPlanSameEme",emerPlanSameEme);
- dataMap.put("emerPlanSameEmeNo",emerPlanSameEmeNo);
- dataMap.put("emerPlanSameSpeedPerfect",emerPlanSameSpeedPerfect);
- dataMap.put("emerPlanSameSpeedGood",emerPlanSameSpeedGood);
- dataMap.put("emerPlanSameSpeedBad",emerPlanSameSpeedBad);
- dataMap.put("emerPlanSameExtaPer", emerPlanSameExta == 0?0: emerPlanSameExta*100/thrqSize);
- dataMap.put("emerPlanSameExtaNoPer", emerPlanSameExtaNo == 0?0: emerPlanSameExtaNo*100/thrqSize);
- dataMap.put("emerPlanSameApprPer", emerPlanSameAppr == 0?0: emerPlanSameAppr*100/thrqSize);
- dataMap.put("emerPlanSameApprNoPer", emerPlanSameApprNo == 0?0: emerPlanSameApprNo*100/thrqSize);
- dataMap.put("emerPlanSameEmePer", emerPlanSameEme == 0?0: emerPlanSameEme*100/thrqSize);
- dataMap.put("emerPlanSameEmeNoPer", emerPlanSameEmeNo == 0?0: emerPlanSameEmeNo*100/thrqSize);
- dataMap.put("emerPlanSameSpeedPerfectPer", emerPlanSameSpeedPerfect == 0?0: emerPlanSameSpeedPerfect*100/thrqSize);
- dataMap.put("emerPlanSameSpeedGoodPer", emerPlanSameSpeedGood == 0?0: emerPlanSameSpeedGood*100/thrqSize);
- dataMap.put("emerPlanSameSpeedBadPer", emerPlanSameSpeedBad == 0?0: emerPlanSameSpeedBad*100/thrqSize);
- dataMap.put("proSize",proSize);
- dataMap.put("diskRunInfoPerfect",diskRunInfoPerfect);
- dataMap.put("diskRunInfoGood",diskRunInfoGood);
- dataMap.put("diskRunInfoBad",diskRunInfoBad);
- dataMap.put("diskRunInfoPerfectPer",diskRunInfoPerfect == 0 ? 0: diskRunInfoPerfect * 100/proSize);
- dataMap.put("diskRunInfoGoodPer", diskRunInfoGood == 0 ? 0: diskRunInfoGood * 100/proSize);
- dataMap.put("diskRunInfoBadPer", diskRunInfoBad == 0 ? 0: diskRunInfoBad * 100/proSize);
- dataMap.put("hasSetMainFl",hasSetMainFl);
- dataMap.put("isMainFlNormalPerfect",isMainFlNormalPerfect);
- dataMap.put("isMainFlNormalGood",isMainFlNormalGood);
- dataMap.put("isMainFlNormalBad",isMainFlNormalBad);
- dataMap.put("hasSetMainFlPer", hasSetMainFl == 0 ? 0: hasSetMainFl * 100/proSize);
- dataMap.put("isMainFlNormalPerfectPer", isMainFlNormalPerfect == 0 ? 0: isMainFlNormalPerfect * 100/proSize);
- dataMap.put("isMainFlNormalGoodPer", isMainFlNormalGood == 0 ? 0: isMainFlNormalGood * 100/proSize);
- dataMap.put("isMainFlNormalBadPer", isMainFlNormalBad == 0 ? 0: isMainFlNormalBad * 100/proSize);
- dataMap.put("hasSetPourFl",hasSetPourFl);
- dataMap.put("pourFyIsNormalPerfect",pourFyIsNormalPerfect);
- dataMap.put("pourFyIsNormalGood",pourFyIsNormalGood);
- dataMap.put("pourFyIsNormalBad",pourFyIsNormalBad);
- dataMap.put("hasSetPourFlPer", hasSetPourFl == 0 ? 0: hasSetPourFl * 100/proSize);
- dataMap.put("pourFyIsNormalPerfectPer", pourFyIsNormalPerfect == 0 ? 0: pourFyIsNormalPerfect * 100/proSize);
- dataMap.put("pourFyIsNormalGoodPer", pourFyIsNormalGood == 0 ? 0: pourFyIsNormalGood * 100/proSize);
- dataMap.put("pourFyIsNormalBadPer", pourFyIsNormalBad == 0 ? 0: pourFyIsNormalBad * 100/proSize);
- dataMap.put("ifDamSafeReq",ifDamSafeReq);
- dataMap.put("ifDamSafeReqNo",ifDamSafeReqNo);
- dataMap.put("ifDamSafeReqNoAll",proSize - ifDamSafeReq);
- dataMap.put("ifDamSafe",ifDamSafe);
- dataMap.put("ifDamSafePer",ifDamSafe == 0 ? 0 : ifDamSafe * 100/proSize);
- dataMap.put("notReinForce",notReinForce);
- dataMap.put("ifDamSafeRul",ifDamSafeRul);
- dataMap.put("ifDamSafeRulNo",ifDamSafeRulNo);
- dataMap.put("ifDamSafeDepRul",ifDamSafeDepRul);
- dataMap.put("ifDamSafeDepRulNo",ifDamSafeDepRulNo);
- dataMap.put("ifDamSafeDepRulNoPer",ifDamSafeDepRulNo ==0?0:ifDamSafeDepRulNo*100/proSize);
- dataMap.put("ifDamSafeThr",ifDamSafeThr);
- dataMap.put("ifReinForceOne",ifReinForceOne);
- dataMap.put("reinForceRunPerfect",reinForceRunPerfect);
- dataMap.put("reinForceRunGood",reinForceRunGood);
- dataMap.put("reinForceRunBad",reinForceRunBad);
- dataMap.put("reinForceRun3",reinForceRun3);
- dataMap.put("reinForceRun3No",reinForceRun3No);
- dataMap.put("ifReinForceTwo",ifReinForceTwo);
- dataMap.put("ifReinImpGve",ifReinImpGve);
- dataMap.put("ifReinImpGveNo",ifReinImpGveNo);
- dataMap.put("ifReinImpGveOne",ifReinImpGveOne);
- dataMap.put("ifReinImpGveOneNo",ifReinImpGveOneNo);
- dataMap.put("ifReinImpPlan",ifReinImpPlan);
- dataMap.put("ifReinImpPlanNo",ifReinImpPlanNo);
- dataMap.put("ifDamSafeReqPer", ifDamSafeReq == 0 ? 0: ifDamSafeReq * 100/proSize);
- dataMap.put("ifDamSafeReqNoPer", ifDamSafeReqNo == 0 ? 0: ifDamSafeReqNo * 100/proSize);
- dataMap.put("ifDamSafePer", ifDamSafe == 0 ? 0: ifDamSafe * 100/proSize);
- dataMap.put("notReinForcePer", notReinForce == 0 ? 0: notReinForce * 100/proSize);
- dataMap.put("ifDamSafeRulPer", ifDamSafeRul == 0 ? 0: ifDamSafeRul * 100/proSize);
- dataMap.put("ifDamSafeRulNoPer", ifDamSafeRulNo == 0 ? 0: ifDamSafeRulNo * 100/proSize);
- dataMap.put("ifDamSafeDepRulPer", ifDamSafeDepRul == 0 ? 0: ifDamSafeDepRul * 100/proSize);
- dataMap.put("ifDamSafeThrPer", ifDamSafeThr == 0 ? 0: ifDamSafeThr * 100/proSize);
- dataMap.put("ifReinForceOnePer", ifReinForceOne == 0 ? 0: ifReinForceOne * 100/proSize);
- dataMap.put("reinForceRunPerfectPer", reinForceRunPerfect == 0 ? 0: reinForceRunPerfect * 100/proSize);
- dataMap.put("reinForceRunGoodPer", reinForceRunGood == 0 ? 0: reinForceRunGood * 100/proSize);
- dataMap.put("reinForceRunBadPer", reinForceRunBad == 0 ? 0: reinForceRunBad * 100/proSize);
- dataMap.put("reinForceRun3Per", reinForceRun3 == 0 ? 0: reinForceRun3 * 100/proSize);
- dataMap.put("reinForceRun3NoPer", reinForceRun3No == 0 ? 0: reinForceRun3No * 100/proSize);
- dataMap.put("ifReinForceTwoPer", ifReinForceTwo == 0 ? 0: ifReinForceTwo * 100/proSize);
- dataMap.put("ifReinImpGvePer", ifReinImpGve == 0 ? 0: ifReinImpGve * 100/proSize);
- dataMap.put("ifReinImpGveNoPer", ifReinImpGveNo == 0 ? 0: ifReinImpGveNo * 100/proSize);
- dataMap.put("ifReinImpGveOnePer", ifReinImpGveOne == 0 ? 0: ifReinImpGveOne * 100/proSize);
- dataMap.put("ifReinImpGveOneNoPer", ifReinImpGveOneNo == 0 ? 0: ifReinImpGveOneNo * 100/proSize);
- dataMap.put("ifReinImpPlanPer", ifReinImpPlan == 0 ? 0: ifReinImpPlan * 100/proSize);
- dataMap.put("ifReinImpPlanNoPer", ifReinImpPlanNo == 0 ? 0: ifReinImpPlanNo * 100/proSize);
- if (sb.length() > 0) {
- return sb.delete(sb.length() - 1, sb.length()).append(")").toString();
- }
- return "";
- }
- private Map<String,Long> setCommonInfo(String ifEffective, Long param, Long param1,Long param2) {
- if (StringUtils.isBlank(ifEffective) || "0".equals(ifEffective)) {
- return null;
- }
- switch (ifEffective) {
- case "1":
- if (param != null) {
- param++;
- }
- break;
- case "2":
- if (param1 != null) {
- param1 ++;
- }
- break;
- case "3":
- if (param2 != null) {
- param2++;
- }
- break;
- default:
- return null;
- }
- Map<String,Long> map = new HashedMap();
- map.put("1",param);
- map.put("2",param1);
- map.put("3",param2);
- return map;
- }
- @Override
- public String getDocByTm(String fileName, String stTm, String enTm,Map<String,Object> map,String orgId) throws IOException {
- Map<String, Object> dataMap = new HashMap<>();
- String filePath = templatePath + "/" + fileName;
- Date stTmDate = DateUtils.Str2Date(stTm);
- Date enTmDate = DateUtils.Str2Date(enTm);
- String curentTm = DateUtils.Date2Str(new Date(), "yyyy年M月d日");
- dataMap.put("tmTitle", curentTm + "(第XX期)");
- dataMap.put("tm", DateUtils.Date2Str(stTmDate, "M月d日") + "至" + DateUtils.Date2Str(enTmDate, "M月d日"));
- //获取信息的业务逻辑
- dataMap = this.getDataMap(dataMap, stTm, enTm ,map,orgId);
- /*
- 替换模板
- dataMap 要填入模本的数据文件
- 设置模本装置方法和路径,FreeMarker支持多种模板装载方法。可以从servlet,classpath,数据库装载,
- 这里我们的模板是放在template包下面
- */
- // 装载路径
- configuration.setDirectoryForTemplateLoading(new File(templatePath));
- // 通过模板名称获取模板
- Template template = configuration.getTemplate(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 Map<String, Object> getDataMap(Map<String, Object> dataMap, String stTm, String enTm, Map<String,Object> map,String orgId) {
- //1.获取督查办督查组信息
- dataMap = this.getDcInfo(dataMap, stTm, enTm);
- //2.获取版本信息
- dataMap = this.getVesionInfo(dataMap);
- //3.获取流域督查组信息
- dataMap = this.getDcBsInfo(dataMap, stTm, enTm);
- //4.督查工作
- dataMap = this.getDcRegsitInfo(dataMap, stTm, enTm);
- //5.严重问题概述 水利工程和运行显示工程名称,其他显示类别,目前有农村引水安全,小型水库,水毁修复,水闸
- this.getDcBigPblmDesc(dataMap, stTm, enTm);
- //6.水利工程详细描述
- this.getDcBigPblmDetailByKeyReg(dataMap, stTm, enTm);
- //7.农村引水安全
- this.getDcBigPblmDetailByVill(dataMap, stTm, enTm, map,orgId);
- //8.小型水库
- this.getDcBigPblmDetailByRever(dataMap, stTm, enTm, map,orgId);
- //9.水毁修复
- this.getDcBigPblmDetailByTrack(dataMap, stTm, enTm, map,orgId);
- //10.水闸
- this.getDcBigPblmDetailByWaga(dataMap, stTm, enTm, map,orgId);
- return dataMap;
- }
- private void getDcBigPblmDetailByWaga(Map<String, Object> dataMap, String stTm, String enTm, Map<String,Object> map,String orgId) {
- SimpleReportEnum[] wagas = Arrays.stream(SimpleReportEnum.values()).filter(e -> e.toString().contains("WAGA_")).toArray(SimpleReportEnum[]::new);
- String persId = MapUtils.getString(map,"persId");
- String ifCasePblm = MapUtils.getString(map,"ifCasePblm");
- // 获取水闸问题数据
- WagaParam wagaParam = new WagaParam();
- wagaParam.setIfCasePblm(ifCasePblm);
- wagaParam.setPersId(persId);
- wagaParam.setStartTime(stTm);
- wagaParam.setOrgId(orgId);
- wagaParam.setEndTime(enTm);
- List<BisInspPblm> bisInspBaseDtos = bisInspPblmDao.findWagaPlbmList(wagaParam);
- Arrays.stream(wagas).forEach(waga -> {
- dataMap.put(waga.getValue(), this.getSingleTypePblmListByRever(waga,bisInspBaseDtos));
- });
- // 获取督查水闸数据
- TypeParam typeParam = new TypeParam();
- typeParam.setPresId(persId);
- typeParam.setSttm(stTm);
- typeParam.setOrgId(orgId);
- typeParam.setEntm(enTm);
- typeParam.setInIdsSql(SqlUtils.getinIdsSql(persId,olBisInspOrgService.getProvince(orgId)));
- List<BisInspWagaRgstrDto> list = attWagaRgstrDao.findPcWagaPage(typeParam);
- // 水闸开始综述部分
- // 1.多少个单位
- dataMap.put("wagaRiverNameCountSum",list.stream().map(BisInspWagaRgstrDto::getRiverName).distinct().count());
- // 单位名称列表
- dataMap.put("wagaRiverNames",String.join(",",list.stream().map(BisInspWagaRgstrDto::getRiverName).distinct().collect(Collectors.toList())));
- // 2.多少组
- dataMap.put("wagaGroupCountSum",list.stream().map(BisInspWagaRgstrDto::getGroupId).distinct().count());
- // 3.多少人
- dataMap.put("wagaPersonCountSum",bisInspStatDao.getPersonCount(setOrgIds(String.join(",",list.stream().map(BisInspWagaRgstrDto::getGroupId).distinct().collect(Collectors.toList())))));
- // 4.多少个省
- dataMap.put("wagaProvinceCountSum",list.stream().map(x -> Optional.ofNullable(x.getAdFullName()).orElse("").split("-")[0]).distinct().count());
- // 5.检查水闸多少座
- dataMap.put("wagaCountSum",list.size());
- // 6.发现问题多少项
- dataMap.put("wagaPblmCountSum",bisInspBaseDtos.size());
- // 7.截止多少年多少月多少日 今天吗?
- dataMap.put("nowDate",new SimpleDateFormat("yyyy年MM月dd日").format(new Date()));
- // 8.累计检查水闸多少座
- dataMap.put("allWagaCountSum",bisInspStatDao.getWagaCount());
- // 9.发现问题多少项
- dataMap.put("allWagaPblmCountSum",bisInspStatDao.getWagaPblmCount());
- }
- private void getDcBigPblmDetailByTrack(Map<String, Object> dataMap, String stTm, String enTm, Map<String,Object> map,String orgId) {
- SimpleReportEnum[] tracks = Arrays.stream(SimpleReportEnum.values()).filter(e -> e.toString().contains("TRACK_")).toArray(SimpleReportEnum[]::new);
- String persId = MapUtils.getString(map,"persId");
- String ifCasePblm = MapUtils.getString(map,"ifCasePblm");
- // 获取水毁问题数据
- TrackParam trackParam = new TrackParam();
- trackParam.setIfCasePblm(ifCasePblm);
- trackParam.setPersId(persId);
- trackParam.setStartTime(stTm);
- trackParam.setOrgId(orgId);
- trackParam.setEndTime(enTm);
- List<BisInspPblm> bisInspBaseDtos = bisInspPblmDao.findTrackPlbmList(trackParam);
- Arrays.stream(tracks).forEach(track -> {
- dataMap.put(track.getValue(), this.getSingleTypePblmListByRever(track,bisInspBaseDtos));
- });
- // 获取水毁督查数据
- BisInspWtdstDtoListParam typeParam = new BisInspWtdstDtoListParam();
- typeParam.setPersGuid(persId);
- typeParam.setStartDate(stTm);
- typeParam.setOrgId(orgId);
- typeParam.setEndDate(enTm);
- List<BisInspWtdstDetailDto> list = bisInspWtdstDao.findDtoList(typeParam);
- // 水毁开始综述部分
- // 1.多少个单位
- dataMap.put("trackRiverNameCountSum",list.stream().map(BisInspWtdstDetailDto::getChkCom).distinct().count());
- // 单位名称列表
- dataMap.put("trackRiverNames",String.join(",",list.stream().map(BisInspWtdstDetailDto::getChkCom).distinct().collect(Collectors.toList())));
- // 2.多少组
- dataMap.put("trackGroupCountSum",list.stream().map(BisInspWtdstDetailDto::getGroupNm).distinct().count());
- // 3.多少人
- dataMap.put("trackPersonCountSum",bisInspStatDao.getPersonCount(setOrgIds(String.join(",",list.stream().map(BisInspWtdstDetailDto::getGroupId).distinct().collect(Collectors.toList())))));
- // 4.多少个省
- dataMap.put("trackProvinceCountSum",list.stream().map(x -> Optional.ofNullable(x.getLocNm()).orElse("").split("-")[0]).distinct().count());
- // 5.检查水毁多少座
- dataMap.put("trackCountSum",list.size());
- // 6.发现问题多少项
- dataMap.put("trackPblmCountSum",bisInspBaseDtos.size());
- // 7.截止多少年多少月多少日 今天吗?
- dataMap.put("nowDate",new SimpleDateFormat("yyyy年MM月dd日").format(new Date()));
- // 8.累计检查水毁多少座
- dataMap.put("allTrackCountSum",bisInspStatDao.getTrackCount());
- // 9.发现问题多少项
- dataMap.put("allTrackPblmCountSum",bisInspStatDao.getTrackPblmCount());
- }
- private void getDcBigPblmDetailByRever(Map<String, Object> dataMap, String stTm, String enTm, Map<String,Object> map,String orgId) {
- SimpleReportEnum[] revers = Arrays.stream(SimpleReportEnum.values()).filter(e -> e.toString().contains("REVER_")).toArray(SimpleReportEnum[]::new);
- String persId = MapUtils.getString(map,"persId");
- String ifCasePblm = MapUtils.getString(map,"ifCasePblm");
- // 获取水库问题数据
- ReverParam reverParam = new ReverParam();
- reverParam.setIfCasePblm(ifCasePblm);
- reverParam.setPersId(persId);
- reverParam.setOrgId(orgId);
- reverParam.setStartTime(stTm);
- reverParam.setEndTime(enTm);
- List<BisInspPblm> bisInspBaseDtos = bisInspPblmDao.findReverPlbmList(reverParam);
- Arrays.stream(revers).forEach(rever -> {
- dataMap.put(rever.getValue(), this.getSingleTypePblmListByRever(rever,bisInspBaseDtos));
- });
- // 获取水库督查数据
- TypeParam typeParam = new TypeParam();
- typeParam.setPresId(persId);
- typeParam.setSttm(stTm);
- typeParam.setOrgId(orgId);
- typeParam.setEntm(enTm);
- typeParam.setpType("1");
- List<BisInspRsvrRgstrPcDto> list = bisInspRsvrRgstrDao.findPcPage(typeParam);
- // 水库开始综述部分
- // 1.多少个单位
- dataMap.put("reverRiverNameCountSum",list.stream().map(BisInspRsvrRgstrPcDto::getRiverName).distinct().count());
- // 单位名称
- dataMap.put("reverRiverNames", String.join(",",list.stream().map(BisInspRsvrRgstrPcDto::getRiverName).distinct().collect(Collectors.toList())));
- // 2.多少组
- dataMap.put("reverGroupCountSum",list.stream().map(BisInspRsvrRgstrPcDto::getGroupName).distinct().count());
- // 3.多少人
- dataMap.put("reverPersonCountSum",bisInspStatDao.getPersonCount(setOrgIds(String.join(",",list.stream().map(BisInspRsvrRgstrPcDto::getId).distinct().collect(Collectors.toList())))));
- // 4.多少个省
- dataMap.put("reverProvinceCountSum",list.stream().map(x -> Optional.ofNullable(x.getAdFullName()).orElse("").split("-")[0]).distinct().count());
- // 5.检查水库多少座
- dataMap.put("reverCountSum",list.size());
- // 小I型
- dataMap.put("reverOneCountSum",list.stream().filter(x -> "4".equals(x.getEngScal())).count());
- // 小II型
- dataMap.put("reverTwoCountSum",list.stream().filter(x -> "5".equals(x.getEngScal())).count());
- // 6.发现问题多少项
- dataMap.put("reverPblmCountSum",bisInspBaseDtos.size());
- // 7.截止多少年多少月多少日 今天吗? 先取今天,也有可能是传过来的
- dataMap.put("nowDate",new SimpleDateFormat("yyyy年MM月dd日").format(new Date()));
- // 8.累计检查水库多少座
- dataMap.put("allReverCountSum",bisInspStatDao.getReverCount(null));
- // 小I型
- dataMap.put("allReverOneCountSum",bisInspStatDao.getReverCount("4"));
- // 小II型
- dataMap.put("allReverTwoCountSum",bisInspStatDao.getReverCount("5"));
- // 9.发现问题多少项
- dataMap.put("allReverPblmCountSum",bisInspStatDao.getReverPblmCount(null));
- // 小I型
- dataMap.put("allReverPblmOneCountSum",bisInspStatDao.getReverPblmCount("4"));
- // 小II型
- dataMap.put("allReverPblmTwoCountSum",bisInspStatDao.getReverPblmCount("5"));
- }
- private void getDcBigPblmDetailByVill(Map<String, Object> dataMap, String stTm, String enTm, Map<String,Object> map,String orgId) {
- SimpleReportEnum[] vills = Arrays.stream(SimpleReportEnum.values()).filter(e -> e.toString().contains("VILL_")).toArray(SimpleReportEnum[]::new);
- String persId = MapUtils.getString(map,"persId");
- String ifCasePblm = MapUtils.getString(map,"ifCasePblm");
- VillParam villParam = new VillParam();
- villParam.setIfCasePblm(ifCasePblm);
- villParam.setPersId(persId);
- villParam.setStartTime(stTm);
- villParam.setEndTime(enTm);
- villParam.setOrgId(orgId);
- List<BisInspPblm> bisInspBaseDtos = bisInspPblmDao.findVillPlbmList(villParam);
- List<BisInspPblm> list1 = bisInspBaseDtos.stream().filter(x -> "用水户情况".equals(x.getInspPblmName())).collect(Collectors.toList());
- List<BisInspPblm> list2 = bisInspBaseDtos.stream().filter(x -> "农村饮水工程".equals(x.getInspPblmName())).collect(Collectors.toList());
- List<BisInspPblm> list3 = bisInspBaseDtos.stream().filter(x -> "水源地".equals(x.getInspPblmName())).collect(Collectors.toList());
- // 农饮工程特殊处理
- GetVillPageByNodeIdParam p = new GetVillPageByNodeIdParam();
- p.setNodeId("002");
- p.setStartDate(stTm);
- p.setOrgId(orgId);
- p.setEndDate(enTm);
- List<BisInspVlgdrinkProjManageDcdxDto> list = bisInspVlgdrinkProjManageDao.getPageByNodeId(p);
- Arrays.stream(vills).forEach(vill -> {
- if(vill == VILL_SAFETY1 || vill == VILL_SAFETY2 || vill == VILL_SAFETY3 || vill == VILL_SAFETY4 || vill == VILL_SAFETY5){
- dataMap.put(vill.getValue(), this.getSingleTypePblmListByRever(vill, list1));
- }else if(vill == VILL_SAFETY6 ){
- // 一、运行管理
- // 1.是否24小时不间断供水 1.IS_24H_SUPPLY 1是 0否
- // 2.有无取水许可证 1有 0无 isInsLicence
- // 3.有无卫生许可证 1有 0无 isSanLicence
- List<String> cwsCodeList = list.stream().filter(x -> "1".equals(x.getIs24hSupply()) || "1".equals(x.getIsInsLicence()) || "1".equals(x.getIsSanLicence()))
- .map(BisInspVlgdrinkProjManageDcdxDto::getCwsCode).distinct().collect(Collectors.toList());
- List<BisInspPblm> pblmList = list2.stream().filter(x -> cwsCodeList.contains(x.getCwsCode())).distinct().collect(Collectors.toList());
- dataMap.put(vill.getValue(), this.getSingleTypePblmListByVill(vill, pblmList));
- }else if(vill == VILL_SAFETY7){
- // 二、净化消毒
- // 1.是否配备净化设施设备 1是 0否 isHavecleanEqui
- // 2.是否配备消毒设备 1是 0否 isHavedisinfect
- List<String> cwsCodeList = list.stream().filter(x -> "1".equals(x.getIsHavecleanEqui()) || "1".equals(x.getIsHavedisinfect()))
- .map(BisInspVlgdrinkProjManageDcdxDto::getCwsCode).distinct().collect(Collectors.toList());
- List<BisInspPblm> pblmList = list2.stream().filter(x -> cwsCodeList.contains(x.getCwsCode())).distinct().collect(Collectors.toList());
- dataMap.put(vill.getValue(), this.getSingleTypePblmListByVill(vill, pblmList));
- }else if(vill == VILL_SAFETY8){
- // 三、水质检测
- // 1.有无水质检测报告 1是 0否 isHavereport
- // 2.水质检测是否达标 1是 0否 isQuailtyGood
- // 3.水质是否达标 1是 0否 isDailycheckGood
- List<String> cwsCodeList = list.stream().filter(x -> "1".equals(x.getIsHavereport()) || "1".equals(x.getIsQuailtyGood()) || "1".equals(x.getIsDailycheckGood()))
- .map(BisInspVlgdrinkProjManageDcdxDto::getCwsCode).distinct().collect(Collectors.toList());
- List<BisInspPblm> pblmList = list2.stream().filter(x -> cwsCodeList.contains(x.getCwsCode())).distinct().collect(Collectors.toList());
- dataMap.put(vill.getValue(), this.getSingleTypePblmListByVill(vill, pblmList));
- }else if(vill == VILL_SAFETY9){
- // 四、自动化系统
- // 1.是否配备自动化控制系统 1是 0否 isAutosystem
- // 2.是否正常运行 1是 0否 isAutosysGood
- List<String> cwsCodeList = list.stream().filter(x -> "1".equals(x.getIsAutosystem()) || "1".equals(x.getIsAutosysGood()))
- .map(BisInspVlgdrinkProjManageDcdxDto::getCwsCode).distinct().collect(Collectors.toList());
- List<BisInspPblm> pblmList = list2.stream().filter(x -> cwsCodeList.contains(x.getCwsCode())).distinct().collect(Collectors.toList());
- dataMap.put(vill.getValue(), this.getSingleTypePblmListByVill(vill, pblmList));
- }else if(vill == VILL_SAFETY10){
- // 五、管网、蓄水池
- dataMap.put(vill.getValue(), this.getSingleTypePblmListByVill(vill, new ArrayList<>()));
- }else if(vill == VILL_SAFETY11){
- // 六、其他
- // 1.是否配备视频安防系统 1是 0否 isVideoSystem
- // 2.是否正常运行视频安防系统 1是 0否 isVideosysGood
- List<String> cwsCodeList = list.stream().filter(x -> "1".equals(x.getIsVideoSystem()) || "1".equals(x.getIsVideosysGood()))
- .map(BisInspVlgdrinkProjManageDcdxDto::getCwsCode).distinct().collect(Collectors.toList());
- List<BisInspPblm> pblmList = list2.stream().filter(x -> cwsCodeList.contains(x.getCwsCode())).distinct().collect(Collectors.toList());
- dataMap.put(vill.getValue(), this.getSingleTypePblmListByVill(vill, pblmList));
- }
- else if(vill == VILL_SAFETY12 || vill == VILL_SAFETY13 || vill == VILL_SAFETY14 || vill == VILL_SAFETY15 || vill == VILL_SAFETY16){
- dataMap.put(vill.getValue(), this.getSingleTypePblmListByRever(vill, list3));
- }
- });
- // 人饮开始综述部分
- // 1.多少个单位
- dataMap.put("villRiverNameCountSum",list.stream().map(VillDcdxBaseDto::getChkCom).distinct().count());
- // 单位名称
- dataMap.put("villRiverNames", String.join(",",list.stream().map(VillDcdxBaseDto::getChkCom).distinct().collect(Collectors.toList())));
- // 2.多少组
- dataMap.put("villGroupCountSum",list.stream().map(VillDcdxBaseDto::getGroupNm).distinct().count());
- // 3.多少人
- // 4.多少个省
- dataMap.put("villProvinceCountSum",bisInspBaseDtos.stream().map(x -> Optional.ofNullable(x.getAdFullName()).orElse("").split("-")[0]).distinct().count());
- // 5.检查人饮多少座
- dataMap.put("villCountSum",list.size());
- // 6.发现问题多少项
- dataMap.put("villPblmCountSum",bisInspBaseDtos.size());
- // 7.截止多少年多少月多少日 今天吗? 先取今天,也有可能是传过来的
- dataMap.put("nowDate",new SimpleDateFormat("yyyy年MM月dd日").format(new Date()));
- // 8.累计检查人饮多少座
- // dataMap.put("allVillCountSum",bisInspStatDao.getVillCount(null));
- // 9.发现问题多少项
- // dataMap.put("allVillPblmCountSum",bisInspStatDao.getVillPblmCount(null));
- }
- private LinkedList<HashMap<String, Object>> getSingleTypePblmListByRever(SimpleReportEnum e, List<BisInspPblm> list) {
- // 返回单个问题类型的数据结构
- return new LinkedList<HashMap<String, Object>>() {{
- List<BisInspPblm> itemList = list.stream().filter(x -> e.getTitle().equals(x.getInspPblmsName()) || e.getTitle().equals(x.getInspPblmName())).distinct().collect(Collectors.toList());
- for(int i = 0;i<itemList.size();i++){
- BisInspPblm bisInspPblm = Optional.ofNullable(itemList.get(i)).orElse(new BisInspPblm());
- HashMap<String, Object> itemMap = new HashMap<>(2);
- itemMap.put("content", "(" + (i+1) + ")"
- + Optional.ofNullable(bisInspPblm.getAdFullName()).orElse("").replace("-","") + bisInspPblm.getNm() + ","
- + bisInspPblm.getInspPblmDesc());
- // 获取图片列表
- List<GwComFile> gwFiles = gwComFileService.findFileByBiz(bisInspPblm.getPblmId());
- setImgContent(itemMap,gwFiles);
- add(itemMap);
- }
- }};
- }
- private LinkedList<HashMap<String, Object>> getSingleTypePblmListByVill(SimpleReportEnum e, List<BisInspPblm> itemList) {
- // 返回单个问题类型的数据结构
- return new LinkedList<HashMap<String, Object>>() {{
- for(int i = 0;i<itemList.size();i++){
- BisInspPblm bisInspPblm = itemList.get(i);
- HashMap<String, Object> itemMap = new HashMap<>(2);
- itemMap.put("content", "(" + (i+1) + ")"
- + Optional.ofNullable(bisInspPblm.getAdFullName()).orElse("").replace("-","") + bisInspPblm.getNm() + ","
- + bisInspPblm.getInspPblmDesc());
- // 获取图片列表
- List<GwComFile> gwFiles = gwComFileService.findFileByBiz(bisInspPblm.getPblmId());
- setImgContent(itemMap,gwFiles);
- add(itemMap);
- }
- }};
- }
- private void setImgContent(HashMap<String, Object> itemMap,List<GwComFile> gwFiles){
- itemMap.put("imgs", new LinkedList<HashMap<String, String>>() {{
- Optional.ofNullable(gwFiles).orElse(new ArrayList<GwComFile>() {{
- add(new GwComFile());
- }}).forEach(y -> add(new HashMap<String, String>(2) {{
- logger.debug("图片路径:" + imgPathPrefix.replace("/upload", "") + y.getFilePath() + ".jpg");
- put("href", getImageString(imgPathPrefix.replace("/upload", "") + y.getFilePath() + ".jpg"));
- put("desc", y.getAbs() == null ? "图片描述" : y.getAbs());
- put("name", y.getFilePath());
- put("src", y.getFilePath());
- }}));
- }});
- }
- /**
- * 获取水利工程建设和运行数据
- *
- * @param dataMap 最终数据集
- * @param stTm 开始时间
- * @param enTm 结束时间
- */
- private void getDcBigPblmDetailByKeyReg(Map<String, Object> dataMap, String stTm, String enTm) {
- // 全部的问题个数 数据来源
- List<KeyRegPblm> pblmList = bisInspStatDao.getBigPblmEmpwtNm(stTm, enTm);
- // 包含的工程名称
- List<String> bigPblmEmpwtNmList = pblmList.stream().map(BisInspPblm::getNm).distinct().collect(Collectors.toList());
- List<HashMap<String, Object>> listData = new LinkedList<>();
- // 对这些工程进行逐个详细介绍
- for (String title : bigPblmEmpwtNmList) {
- HashMap<String, Object> map = new HashMap<>();
- // 工程名称
- map.put(TITLE.getValue(), title);
- // 单个工程问题列表
- List<KeyRegPblm> pblmSingle = pblmList.stream().filter(x -> x.getNm().equals(title)).collect(Collectors.toList());
- // 标段名称列表
- List<String> secNameList = pblmSingle.stream().map(KeyRegPblm::getSecName).distinct().filter(StringUtils::isNotBlank).collect(Collectors.toList());
- map.put("secCounts", secNameList.size());
- map.put("secNames", String.join(",", secNameList));
- // 共发现问题多少项
- map.put("pblmSum", pblmSingle.size());
- // 施工单位多少项
- map.put("pblmConsUnitSum", pblmSingle.stream().filter(x -> ILLEGAL_BEHAVIOR4.getValue().equals(x.getReviOrg())).collect(Collectors.toList()).size());
- // 设计单位多少项
- map.put("pblmDesiUnitSum", pblmSingle.stream().filter(x -> ILLEGAL_BEHAVIOR2.getValue().equals(x.getReviOrg())).collect(Collectors.toList()).size());
- SimpleReportEnum[] illegals = SimpleReportEnum.values();
- for (SimpleReportEnum illegal : illegals) {
- if (illegal == ILLEGAL_BEHAVIOR1 || illegal == ILLEGAL_BEHAVIOR2 || illegal == ILLEGAL_BEHAVIOR3 || illegal == ILLEGAL_BEHAVIOR4
- || illegal == ILLEGAL_BEHAVIOR5 || illegal == ILLEGAL_BEHAVIOR6 || illegal == ILLEGAL_BEHAVIOR7 || illegal == MASS_DEFECT) {
- // 单个工程开始循环添加各类工程问题
- map.put(illegal.getValue(), new LinkedList<HashMap<String, Object>>() {{
- List<KeyRegPblm> itemList = pblmSingle.stream().filter(x -> illegal.getTitle().equals(
- illegal == MASS_DEFECT ? x.getInspPblmName() : x.getReviOrg()
- )).collect(Collectors.toList());
- for (int i = 0; i < itemList.size(); i++) {
- HashMap<String, Object> itemMap = new HashMap<>(2);
- itemMap.put("content", "(" + (i + 1) + ")" + itemList.get(i).getSecName() + itemList.get(i).getInspPblmDesc());
- // 获取图片列表
- List<GwComFile> gwFiles = gwComFileService.findFileByBiz(itemList.get(i).getPblmId());
- itemMap.put("imgs", new LinkedList<HashMap<String, String>>() {{
- Optional.ofNullable(gwFiles).orElse(new ArrayList<GwComFile>() {{
- add(new GwComFile());
- }}).forEach(y -> {
- add(new HashMap<String, String>(2) {{
- String href = imgPathPrefix.replace("/upload", "") + y.getFilePath() + ".jpg";
- logger.debug("图片路径:" + href);
- put("href", getImageString(href));
- put("desc", y.getAbs() == null ? "图片描述" + y.getFilePath() : y.getAbs());
- put("name", y.getFilePath());
- put("src", y.getFilePath());
- }});
- });
- }});
- add(itemMap);
- }
- }});
- }
- }
- listData.add(map);
- }
- dataMap.put("bigPblmEmpwtNmListDetail", listData);
- }
- private Map<String, Object> getDcBigPblmDesc(Map<String, Object> dataMap, String stTm, String enTm) {
- try {
- // 1.指定时间内存在典型问题的水利工程建设名称
- List<String> bigPblmEmpwtNmList = bisInspStatDao.getBigPblmEmpwtNm(stTm, enTm).stream().map(x -> x.getNm() + ":## ").distinct().collect(Collectors.toList());
- dataMap.put("bigPblmEmpwtNmList", bigPblmEmpwtNmList);
- // 2.指定时间内存在典型问题的水利工程运行名称
- // TODO:暂时跳过
- // 3.指定时间内存在典型问题的水库的名称
- // 4.其他类型的,暂时写死
- } catch (Exception e) {
- e.printStackTrace();
- }
- return dataMap;
- }
- public String getMapString(Map<String, Object> map) {
- String text = "";
- for (String key : map.keySet()) {
- text += map.get(key) + ",";
- }
- if (text.length() > 0) {
- text = text.substring(0, text.length() - 1);
- }
- return text;
- }
- /**
- * 督查办-获取督查办督查组和人员信息
- *
- * @param dataMap Map<String, Object>
- * @param stTm 开始时间
- * @param enTm 结束时间
- * @return dataMap
- */
- public Map<String, Object> getDcInfo(Map<String, Object> dataMap, String stTm, String enTm) {
- List<BisInspStatGroupInfoDto> bisInspStatGroupInfoDtoList = bisInspStatDao.getDcGroupInfo(stTm, enTm);
- int dcGroupSize = 0;
- int dcGroupPersonSize = 0;
- Map<String, Object> dcTypeMap = new HashMap<>();
- for (BisInspStatGroupInfoDto bisInspStatGroupInfoDto : bisInspStatGroupInfoDtoList) {
- if (bisInspStatGroupInfoDto.getId().length() == 12) {
- dcGroupSize++;
- int curentPerCon = bisInspStatGroupInfoDto.getPersCoun() == null ? 0 : Integer.parseInt(bisInspStatGroupInfoDto.getPersCoun());
- dcGroupPersonSize = dcGroupPersonSize + curentPerCon;
- String dcType = bisInspStatGroupInfoDto.getId().substring(0, 3);
- for (BisInspEnum enums : BisInspEnum.values()) {
- if (dcType.equals(enums.getRlation())) {
- dcTypeMap.put(dcType, enums.getDesc());
- }
- }
- }
- }
- //督查组总数
- dataMap.put("dcGroup", dcGroupSize);
- //督查组人员总数
- dataMap.put("dcGropuPerson", dcGroupPersonSize);
- //开始时间到结束时间共督查多少种类型
- dataMap.put("dcTypeList", this.getMapString(dcTypeMap));
- return dataMap;
- }
- /**
- * 督查办-获取APP版本信息
- *
- * @param dataMap Map<String, Object>
- * @return dataMap
- */
- public Map<String, Object> getVesionInfo(Map<String, Object> dataMap) {
- Version version = versionDao.getLatestVersion();
- //最新版本号
- dataMap.put("newAppVersion", version.getAppName());
- //共更新多少次
- dataMap.put("appVersionCount", version.getCon());
- //最后更新内容
- dataMap.put("updateCon", version.getUpdateContent());
- return dataMap;
- }
- /**
- * 流域机构-获取流域督查组和人员信息
- *
- * @param dataMap Map<String, Object>
- * @param stTm 开始时间
- * @param enTm 结束时间
- * @return dataMap
- */
- public Map<String, Object> getDcBsInfo(Map<String, Object> dataMap, String stTm, String enTm) {
- List<BisInspStatGroupInfoDto> bisInspStatGroupInfoDtoList = bisInspStatDao.getBsGroupInfo(stTm, enTm);
- int dcGroupSize = 0;
- int dcGroupPersonSize = 0;
- int dcBsSize = 0;
- Map<String, Object> dcBsMap = new HashMap<>();
- Map<String, Object> dcTypeMap = new HashMap<>();
- Map<String, Object> dcBsNot = new HashMap<>();
- for (BisInspStatGroupInfoDto bisInspStatGroupInfoDto : bisInspStatGroupInfoDtoList) {
- if (bisInspStatGroupInfoDto.getId().length() == 12) {
- dcGroupSize++;
- int curentPerCon = bisInspStatGroupInfoDto.getPersCoun() == null ? 0 : Integer.parseInt(bisInspStatGroupInfoDto.getPersCoun());
- dcGroupPersonSize = dcGroupPersonSize + curentPerCon;
- String dcType = bisInspStatGroupInfoDto.getId().substring(0, 3);
- dcBsMap.put(bisInspStatGroupInfoDto.getDepId(), bisInspStatGroupInfoDto.getDepNm());
- for (BisInspEnum enums : BisInspEnum.values()) {
- if (dcType.equals(enums.getRlation())) {
- dcTypeMap.put(dcType, enums.getDesc());
- }
- }
- }
- }
- //找出不在结果集里
- for (BisInspBsEnum enums : BisInspBsEnum.values()) {
- if (null == dcBsMap.get(enums.getKey())) {
- dcBsNot.put(enums.getKey(), enums.getDesc());
- }
- }
- //流域机构个数
- dataMap.put("dcBsSize", dcBsMap.keySet().size());
- //流域机构个数
- dataMap.put("dcBsGroup", dcGroupSize);
- //督查组人员总数
- dataMap.put("dcBsGropuPerson", dcGroupPersonSize);
- //开始时间到结束时间共督查多少种类型
- dataMap.put("dcBsTypeList", getMapString(dcTypeMap));
- //开始时间到结束时间共督查多少种类型
- dataMap.put("dcBsNot", getMapString(dcBsNot));
- return dataMap;
- }
- /**
- * 督查工作-获取督查组反馈情况信息
- *
- * @param dataMap Map<String, Object>
- * @return dataMap
- */
- public Map<String, Object> getDcRegsitInfo(Map<String, Object> dataMap, String stTm, String enTm) {
- List<BisInspStatGroupInfoDto> bisInspStatGroupInfoDtoList = bisInspStatDao.getDcRegsitInfo(stTm, enTm);
- // TODO: 待实现
- return dataMap;
- }
- }
|