dffd43ce4278e3e7d76b7ad0fbcb71e1c43eed44.svn-base 37 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786
  1. package cn.com.goldenwater.dcproj.utils.export;
  2. import cn.com.goldenwater.dcproj.dao.AttAdBaseDao;
  3. import cn.com.goldenwater.dcproj.dao.AttAdXBaseDao;
  4. import cn.com.goldenwater.dcproj.dao.AttCwsBaseDao;
  5. import cn.com.goldenwater.dcproj.dto.BisInspRsvrRgstrPcDto;
  6. import cn.com.goldenwater.dcproj.dto.BisInspRsvrRgstrPcDtoVo;
  7. import cn.com.goldenwater.dcproj.dto.BisInspWtdstDetailDto;
  8. import cn.com.goldenwater.dcproj.model.*;
  9. import cn.com.goldenwater.dcproj.param.AttAdXBaseParam;
  10. import org.springframework.beans.factory.annotation.Autowired;
  11. import org.springframework.stereotype.Component;
  12. import java.lang.reflect.InvocationTargetException;
  13. import java.lang.reflect.Method;
  14. import java.util.*;
  15. import static cn.com.goldenwater.dcproj.utils.export.ExcelSkFieldLists.*;
  16. import static cn.com.goldenwater.dcproj.utils.export.FieldFormat.*;
  17. import static cn.com.goldenwater.dcproj.utils.export.FieldFormatDispatch.getFormatValue;
  18. import static cn.com.goldenwater.dcproj.utils.export.FieldFormatSkExp.*;
  19. /**
  20. * @ClassName ExcelFieldUtil
  21. * @Description 配置Excel数据字段
  22. * @Author liyz
  23. * @Date 2019/3/13 9:58
  24. * @Version 1.0
  25. **/
  26. @Component
  27. public class ExcelFieldUtil {
  28. @Autowired
  29. private AttAdBaseDao attAdBaseDao;
  30. @Autowired
  31. private AttAdXBaseDao attAdXBaseDao;
  32. @Autowired
  33. private AttCwsBaseDao attCwsBaseDao;
  34. /**
  35. * 1.暗访调研行政村统计表
  36. *
  37. * @param list list
  38. * @return 数据集合
  39. */
  40. List<Map<String, Object>> getBisInspSecsurveyVlgDataList(List<BisInspSecsurveyVlg> list) {
  41. List<Map<String, Object>> dataList = new ArrayList<>();
  42. for (BisInspSecsurveyVlg bis : list) {
  43. Map<String, Object> map = new LinkedHashMap<>();
  44. AttAdXBaseParam attAdXBaseParam = new AttAdXBaseParam();
  45. if (bis.getVillageCode() != null && !"".equals(bis.getVillageCode())) {
  46. attAdXBaseParam.setAdCode(bis.getVillageCode());
  47. AttAdXBase attAdXBase = attAdXBaseDao.getBy(attAdXBaseParam);
  48. if (attAdXBase != null) {
  49. map.put("adNm", formatCheckNull(attAdXBase.getAdFullName()));
  50. } else {
  51. map.put("adNm", formatCheckNull(bis.getAdNm()));
  52. }
  53. } else {
  54. map.put("adNm", formatCheckNull(bis.getAdNm()));
  55. }
  56. map.put("isPoverty", formatRadio(bis.getIsPoverty()));
  57. map.put("isFluexc", formatRadio(bis.getIsFluexc()));
  58. map.put("isMtarea", formatRadio(bis.getIsMtarea()));
  59. map.put("isCenwtSupply", formatRadio(bis.getIsCenwtSupply()));
  60. map.put("watersupplyPer", formatRate(bis.getWatersupplyPer()));
  61. map.put("visitDate", bis.getVisitDate());
  62. dataList.add(map);
  63. }
  64. return dataList;
  65. }
  66. /**
  67. * 2.村内农村饮水工程设施运行维护情况表
  68. *
  69. * @param list list
  70. * @return 数据集合
  71. */
  72. List<Map<String, Object>> getBisInspVlgdrinkFacOperDataList(List<BisInspVlgdrinkFacOper> list) {
  73. List<Map<String, Object>> dataList = new ArrayList<>();
  74. for (BisInspVlgdrinkFacOper bis : list) {
  75. Map<String, Object> map = new LinkedHashMap<>();
  76. AttAdXBaseParam attAdXBaseParam = new AttAdXBaseParam();
  77. attAdXBaseParam.setAdCode(bis.getAdCode());
  78. AttAdXBase attAdXBase = attAdXBaseDao.getBy(attAdXBaseParam);
  79. if (attAdXBase != null) {
  80. // 行政村名(*县*乡镇*村)
  81. map.put("adnm", formatCheckNull(attAdXBase.getAdFullName()));
  82. } else {
  83. map.put("adnm", formatCheckNull(bis.getAdnm()));
  84. }
  85. // 是否需要设置管水员
  86. map.put("isNdAdmin", formatIsAdmin(bis.getIsNdAdmin()));
  87. // 是否设置管水员
  88. map.put("isAdmin", formatIsAdmin(bis.getIsAdmin()));
  89. // 管水员姓名
  90. map.put("adminNm", formatCheckNull(bis.getAdminNm()));
  91. // 管水员年龄
  92. map.put("adminAge", formatCheckNull(bis.getAdminAge()));
  93. // 管水员性质
  94. map.put("adminPro", formateAdminPro(bis.getAdminPro()));
  95. // 管水员工资(元/年)
  96. map.put("salary", bis.getSalary());
  97. // 运行维护费用(元/年)
  98. map.put("operFee", bis.getOperFee());
  99. // 除水费收入外的运行维护费用来源
  100. map.put("otherFeeOrg", formateOtherFeeOrg(bis.getOtherFeeOrg()));
  101. // 费用说明
  102. map.put("feeCommons", bis.getFeeCommons());
  103. // 暗访日期
  104. map.put("visitDate", bis.getVisitDate());
  105. dataList.add(map);
  106. }
  107. return dataList;
  108. }
  109. /**
  110. * 3.用水户情况表
  111. *
  112. * @param list list
  113. * @return 数据集合
  114. */
  115. public List<Map<String, Object>> getBisInspWateruserInfoDataList(List<BisInspWateruserInfo> list) {
  116. List<Map<String, Object>> dataList = new ArrayList<>();
  117. for (BisInspWateruserInfo bis : list) {
  118. Map<String, Object> map = new LinkedHashMap<>();
  119. // 调查地点(*县*乡镇*村)
  120. map.put("villageNm", formatCheckNull(bis.getVillageNm()));
  121. // 户主姓名
  122. map.put("userNm", formatCheckNull(bis.getUserNm()));
  123. // 电话
  124. map.put("telphone", formatCheckNull(bis.getTelphone()));
  125. // 对应工程名称
  126. map.put("cwsName", formatCheckNull(bis.getCwsName()));
  127. // -------------------------------------------------------------------
  128. // 水质
  129. // -------------------------------------------------------------------
  130. // 水质是否良好
  131. map.put("isQualityGood", formatRadio(bis.getIsQualityGood()));
  132. // 是否存在问题
  133. map.put("isQualityProblem", formatRadio(bis.getIsQualityProblem()));
  134. // 水量
  135. // 是否供水入户
  136. map.put("isSplyHome", formatRadio(bis.getIsSplyHome()));
  137. // 是否24小时供水
  138. map.put("is24hSupply", formatRadio(bis.getIs24hSupply()));
  139. // 是否存在问题
  140. map.put("isWaterProblem", formatRadio(bis.getWaterProblem()));
  141. // 水价收费
  142. // 是否计量收费
  143. map.put("isCalFee", formatRadio(bis.getIsCalFee()));
  144. // 是否存在问题
  145. map.put("isFeeProblem", formatRadio(bis.getFeeProblem()));
  146. // 供水服务
  147. // 是否存在问题
  148. map.put("isSplyProblem", formatRadio(bis.getIsSplyProblem()));
  149. // 总体评价
  150. map.put("evaluate", formatEvaluate(bis.getEvaluate()));
  151. // 暗访日期
  152. map.put("visitDate", formatCheckNull(bis.getVisitDate()));
  153. dataList.add(map);
  154. }
  155. return dataList;
  156. }
  157. /**
  158. * 4.农村饮水工程运行管理情况表
  159. *
  160. * @param list list
  161. * @return 数据集合
  162. */
  163. public List<Map<String, Object>> getBisInspVlgdrinkProjManageDataList(List<BisInspVlgdrinkProjManage> list) {
  164. List<Map<String, Object>> dataList = new ArrayList<>();
  165. for (BisInspVlgdrinkProjManage bis : list) {
  166. Map<String, Object> map = new LinkedHashMap<>();
  167. // 省 市 县
  168. String province = "";
  169. String city = "";
  170. String county = "";
  171. String code = null;
  172. try {
  173. String cwsCode = bis.getCwsCode();
  174. AttCwsBase attCwsBase = attCwsBaseDao.get(cwsCode);
  175. if (attCwsBase != null) {
  176. code = attCwsBase.getAddvcd();
  177. }
  178. } catch (Exception e) {
  179. System.out.println("编码不正常呀");
  180. }
  181. if (code != null) {
  182. province = attAdBaseDao.fingAdUp(code.substring(0, 2) + "0000000000").getAdName();
  183. city = attAdBaseDao.fingAdUp(code.substring(0, 4) + "00000000").getAdName();
  184. county = attAdBaseDao.fingAdUp(code.substring(0, 6) + "000000").getAdName();
  185. }
  186. map.put("province", formatCheckNull(province));
  187. map.put("city", formatCheckNull(city));
  188. map.put("county", formatCheckNull(county));
  189. // 工程名称
  190. map.put("pjnm", formatCheckNull(bis.getPjnm()));
  191. // 所在地
  192. map.put("villageNm", formatCheckNull(bis.getVillageNm()));
  193. // 建成年份
  194. map.put("buildYear", formatCheckNull(bis.getBuildYear()));
  195. // 设计供水规模(m³/d)
  196. map.put("planSupplyScale", formatCheckNull(bis.getPlanSupplyScale()));
  197. // 实际供水规模(m³/d)
  198. map.put("supplyScale", formatCheckNull(bis.getSupplyScale()));
  199. // 覆盖人口(万人)
  200. map.put("personNum", formatCheckNull(bis.getPersonNum()));
  201. // 管网漏损率(%)
  202. map.put("pipeDamagePer", formatRate(bis.getPipeDamagePer()));
  203. // 工程类别
  204. map.put("projectType", formatProjectType(bis.getProjectType()));
  205. // 是否24小时不间断供水
  206. map.put("is24hSupply", formatBoo(bis.getIs24hSupply()));
  207. // 水质保障
  208. // 净化设施设备
  209. // 是否配备
  210. map.put("isHavecleanEqui", formatBoo(bis.getIsHavecleanEqui()));
  211. // 是否正常运行
  212. map.put("isCleanequiG", formatBoo(bis.getIsCleanequiG()));
  213. // 消毒设备
  214. // 是否配备
  215. map.put("isHavedisinfect", formatBoo(bis.getIsHavedisinfect()));
  216. // 消毒方式
  217. map.put("disinfectType", formatDisinfectType(bis.getDisinfectType()));
  218. // 是否正常运行
  219. map.put("isDisinfectGood", formatBoo(bis.getIsDisinfectGood()));
  220. // 水质检测报告
  221. // 有无报告
  222. map.put("isHavereport", formatExistRadio(bis.getIsHavereport()));
  223. // 是否达标
  224. map.put("isQuailtyGood", formatBoo(bis.getIsQuailtyGood()));
  225. // 千吨万人水厂水质化验室
  226. // 是否配备
  227. map.put("isHaveLab", formatBoo(bis.getIsHaveLab()));
  228. // 是否开展日检
  229. map.put("isDailyCheck", formatBoo(bis.getIsDailyCheck()));
  230. // 水质是否达标
  231. map.put("isDailycheckGood", formatBoo(bis.getIsDailycheckGood()));
  232. // 运行管理
  233. // 有无取水许可证
  234. map.put("isInsLicence", formatExistRadio(bis.getIsInsLicence()));
  235. // 有无卫生许可证
  236. map.put("isSanLicence", formatExistRadio(bis.getIsSanLicence()));
  237. // 自动化控制系统
  238. // 是否配备
  239. map.put("isAutosystem", formatBoo(bis.getIsAutosystem()));
  240. // 是否正常运行
  241. map.put("isAutosysGood", formatBoo(bis.getIsAutosysGood()));
  242. // 视频安防系统
  243. // 是否配备
  244. map.put("isVideoSystem", formatBoo(bis.getIsVideoSystem()));
  245. // 是否正常运行
  246. map.put("isVideosysGood", formatBoo(bis.getIsVideosysGood()));
  247. // 水费水价
  248. // 执行水价(元/ m³)
  249. map.put("waterFee", formatCheckNull(bis.getWaterFee()));
  250. // 全成本(元/ m³)
  251. map.put("waterCost", formatCheckNull(bis.getWaterCost()));
  252. // 运行成本(元/ m³)
  253. map.put("operCost", formatCheckNull(bis.getOperCost()));
  254. // 水费回收率(%)
  255. map.put("feeRecyclePer", formatRate(bis.getFeeRecyclePer()));
  256. // 管理主体
  257. map.put("manager", formatManager(bis.getManager()));
  258. // 是否配备供水服务热线电话
  259. map.put("isHaveHotline", formatBoo(bis.getIsHaveHotline()));
  260. // 填报状态
  261. map.put("status", formatStatus(bis.getStatus()));
  262. // 暗访日期
  263. map.put("visitDate", formatCheckNull(bis.getVisitDate()));
  264. // 记录人员
  265. map.put("recPers2", formatCheckNull(bis.getRecPers2()));
  266. // 记录人员电话
  267. map.put("recPersTel", formatCheckNull(bis.getRecPersTel()));
  268. dataList.add(map);
  269. }
  270. return dataList;
  271. }
  272. /**
  273. * 5.千人以上供水工程水源地保护情况表
  274. *
  275. * @param list list
  276. * @return 数据集合
  277. */
  278. public List<Map<String, Object>> getBisInspProSourceProtectDataList(List<BisInspProSourceProtect> list) {
  279. List<Map<String, Object>> dataList = new ArrayList<>();
  280. for (BisInspProSourceProtect bis : list) {
  281. Map<String, Object> map = new LinkedHashMap<>();
  282. map.put("waterSourceNm", bis.getWaterSourceNm());
  283. AttAdXBaseParam attAdXBaseParam = new AttAdXBaseParam();
  284. if (bis.getAdCode() != null && !"".equals(bis.getAdCode())) {
  285. attAdXBaseParam.setAdCode(bis.getAdCode());
  286. AttAdXBase attAdXBase = attAdXBaseDao.getBy(attAdXBaseParam);
  287. if (attAdXBase != null) {
  288. map.put("villageNm", formatCheckNull(attAdXBase.getAdFullName()));
  289. } else {
  290. map.put("villageNm", formatCheckNull(bis.getVillageNm()));
  291. }
  292. } else {
  293. map.put("villageNm", formatCheckNull(bis.getVillageNm()));
  294. }
  295. map.put("cwsCode", bis.getCwsCode());
  296. map.put("planInsAmount", bis.getPlanInsAmount());
  297. map.put("sourceType", formatSourceType(bis.getSourceType()));
  298. map.put("waterQuality", formatWaterQuality(bis.getWaterQuality()));
  299. map.put("isProtectArea", formatRadio(bis.getIsProtectArea()));
  300. map.put("isProtectMark", formatRadio(bis.getIsProtectMark()));
  301. map.put("isPollSource", formatRadio(bis.getIsPollSource()));
  302. map.put("isSpare", formatRadio(bis.getIsSpare()));
  303. map.put("visitDate", bis.getVisitDate());
  304. dataList.add(map);
  305. }
  306. return dataList;
  307. }
  308. /**
  309. * 6.管理责任体系落实情况表
  310. *
  311. * @param list 原始数据
  312. * @return 封装好的数据
  313. */
  314. public List<Map<String, Object>> getBisInspManageResponsibilityDataList(List<BisInspManageResponsibility> list) {
  315. List<Map<String, Object>> dataList = new ArrayList<>();
  316. for (BisInspManageResponsibility bis : list) {
  317. Map<String, Object> map = new LinkedHashMap<>();
  318. // 省 市 县
  319. String province = "";
  320. String city = "";
  321. String county = "";
  322. String code = bis.getAdCode();
  323. if (code != null) {
  324. province = attAdBaseDao.fingAdUp(code.substring(0, 2) + "0000000000").getAdName();
  325. city = attAdBaseDao.fingAdUp(code.substring(0, 4) + "00000000").getAdName();
  326. county = attAdBaseDao.fingAdUp(code.substring(0, 6) + "000000").getAdName();
  327. }
  328. map.put("province", formatCheckNull(province));
  329. map.put("city", formatCheckNull(city));
  330. map.put("county", formatCheckNull(county));
  331. // 农村人口(万人)
  332. map.put("personAmount", formatCheckNull(bis.getPersonAmount()));
  333. // 集中供水率(%)
  334. map.put("focusSupplyPerc", formatRate(bis.getFocusSupplyPerc()));
  335. // 自来水普及率(%)
  336. map.put("waterSupplyPerc", formatRate(bis.getWaterSupplyPerc()));
  337. // 三个责任
  338. // 地方人民政府主体责任是否明确
  339. map.put("isGovRes", formatBoo(bis.getIsGovRes()));
  340. // 水利部门行业监管责任是否明确
  341. map.put("isConRes", formatBoo(bis.getIsConRes()));
  342. // 供水单位运行管理责任是否到位
  343. map.put("isDeptRes", formatBoo(bis.getIsDeptRes()));
  344. // 三项制度
  345. // 是否建立县级运行管理机构
  346. map.put("isCntyDept", formatBoo(bis.getIsCntyDept()));
  347. // 是否建立县级运行管理办法
  348. map.put("isCntyFunc", formatBoo(bis.getIsCntyFunc()));
  349. // 是否落实县级运行管理经费
  350. map.put("isCntyFee", formatBoo(bis.getIsCntyFee()));
  351. // 县级水质检测中心
  352. // 是否正常开展水质巡检
  353. map.put("isQuailtyChk", formatBoo(bis.getIsQuailtyChk()));
  354. // 2018年落实运行经费(万元)
  355. map.put("pracFee", formatCheckNull(bis.getPracFee()));
  356. // 暗访日期
  357. map.put("visitDate", formatCheckNull(bis.getVisitDate()));
  358. // 县级水行政主管部门参加人员
  359. map.put("accompany", formatCheckNull(bis.getAccompany()));
  360. // 暗访组(人)
  361. map.put("visitorIds", formatCheckNull(bis.getVisitorId()));
  362. // 记录人员
  363. map.put("recPers2", formatCheckNull(bis.getRecPers2()));
  364. // 记录人员电话
  365. map.put("recPersTel", formatCheckNull(bis.getRecPersTel()));
  366. // 填报状态
  367. map.put("status", formatBaseStat(bis.getStatus()));
  368. dataList.add(map);
  369. }
  370. return dataList;
  371. }
  372. /**
  373. * 7.水毁修复项目暗访情况表
  374. *
  375. * @param list list
  376. * @return 数据集合
  377. */
  378. public List<Map<String, Object>> getBisInspWtdstDtoDataList(List<BisInspWtdstDetailDto> list) {
  379. List<Map<String, Object>> dataList = new ArrayList<>();
  380. for (BisInspWtdstDetailDto bis : list) {
  381. Map<String, Object> map = new LinkedHashMap<>();
  382. String province = "";
  383. String city = "";
  384. String county = "";
  385. String code = bis.getLocAd();
  386. if (code != null) {
  387. province = attAdBaseDao.fingAdUp(code.substring(0, 2) + "0000000000").getAdName();
  388. city = attAdBaseDao.fingAdUp(code.substring(0, 4) + "00000000").getAdName();
  389. county = attAdBaseDao.fingAdUp(code.substring(0, 6) + "000000").getAdName();
  390. }
  391. map.put("province", formatCheckNull(province));
  392. map.put("city", formatCheckNull(city));
  393. map.put("county", formatCheckNull(county));
  394. map.put("wtdstNm", bis.getWtdstNm());
  395. map.put("locNm", bis.getLocNm());
  396. map.put("wtdstType", bis.getWtdstType());
  397. map.put("mangNm", bis.getMangNm());
  398. map.put("loac", bis.getLoac());
  399. map.put("disContent", bis.getDisContent());
  400. map.put("wkstate", formatWkstate(bis.getWkstate()));
  401. map.put("planTm", bis.getPlanTm());
  402. map.put("problmNum", bis.getProblmNum());
  403. map.put("adNm", bis.getAdNm());
  404. map.put("note", bis.getNote());
  405. dataList.add(map);
  406. }
  407. return dataList;
  408. }
  409. /**
  410. * 8.小水库督查情况
  411. *
  412. * @param list list
  413. * @return 数据集合
  414. */
  415. public List<Map<String, Object>> getBisInspRsvrRgstrPcDtoDataList(List<BisInspRsvrRgstrPcDtoVo> list) {
  416. List<Map<String, Object>> dataList = new LinkedList<>();
  417. for (BisInspRsvrRgstrPcDtoVo bis : list) {
  418. Map<String, Object> map = new LinkedHashMap<>();
  419. BisInspRsvrRgstrPcDto bisInspRsvrRgstrPcDto = bis.getBisInspRsvrRgstrPcDto();
  420. map.put("nm", formatCheckNull(bisInspRsvrRgstrPcDto.getNm()));
  421. map.put("rsCode", formatCheckNull(bisInspRsvrRgstrPcDto.getCode()));
  422. // 组长名称
  423. map.put("groupLeader", formatCheckNull(bisInspRsvrRgstrPcDto.getGroupLeader()));
  424. // 组长电话
  425. map.put("groupLeaderTel", formatCheckNull(bisInspRsvrRgstrPcDto.getGroupLeader()));
  426. // 联络员电话
  427. map.put("liaisonManTel", formatCheckNull(bisInspRsvrRgstrPcDto.getLiaisonManTel()));
  428. // 联络员
  429. map.put("liaisonMan", formatCheckNull(bisInspRsvrRgstrPcDto.getLiaisonMan()));
  430. AttRsBaseCrrct attRsBaseCrrct = bis.getAttRsBaseCrrct();
  431. if (attRsBaseCrrct != null) {
  432. // 1 加入基础信息
  433. // 水库位置
  434. map.put("rsLoc", attRsBaseCrrct.getRsLoc() == null ? "" : attRsBaseCrrct.getRsLoc());
  435. // 建成时间
  436. map.put("compDate", formatCompDate(attRsBaseCrrct.getCompDate()));
  437. // 工程规模
  438. map.put("engScal1", formatEngScal(attRsBaseCrrct.getEngScal()));
  439. // 总库容(万m³)
  440. map.put("totCap", attRsBaseCrrct.getTotCap() == null ? "" : attRsBaseCrrct.getTotCap());
  441. //最大坝高(m)
  442. map.put("damSizeHig", attRsBaseCrrct.getDamSizeHig() == null ? "" : attRsBaseCrrct.getDamSizeHig());
  443. //主坝坝型
  444. map.put("damTypeStr1", formatDamType(attRsBaseCrrct.getDamTypeStr()));
  445. // 注册登记号
  446. map.put("regCode", attRsBaseCrrct.getRegCode() == null ? "" : attRsBaseCrrct.getRegCode());
  447. // 未注册
  448. map.put("regCode2", "");
  449. } else {
  450. AttRsBase attRsBase = bis.getAttRsBase();
  451. // 所在地点
  452. map.put("rsLoc", attRsBase.getRsLoc() == null ? "" : attRsBase.getRsLoc());
  453. // 建成时间
  454. map.put("compDate", formatCompDate(attRsBase.getCompDate()));
  455. // 工程规模
  456. map.put("engScal1", formatEngScal(attRsBase.getEngScal()));
  457. // 总库容(万m³)
  458. map.put("totCap", attRsBase.getTotCap() == null ? "" : attRsBase.getTotCap());
  459. //最大坝高(m)
  460. map.put("damSizeHig", attRsBase.getDamSizeHig() == null ? "" : attRsBase.getDamSizeHig());
  461. //主坝坝型
  462. map.put("damTypeStr1", formatDamType(attRsBase.getDamTypeStr()));
  463. // 注册登记号
  464. map.put("regCode", attRsBase.getRegCode() == null ? "" : attRsBase.getRegCode());
  465. // 未注册
  466. map.put("regCode2", "");
  467. }
  468. // 2.重点环节落实情况
  469. BisInspBaseExt bisInspBaseExt = bis.getBisInspBaseExt();
  470. map.put("emerPlanSameExta", formatEmerPlanSameExta(bisInspBaseExt.getEmerPlanSameExta()));
  471. map.put("emerPlanSameAppr", formatEmerPlanSameExta(bisInspBaseExt.getEmerPlanSameAppr()));
  472. map.put("emerPlanSameSpeed", formatEmerPlanSameExta(bisInspBaseExt.getEmerPlanSameSpeed()));
  473. map.put("emerPlanSameEme", formatEmerPlanSameExta(bisInspBaseExt.getEmerPlanSameEme()));
  474. map.put("schPlanSameExta", formatEmerPlanSameExta(bisInspBaseExt.getSchPlanSameExta()));
  475. map.put("schPlanSameAppr", formatEmerPlanSameExta(bisInspBaseExt.getSchPlanSameAppr()));
  476. map.put("schPlanSameSpeed", formatEmerPlanSameExta(bisInspBaseExt.getSchPlanSameSpeed()));
  477. map.put("rainForc", formatEmerPlanSameExta(bisInspBaseExt.getRainForc()));
  478. // 3.责任人落实情况
  479. BisInspBasePresExt bisInspBasePresExt = bis.getBisInspBasePresExt();
  480. // 是否有行政责任人
  481. map.put("hasWiunWaoLegPers", formatEmerPlanSameExta(bisInspBasePresExt.getHasWiunWaoLegPers()));
  482. // 责任人名称
  483. map.put("wiunWaoLegPers", bisInspBasePresExt.getWiunWaoLegPers() == null ? "" : bisInspBasePresExt.getWiunWaoLegPers());
  484. // 责任人电话
  485. map.put("wiunWaoLegPersTel", bisInspBasePresExt.getWiunWaoLegPersTel() == null ? "" : bisInspBasePresExt.getWiunWaoLegPersTel());
  486. // 责任人职务
  487. map.put("wiunWaoLegPersDuty", bisInspBasePresExt.getWiunWaoLegPersDuty() == null ? "" : bisInspBasePresExt.getWiunWaoLegPersDuty());
  488. // 履职情况
  489. map.put("wiunWaoLegPersResu", formatWiunWaoLegPersResu(bisInspBasePresExt.getWiunWaoLegPersResu()));
  490. // 是否有技术责任人
  491. map.put("hasTechPers", formatEmerPlanSameExta(bisInspBasePresExt.getHasTechPers()));
  492. // 责任人名称
  493. map.put("techPers", bisInspBasePresExt.getTechPers() == null ? "" : bisInspBasePresExt.getTechPers());
  494. // 责任人电话
  495. map.put("techPersTel", bisInspBasePresExt.getTechPersTel() == null ? "" : bisInspBasePresExt.getTechPersTel());
  496. // 责任人职务
  497. map.put("techPersDuty", bisInspBasePresExt.getTechPersDuty() == null ? "" : bisInspBasePresExt.getTechPersDuty());
  498. // 履职情况
  499. map.put("techPersResu", formatWiunWaoLegPersResu(bisInspBasePresExt.getTechPersResu()));
  500. // 是否有巡查责任人
  501. map.put("hasPatrolPers", formatEmerPlanSameExta(bisInspBasePresExt.getHasPatrolPers()));
  502. // 责任人名称
  503. map.put("patrolPers", bisInspBasePresExt.getPatrolPers() == null ? "" : bisInspBasePresExt.getPatrolPers());
  504. // 责任人职务
  505. map.put("patrolPersDuty", formatPatrolPersDuty(bisInspBasePresExt.getPatrolPersDuty()));
  506. // 巡查责任人履职情况
  507. map.put("patrolPersResu", formatWiunWaoLegPersResu(bisInspBasePresExt.getPatrolPersResu()));
  508. // 管理机构
  509. // 是否有专门管理机构
  510. map.put("specialManage", formatEmerPlanSameExta(bisInspBasePresExt.getSpecialManage()));
  511. // 管理机构名称
  512. map.put("manaOrg", formatCheckNull(bisInspBasePresExt.getManaOrg()));
  513. // 管理机构性质
  514. map.put("orgProp", formatCheckNull(bisInspBasePresExt.getOrgProp()));
  515. // 管理机构经费来源
  516. map.put("fundSour", formatCheckNull(bisInspBasePresExt.getFundSour()));
  517. // 管理机构经费每年数额
  518. map.put("fundSourCount", bisInspBasePresExt.getFundSourCount() == null ? "" : bisInspBasePresExt.getFundSourCount());
  519. //无管理机构是否有管护人员,1是,2否
  520. map.put("noManHasPres", formatEmerPlanSameExta(bisInspBasePresExt.getNoManHasPres()));
  521. // 是否参加过培训 1是,2否
  522. map.put("hasAttendTrain", formatEmerPlanSameExta(bisInspBasePresExt.getHasAttendTrain()));
  523. // 管护报酬(万元/年)
  524. map.put("patrolReward", bisInspBasePresExt.getPatrolReward() == null ? "" : bisInspBasePresExt.getPatrolReward());
  525. // 经费来源
  526. map.put("patrolFundSour", bisInspBasePresExt.getPatrolFundSour() == null ? "" : bisInspBasePresExt.getPatrolFundSour());
  527. // 是否开展巡查 1是,2否
  528. map.put("hasExtPatrol", formatEmerPlanSameExta(bisInspBasePresExt.getHasExtPatrol()));
  529. // 巡视频次
  530. map.put("protalRate", bisInspBasePresExt.getProtalRate() == null ? "" : bisInspBasePresExt.getProtalRate());
  531. // 巡视检查记录是否完整 1是,2否
  532. map.put("isPatrolMsgComp", formatEmerPlanSameExta(bisInspBasePresExt.getIsPatrolMsgComp()));
  533. // 有险情是否即时报告 1是,2否
  534. map.put("hasRepDangReal", formatEmerPlanSameExta(bisInspBasePresExt.getHasRepDangReal()));
  535. // 险情报告对象
  536. map.put("dangReportObj", formatEmerPlanSameExta(bisInspBasePresExt.getDangReportObj()));
  537. // 是否有报告记录 1是,2否
  538. map.put("hasReport", formatEmerPlanSameExta(bisInspBasePresExt.getHasReport()));
  539. // 是否知晓防洪限制水位 1是,2否
  540. map.put("hasFlLowLimLev", formatEmerPlanSameExta(bisInspBasePresExt.getHasFlLowLimLev()));
  541. // 是否知晓安全应急(防汛)应急预案 1是,2否
  542. map.put("hasKnowEmerPlanSame", formatEmerPlanSameExta(bisInspBasePresExt.getHasKnowEmerPlanSame()));
  543. // 4.水库工程实体和运行管理情况
  544. BisInspSafeExtManage bisInspSafeExtManage = bis.getBisInspSafeExtManage();
  545. // 安全总体评价
  546. map.put("safeComment", formatSafeComment(bisInspSafeExtManage.getSafeComment()));
  547. // 是否正常蓄水运行
  548. map.put("hasRetainRegular", formatRetainRegular(bisInspSafeExtManage.getRetainRegular()));
  549. // 有缺陷但能蓄水
  550. map.put("noRetainRegular", formatKnowResManager(bisInspSafeExtManage.getNoRetainRegular()));
  551. //不具备正常蓄水条件
  552. map.put("canNotRetainWater", formatHasRetainRegular(bisInspSafeExtManage.getHasRetainRegular()));
  553. // 挡水物
  554. // 是否明显漏水
  555. // 漏水是否影响安全
  556. map.put("leakMakeSafe", formatEmerPlanSameExta(bisInspSafeExtManage.getLeakMakeSafe()));
  557. //是否有变形或不稳定情况
  558. map.put("hasAstable", formatEmerPlanSameExta(bisInspSafeExtManage.getHasAstable()));
  559. // 泄洪建筑物运行状况
  560. // 是否设置泄洪建筑物
  561. map.put("hasSetMainFl", formatEmerPlanSameExta(bisInspSafeExtManage.getHasSetMainFl()));
  562. // 泄洪建筑物是否运行正常
  563. map.put("isMainFlNormal", formatEmerPlanSameExta(bisInspSafeExtManage.getIsMainFlNormal()));
  564. // 放水建筑物运行情况
  565. // 是否设置放水建筑物
  566. map.put("hasSetPourFl", formatEmerPlanSameExta(bisInspSafeExtManage.getHasSetPourFl()));
  567. // 放水建筑物是否运行正常
  568. map.put("pourFyIsNormal", formatPourFyIsNormal(bisInspSafeExtManage.getPourFyIsNormal()));
  569. // 是否设置防洪限制水位 HavFlLowLimLev
  570. map.put("havFlLowLimLev", formatEmerPlanSameExta(bisInspSafeExtManage.getHavFlLowLimLev()));
  571. // 超汛限水位运行
  572. map.put("gtFlLowLimLev", formatEmerPlanSameExta(bisInspSafeExtManage.getFlLowLimLevNote()));
  573. // 是否注册登记
  574. map.put("manageRegRelNote", formatEmerPlanSameExta(bisInspSafeExtManage.getManagePersNote()));
  575. // 注册信息真实
  576. map.put("ifManageRegRel", formatEmerPlanSameExta(bisInspSafeExtManage.getIfManageRegRel()));
  577. // 安全鉴定
  578. map.put("extDamSafeAppr", formatEmerPlanSameExta(bisInspSafeExtManage.getExtDamSafeAppr()));
  579. // 最近一次鉴定时间
  580. // 是否有专门管理机构
  581. map.put("hasSpeManage", formatEmerPlanSameExta(bisInspSafeExtManage.getHasSpeManage()));
  582. // 是否有管护人员
  583. map.put("hasManagePers", formatEmerPlanSameExta(bisInspSafeExtManage.getHasManagePers()));
  584. // 是否有稳定经济来源
  585. map.put("hasWdEmnic", formatEmerPlanSameExta(bisInspSafeExtManage.getHasWdEmnic()));
  586. // 正常运行
  587. map.put("retainRegular", formatRetainRegular(bisInspSafeExtManage.getRetainRegular()));
  588. // 是否正常运行
  589. map.put("dikeHasLeak", formatEmerPlanSameExta(bisInspSafeExtManage.getDikeHasLeak()));
  590. // 水库除险加固
  591. // 是否进行除险加固 IfReinForce
  592. map.put("ifReinForce", formatEmerPlanSameExta(bisInspSafeExtManage.getIfReinForce()));
  593. // 实施情况
  594. map.put("ifComplateAccAll", formatIfComplateAccAll(bisInspSafeExtManage.getIfComplateAcc()));
  595. // 公示情况
  596. // 是否设置水库公示牌
  597. map.put("ifDamWarnLogo", formatEmerPlanSameExta(bisInspSafeExtManage.getIfDamWarnLogo()));
  598. // 5 走访情况
  599. List<BisInspPreList> bisInspPreList = bis.getBisInspPreList();
  600. // 走访人数
  601. int viewPreNum = bisInspPreList.size();
  602. // 走访人姓名
  603. String viewPreName = "";
  604. // 是否知晓水库管护人员
  605. String knowResManager = "";
  606. // 对管护责任人的评价
  607. String managerComment = "";
  608. for (BisInspPreList bipre : bisInspPreList) {
  609. // 多个人的名字合成一个字段
  610. viewPreName += bipre.getViewPreName() + " ";
  611. knowResManager = bipre.getKnowResManager();
  612. managerComment = bipre.getManagerComment();
  613. }
  614. // 走访人数
  615. map.put("viewPreNum", viewPreNum);
  616. // 走访人姓名
  617. map.put("viewPreName", viewPreName);
  618. // 是否知晓水库管护人员
  619. map.put("knowResManager", formatKnowResManager(knowResManager));
  620. // 对管护责任人的评价
  621. map.put("managerComment", formatManagerComment(managerComment));
  622. // 省 市 县
  623. HashMap<Object, Object> hashMap = bis.getHashMap();
  624. map.put("province", hashMap.get("province").toString());
  625. map.put("city", hashMap.get("city").toString());
  626. map.put("county", hashMap.get("county").toString());
  627. dataList.add(map);
  628. }
  629. return dataList;
  630. }
  631. /**
  632. * 要填报的水库模板
  633. */
  634. public List<Map<String, Object>> getBisInspRsvrRgstrPcDtoTemplate(List<BisInspRsvrRgstrPcDtoVo> list) {
  635. List<Map<String, Object>> dataList = new LinkedList<>();
  636. for (BisInspRsvrRgstrPcDtoVo bis : list) {
  637. LinkedHashMap<String, Object> map = new LinkedHashMap<>();
  638. //BisInspRsvrRgstrPcDto表 基础信息 填报的基础信息不是这个表,但是要同步到这个表
  639. BisInspRsvrRgstrPcDto bisInspRsvrRgstrPcDto = bis.getBisInspRsvrRgstrPcDto();
  640. // 督查组
  641. map.put("groupName", formatCheckNull(bisInspRsvrRgstrPcDto.getUpGroupName()));
  642. // 督查状态
  643. map.put("state", formatState(bisInspRsvrRgstrPcDto.getState()));
  644. // 1.基础信息 由两个表组成,如果AttRsBaseCrrct表无数据,则取AttRsBase表
  645. AttRsBaseCrrct attRsBaseCrrct = bis.getAttRsBaseCrrct();
  646. if (attRsBaseCrrct != null) {
  647. this.setMapValue(attRsBaseCrrct, baseCrrctKeysArray, map);
  648. } else {
  649. AttRsBase attRsBase = bis.getAttRsBase();
  650. this.setMapValue(attRsBase, baseCrrctKeysArray, map);
  651. }
  652. // 放入行政区划
  653. HashMap<Object, Object> hashMap = bis.getHashMap();
  654. String province = hashMap.get("province").toString();
  655. String city = hashMap.get("city").toString();
  656. String county = hashMap.get("county").toString();
  657. map.put("adFullName", province + city + county);
  658. // 放入objId
  659. map.put("rgstrId", bisInspRsvrRgstrPcDto.getRgstrId());
  660. // 2.重点环节落实情况
  661. BisInspBaseExt bisInspBaseExt = bis.getBisInspBaseExt();
  662. this.setMapValue(bisInspBaseExt, baseExtKeysArray, map);
  663. // 3.责任人落实情况
  664. BisInspBasePresExt bisInspBasePresExt = bis.getBisInspBasePresExt();
  665. this.setMapValue(bisInspBasePresExt, presExtKeysArray, map);
  666. // 4.水库工程实体和运行管理情况
  667. BisInspSafeExtManage bisInspSafeExtManage = bis.getBisInspSafeExtManage();
  668. this.setMapValue(bisInspSafeExtManage, safeExtManageKeysArray, map);
  669. // 5 走访情况
  670. List<BisInspPreList> bisInspPreList = bis.getBisInspPreList();
  671. this.setMapValue(bisInspPreList, preListKeysArray, map);
  672. // 工程实体
  673. BisInspRsvrProject bisInspRsvrProject = bis.getBisInspRsvrProject();
  674. this.setMapValue(bisInspRsvrProject, safeExtManageKeysArray, map);
  675. // 6 效益发挥情况
  676. BisInspRsvrBenefits bisInspRsvrBenefits = bis.getBisInspRsvrBenefits();
  677. this.setMapValue(bisInspRsvrBenefits, benefitsArray, map);
  678. // diskRunInfo hasSetMainF 字段和 工程实体里的 挡水建筑物 重复,单独处理
  679. map.put("diskRunInfo2", isShiFou(bisInspRsvrBenefits.getDiskRunInfo()));
  680. map.put("hasSetMainFl2", formatCheckNull(bisInspRsvrBenefits.getHasSetMainFl()));
  681. dataList.add(map);
  682. }
  683. return dataList;
  684. }
  685. /**
  686. * 用反射简化赋值流程,通过对象和属性名称给Map赋值
  687. */
  688. private void setMapValue(Object obj, String[] names, LinkedHashMap<String, Object> map) {
  689. if (obj == null) {
  690. for (String name : names) {
  691. map.put(name, "");
  692. }
  693. return;
  694. }
  695. Method[] methods = obj.getClass().getMethods();
  696. for (Method method : methods) {
  697. for (String name : names) {
  698. if (("get" + name).toLowerCase().equals(method.getName().toLowerCase())) {
  699. try {
  700. map.put(name, getFormatValue("sk", name, formatCheckNull(method.invoke(obj)), false));
  701. } catch (IllegalAccessException e) {
  702. e.printStackTrace();
  703. } catch (InvocationTargetException e) {
  704. e.printStackTrace();
  705. }
  706. }
  707. }
  708. }
  709. }
  710. }