IndustrialLandSupplyController.java 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657
  1. package platform.modules.government.web;
  2. import com.github.pagehelper.PageInfo;
  3. import org.springframework.beans.factory.annotation.Autowired;
  4. import org.springframework.stereotype.Controller;
  5. import org.springframework.ui.ModelMap;
  6. import org.springframework.web.bind.WebDataBinder;
  7. import org.springframework.web.bind.annotation.*;
  8. import platform.common.Constant;
  9. import platform.common.annotation.OperationLog;
  10. import platform.common.base.controller.BaseController;
  11. import platform.common.base.model.DictionaryItem;
  12. import platform.common.base.service.DictionaryItemService;
  13. import platform.common.exception.BaseException;
  14. import platform.common.util.CommonUtils;
  15. import platform.common.util.ShiroUtils;
  16. import platform.modules.company.dto.LandSupplyApprovalDto;
  17. import platform.modules.government.dto.IndustrialLandSupplyConfigListDto;
  18. import platform.modules.government.dto.IndustrialLandSupplyDto;
  19. import platform.modules.government.dto.IndustrialLandSupplyParam;
  20. import platform.modules.government.entity.IndustrialLandSupplyConfig;
  21. import platform.modules.government.entity.IndustrialLandSupplyConsultation;
  22. import platform.modules.government.entity.IndustrialLandSupplyDetail;
  23. import platform.modules.government.entity.User;
  24. import platform.modules.government.service.IndustrialLandSupplyConfigService;
  25. import platform.modules.government.service.IndustrialLandSupplyConsultationService;
  26. import platform.modules.government.service.IndustrialLandSupplyDetailService;
  27. import platform.modules.government.service.UserService;
  28. import platform.modules.sys.service.ApprovalService;
  29. import platform.modules.sys.web.ResponseMessage;
  30. import javax.servlet.http.HttpServletResponse;
  31. import java.io.IOException;
  32. import java.text.ParseException;
  33. import java.util.List;
  34. import java.util.Objects;
  35. /**
  36. * 产业供地
  37. *
  38. * @Author: huZhiHao
  39. * @Date: 2020/3/5
  40. **/
  41. @Controller
  42. @RequestMapping(value = "/land_supply")
  43. public class IndustrialLandSupplyController extends BaseController {
  44. @Autowired
  45. private IndustrialLandSupplyDetailService industrialLandSupplyDetailService;
  46. @Autowired
  47. private IndustrialLandSupplyConsultationService industrialLandSupplyConsultationService;
  48. @Autowired
  49. private IndustrialLandSupplyConfigService industrialLandSupplyConfigService;
  50. @Autowired
  51. private DictionaryItemService dictionaryItemService;
  52. @Autowired
  53. private ApprovalService approvalService;
  54. @Autowired
  55. private UserService userService;
  56. /**
  57. * @Author: huZhiHao
  58. * @Description: 查看产业供地列表 1 待处理 2 已处理 3 全部
  59. * @Date: 2020/3/7
  60. * @Params: [modelMap, pageNum, param, type]
  61. * @Return: java.lang.String
  62. **/
  63. @OperationLog(value = "查看产业供地列表")
  64. @RequestMapping("/list/{type}")
  65. public String waitIndex(
  66. ModelMap modelMap, @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
  67. IndustrialLandSupplyParam param, @PathVariable("type") String type) throws Exception {
  68. PageInfo<IndustrialLandSupplyDto> pageInfo = industrialLandSupplyDetailService.findPage(pageNum, PAGESIZE, param, type);
  69. log.info("分页查询内容列表结果! pageInfo = {}", pageInfo);
  70. modelMap.put("pageInfo", pageInfo);
  71. modelMap.put("param", param);
  72. modelMap.put("approve_status", param.getApprove_status());
  73. modelMap.put("process_stage", param.getProcess_stage());
  74. modelMap.put("type", type);
  75. modelMap.put("userType", ShiroUtils.getUserType());
  76. List<DictionaryItem> statusList = dictionaryItemService.findListByTypeName(Constant.DictionaryType.INDUSTRIAL_LAND_SUPPLY_APPROVE_STATUS);
  77. modelMap.addAttribute("statusList", statusList);
  78. List<DictionaryItem> stageList = dictionaryItemService.findListByTypeName(Constant.DictionaryType.INDUSTRIAL_LAND_SUPPLY_APPROVE_STAGE);
  79. modelMap.addAttribute("stageList", stageList);
  80. modelMap.addAttribute("canAdd", industrialLandSupplyDetailService.canAdd());
  81. modelMap.addAttribute("userGroupType", industrialLandSupplyDetailService.userGroupType());
  82. return "/admin/government/industrial_land_supply/index";
  83. }
  84. @OperationLog(value = "新增产业供地")
  85. @RequestMapping("/add")
  86. public String add(ModelMap modelMap) {
  87. boolean canAsk = industrialLandSupplyDetailService.canAsk();
  88. modelMap.addAttribute("canAsk", canAsk);
  89. if (canAsk)
  90. modelMap.addAttribute("consulDepartmentList", industrialLandSupplyDetailService.consulDepartmentList());
  91. return "/admin/government/industrial_land_supply/add";
  92. }
  93. @OperationLog(value = "新增产业供地")
  94. @RequestMapping("/save")
  95. @ResponseBody
  96. public ResponseMessage save(IndustrialLandSupplyDetail industrialLandSupplyDetail, @RequestParam("state") String state) {
  97. try {
  98. if (IsTooFrequently()) {
  99. return ResponseMessage.error("操作过于频繁,请稍后再试!");
  100. }
  101. industrialLandSupplyDetailService.save(industrialLandSupplyDetail, state);
  102. } catch (Exception e) {
  103. e.printStackTrace();
  104. return ResponseMessage.error("保存失败!");
  105. }
  106. return ResponseMessage.success("保存成功!");
  107. }
  108. @OperationLog(value = "修改产业供地")
  109. @RequestMapping("/update")
  110. @ResponseBody
  111. public ResponseMessage update(IndustrialLandSupplyDetail industrialLandSupplyDetail, @RequestParam("state") String state) {
  112. try {
  113. if (IsTooFrequently()) {
  114. return ResponseMessage.error("操作过于频繁,请稍后再试!");
  115. }
  116. industrialLandSupplyDetailService.update(industrialLandSupplyDetail, state);
  117. } catch (Exception e) {
  118. e.printStackTrace();
  119. return ResponseMessage.error("保存失败!");
  120. }
  121. return ResponseMessage.success("保存成功!");
  122. }
  123. @OperationLog(value = "查看详情")
  124. @RequestMapping("/detail/{id}")
  125. public String detail(@PathVariable("id") String id, ModelMap modelMap) throws Exception {
  126. log.info("查看详情");
  127. IndustrialLandSupplyDetail entity = industrialLandSupplyDetailService.selectById(id + "");
  128. modelMap.put("data", entity);
  129. modelMap.put("fileUrl", setFileUrl());
  130. modelMap.put("approvalList", approvalService.getApprovalList(entity.getId(), Constant.DictionaryType.INDUSTRIAL_LAND_SUPPLY, Constant.DictionaryType.INDUSTRIAL_LAND_SUPPLY_APPROVE_STATUS));
  131. modelMap.put("detailType", industrialLandSupplyDetailService.detailType());
  132. return "/admin/government/industrial_land_supply/detail";
  133. }
  134. @OperationLog(value = "编辑跳转")
  135. @RequestMapping("/edit/{id}")
  136. public String edit(@PathVariable("id") String id, ModelMap modelMap) throws Exception {
  137. log.info("编辑跳转");
  138. boolean canAsk = industrialLandSupplyDetailService.canAsk();
  139. modelMap.addAttribute("canAsk", canAsk);
  140. IndustrialLandSupplyDetail entity = industrialLandSupplyDetailService.selectById(id + "");
  141. if (canAsk) {
  142. // modelMap.addAttribute("consulDepartmentList", industrialLandSupplyDetailService.consulDepartmentList());
  143. modelMap.addAttribute("consulDepartmentList", entity.getConsulDepartmentList());
  144. }
  145. modelMap.put("data", entity);
  146. modelMap.put("fileUrl", setFileUrl());
  147. //审批列表
  148. modelMap.put("approvalList", approvalService.getApprovalList(entity.getId(), Constant.DictionaryType.INDUSTRIAL_LAND_SUPPLY, Constant.DictionaryType.INDUSTRIAL_LAND_SUPPLY_APPROVE_STATUS));
  149. //咨询列表
  150. IndustrialLandSupplyConsultation industrialLandSupplyConsultation = new IndustrialLandSupplyConsultation();
  151. industrialLandSupplyConsultation.setIndustrial_land_supply_id(id);
  152. industrialLandSupplyConsultation.setDel_flag(false);
  153. List<IndustrialLandSupplyConsultation> industrialLandSupplyConsultationList = industrialLandSupplyConsultationService.findListByWhere(industrialLandSupplyConsultation);
  154. modelMap.put("industrialLandSupplyConsultationList", industrialLandSupplyConsultationList);
  155. return "/admin/government/industrial_land_supply/edit";
  156. }
  157. @OperationLog(value = "删除")
  158. @ResponseBody
  159. @GetMapping(value = "/delete/{id}")
  160. public ResponseMessage delete(@PathVariable("id") String id) {
  161. log.info("删除");
  162. try {
  163. IndustrialLandSupplyDetail industrialLandSupplyDetail = new IndustrialLandSupplyDetail();
  164. industrialLandSupplyDetail.setId(Integer.valueOf(id));
  165. industrialLandSupplyDetail.setDel_flag(true);
  166. industrialLandSupplyDetailService.updateSelective(industrialLandSupplyDetail);
  167. return ResponseMessage.success("删除成功!");
  168. } catch (Exception e) {
  169. e.printStackTrace();
  170. return ResponseMessage.error("删除失败!");
  171. }
  172. }
  173. @OperationLog(value = "审核")
  174. @PostMapping(value = "/approve")
  175. @ResponseBody
  176. public ResponseMessage approve(ModelMap modelMap, LandSupplyApprovalDto approval) {
  177. if (IsTooFrequently()) {
  178. return ResponseMessage.error("操作过于频繁,请稍后再试!");
  179. }
  180. log.info("审核!");
  181. try {
  182. industrialLandSupplyDetailService.updateAttachment(approval);
  183. if (approval.getStatus().equals(Constant.ApproveButtonStatus.APPROVED)) {
  184. //通过
  185. if (industrialLandSupplyDetailService.pass(approval.getApply_id(), approval.getApproval_comment()))
  186. return ResponseMessage.success("操作成功");
  187. } else if (approval.getStatus().equals(Constant.ApproveButtonStatus.REJECT)) {
  188. //退回
  189. if (industrialLandSupplyDetailService.untread(approval.getApply_id(), approval.getApproval_comment()))
  190. return ResponseMessage.success("操作成功");
  191. } else if (approval.getStatus().equals(Constant.ApproveButtonStatus.NOTAPPROVED)) {
  192. //不通过
  193. if (industrialLandSupplyDetailService.refuse(approval.getApply_id(), approval.getApproval_comment()))
  194. return ResponseMessage.success("操作成功");
  195. }
  196. } catch (BaseException e) {
  197. return ResponseMessage.error(e.getMessage());
  198. } catch (Exception e) {
  199. e.getStackTrace();
  200. }
  201. return ResponseMessage.error("操作失败!");
  202. }
  203. @OperationLog(value = "回答咨询页面")
  204. @RequestMapping("/feedback/{id}")
  205. public String feedbackPage(@PathVariable("id") String id, ModelMap modelMap) throws ParseException {
  206. log.info("回答咨询页面");
  207. IndustrialLandSupplyDetail entity = industrialLandSupplyDetailService.selectByIdWithDepartment(id + "");
  208. modelMap.put("data", entity);
  209. modelMap.put("fileUrl", setFileUrl());
  210. return "/admin/government/industrial_land_supply/feedback";
  211. }
  212. @OperationLog(value = "回答咨询附件添加页面")
  213. @GetMapping(value = "/addApplyFile")
  214. public String addApplyFile(ModelMap modelMap, String fileIdName) {
  215. modelMap.put("fileIdName", fileIdName);
  216. modelMap.put("fileUrl", setFileUrl());
  217. return "/admin/government/industrial_land_supply/file_add";
  218. }
  219. @OperationLog(value = "回答咨询")
  220. @RequestMapping("/feedback")
  221. @ResponseBody
  222. public ResponseMessage feedback(IndustrialLandSupplyDetail industrialLandSupplyDetail) {
  223. if (CommonUtils.isNotNull(industrialLandSupplyDetail) && CommonUtils.isNotNull(industrialLandSupplyDetail.getConsultationList())) {
  224. industrialLandSupplyDetailService.saveFeedback(industrialLandSupplyDetail.getConsultationList());
  225. }
  226. return ResponseMessage.success("保存成功!");
  227. }
  228. @OperationLog(value = "咨询汇总页面")
  229. @RequestMapping("/summary/{id}")
  230. public String summaryPage(@PathVariable("id") String id, ModelMap modelMap) throws Exception {
  231. log.info("咨询汇总页面");
  232. IndustrialLandSupplyDetail entity = industrialLandSupplyDetailService.selectById(id + "");
  233. modelMap.put("data", entity);
  234. modelMap.put("fileUrl", setFileUrl());
  235. return "/admin/government/industrial_land_supply/summary";
  236. }
  237. @OperationLog(value = "咨询汇总")
  238. @RequestMapping("/summary")
  239. @ResponseBody
  240. public ResponseMessage summary(IndustrialLandSupplyDetail industrialLandSupplyDetail) {
  241. industrialLandSupplyDetailService.saveSummary(industrialLandSupplyDetail);
  242. return ResponseMessage.success("保存成功!");
  243. }
  244. @OperationLog(value = "预审审核页面")
  245. @RequestMapping("/pre_approve/{id}")
  246. public String preApprovePage(@PathVariable("id") String id, ModelMap modelMap) throws Exception {
  247. log.info("预审审核页面");
  248. IndustrialLandSupplyDetail entity = industrialLandSupplyDetailService.selectById(id + "");
  249. modelMap.put("data", entity);
  250. modelMap.put("fileUrl", setFileUrl());
  251. modelMap.put("approvalList", approvalService.getApprovalList(entity.getId(), Constant.DictionaryType.INDUSTRIAL_LAND_SUPPLY, Constant.DictionaryType.INDUSTRIAL_LAND_SUPPLY_APPROVE_STATUS));
  252. return "/admin/government/industrial_land_supply/pre_approve";
  253. }
  254. @OperationLog(value = "追加咨询页面")
  255. @RequestMapping("/feedback_append/{id}")
  256. public String feedbackAppendPage(@PathVariable("id") String id, ModelMap modelMap) throws Exception {
  257. log.info("追加咨询页面");
  258. boolean canAsk = industrialLandSupplyDetailService.canAsk();
  259. modelMap.addAttribute("canAsk", canAsk);
  260. IndustrialLandSupplyDetail entity = industrialLandSupplyDetailService.selectById(id + "");
  261. if(!Objects.equals(entity.getApprove_status(),Constant.LandSupplyApproveStatus.COMMERCE_PENDING_SUMMARY)){
  262. entity.setApprove_status(Constant.LandSupplyApproveStatus.COMMERCE_PENDING_FEEDBACK);
  263. }
  264. industrialLandSupplyDetailService.updateSelective(entity);
  265. if (canAsk) {
  266. // modelMap.addAttribute("consulDepartmentList", industrialLandSupplyDetailService.consulDepartmentList());
  267. modelMap.addAttribute("consulDepartmentList", entity.getConsulDepartmentList());
  268. }
  269. modelMap.put("data", entity);
  270. modelMap.put("fileUrl", setFileUrl());
  271. //审批列表
  272. modelMap.put("approvalList", approvalService.getApprovalList(entity.getId(), Constant.DictionaryType.INDUSTRIAL_LAND_SUPPLY, Constant.DictionaryType.INDUSTRIAL_LAND_SUPPLY_APPROVE_STATUS));
  273. //咨询列表
  274. IndustrialLandSupplyConsultation industrialLandSupplyConsultation = new IndustrialLandSupplyConsultation();
  275. industrialLandSupplyConsultation.setIndustrial_land_supply_id(id);
  276. industrialLandSupplyConsultation.setDel_flag(false);
  277. List<IndustrialLandSupplyConsultation> industrialLandSupplyConsultationList = industrialLandSupplyConsultationService.findListByWhere(industrialLandSupplyConsultation);
  278. modelMap.put("industrialLandSupplyConsultationList", industrialLandSupplyConsultationList);
  279. return "/admin/government/industrial_land_supply/feedback_append";
  280. }
  281. @OperationLog(value = "追加咨询")
  282. @RequestMapping("/feedback_append")
  283. @ResponseBody
  284. public ResponseMessage feedbackAppend(IndustrialLandSupplyDetail industrialLandSupplyDetail) throws Exception {
  285. String message = industrialLandSupplyDetailService.saveFeedbackAppend(industrialLandSupplyDetail);
  286. if (CommonUtils.isNotNull(message)) {
  287. return ResponseMessage.error(message);
  288. }
  289. return ResponseMessage.success("保存成功!");
  290. }
  291. @OperationLog(value = "撤回咨询页面")
  292. @RequestMapping("/feedback_withdraw/{id}")
  293. public String withdrawPage(@PathVariable("id") String id, ModelMap modelMap) throws Exception {
  294. log.info("撤回咨询页面");
  295. IndustrialLandSupplyDetail entity = industrialLandSupplyDetailService.selectById(id);
  296. modelMap.put("data", entity);
  297. modelMap.put("fileUrl", setFileUrl());
  298. return "/admin/government/industrial_land_supply/feedback_withdraw";
  299. }
  300. @OperationLog(value = "撤回咨询")
  301. @ResponseBody
  302. @GetMapping(value = "/withdraw_consul/{id}")
  303. public ResponseMessage withdraw(@PathVariable("id") String id) {
  304. log.info("撤回咨询");
  305. try {
  306. industrialLandSupplyDetailService.withDrawConsul(id);
  307. return ResponseMessage.success("撤回成功!");
  308. } catch (Exception e) {
  309. e.printStackTrace();
  310. return ResponseMessage.error("撤回失败!");
  311. }
  312. }
  313. @OperationLog(value = "撤回申请")
  314. @ResponseBody
  315. @GetMapping(value = "/withdraw_apply/{id}")
  316. public ResponseMessage withdrawApply(@PathVariable("id") String id) {
  317. log.info("撤回申请");
  318. try {
  319. industrialLandSupplyDetailService.withdrawApply(id);
  320. return ResponseMessage.success("删除成功!");
  321. } catch (Exception e) {
  322. e.printStackTrace();
  323. return ResponseMessage.error("删除失败!");
  324. }
  325. }
  326. @OperationLog(value = "商务业务员审核属地页面")
  327. @RequestMapping("/commerce_approve/{id}")
  328. public String commerceApprovePage(@PathVariable("id") String id, ModelMap modelMap) throws Exception {
  329. log.info("商务业务员审核属地页面");
  330. boolean canAsk = industrialLandSupplyDetailService.canAsk();
  331. modelMap.addAttribute("canAsk", canAsk);
  332. if (canAsk)
  333. modelMap.addAttribute("consulDepartmentList", industrialLandSupplyDetailService.consulDepartmentList());
  334. IndustrialLandSupplyDetail entity = industrialLandSupplyDetailService.selectById(id + "");
  335. modelMap.put("data", entity);
  336. modelMap.put("fileUrl", setFileUrl());
  337. //审批列表
  338. modelMap.put("approvalList", approvalService.getApprovalList(entity.getId(), Constant.DictionaryType.INDUSTRIAL_LAND_SUPPLY, Constant.DictionaryType.INDUSTRIAL_LAND_SUPPLY_APPROVE_STATUS));
  339. //咨询列表
  340. IndustrialLandSupplyConsultation industrialLandSupplyConsultation = new IndustrialLandSupplyConsultation();
  341. industrialLandSupplyConsultation.setIndustrial_land_supply_id(id);
  342. industrialLandSupplyConsultation.setDel_flag(false);
  343. List<IndustrialLandSupplyConsultation> industrialLandSupplyConsultationList = industrialLandSupplyConsultationService.findListByWhere(industrialLandSupplyConsultation);
  344. modelMap.put("industrialLandSupplyConsultationList", industrialLandSupplyConsultationList);
  345. Integer userId = entity.getCreate_by();
  346. User user = userService.getUser(userId);
  347. modelMap.put("createUserType", user.getUser_type() + "");
  348. return "/admin/government/industrial_land_supply/commerce_approve";
  349. }
  350. @OperationLog(value = "商务业务员审核属地")
  351. @RequestMapping("/commerce_approve")
  352. @ResponseBody
  353. public ResponseMessage commerceApprove(IndustrialLandSupplyDetail industrialLandSupplyDetail) {
  354. try {
  355. if (IsTooFrequently()) {
  356. return ResponseMessage.error("操作过于频繁,请稍后再试!");
  357. }
  358. industrialLandSupplyDetailService.commerceApprove(industrialLandSupplyDetail);
  359. } catch (Exception e) {
  360. e.printStackTrace();
  361. return ResponseMessage.error("保存失败!");
  362. }
  363. return ResponseMessage.success("保存成功!");
  364. }
  365. @OperationLog(value = "跳转分发页面")
  366. @RequestMapping("/distribute/{id}")
  367. public String distributePage(@PathVariable("id") String id, ModelMap modelMap) throws Exception {
  368. log.info("跳转分发页面");
  369. IndustrialLandSupplyDetail entity = industrialLandSupplyDetailService.selectById(id + "");
  370. modelMap.put("data", entity);
  371. modelMap.put("fileUrl", setFileUrl());
  372. modelMap.put("approvalList", approvalService.getApprovalList(entity.getId(), Constant.DictionaryType.INDUSTRIAL_LAND_SUPPLY, Constant.DictionaryType.INDUSTRIAL_LAND_SUPPLY_APPROVE_STATUS));
  373. modelMap.addAttribute("distDepartmentList", industrialLandSupplyDetailService.distDepartmentList());
  374. return "/admin/government/industrial_land_supply/distribute";
  375. }
  376. @OperationLog(value = "分发")
  377. @RequestMapping("/distribute")
  378. @ResponseBody
  379. public ResponseMessage distribute(IndustrialLandSupplyDetail industrialLandSupplyDetail) {
  380. try {
  381. if (IsTooFrequently()) {
  382. return ResponseMessage.error("操作过于频繁,请稍后再试!");
  383. }
  384. industrialLandSupplyDetailService.distribute(industrialLandSupplyDetail);
  385. } catch (Exception e) {
  386. e.printStackTrace();
  387. return ResponseMessage.error("保存失败!");
  388. }
  389. return ResponseMessage.success("保存成功!");
  390. }
  391. @OperationLog(value = "跳转分发反馈页面")
  392. @RequestMapping("/distribute_feedback/{id}")
  393. public String distributeFeedbackPage(@PathVariable("id") String id, ModelMap modelMap) throws ParseException {
  394. log.info("跳转分发反馈页面");
  395. IndustrialLandSupplyDetail entity = industrialLandSupplyDetailService.selectByIdWithDepartment(id + "");
  396. modelMap.put("data", entity);
  397. modelMap.put("fileUrl", setFileUrl());
  398. modelMap.put("approvalList", approvalService.getApprovalList(entity.getId(), Constant.DictionaryType.INDUSTRIAL_LAND_SUPPLY, Constant.DictionaryType.INDUSTRIAL_LAND_SUPPLY_APPROVE_STATUS));
  399. modelMap.addAttribute("distDepartmentList", industrialLandSupplyDetailService.distDepartmentList());
  400. modelMap.addAttribute("departmentFile", industrialLandSupplyDetailService.getAllDepartmentFile(id));
  401. return "/admin/government/industrial_land_supply/distribute_feedback";
  402. }
  403. @OperationLog(value = "分发反馈")
  404. @RequestMapping("/distribute_feedback")
  405. @ResponseBody
  406. public ResponseMessage distributeFeedback(IndustrialLandSupplyDetail industrialLandSupplyDetail) {
  407. try {
  408. if (IsTooFrequently()) {
  409. return ResponseMessage.error("操作过于频繁,请稍后再试!");
  410. }
  411. industrialLandSupplyDetailService.distributeFeedback(industrialLandSupplyDetail.getDistributionList());
  412. } catch (Exception e) {
  413. e.printStackTrace();
  414. return ResponseMessage.error("保存失败!");
  415. }
  416. return ResponseMessage.success("保存成功!");
  417. }
  418. @OperationLog(value = "跳转分发汇总")
  419. @RequestMapping("/distribute_summary/{id}")
  420. public String distributeSummaryPage(@PathVariable("id") String id, ModelMap modelMap) throws Exception {
  421. log.info("跳转分发汇总");
  422. IndustrialLandSupplyDetail entity = industrialLandSupplyDetailService.selectById(id + "");
  423. modelMap.put("data", entity);
  424. modelMap.put("fileUrl", setFileUrl());
  425. modelMap.put("approvalList", approvalService.getApprovalList(entity.getId(), Constant.DictionaryType.INDUSTRIAL_LAND_SUPPLY, Constant.DictionaryType.INDUSTRIAL_LAND_SUPPLY_APPROVE_STATUS));
  426. return "/admin/government/industrial_land_supply/distribute_summary";
  427. }
  428. @OperationLog(value = "分发汇总")
  429. @RequestMapping("/distribute_summary")
  430. @ResponseBody
  431. public ResponseMessage distributeSummary(IndustrialLandSupplyDetail industrialLandSupplyDetail) {
  432. try {
  433. if (IsTooFrequently()) {
  434. return ResponseMessage.error("操作过于频繁,请稍后再试!");
  435. }
  436. industrialLandSupplyDetailService.distributeSummary(industrialLandSupplyDetail);
  437. } catch (Exception e) {
  438. e.printStackTrace();
  439. return ResponseMessage.error("保存失败!");
  440. }
  441. return ResponseMessage.success("保存成功!");
  442. }
  443. @OperationLog(value = "跳转供地审核")
  444. @RequestMapping("/land_approve/{id}")
  445. public String landApprovePage(@PathVariable("id") String id, ModelMap modelMap) throws Exception {
  446. log.info("跳转供地审核");
  447. IndustrialLandSupplyDetail entity = industrialLandSupplyDetailService.selectById(id + "");
  448. modelMap.put("data", entity);
  449. modelMap.put("fileUrl", setFileUrl());
  450. modelMap.put("approvalList", approvalService.getApprovalList(entity.getId(), Constant.DictionaryType.INDUSTRIAL_LAND_SUPPLY, Constant.DictionaryType.INDUSTRIAL_LAND_SUPPLY_APPROVE_STATUS));
  451. return "/admin/government/industrial_land_supply/land_approve";
  452. }
  453. @OperationLog(value = "跳转行政反馈")
  454. @RequestMapping("/xingzheng_feedback/{id}")
  455. public String gsFeedbackPage(@PathVariable("id") String id, ModelMap modelMap) throws Exception {
  456. log.info("跳转行政反馈");
  457. IndustrialLandSupplyDetail entity = industrialLandSupplyDetailService.selectById(id + "");
  458. modelMap.put("data", entity);
  459. modelMap.put("fileUrl", setFileUrl());
  460. modelMap.put("approvalList", approvalService.getApprovalList(entity.getId(), Constant.DictionaryType.INDUSTRIAL_LAND_SUPPLY, Constant.DictionaryType.INDUSTRIAL_LAND_SUPPLY_APPROVE_STATUS));
  461. return "/admin/government/industrial_land_supply/xingzheng_feedback";
  462. }
  463. @OperationLog(value = "行政反馈")
  464. @RequestMapping("/xingzheng_feedback")
  465. @ResponseBody
  466. public ResponseMessage gsFeedbackPage(IndustrialLandSupplyDetail industrialLandSupplyDetail) {
  467. try {
  468. if (IsTooFrequently()) {
  469. return ResponseMessage.error("操作过于频繁,请稍后再试!");
  470. }
  471. industrialLandSupplyDetailService.gsFeedback(industrialLandSupplyDetail);
  472. } catch (Exception e) {
  473. e.printStackTrace();
  474. return ResponseMessage.error("保存失败!");
  475. }
  476. return ResponseMessage.success("保存成功!");
  477. }
  478. @OperationLog(value = "跳转行政反馈")
  479. @RequestMapping("/xingzheng_feedback_view/{id}")
  480. public String gsFeedbackViewPage(@PathVariable("id") String id, ModelMap modelMap) throws Exception {
  481. log.info("跳转行政反馈");
  482. IndustrialLandSupplyDetail entity = industrialLandSupplyDetailService.selectById(id + "");
  483. modelMap.put("data", entity);
  484. modelMap.put("fileUrl", setFileUrl());
  485. modelMap.put("approvalList", approvalService.getApprovalList(entity.getId(), Constant.DictionaryType.INDUSTRIAL_LAND_SUPPLY, Constant.DictionaryType.INDUSTRIAL_LAND_SUPPLY_APPROVE_STATUS));
  486. return "/admin/government/industrial_land_supply/xingzheng_feedback_view";
  487. }
  488. //导出会签单
  489. @RequestMapping("/management_committee_leader_export/{id}")
  490. public void managementCommitteeLeaderExport(@PathVariable("id") int id, HttpServletResponse response) throws Exception {
  491. industrialLandSupplyDetailService.exportCountersignWord2(id, response);
  492. }
  493. // @RequestMapping("/management_committee_leader_export/{id}")
  494. // public void managementCommitteeLeaderExport(@PathVariable("id") String id, HttpServletResponse response) throws IOException {
  495. //
  496. // ExportWord ew = new ExportWord();
  497. // XWPFDocument document = ew.createXWPFDocument(10, 6);
  498. // List<List<Object>> list = new ArrayList<List<Object>>();
  499. //
  500. // List<Object> tempList = new ArrayList<Object>();
  501. // tempList.add("姓名");
  502. // tempList.add("黄xx");
  503. // tempList.add("性别");
  504. // tempList.add("男");
  505. // tempList.add("出生日期");
  506. // tempList.add("2018-10-10");
  507. // list.add(tempList);
  508. // tempList = new ArrayList<Object>();
  509. // tempList.add("身份证号");
  510. // tempList.add("36073xxxxxxxxxxx");
  511. // list.add(tempList);
  512. // tempList = new ArrayList<Object>();
  513. // tempList.add("出生地");
  514. // tempList.add("江西");
  515. // tempList.add("名族");
  516. // tempList.add("汉");
  517. // tempList.add("婚否");
  518. // tempList.add("否");
  519. // list.add(tempList);
  520. // tempList = new ArrayList<Object>();
  521. // tempList.add("既往病史");
  522. // tempList.add("无");
  523. // list.add(tempList);
  524. //
  525. // Map<String, Object> dataList = new HashMap<String, Object>();
  526. // dataList.put("TITLE", "个人体检表");
  527. // dataList.put("TABLEDATA", list);
  528. //
  529. // response.reset();
  530. // response.setContentType("application/octet-stream; charset=utf-8");
  531. // response.setHeader("Content-Disposition", "attachment; filename=" + URLEncoder.encode("word测试.docx", "UTF-8"));
  532. //
  533. // ew.exportCheckWord(dataList, document, response);
  534. // System.out.println("文档生成成功");
  535. // }
  536. @OperationLog(value = "跳转配置页面")
  537. @RequestMapping("/config")
  538. public String config(ModelMap modelMap) {
  539. log.info("跳转配置页面");
  540. List<IndustrialLandSupplyConfig> industrialLandSupplyConfigList = industrialLandSupplyConfigService.findAll();
  541. modelMap.put("list", industrialLandSupplyConfigList);
  542. return "/admin/government/industrial_land_supply/config";
  543. }
  544. @OperationLog(value = "新增产业供地")
  545. @RequestMapping("/config/save")
  546. @ResponseBody
  547. public ResponseMessage configSave(IndustrialLandSupplyConfigListDto industrialLandSupplyConfigListDto) {
  548. try {
  549. industrialLandSupplyConfigService.saveConfigList(industrialLandSupplyConfigListDto.getConfigList());
  550. } catch (Exception e) {
  551. e.printStackTrace();
  552. return ResponseMessage.error("保存失败!");
  553. }
  554. return ResponseMessage.success("保存成功!");
  555. }
  556. /**
  557. * 由于Spring在接受前台传入的List时,就会出现256的IndexOutOfBoundsException异常
  558. * 设置setAutoGrowCollectionLimit为1024
  559. *
  560. * @param binder
  561. * @see [类、类#方法、类#成员]
  562. */
  563. @InitBinder
  564. public void initListBinder(WebDataBinder binder) {
  565. // 设置需要包裹的元素个数,默认为256
  566. binder.setAutoGrowCollectionLimit(3000);
  567. }
  568. }