“djh”
2025-03-05 06af2ffa26ed44bb2a8a60c0618f8d0490fdd6ed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
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.service.HzStatisticService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
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;
 
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
 
/**
 * <p>
 * 统计前端控制器
 * </p>
 *
 * @author kzy
 * @since 2024-06-06 13:53:17
 */
@Api(tags = "统计记录前端控制器")
@RestController
@RequestMapping("/statistic")
public class HzStatisticController {
    @Autowired
    private HzStatisticService statisticService;
 
    @ApiOperation(value = "30天入库数量统计")
    @GetMapping("/entryStatistic")
    public CommonResult entryStatistic() {
        return CommonResult.success(statisticService.entryStatic());
    }
 
    @ApiOperation(value = "一周使用数量统计")
    @GetMapping("/useStatistic")
    public CommonResult useStatistic() {
        return CommonResult.success(statisticService.useEverydayStatic());
    }
 
    @ApiOperation(value = "一周使用频繁的危化品数量统计")
    @GetMapping("/maxUseStatistic")
    public CommonResult maxUseStatistic() {
        return CommonResult.success(statisticService.maxUseStatic());
    }
 
    @ApiOperation(value = "首页数据统计")
    @GetMapping("/homeDataStatistic")
    public CommonResult homeDataStatistic() {
        return CommonResult.success(statisticService.homeDataStatistic());
    }
 
 
 
    @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("/hazmatUseStatistic")
    public CommonResult hazmatUseStatistic(String startTime,String endTime) {
        return CommonResult.success(statisticService.useStatic(startTime,endTime));
    }
 
    @ApiOperation(value = "危化品使用记录导出")
    @ApiImplicitParams({
            @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);
    }
 
}