This commit is contained in:
BLRTTX 2024-12-18 22:31:15 +08:00
parent d618f890a0
commit 2195c466bd
6 changed files with 61 additions and 4 deletions

View File

@ -1,5 +1,6 @@
package com.atjy.model.entity; package com.atjy.model.entity;
import com.atjy.model.enums.AppointmentStatus;
import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
@ -22,7 +23,7 @@ public class UserAppointment extends BaseEntity {
@Schema(description = "状态") @Schema(description = "状态")
@TableField(value = "state") @TableField(value = "state")
private Byte state; private AppointmentStatus state;
@Schema(description = "医生id") @Schema(description = "医生id")
@TableField(value = "doctor_id") @TableField(value = "doctor_id")
@ -30,7 +31,7 @@ public class UserAppointment extends BaseEntity {
@Schema(description = "费用") @Schema(description = "费用")
@TableField(value = "fees") @TableField(value = "fees")
private Long fees; private Integer fees;
@Schema(description = "就诊人姓名") @Schema(description = "就诊人姓名")
@TableField(value = "name") @TableField(value = "name")

View File

@ -0,0 +1,34 @@
package com.atjy.model.enums;
import com.baomidou.mybatisplus.annotation.EnumValue;
import com.fasterxml.jackson.annotation.JsonValue;
public enum AppointmentStatus implements BaseEnum {
WAIT(1, "待就诊"),
ALREADY(2, "已就诊");
@EnumValue
@JsonValue
private Integer code;
private String name;
AppointmentStatus(Integer code, String name) {
this.code = code;
this.name = name;
}
@Override
public Integer getCode() {
return this.code;
}
@Override
public String getName() {
return this.name;
}
}

View File

@ -2,6 +2,8 @@ package com.atjy.web.app.service.impl;
import com.atjy.common.login.LoginUserHolder; import com.atjy.common.login.LoginUserHolder;
import com.atjy.model.entity.*; import com.atjy.model.entity.*;
import com.atjy.model.enums.AppointmentStatus;
import com.atjy.model.enums.BaseStatus;
import com.atjy.web.app.mapper.*; import com.atjy.web.app.mapper.*;
import com.atjy.web.app.service.AppointmentInfoService; import com.atjy.web.app.service.AppointmentInfoService;
import com.atjy.web.app.vo.appointment.AppointmentInfoVo; import com.atjy.web.app.vo.appointment.AppointmentInfoVo;
@ -48,6 +50,7 @@ public class AppointmentInfoServiceImpl extends ServiceImpl<AppointmentInfoMappe
.eq(AppointmentInfo::getAppointmentDate, date)) .eq(AppointmentInfo::getAppointmentDate, date))
.getId())) .getId()))
.getFees()); .getFees());
appointmentInfoVo.setPhone(hospitalInfo.getPhone());
appointmentInfoVo.setHospitalName(hospitalInfo.getHospitalName()); appointmentInfoVo.setHospitalName(hospitalInfo.getHospitalName());
appointmentInfoVo.setAddress(hospitalInfo.getAddress()); appointmentInfoVo.setAddress(hospitalInfo.getAddress());
@ -86,6 +89,19 @@ public class AppointmentInfoServiceImpl extends ServiceImpl<AppointmentInfoMappe
@Override @Override
public void setAppointmentOrder(AppointmentSetOrderVo appointmentSetOrderVo) { public void setAppointmentOrder(AppointmentSetOrderVo appointmentSetOrderVo) {
// todo UserAppointment userAppointment = new UserAppointment();
userAppointment.setUserId(LoginUserHolder.getLoginUser().getUserId());
userAppointment.setDoctorId(appointmentSetOrderVo.getId());
userAppointment.setAppointmentId(appointmentInfoMapper.selectOne(new LambdaQueryWrapper<AppointmentInfo>()
.eq(AppointmentInfo::getAppointmentDate, appointmentSetOrderVo.getAppointmentDate()))
.getId());
userAppointment.setState(AppointmentStatus.WAIT);
userAppointment.setName(appointmentSetOrderVo.getName());
userAppointment.setPhone(appointmentSetOrderVo.getPhone());
userAppointment.setFees(appointmentSetOrderVo.getFees());
userAppointment.setMemo(appointmentSetOrderVo.getMemo());
userAppointmentMapper.insertOrUpdate(userAppointment);
} }
} }

View File

@ -16,6 +16,9 @@ public class AppointmentInfoVo {
@Schema(description = "地址") @Schema(description = "地址")
private String address; private String address;
@Schema(description = "电话")
private String phone;
@Schema(description = "所属科室") @Schema(description = "所属科室")
private String department; private String department;

View File

@ -23,7 +23,7 @@ public class AppointmentOrderVo {
private String department; private String department;
@Schema(description = "就诊费用") @Schema(description = "就诊费用")
private Long fees; private Integer fees;
@Schema(description = "就诊人姓名") @Schema(description = "就诊人姓名")
private String name; private String name;

View File

@ -19,6 +19,9 @@ public class AppointmentSetOrderVo {
@Schema(description = "就诊人手机号") @Schema(description = "就诊人手机号")
private String phone; private String phone;
@Schema(description = "费用")
private Integer fees;
@Schema(description = "备注") @Schema(description = "备注")
private String memo; private String memo;
} }