From 12c97309b50530c8c7f9c6d48641c79d07a44b2b Mon Sep 17 00:00:00 2001
From: eight <641137800@qq.com>
Date: 星期三, 30 十月 2024 17:18:49 +0800
Subject: [PATCH] update

---
 jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/appointment/AppointmentServiceImpl.java |   13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/appointment/AppointmentServiceImpl.java b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/appointment/AppointmentServiceImpl.java
index ab08704..782f1a9 100644
--- a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/appointment/AppointmentServiceImpl.java
+++ b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/appointment/AppointmentServiceImpl.java
@@ -56,7 +56,12 @@
         appointment.setBookTime( LocalDateTime.now() );
         appointment.setBookSrc( 1 );
 
-        appointmentMapper.insert(appointment);
+        try {
+            appointmentMapper.insert(appointment);
+        } catch (DuplicateKeyException e) {
+            throw exception(APPOINTMENT_EXIST_TODAY);
+        }
+
         // 杩斿洖
         return appointment.getId();
     }
@@ -94,7 +99,7 @@
         // 鍏堜粠鍖婚櫌骞冲彴鏌ヨ
         AppointmentDO appointmentExtermal = getAppointmentExtermal( patId );
         if (null != appointmentExtermal && null != appointmentExtermal.getBookDate() && appointmentExtermal.getBookDate().isEqual(LocalDate.now()) ) {
-            // 鏌ヨDB涓� 鏄惁宸茬粡瀛樺湪
+            // 鏌ュ埌褰撳ぉ鐨勯绾﹀悗锛屾煡璇B涓� 鏄惁宸茬粡瀛樺湪
             AppointmentDO appointmentDO = appointmentMapper.getCurrentPatId( patId );
             if (null == appointmentDO ) {
                 appointmentExtermal.setBookSrc(0);
@@ -120,7 +125,9 @@
 
         // QueryRisReportList   queryEcgRequest
         RestApiResult<AppointmentExternal> result = remoteDataService.httpApi("queryEcgRequest", "ECG", "ECG", reqBodyVo);
-        result.getCode();
+        if (0 == result.getRow().size()) {
+            return null;
+        }
 
         AppointmentExternal appointmentExternal = result.getRow().get(0);
         AppointmentDO appointmentDO = BeanUtils.toBean( appointmentExternal, AppointmentDO.class );

--
Gitblit v1.9.3