Browse Source

手术开始时间不能早于入院时间前24小时

lighter 7 months ago
parent
commit
5cb5c2babe

+ 7 - 3
src/main/java/thyyxxk/webserver/service/inpatient/casefrontsheet/VerifyCaseFrontSheet.java

@@ -524,11 +524,15 @@ public class VerifyCaseFrontSheet {
         if (null == opEnd) {
             errors.add("手术结束时间不能为空。");
         }
-        if (null != opStart && null != admDate && opStart.before(admDate)) {
-            errors.add("手术开始时间不能早于入院时间");
+        if (null != opStart && null != admDate) {
+            long admstamp = admDate.getTime() - (24 * 60 * 60 * 1000);
+            long srgstamp = opStart.getTime();
+            if (admstamp > srgstamp) {
+                errors.add("手术开始时间不能早于入院时间前24小时");
+            }
         }
         if (null != opStart && null != disDate && opStart.after(disDate)) {
-            errors.add("手术开始时间不能晚于入院时间。");
+            errors.add("手术开始时间不能晚于院时间。");
         }
         if (null != opStart && null != opEnd && opEnd.before(opStart)) {
             errors.add("手术开始时间不能晚于手术结束时间。");