新增预约限制:同一个医生 一天只能预约一次;

master
gongzhenkun 2 years ago
parent 8c4314fb83
commit 3fa1bb4ff5

@ -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<TRecord> 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();

@ -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())

@ -284,6 +284,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="doctorId != null "> and doctor_id = #{doctorId}</if>
<if test="hospitalId != null "> and hospital_id = #{hospitalId}</if>
<if test="status != null and status != ''"> and status = #{status}</if>
<if test="createTime != null and createTime != ''"> and DATE_FORMAT( create_time, '%Y-%m-%d' ) = DATE_FORMAT(#{appointmentTime},'%Y-%m-%d')</if>
<if test="aiResult != null and aiResult != ''"> and ai_result = #{aiResult}</if>
<if test="aiResult2 != null and aiResult2 != ''"> and ai_result2 = #{aiResult2}</if>
<if test="updateResult != null and updateResult != ''"> and update_result = #{updateResult}</if>

Loading…
Cancel
Save