parent
6f087e2556
commit
262c96c875
@ -0,0 +1,51 @@ |
|||||||
|
package digital.laboratory.platform.inspection.convert; |
||||||
|
|
||||||
|
import digital.laboratory.platform.inspection.dto.SampleInspectDataDTO; |
||||||
|
import digital.laboratory.platform.inspection.entity.TestRecordSampleData; |
||||||
|
|
||||||
|
import java.util.Collections; |
||||||
|
import java.util.List; |
||||||
|
import java.util.stream.Collectors; |
||||||
|
|
||||||
|
/** |
||||||
|
* @author ChenJiangBao |
||||||
|
* @version 1.0 |
||||||
|
* @description: 检验数据转换器 |
||||||
|
* @date 2025/3/25 17:08 |
||||||
|
*/ |
||||||
|
public class TestRecordSampleDataConverter { |
||||||
|
|
||||||
|
/** |
||||||
|
* dot 转 entity |
||||||
|
* @param dto |
||||||
|
* @return |
||||||
|
*/ |
||||||
|
public static TestRecordSampleData dtoToEntity(SampleInspectDataDTO dto) { |
||||||
|
if (dto == null) return null; |
||||||
|
TestRecordSampleData testRecordSampleData = new TestRecordSampleData(); |
||||||
|
testRecordSampleData.setId(dto.getId()); |
||||||
|
testRecordSampleData.setName(dto.getName()); |
||||||
|
testRecordSampleData.setSampleNo(dto.getSampleNo()); |
||||||
|
testRecordSampleData.setTestId(dto.getTestId()); |
||||||
|
testRecordSampleData.setSampleConcentration(dto.getSampleConcentration()); |
||||||
|
testRecordSampleData.setCompoundName(dto.getCompoundName()); |
||||||
|
testRecordSampleData.setRtTimeWithinError(dto.getRtTimeWithinError()); |
||||||
|
testRecordSampleData.setRtTimeError(dto.getRtTimeError()); |
||||||
|
testRecordSampleData.setTargetRtTime(dto.getTargetRtTime()); |
||||||
|
testRecordSampleData.setIsDetected(dto.getIsDetected()); |
||||||
|
testRecordSampleData.setSampleType(dto.getSampleType()); |
||||||
|
testRecordSampleData.setCompoundCnName(dto.getCompoundCnName()); |
||||||
|
testRecordSampleData.setWhetherCheckOut(dto.getWhetherCheckOut()); |
||||||
|
return testRecordSampleData; |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* dto列表转实体列表 |
||||||
|
* @param dtoList |
||||||
|
* @return |
||||||
|
*/ |
||||||
|
public static List<TestRecordSampleData> dtoToEntityList(List<SampleInspectDataDTO> dtoList) { |
||||||
|
if (dtoList == null) return Collections.emptyList(); |
||||||
|
return dtoList.stream().map(TestRecordSampleDataConverter::dtoToEntity).collect(Collectors.toList()); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,58 @@ |
|||||||
|
package digital.laboratory.platform.inspection.dto; |
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModel; |
||||||
|
import io.swagger.annotations.ApiModelProperty; |
||||||
|
import lombok.Data; |
||||||
|
|
||||||
|
import java.util.List; |
||||||
|
|
||||||
|
/** |
||||||
|
* 实验中样本检测结果数据 DTO类,包含扩展数据 |
||||||
|
* @TableName b_test_record_sampledata |
||||||
|
*/ |
||||||
|
@Data |
||||||
|
@ApiModel(value = "SampleInspectDataDTO", description = "实验中样本检测结果数据 DTO类,包含扩展数据") |
||||||
|
public class SampleInspectDataDTO { |
||||||
|
|
||||||
|
@ApiModelProperty(value = "主键标识", example = "123456789") |
||||||
|
private String id; |
||||||
|
|
||||||
|
@ApiModelProperty(value = "数据从机器中导出的唯一标识", example = "Sample123") |
||||||
|
private String name; |
||||||
|
|
||||||
|
@ApiModelProperty(value = "样本编号", example = "SMP001") |
||||||
|
private String sampleNo; |
||||||
|
|
||||||
|
@ApiModelProperty(value = "实验ID", example = "TEST001") |
||||||
|
private String testId; |
||||||
|
|
||||||
|
@ApiModelProperty(value = "样品浓度", example = "8.9") |
||||||
|
private String sampleConcentration; |
||||||
|
|
||||||
|
@ApiModelProperty(value = "化合物名称", example = "Heroin") |
||||||
|
private String compoundName; |
||||||
|
|
||||||
|
@ApiModelProperty(value = "保留时间是否在误差范围内,缴获物(-1~1), 生物样本(-2.5~2.5)", example = "0.5") |
||||||
|
private String rtTimeWithinError; |
||||||
|
|
||||||
|
@ApiModelProperty(value = "保留时间相对误差(%)", example = "1.2") |
||||||
|
private Double rtTimeError; |
||||||
|
|
||||||
|
@ApiModelProperty(value = "检材保留时间(min)", example = "2.5") |
||||||
|
private Double targetRtTime; |
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否检出该物质 1 检出, 0 未检出", example = "1") |
||||||
|
private Integer isDetected; |
||||||
|
|
||||||
|
@ApiModelProperty(value = "样本类型 - QC(质控), STD(标准品), Analyte(待测样品)", example = "QC") |
||||||
|
private String sampleType; |
||||||
|
|
||||||
|
@ApiModelProperty(value = "检测的化合物的中文名字", example = "海洛因") |
||||||
|
private String compoundCnName; |
||||||
|
|
||||||
|
@ApiModelProperty("是否检出, 定性结果") |
||||||
|
private String whetherCheckOut; |
||||||
|
|
||||||
|
@ApiModelProperty("样本检验扩展数据列表") |
||||||
|
private List<TestSampleDataExpandDTO> expandList; |
||||||
|
} |
@ -0,0 +1,56 @@ |
|||||||
|
package digital.laboratory.platform.inspection.dto; |
||||||
|
|
||||||
|
import digital.laboratory.platform.inspection.entity.TestRecordSampleData; |
||||||
|
import lombok.Data; |
||||||
|
|
||||||
|
@Data |
||||||
|
public class TestRecordSampleDataDocDTO extends TestRecordSampleData { |
||||||
|
|
||||||
|
/** |
||||||
|
* 离子丰度比 | 峰面积之比 |
||||||
|
* p 表示打印 (Print) |
||||||
|
*/ |
||||||
|
private String pIonAbundanceRatio; |
||||||
|
|
||||||
|
/** |
||||||
|
* 离子丰度比相对偏差(%) |
||||||
|
* 计算公式:(目标物离子丰度比 - 标准物离子丰度比) / 标准物质离子丰度比 * 100 |
||||||
|
* p 表示打印 (Print) |
||||||
|
*/ |
||||||
|
private String pIonAbundanceRatioError; |
||||||
|
|
||||||
|
/** |
||||||
|
* 离子丰度比偏差是否在误差范围内 |
||||||
|
* p 表示打印 (Print) |
||||||
|
*/ |
||||||
|
private String pIonAbundanceRatioWithinError; |
||||||
|
|
||||||
|
/** |
||||||
|
* 目标物保留时间 |
||||||
|
* p 表示打印 (Print) |
||||||
|
*/ |
||||||
|
private String pTargetRtTime; |
||||||
|
|
||||||
|
/** |
||||||
|
* 保留时间偏差 |
||||||
|
* p 表示打印 (Print) |
||||||
|
*/ |
||||||
|
private String pRtTimeError; |
||||||
|
|
||||||
|
/** |
||||||
|
* 保留时间偏差是否在误差范围内 |
||||||
|
* p 表示打印 (Print) |
||||||
|
*/ |
||||||
|
private String pRtTimeWithinError; |
||||||
|
|
||||||
|
/** |
||||||
|
* 是否检测到目标物 |
||||||
|
* p 表示打印 (Print) |
||||||
|
*/ |
||||||
|
private String pIsDetected; |
||||||
|
|
||||||
|
/** |
||||||
|
* 样本索引编号 |
||||||
|
*/ |
||||||
|
private String indexNum; |
||||||
|
} |
@ -1,57 +1,74 @@ |
|||||||
package digital.laboratory.platform.inspection.vo; |
package digital.laboratory.platform.inspection.vo; |
||||||
|
|
||||||
import digital.laboratory.platform.inspection.entity.TestRecordSampleData; |
import digital.laboratory.platform.inspection.entity.TestRecordSampleDataExpand; |
||||||
|
import io.swagger.annotations.ApiModel; |
||||||
|
import io.swagger.annotations.ApiModelProperty; |
||||||
import lombok.Data; |
import lombok.Data; |
||||||
|
|
||||||
import java.math.BigDecimal; |
import java.util.List; |
||||||
|
|
||||||
|
/** |
||||||
|
* 样本检验数据 VO类 |
||||||
|
* @TableName b_test_record_sampledata |
||||||
|
*/ |
||||||
@Data |
@Data |
||||||
public class TestRecordSampleDataVO extends TestRecordSampleData { |
@ApiModel(value = "TestRecordSampleDataVO", description = "实验中样本检测结果数据 VO类") |
||||||
/** |
public class TestRecordSampleDataVO { |
||||||
* 离子丰度比 | 峰面积之比 |
|
||||||
* p 表示打印 (Print) |
@ApiModelProperty(value = "主键标识", example = "123456789") |
||||||
*/ |
private String id; |
||||||
private String pIonAbundanceRatio; |
|
||||||
|
@ApiModelProperty(value = "数据从机器中导出的唯一标识", example = "Sample123") |
||||||
/** |
private String name; |
||||||
* 离子丰度比相对偏差(%) |
|
||||||
* 计算公式:(目标物离子丰度比 - 标准物离子丰度比) / 标准物质离子丰度比 * 100 |
@ApiModelProperty(value = "样本编号", example = "SMP001") |
||||||
* p 表示打印 (Print) |
private String sampleNo; |
||||||
*/ |
|
||||||
private String pIonAbundanceRatioError; |
@ApiModelProperty(value = "实验ID", example = "TEST001") |
||||||
|
private String testId; |
||||||
/** |
|
||||||
* 离子丰度比偏差是否在误差范围内 |
@ApiModelProperty(value = "标准品浓度", example = "10.5") |
||||||
* p 表示打印 (Print) |
private String stdConcentration; |
||||||
*/ |
|
||||||
private String pIonAbundanceRatioWithinError; |
@ApiModelProperty(value = "样品浓度", example = "8.9") |
||||||
|
private String sampleConcentration; |
||||||
/** |
|
||||||
* 目标物保留时间 |
@ApiModelProperty(value = "化合物名称", example = "Heroin") |
||||||
* p 表示打印 (Print) |
private String compoundName; |
||||||
*/ |
|
||||||
private String pTargetRtTime; |
@ApiModelProperty(value = "保留时间是否在误差范围内,缴获物(-1~1), 生物样本(-2.5~2.5)", example = "0.5") |
||||||
|
private String rtTimeWithinError; |
||||||
/** |
|
||||||
* 保留时间偏差 |
@ApiModelProperty(value = "保留时间相对误差(%)", example = "1.2") |
||||||
* p 表示打印 (Print) |
private Double rtTimeError; |
||||||
*/ |
|
||||||
private String pRtTimeError; |
@ApiModelProperty(value = "检材保留时间(min)", example = "2.5") |
||||||
|
private Double targetRtTime; |
||||||
/** |
|
||||||
* 保留时间偏差是否在误差范围内 |
@ApiModelProperty(value = "标准品保留时间(min)", example = "2.6") |
||||||
* p 表示打印 (Print) |
private Double stdRtTime; |
||||||
*/ |
|
||||||
private String pRtTimeWithinError; |
@ApiModelProperty(value = "是否检出该物质 1 检出, 0 未检出", example = "1") |
||||||
|
private Integer isDetected; |
||||||
/** |
|
||||||
* 是否检测到目标物 |
@ApiModelProperty(value = "样本类型 - QC(质控), STD(标准品), Analyte(待测样品)", example = "QC") |
||||||
* p 表示打印 (Print) |
private String sampleType; |
||||||
*/ |
|
||||||
private String pIsDetected; |
@ApiModelProperty(value = "检验数据 JSON", example = "{\"mass\": 146, \"intensity\": 200}") |
||||||
|
private String dataJson; |
||||||
/** |
|
||||||
* 样本索引编号 |
@ApiModelProperty(value = "检验结果数据 JSON", example = "{\"result\": \"Positive\"}") |
||||||
*/ |
private String dataResultJson; |
||||||
private String indexNum; |
|
||||||
|
@ApiModelProperty(value = "状态:0-待审核, 1-已审核, 2-已审批, 3-已上传", example = "1") |
||||||
|
private Integer status; |
||||||
|
|
||||||
|
@ApiModelProperty(value = "检测的化合物的中文名字", example = "海洛因") |
||||||
|
private String compoundCnName; |
||||||
|
|
||||||
|
@ApiModelProperty("是否检出, 定性结果") |
||||||
|
private String whetherCheckOut; |
||||||
|
|
||||||
|
@ApiModelProperty("样本检验扩展数据列表") |
||||||
|
private List<TestRecordSampleDataExpand> expandList; |
||||||
} |
} |
||||||
|
Loading…
Reference in new issue