update
This commit is contained in:
@@ -238,13 +238,13 @@ public class InspectRecordServiceImpl implements InspectRecordService {
|
||||
for (int i = 0; i < dataDtos.size(); i++) {
|
||||
dataDtos.get(i).setIndexNum(String.valueOf(indexNum++));
|
||||
}
|
||||
this.buildIonPairAndCE(data, testRecordReagentService
|
||||
.list(Wrappers.<TestRecordReagent>lambdaQuery()
|
||||
.in(TestRecordReagent::getId, testRecord.getReagentConsumablesList())
|
||||
.eq(TestRecordReagent::getCategory, "标准物质"))
|
||||
.stream()
|
||||
.map(item -> item.getId())
|
||||
.collect(Collectors.toList()));
|
||||
// this.buildIonPairAndCE(data, testRecordReagentService
|
||||
// .list(Wrappers.<TestRecordReagent>lambdaQuery()
|
||||
// .in(TestRecordReagent::getId, testRecord.getReagentConsumablesList())
|
||||
// .eq(TestRecordReagent::getCategory, "标准物质"))
|
||||
// .stream()
|
||||
// .map(item -> item.getId())
|
||||
// .collect(Collectors.toList()));
|
||||
// 返回处理后的数据
|
||||
data.put("dataDtos", dataDtos);
|
||||
data.put("sampleSize", dataDtos.size());
|
||||
@@ -252,32 +252,32 @@ public class InspectRecordServiceImpl implements InspectRecordService {
|
||||
return data;
|
||||
}
|
||||
|
||||
public void buildIonPairAndCE(Map<String, Object> data, List<String> reagentIdList) {
|
||||
List<IonPairAndCEVO> ionPairAndCEVOS = new ArrayList<>();
|
||||
|
||||
// 遍历 reagentIdList
|
||||
for (String id : reagentIdList) {
|
||||
TestRecordReagentVO vo = testRecordReagentService.getVOById(id);
|
||||
if (vo == null) {
|
||||
continue; // 如果 vo 为空,跳过当前循环
|
||||
}
|
||||
|
||||
Drug drug = vo.getDrug();
|
||||
if (drug == null) {
|
||||
continue; // 如果 drug 为空,跳过当前循环
|
||||
}
|
||||
|
||||
// 添加 ionPairAndCEVO1 和 ionPairAndCEVO2
|
||||
ionPairAndCEVOS.add(createIonPairAndCEVO(drug.getName(), drug.getMainProductIon(),
|
||||
drug.getMainDeclusteringPotential(), drug.getMainCollisionEnergy()));
|
||||
ionPairAndCEVOS.add(createIonPairAndCEVO(drug.getName(), drug.getMinorProductIon(),
|
||||
drug.getMinorDeclusteringPotential(), drug.getMinorCollisionEnergy()));
|
||||
}
|
||||
|
||||
// 将结果放入数据 map 中
|
||||
data.put("ionPairAndCEVOS", ionPairAndCEVOS);
|
||||
data.put("ionPairAndCEVOSize", ionPairAndCEVOS.size() / 2);
|
||||
}
|
||||
// public void buildIonPairAndCE(Map<String, Object> data, List<String> reagentIdList) {
|
||||
// List<IonPairAndCEVO> ionPairAndCEVOS = new ArrayList<>();
|
||||
//
|
||||
// // 遍历 reagentIdList
|
||||
// for (String id : reagentIdList) {
|
||||
// TestRecordReagentVO vo = testRecordReagentService.getVOById(id);
|
||||
// if (vo == null) {
|
||||
// continue; // 如果 vo 为空,跳过当前循环
|
||||
// }
|
||||
//
|
||||
// Drug drug = vo.getDrug();
|
||||
// if (drug == null) {
|
||||
// continue; // 如果 drug 为空,跳过当前循环
|
||||
// }
|
||||
//
|
||||
// // 添加 ionPairAndCEVO1 和 ionPairAndCEVO2
|
||||
// ionPairAndCEVOS.add(createIonPairAndCEVO(drug.getName(), drug.getMainProductIon(),
|
||||
// drug.getMainDeclusteringPotential(), drug.getMainCollisionEnergy()));
|
||||
// ionPairAndCEVOS.add(createIonPairAndCEVO(drug.getName(), drug.getMinorProductIon(),
|
||||
// drug.getMinorDeclusteringPotential(), drug.getMinorCollisionEnergy()));
|
||||
// }
|
||||
//
|
||||
// // 将结果放入数据 map 中
|
||||
// data.put("ionPairAndCEVOS", ionPairAndCEVOS);
|
||||
// data.put("ionPairAndCEVOSize", ionPairAndCEVOS.size() / 2);
|
||||
// }
|
||||
|
||||
// 创建 IonPairAndCEVO 对象的辅助方法
|
||||
private IonPairAndCEVO createIonPairAndCEVO(String compoundName, String productIon,
|
||||
@@ -365,7 +365,7 @@ public class InspectRecordServiceImpl implements InspectRecordService {
|
||||
LoopRowTableRenderPolicy policy = new LoopRowTableRenderPolicy();
|
||||
Configure config = Configure.builder().
|
||||
bind("dataDtos", policy)
|
||||
.bind("ionPairAndCEVOS", policy).build();
|
||||
.build();
|
||||
return buildDocFileAndUploadToOss(entrustId, templatePath, config, docMap);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user