Procházet zdrojové kódy

fix 修改接口,对参数传值做兼容

DYH2020 před 2 roky
rodič
revize
0b7e55e006

+ 8 - 2
src/main/java/com/ywt/mg/web/controller/DrugController.java

@@ -114,9 +114,15 @@ public class DrugController {
 
                     int daysOfMedicationInt = 0;
                     String daysOfMedication = drugInfo.getDaysOfMedication();
-                    daysOfMedication = daysOfMedication.replace("天", "");
+
                     try {
-                        daysOfMedicationInt = Integer.parseInt(daysOfMedication);
+                        if (daysOfMedication.contains("天")) {
+                            daysOfMedication = daysOfMedication.replace("天", "");
+                            daysOfMedicationInt = Integer.parseInt(daysOfMedication);
+                        } else if (daysOfMedication.contains("周")) {
+                            daysOfMedication = daysOfMedication.replace("周", "");
+                            daysOfMedicationInt = Integer.parseInt(daysOfMedication) * 7;
+                        }
                     } catch (Exception e) {
                         logger.error("--daysOfMedication 格式化出错--:{}", daysOfMedication);
                     }