DataStatisticsController.java 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  1. package com.ruoyi.web.controller.app;
  2. import com.ruoyi.app.domain.request.SearchTimeRangeParam;
  3. import com.ruoyi.app.domain.request.TimeRangeParam;
  4. import com.ruoyi.app.service.IDataStatisticsService;
  5. import com.ruoyi.common.core.controller.BaseController;
  6. import com.ruoyi.common.core.domain.AjaxResult;
  7. import org.springframework.beans.factory.annotation.Autowired;
  8. import org.springframework.security.access.prepost.PreAuthorize;
  9. import org.springframework.validation.annotation.Validated;
  10. import org.springframework.web.bind.annotation.*;
  11. import java.util.HashMap;
  12. /**
  13. * 数据分析Controller
  14. *
  15. * @author coede
  16. * @date 2025-03-28
  17. */
  18. @RestController
  19. @RequestMapping("/app/statistics")
  20. public class DataStatisticsController extends BaseController
  21. {
  22. @Autowired
  23. private IDataStatisticsService dataStatisticsService;
  24. /**
  25. * 获取生产指标信息
  26. */
  27. @PreAuthorize("@ss.hasPermi('app:statistics:getGrodIndicator')")
  28. @GetMapping(value = "/getGrodIndicator")
  29. public AjaxResult getProdIndicator(@Validated TimeRangeParam timeRangeParam)
  30. {
  31. return success(dataStatisticsService.getProdIndicator(timeRangeParam));
  32. }
  33. /**
  34. * 获取供应商供应数量前五排名
  35. */
  36. @PreAuthorize("@ss.hasPermi('app:statistics:getSupplierRank')")
  37. @GetMapping(value = "/getSupplierRank")
  38. public AjaxResult getSupplierRank(@Validated TimeRangeParam timeRangeParam)
  39. {
  40. return success(dataStatisticsService.selectAmountRankByTime(timeRangeParam));
  41. }
  42. /**
  43. * 获取肉商接收数量前五排名
  44. */
  45. @PreAuthorize("@ss.hasPermi('app:statistics:getPurchaserRank')")
  46. @GetMapping(value = "/getPurchaserRank")
  47. public AjaxResult getPurchaserRank(@Validated TimeRangeParam timeRangeParam)
  48. {
  49. return success(dataStatisticsService.selectSaleAmountRankByTime(timeRangeParam));
  50. }
  51. /**
  52. * 根据时间范围获取不同产地供应商供应数量
  53. */
  54. @PreAuthorize("@ss.hasPermi('app:statistics:getOriginAmount')")
  55. @GetMapping(value = "/getOriginAmount")
  56. public AjaxResult getOriginAmount(@Validated TimeRangeParam timeRangeParam)
  57. {
  58. return success(dataStatisticsService.selectOriginAmountByTime(timeRangeParam));
  59. }
  60. /**
  61. * 根据时间范围获取不同去向肉商销售数量
  62. */
  63. @PreAuthorize("@ss.hasPermi('app:statistics:getSaleAmount')")
  64. @GetMapping(value = "/getSaleAmount")
  65. public AjaxResult getSaleAmount(@Validated TimeRangeParam timeRangeParam)
  66. {
  67. return success(dataStatisticsService.selectSaleAmountByTime(timeRangeParam));
  68. }
  69. /**
  70. * 根据时间范围获取不同去向肉商销售数量
  71. */
  72. @PreAuthorize("@ss.hasPermi('app:statistics:getHarmlessAmount')")
  73. @GetMapping(value = "/getHarmlessAmount")
  74. public AjaxResult getHarmlessAmount(@Validated TimeRangeParam timeRangeParam)
  75. {
  76. return success(dataStatisticsService.selectHarmlessSumByTime(timeRangeParam));
  77. }
  78. /**
  79. * 根据获取指定时间范围内每日累计计划屠宰
  80. */
  81. @PreAuthorize("@ss.hasPermi('app:statistics:getEntranceAmountWithTime')")
  82. @GetMapping(value = "/getEntranceAmountWithTime")
  83. public AjaxResult getEntranceAmountWithTime(@Validated TimeRangeParam timeRangeParam)
  84. {
  85. return success(dataStatisticsService.selectEntranceAmountByTime(timeRangeParam));
  86. }
  87. /**
  88. * 获取产出指标信息
  89. */
  90. @PreAuthorize("@ss.hasPermi('app:statistics:getOutputIndicator')")
  91. @GetMapping(value = "/getOutputIndicator")
  92. public AjaxResult getOutputIndicator(@Validated TimeRangeParam timeRangeParam)
  93. {
  94. return success(dataStatisticsService.getOutputIndicator(timeRangeParam));
  95. }
  96. /**
  97. * 获取白条重量统计
  98. */
  99. @PreAuthorize("@ss.hasPermi('app:statistics:getSideWeight')")
  100. @GetMapping(value = "/getSideWeight")
  101. public AjaxResult getSideWeight(@Validated TimeRangeParam timeRangeParam)
  102. {
  103. return success(dataStatisticsService.selectSideWeightByTime(timeRangeParam));
  104. }
  105. /**
  106. * 获取其他产品重量统计
  107. */
  108. @PreAuthorize("@ss.hasPermi('app:statistics:getOtherProductWeight')")
  109. @GetMapping(value = "/getOtherProductWeight")
  110. public AjaxResult getOtherProductWeight(@Validated SearchTimeRangeParam searchTimeRangeParam)
  111. {
  112. return success(dataStatisticsService.selectOtherProductWeightByTime(searchTimeRangeParam));
  113. }
  114. /**
  115. * 获取今日昨日统计
  116. */
  117. @PreAuthorize("@ss.hasPermi('app:statistics:getLatelyIndicator')")
  118. @GetMapping(value = "/getLastestIndicator")
  119. public AjaxResult getLatelyIndicator()
  120. {
  121. return success(dataStatisticsService.getLatelyIndicator());
  122. }
  123. /**
  124. * 获取近七天每日订单量
  125. */
  126. @PreAuthorize("@ss.hasPermi('app:statistics:getWeekEntranceCount')")
  127. @GetMapping(value = "/getWeekEntranceCount")
  128. public AjaxResult getWeekEntranceCount()
  129. {
  130. return success(dataStatisticsService.getWeekEntranceCount());
  131. }
  132. /**
  133. * 获取各部位重量对比情况
  134. */
  135. @PreAuthorize("@ss.hasPermi('app:statistics:getPorkPartWeight')")
  136. @GetMapping(value = "/getPorkPartWeight")
  137. public AjaxResult getPorkPartWeight()
  138. {
  139. return success(dataStatisticsService.getPorkPartWeight());
  140. }
  141. /**
  142. * 获取产地/去向对比情况
  143. */
  144. @PreAuthorize("@ss.hasPermi('app:statistics:getPlaceAmount')")
  145. @GetMapping(value = "/getPlaceAmount")
  146. public AjaxResult getPlaceAmount()
  147. {
  148. return success(dataStatisticsService.getPlaceAmount());
  149. }
  150. }