perf: 88047 法规符合性排查流程--发起节点--生成2200条数据,耗时近5秒
This commit is contained in:
+19
-17
@@ -460,8 +460,11 @@ public class ProcessStandardComplianceCheckServiceImpl extends ServiceImpl<Proce
|
||||
String isSameLastVersion = scc.getIsSameLastVersion();
|
||||
if (YesOrNoEnum.NO.getValue().equals(isSameLastVersion)) {
|
||||
// 过滤出也为否的数据
|
||||
detailInfoList = detailInfoList.stream().filter(detail -> YesOrNoEnum.NO.getValue().equals
|
||||
(detail.getIsSameAsPrevVersion())).collect(Collectors.toList());
|
||||
// 过滤出也为否的数据
|
||||
detailInfoList = detailInfoList.stream()
|
||||
.parallel() // 使用并行流
|
||||
.filter(detail -> YesOrNoEnum.NO.getValue().equals(detail.getIsSameAsPrevVersion()))
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
}
|
||||
// 获取两个文件
|
||||
@@ -993,21 +996,20 @@ public class ProcessStandardComplianceCheckServiceImpl extends ServiceImpl<Proce
|
||||
* @param detailInfoList
|
||||
*/
|
||||
private List<ProcessStandardComplianceCheckDetail> saveAllDetailData(List<ModelExcelVO> modelExcelVOList, List<ProcessStandardComplianceCheckDetail> detailInfoList) {
|
||||
List<ProcessStandardComplianceCheckDetail> result = new ArrayList<>();
|
||||
for (ProcessStandardComplianceCheckDetail detailInfo : detailInfoList) {
|
||||
for (ModelExcelVO modelExcelVO : modelExcelVOList) {
|
||||
ProcessStandardComplianceCheckDetail detail = new ProcessStandardComplianceCheckDetail();
|
||||
detail.setModel(modelExcelVO.getModel());
|
||||
detail.setModelStatus(modelExcelVO.getModelState());
|
||||
detail.setTermNumber(detailInfo.getTermNumber());
|
||||
detail.setTermTitle(detailInfo.getTermTitle());
|
||||
detail.setTermContent(detailInfo.getTermContent());
|
||||
detail.setAuthDept(detailInfo.getAuthDept());
|
||||
detail.setCheckId(detailInfo.getCheckId());
|
||||
result.add(detail);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
return detailInfoList.parallelStream() // 使用并行流
|
||||
.flatMap(detailInfo -> modelExcelVOList.parallelStream()
|
||||
.map(modelExcelVO -> {
|
||||
ProcessStandardComplianceCheckDetail detail = new ProcessStandardComplianceCheckDetail();
|
||||
detail.setModel(modelExcelVO.getModel());
|
||||
detail.setModelStatus(modelExcelVO.getModelState());
|
||||
detail.setTermNumber(detailInfo.getTermNumber());
|
||||
detail.setTermTitle(detailInfo.getTermTitle());
|
||||
detail.setTermContent(detailInfo.getTermContent());
|
||||
detail.setAuthDept(detailInfo.getAuthDept());
|
||||
detail.setCheckId(detailInfo.getCheckId());
|
||||
return detail;
|
||||
}))
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user