新增问诊订单详情。修改错误码格式

This commit is contained in:
2023-09-06 14:30:54 +08:00
parent dc0217d191
commit 654c0fed05
23 changed files with 810 additions and 59 deletions
+41
View File
@@ -0,0 +1,41 @@
package model
import (
"gorm.io/gorm"
"hospital-admin-api/global"
"time"
)
// OrderEvaluation 订单-评价表
type OrderEvaluation struct {
EvaluationId int64 `gorm:"column:evaluation_id;type:bigint(19);primary_key;comment:主键id" json:"evaluation_id"`
DoctorId int64 `gorm:"column:doctor_id;type:bigint(19);comment:医生id;NOT NULL" json:"doctor_id"`
PatientId int64 `gorm:"column:patient_id;type:bigint(19);comment:患者id;NOT NULL" json:"patient_id"`
OrderInquiryId int64 `gorm:"column:order_inquiry_id;type:bigint(19);comment:订单-问诊id;NOT NULL" json:"order_inquiry_id"`
NameMask string `gorm:"column:name_mask;type:varchar(255);comment:患者姓名(掩码)" json:"name_mask"`
ReplyQuality float64 `gorm:"column:reply_quality;type:float(10,2);default:100.00;comment:回复质量(百分制)" json:"reply_quality"`
ServiceAttitude float64 `gorm:"column:service_attitude;type:float(10,2);default:100.00;comment:服务态度(百分制)" json:"service_attitude"`
ReplyProgress float64 `gorm:"column:reply_progress;type:float(10,2);default:100.00;comment:回复速度(百分制)" json:"reply_progress"`
AvgScore float64 `gorm:"column:avg_score;type:float(10,2);default:100.00;comment:平均得分(百分制,回复质量占4、服务态度占3、回复速度占3,计算公式:每个得分 * 占比 相加)" json:"avg_score"`
Type int `gorm:"column:type;type:tinyint(1);default:1;comment:类型(1:默认评价 2:主动评价)" json:"type"`
Content string `gorm:"column:content;type:text;comment:评价内容" json:"content"`
Model
}
func (m *OrderEvaluation) TableName() string {
return "gdxz_order_evaluation"
}
func (m *OrderEvaluation) BeforeCreate(tx *gorm.DB) error {
if m.EvaluationId == 0 {
m.EvaluationId = global.Snowflake.Generate().Int64()
}
m.CreatedAt = LocalTime(time.Now())
tx.Statement.SetColumn("CreatedAt", m.CreatedAt)
m.UpdatedAt = LocalTime(time.Now())
tx.Statement.SetColumn("UpdatedAt", m.UpdatedAt)
return nil
}
+54
View File
@@ -0,0 +1,54 @@
package model
import (
"gorm.io/gorm"
"hospital-admin-api/global"
"time"
)
// OrderInquiryCase 订单-问诊病例表
type OrderInquiryCase struct {
InquiryCaseId int64 `gorm:"column:inquiry_case_id;type:bigint(19);primary_key;comment:主键id" json:"inquiry_case_id"`
UserId int64 `gorm:"column:user_id;type:bigint(19);comment:用户id" json:"user_id"`
PatientId int64 `gorm:"column:patient_id;type:bigint(19);comment:患者id" json:"patient_id"`
OrderInquiryId int64 `gorm:"column:order_inquiry_id;type:bigint(19);comment:订单-问诊id;NOT NULL" json:"order_inquiry_id"`
FamilyId int64 `gorm:"column:family_id;type:bigint(19);comment:家庭成员id" json:"family_id"`
Relation int `gorm:"column:relation;type:tinyint(1);default:1;comment:与患者关系(1:本人 2:父母 3:爱人 4:子女 5:亲戚 6:其他 " json:"relation"`
Status int `gorm:"column:status;type:tinyint(1);default:1;comment:状态(1:正常 2:删除)" json:"status"`
Name string `gorm:"column:name;type:varchar(50);comment:患者名称" json:"name"`
Sex int `gorm:"column:sex;type:tinyint(1);default:0;comment:患者性别(0:未知 1:男 2:女)" json:"sex"`
Age int `gorm:"column:age;type:int(11);comment:患者年龄" json:"age"`
Height string `gorm:"column:height;type:varchar(100);comment:身高(cm" json:"height"`
Weight string `gorm:"column:weight;type:varchar(100);comment:体重(kg" json:"weight"`
DiseaseClassId int64 `gorm:"column:disease_class_id;type:bigint(19);comment:疾病分类id-系统" json:"disease_class_id"`
DiseaseClassName string `gorm:"column:disease_class_name;type:varchar(255);comment:疾病名称-系统" json:"disease_class_name"`
DiagnosisDate LocalTime `gorm:"column:diagnosis_date;type:datetime;comment:确诊日期" json:"diagnosis_date"`
DiseaseDesc string `gorm:"column:disease_desc;type:text;comment:病情描述(主诉)" json:"disease_desc"`
DiagnoseImages string `gorm:"column:diagnose_images;type:varchar(1000);comment:复诊凭证(多个使用逗号分隔)" json:"diagnose_images"`
IsAllergyHistory int `gorm:"column:is_allergy_history;type:tinyint(1);comment:是否存在过敏史(0:否 1:是)" json:"is_allergy_history"`
AllergyHistory string `gorm:"column:allergy_history;type:varchar(255);comment:过敏史描述" json:"allergy_history"`
IsFamilyHistory int `gorm:"column:is_family_history;type:tinyint(1);comment:是否存在家族病史(0:否 1:是)" json:"is_family_history"`
FamilyHistory string `gorm:"column:family_history;type:varchar(255);comment:家族病史描述" json:"family_history"`
IsPregnant int `gorm:"column:is_pregnant;type:tinyint(1);comment:是否备孕、妊娠、哺乳期(0:否 1:是)" json:"is_pregnant"`
Pregnant string `gorm:"column:pregnant;type:varchar(255);comment:备孕、妊娠、哺乳期描述" json:"pregnant"`
IsTaboo int `gorm:"column:is_taboo;type:tinyint(1);comment:是否服用过禁忌药物,且无相关禁忌(0:否 1:是)问诊购药时存在" json:"is_taboo"`
Model
}
func (m *OrderInquiryCase) TableName() string {
return "gdxz_order_inquiry_case"
}
func (m *OrderInquiryCase) BeforeCreate(tx *gorm.DB) error {
if m.InquiryCaseId == 0 {
m.InquiryCaseId = global.Snowflake.Generate().Int64()
}
m.CreatedAt = LocalTime(time.Now())
tx.Statement.SetColumn("CreatedAt", m.CreatedAt)
m.UpdatedAt = LocalTime(time.Now())
tx.Statement.SetColumn("UpdatedAt", m.UpdatedAt)
return nil
}
+1 -1
View File
@@ -17,7 +17,7 @@ type OrderInquiryRefund struct {
InquiryRefundStatus int `gorm:"column:inquiry_refund_status;type:tinyint(4);comment:问诊订单退款状态(0:无退款 1:申请退款 2:退款中 3:退款成功 4:拒绝退款 5:退款关闭 6:退款异常)" json:"inquiry_refund_status"`
RefundTotal float64 `gorm:"column:refund_total;type:decimal(10,2);comment:退款金额" json:"refund_total"`
RefundReason string `gorm:"column:refund_reason;type:varchar(255);comment:退款原因" json:"refund_reason"`
SuccessTime time.Time `gorm:"column:success_time;type:datetime;comment:退款成功时间" json:"success_time"`
SuccessTime LocalTime `gorm:"column:success_time;type:datetime;comment:退款成功时间" json:"success_time"`
Model
}