123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173 |
- package com.ruoyi.web.controller.app;
- import com.ruoyi.app.domain.request.SearchTimeRangeParam;
- import com.ruoyi.app.domain.request.TimeRangeParam;
- import com.ruoyi.app.service.IDataStatisticsService;
- import com.ruoyi.common.core.controller.BaseController;
- import com.ruoyi.common.core.domain.AjaxResult;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.security.access.prepost.PreAuthorize;
- import org.springframework.validation.annotation.Validated;
- import org.springframework.web.bind.annotation.*;
- import java.util.HashMap;
- /**
- * 数据分析Controller
- *
- * @author coede
- * @date 2025-03-28
- */
- @RestController
- @RequestMapping("/app/statistics")
- public class DataStatisticsController extends BaseController
- {
- @Autowired
- private IDataStatisticsService dataStatisticsService;
- /**
- * 获取生产指标信息
- */
- @PreAuthorize("@ss.hasPermi('app:statistics:getGrodIndicator')")
- @GetMapping(value = "/getGrodIndicator")
- public AjaxResult getProdIndicator(@Validated TimeRangeParam timeRangeParam)
- {
- return success(dataStatisticsService.getProdIndicator(timeRangeParam));
- }
- /**
- * 获取供应商供应数量前五排名
- */
- @PreAuthorize("@ss.hasPermi('app:statistics:getSupplierRank')")
- @GetMapping(value = "/getSupplierRank")
- public AjaxResult getSupplierRank(@Validated TimeRangeParam timeRangeParam)
- {
- return success(dataStatisticsService.selectAmountRankByTime(timeRangeParam));
- }
- /**
- * 获取肉商接收数量前五排名
- */
- @PreAuthorize("@ss.hasPermi('app:statistics:getPurchaserRank')")
- @GetMapping(value = "/getPurchaserRank")
- public AjaxResult getPurchaserRank(@Validated TimeRangeParam timeRangeParam)
- {
- return success(dataStatisticsService.selectSaleAmountRankByTime(timeRangeParam));
- }
- /**
- * 根据时间范围获取不同产地供应商供应数量
- */
- @PreAuthorize("@ss.hasPermi('app:statistics:getOriginAmount')")
- @GetMapping(value = "/getOriginAmount")
- public AjaxResult getOriginAmount(@Validated TimeRangeParam timeRangeParam)
- {
- return success(dataStatisticsService.selectOriginAmountByTime(timeRangeParam));
- }
- /**
- * 根据时间范围获取不同去向肉商销售数量
- */
- @PreAuthorize("@ss.hasPermi('app:statistics:getSaleAmount')")
- @GetMapping(value = "/getSaleAmount")
- public AjaxResult getSaleAmount(@Validated TimeRangeParam timeRangeParam)
- {
- return success(dataStatisticsService.selectSaleAmountByTime(timeRangeParam));
- }
- /**
- * 根据时间范围获取不同去向肉商销售数量
- */
- @PreAuthorize("@ss.hasPermi('app:statistics:getHarmlessAmount')")
- @GetMapping(value = "/getHarmlessAmount")
- public AjaxResult getHarmlessAmount(@Validated TimeRangeParam timeRangeParam)
- {
- return success(dataStatisticsService.selectHarmlessSumByTime(timeRangeParam));
- }
- /**
- * 根据获取指定时间范围内每日累计计划屠宰
- */
- @PreAuthorize("@ss.hasPermi('app:statistics:getEntranceAmountWithTime')")
- @GetMapping(value = "/getEntranceAmountWithTime")
- public AjaxResult getEntranceAmountWithTime(@Validated TimeRangeParam timeRangeParam)
- {
- return success(dataStatisticsService.selectEntranceAmountByTime(timeRangeParam));
- }
- /**
- * 获取产出指标信息
- */
- @PreAuthorize("@ss.hasPermi('app:statistics:getOutputIndicator')")
- @GetMapping(value = "/getOutputIndicator")
- public AjaxResult getOutputIndicator(@Validated TimeRangeParam timeRangeParam)
- {
- return success(dataStatisticsService.getOutputIndicator(timeRangeParam));
- }
- /**
- * 获取白条重量统计
- */
- @PreAuthorize("@ss.hasPermi('app:statistics:getSideWeight')")
- @GetMapping(value = "/getSideWeight")
- public AjaxResult getSideWeight(@Validated TimeRangeParam timeRangeParam)
- {
- return success(dataStatisticsService.selectSideWeightByTime(timeRangeParam));
- }
- /**
- * 获取其他产品重量统计
- */
- @PreAuthorize("@ss.hasPermi('app:statistics:getOtherProductWeight')")
- @GetMapping(value = "/getOtherProductWeight")
- public AjaxResult getOtherProductWeight(@Validated SearchTimeRangeParam searchTimeRangeParam)
- {
- return success(dataStatisticsService.selectOtherProductWeightByTime(searchTimeRangeParam));
- }
- /**
- * 获取今日昨日统计
- */
- @PreAuthorize("@ss.hasPermi('app:statistics:getLatelyIndicator')")
- @GetMapping(value = "/getLastestIndicator")
- public AjaxResult getLatelyIndicator()
- {
- return success(dataStatisticsService.getLatelyIndicator());
- }
- /**
- * 获取近七天每日订单量
- */
- @PreAuthorize("@ss.hasPermi('app:statistics:getWeekEntranceCount')")
- @GetMapping(value = "/getWeekEntranceCount")
- public AjaxResult getWeekEntranceCount()
- {
- return success(dataStatisticsService.getWeekEntranceCount());
- }
- /**
- * 获取各部位重量对比情况
- */
- @PreAuthorize("@ss.hasPermi('app:statistics:getPorkPartWeight')")
- @GetMapping(value = "/getPorkPartWeight")
- public AjaxResult getPorkPartWeight()
- {
- return success(dataStatisticsService.getPorkPartWeight());
- }
- /**
- * 获取产地/去向对比情况
- */
- @PreAuthorize("@ss.hasPermi('app:statistics:getPlaceAmount')")
- @GetMapping(value = "/getPlaceAmount")
- public AjaxResult getPlaceAmount()
- {
- return success(dataStatisticsService.getPlaceAmount());
- }
- }
|