zhujie
2025-04-11 52358cd76aee8d5f7edc54e177b6eab0d1f58533
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
84
package com.mzl.flower.web.v2.statisticsAnalysis;
 
 
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.mzl.flower.base.BaseController;
import com.mzl.flower.base.R;
import com.mzl.flower.base.ReturnDataDTO;
import com.mzl.flower.dto.request.statisticAnalysis.FlowerMaterialDTO;
import com.mzl.flower.dto.request.statisticAnalysis.FlowerSaleDTO;
import com.mzl.flower.dto.response.statisticAnalysis.FlowerMaterialStaticVO;
import com.mzl.flower.dto.response.statisticAnalysis.FlowerSaleStatisticVO;
import com.mzl.flower.dto.response.statisticAnalysis.FlowerMaterialVO;
import com.mzl.flower.dto.response.statisticAnalysis.FlowerSaleVO;
import com.mzl.flower.service.statisticsAnalysis.StatisticAnalysisService;
import com.mzl.flower.utils.ConverterUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
 
import javax.servlet.http.HttpServletResponse;
 
 
/**
* @author @TaoJie
* @since 2024-09-25
*/
@RestController
@RequestMapping("/v2/statistic-analysis")
@Api(value = "数据统计与分析", tags = "数据统计与分析")
@Validated
public class StatisticAnalysisController extends BaseController {
 
 
    @Autowired
    private StatisticAnalysisService statisticAnalysisService;
 
    @GetMapping("/flower-material/page")
    @ApiOperation(value = "花材统计-分页", notes = "花材统计-分页")
    public ResponseEntity<ReturnDataDTO<Page<FlowerMaterialVO>>> getFlowerMaterialPage(
            Page page,@Validated FlowerMaterialDTO dto
    ) {
        return returnData(R.SUCCESS.getCode(), ConverterUtil.transPage(statisticAnalysisService.getFlowerMaterialPage(page,dto), FlowerMaterialVO.class));
    }
 
    @GetMapping("/flower-material/statis")
    @ApiOperation(value = "花材统计-统计", notes = "花材统计统计")
    public ResponseEntity<ReturnDataDTO<FlowerMaterialStaticVO>> getFlowerMaterialStatis(@Validated FlowerMaterialDTO dto
    ) {
        return returnData(R.SUCCESS.getCode(), ConverterUtil.transObject(statisticAnalysisService.getFlowerMaterialStatis(dto), FlowerMaterialStaticVO.class));
    }
 
 
    @GetMapping({"/flower-material/export"})
    @ApiOperation(value = "花材统计-导出")
    public void exportFlowerMaterialSales(HttpServletResponse response,@Validated FlowerMaterialDTO dto){
        statisticAnalysisService.exportFlowerMaterialSales(response, dto);
    }
 
 
    @GetMapping("/flower-sale/page")
    @ApiOperation(value = "花材销售统计-分页", notes = "花材销售统计-分页")
    public ResponseEntity<ReturnDataDTO<Page<FlowerSaleVO>>> getFlowerSalePage(Page page, @Validated FlowerSaleDTO dto) {
        return returnData(R.SUCCESS.getCode(), ConverterUtil.transPage(statisticAnalysisService.getFlowerSalePage(page, dto), FlowerSaleVO.class));
    }
 
    @GetMapping("/flower-sale/statistics")
    @ApiOperation(value = "花材销售统计-统计", notes = "花材销售统计")
    public ResponseEntity<ReturnDataDTO<FlowerSaleStatisticVO>> getFlowerSaleStatistics(@Validated FlowerSaleDTO dto) {
        return returnData(R.SUCCESS.getCode(), ConverterUtil.transObject(statisticAnalysisService.getFlowerSaleStatistics(dto), FlowerSaleStatisticVO.class));
    }
 
 
    @GetMapping({"/flower-sale/export"})
    @ApiOperation(value = "花材销售统计-导出")
    public void exportFlowerSales(HttpServletResponse response, @Validated FlowerSaleDTO dto) {
        statisticAnalysisService.exportFlowerSales(response, dto);
    }
 
}