diff --git a/dlp-drugtesting-biz/src/main/java/digital/laboratory/platform/inspection/service/impl/InspectRecordServiceImpl.java b/dlp-drugtesting-biz/src/main/java/digital/laboratory/platform/inspection/service/impl/InspectRecordServiceImpl.java index f6cef54..590fd6a 100644 --- a/dlp-drugtesting-biz/src/main/java/digital/laboratory/platform/inspection/service/impl/InspectRecordServiceImpl.java +++ b/dlp-drugtesting-biz/src/main/java/digital/laboratory/platform/inspection/service/impl/InspectRecordServiceImpl.java @@ -150,8 +150,15 @@ public class InspectRecordServiceImpl implements InspectRecordService { // 添加空白数据 TestRecordSampleDataVO blankVo = new TestRecordSampleDataVO(); - blankVo.setName("空白"); + blankVo.setName("空白" + materialType); blankVo.setCompoundName(compoundName); + blankVo.setPTargetRtTime("/"); + blankVo.setPRtTimeError("/"); + blankVo.setPRtTimeWithinError("否"); + blankVo.setPIonAbundanceRatio("/"); + blankVo.setPIonAbundanceRatioError("/"); + blankVo.setPIonAbundanceRatioWithinError("否"); + blankVo.setPIsDetected("否"); dataDtos.add(blankVo); // 根据样品类型分组 @@ -163,20 +170,22 @@ public class InspectRecordServiceImpl implements InspectRecordService { TestRecordSampleData std = map.get("STD").get(0); TestRecordSampleDataVO stdVo = new TestRecordSampleDataVO(); BeanUtils.copyProperties(std, stdVo); - stdVo.setName("空白添加"); - stdVo.setIsDetected(1); - List expandList = dataExpandMap.get(std.getId()); if (expandList != null) { for (TestRecordSampleDataExpand expand : expandList) { if (!expand.getBasePeak()) { - stdVo.setIonAbundanceRatio(expand.getIonAbundanceRatio()); - stdVo.setIonAbundanceRatioError(expand.getIonAbundanceRatioError()); - stdVo.setIonAbundanceRatioWithinError(expand.getIonAbundanceRatioWithinError()); + stdVo.setPIonAbundanceRatio(expand.getIonAbundanceRatio().toString()); + stdVo.setPIonAbundanceRatioError("/"); + stdVo.setPIonAbundanceRatioWithinError("/"); break; // 只取第一个符合条件的扩展数据 } } } + stdVo.setName("空白" + materialType + "加标"); + stdVo.setPTargetRtTime(std.getTargetRtTime().toString()); + stdVo.setPRtTimeError("/"); + stdVo.setPRtTimeWithinError("/"); + stdVo.setPIsDetected("是"); dataDtos.add(stdVo); } @@ -195,22 +204,25 @@ public class InspectRecordServiceImpl implements InspectRecordService { if (expandList != null) { for (TestRecordSampleDataExpand expand : expandList) { if (!expand.getBasePeak()) { - vo.setIonAbundanceRatio(expand.getIonAbundanceRatio()); - vo.setIonAbundanceRatioError(expand.getIonAbundanceRatioError()); - vo.setIonAbundanceRatioWithinError(expand.getIonAbundanceRatioWithinError()); + vo.setPIonAbundanceRatio(expand.getIonAbundanceRatio().toString()); + vo.setPIonAbundanceRatioError(expand.getIonAbundanceRatioError().toString()); + vo.setPIonAbundanceRatioWithinError(expand.getIonAbundanceRatioWithinError()); break; // 只取第一个符合条件的扩展数据 } } } - // 重新命名样品 - vo.setName((analyte.size() == 1) ? "检材样品" : (i + 1) + "号检材样品"); + vo.setName((dataList.size() == 1) ? "检材样品" : (i + 1) + "号检材样品"); dataVOS.add(vo); } dataDtos.addAll(dataVOS); } } + int indexNum = 1; + for (int i = 0; i < dataDtos.size(); i++) { + dataDtos.get(i).setIndexNum(String.valueOf(indexNum++)); + } // 返回处理后的数据 data.put("dataDtos", dataDtos); data.put("sampleSize", dataDtos.size()); @@ -218,6 +230,24 @@ public class InspectRecordServiceImpl implements InspectRecordService { return data; } + public TestRecordSampleDataVO processingPrintData(TestRecordSampleDataVO vo, String materialType, String compoundName, Map> dataExpandMap) { + String type = vo.getSampleType(); + switch (type) { + case "QC": + + break; + case "STD": + + break; + case "Analyte": + + + default: + break; + } + return vo; + } + /** * 根据委托信息和样本类型生成生物样本检验记录文件。 @@ -253,7 +283,8 @@ public class InspectRecordServiceImpl implements InspectRecordService { * @return 上传后的文件路径 * @throws Exception 可能抛出的异常 */ - private String buildDocFileAndUploadToOss(String entrustId, String templatePath, Configure config, Map data) throws Exception { + private String buildDocFileAndUploadToOss(String entrustId, String templatePath, Configure + config, Map data) throws Exception { ByteArrayOutputStream bos = new ByteArrayOutputStream(); ossFile.fileGet(templatePath, bos); byte[] templateArray = bos.toByteArray(); @@ -319,7 +350,8 @@ public class InspectRecordServiceImpl implements InspectRecordService { * @param materialType * @return 包含委托信息和检验记录信息的HashMap对象 */ - private HashMap buildCommonInspectRecordDocMap(EntrustInfo entrustInfo, TestRecord testRecord, String materialType) { + private HashMap buildCommonInspectRecordDocMap(EntrustInfo entrustInfo, TestRecord + testRecord, String materialType) { HashMap data = new HashMap<>(); data.put("entrustDepartment", entrustInfo.getEntrustDepartment()); diff --git a/dlp-drugtesting-biz/src/main/java/digital/laboratory/platform/inspection/vo/TestRecordSampleDataVO.java b/dlp-drugtesting-biz/src/main/java/digital/laboratory/platform/inspection/vo/TestRecordSampleDataVO.java index 9e18571..1b67bdc 100644 --- a/dlp-drugtesting-biz/src/main/java/digital/laboratory/platform/inspection/vo/TestRecordSampleDataVO.java +++ b/dlp-drugtesting-biz/src/main/java/digital/laboratory/platform/inspection/vo/TestRecordSampleDataVO.java @@ -9,17 +9,49 @@ import java.math.BigDecimal; public class TestRecordSampleDataVO extends TestRecordSampleData { /** * 离子丰度比 | 峰面积之比 + * p 表示打印 (Print) */ - private BigDecimal ionAbundanceRatio; + private String pIonAbundanceRatio; /** - * 离子丰度比相对偏差(%)| 计算离子丰度比 相对偏差 (目标物离子丰度比 - 标准物离子丰度比) / 标准物质离子丰度比 * 100 + * 离子丰度比相对偏差(%) + * 计算公式:(目标物离子丰度比 - 标准物离子丰度比) / 标准物质离子丰度比 * 100 + * p 表示打印 (Print) */ - private BigDecimal ionAbundanceRatioError; + private String pIonAbundanceRatioError; /** * 离子丰度比偏差是否在误差范围内 + * p 表示打印 (Print) */ - private String ionAbundanceRatioWithinError; + 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; }