陶杰
2024-09-27 43d728030dca41209677b0a7e314de2ce0a21aa9
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
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.config.exception.ValidationException;
import com.mzl.flower.dto.request.coupon.CreateCouponRecordDTO;
import com.mzl.flower.dto.request.coupon.QueryCouponRecordDTO;
import com.mzl.flower.dto.request.payment.OrderItemSalesQueryDTO;
import com.mzl.flower.dto.request.report.QueryOrderDTO;
import com.mzl.flower.dto.response.coupon.CouponRecordResultVO;
import com.mzl.flower.dto.response.coupon.CouponRecordVO;
import com.mzl.flower.dto.response.report.OrderReportResultVO;
import com.mzl.flower.entity.coupon.CouponRecordDO;
import com.mzl.flower.entity.coupon.CouponTemplateDO;
import com.mzl.flower.enums.CouponStatusEnum;
import com.mzl.flower.service.coupon.CouponRecordService;
import com.mzl.flower.service.coupon.CouponTemplateService2;
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.apache.commons.lang3.StringUtils;
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, 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(QueryOrderDTO dto
    ) {
        return returnData(R.SUCCESS.getCode(), ConverterUtil.transObject(orderReportService.getSaleStatis(dto), OrderReportResultVO.class));
    }
 
 
    @GetMapping({"/sale/export"})
    @ApiOperation(value = "报告列表导出")
    public void exportSales(HttpServletResponse response, QueryOrderDTO dto){
        orderReportService.exportSalesList(response, dto);
    }
 
}