AnalysisController.java 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. package com.ozs.web.controller.statisticalAnalysis;
  2. import com.ozs.common.annotation.Log;
  3. import com.ozs.common.constant.ModularConstans;
  4. import com.ozs.common.core.controller.BaseController;
  5. import com.ozs.common.core.domain.AjaxResult;
  6. import com.ozs.common.enums.BusinessType;
  7. import com.ozs.common.utils.StringUtils;
  8. import com.ozs.pm.doman.vo.requestVo.PmDemandReqVo;
  9. import com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo;
  10. import com.ozs.pm.service.IPmDemandService;
  11. import io.swagger.annotations.ApiOperation;
  12. import org.springframework.web.bind.annotation.PostMapping;
  13. import org.springframework.web.bind.annotation.RequestBody;
  14. import org.springframework.web.bind.annotation.RequestMapping;
  15. import org.springframework.web.bind.annotation.RestController;
  16. import javax.annotation.Resource;
  17. import java.util.List;
  18. /**
  19. * 统计分析页面控制层
  20. * (需求更新后进行的整理)
  21. *
  22. * @author buzhanyi
  23. */
  24. @RestController
  25. @RequestMapping("/analysis")
  26. public class AnalysisController extends BaseController {
  27. @Resource
  28. private IPmDemandService pmDemandService;
  29. @ApiOperation(value = "需求提报情况")
  30. @PostMapping("/demandSubCount")
  31. @Log(title = ModularConstans.statisticalAnalysis, businessType = BusinessType.QUERY)
  32. public AjaxResult demandSubCount(@RequestBody PmDemandReqVo pmDemandReqVo) {
  33. if (StringUtils.isNull(pmDemandReqVo.getPurchaseDeptId())) {
  34. return error("登录账号的单位 不能为空!");
  35. }
  36. List<StatisticalChartsResVo> resVos = pmDemandService.demandSubCount(pmDemandReqVo);
  37. return success(resVos);
  38. }
  39. @ApiOperation(value = "项目类型情况统计")
  40. @PostMapping("/countByProjectType")
  41. //@PreAuthorize("@ss.hasPermi('statistical:countByProjectType')")
  42. @Log(title = ModularConstans.statisticalAnalysis, businessType = BusinessType.QUERY)
  43. public AjaxResult countByProjectType(@RequestBody PmDemandReqVo pmDemandReqVo) {
  44. if (StringUtils.isNull(pmDemandReqVo.getPurchaseDeptId())) {
  45. return error("登录账号的单位 不能为空!");
  46. }
  47. List<StatisticalChartsResVo> resVos = pmDemandService.countByProjectType(pmDemandReqVo);
  48. return AjaxResult.success(resVos);
  49. }
  50. @ApiOperation(value = "项目属性情况统计")
  51. @PostMapping("/countByProjectAttr")
  52. //@PreAuthorize("@ss.hasPermi('statistical:countByProjectAttr')")
  53. @Log(title = ModularConstans.statisticalAnalysis, businessType = BusinessType.QUERY)
  54. public AjaxResult countByProjectAttr(@RequestBody PmDemandReqVo pmDemandReqVo) {
  55. //按照项目属性统计所有的项目
  56. if (StringUtils.isNull(pmDemandReqVo.getPurchaseDeptId())) {
  57. return error("登录账号的单位 不能为空!");
  58. }
  59. List<StatisticalChartsResVo> resVos = pmDemandService.countByProjectAttr(pmDemandReqVo);
  60. return AjaxResult.success(resVos);
  61. }
  62. @ApiOperation(value = "需采转化情况统计")
  63. @PostMapping("/countByPurchaseChange")
  64. //@PreAuthorize("@ss.hasPermi('statistical:countByPurchaseChange')")
  65. @Log(title = ModularConstans.statisticalAnalysis, businessType = BusinessType.QUERY)
  66. public AjaxResult countByPurchaseChange(@RequestBody PmDemandReqVo pmDemandReqVo) {
  67. if (StringUtils.isNull(pmDemandReqVo.getPurchaseDeptId())) {
  68. return error("登录账号的单位 不能为空!");
  69. }
  70. List<StatisticalChartsResVo> resVos = pmDemandService.countByPurchaseChange(pmDemandReqVo);
  71. return AjaxResult.success(resVos);
  72. }
  73. @ApiOperation(value = "执行滞后分析")
  74. @PostMapping("/countProjectExceed")
  75. //@PreAuthorize("@ss.hasPermi('statistical:countProjectExceed')")
  76. @Log(title = ModularConstans.statisticalAnalysis, businessType = BusinessType.QUERY)
  77. public AjaxResult countProjectExceed(@RequestBody PmDemandReqVo pmDemandReqVo) {
  78. if (StringUtils.isNull(pmDemandReqVo.getPurchaseDeptId())) {
  79. return error("登录账号的单位 不能为空!");
  80. }
  81. return pmDemandService.countProjectExceed(pmDemandReqVo);
  82. }
  83. @ApiOperation(value = "滞后项目时长分析")
  84. @PostMapping("/exceedMarketAnalysis")
  85. //@PreAuthorize("@ss.hasPermi('statistical:exceedMarketAnalysis')")
  86. @Log(title = ModularConstans.statisticalAnalysis, businessType = BusinessType.QUERY)
  87. public AjaxResult exceedMarketAnalysis(@RequestBody PmDemandReqVo pmDemandReqVo) {
  88. //按照滞后时长统计项目数量
  89. //滞后时长包括:滞后1个月以内的采购任务、滞后1至3个月采购任务、滞后3至6个月采购任务、滞后6个月至1年采购任务、滞后1年以上采购任务
  90. if (StringUtils.isNull(pmDemandReqVo.getPurchaseDeptId())) {
  91. return error("登录账号的单位 不能为空!");
  92. }
  93. return pmDemandService.exceedMarketAnalysis(pmDemandReqVo);
  94. }
  95. @ApiOperation(value = "滞后主要直接原因")
  96. @PostMapping("/exceedReason")
  97. //@PreAuthorize("@ss.hasPermi('statistical:exceedReason')")
  98. @Log(title = ModularConstans.statisticalAnalysis, businessType = BusinessType.QUERY)
  99. public AjaxResult exceedReason(@RequestBody PmDemandReqVo pmDemandReqVo) {
  100. //按照滞后时长统计项目数量
  101. //滞后时长包括:滞后1个月以内的采购任务、滞后1至3个月采购任务、滞后3至6个月采购任务、滞后6个月至1年采购任务、滞后1年以上采购任务
  102. if (StringUtils.isNull(pmDemandReqVo.getPurchaseDeptId())) {
  103. return error("登录账号的单位 不能为空!");
  104. }
  105. return pmDemandService.exceedReason(pmDemandReqVo);
  106. }
  107. @ApiOperation(value = "重大规划采购任务专项计划管理情况")
  108. @PostMapping("/countMajorProject")
  109. //@PreAuthorize("@ss.hasPermi('statistical:countMajorProject')")
  110. @Log(title = ModularConstans.statisticalAnalysis, businessType = BusinessType.QUERY)
  111. public AjaxResult countMajorProject(@RequestBody PmDemandReqVo pmDemandReqVo) {
  112. if (StringUtils.isNull(pmDemandReqVo.getPurchaseDeptId())) {
  113. return error("登录账号的单位 不能为空!");
  114. }
  115. return pmDemandService.countMajorProject(pmDemandReqVo);
  116. }
  117. }