diff --git a/model/src/main/java/com/atjy/model/entity/UserAppointment.java b/model/src/main/java/com/atjy/model/entity/UserAppointment.java index 2b8b923..7d20347 100644 --- a/model/src/main/java/com/atjy/model/entity/UserAppointment.java +++ b/model/src/main/java/com/atjy/model/entity/UserAppointment.java @@ -1,5 +1,6 @@ package com.atjy.model.entity; +import com.atjy.model.enums.AppointmentStatus; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableName; import io.swagger.v3.oas.annotations.media.Schema; @@ -22,7 +23,7 @@ public class UserAppointment extends BaseEntity { @Schema(description = "状态") @TableField(value = "state") - private Byte state; + private AppointmentStatus state; @Schema(description = "医生id") @TableField(value = "doctor_id") @@ -30,7 +31,7 @@ public class UserAppointment extends BaseEntity { @Schema(description = "费用") @TableField(value = "fees") - private Long fees; + private Integer fees; @Schema(description = "就诊人姓名") @TableField(value = "name") diff --git a/model/src/main/java/com/atjy/model/enums/AppointmentStatus.java b/model/src/main/java/com/atjy/model/enums/AppointmentStatus.java new file mode 100644 index 0000000..861353f --- /dev/null +++ b/model/src/main/java/com/atjy/model/enums/AppointmentStatus.java @@ -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; + } +} diff --git a/web/web-app/src/main/java/com/atjy/web/app/service/impl/AppointmentInfoServiceImpl.java b/web/web-app/src/main/java/com/atjy/web/app/service/impl/AppointmentInfoServiceImpl.java index 84bb0bc..988ef5c 100644 --- a/web/web-app/src/main/java/com/atjy/web/app/service/impl/AppointmentInfoServiceImpl.java +++ b/web/web-app/src/main/java/com/atjy/web/app/service/impl/AppointmentInfoServiceImpl.java @@ -2,6 +2,8 @@ package com.atjy.web.app.service.impl; import com.atjy.common.login.LoginUserHolder; 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.service.AppointmentInfoService; import com.atjy.web.app.vo.appointment.AppointmentInfoVo; @@ -48,6 +50,7 @@ public class AppointmentInfoServiceImpl extends ServiceImpl() + .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); } } diff --git a/web/web-app/src/main/java/com/atjy/web/app/vo/appointment/AppointmentInfoVo.java b/web/web-app/src/main/java/com/atjy/web/app/vo/appointment/AppointmentInfoVo.java index a10e5e6..a8ff68a 100644 --- a/web/web-app/src/main/java/com/atjy/web/app/vo/appointment/AppointmentInfoVo.java +++ b/web/web-app/src/main/java/com/atjy/web/app/vo/appointment/AppointmentInfoVo.java @@ -16,6 +16,9 @@ public class AppointmentInfoVo { @Schema(description = "地址") private String address; + @Schema(description = "电话") + private String phone; + @Schema(description = "所属科室") private String department; diff --git a/web/web-app/src/main/java/com/atjy/web/app/vo/appointment/AppointmentOrderVo.java b/web/web-app/src/main/java/com/atjy/web/app/vo/appointment/AppointmentOrderVo.java index ab9d452..d007a79 100644 --- a/web/web-app/src/main/java/com/atjy/web/app/vo/appointment/AppointmentOrderVo.java +++ b/web/web-app/src/main/java/com/atjy/web/app/vo/appointment/AppointmentOrderVo.java @@ -23,7 +23,7 @@ public class AppointmentOrderVo { private String department; @Schema(description = "就诊费用") - private Long fees; + private Integer fees; @Schema(description = "就诊人姓名") private String name; diff --git a/web/web-app/src/main/java/com/atjy/web/app/vo/appointment/AppointmentSetOrderVo.java b/web/web-app/src/main/java/com/atjy/web/app/vo/appointment/AppointmentSetOrderVo.java index 3ba13da..e51a938 100644 --- a/web/web-app/src/main/java/com/atjy/web/app/vo/appointment/AppointmentSetOrderVo.java +++ b/web/web-app/src/main/java/com/atjy/web/app/vo/appointment/AppointmentSetOrderVo.java @@ -19,6 +19,9 @@ public class AppointmentSetOrderVo { @Schema(description = "就诊人手机号") private String phone; + @Schema(description = "费用") + private Integer fees; + @Schema(description = "备注") private String memo; }