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()); } }