package com.yh.saas.plugin.yiliangyiyun.controller;


import com.baomidou.mybatisplus.plugins.Page;
import com.yh.saas.plugin.yiliangyiyun.entity.ContractManagementInfo;
import com.yh.saas.plugin.yiliangyiyun.entity.DriverViewInfo;
import com.yh.saas.plugin.yiliangyiyun.entity.PurchaseClosingReport;
import com.yh.saas.plugin.yiliangyiyun.entity.PurchaseReceiptReport;
import com.yh.saas.plugin.yiliangyiyun.service.IPurchaseClosingReportService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 * 采购平仓报表 前端控制器
 * </p>
 *
 * @author Gongdc
 * @since 2021-08-03
 */
@RestController
@RequestMapping("/purchaseClosingReport")
public class PurchaseClosingReportController {
    @Autowired
    private IPurchaseClosingReportService purchaseClosingReportService;
    /**
     * 采购平仓统计列表
     * @param purchaseClosingReport
     * @return
     */
    @GetMapping("/selectPurchaseOrder")
    public Page<PurchaseClosingReport> selectPurchaseOrder(PurchaseClosingReport purchaseClosingReport){
        return purchaseClosingReportService.selectPurchaseOrder(purchaseClosingReport);
    }
    /**
     * 编辑采购平仓统计
     * @param purchaseClosingReport
     * @return
     */
    @PostMapping("/api/editProcurementReceiptReport")
    public String editProcurementReceiptReport(@RequestBody PurchaseClosingReport purchaseClosingReport){
        return purchaseClosingReportService.editProcurementReceiptReport(purchaseClosingReport);
    }
    /**
     * 出纳付款
     * @param purchaseClosingReport
     * @return
     */
    @PostMapping("/api/payMoney")
    public String payMoney(@RequestBody PurchaseClosingReport purchaseClosingReport){
        return purchaseClosingReportService.payMoney(purchaseClosingReport);
    }
    /**
     * 出纳收款
     * @param purchaseClosingReport
     * @return
     */
    @PostMapping("/api/collectMoney")
    public String collectMoney(@RequestBody PurchaseClosingReport purchaseClosingReport){
        return purchaseClosingReportService.collectMoney(purchaseClosingReport);
    }

    /**
     * 审核
     * @param purchaseClosingReport
     * @return
     */
    @PostMapping("/api/examine")
    public String examine(@RequestBody PurchaseClosingReport purchaseClosingReport) {
        return purchaseClosingReportService.examine(purchaseClosingReport);
    }
    /**
     * 合同编号下拉列表
     * @param compId
     * @return
     */
    @GetMapping("/selectContractNoList")
    public List<ContractManagementInfo> selectContractNoList(String compId) {
        return purchaseClosingReportService.selectContractNoList(compId);
    }
    /**
     * 查看
     */
    @GetMapping("/getInfo")
    public PurchaseClosingReport getInfo(@RequestParam String id) {
        return purchaseClosingReportService.getInfo(id);
    }
}

