From 784c60d5baad7edceab2f1668ed9116e5b5e5e89 Mon Sep 17 00:00:00 2001
From: eight <641137800@qq.com>
Date: 星期四, 31 十月 2024 16:22:50 +0800
Subject: [PATCH] update
---
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/appointment/AppointmentServiceImpl.java | 21 +++++++++++++++++----
1 files changed, 17 insertions(+), 4 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..7ce9921 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();
}
@@ -90,11 +95,17 @@
}
@Override
- public AppointmentDO getAppointmentByPatId(String patId) {
+ public AppointmentDO getCurAppointmentByPatId(String patId) {
+ AppointmentDO appointmentDO = appointmentMapper.getCurrentPatId( patId );
+ return appointmentDO;
+ }
+
+ @Override
+ public AppointmentDO queryAndCreateAppointmentByPatId(String patId) {
// 鍏堜粠鍖婚櫌骞冲彴鏌ヨ
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 +131,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