LIJU 2 周之前
父节点
当前提交
3e5109cd48

+ 18 - 0
src/main/java/thyyxxk/webserver/service/medicaladvice/nursing/NursingManagementService.java

@@ -103,6 +103,7 @@ public class NursingManagementService {
     // }
 
     static {
+        // 新的映射关系(前端显示值 -> 后端时间)
         recTimeMap.put("2", "02:00");
         recTimeMap.put("6", "06:00");
         recTimeMap.put("10", "10:00");
@@ -110,12 +111,29 @@ public class NursingManagementService {
         recTimeMap.put("18", "18:00");
         recTimeMap.put("22", "22:00");
 
+        // 新的反向映射(后端时间 -> 前端显示值)
         recTimeMap.put("02:00", "2");
         recTimeMap.put("06:00", "6");
         recTimeMap.put("10:00", "10");
         recTimeMap.put("14:00", "14");
         recTimeMap.put("18:00", "18");
         recTimeMap.put("22:00", "22");
+
+        // 兼容旧数据的映射(保持向后兼容)
+        recTimeMap.put("3", "03:00");
+        recTimeMap.put("7", "07:00");
+        recTimeMap.put("11", "11:00");
+        recTimeMap.put("15", "15:00");
+        recTimeMap.put("19", "19:00");
+        recTimeMap.put("23", "23:00");
+
+        // 旧数据的反向映射
+        recTimeMap.put("03:00", "3");
+        recTimeMap.put("07:00", "7");
+        recTimeMap.put("11:00", "11");
+        recTimeMap.put("15:00", "15");
+        recTimeMap.put("19:00", "19");
+        recTimeMap.put("23:00", "23");
     }
 
     @Autowired