package digital.laboratory.platform.inspection.convert;

import digital.laboratory.platform.inspection.dto.TestSampleDataExpandDTO;
import digital.laboratory.platform.inspection.entity.TestRecordSampleDataExpand;

/**
 * @author ChenJiangBao
 * @version 1.0
 * @description: 样本实验扩展数据实现类
 * @date 2025/3/21 15:35
 */
public class TestSampleDataExpandConverter {

    /**
     * DTO 转实体类
     */
    public static TestRecordSampleDataExpand dtoToEntity(TestSampleDataExpandDTO dto) {
        if (dto == null) return null;
        TestRecordSampleDataExpand testRecordSampleDataExpand = new TestRecordSampleDataExpand();
        testRecordSampleDataExpand.setId(dto.getId());
        testRecordSampleDataExpand.setTestDataId(dto.getTestDataId());
        testRecordSampleDataExpand.setPeakArea(dto.getPeakArea());
        testRecordSampleDataExpand.setBasePeak(dto.getBasePeak());
        testRecordSampleDataExpand.setIonAbundanceRatio(dto.getIonAbundanceRatio());
        testRecordSampleDataExpand.setIonAbundanceRatioError(dto.getIonAbundanceRatioError());
        testRecordSampleDataExpand.setIonAbundanceRatioWithinError(dto.getIonAbundanceRatioWithinError());
        testRecordSampleDataExpand.setFragmentRetTime(dto.getFragmentRetTime());
        testRecordSampleDataExpand.setMassToChargeRatio(dto.getMassToChargeRatio());
        testRecordSampleDataExpand.setQualitativeIonPair(dto.getQualitativeIonPair());
        return testRecordSampleDataExpand;
    }

}
