a1c8585ad8b987e41931058b62bb624cdb0ecaea.svn-base 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397
  1. package cn.com.goldenwater.dcproj.service.impl.offline;
  2. import cn.com.goldenwater.dcproj.constValue.BisInspEnum;
  3. import cn.com.goldenwater.dcproj.constValue.SplitValue;
  4. import cn.com.goldenwater.dcproj.dao.*;
  5. import cn.com.goldenwater.dcproj.model.*;
  6. import cn.com.goldenwater.dcproj.param.*;
  7. import cn.com.goldenwater.dcproj.service.GwComFileService;
  8. import cn.com.goldenwater.dcproj.service.SupervisionPlanService;
  9. import cn.com.goldenwater.dcproj.utils.AdLevelUtil;
  10. import cn.com.goldenwater.id.util.UuidUtil;
  11. import com.fasterxml.jackson.databind.DeserializationFeature;
  12. import com.fasterxml.jackson.databind.ObjectMapper;
  13. import org.apache.commons.lang3.StringUtils;
  14. import org.slf4j.Logger;
  15. import org.slf4j.LoggerFactory;
  16. import org.springframework.beans.factory.annotation.Autowired;
  17. import org.springframework.beans.factory.annotation.Value;
  18. import org.springframework.stereotype.Service;
  19. import org.springframework.transaction.annotation.Transactional;
  20. import java.io.IOException;
  21. import java.text.ParseException;
  22. import java.text.SimpleDateFormat;
  23. import java.util.Date;
  24. import java.util.List;
  25. import static cn.com.goldenwater.dcproj.utils.impexcel.ImpUtil.checkIsDate;
  26. /**
  27. * @author lhc 大中型水库离线填报
  28. * @date 2020/3/16 13:40
  29. */
  30. @Service
  31. @Transactional
  32. public class BisInspOffLineRsmlProcess extends BisInspOffLineProcess {
  33. private Logger logger = LoggerFactory.getLogger(getClass());
  34. @Autowired
  35. AttRsBaseDao attRsBaseDao;//水库基本信息
  36. @Autowired
  37. BisInspPblmDao bisInspPblmDao;//督查问题
  38. @Autowired
  39. private GwComFileService gwComFileService;//文件操作
  40. @Autowired
  41. private BisInspRsmlRgstrDao bisInspRsmlRgstrDao;
  42. @Autowired
  43. private BisInspAllObjDao bisInspAllObjDao;
  44. @Autowired
  45. private BisInspRsmlRgstrPresDao bisInspRsmlRgstrPresDao;
  46. @Autowired
  47. private BisInspRsmlRgstrSafeDao bisInspRsmlRgstrSafeDao;
  48. @Autowired
  49. private BisInspRsmlRgstrProjectDao bisInspRsmlRgstrProjectDao;
  50. @Autowired
  51. private BisInspRsmlRgstrRunManageDao bisInspRsmlRgstrRunManageDao;
  52. @Value("${getFile.prefix}")
  53. public String prefix;
  54. @Autowired
  55. SupervisionPlanService supervisionPlanService;
  56. @Override
  57. public BisInspOffLineRet process(BisInspOffLineObj bisInspOffLineObj, String fileDir) throws IOException {
  58. BisInspOffLineRet bisInspOffLineRet = new BisInspOffLineRet();
  59. ObjectMapper om = new ObjectMapper();
  60. om.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
  61. //解析大中水库填报信息
  62. BisInspOffLineRsmlRgeister bisInspOffLineRsmlRgeister = om.readValue(bisInspOffLineObj.getRegister(), BisInspOffLineRsmlRgeister.class);
  63. //解析大中水库基本信息对象
  64. if (bisInspOffLineObj.getBase() != null) {
  65. BisInspRsmlRgstr bisInspRsmlRgstr = new BisInspRsmlRgstr();
  66. String objId = UuidUtil.uuid();
  67. String regId = objId;
  68. BisInspOffLineRsml bisInspOffLineRsml = bisInspOffLineRsmlRgeister.getBisInspOffLineRsml();
  69. if (null != bisInspOffLineRsml && StringUtils.isNotBlank(bisInspOffLineRsml.getRgstrId())) {
  70. bisInspOffLineRsmlRgeister.setRgstrId(bisInspOffLineRsml.getRgstrId());
  71. regId = bisInspOffLineRsml.getRgstrId();
  72. bisInspOffLineRsmlRgeister.setObjId(bisInspOffLineRsml.getObjId());
  73. objId = bisInspOffLineRsml.getObjId();
  74. bisInspRsmlRgstr.setObjId(objId);
  75. bisInspRsmlRgstr.setRgstrId(regId);
  76. bisInspRsmlRgstr.setState("1");
  77. } else {
  78. //添加到督查任务
  79. String goupId = bisInspOffLineObj.getGroupId();
  80. AttRsBase attRsBase = om.readValue(bisInspOffLineObj.getBase(), AttRsBase.class);
  81. insertBisInspAllObj(bisInspOffLineObj, attRsBase, objId, goupId);
  82. bisInspRsmlRgstr.setRgstrId(regId);
  83. bisInspRsmlRgstr.setObjId(objId);
  84. //插入登记表信息
  85. insertBisInspRsmlRgstr(attRsBase, bisInspRsmlRgstr, om);
  86. }
  87. //插入三个责任人信息
  88. insertBisInspRsmlRgstrPres(bisInspOffLineRsmlRgeister, bisInspRsmlRgstr, bisInspOffLineRsml);
  89. //水库安全管理三级责任人
  90. insertBisInspPresSafe(bisInspOffLineRsmlRgeister, bisInspRsmlRgstr, bisInspOffLineRsml);
  91. //运行情况
  92. insertBisInspRsmlRgstrRunManage(bisInspOffLineRsmlRgeister, bisInspRsmlRgstr, bisInspOffLineRsml);
  93. //水库工程实体
  94. insertBisInspRsmlRgstrProject(bisInspOffLineRsmlRgeister, bisInspRsmlRgstr, bisInspOffLineRsml);
  95. bisInspRsmlRgstrDao.update(bisInspRsmlRgstr);//更新各个填报项目状态
  96. bisInspOffLineRet.setObjId(objId);
  97. bisInspOffLineRet.setRegId(regId);
  98. }
  99. return bisInspOffLineRet;
  100. }
  101. /**
  102. * 删除任务及登记表信息
  103. *
  104. * @param bisInspOffLineObj
  105. */
  106. public void delRgstrData(BisInspOffLineObj bisInspOffLineObj) {
  107. //登记表查找重复数据,然后删除
  108. BisInspAllObjParam bisInspAllObjParam = new BisInspAllObjParam();
  109. bisInspAllObjParam.setId(bisInspOffLineObj.getGroupId());
  110. bisInspAllObjParam.setNm(bisInspOffLineObj.getNm());
  111. List<BisInspAllObj> bisInspAllObjs = bisInspAllObjDao.findList(bisInspAllObjParam);
  112. for (BisInspAllObj bisInspAllObj : bisInspAllObjs) {
  113. //删除登记表
  114. //删除登记表关联的各个填报表数据
  115. supervisionPlanService.cleanObjDataByObjId(BisInspEnum.RSML.getValue(), bisInspAllObj.getObjId());
  116. }
  117. }
  118. /**
  119. * 插入小水库督查任务信息
  120. *
  121. * @param attRsBase 对象基本信息
  122. * @param objId 督查对象ID
  123. * @param groupId 督查组ID
  124. */
  125. public void insertBisInspAllObj(BisInspOffLineObj bisInspOffLineObj, AttRsBase attRsBase, String objId, String groupId) {
  126. BisInspAllObj bisInspAllObj = new BisInspAllObj();
  127. bisInspAllObj.setId(groupId);
  128. bisInspAllObj.setObjId(objId);
  129. bisInspAllObj.setOrgId(bisInspOffLineObj.getOrgId());
  130. bisInspAllObj.setAdCode(bisInspOffLineObj.getProvince());
  131. bisInspAllObj.setNm(attRsBase.getRsName());
  132. bisInspAllObj.setCode(attRsBase.getRsCode());
  133. bisInspAllObj.setPtype("22");
  134. bisInspAllObj.setLttd(StringUtils.isNotBlank(attRsBase.getCenterXGd()) ? Double.parseDouble(attRsBase.getCenterXGd()) : 0);
  135. bisInspAllObj.setLgtd(StringUtils.isNotBlank(attRsBase.getCenterYGd()) ? Double.parseDouble(attRsBase.getCenterYGd()) : 0);
  136. bisInspAllObj.setLttdpc(StringUtils.isNotBlank(attRsBase.getCenterX()) ? Double.parseDouble(attRsBase.getCenterX()) : 0);
  137. bisInspAllObj.setLgtdpc(StringUtils.isNotBlank(attRsBase.getCenterY()) ? Double.parseDouble(attRsBase.getCenterY()) : 0);
  138. bisInspAllObjDao.insert(bisInspAllObj);
  139. }
  140. /**
  141. * 插入大中水库登记信息
  142. *
  143. * @param attRsBase 对象基本信息
  144. * @param bisInspRsmlRgstr 注册信息
  145. * @param om 转换对象
  146. * @throws IOException
  147. */
  148. public void insertBisInspRsmlRgstr(AttRsBase attRsBase, BisInspRsmlRgstr bisInspRsmlRgstr, ObjectMapper om) {
  149. bisInspRsmlRgstr.setRgstrId(bisInspRsmlRgstr.getRgstrId());
  150. bisInspRsmlRgstr.setObjId(bisInspRsmlRgstr.getObjId());
  151. bisInspRsmlRgstr.setRsCode(attRsBase.getRsCode());
  152. bisInspRsmlRgstr.setRsName(attRsBase.getRsName());
  153. bisInspRsmlRgstr.setId(bisInspRsmlRgstr.getRgstrId());
  154. if (attRsBase.getRegCode() != null) {
  155. bisInspRsmlRgstr.setHasDamRegCode("1");
  156. bisInspRsmlRgstr.setDamRegCode(attRsBase.getRegCode());
  157. } else {
  158. bisInspRsmlRgstr.setHasDamRegCode("2");
  159. }
  160. bisInspRsmlRgstr.setAdCode(attRsBase.getAdmDiv());
  161. bisInspRsmlRgstr.setLocation(attRsBase.getLocation());
  162. bisInspRsmlRgstr.setHystSite(attRsBase.getLocation());
  163. bisInspRsmlRgstr.setCenterX(attRsBase.getCenterX() == null ? 0 : Double.parseDouble(attRsBase.getCenterX()));
  164. bisInspRsmlRgstr.setCenterY(attRsBase.getCenterY() == null ? 0 : Double.parseDouble(attRsBase.getCenterY()));
  165. bisInspRsmlRgstr.setGdX(attRsBase.getCenterXGd() == null ? 0 : Double.parseDouble(attRsBase.getCenterXGd()));
  166. bisInspRsmlRgstr.setGdY(attRsBase.getCenterYGd() == null ? 0 : Double.parseDouble(attRsBase.getCenterYGd()));
  167. bisInspRsmlRgstr.setRsAdmCode(attRsBase.getRsAdmCode());
  168. bisInspRsmlRgstr.setRsAdmName(attRsBase.getRsAdmName());
  169. bisInspRsmlRgstr.setEngScal(attRsBase.getEngScal());
  170. bisInspRsmlRgstr.setRsClass(attRsBase.getRsClass());
  171. bisInspRsmlRgstr.setDamType(attRsBase.getDamType());
  172. bisInspRsmlRgstr.setTotCap(attRsBase.getTotCap());
  173. bisInspRsmlRgstr.setDamSizeHig(attRsBase.getDamSizeHig());
  174. bisInspRsmlRgstr.setDesFlStag(attRsBase.getDesFlStag());
  175. bisInspRsmlRgstr.setFlConTopStag(attRsBase.getFlConTopStag());
  176. bisInspRsmlRgstr.setImpdDt(attRsBase.getImpdDt());
  177. bisInspRsmlRgstr.setRnfcImpdDt(attRsBase.getRnfcImpdDt());
  178. if (org.apache.commons.lang3.StringUtils.isNotBlank(attRsBase.getCompDateStr())) {
  179. try {
  180. // 不是时间格式会报错,判断一下,不是时间格式就不赋给它了
  181. if (checkIsDate(attRsBase.getCompDateStr())) {
  182. bisInspRsmlRgstr.setResCreateTime(new SimpleDateFormat(SplitValue.TIME_SPLIT).parse(attRsBase.getCompDateStr()));
  183. }
  184. } catch (ParseException e) {
  185. e.printStackTrace();
  186. }
  187. }
  188. bisInspRsmlRgstr.setIntm(new Date());
  189. bisInspRsmlRgstr.setUptm(new Date());
  190. bisInspRsmlRgstr.setState("1");
  191. //添加注册登记表
  192. bisInspRsmlRgstrDao.insert(bisInspRsmlRgstr);
  193. }
  194. /**
  195. * 插入三个责任人信息
  196. *
  197. * @param bisInspOffLineRsmlRgeister 三个责任人信息
  198. * @param bisInspRsmlRgstr
  199. */
  200. public void insertBisInspRsmlRgstrPres(BisInspOffLineRsmlRgeister bisInspOffLineRsmlRgeister, BisInspRsmlRgstr bisInspRsmlRgstr, BisInspOffLineRsml bisInspOffLineRsml) {
  201. if (null != bisInspOffLineRsml && StringUtils.isNotBlank(bisInspOffLineRsml.getRgstrId())) {
  202. if (null != bisInspOffLineRsml.getBasePresExt() && bisInspOffLineRsml.getBasePresExt()) {
  203. if (null != bisInspOffLineRsmlRgeister.getBisInspRsmlRgstrPres()) {
  204. BisInspRsmlRgstrPres bisInspRsmlRgstrPres = bisInspOffLineRsmlRgeister.getBisInspRsmlRgstrPres();
  205. bisInspRsmlRgstrPres.setRgstrId(bisInspOffLineRsml.getRgstrId());
  206. BisInspRsmlRgstrPresParam bisInspBasePresExtParam = new BisInspRsmlRgstrPresParam();
  207. bisInspBasePresExtParam.setRgstrId(bisInspOffLineRsml.getRgstrId());
  208. List<BisInspRsmlRgstrPres> bisInspBasePresExts = bisInspRsmlRgstrPresDao.findList(bisInspBasePresExtParam);
  209. //找到dutyId
  210. if (bisInspBasePresExts != null && bisInspBasePresExts.size() > 0) {
  211. bisInspRsmlRgstrPres.setId(bisInspBasePresExts.get(0).getId());
  212. bisInspRsmlRgstrPresDao.update(bisInspRsmlRgstrPres);
  213. } else {
  214. bisInspRsmlRgstrPres.setId(UuidUtil.uuid());
  215. bisInspRsmlRgstrPresDao.insert(bisInspRsmlRgstrPres);
  216. }
  217. //更新状态
  218. bisInspRsmlRgstr.setPresState("2");
  219. }
  220. }
  221. } else {
  222. BisInspRsmlRgstrPres bisInspRsmlRgstrPres = null;
  223. if (bisInspOffLineRsmlRgeister.getBisInspRsmlRgstrPres() != null) {
  224. bisInspRsmlRgstrPres = bisInspOffLineRsmlRgeister.getBisInspRsmlRgstrPres();
  225. //更新状态
  226. bisInspRsmlRgstr.setPresState("2");
  227. } else {
  228. bisInspRsmlRgstrPres = new BisInspRsmlRgstrPres();
  229. bisInspRsmlRgstr.setPresState("1");
  230. }
  231. bisInspRsmlRgstrPres.setRgstrId(bisInspRsmlRgstr.getRgstrId());
  232. bisInspRsmlRgstrPres.setId(UuidUtil.uuid());
  233. bisInspRsmlRgstrPresDao.insert(bisInspRsmlRgstrPres);
  234. }
  235. }
  236. /**
  237. * 插入政府三级管理责任人
  238. *
  239. * @param bisInspOffLineRsmlRgeister 三个责任人信息
  240. * @param bisInspRsmlRgstr
  241. */
  242. public void insertBisInspPresSafe(BisInspOffLineRsmlRgeister bisInspOffLineRsmlRgeister, BisInspRsmlRgstr bisInspRsmlRgstr, BisInspOffLineRsml bisInspOffLineRsml) {
  243. if (null != bisInspOffLineRsml && StringUtils.isNotBlank(bisInspOffLineRsml.getRgstrId())) {
  244. if (null != bisInspOffLineRsml.getPresSafe() && bisInspOffLineRsml.getPresSafe()) {
  245. if (null != bisInspOffLineRsmlRgeister.getBisInspRsmlRgstrSafe()) {
  246. BisInspRsmlRgstrSafe bisInspRsmlRgstrSafe = bisInspOffLineRsmlRgeister.getBisInspRsmlRgstrSafe();
  247. bisInspRsmlRgstrSafe.setRgstrId(bisInspOffLineRsml.getRgstrId());
  248. BisInspRsmlRgstrSafeParam bisInspRsmlRgstrSafeParam = new BisInspRsmlRgstrSafeParam();
  249. bisInspRsmlRgstrSafeParam.setRgstrId(bisInspOffLineRsml.getRgstrId());
  250. List<BisInspRsmlRgstrSafe> bisInspRsmlRgstrSafes = bisInspRsmlRgstrSafeDao.findList(bisInspRsmlRgstrSafeParam);
  251. //找到dutyId
  252. if (bisInspRsmlRgstrSafes != null && bisInspRsmlRgstrSafes.size() > 0) {
  253. bisInspRsmlRgstrSafe.setId(bisInspRsmlRgstrSafes.get(0).getId());
  254. bisInspRsmlRgstrSafeDao.update(bisInspRsmlRgstrSafe);
  255. } else {
  256. bisInspRsmlRgstrSafe.setId(UuidUtil.uuid());
  257. bisInspRsmlRgstrSafeDao.insert(bisInspRsmlRgstrSafe);
  258. }
  259. //更新状态
  260. bisInspRsmlRgstr.setSafeStat("2");
  261. }
  262. }
  263. } else {
  264. BisInspRsmlRgstrSafe bisInspRsmlRgstrSafe = null;
  265. if (bisInspOffLineRsmlRgeister.getBisInspRsmlRgstrSafe() != null) {
  266. bisInspRsmlRgstrSafe = bisInspOffLineRsmlRgeister.getBisInspRsmlRgstrSafe();
  267. //更新状态
  268. bisInspRsmlRgstr.setSafeStat("2");
  269. } else {
  270. bisInspRsmlRgstrSafe = new BisInspRsmlRgstrSafe();
  271. bisInspRsmlRgstr.setSafeStat("1");
  272. }
  273. bisInspRsmlRgstrSafe.setRgstrId(bisInspRsmlRgstr.getRgstrId());
  274. bisInspRsmlRgstrSafe.setId(UuidUtil.uuid());
  275. bisInspRsmlRgstrSafeDao.insert(bisInspRsmlRgstrSafe);
  276. }
  277. }
  278. /**
  279. * 插入运行情况信息
  280. *
  281. * @param bisInspOffLineRsmlRgeister 运行情况信息
  282. * @param bisInspRsmlRgstr
  283. */
  284. public void insertBisInspRsmlRgstrRunManage(BisInspOffLineRsmlRgeister bisInspOffLineRsmlRgeister, BisInspRsmlRgstr bisInspRsmlRgstr, BisInspOffLineRsml bisInspOffLineRsml) {
  285. if (null != bisInspOffLineRsml && StringUtils.isNotBlank(bisInspOffLineRsml.getRgstrId())) {
  286. if (null != bisInspOffLineRsml.getSafeExtManage() && bisInspOffLineRsml.getSafeExtManage()) {
  287. if (null != bisInspOffLineRsmlRgeister.getBisInspRsmlRgstrRunManage()) {
  288. BisInspRsmlRgstrRunManage bisInspRsmlRgstrRunManage = bisInspOffLineRsmlRgeister.getBisInspRsmlRgstrRunManage();
  289. bisInspRsmlRgstrRunManage.setRgstrId(bisInspOffLineRsml.getRgstrId());
  290. //找到对应的ID update
  291. BisInspRsmlRgstrRunManageParam bisInspSafeExtManageParam = new BisInspRsmlRgstrRunManageParam();
  292. bisInspSafeExtManageParam.setRgstrId(bisInspOffLineRsml.getRgstrId());
  293. List<BisInspRsmlRgstrRunManage> bisInspRsmlRgstrRunManages = bisInspRsmlRgstrRunManageDao.findList(bisInspSafeExtManageParam);
  294. if (bisInspRsmlRgstrRunManages != null && bisInspRsmlRgstrRunManages.size() > 0) {
  295. bisInspRsmlRgstrRunManage.setId(bisInspRsmlRgstrRunManages.get(0).getId());
  296. if (null != bisInspOffLineRsml.getSafeExtManage() && bisInspOffLineRsml.getSafeExtManage()) {
  297. bisInspRsmlRgstrRunManageDao.update(bisInspRsmlRgstrRunManage);
  298. }
  299. } else {
  300. bisInspRsmlRgstrRunManage.setId(UuidUtil.uuid());
  301. bisInspRsmlRgstrRunManageDao.insert(bisInspRsmlRgstrRunManage);
  302. }
  303. bisInspRsmlRgstr.setRunManageState("2"); //更新状态
  304. }
  305. }
  306. } else {
  307. BisInspRsmlRgstrRunManage bisInspRsmlRgstrRunManage = null;
  308. if (bisInspOffLineRsmlRgeister.getBisInspRsmlRgstrRunManage() != null) {
  309. bisInspRsmlRgstrRunManage = bisInspOffLineRsmlRgeister.getBisInspRsmlRgstrRunManage();
  310. bisInspRsmlRgstr.setRunManageState("2"); //更新状态
  311. } else {
  312. bisInspRsmlRgstrRunManage = new BisInspRsmlRgstrRunManage();
  313. bisInspRsmlRgstr.setRunManageState("1");
  314. }
  315. bisInspRsmlRgstrRunManage.setRgstrId(bisInspRsmlRgstr.getRgstrId());
  316. bisInspRsmlRgstrRunManage.setId(UuidUtil.uuid());
  317. bisInspRsmlRgstrRunManageDao.insert(bisInspRsmlRgstrRunManage);
  318. }
  319. }
  320. /**
  321. * 插入水库工程实体信息
  322. *
  323. * @param bisInspOffLineRsmlRgeister 三个责任人信息
  324. * @param bisInspRsmlRgstr
  325. */
  326. public void insertBisInspRsmlRgstrProject(BisInspOffLineRsmlRgeister bisInspOffLineRsmlRgeister, BisInspRsmlRgstr bisInspRsmlRgstr, BisInspOffLineRsml bisInspOffLineRsml) {
  327. if (null != bisInspOffLineRsml && StringUtils.isNotBlank(bisInspOffLineRsml.getRgstrId())) {
  328. if (null != bisInspOffLineRsmlRgeister.getBisInspRsmlRgstrProject()) {
  329. BisInspRsmlRgstrProject bisInspRsmlRgstrProject = bisInspOffLineRsmlRgeister.getBisInspRsmlRgstrProject();
  330. bisInspRsmlRgstrProject.setRgstrId(bisInspOffLineRsml.getRgstrId());
  331. //找到对应的ID update
  332. BisInspRsmlRgstrProjectParam bisInspRsmlRgstrProjectParam = new BisInspRsmlRgstrProjectParam();
  333. bisInspRsmlRgstrProjectParam.setRgstrId(bisInspOffLineRsml.getRgstrId());
  334. List<BisInspRsmlRgstrProject> bisInspRsmlRgstrProjects = bisInspRsmlRgstrProjectDao.findList(bisInspRsmlRgstrProjectParam);
  335. if (bisInspRsmlRgstrProjects != null && bisInspRsmlRgstrProjects.size() > 0) {
  336. bisInspRsmlRgstrProject.setId(bisInspRsmlRgstrProjects.get(0).getId());
  337. if (null != bisInspOffLineRsml.getRsvrProject() && bisInspOffLineRsml.getRsvrProject()) {
  338. bisInspRsmlRgstrProjectDao.update(bisInspRsmlRgstrProject);
  339. }
  340. } else {
  341. bisInspRsmlRgstrProject.setId(UuidUtil.uuid());
  342. bisInspRsmlRgstrProjectDao.insert(bisInspRsmlRgstrProject);
  343. }
  344. bisInspRsmlRgstr.setProjectState("2");
  345. }
  346. } else {
  347. BisInspRsmlRgstrProject bisInspRsmlRgstrProject = null;
  348. if (bisInspOffLineRsmlRgeister.getBisInspRsmlRgstrProject() != null) {
  349. bisInspRsmlRgstrProject = bisInspOffLineRsmlRgeister.getBisInspRsmlRgstrProject();//更新状态
  350. bisInspRsmlRgstr.setProjectState("2");
  351. } else {
  352. bisInspRsmlRgstrProject = new BisInspRsmlRgstrProject();
  353. bisInspRsmlRgstr.setProjectState("1");
  354. }
  355. bisInspRsmlRgstrProject.setRgstrId(bisInspRsmlRgstr.getRgstrId());
  356. bisInspRsmlRgstrProject.setId(UuidUtil.uuid());
  357. bisInspRsmlRgstrProjectDao.insert(bisInspRsmlRgstrProject);
  358. }
  359. }
  360. @Override
  361. public BisInspOffLineRetBase getBaseInfo(BisInspOffLine bisInspOffLine) {
  362. BisInspOffLineRetBase bisInspOffLineRetBase = new BisInspOffLineRetBase();
  363. AttRsBaseParam attRsBaseParam = new AttRsBaseParam();
  364. attRsBaseParam.setRsName(bisInspOffLine.getName());
  365. attRsBaseParam.setAdmDiv(AdLevelUtil.getAddvcd(bisInspOffLine.getAddvcd()));
  366. bisInspOffLineRetBase.setBase(attRsBaseDao.findList(attRsBaseParam));
  367. //判断登记表是否有重复对象
  368. List<BisInspRsmlRgstr> bisInspRsmlRgstrs = bisInspRsmlRgstrDao.getRsmlByIdNm(bisInspOffLine.getGroupId(), bisInspOffLine.getName());
  369. if (null != bisInspRsmlRgstrs && bisInspRsmlRgstrs.size() > 0) {
  370. bisInspOffLineRetBase.setRepeat(true);
  371. bisInspOffLineRetBase.setRepeatList(bisInspRsmlRgstrs);
  372. } else {
  373. bisInspOffLineRetBase.setRepeat(false);
  374. }
  375. return bisInspOffLineRetBase;
  376. }
  377. }