update
This commit is contained in:
+20
-5
@@ -238,13 +238,29 @@ public class InspectRecordServiceImpl implements InspectRecordService {
|
|||||||
TestRecordSampleData item = analyte.get(i);
|
TestRecordSampleData item = analyte.get(i);
|
||||||
TestRecordSampleDataDocDTO vo = new TestRecordSampleDataDocDTO();
|
TestRecordSampleDataDocDTO vo = new TestRecordSampleDataDocDTO();
|
||||||
BeanUtils.copyProperties(item, vo);
|
BeanUtils.copyProperties(item, vo);
|
||||||
|
List<TestRecordSampleDataExpand> expandList = dataExpandMap.get(item.getId());
|
||||||
vo.setPTargetRtTime(item.getTargetRtTime() != null ? String.format("%.2f", item.getTargetRtTime()) : "/");
|
vo.setPTargetRtTime(item.getTargetRtTime() != null ? String.format("%.2f", item.getTargetRtTime()) : "/");
|
||||||
vo.setPRtTimeError(item.getRtTimeError() != null ? item.getRtTimeError().setScale(2, RoundingMode.HALF_UP).toString() : "/");
|
vo.setPRtTimeError(item.getRtTimeError() != null ? item.getRtTimeError().setScale(2, RoundingMode.HALF_UP).toString() : "/");
|
||||||
vo.setPRtTimeWithinError(item.getRtTimeWithinError() != null ? item.getRtTimeWithinError().toString() : "/");
|
vo.setPRtTimeWithinError(item.getRtTimeWithinError() != null ? item.getRtTimeWithinError().toString() : "/");
|
||||||
vo.setPIsDetected(item.getIsDetected() != null && item.getIsDetected() == 1 ? "是" : "否");
|
vo.setPIsDetected(item.getIsDetected() != null && item.getIsDetected() == 1 ? "是" : "否");
|
||||||
|
|
||||||
vo.setName((dataList.stream().collect(Collectors.groupingBy(TestRecordSampleData::getSampleNo)).keySet().size() == 1) ? "检材样品" : (i + 1) + "号检材样品");
|
if (expandList != null) {
|
||||||
|
for (TestRecordSampleDataExpand expand : expandList) {
|
||||||
|
if (!expand.getBasePeak()) {
|
||||||
|
vo.setPIonAbundanceRatio(expand.getIonAbundanceRatio() != null ? expand.getIonAbundanceRatio().setScale(2, RoundingMode.HALF_UP).toString() : "/");
|
||||||
|
vo.setPIonAbundanceRatioError(expand.getIonAbundanceRatioError() != null ? expand.getIonAbundanceRatioError().setScale(2, RoundingMode.HALF_UP).toString() : "/");
|
||||||
|
vo.setPIonAbundanceRatioWithinError(expand.getIonAbundanceRatioWithinError() != null ? expand.getIonAbundanceRatioWithinError() : "/");
|
||||||
|
break; // 只取第一个符合条件的扩展数据
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 重新命名样品
|
||||||
|
vo.setName((dataList
|
||||||
|
.stream()
|
||||||
|
.collect(Collectors.groupingBy(TestRecordSampleData::getSampleNo))
|
||||||
|
.keySet()
|
||||||
|
.size() == 1) ? "检材样品" : (i + 1) + "号检材样品");
|
||||||
vo.setCompoundName(compoundName);
|
vo.setCompoundName(compoundName);
|
||||||
dataVOS.add(vo);
|
dataVOS.add(vo);
|
||||||
}
|
}
|
||||||
@@ -918,7 +934,8 @@ public class InspectRecordServiceImpl implements InspectRecordService {
|
|||||||
* @param sampleInfoList 样本信息列表
|
* @param sampleInfoList 样本信息列表
|
||||||
* @return 物料特性描述(如果列表为空,则返回空字符串)
|
* @return 物料特性描述(如果列表为空,则返回空字符串)
|
||||||
*/
|
*/
|
||||||
private String buildMaterialCharacterDesc(List<SampleInfo> sampleInfoList) {
|
@Override
|
||||||
|
public String buildMaterialCharacterDesc(List<SampleInfo> sampleInfoList) {
|
||||||
if (CollUtil.isEmpty(sampleInfoList)) {
|
if (CollUtil.isEmpty(sampleInfoList)) {
|
||||||
return StrUtil.EMPTY;
|
return StrUtil.EMPTY;
|
||||||
}
|
}
|
||||||
@@ -1137,6 +1154,4 @@ public class InspectRecordServiceImpl implements InspectRecordService {
|
|||||||
// 使用 ";" 连接所有描述,并返回最终的检测意见字符串
|
// 使用 ";" 连接所有描述,并返回最终的检测意见字符串
|
||||||
return String.join(";", finalSentences);
|
return String.join(";", finalSentences);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user