package vip.xiaonuo.sale.controller;


import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.github.xiaoymin.knife4j.annotations.ApiSupport;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;
import vip.xiaonuo.common.pojo.CommonResult;
import vip.xiaonuo.sale.entity.SaleDetail;
import vip.xiaonuo.sale.entity.SaleReceive;
import vip.xiaonuo.sale.param.SaleDetailPageParam;
import vip.xiaonuo.sale.param.SaleDetailParam;
import vip.xiaonuo.sale.param.SaleReceiveParam;
import vip.xiaonuo.sale.service.ISaleDetailService;

import java.util.List;

/**
 * <p>
 * 销售信息明细表 前端控制器
 * </p>
 *
 * @author author
 * @since 2024-12-13
 */
@RestController
@Api(tags = "销售信息明细表")
@ApiSupport(author = "wang", order = 1)
@Validated
public class SaleDetailController {

    @Autowired
    private ISaleDetailService detailService;

    @PostMapping("/sale-detail/getList")
    @ApiOperationSupport(order = 1)
    @ApiOperation("客户销售额占比")
    public CommonResult<List<SaleDetail>> getList(@RequestBody SaleDetailParam detailParam) {
        return CommonResult.data(detailService.getList(detailParam));
    }

    @PostMapping("/sale-detail/getList2")
    @ApiOperationSupport(order = 2)
    @ApiOperation("客户销售额明显表")
    public CommonResult<Page<SaleDetail>> getList2(@RequestBody SaleDetailPageParam detailPageParam) {
        return CommonResult.data(detailService.getList2(detailPageParam));
    }
}
