Prechádzať zdrojové kódy

治疗方案没有药品推荐不展示

zhaops 5 rokov pred
rodič
commit
83ff126658

+ 6 - 14
aipt-service/src/main/java/com/diagbot/facade/TreatmentFacade.java

@@ -74,7 +74,8 @@ public class TreatmentFacade {
         List<AdverseReaction> adverseReactionList = treat.getAdverseEvent();
 
         if (ListUtil.isNotEmpty(treatmentPlanList)) {
-            for (TreatmentPlan treatmentPlan : treatmentPlanList) {
+            for (int index = 0; index < treatmentPlanList.size(); index++) {
+                TreatmentPlan treatmentPlan = treatmentPlanList.get(index);
                 List<MeditionDetail> meditionDetailList = treatmentPlan.getMeditionDetails();
                 if (ListUtil.isNotEmpty(meditionDetailList)) {
                     for (MeditionDetail meditionDetail : meditionDetailList) {
@@ -107,23 +108,14 @@ public class TreatmentFacade {
                                     .collect(Collectors.toList());
                             conceptNameList.addAll(drugNameList);
                         } else {
-                            if(StringUtil.isBlank(meditionDetail.getDescription())) {
-                                meditionDetailList.remove(meditionDetail);
-                                meditionDetailList.size();
-                                if (meditionDetailList.size() == 0) {
-                                    break;
-                                }
+                            if (StringUtil.isBlank(meditionDetail.getDescription())) {
+                                treatmentPlanList.remove(index);
+                                index--;
+                                break;
                             }
                         }
                     }
                 }
-                if (ListUtil.isEmpty(meditionDetailList)) {
-                    treatmentPlanList.remove(treatmentPlan);
-                    treatmentPlanList.size();
-                    if (treatmentPlanList.size() == 0) {
-                        break;
-                    }
-                }
             }
         }
         if (ListUtil.isNotEmpty(adverseReactionList)) {