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

import java.util.List;

/**
 * <p>
 * 汽运结算报表 前端控制器
 * </p>
 *
 * @author Gongdc
 * @since 2021-08-27
 */
@RestController
    @RequestMapping("/tranSettlementReport")
public class TranSettlementReportController {
    @Autowired
    private ITranSettlementReportService tranSettlementReportService;
    /**
     * 汽运结算统计报表
     * @param tranSettlementReport
     * @return
     */
    @GetMapping("/selectTranSettlementReport")
    public Page<TranSettlementReport> selectTranSettlementReport(TranSettlementReport tranSettlementReport){
        return tranSettlementReportService.selectTranSettlementReport(tranSettlementReport);
    }

    /**
     * 修改结算重量\扣款\已开发票
     * @param tranSettlementReport
     * @return
     */
    @PostMapping("/api/editTranSettlementReport")
    public String editTranSettlementReport(@RequestBody TranSettlementReport tranSettlementReport){
        return tranSettlementReportService.editTranSettlementReport(tranSettlementReport);
    }

    /**
     * 合同编号下拉列表
     * @param compId
     * @return
     */
    @GetMapping("/selectContractNoList")
    public List<ContractManagementInfo> selectContractNoList(String compId) {
        return tranSettlementReportService.selectContractNoList(compId);
    }

    /**
     * 出纳付款
     * @param
     * @return
     */
    @PostMapping("/api/payMoney")
    public String payMoney(@RequestBody TranSettlementReport tranSettlementReport){
        return tranSettlementReportService.payMoney(tranSettlementReport);
    }

    /**
     * 批量开发票
     * @param tranSettlementReport
     * @return
     */
    @PostMapping("/api/openInvoiceList")
    public String openInvoiceList(@RequestBody TranSettlementReport tranSettlementReport) {
        return tranSettlementReportService.openInvoiceList(tranSettlementReport);
    }
    /**
     * 查看
     */
    @GetMapping("/getInfo")
    public TranSettlementReport getInfo(@RequestParam String id) {
        return tranSettlementReportService.getInfo(id);
    }
}

