cloudroam
2025-01-07 1d0fc6126fb664e81a1a3737d8eaf4a618e7cb0f
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
package com.mzl.flower.web.v2.report;
 
 
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.report.QueryOrderDTO;
import com.mzl.flower.dto.request.report.QueryPartnerOrderDTO;
import com.mzl.flower.dto.request.report.QuerySupplierDTO;
import com.mzl.flower.dto.response.report.OrderDetailReportResultVO;
import com.mzl.flower.dto.response.report.OrderReportResultVO;
import com.mzl.flower.dto.response.report.OrderSupplierReportResultVO;
import com.mzl.flower.service.report.OrderReportService;
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.*;
 
import javax.servlet.http.HttpServletResponse;
 
 
/**
* @author @TaoJie
* @since 2024-09-25
*/
@RestController
@RequestMapping("/v2/report/order")
@Api(value = "报表-订单", tags = "报表-订单")
@Validated
public class OrderReportController extends BaseController {
 
 
    @Autowired
    private OrderReportService orderReportService;
 
    @GetMapping("/sale/page")
    @ApiOperation(value = "查询-分页", notes = "查询-分页")
    public ResponseEntity<ReturnDataDTO<Page<OrderReportResultVO>>> page(
            Page page,@Validated QueryOrderDTO dto
    ) {
        return returnData(R.SUCCESS.getCode(), ConverterUtil.transPage(orderReportService.getSalePage(page,dto), OrderReportResultVO.class));
    }
 
    @GetMapping("/sale/statis")
    @ApiOperation(value = "统计", notes = "统计")
    public ResponseEntity<ReturnDataDTO<OrderReportResultVO>> statis(@Validated QueryOrderDTO dto
    ) {
        return returnData(R.SUCCESS.getCode(), ConverterUtil.transObject(orderReportService.getSaleStatis(dto), OrderReportResultVO.class));
    }
 
 
    @GetMapping({"/sale/export"})
    @ApiOperation(value = "报告列表导出")
    public void exportSales(HttpServletResponse response,@Validated QueryOrderDTO dto){
        orderReportService.exportSalesList(response, dto);
    }
 
    @GetMapping("/detail/page")
    @ApiOperation(value = "查询-分页", notes = "查询-分页")
    public ResponseEntity<ReturnDataDTO<Page<OrderDetailReportResultVO>>> detail(Page page, QueryOrderDTO dto) {
        return returnData(R.SUCCESS.getCode(), orderReportService.getOrderDetailPage(page, dto));
    }
 
    @GetMapping("/detail/export")
    @ApiOperation(value = "订单结算明细导出")
    public void exportOrderDetail(HttpServletResponse response, QueryOrderDTO queryOrderDTO) {
        orderReportService.exportOrderDetail(response, queryOrderDTO);
    }
 
 
    @GetMapping("/partner/sale/page")
    @ApiOperation(value = "合伙人-查询-分页", notes = "合伙人-查询-分页")
    public ResponseEntity<ReturnDataDTO<Page<OrderReportResultVO>>> getPartnerPage(
            Page page,@Validated QueryPartnerOrderDTO dto
    ) {
        return returnData(R.SUCCESS.getCode(), orderReportService.getPartnerSalePage(page,dto));
    }
 
    @GetMapping("/partner/sale/statis")
    @ApiOperation(value = "合伙人-查询-统计", notes = "合伙人-查询-统计")
    public ResponseEntity<ReturnDataDTO<Page<OrderReportResultVO>>> getPartnerPageStatis(@Validated QueryPartnerOrderDTO dto
    ) {
        return returnData(R.SUCCESS.getCode(), orderReportService.getPartnerSaleStatis(dto));
    }
 
    @GetMapping({"/partner/sale/export"})
    @ApiOperation(value = "合伙人报告列表导出")
    public void partnerExportSales(HttpServletResponse response,@Validated QueryPartnerOrderDTO dto){
        orderReportService.exportPartnerSalesList(response, dto);
    }
 
    /**
     * 花农结算报表
     */
    @GetMapping("/supplier/page")
    @ApiOperation(value = "花农结算报表-分页", notes = "花农结算报表-分页")
    public ResponseEntity<ReturnDataDTO<Page<OrderSupplierReportResultVO>>> supplier(Page page, QuerySupplierDTO dto) {
        return returnData(R.SUCCESS.getCode(), orderReportService.getOrderSupplierPage(page, dto));
    }
 
    @GetMapping("/supplier/count")
    @ApiOperation(value = "花农结算报表-统计", notes = "花农结算报表-统计")
    public ResponseEntity<ReturnDataDTO<Page<OrderSupplierReportResultVO>>> supplierCount(QuerySupplierDTO dto) {
        return returnData(R.SUCCESS.getCode(), orderReportService.getOrderSupplierClout(dto));
    }
 
    @GetMapping({"/supplier/export"})
    @ApiOperation(value = "花农结算报表导出")
    public void supplierExports(HttpServletResponse response, QuerySupplierDTO dto) {
        orderReportService.exportSupplierList(response, dto);
    }
 
 
}