41598759cfd9d4d3a6b81a5ebd2ee1497f3d4790.svn-base 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427
  1. package cn.com.goldenwater.dcproj.service.impl.rsfco;
  2. import cn.com.goldenwater.core.service.AbstractCrudService;
  3. import cn.com.goldenwater.dcproj.constValue.BisInspEnum;
  4. import cn.com.goldenwater.dcproj.constValue.SplitValue;
  5. import cn.com.goldenwater.dcproj.constValue.StateEnum;
  6. import cn.com.goldenwater.dcproj.dao.*;
  7. import cn.com.goldenwater.dcproj.dto.BisInspRgstrDto;
  8. import cn.com.goldenwater.dcproj.dto.BisInspRsfcoRgstrVo;
  9. import cn.com.goldenwater.dcproj.model.*;
  10. import cn.com.goldenwater.dcproj.param.*;
  11. import cn.com.goldenwater.dcproj.service.*;
  12. import cn.com.goldenwater.dcproj.utils.AdLevelUtil;
  13. import cn.com.goldenwater.dcproj.utils.BeanUtil;
  14. import cn.com.goldenwater.dcproj.utils.Builder;
  15. import cn.com.goldenwater.dcproj.utils.InspPblmUtils;
  16. import cn.com.goldenwater.dcproj.utils.impexcel.ExpAndImpUtil;
  17. import cn.com.goldenwater.dcproj.utils.impexcel.field.ExcelFieldLists;
  18. import cn.com.goldenwater.dcproj.utils.impexcel.format.RsfcoFieldFromatExp;
  19. import cn.com.goldenwater.id.util.UuidUtil;
  20. import com.github.pagehelper.PageHelper;
  21. import com.github.pagehelper.PageInfo;
  22. import org.apache.commons.collections.CollectionUtils;
  23. import org.apache.commons.lang3.StringUtils;
  24. import org.springframework.beans.factory.annotation.Autowired;
  25. import org.springframework.beans.factory.annotation.Value;
  26. import org.springframework.stereotype.Service;
  27. import org.springframework.transaction.annotation.Transactional;
  28. import javax.servlet.http.HttpServletResponse;
  29. import java.io.File;
  30. import java.util.*;
  31. /**
  32. * @author lune
  33. * @date 2020-4-21
  34. */
  35. @Service
  36. @Transactional
  37. public class BisInspRsfcoRgstrServiceImpl extends AbstractCrudService<BisInspRsfcoRgstr, BisInspRsfcoRgstrParam> implements BisInspRsfcoRgstrService, BisInspObjStrategy {
  38. @Autowired
  39. private BisInspRsfcoRgstrDao bisInspRsfcoRgstrDao;
  40. @Autowired
  41. private BisInspPblmDao bisInspPblmDao;
  42. @Autowired
  43. private AttRsBaseDao attRsBaseDao;
  44. @Autowired
  45. private AttAdXBaseDao attAdXBaseDao;
  46. @Autowired
  47. private BisInspAllObjDao bisInspAllObjDao;
  48. @Autowired
  49. private AttRsBaseCrrctDao attRsBaseCrrctDao;
  50. @Autowired
  51. private BisInspRsfcoRgstrBaseDao bisInspRsfcoRgstrBaseDao;
  52. @Autowired
  53. private BisInspRsfcoRgstrFlliDao bisInspRsfcoRgstrFlliDao;
  54. @Autowired
  55. private BisInspRsfcoRgstrAoeparoDao bisInspRsfcoRgstrAoeparoDao;
  56. @Autowired
  57. private BisInspRsfcoRgstrBaseInfoService bisInspRsfcoRgstrBaseInfoService;
  58. @Autowired
  59. private BisInspRsfcoRgstrFcsService bisInspRsfcoRgstrFcsService;
  60. @Autowired
  61. private BisInspRsfcoRgstrTflwliiService bisInspRsfcoRgstrTflwliiService;
  62. @Value("${export.templatePath}")
  63. private String templatePath;
  64. public BisInspRsfcoRgstrServiceImpl(BisInspRsfcoRgstrDao bisInspRsfcoRgstrDao) {
  65. super(bisInspRsfcoRgstrDao);
  66. this.bisInspRsfcoRgstrDao = bisInspRsfcoRgstrDao;
  67. }
  68. @Override
  69. public void insertObj(BisInspAllObj bisInspAllObj, String persId) {
  70. AttRsBaseParam baseParam = new AttRsBaseParam();
  71. baseParam.setRsCode(bisInspAllObj.getCode());
  72. AttRsBase attRsBase = attRsBaseDao.getBy(baseParam);
  73. BisInspRsfcoRgstr rgstr = new BisInspRsfcoRgstr();
  74. rgstr.setId(UuidUtil.uuid());
  75. rgstr.setObjId(bisInspAllObj.getObjId());
  76. rgstr.setRsCode(attRsBase.getRsCode());
  77. rgstr.setRsName(bisInspAllObj.getNm());
  78. rgstr.setHasDamRegCode("1");
  79. rgstr.setDamRegCode(attRsBase.getRegCode());
  80. rgstr.setAdCode(attRsBase.getAdmDiv());
  81. rgstr.setLocation(attRsBase.getLocation());
  82. rgstr.setHystSite(attRsBase.getRsLoc());
  83. rgstr.setCompDateStr(attRsBase.getCompDateStr());
  84. if (attRsBase.getCenterYGd() != null) {
  85. rgstr.setGdY(Double.parseDouble(attRsBase.getCenterYGd()));
  86. }
  87. if (attRsBase.getCenterXGd() != null) {
  88. rgstr.setGdX(Double.parseDouble(attRsBase.getCenterXGd()));
  89. }
  90. if (attRsBase.getCenterX() != null) {
  91. rgstr.setCenterX(Double.parseDouble(attRsBase.getCenterX()));
  92. }
  93. if (attRsBase.getCenterY() != null) {
  94. rgstr.setCenterY(Double.parseDouble(attRsBase.getCenterY()));
  95. }
  96. rgstr.setRsAdmCode(attRsBase.getRsAdmCode());
  97. rgstr.setRsAdmName(attRsBase.getRsAdmName());
  98. rgstr.setEngScal(attRsBase.getEngScal());
  99. rgstr.setDamType(attRsBase.getDamType());
  100. rgstr.setTotCap(attRsBase.getTotCap());
  101. rgstr.setDamSizeHig(attRsBase.getDamSizeHig());
  102. rgstr.setResCreateTime(attRsBase.getCompDate());
  103. rgstr.setPresState(StateEnum.NOWASTSTATE.getKey());
  104. rgstr.setRunManageState(StateEnum.NOWASTSTATE.getKey());
  105. rgstr.setProjectState(StateEnum.NOWASTSTATE.getKey());
  106. rgstr.setState(StateEnum.NOWASTSTATE.getKey());
  107. Date date = new Date();
  108. rgstr.setIntm(date);
  109. rgstr.setUptm(date);
  110. bisInspRsfcoRgstrDao.insert(rgstr);
  111. // bisInspRsfcoRgstrBaseInfoService.insert(Builder.of(BisInspRsfcoRgstrBaseInfoParam::new).with(BisInspRsfcoRgstrBaseInfoParam::setRgstrId, rgstr.getId()).build());
  112. // bisInspRsfcoRgstrFcsService.insert(Builder.of(BisInspRsfcoRgstrFcsParam::new).with(BisInspRsfcoRgstrFcsParam::setRgstrId, rgstr.getId()).build());
  113. // bisInspRsfcoRgstrTflwliiService.insert(Builder.of(BisInspRsfcoRgstrTflwliiParam::new).with(BisInspRsfcoRgstrTflwliiParam::setRgstrId, rgstr.getId()).build());
  114. }
  115. @Override
  116. public String getType() {
  117. return BisInspEnum.RSFCO.getValue();
  118. }
  119. @Override
  120. public void cleanObjData(String objId) {
  121. BisInspRsfcoRgstrParam rsfcoRgstrParam = new BisInspRsfcoRgstrParam();
  122. rsfcoRgstrParam.setObjId(objId);
  123. List<BisInspRsfcoRgstr> list = this.bisInspRsfcoRgstrDao.findList(rsfcoRgstrParam);
  124. if (list.size() > 0) {
  125. String id = list.get(0).getId();
  126. BisInspPblmParam bisInspPblmParam = new BisInspPblmParam();
  127. bisInspPblmParam.setObjId(objId);
  128. bisInspPblmParam.setObjType(BisInspEnum.RSFCO.getValue());
  129. this.bisInspPblmDao.deleteBy(bisInspPblmParam);//删除问题
  130. BisInspRsfcoRgstrBaseParam baseParam = new BisInspRsfcoRgstrBaseParam();
  131. baseParam.setRgstrId(id);
  132. bisInspRsfcoRgstrBaseDao.deleteBy(baseParam);
  133. BisInspRsfcoRgstrFlliParam flliParam = new BisInspRsfcoRgstrFlliParam();
  134. flliParam.setRgstrId(id);
  135. bisInspRsfcoRgstrFlliDao.deleteBy(flliParam);
  136. bisInspRsfcoRgstrBaseInfoService.deleteBy(Builder.of(BisInspRsfcoRgstrBaseInfoParam::new).with(BisInspRsfcoRgstrBaseInfoParam::setRgstrId, id).build());
  137. bisInspRsfcoRgstrFcsService.deleteBy(Builder.of(BisInspRsfcoRgstrFcsParam::new).with(BisInspRsfcoRgstrFcsParam::setRgstrId, id).build());
  138. bisInspRsfcoRgstrTflwliiService.deleteBy(Builder.of(BisInspRsfcoRgstrTflwliiParam::new).with(BisInspRsfcoRgstrTflwliiParam::setRgstrId, id).build());
  139. BisInspRsfcoRgstrAoeparoParam aoeparoParam = new BisInspRsfcoRgstrAoeparoParam();
  140. aoeparoParam.setRgstrId(id);
  141. bisInspRsfcoRgstrAoeparoDao.deleteBy(aoeparoParam);
  142. this.bisInspRsfcoRgstrDao.delete(id);//删除水库登记表
  143. BisInspAllObjParam bisInspAllObjParam = new BisInspAllObjParam();
  144. bisInspAllObjParam.setObjId(objId);
  145. this.bisInspAllObjDao.deleteBy(bisInspAllObjParam);//删除对象名录表
  146. AttRsBaseCrrctParam attRsBaseCrrctParam = new AttRsBaseCrrctParam();
  147. attRsBaseCrrctParam.setObjId(objId);
  148. attRsBaseCrrctDao.deleteBy(attRsBaseCrrctParam);
  149. }
  150. }
  151. @Override
  152. public PageInfo findObjPageByType(TypeParam typeParam, HttpServletResponse response) {
  153. return findRsfcoPage(typeParam, response);
  154. }
  155. @Override
  156. public Object findObjListByType(TypeParam typeParam) {
  157. if (StringUtils.isNotBlank(typeParam.getAdCode())) {
  158. typeParam.setAdCode(String.valueOf(AdLevelUtil.SubAd(typeParam.getAdCode()).get(SplitValue.SUBAD)));
  159. }
  160. List<BisInspRgstrDto> list = bisInspRsfcoRgstrDao.findRsfcoList(typeParam);
  161. list = InspPblmUtils.changeList(list);
  162. return list;
  163. }
  164. @Override
  165. public PageInfo<BisInspRgstrDto> findRsfcoPage(TypeParam param, HttpServletResponse response) {
  166. if (StringUtils.isNotBlank(param.getAdCode())) {
  167. param.setAdCode(String.valueOf(AdLevelUtil.SubAd(param.getAdCode()).get(SplitValue.SUBAD)));
  168. }
  169. if (StringUtils.isNotBlank(param.getAdCodes())) {
  170. param.setAdCodes(AdLevelUtil.getListAddvcd(param.getAdCodes()));
  171. }
  172. PageHelper.startPage(param);
  173. List<BisInspRgstrDto> list = bisInspRsfcoRgstrDao.findRsfcoList(param);
  174. list = InspPblmUtils.changeList(list);
  175. return new PageInfo<BisInspRgstrDto>(list);
  176. }
  177. @Override
  178. public void downloadTemplate(HttpServletResponse response, TypeParam param) throws Exception {
  179. // 模板路径
  180. String filePath = templatePath + File.separator + "pblmSkfh_tb.xls";
  181. // SHEET名称
  182. String sheetName = "水库防洪填报表";
  183. // 文件名称带后缀
  184. String fileName = sheetName + ".xls";
  185. // startRow
  186. int startRow = 2;
  187. if (StringUtils.isBlank(param.getPlnaId())) {
  188. List<Map<String, Object>> list = new ArrayList<>();
  189. ExpAndImpUtil.download(response, list, filePath, startRow, sheetName);
  190. }
  191. //获取水库登记表
  192. List<BisInspRgstrDto> rsfcoList = bisInspRsfcoRgstrDao.findRsfcoList(param);
  193. rsfcoList = InspPblmUtils.changeList(rsfcoList);
  194. List<BisInspRsfcoRgstrVo> bisInspRsfcoRgstrVoList = new ArrayList();
  195. //赋值其他参数
  196. setRsfcoRgstrVoList(rsfcoList, bisInspRsfcoRgstrVoList);
  197. //数据转换为Map
  198. List<Map<String, Object>> dataList = rsfcoRgsteListConvertMap(bisInspRsfcoRgstrVoList);
  199. ExpAndImpUtil.download(response, dataList, filePath, startRow, sheetName);
  200. }
  201. private List<Map<String, Object>> rsfcoRgsteListConvertMap(List<BisInspRsfcoRgstrVo> bisInspRsfcoRgstrVoList) {
  202. List<Map<String, Object>> dataList = new LinkedList<>();
  203. bisInspRsfcoRgstrVoList.forEach(vo -> {
  204. Map<String, Object> map = new HashMap<>();
  205. //登记表
  206. BisInspRgstrDto bisInspRgstrDto = vo.getBisInspRgstrDto();
  207. ExpAndImpUtil.convertBeanToMap(bisInspRgstrDto, ExcelFieldLists.bisInspRgstrArrays, map, RsfcoFieldFromatExp.class);
  208. //水库防洪调度存在问题原因分析及整改意见管理
  209. BisInspRsfcoRgstrAoeparo bisInspRsfcoRgstrAoeparo = vo.getBisInspRsfcoRgstrAoeparo();
  210. ExpAndImpUtil.convertBeanToMap(bisInspRsfcoRgstrAoeparo, ExcelFieldLists.bisInspRsfcoRgstrAoeparoArrays, map, RsfcoFieldFromatExp.class);
  211. //水库防洪调度总体情况管理
  212. BisInspRsfcoRgstrBase bisInspRsfcoRgstrBase = vo.getBisInspRsfcoRgstrBase();
  213. ExpAndImpUtil.convertBeanToMap(bisInspRsfcoRgstrBase, ExcelFieldLists.bisInspRsfcoRgstrBaseArrays, map, RsfcoFieldFromatExp.class);
  214. //水库防洪调度和汛限水位执行管理
  215. BisInspRsfcoRgstrFlli bisInspRsfcoRgstrFlli = vo.getBisInspRsfcoRgstrFlli();
  216. ExpAndImpUtil.convertBeanToMap(bisInspRsfcoRgstrFlli, ExcelFieldLists.bisInspRsfcoRgstrFlliArrays, map, RsfcoFieldFromatExp.class);
  217. dataList.add(map);
  218. });
  219. return dataList;
  220. }
  221. private void setRsfcoRgstrVoList(List<BisInspRgstrDto> rsfcoList, List<BisInspRsfcoRgstrVo> bisInspRsfcoRgstrVoList) {
  222. rsfcoList.forEach(rsfcoDto -> {
  223. BisInspRsfcoRgstrVo bisVo = new BisInspRsfcoRgstrVo();
  224. //登记表
  225. bisVo.setBisInspRgstrDto(rsfcoDto);
  226. String rgstrId = rsfcoDto.getRgstrId();
  227. //水库防洪调度总体情况管理
  228. BisInspRsfcoRgstrBaseParam baseParam = new BisInspRsfcoRgstrBaseParam();
  229. baseParam.setRgstrId(rgstrId);
  230. BisInspRsfcoRgstrBase base = bisInspRsfcoRgstrBaseDao.getBy(baseParam);
  231. bisVo.setBisInspRsfcoRgstrBase(base);
  232. //水库防洪调度和汛限水位执行管理
  233. BisInspRsfcoRgstrFlliParam flliParam = new BisInspRsfcoRgstrFlliParam();
  234. flliParam.setRgstrId(rgstrId);
  235. BisInspRsfcoRgstrFlli flli = bisInspRsfcoRgstrFlliDao.getBy(flliParam);
  236. bisVo.setBisInspRsfcoRgstrFlli(flli);
  237. //水库防洪调度存在问题原因分析及整改意见管理
  238. BisInspRsfcoRgstrAoeparoParam aoeparoParam = new BisInspRsfcoRgstrAoeparoParam();
  239. aoeparoParam.setRgstrId(rgstrId);
  240. BisInspRsfcoRgstrAoeparo aoeparo = bisInspRsfcoRgstrAoeparoDao.getBy(aoeparoParam);
  241. bisVo.setBisInspRsfcoRgstrAoeparo(aoeparo);
  242. bisInspRsfcoRgstrVoList.add(bisVo);
  243. });
  244. }
  245. @Override
  246. public int insertIntoData(List<LinkedHashMap<String, Object>> list, FileParam param) throws Exception {
  247. for (LinkedHashMap<String, Object> map : list) {
  248. String persId = param.getPersId();
  249. //修改登记表
  250. BisInspRgstrDto bisInspRgstrDto = (BisInspRgstrDto) ExpAndImpUtil.convertMapToBean(BisInspRgstrDto.class, map);
  251. String rgstrId = "";
  252. if (StringUtils.isNotBlank(bisInspRgstrDto.getRgstrId())) {
  253. rgstrId = bisInspRgstrDto.getRgstrId();
  254. BisInspRsfcoRgstr bisInspRsfcoRgstr = new BisInspRsfcoRgstr();
  255. BeanUtil.copyObject1(bisInspRgstrDto, bisInspRsfcoRgstr);
  256. bisInspRsfcoRgstr.setRsName(bisInspRgstrDto.getNm());
  257. bisInspRsfcoRgstr.setUptm(new Date());
  258. bisInspRsfcoRgstr.setRecPersId(persId);
  259. bisInspRsfcoRgstr.setId(rgstrId);
  260. bisInspRsfcoRgstr.setLocation(bisInspRgstrDto.getProvince() + bisInspRgstrDto.getCity() + bisInspRgstrDto.getCountry());
  261. bisInspRsfcoRgstrDao.update(bisInspRsfcoRgstr);
  262. } else {
  263. String id = UuidUtil.uuid();
  264. rgstrId = id;
  265. BisInspRsfcoRgstr bisInspRsfcoRgstr = new BisInspRsfcoRgstr();
  266. BeanUtil.copyObject1(bisInspRgstrDto, bisInspRsfcoRgstr);
  267. AttRsBaseParam attRsBaseParam = new AttRsBaseParam();
  268. attRsBaseParam.setRsName(bisInspRgstrDto.getNm());
  269. List<AttRsBase> baseList = attRsBaseDao.findList(attRsBaseParam);
  270. if (CollectionUtils.isEmpty(baseList)) {
  271. continue;
  272. }
  273. AttRsBase attRsBase = baseList.get(0);
  274. String ObjUuid = UuidUtil.uuid();
  275. BisInspAllObj bisInspAllObj = new BisInspAllObj();
  276. bisInspAllObj.setCode(attRsBase.getRsCode());
  277. bisInspAllObj.setId(param.getGroupId());
  278. bisInspAllObj.setNm(attRsBase.getRsName());
  279. bisInspAllObj.setLgtd(Double.parseDouble(attRsBase.getCenterXGd()));
  280. bisInspAllObj.setLttd(Double.parseDouble(attRsBase.getCenterYGd()));
  281. bisInspAllObj.setObjId(ObjUuid);
  282. bisInspAllObj.setPtype("26");
  283. bisInspAllObjDao.insert(bisInspAllObj);
  284. BeanUtil.copyObject1(attRsBase, bisInspRsfcoRgstr);
  285. String adCode = attRsBase.getAdmDiv();
  286. bisInspRsfcoRgstr.setAdCode(adCode);
  287. bisInspRsfcoRgstr.setId(id);
  288. bisInspRsfcoRgstr.setHasDamRegCode("1");
  289. bisInspRsfcoRgstr.setRecPersId(persId);
  290. bisInspRsfcoRgstr.setObjId(ObjUuid);
  291. bisInspRsfcoRgstr.setIntm(new Date());
  292. bisInspRsfcoRgstr.setUptm(new Date());
  293. bisInspRsfcoRgstrDao.insert(bisInspRsfcoRgstr);
  294. }
  295. //水库防洪调度总体情况管理
  296. insertRsfcoRgstrBse(map, persId, rgstrId);
  297. //水库防洪调度和汛限水位执行管理
  298. insertRsfcoRgstrFlli(map, persId, rgstrId);
  299. //水库防洪调度存在问题原因分析及整改意见管理
  300. insertRsfcoRgstrAoeparo(map, persId, rgstrId);
  301. }
  302. return 0;
  303. }
  304. private void insertRsfcoRgstrAoeparo(LinkedHashMap<String, Object> map, String persId, String rgstrId) throws IllegalAccessException, InstantiationException {
  305. if (StringUtils.isNotBlank(rgstrId)) {
  306. //水库防洪调度存在问题原因分析及整改意见管理
  307. BisInspRsfcoRgstrAoeparo aoeparo = (BisInspRsfcoRgstrAoeparo) ExpAndImpUtil.convertMapToBean(BisInspRsfcoRgstrAoeparo.class, map);
  308. BisInspRsfcoRgstrAoeparoParam aoeparoParam = new BisInspRsfcoRgstrAoeparoParam();
  309. aoeparoParam.setRgstrId(rgstrId);
  310. List<BisInspRsfcoRgstrAoeparo> aoeparoList = bisInspRsfcoRgstrAoeparoDao.findList(aoeparoParam);
  311. if (CollectionUtils.isEmpty(aoeparoList)) {
  312. aoeparo.setId(UuidUtil.uuid());
  313. aoeparo.setRecPersId(persId);
  314. aoeparo.setRgstrId(rgstrId);
  315. aoeparo.setIntm(new Date());
  316. aoeparo.setUptm(new Date());
  317. bisInspRsfcoRgstrAoeparoDao.insert(aoeparo);
  318. } else {
  319. aoeparo.setId(aoeparoList.get(0).getId());
  320. aoeparo.setRecPersId(persId);
  321. aoeparo.setRgstrId(rgstrId);
  322. aoeparo.setUptm(new Date());
  323. bisInspRsfcoRgstrAoeparoDao.update(aoeparo);
  324. }
  325. }
  326. }
  327. private void insertRsfcoRgstrFlli(LinkedHashMap<String, Object> map, String persId, String rgstrId) throws IllegalAccessException, InstantiationException {
  328. if (StringUtils.isNotBlank(rgstrId)) {
  329. //水库防洪调度和汛限水位执行管理
  330. BisInspRsfcoRgstrFlli flli = (BisInspRsfcoRgstrFlli) ExpAndImpUtil.convertMapToBean(BisInspRsfcoRgstrFlli.class, map);
  331. BisInspRsfcoRgstrFlliParam flliParam = new BisInspRsfcoRgstrFlliParam();
  332. flliParam.setRgstrId(rgstrId);
  333. List<BisInspRsfcoRgstrFlli> flliList = bisInspRsfcoRgstrFlliDao.findList(flliParam);
  334. if (CollectionUtils.isEmpty(flliList)) {
  335. flli.setId(UuidUtil.uuid());
  336. flli.setRecPersId(persId);
  337. flli.setIntm(new Date());
  338. flli.setUptm(new Date());
  339. flli.setRgstrId(rgstrId);
  340. bisInspRsfcoRgstrFlliDao.insert(flli);
  341. } else {
  342. flli.setId(flliList.get(0).getId());
  343. flli.setRecPersId(persId);
  344. flli.setUptm(new Date());
  345. bisInspRsfcoRgstrFlliDao.update(flli);
  346. }
  347. }
  348. }
  349. private void insertRsfcoRgstrBse(LinkedHashMap<String, Object> map, String persId, String rgstrId) throws IllegalAccessException, InstantiationException {
  350. if (StringUtils.isNotBlank(rgstrId)) {
  351. //水库防洪调度总体情况管理
  352. BisInspRsfcoRgstrBase base = (BisInspRsfcoRgstrBase) ExpAndImpUtil.convertMapToBean(BisInspRsfcoRgstrBase.class, map);
  353. BisInspRsfcoRgstrBaseParam baseParam = new BisInspRsfcoRgstrBaseParam();
  354. baseParam.setRgstrId(rgstrId);
  355. List<BisInspRsfcoRgstrBase> baseList = bisInspRsfcoRgstrBaseDao.findList(baseParam);
  356. if (CollectionUtils.isEmpty(baseList)) {
  357. base.setId(UuidUtil.uuid());
  358. base.setIntm(new Date());
  359. base.setUptm(new Date());
  360. base.setRecPersId(persId);
  361. base.setRgstrId(rgstrId);
  362. bisInspRsfcoRgstrBaseDao.insert(base);
  363. } else {
  364. base.setId(baseList.get(0).getId());
  365. base.setUptm(new Date());
  366. base.setRecPersId(persId);
  367. bisInspRsfcoRgstrBaseDao.update(base);
  368. }
  369. }
  370. }
  371. @Override
  372. public BisInspRsfcoRgstr get(String key) {
  373. BisInspRsfcoRgstr rgstr = super.get(key);
  374. if (rgstr != null) {
  375. if (rgstr.getAdCode() != null && rgstr.getAdCode().length() == 6) {
  376. rgstr.setAdCode(rgstr.getAdCode() + "000000");
  377. }
  378. AttAdXBase adXBase = attAdXBaseDao.get(rgstr.getAdCode());
  379. if (adXBase != null) {
  380. rgstr.setLocation(adXBase.getAdFullName());
  381. }
  382. }
  383. return rgstr;
  384. }
  385. }