20250327 更新

1.对检验数据中的保留时间相对偏差、丰度比、丰度比偏差进行小数位格式化
master
陈江保 5 days ago
parent a969419847
commit 9c9f3e0aa2
  1. 4
      dlp-drugtesting-biz/src/main/java/digital/laboratory/platform/inspection/service/impl/TestRecordSampleDataServiceImpl.java
  2. 61
      dlp-drugtesting-biz/src/main/java/digital/laboratory/platform/inspection/vo/TestRecordSampleDataExpandVO.java
  3. 20
      dlp-drugtesting-biz/src/main/java/digital/laboratory/platform/inspection/vo/TestRecordSampleDataVO.java
  4. 15
      dlp-drugtesting-biz/src/main/resources/mapper/TestRecordSampleDataExpandMapper.xml
  5. 2
      dlp-drugtesting-biz/src/main/resources/mapper/TestRecordSampleDataMapper.xml

@ -423,6 +423,10 @@ public class TestRecordSampleDataServiceImpl extends ServiceImpl<TestRecordSampl
public boolean updateEntrustTestData(List<SampleInspectDataDTO> dtoList) {
List<TestRecordSampleData> testRecordSampleDataList = TestRecordSampleDataConverter.dtoToEntityList(dtoList);
if (super.updateBatchById(testRecordSampleDataList)) {
TestRecord testRecord = testRecordService.getById(dtoList.get(0).getTestId());
if (testRecord.getStatus().compareTo(2) < 0) {
testRecordService.update(Wrappers.<TestRecord>lambdaUpdate().eq(TestRecord::getId, dtoList.get(0).getTestId()).set(TestRecord::getStatus, 2));
}
// 开启异步执行
CompletableFuture.runAsync(() -> {
testRecordSampleDataList.forEach(item -> calculateInspectData(item.getId()));

@ -0,0 +1,61 @@
package digital.laboratory.platform.inspection.vo;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
import java.math.RoundingMode;
/**
* 样本检验数据的扩展信息
* @TableName b_test_record_sampledata_expand
*/
@Data
@TableName(autoResultMap = true)
@ApiModel(value = "TestRecordSampleDataExpandVO", description = "样本检验数据的扩展信息 VO类") // 定义模型描述
public class TestRecordSampleDataExpandVO {
@ApiModelProperty(value = "主键标识", example = "123456")
private String id;
@ApiModelProperty(value = "关联的实验数据id", example = "testData_001")
private String testDataId;
@ApiModelProperty(value = "峰面积", example = "12345.67")
private BigDecimal peakArea;
@ApiModelProperty(value = "是否是基峰, 1 是 | 0 不是", example = "true")
private Boolean basePeak;
@ApiModelProperty(value = "离子丰度比", example = "0.85")
private BigDecimal ionAbundanceRatio;
@ApiModelProperty(value = "离子丰度比相对偏差(%)",
example = "5.2", notes = "计算公式:(目标物离子丰度比 - 标准物离子丰度比) / 标准物质离子丰度比 * 100")
private BigDecimal ionAbundanceRatioError;
@ApiModelProperty(value = "离子丰度比偏差是否在误差范围内", example = "是")
private String ionAbundanceRatioWithinError;
@ApiModelProperty(value = "碎片保留时间,仅对nps实验有用", example = "2.34")
private BigDecimal fragmentRetTime;
@ApiModelProperty(value = "质荷比(m/z),nps案件", example = "150.2")
private BigDecimal massToChargeRatio;
@ApiModelProperty(value = "定性离子对,生物案件使用", example = "C6H12O6")
private String qualitativeIonPair;
/************************ 处理需要特定格式返回的字段 **************************/
public BigDecimal getIonAbundanceRatio() {
return ionAbundanceRatio != null ? ionAbundanceRatio.setScale(2, RoundingMode.HALF_UP) : null;
}
public BigDecimal getIonAbundanceRatioError() {
return ionAbundanceRatioError != null ? ionAbundanceRatioError.setScale(2, RoundingMode.HALF_UP) : null;
}
}

@ -6,6 +6,8 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.List;
/**
@ -41,7 +43,7 @@ public class TestRecordSampleDataVO {
private String rtTimeWithinError;
@ApiModelProperty(value = "保留时间相对误差(%)", example = "1.2")
private Double rtTimeError;
private BigDecimal rtTimeError;
@ApiModelProperty(value = "检材保留时间(min)", example = "2.5")
private Double targetRtTime;
@ -71,12 +73,24 @@ public class TestRecordSampleDataVO {
private String whetherCheckOut;
@ApiModelProperty("样本检验扩展数据列表")
private List<TestRecordSampleDataExpand> expandList;
private List<TestRecordSampleDataExpandVO> expandList;
/********************************* 对于返回到前端的数据进行处理 *****************************************/
/**
* 获取检测状态
*
* @return 如果检测状态为已检测则返回TestRecordSampleDataConstant.IS
* 如果检测状态为未检测则返回TestRecordSampleDataConstant.NO
* 如果检测状态为空则返回null
*/
public String getIsDetected() {
if (isDetected == null) {
return null;
}
return isDetected.equals(1) ? TestRecordSampleDataConstant.IS : TestRecordSampleDataConstant.NO;
}
public BigDecimal getRtTimeError() {
return rtTimeError != null ? rtTimeError.setScale(3, RoundingMode.HALF_UP) : null;
}
}

@ -21,6 +21,19 @@
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
</resultMap>
<resultMap id="VOMap" type="digital.laboratory.platform.inspection.vo.TestRecordSampleDataExpandVO">
<id property="id" column="exp_id" jdbcType="VARCHAR"/>
<result property="testDataId" column="test_data_id" jdbcType="VARCHAR"/>
<result property="peakArea" column="peak_area" jdbcType="DECIMAL"/>
<result property="basePeak" column="base_peak" jdbcType="TINYINT"/>
<result property="ionAbundanceRatio" column="ion_abundance_ratio" jdbcType="DECIMAL"/>
<result property="ionAbundanceRatioError" column="ion_abundance_ratio_error" jdbcType="DECIMAL"/>
<result property="ionAbundanceRatioWithinError" column="ion_abundance_ratio_within_error" jdbcType="VARCHAR"/>
<result property="fragmentRetTime" column="fragment_ret_time" jdbcType="DECIMAL"/>
<result property="massToChargeRatio" column="mass_to_charge_ratio" jdbcType="DECIMAL"/>
<result property="qualitativeIonPair" column="qualitative_ion_pair" jdbcType="VARCHAR"/>
</resultMap>
<sql id="Base_Column_List">
exp.exp_id,
exp.test_data_id,
@ -45,7 +58,7 @@
LEFT JOIN b_test_record_sampledata test ON exp.test_data_id = test.id
</sql>
<select id="queryExpandDataByTestDataId" resultMap="BaseResultMap" resultType="digital.laboratory.platform.inspection.entity.TestRecordSampleDataExpand">
<select id="queryExpandDataByTestDataId" resultMap="VOMap" resultType="digital.laboratory.platform.inspection.entity.TestRecordSampleDataExpand">
SELECT
<include refid="Base_Column_List"></include>
FROM b_test_record_sampledata_expand exp WHERE exp.test_data_id = #{testDataId}

@ -49,7 +49,7 @@
<result property="whetherCheckOut" column="whether_check_out" jdbcType="VARCHAR"/>
<collection
property="expandList"
ofType="digital.laboratory.platform.inspection.entity.TestRecordSampleDataExpand"
ofType="digital.laboratory.platform.inspection.vo.TestRecordSampleDataExpandVO"
javaType="java.util.List"
column="id"
select="digital.laboratory.platform.inspection.mapper.TestRecordSampleDataExpandMapper.queryExpandDataByTestDataId" />

Loading…
Cancel
Save