package digital.laboratory.platform.inspection.service;

import com.baomidou.mybatisplus.extension.service.IService;
import digital.laboratory.platform.inspection.dto.ResetSampleInjectorDTO;
import digital.laboratory.platform.inspection.entity.SampleInjector;
import digital.laboratory.platform.inspection.vo.TestRecordSolutionVO;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;

/**
 * 进样器service 接口
 */
public interface SampleInjectorService extends IService<SampleInjector> {

    /**
     * 保存进样信息
     * @param sampleInjector
     * @return
     */
    SampleInjector saveSampleInjector(SampleInjector sampleInjector);

    /**
     * 检材列表查询
     * @param testId
     * @param key
     * @return
     */
    List<TestRecordSolutionVO> queryMaterialList(String testId, String key);

    /**
     * 导出进样信息excel表
     * @param id
     * @param response
     */
    void exportSampleInjectorInfoToExcel(String id, HttpServletResponse response);

    /**
     * 重置进样信息
     * @param dto
     * @return
     */
    SampleInjector reset(ResetSampleInjectorDTO dto);

    /**
     * 根据实验id获取，数据为空则初始部分数据返回
     * @param testId
     * @return
     */
    SampleInjector getByTestId(String testId);

    /**
     * 判断当前进样器是否保存了进样位置信息
     * @param testId
     * @return
     */
    boolean whetherSave(String testId);
}
