|
|
@@ -69,6 +69,8 @@ import java.util.stream.Collectors;
|
|
|
public class MedicalInsRuleProjectServiceImpl extends ServiceImpl<MedicalInsRuleProjectMapper, MedicalInsRuleProject> implements IMedicalInsRuleProjectService {
|
|
|
|
|
|
public static final String PROJECTCODE = "projectCode";
|
|
|
+ public static final String MEDICALDIAGNOSECODE = "medicalDiagnoseCode";
|
|
|
+ public static final String CORRELATIONMEDICALDIAGNOSECODE = "correlationMedicalDiagnoseCode";
|
|
|
public static final String CORRELATIONPROJECTCODE = "correlationProjectCode";
|
|
|
|
|
|
private final IMedicalInsRuleProjectDiagnoseService diagnoseService;
|
|
|
@@ -380,7 +382,22 @@ public class MedicalInsRuleProjectServiceImpl extends ServiceImpl<MedicalInsRule
|
|
|
if (!CollectionUtils.isEmpty(updateList)) {
|
|
|
updateNumber = updateList.size();
|
|
|
this.updateBatchById(updateList, 500);
|
|
|
-
|
|
|
+ if(fieldList.contains(MEDICALDIAGNOSECODE) ||fieldList.contains(CORRELATIONMEDICALDIAGNOSECODE)) {
|
|
|
+ Integer finalId2 = id;
|
|
|
+ updateList.stream().forEach(it -> {
|
|
|
+ if (StringUtils.hasText(it.getMedicalDiagnoseCode())) {
|
|
|
+ List<String> code = Arrays.asList(it.getMedicalDiagnoseCode().split("\n"));
|
|
|
+ Integer projectCodeType = 1;
|
|
|
+ diagnoseService.saveDiagnose(code, projectCodeType, finalId2, it.getProjectCode());
|
|
|
+ }
|
|
|
+ if (StringUtils.hasText(it.getCorrelationMedicalDiagnoseCode())) {
|
|
|
+ List<String> code = Arrays.asList(it.getCorrelationMedicalDiagnoseCode().split("\n"));
|
|
|
+ Integer projectCodeType = 2;
|
|
|
+ diagnoseService.saveDiagnose(code, projectCodeType, finalId2, it.getProjectCode());
|
|
|
+
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
}
|
|
|
// 取出差集
|
|
|
instalList = excelImportUtilService.getInsertDatas(list, dbExistsList, this::getDuplicateRm);
|
|
|
@@ -398,21 +415,22 @@ public class MedicalInsRuleProjectServiceImpl extends ServiceImpl<MedicalInsRule
|
|
|
// this.saveBatch(instalList, 500);
|
|
|
// insertService.apply(instalList, 500);
|
|
|
this.saveBatch(instalList, 500);
|
|
|
-// list<MedicalInsRuleProject>
|
|
|
- instalList.stream().forEach(it -> {
|
|
|
- if (StringUtils.hasText(it.getMedicalDiagnoseCode())) {
|
|
|
- List<String> code = Arrays.asList(it.getMedicalDiagnoseCode().split("\n"));
|
|
|
- Integer projectCodeType = 1;
|
|
|
- diagnoseService.saveDiagnose(code, projectCodeType, it.getMedicalInsRuleInfoId(), it.getProjectCode());
|
|
|
- }
|
|
|
- if (StringUtils.hasText(it.getCorrelationMedicalDiagnoseCode())) {
|
|
|
- List<String> code = Arrays.asList(it.getCorrelationMedicalDiagnoseCode().split("\n"));
|
|
|
- Integer projectCodeType = 2;
|
|
|
- diagnoseService.saveDiagnose(code, projectCodeType, it.getMedicalInsRuleInfoId(), it.getProjectCode());
|
|
|
-
|
|
|
- }
|
|
|
- });
|
|
|
-
|
|
|
+ if(fieldList.contains(MEDICALDIAGNOSECODE) ||fieldList.contains(CORRELATIONMEDICALDIAGNOSECODE)) {
|
|
|
+ Integer finalId1 = id;
|
|
|
+ instalList.stream().forEach(it -> {
|
|
|
+ if (StringUtils.hasText(it.getMedicalDiagnoseCode())) {
|
|
|
+ List<String> code = Arrays.asList(it.getMedicalDiagnoseCode().split("\n"));
|
|
|
+ Integer projectCodeType = 1;
|
|
|
+ diagnoseService.saveDiagnose(code, projectCodeType, finalId1, it.getProjectCode());
|
|
|
+ }
|
|
|
+ if (StringUtils.hasText(it.getCorrelationMedicalDiagnoseCode())) {
|
|
|
+ List<String> code = Arrays.asList(it.getCorrelationMedicalDiagnoseCode().split("\n"));
|
|
|
+ Integer projectCodeType = 2;
|
|
|
+ diagnoseService.saveDiagnose(code, projectCodeType, finalId1, it.getProjectCode());
|
|
|
+
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
}
|
|
|
//400条 saveBatch消耗时间1592毫秒 循环插入消耗时间1947毫秒
|
|
|
//1200条 saveBatch消耗时间3687毫秒 循环插入消耗时间5212毫秒
|