|
@@ -416,8 +416,7 @@ public class DiagnoseFacade extends DiagnoseServiceImpl {
|
|
|
|
|
|
// 更新明细
|
|
// 更新明细
|
|
if (ListUtil.isNotEmpty(diagnoseDetailList)) {
|
|
if (ListUtil.isNotEmpty(diagnoseDetailList)) {
|
|
-// diagnoseDetailService.updateBatchById(diagnoseDetailList);
|
|
|
|
- diagnoseDetailService.updateBatch(diagnoseDetailList);
|
|
|
|
|
|
+ diagnoseDetailService.updateBatch(diagnoseDetailList); // 效率比框架的updateBatchById高很多
|
|
}
|
|
}
|
|
|
|
|
|
Long time5 = System.currentTimeMillis();
|
|
Long time5 = System.currentTimeMillis();
|
|
@@ -428,26 +427,33 @@ public class DiagnoseFacade extends DiagnoseServiceImpl {
|
|
// 新增问题词
|
|
// 新增问题词
|
|
if (ListUtil.isNotEmpty(diagnoseQuestionList)) {
|
|
if (ListUtil.isNotEmpty(diagnoseQuestionList)) {
|
|
// 新增问题词数据
|
|
// 新增问题词数据
|
|
- diagnoseQuestionService.saveBatch(diagnoseQuestionList);
|
|
|
|
-
|
|
|
|
|
|
+ diagnoseQuestionService.insertBatch(diagnoseQuestionList); // 效率比框架的saveBatch高很多
|
|
}
|
|
}
|
|
Long time6 = System.currentTimeMillis();
|
|
Long time6 = System.currentTimeMillis();
|
|
- res.append("新增问题词:" + (time6-time5)/1000.0).append("秒,");
|
|
|
|
|
|
+ res.append("新增问题词" + diagnoseQuestionList.size() + "条:" + (time6-time5)/1000.0).append("秒,");
|
|
|
|
|
|
List<String> disNameList = diagnoseQuestionList.stream().map(row -> row.getDisName()).distinct().collect(Collectors.toList());
|
|
List<String> disNameList = diagnoseQuestionList.stream().map(row -> row.getDisName()).distinct().collect(Collectors.toList());
|
|
|
|
|
|
// 修改问题词表的状态
|
|
// 修改问题词表的状态
|
|
|
|
+ List<Diagnose> updateDiagnose = new ArrayList<>();
|
|
for (Diagnose diagnose : diagnoseListWithDB) {
|
|
for (Diagnose diagnose : diagnoseListWithDB) {
|
|
|
|
+ String oldHasQueston = diagnose.getHasQuestion();
|
|
if (disNameList.contains(diagnose.getDisName())) {
|
|
if (disNameList.contains(diagnose.getDisName())) {
|
|
diagnose.setHasQuestion(String.valueOf(HasQuestionEnum.HAS_QUESTION.getKey()));
|
|
diagnose.setHasQuestion(String.valueOf(HasQuestionEnum.HAS_QUESTION.getKey()));
|
|
} else {
|
|
} else {
|
|
diagnose.setHasQuestion(String.valueOf(HasQuestionEnum.NO_QUESTION.getKey()));
|
|
diagnose.setHasQuestion(String.valueOf(HasQuestionEnum.NO_QUESTION.getKey()));
|
|
}
|
|
}
|
|
|
|
+ if (!oldHasQueston.equals(diagnose.getHasQuestion())) {
|
|
|
|
+ updateDiagnose.add(diagnose);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
// 更新主表信息
|
|
// 更新主表信息
|
|
- diagnoseService.updateBatchById(diagnoseListWithDB);
|
|
|
|
|
|
+ if (ListUtil.isNotEmpty(updateDiagnose)) {
|
|
|
|
+// diagnoseService.updateBatchById(updateDiagnose);
|
|
|
|
+ diagnoseService.updateBatch(updateDiagnose);
|
|
|
|
+ }
|
|
Long time7 = System.currentTimeMillis();
|
|
Long time7 = System.currentTimeMillis();
|
|
- res.append("更新主表状态:" + (time7-time6)/1000.0).append("秒,");
|
|
|
|
|
|
+ res.append("更新主表" +updateDiagnose.size()+ "条:" + (time7-time6)/1000.0).append("秒,");
|
|
res.append("总计花费时间:" + (time7-time1)/1000.0).append("秒。");
|
|
res.append("总计花费时间:" + (time7-time1)/1000.0).append("秒。");
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, e.getMessage());
|
|
throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, e.getMessage());
|