package com.jwipc.inquiry.controller.rest;

import com.jwipc.inquiry.dto.InquiryMaterialSupplierDTO;
import com.jwipc.inquiry.dto.InquirySupplierCostQuoteDetailDTO;
import com.jwipc.inquiry.logic.InquirySupplierCostQuoteDetailLogic;
import com.jwipc.security.LoginUtil;
import lombok.RequiredArgsConstructor;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Objects;

import static com.jwipc.inquiry.constant.ModuleConst.MODULE_ROOT;

/**
 * <p>
 * 询价供应商成本报价明细 前端控制器
 * </p>
 *
 * @author shenyang.ou
 * @since 2024-02-23
 */
@RestController
@RequestMapping(MODULE_ROOT+ "/supplier/cost/quote/detail/rest")
@RequiredArgsConstructor
public class InquirySupplierCostQuoteDetailRestController {
    private final InquirySupplierCostQuoteDetailLogic inquirySupplierCostQuoteDetailLogic;

    /**
     * 获取供应商成本报价列表
     * @param inquiryMaterialSupplierId 询价物料供应商id
     * @param costTemplateCode 成本构成模板
     * @return 供应商成本报价列表
     */
    @RequestMapping("/listByInquiryMaterialSupplierIdAndCostTemplateCode")
    public ResponseEntity<List<InquirySupplierCostQuoteDetailDTO>> listByInquiryMaterialSupplierIdAndCostTemplateCode(Long inquiryMaterialSupplierId,String costTemplateCode) {
        return ResponseEntity.ok(inquirySupplierCostQuoteDetailLogic.listByInquiryMaterialSupplierIdAndCostTemplateCode(inquiryMaterialSupplierId,costTemplateCode));
    }
}
