From 3fa1bb4ff58040da0cd71fc93d8b619ecca1b1c9 Mon Sep 17 00:00:00 2001 From: gongzhenkun <1658878546@qq.com> Date: Thu, 1 Sep 2022 11:54:42 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E9=A2=84=E7=BA=A6=E9=99=90?= =?UTF-8?q?=E5=88=B6=EF=BC=9A=E5=90=8C=E4=B8=80=E4=B8=AA=E5=8C=BB=E7=94=9F?= =?UTF-8?q?=20=E4=B8=80=E5=A4=A9=E5=8F=AA=E8=83=BD=E9=A2=84=E7=BA=A6?= =?UTF-8?q?=E4=B8=80=E6=AC=A1=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ruoyi/web/controller/api/AppController.java | 7 +++++++ .../main/java/com/ruoyi/system/domain/TRecord.java | 11 +++++++++++ .../main/resources/mapper/system/TRecordMapper.xml | 1 + 3 files changed, 19 insertions(+) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/AppController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/AppController.java index ff805e2..5df476e 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/AppController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/AppController.java @@ -666,6 +666,13 @@ public class AppController extends BaseController tRecord.setPatientId(patientId); tRecord.setDoctorId(getUserId()); tRecord.setStatus("0"); + // 新增预约限制:同一个医生 一天只能预约一次; + tRecord.setAppointmentTime(DateUtils.dateTime(new Date())); + List tRecords = tRecordService.selectTRecordList(tRecord); + if (!CollectionUtils.isEmpty(tRecords)) { + String appointmentTime = DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS ,tRecords.get(0).getCreateTime()); + return AjaxResult.error("同一个医生,一天只能预约一次;您今天已经在" + appointmentTime + "预约"); + } tRecord.setCreateBy(getUsername()); tRecordService.insertTRecord(tRecord); TPatientHospitalDoctor tPatientHospitalDoctor = new TPatientHospitalDoctor(); diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/TRecord.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/TRecord.java index 3ad0fb2..1d19875 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/domain/TRecord.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/TRecord.java @@ -79,6 +79,8 @@ public class TRecord extends BaseEntity @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private Date aiResultModifyTime; + private String appointmentTime; + public void setId(Long id) { this.id = id; @@ -217,6 +219,14 @@ public class TRecord extends BaseEntity this.aiResultModifyTime = aiResultModifyTime; } + public String getAppointmentTime() { + return appointmentTime; + } + + public void setAppointmentTime(String appointmentTime) { + this.appointmentTime = appointmentTime; + } + @Override public String toString() { return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) @@ -232,6 +242,7 @@ public class TRecord extends BaseEntity .append("createTime", getCreateTime()) .append("updateTime", getUpdateTime()) .append("uploadTime", getUploadTime()) + .append("appointmentTime", getAppointmentTime()) .append("imgSx", getImgSx()) .append("imgSm", getImgSm()) .append("responseTime", getResponseTime()) diff --git a/ruoyi-system/src/main/resources/mapper/system/TRecordMapper.xml b/ruoyi-system/src/main/resources/mapper/system/TRecordMapper.xml index 31eae4c..d442750 100644 --- a/ruoyi-system/src/main/resources/mapper/system/TRecordMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/TRecordMapper.xml @@ -284,6 +284,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and doctor_id = #{doctorId} and hospital_id = #{hospitalId} and status = #{status} + and DATE_FORMAT( create_time, '%Y-%m-%d' ) = DATE_FORMAT(#{appointmentTime},'%Y-%m-%d') and ai_result = #{aiResult} and ai_result2 = #{aiResult2} and update_result = #{updateResult}