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.StockSaleReceiptReport;
import com.yh.saas.plugin.yiliangyiyun.service.IStockSaleReceiptReportService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 * 现货销售入库报表 前端控制器
 * </p>
 *
 * @author Gdc
 * @since 2021-09-22
 */
@RestController
@RequestMapping("/stockSaleReceiptReport")
public class StockSaleReceiptReportController {

    @Autowired
    private IStockSaleReceiptReportService stockSaleReceiptReportService;

    /**
     * 销售出库统计列表
     * @param stockSaleReceiptReport
     * @return
     */
    @GetMapping("/selectSaleOrder")
    Page<StockSaleReceiptReport> selectSaleOrder(StockSaleReceiptReport stockSaleReceiptReport){
        return stockSaleReceiptReportService.selectSaleOrder(stockSaleReceiptReport);
    }


    /**
     * 定金/备注
     *
     * @param contractManagementInfo
     * @return
     */
    @PostMapping("/api/disAndRemark")
    public String disAndRemark(@RequestBody ContractManagementInfo contractManagementInfo){
        return stockSaleReceiptReportService.disAndRemark(contractManagementInfo);
    }


    /**
     * 修改结算重量
     *
     * @param stockSaleReceiptReport
     * @return
     */
    @PostMapping("/api/editSettlementWeight")
    public String editSettlementWeight(@RequestBody StockSaleReceiptReport stockSaleReceiptReport){
        return stockSaleReceiptReportService.editSettlementWeight(stockSaleReceiptReport);
    }


    /**
     * 出纳收款
     * @param stockSaleReceiptReport
     * @return
     */
    @PostMapping("/api/collectMoney")
    public String collectMoney(@RequestBody StockSaleReceiptReport stockSaleReceiptReport){
        return stockSaleReceiptReportService.collectMoney(stockSaleReceiptReport);
    }

    /**
     * 合同编号下拉列表
     * @param compId
     * @return
     */
    @GetMapping("/selectContractNoList")
    public List<ContractManagementInfo> selectContractNoList(String compId) {
        return stockSaleReceiptReportService.selectContractNoList(compId);
    }
    /**
     * 批量开发票
     * @param stockSaleReceiptReport
     * @return
     */
    @PostMapping("/api/openInvoiceList")
    public String openInvoiceList(@RequestBody StockSaleReceiptReport stockSaleReceiptReport) {
        return stockSaleReceiptReportService.openInvoiceList(stockSaleReceiptReport);
    }
}

