package digital.laboratory.platform.inspection.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import digital.laboratory.platform.common.mybatis.security.service.DLPUser;
import digital.laboratory.platform.inspection.dto.TestRecordArgumentDto;
import digital.laboratory.platform.inspetion.api.entity.SampleInfo;
import digital.laboratory.platform.inspetion.api.entity.MaterialDto;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/*
 *@title SampleInfoService
 *@description
 *@author xy
 *@version 1.0
 *@create 2023/12/7 15:31
 */
public interface SampleInfoService extends IService<SampleInfo> {
    SampleInfo addSampleInfo(SampleInfo sampleInfo);//添加样本信息

    SampleInfo updateSampleInfo(SampleInfo sampleInfo);//修改样本信息

    Boolean deleteSampleInfo(String id);//删除样本信息

    IPage getSampleInfoPageList(Page page, SampleInfo sampleInfo);

    List<SampleInfo> getSampleInfoList(SampleInfo sampleInfo);

    Boolean checkExist(String id);

    IPage getPageForTestRecord(Page page, DLPUser dlpUser, String testId, String keywords);

    @Transactional
    boolean useTestRecordSample(TestRecordArgumentDto testRecordArgumentDto);

    List<SampleInfo> getSampleInfoListForBusiness(String businessId, String testUser);

    boolean checkRepeatNo(String acceptNo,String id);

    /**复制其他系统检材内容
     * @param sampleInfo
     * @param material
     * @param type       0:委托 1：任务 2：筛查
     */
    void copy(SampleInfo sampleInfo, MaterialDto material, Integer type);
}
