AnalysisController.java 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298
  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. import java.util.Map;
  19. /**
  20. * 统计分析页面控制层
  21. * (需求更新后进行的整理)
  22. *
  23. * @author buzhanyi
  24. */
  25. @RestController
  26. @RequestMapping("/analysis")
  27. public class AnalysisController extends BaseController {
  28. @Resource
  29. private IPmDemandService pmDemandService;
  30. @ApiOperation(value = "采购管理部门“执行率”、“规划执行率”、“完成率”、“滞后率”、“偏差率”、“流废标率”统计")
  31. @PostMapping("/demandZGWZPL")
  32. @Log(title = ModularConstans.statisticalAnalysis, businessType = BusinessType.QUERY)
  33. public AjaxResult demandZGWZPL(@RequestBody PmDemandReqVo pmDemandReqVo) {
  34. if (StringUtils.isNull(pmDemandReqVo.getPurchaseDeptId())) {
  35. return error("登录账号的单位 不能为空!");
  36. }
  37. Map<String, String> maps = pmDemandService.demandZGWZPL(pmDemandReqVo);
  38. return success(maps);
  39. }
  40. @ApiOperation(value = "需求提报情况")
  41. @PostMapping("/demandSubCount")
  42. //@PreAuthorize("@ss.hasPermi('statistical:demandSubCount')")
  43. @Log(title = ModularConstans.statisticalAnalysis, businessType = BusinessType.QUERY)
  44. public AjaxResult demandSubCount(@RequestBody PmDemandReqVo pmDemandReqVo) {
  45. if (StringUtils.isNull(pmDemandReqVo.getPurchaseDeptId())) {
  46. return error("登录账号的单位 不能为空!");
  47. }
  48. List<StatisticalChartsResVo> resVos = pmDemandService.demandSubCount(pmDemandReqVo);
  49. return success(resVos);
  50. }
  51. @ApiOperation(value = "项目类型情况统计")
  52. @PostMapping("/countByProjectType")
  53. //@PreAuthorize("@ss.hasPermi('statistical:countByProjectType')")
  54. @Log(title = ModularConstans.statisticalAnalysis, businessType = BusinessType.QUERY)
  55. public AjaxResult countByProjectType(@RequestBody PmDemandReqVo pmDemandReqVo) {
  56. if (StringUtils.isNull(pmDemandReqVo.getPurchaseDeptId())) {
  57. return error("登录账号的单位 不能为空!");
  58. }
  59. List<StatisticalChartsResVo> resVos = pmDemandService.countByProjectType(pmDemandReqVo);
  60. return AjaxResult.success(resVos);
  61. }
  62. @ApiOperation(value = "项目属性情况统计")
  63. @PostMapping("/countByProjectAttr")
  64. //@PreAuthorize("@ss.hasPermi('statistical:countByProjectAttr')")
  65. @Log(title = ModularConstans.statisticalAnalysis, businessType = BusinessType.QUERY)
  66. public AjaxResult countByProjectAttr(@RequestBody PmDemandReqVo pmDemandReqVo) {
  67. //按照项目属性统计所有的项目
  68. if (StringUtils.isNull(pmDemandReqVo.getPurchaseDeptId())) {
  69. return error("登录账号的单位 不能为空!");
  70. }
  71. return AjaxResult.success(pmDemandService.countByProjectAttr(pmDemandReqVo));
  72. }
  73. @ApiOperation(value = "任务属性分布")
  74. @PostMapping("/countByTaskAttr")
  75. //@PreAuthorize("@ss.hasPermi('statistical:countByProjectAttr')")
  76. @Log(title = ModularConstans.statisticalAnalysis, businessType = BusinessType.QUERY)
  77. public AjaxResult countByTaskAttr(@RequestBody PmDemandReqVo pmDemandReqVo) {
  78. //按照项目属性统计所有的项目
  79. if (StringUtils.isNull(pmDemandReqVo.getPurchaseDeptId())) {
  80. return error("登录账号的单位 不能为空!");
  81. }
  82. return AjaxResult.success(pmDemandService.countByTaskAttr(pmDemandReqVo));
  83. }
  84. @ApiOperation(value = "需采转化情况统计")
  85. @PostMapping("/countByPurchaseChange")
  86. //@PreAuthorize("@ss.hasPermi('statistical:countByPurchaseChange')")
  87. @Log(title = ModularConstans.statisticalAnalysis, businessType = BusinessType.QUERY)
  88. public AjaxResult countByPurchaseChange(@RequestBody PmDemandReqVo pmDemandReqVo) {
  89. if (StringUtils.isNull(pmDemandReqVo.getPurchaseDeptId())) {
  90. return error("登录账号的单位 不能为空!");
  91. }
  92. List<StatisticalChartsResVo> resVos = pmDemandService.countByPurchaseChange(pmDemandReqVo);
  93. return AjaxResult.success(resVos);
  94. }
  95. @ApiOperation(value = "执行滞后分析")
  96. @PostMapping("/countProjectExceed")
  97. //@PreAuthorize("@ss.hasPermi('statistical:countProjectExceed')")
  98. @Log(title = ModularConstans.statisticalAnalysis, businessType = BusinessType.QUERY)
  99. public AjaxResult countProjectExceed(@RequestBody PmDemandReqVo pmDemandReqVo) {
  100. if (StringUtils.isNull(pmDemandReqVo.getPurchaseDeptId())) {
  101. return error("登录账号的单位 不能为空!");
  102. }
  103. return pmDemandService.countProjectExceed(pmDemandReqVo);
  104. }
  105. @ApiOperation(value = "滞后项目时长分析")
  106. @PostMapping("/exceedMarketAnalysis")
  107. //@PreAuthorize("@ss.hasPermi('statistical:exceedMarketAnalysis')")
  108. @Log(title = ModularConstans.statisticalAnalysis, businessType = BusinessType.QUERY)
  109. public AjaxResult exceedMarketAnalysis(@RequestBody PmDemandReqVo pmDemandReqVo) {
  110. //按照滞后时长统计项目数量
  111. //滞后时长包括:滞后1个月以内的采购任务、滞后1至3个月采购任务、滞后3至6个月采购任务、滞后6个月至1年采购任务、滞后1年以上采购任务
  112. if (StringUtils.isNull(pmDemandReqVo.getPurchaseDeptId())) {
  113. return error("登录账号的单位 不能为空!");
  114. }
  115. return pmDemandService.exceedMarketAnalysis(pmDemandReqVo);
  116. }
  117. @ApiOperation(value = "滞后主要直接原因")
  118. @PostMapping("/exceedReason")
  119. //@PreAuthorize("@ss.hasPermi('statistical:exceedReason')")
  120. @Log(title = ModularConstans.statisticalAnalysis, businessType = BusinessType.QUERY)
  121. public AjaxResult exceedReason(@RequestBody PmDemandReqVo pmDemandReqVo) {
  122. //按照滞后时长统计项目数量
  123. //滞后时长包括:滞后1个月以内的采购任务、滞后1至3个月采购任务、滞后3至6个月采购任务、滞后6个月至1年采购任务、滞后1年以上采购任务
  124. if (StringUtils.isNull(pmDemandReqVo.getPurchaseDeptId())) {
  125. return error("登录账号的单位 不能为空!");
  126. }
  127. return pmDemandService.exceedReason(pmDemandReqVo);
  128. }
  129. @ApiOperation(value = "重大规划采购任务专项计划管理情况")
  130. @PostMapping("/countMajorProject")
  131. //@PreAuthorize("@ss.hasPermi('statistical:countMajorProject')")
  132. @Log(title = ModularConstans.statisticalAnalysis, businessType = BusinessType.QUERY)
  133. public AjaxResult countMajorProject(@RequestBody PmDemandReqVo pmDemandReqVo) {
  134. if (StringUtils.isNull(pmDemandReqVo.getPurchaseDeptId())) {
  135. return error("登录账号的单位 不能为空!");
  136. }
  137. return pmDemandService.countMajorProject(pmDemandReqVo);
  138. }
  139. @ApiOperation(value = "采购任务受领")
  140. @PostMapping("/countPurTask")
  141. //@PreAuthorize("@ss.hasPermi('statistical:countPurTask')")
  142. @Log(title = ModularConstans.statisticalAnalysis, businessType = BusinessType.QUERY)
  143. public AjaxResult countPurTask(@RequestBody PmDemandReqVo pmDemandReqVo) {
  144. if (StringUtils.isNull(pmDemandReqVo.getPurchaseDeptId())) {
  145. return error("登录账号的单位 不能为空!");
  146. }
  147. return pmDemandService.countPurTask(pmDemandReqVo);
  148. }
  149. @ApiOperation(value = "任务受领数量/预算金额(万元)")
  150. @PostMapping("/purchaseProjectNumberAnalysis")
  151. //@PreAuthorize("@ss.hasPermi('statistical:purchaseProjectNumberAnalysis')")
  152. @Log(title = ModularConstans.statisticalAnalysis, businessType = BusinessType.QUERY)
  153. public AjaxResult purchaseProjectNumberAnalysis(@RequestBody PmDemandReqVo pmDemandReqVo) {
  154. // 需求单位可查看本单位及其下属单位的统计数据
  155. if (StringUtils.isNull(pmDemandReqVo.getPurchaseDeptId())) {
  156. return error("登录账号的单位 不能为空!");
  157. }
  158. if (StringUtils.isNull(pmDemandReqVo.getTimeType())) {
  159. return error("统计时间类型不能为空, 1:年度,2:季度,3:月份!");
  160. }
  161. List<Map<String, String>> map = pmDemandService.purchaseProjectNumberAnalysis(pmDemandReqVo);
  162. return success(map);
  163. }
  164. @ApiOperation(value = "采购方式分布")
  165. @PostMapping("/countByPurchaseMode")
  166. //@PreAuthorize("@ss.hasPermi('statistical:countByPurchaseMode')")
  167. @Log(title = ModularConstans.statisticalAnalysis, businessType = BusinessType.QUERY)
  168. public AjaxResult countByPurchaseMode(@RequestBody PmDemandReqVo pmDemandReqVo) {
  169. //按照采购方式统计所有的项目
  170. if (StringUtils.isNull(pmDemandReqVo.getPurchaseDeptId())) {
  171. return error("登录账号的单位 不能为空!");
  172. }
  173. List<StatisticalChartsResVo> resVos = pmDemandService.countByPurchaseMode(pmDemandReqVo);
  174. return AjaxResult.success(resVos);
  175. }
  176. @ApiOperation(value = "任务金额分布")
  177. @PostMapping("/countByEvaluation")
  178. //@PreAuthorize("@ss.hasPermi('statistical:purchaseProjectExecute')")
  179. @Log(title = ModularConstans.statisticalAnalysis, businessType = BusinessType.QUERY)
  180. public AjaxResult countByEvaluation(@RequestBody PmDemandReqVo pmDemandReqVo) {
  181. //按照概算金额统计所有的项目
  182. //概算金额包括:100万以下采购任务、100至500万元采购任务、500至1000万元采购任务、1000至5000万元采购任务、5000至1亿元采购任务、1亿元及以上采购任务
  183. if (StringUtils.isNull(pmDemandReqVo.getPurchaseDeptId())) {
  184. return error("登录账号的单位 不能为空!");
  185. }
  186. List<StatisticalChartsResVo> resVos = pmDemandService.countByEvaluation(pmDemandReqVo);
  187. return AjaxResult.success(resVos);
  188. }
  189. @ApiOperation(value = "任务执行进度")
  190. @PostMapping("/purchaseProjectExecute")
  191. //@PreAuthorize("@ss.hasPermi('statistical:purchaseProjectExecute')")
  192. @Log(title = ModularConstans.statisticalAnalysis, businessType = BusinessType.QUERY)
  193. public AjaxResult purchaseProjectExecute(@RequestBody PmDemandReqVo pmDemandReqVo) {
  194. // 需求单位可查看本单位及其下属单位的统计数据
  195. if (StringUtils.isNull(pmDemandReqVo.getPurchaseDeptId())) {
  196. return error("登录账号的单位 不能为空!");
  197. }
  198. List<StatisticalChartsResVo> resVos = pmDemandService.purchaseProjectExecute(pmDemandReqVo);
  199. return AjaxResult.success(resVos);
  200. }
  201. @ApiOperation(value = "新完成采购任务数量")
  202. @PostMapping("/purchaseTaskFinish")
  203. //@PreAuthorize("@ss.hasPermi('statistical:purchaseTaskFinish')")
  204. @Log(title = ModularConstans.statisticalAnalysis, businessType = BusinessType.QUERY)
  205. public AjaxResult purchaseTaskFinish(@RequestBody PmDemandReqVo pmDemandReqVo) {
  206. // 需求单位可查看本单位及其下属单位的统计数据
  207. if (StringUtils.isNull(pmDemandReqVo.getPurchaseDeptId())) {
  208. return error("登录账号的单位 不能为空!");
  209. }
  210. if (StringUtils.isNull(pmDemandReqVo.getTimeType())) {
  211. return error("统计时间类型不能为空, 1:年度,2:季度,3:月份!");
  212. }
  213. List<Map<String, Integer>> map = pmDemandService.purchaseTaskFinish(pmDemandReqVo);
  214. return success(map);
  215. }
  216. @ApiOperation(value = "各阶段采购任务数量分布")
  217. @PostMapping("/countEveryStatusNum")
  218. //@PreAuthorize("@ss.hasPermi('statistical:countEveryStatusNum')")
  219. @Log(title = ModularConstans.statisticalAnalysis, businessType = BusinessType.QUERY)
  220. public AjaxResult countEveryStatusNum(@RequestBody PmDemandReqVo pmDemandReqVo) {
  221. if (StringUtils.isNull(pmDemandReqVo.getPurchaseDeptId())) {
  222. return error("登录账号的单位 不能为空!");
  223. }
  224. return pmDemandService.countEveryStatusNumThisYear(pmDemandReqVo);
  225. }
  226. @ApiOperation(value = "滞后直接原因")
  227. @PostMapping("/exceedReasonZj")
  228. //@PreAuthorize("@ss.hasPermi('statistical:exceedReasonZj')")
  229. @Log(title = ModularConstans.statisticalAnalysis, businessType = BusinessType.QUERY)
  230. public AjaxResult exceedReasonZj(@RequestBody PmDemandReqVo pmDemandReqVo) {
  231. //按照滞后时长统计项目数量
  232. //滞后时长包括:滞后1个月以内的采购任务、滞后1至3个月采购任务、滞后3至6个月采购任务、滞后6个月至1年采购任务、滞后1年以上采购任务
  233. if (StringUtils.isNull(pmDemandReqVo.getPurchaseDeptId())) {
  234. return error("登录账号的单位 不能为空!");
  235. }
  236. return pmDemandService.exceedReasonZj(pmDemandReqVo);
  237. }
  238. @ApiOperation(value = "重大规划采购任务专项计划管理情况")
  239. @PostMapping("/countMajorProjectCGB")
  240. //@PreAuthorize("@ss.hasPermi('statistical:countMajorProjectCGB')")
  241. @Log(title = ModularConstans.statisticalAnalysis, businessType = BusinessType.QUERY)
  242. public AjaxResult countMajorProjectCGB(@RequestBody PmDemandReqVo pmDemandReqVo) {
  243. if (StringUtils.isNull(pmDemandReqVo.getPurchaseDeptId())) {
  244. return error("登录账号的单位 不能为空!");
  245. }
  246. return pmDemandService.countMajorProjectCGB(pmDemandReqVo);
  247. }
  248. @ApiOperation(value = "新增执行滞后采购任务数量分析")
  249. @PostMapping("/countMajorProjectNumCGB")
  250. //@PreAuthorize("@ss.hasPermi('statistical:countMajorProjectNumCGB')")
  251. @Log(title = ModularConstans.statisticalAnalysis, businessType = BusinessType.QUERY)
  252. public AjaxResult countMajorProjectNumCGB(@RequestBody PmDemandReqVo pmDemandReqVo) {
  253. if (StringUtils.isNull(pmDemandReqVo.getPurchaseDeptId())) {
  254. return error("登录账号的单位 不能为空!");
  255. }
  256. return pmDemandService.countMajorProjectNumCGB(pmDemandReqVo);
  257. }
  258. @ApiOperation(value = "滞留环节")
  259. @PostMapping("/exceedLink")
  260. //@PreAuthorize("@ss.hasPermi('statistical:exceedLink')")
  261. @Log(title = ModularConstans.statisticalAnalysis, businessType = BusinessType.QUERY)
  262. public AjaxResult exceedLink(@RequestBody PmDemandReqVo pmDemandReqVo) {
  263. // 超过计划完成采购时间的各状态数量及占比统计,包括:采购需求对接、采购文件编制审核、标签质疑投诉、待开标/流废标处置、标后质疑
  264. if (StringUtils.isNull(pmDemandReqVo.getPurchaseDeptId())) {
  265. return error("登录账号的单位 不能为空!");
  266. }
  267. return pmDemandService.exceedLink(pmDemandReqVo);
  268. }
  269. }