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.PurchaseClosingReport;
import com.yh.saas.plugin.yiliangyiyun.entity.PurchaseReceiptReport;
import com.yh.saas.plugin.yiliangyiyun.entity.SalesClosingReport;
import com.yh.saas.plugin.yiliangyiyun.service.ISalesClosingReportService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 * 销售平仓报表 前端控制器
 * </p>
 *
 * @author Gongdc
 * @since 2021-08-05
 */
@RestController
@RequestMapping("/salesClosingReport")
public class SalesClosingReportController {
    @Autowired
    private ISalesClosingReportService salesClosingReportService;
    /**
     * 销售平仓统计列表
     * @param salesClosingReport
     * @return
     */
    @GetMapping("/selectSalesClosingOrder")
    public Page<SalesClosingReport> selectSalesClosingOrder(SalesClosingReport salesClosingReport){
        return salesClosingReportService.selectSalesClosingOrder(salesClosingReport);
    }

    /**
     * 编辑采购平仓统计
     * @param salesClosingReport
     * @return
     */
    @PostMapping("/api/editSalesCloseReport")
    public String editSalesCloseReport(@RequestBody SalesClosingReport salesClosingReport){
        return salesClosingReportService.editSalesCloseReport(salesClosingReport);
    }
    /**
     * 出纳付款
     * @param salesClosingReport
     * @return
     */
    @PostMapping("/api/payMoney")
    public String payMoney(@RequestBody SalesClosingReport salesClosingReport){
        return salesClosingReportService.payMoney(salesClosingReport);
    }
    /**
     * 出纳收款
     * @param salesClosingReport
     * @return
     */
    @PostMapping("/api/collectMoney")
    public String collectMoney(@RequestBody SalesClosingReport salesClosingReport){
        return salesClosingReportService.collectMoney(salesClosingReport);
    }

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

}

