|
@@ -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);
|
|
|
}
|