package com.fjhx.sale.controller.quotation;

import com.fjhx.sale.entity.quotation.dto.QuotationEstimateDto;
import com.fjhx.sale.entity.quotation.vo.QuotationEstimateVo;
import com.fjhx.sale.entity.sale.vo.SaleQuotationVo;
import com.fjhx.sale.service.quotation.QuotationEstimateService;
import org.springframework.beans.factory.annotation.Autowired;
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 java.util.List;


/**
 * <p>
 * 报价评估 前端控制器
 * </p>
 *
 * @author
 * @since 2024-02-04
 */
@RestController
@RequestMapping("/quotationEstimate")
public class QuotationEstimateController {

    @Autowired
    private QuotationEstimateService quotationEstimateService;

    /**
     * 报价评估明细
     */
    @PostMapping("/detail")
    public List<QuotationEstimateVo> detail(@RequestBody QuotationEstimateDto dto) {
        return quotationEstimateService.detail(dto);
    }

    /**
     * 报价评估新增
     */
    @PostMapping("/addOrEdit")
    public void addOrEdit(@RequestBody QuotationEstimateDto quotationEstimateDto) {
        quotationEstimateService.addOrEdit(quotationEstimateDto);
    }

    /**
     * 报价评估新增
     */
    @PostMapping("/submitQuotation")
    public void submitQuotation(@RequestBody QuotationEstimateDto quotationEstimateDto) {
        quotationEstimateService.submitQuotation(quotationEstimateDto.getQuotationId());
    }

    @PostMapping("/printPdf")
    public SaleQuotationVo printPdf(@RequestBody QuotationEstimateDto quotationEstimateDto) {
        return quotationEstimateService.printPdf(quotationEstimateDto);
    }

}
