IndustrialLandSupplyController.java 29 KB

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