package com.ruoyi.quote.service.impl;

import com.ruoyi.quote.domain.CalculateRBParamDto;
import com.ruoyi.quote.domain.MaterialDto;
import com.ruoyi.quote.mapper.QuoteMapper;
import com.ruoyi.quote.service.QuoteService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @ClassName QuoteServiceImpl
 * @Description TODO
 * @Author JIAL
 * @Date 2024/3/5 16:07
 * @Version 1.0
 */
@Service
public class QuoteServiceImpl implements QuoteService {

    @Autowired
    QuoteMapper quoteMapper;

    /**
     * @title queryMaterialListByParam
     * @description 根据条件查询物料信息
     * @author JIAL
     * @param: precMaterialName
     * @param: vagueMaterialName
     * @param: vagueModel
     * @updateTime 2024/3/5 16:16
     * @return: java.util.List<com.ruoyi.quote.domain.MaterialDto>
     */
    @Override
    public List<MaterialDto> queryMaterialListByParam(String precMaterialName, String vagueMaterialName, String vagueModel) {
        return quoteMapper.selectMaterialListByParam(precMaterialName, vagueMaterialName, vagueModel);
    }

    /**
     * @title queryCostPriceByParams
     * @description 查红本成本
     * @author JIAL
     * @param: params
     * @updateTime 2024/3/11 9:44
     * @return: java.util.List<com.ruoyi.quote.domain.CalculateRBParamDto>
     */
    @Override
    public List<CalculateRBParamDto> queryRedBCostByParams(List<CalculateRBParamDto> params) {
        return quoteMapper.queryRedBCostByParams(params);
    }

    /**
     * @title queryRedBPriceByParams
     * @description 获取红本价
     * @author JIAL
     * @param: params
     * @updateTime 2024/3/12 10:32
     * @return: java.util.List<com.ruoyi.quote.domain.CalculateRBParamDto>
     */
    @Override
    public List<CalculateRBParamDto> queryRedBPriceByParams(List<CalculateRBParamDto> params) {
        return quoteMapper.queryRedBPriceByParams(params);
    }


    /**
     * @title queryRedBookVer
     * @description 获取红本价最新版本
     * @author JIAL
     * @updateTime 2024/3/11 11:13
     * @return: java.lang.String
     */
    @Override
    public String queryRedBookVer() {
        return quoteMapper.queryRedBookVer();
    }

    /**
     * @title queryRedBookLocalVer
     * @description 获取本地红本版本号
     * @author JIAL
     * @updateTime 2024/3/13 12:37
     * @return: java.lang.String
     */
    @Override
    public String queryRedBookLocalVer() {
        return quoteMapper.queryRedBookLocalVer();
    }
}
