BmDeptPlanController.java 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. package com.ruoyi.web.controller.project;
  2. import java.util.List;
  3. import java.util.Map;
  4. import com.ruoyi.common.annotation.RepeatSubmit;
  5. import com.ruoyi.system.domain.project.BmDeptPlan;
  6. import com.ruoyi.system.domain.vo.BmDeptPlanVo;
  7. import com.ruoyi.system.service.project.IBmDeptPlanService;
  8. import org.springframework.security.access.prepost.PreAuthorize;
  9. import org.springframework.beans.factory.annotation.Autowired;
  10. import org.springframework.web.bind.annotation.GetMapping;
  11. import org.springframework.web.bind.annotation.PostMapping;
  12. import org.springframework.web.bind.annotation.PutMapping;
  13. import org.springframework.web.bind.annotation.DeleteMapping;
  14. import org.springframework.web.bind.annotation.PathVariable;
  15. import org.springframework.web.bind.annotation.RequestBody;
  16. import org.springframework.web.bind.annotation.RequestMapping;
  17. import org.springframework.web.bind.annotation.RestController;
  18. import com.ruoyi.common.annotation.Log;
  19. import com.ruoyi.common.core.controller.BaseController;
  20. import com.ruoyi.common.core.domain.AjaxResult;
  21. import com.ruoyi.common.enums.BusinessType;
  22. import com.ruoyi.common.utils.poi.ExcelUtil;
  23. import com.ruoyi.common.core.page.TableDataInfo;
  24. /**
  25. * 部门招商计划Controller
  26. *
  27. * @author ruoyi
  28. * @date 2021-03-09
  29. */
  30. @RestController
  31. @RequestMapping("/deptPlan/plan")
  32. public class BmDeptPlanController extends BaseController {
  33. @Autowired
  34. private IBmDeptPlanService bmDeptPlanService;
  35. /**
  36. * 查询 部门招商计划列表
  37. */
  38. @PreAuthorize("@ss.hasPermi('deptPlan:Plan:list')")
  39. @GetMapping("/list")
  40. public TableDataInfo list(BmDeptPlan bmDeptPlan) {
  41. startPage();
  42. List<BmDeptPlan> list = bmDeptPlanService.selectBmDeptPlanList(bmDeptPlan);
  43. return getDataTable(list);
  44. }
  45. /**
  46. * 导出 部门招商计划列表
  47. */
  48. @PreAuthorize("@ss.hasPermi('deptPlan:Plan:export')")
  49. @Log(title = " 部门招商计划", businessType = BusinessType.EXPORT)
  50. @GetMapping("/export")
  51. public AjaxResult export(BmDeptPlan bmDeptPlan) {
  52. List<BmDeptPlan> list = bmDeptPlanService.selectBmDeptPlanList(bmDeptPlan);
  53. ExcelUtil<BmDeptPlan> util = new ExcelUtil<BmDeptPlan>(BmDeptPlan.class);
  54. return util.exportExcel(list, "Plan");
  55. }
  56. /**
  57. * 获取 部门招商计划详细信息
  58. */
  59. @PreAuthorize("@ss.hasPermi('deptPlan:Plan:query')")
  60. @GetMapping(value = "/{id}")
  61. public AjaxResult getInfo(@PathVariable("id") Long id) {
  62. return AjaxResult.success(bmDeptPlanService.selectBmDeptPlanById(id));
  63. }
  64. /**
  65. * 新增 部门招商计划
  66. */
  67. @PreAuthorize("@ss.hasPermi('deptPlan:Plan:add')")
  68. @Log(title = " 部门招商计划", businessType = BusinessType.INSERT)
  69. @PostMapping
  70. @RepeatSubmit
  71. public AjaxResult add(@RequestBody BmDeptPlan bmDeptPlan) {
  72. return toAjax(bmDeptPlanService.insertBmDeptPlan(bmDeptPlan));
  73. }
  74. /**
  75. * 修改 部门招商计划
  76. */
  77. @PreAuthorize("@ss.hasPermi('deptPlan:Plan:edit')")
  78. @Log(title = " 部门招商计划", businessType = BusinessType.UPDATE)
  79. @PutMapping
  80. public AjaxResult edit(@RequestBody BmDeptPlan bmDeptPlan) {
  81. return toAjax(bmDeptPlanService.updateBmDeptPlan(bmDeptPlan));
  82. }
  83. /**
  84. * 删除 部门招商计划
  85. */
  86. @PreAuthorize("@ss.hasPermi('deptPlan:Plan:remove')")
  87. @Log(title = " 部门招商计划", businessType = BusinessType.DELETE)
  88. @DeleteMapping("/{ids}")
  89. public AjaxResult remove(@PathVariable Long[] ids) {
  90. return toAjax(bmDeptPlanService.deleteBmDeptPlanByIds(ids));
  91. }
  92. /**
  93. * 首页-单位榜单
  94. */
  95. @PreAuthorize("@ss.hasPermi('deptPlan:Plan:unitList')")
  96. @Log(title = " 单位榜单", businessType = BusinessType.INSERT)
  97. @PostMapping("/unitList")
  98. public TableDataInfo unitList() {
  99. List<BmDeptPlanVo> bmDeptPlanVos = bmDeptPlanService.selectUnitList();
  100. return getDataTable(bmDeptPlanVos);
  101. }
  102. /**
  103. * 首页-单位榜单资金
  104. */
  105. @PreAuthorize("@ss.hasPermi('deptPlan:Plan:unitAmountList')")
  106. @Log(title = " 单位榜单资金", businessType = BusinessType.INSERT)
  107. @PostMapping("/unitAmountList")
  108. public TableDataInfo unitAmountList() {
  109. List<BmDeptPlanVo> bmDeptPlanVos = bmDeptPlanService.selectUnitAmountList();
  110. return getDataTable(bmDeptPlanVos);
  111. }
  112. /**
  113. * 统计分析-合同金额
  114. */
  115. @PreAuthorize("@ss.hasPermi('deptPlan:Plan:totAmtList')")
  116. @Log(title = " 统计分析-合同金额", businessType = BusinessType.INSERT)
  117. @PostMapping("/totAmtList")
  118. public TableDataInfo totAmtList() {
  119. List<BmDeptPlanVo> bmDeptPlanVos = bmDeptPlanService.selectTotAmtList();
  120. return getDataTable(bmDeptPlanVos);
  121. }
  122. /**
  123. * 统计分析-在建项目-柱状图
  124. */
  125. @GetMapping("/projectUnitAmountEharts")
  126. public AjaxResult projectUnitAmountEharts(String year) {
  127. Map<String, Object> map = bmDeptPlanService.selectProjectUnitAmountEharts(year);
  128. return AjaxResult.success(map);
  129. }
  130. /**
  131. * 统计分析-入归榜单
  132. */
  133. //@PreAuthorize("@ss.hasPermi('deptPlan:Plan:totAmtList')")
  134. @PostMapping("/investmentList")
  135. public TableDataInfo investmentList() {
  136. List<BmDeptPlanVo> bmDeptPlanVos = bmDeptPlanService.selectInvestmentList();
  137. return getDataTable(bmDeptPlanVos);
  138. }
  139. /**
  140. * 统计分析-投产项目-柱状图
  141. */
  142. @GetMapping("/projectInvestmentEharts")
  143. public AjaxResult projectInvestmentEharts(String year) {
  144. Map<String, Object> map = bmDeptPlanService.selectProjectInvestmentEharts(year);
  145. return AjaxResult.success(map);
  146. }
  147. }