瀏覽代碼

[진료관리 - 상세] 혈압/맥박 같은 행에 넣을 때 판단 기준 초까지 잡는 것으로 변경.

(cherry picked from commit 08ff9724b998b3edea4c49064454e2a668d6e9fa)
sjpark 4 年之前
父節點
當前提交
5013dc85a1
共有 1 個文件被更改,包括 15 次插入1 次删除
  1. 15 1
      src/main/java/com/lemon/lifecenter/controller/ClinicController.java

+ 15 - 1
src/main/java/com/lemon/lifecenter/controller/ClinicController.java

@@ -436,7 +436,21 @@ public class ClinicController extends LifeCenterController {
       PatientPHRHistoryDTO bp = bloodPressureResult.get(bloodPressureIndex);
       PatientPHRHistoryDTO pr = pulseRateResult.get(pulseRateIndex);
 
-      int dateDiffer = bp.getRecordedDateFormatted().compareTo(pr.getRecordedDateFormatted());
+      SimpleDateFormat originalFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
+      SimpleDateFormat targetFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+
+      String bpRecordedDateFormatted = bp.getRecordedDate();
+      String prRecordedDateFormatted = pr.getRecordedDate();
+      try {
+        Date t = originalFormat.parse(bpRecordedDateFormatted);
+        bpRecordedDateFormatted = targetFormat.format(t);
+        Date t2 = originalFormat.parse(prRecordedDateFormatted);
+        prRecordedDateFormatted = targetFormat.format(t2);
+      }
+      catch (Exception e) {
+      }
+
+      int dateDiffer = bpRecordedDateFormatted.compareTo(prRecordedDateFormatted);
       if (dateDiffer == 0) {
         union.setCreateDate(bp.getCreateDate());
         union.setRecordedDate(bp.getRecordedDate());