From 65ca50935315a89e219b7c974caf95dc28895ffc Mon Sep 17 00:00:00 2001
From: “djh” <“3298565835@qq.com”>
Date: Thu, 16 Oct 2025 08:37:56 +0800
Subject: [PATCH] 修改
---
hazmat-admin/src/main/java/com/gkhy/hazmat/admin/controller/web/HzStatisticController.java | 70 ++++++++++++++++++++++++----------
1 files changed, 49 insertions(+), 21 deletions(-)
diff --git a/hazmat-admin/src/main/java/com/gkhy/hazmat/admin/controller/web/HzStatisticController.java b/hazmat-admin/src/main/java/com/gkhy/hazmat/admin/controller/web/HzStatisticController.java
index de8b68e..a028ae3 100644
--- a/hazmat-admin/src/main/java/com/gkhy/hazmat/admin/controller/web/HzStatisticController.java
+++ b/hazmat-admin/src/main/java/com/gkhy/hazmat/admin/controller/web/HzStatisticController.java
@@ -1,7 +1,9 @@
package com.gkhy.hazmat.admin.controller.web;
+import com.gkhy.hazmat.common.annotation.Anonymous;
import com.gkhy.hazmat.common.api.CommonResult;
+import com.gkhy.hazmat.system.domain.dto.HazmatUseStatisticDTO;
import com.gkhy.hazmat.system.service.HzStatisticService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
@@ -9,6 +11,7 @@
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@@ -31,27 +34,60 @@
private HzStatisticService statisticService;
@ApiOperation(value = "30天入库数量统计")
+ @ApiImplicitParams({
+ @ApiImplicitParam(paramType = "query",name = "companyId",dataType ="long",required = false,value = "公司id")
+ })
@GetMapping("/entryStatistic")
- public CommonResult entryStatistic() {
- return CommonResult.success(statisticService.entryStatic());
+ public CommonResult entryStatistic(Long companyId) {
+ return CommonResult.success(statisticService.entryStatic(companyId));
}
@ApiOperation(value = "一周使用数量统计")
+ @ApiImplicitParams({
+ @ApiImplicitParam(paramType = "query",name = "companyId",dataType ="long",required = false,value = "公司id")
+ })
@GetMapping("/useStatistic")
- public CommonResult useStatistic() {
- return CommonResult.success(statisticService.useEverydayStatic());
+ public CommonResult useStatistic(Long companyId) {
+ return CommonResult.success(statisticService.useEverydayStatic(companyId));
}
+
+ @ApiOperation(value = "大屏一天使用量统计")
+ @ApiImplicitParams({
+ @ApiImplicitParam(paramType = "query",name = "companyId",dataType = "long",required = false,value = "企业ID")
+ })
+ @GetMapping("/dayUseStatistic")
+ @Anonymous
+ public CommonResult dayUseStatistic(Long companyId){
+ return CommonResult.success(statisticService.dayUseStatistic(companyId));
+ }
+
+ @ApiOperation(value = "大屏企业统计")
+ @ApiImplicitParams({
+ @ApiImplicitParam(paramType = "query",name = "type",dataType = "long",required = false,value = "企业类型")
+ })
+ @GetMapping("/companyMessage")
+ public CommonResult companyMessage(Long type){
+ return CommonResult.success(statisticService.companyMessage(type));
+ }
+
+
@ApiOperation(value = "一周使用频繁的危化品数量统计")
+ @ApiImplicitParams({
+ @ApiImplicitParam(paramType = "query",name = "companyId",dataType ="long",required = false,value = "公司id")
+ })
@GetMapping("/maxUseStatistic")
- public CommonResult maxUseStatistic() {
- return CommonResult.success(statisticService.maxUseStatic());
+ public CommonResult maxUseStatistic(Long companyId) {
+ return CommonResult.success(statisticService.maxUseStatic(companyId));
}
@ApiOperation(value = "首页数据统计")
+ @ApiImplicitParams({
+ @ApiImplicitParam(paramType = "query",name = "companyId",dataType ="long",required = false,value = "公司id")
+ })
@GetMapping("/homeDataStatistic")
- public CommonResult homeDataStatistic() {
- return CommonResult.success(statisticService.homeDataStatistic());
+ public CommonResult homeDataStatistic(Long companyId) {
+ return CommonResult.success(statisticService.homeDataStatistic(companyId));
}
@@ -59,25 +95,17 @@
@ApiOperation(value = "危化品使用统计")
@ApiImplicitParams({
@ApiImplicitParam(paramType = "query", name = "pageNum", dataType = "int", required = false, value = "当前页,默认1"),
- @ApiImplicitParam(paramType = "query", name = "pageSize", dataType = "int", required = false, value = "每页数目,默认10"),
- @ApiImplicitParam(paramType = "query", name = "startTime", dataType = "string", required = false, value = "开始时间,格式xxxx-xx-xx 00:00:00"),
- @ApiImplicitParam(paramType = "query", name = "endTime", dataType = "string", required = false, value = "结束时间,格式xxxx-xx-xx 23:59:59")
+ @ApiImplicitParam(paramType = "query", name = "pageSize", dataType = "int", required = false, value = "每页数目,默认10")
})
@GetMapping("/hazmatUseStatistic")
- public CommonResult hazmatUseStatistic(String startTime,String endTime) {
- return CommonResult.success(statisticService.useStatic(startTime,endTime));
+ public CommonResult hazmatUseStatistic(HazmatUseStatisticDTO useStatisticDTO) {
+ return CommonResult.success(statisticService.useStatic(useStatisticDTO));
}
@ApiOperation(value = "危化品使用记录导出")
- @ApiImplicitParams({
- @ApiImplicitParam(paramType = "query", name = "pageNum", dataType = "int", required = false, value = "当前页,默认1"),
- @ApiImplicitParam(paramType = "query", name = "pageSize", dataType = "int", required = false, value = "每页数目,默认10"),
- @ApiImplicitParam(paramType = "query", name = "startTime", dataType = "string", required = false, value = "开始时间,格式xxxx-xx-xx 00:00:00"),
- @ApiImplicitParam(paramType = "query", name = "endTime", dataType = "string", required = false, value = "结束时间,格式xxxx-xx-xx 23:59:59")
- })
@GetMapping("/importBaiscUse")
- public void ImportBasicUse(HttpServletResponse response, String startTime, String endTime) throws IOException {
- statisticService.importBaiscUse(response,startTime,endTime);
+ public void ImportBasicUse(HttpServletResponse response,HazmatUseStatisticDTO useStatisticDTO) throws IOException {
+ statisticService.importBaiscUse(response,useStatisticDTO);
}
}
--
Gitblit v1.9.2