diff --git a/dlp-drugtesting-api/src/main/java/digital/laboratory/platform/inspetion/api/entity/IdentificationBookDTO.java b/dlp-drugtesting-api/src/main/java/digital/laboratory/platform/inspetion/api/entity/IdentificationBookDTO.java index 713119e..3cc718c 100644 --- a/dlp-drugtesting-api/src/main/java/digital/laboratory/platform/inspetion/api/entity/IdentificationBookDTO.java +++ b/dlp-drugtesting-api/src/main/java/digital/laboratory/platform/inspetion/api/entity/IdentificationBookDTO.java @@ -24,6 +24,8 @@ public class IdentificationBookDTO { private String testOptUser;//检验人 private String testStartDate;//检验开始日期 private String testFinishDate;//检验完成日期 + private String materialCharacterDesc;//检材特征描述 + private String materialIngredient;//鉴定要求 // eg:1号检材中未检出四氢大麻酚,检出合成大麻素类物质MDMB-4en-PINACA; // 2号检材中未检出四氢大麻酚,检出合成大麻素类物质MDMB-4en-PINACA。 diff --git a/dlp-drugtesting-biz/src/main/java/digital/laboratory/platform/inspection/service/impl/IdentifyBookDataServiceImpl.java b/dlp-drugtesting-biz/src/main/java/digital/laboratory/platform/inspection/service/impl/IdentifyBookDataServiceImpl.java index e1959fa..fbbd70b 100644 --- a/dlp-drugtesting-biz/src/main/java/digital/laboratory/platform/inspection/service/impl/IdentifyBookDataServiceImpl.java +++ b/dlp-drugtesting-biz/src/main/java/digital/laboratory/platform/inspection/service/impl/IdentifyBookDataServiceImpl.java @@ -43,6 +43,10 @@ public class IdentifyBookDataServiceImpl implements IdentifyBookDataService { private TestRecordSampleDataService testRecordSampleDataService;//检验数据 @Resource private TestRecordMethodService testRecordMethodService;//检验方法 + @Resource + private InspectRecordService inspectRecordService; + @Resource + private TestRecordReagentService testRecordReagentService; /** * 获取完成实验的数据/获取符合制作文书的数据 @@ -92,6 +96,11 @@ public class IdentifyBookDataServiceImpl implements IdentifyBookDataService { //构建文书数据 private IdentificationBookDTO buildBookDataDetail(String businessId) { + + TestRecord testRecordInfo = testRecordService.lambdaQuery() + .eq(TestRecord::getBusinessId, businessId) + .one(); + IdentificationBookDTO bookData = new IdentificationBookDTO(); //委托信息 EntrustInfo entrustInfo = entrustInfoService.getById(businessId); @@ -101,23 +110,26 @@ public class IdentifyBookDataServiceImpl implements IdentifyBookDataService { .eq(SampleInfo::getBusinessId, businessId).orderByAsc(SampleInfo::getAcceptNo)); bookData.setSampleInfoList(sampleList); - //设置检验结果 - List testRecordSampleDataList = getTestRecordSampleData(sampleList);//样本溶液对应的数据 - if (CollUtil.isEmpty(testRecordSampleDataList)) { - return null; - } - List testResultsList = buildTestResult(testRecordSampleDataList, sampleList);//构建检验结果 - TestRecord testRecordInfo = testRecordService.lambdaQuery() - .eq(TestRecord::getBusinessId, businessId) - .one(); + //设置检材性状描述 + bookData.setMaterialCharacterDesc(inspectRecordService.buildMaterialCharacterDesc(sampleList)); + + //设置使用的标准物质和试剂 + List references = testRecordReagentService.list(Wrappers.lambdaQuery() + .in(TestRecordReagent::getId, testRecordInfo.getReagentConsumablesList()) + .eq(TestRecordReagent::getCategory, "标准物质")); + + //构建检材检出描述 + bookData.setMaterialIngredient(references.stream() + .map(reagent -> reagent.getReagentConsumableName()) + .collect(Collectors.joining("、"))); + //实验信息 bookData.setTestMethod(getTestMethods(testRecordInfo));//设置用到的实验方法 //设置检验过程 bookData.setTestProcessDes(testRecordInfo.getTestProcessDes());//设置检验过程 bookData.setTestResult(testRecordSampleDataService.generateQualitativeResults(businessId)); - //bookData.setTestResult(buildTestResultDes(testResultsList));//检验结果 - //检验日期 + //检验日期 DateTimeFormatter sdf = DateTimeFormatter.ofPattern("yyyy年MM月dd日"); bookData.setTestStartDate(sdf.format(testRecordInfo.getCreateTime())); bookData.setTestOptUser(testRecordInfo.getTestUserId());