package vip.xiaonuo.purchase.controller;


import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
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.purchase.param.*;
import vip.xiaonuo.purchase.service.IPurchaseOrderService;

import java.util.List;
import java.util.Map;


/**
 * <p>
 * 采购单品价格表 前端控制器
 * </p>
 *
 * @author author
 * @since 2024-11-27
 */
@RequestMapping("/dongShi")
@Api(tags = "董事长控制器")
@RestController
@Validated
public class PurchaseDongShiController {

    @Autowired
    private IPurchaseOrderService purchaseOrderService;

    @ApiOperationSupport(order = 1)
    @ApiOperation("供应链指标卡")
    @PostMapping("/getIndicator")
    public CommonResult<PurchaseAllParam> getIndicator(@RequestBody DongShiPurchaseParam priceParam) {
        return CommonResult.data(purchaseOrderService.getIndicator(priceParam));
    }

    @ApiOperationSupport(order = 1)
    @ApiOperation("采购金额、预付金额详细")
    @PostMapping("/getCaiGouYvFuDetil")
    public CommonResult<List<PurchaseAllParam>> getCaiGouYvFuDetil(@RequestBody DongShiPurchaseParam priceParam) {
        return CommonResult.data(purchaseOrderService.getCaiGouYvFuDetil(priceParam));
    }


    @ApiOperationSupport(order = 1)
    @ApiOperation("采购金额趋势")
    @PostMapping("/getCaiGouYvFuQuShi")
    public CommonResult<List<PurchaseAllParam>> getCaiGouYvFuQuShi(@RequestBody DongShiPurchaseParam priceParam) {
        return CommonResult.data(purchaseOrderService.getCaiGouYvFuQuShi(priceParam));
    }

    @ApiOperationSupport(order = 1)
    @ApiOperation("主要原材料")
    @PostMapping("/getZhuYaoYuanCaiLiao")
    public CommonResult<List<PurchaseYuanCaiLiaoParam> > getZhuYaoYuanCaiLiao(@RequestBody DongShiPurchaseParam priceParam) {
        return CommonResult.data(purchaseOrderService.getZhuYaoYuanCaiLiao(priceParam));
    }
    @ApiOperationSupport(order = 1)
    @ApiOperation("供应商")
    @PostMapping("/getGongYingShang")
    public CommonResult<Page<GongYingShangParam>> getGongYingShang(@RequestBody DongShiPurchaseParam priceParam) {
        return CommonResult.data(purchaseOrderService.getGongYingShang(priceParam));
    }

    @ApiOperationSupport(order = 1)
    @ApiOperation("物料筛选")
    @PostMapping("/getWuLiaoShaiXuan")
    public CommonResult<List<String >> getWuLiaoShaiXuan(@RequestBody DongShiPurchaseParam priceParam) {
        return CommonResult.data(purchaseOrderService.getWuLiaoShaiXuan(priceParam));
    }

    @ApiOperation("库存物料数量金额")
    @PostMapping("/getKuCunWuLiao")
    public CommonResult<List<DongShiKuCunWuliaoVoParam >> getKuCunWuLiao(@RequestBody DongShiKuCunWuliaoParam priceParam) {
        return CommonResult.data(purchaseOrderService.getKuCunWuLiao(priceParam));
    }
}
