新增处理医生问诊配置方法,后台多点审核医生时,增加医生问诊购药配置
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"gorm.io/gorm"
|
||||
"hospital-admin-api/global"
|
||||
"time"
|
||||
)
|
||||
|
||||
// DoctorInquiryConfig 医生接诊配置表
|
||||
type DoctorInquiryConfig struct {
|
||||
InquiryConfigId int64 `gorm:"column:inquiry_config_id;type:bigint(19);primary_key;comment:主键id" json:"inquiry_config_id"`
|
||||
DoctorId int64 `gorm:"column:doctor_id;type:bigint(19);comment:医生id" json:"doctor_id"`
|
||||
InquiryType int `gorm:"column:inquiry_type;type:tinyint(1);default:1;comment:接诊类型(1:专家问诊 2:快速问诊 3:公益问诊 4:问诊购药);NOT NULL" json:"inquiry_type"`
|
||||
InquiryMode int `gorm:"column:inquiry_mode;type:tinyint(1);default:1;comment:接诊方式(1:图文 2:视频 3:语音 4:电话 5:会员);NOT NULL" json:"inquiry_mode"`
|
||||
IsEnable int `gorm:"column:is_enable;type:tinyint(1);default:0;comment:是否启用(0:否 1:是)" json:"is_enable"`
|
||||
LastEnableMethod int `gorm:"column:last_enable_method;type:tinyint(1);default:1;comment:最后开启方式(1:自己 2:后台)" json:"last_enable_method"`
|
||||
WorkNumDay int `gorm:"column:work_num_day;type:int(10);default:0;comment:每日接诊数量" json:"work_num_day"`
|
||||
InquiryPrice float64 `gorm:"column:inquiry_price;type:decimal(10,2);comment:接诊价格(专家问诊-公益问诊)" json:"inquiry_price"`
|
||||
Model
|
||||
}
|
||||
|
||||
func (m *DoctorInquiryConfig) TableName() string {
|
||||
return "gdxz_doctor_inquiry_config"
|
||||
}
|
||||
|
||||
func (m *DoctorInquiryConfig) BeforeCreate(tx *gorm.DB) error {
|
||||
if m.InquiryConfigId == 0 {
|
||||
m.InquiryConfigId = 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
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"gorm.io/gorm"
|
||||
"hospital-admin-api/global"
|
||||
"time"
|
||||
)
|
||||
|
||||
// SystemInquiryConfig 系统问诊配置
|
||||
type SystemInquiryConfig struct {
|
||||
SystemInquiryConfigId int64 `gorm:"column:system_inquiry_config_id;type:bigint(19);primary_key;comment:主键id" json:"system_inquiry_config_id"`
|
||||
InquiryType int `gorm:"column:inquiry_type;type:tinyint(1);comment:接诊类型(1:专家问诊 2:快速问诊 3:公益问诊 4:问诊购药 5:检测)" json:"inquiry_type"`
|
||||
InquiryMode int `gorm:"column:inquiry_mode;type:tinyint(1);default:1;comment:接诊方式(1:图文 2:视频 3:语音 4:电话 5:会员)" json:"inquiry_mode"`
|
||||
MaxWorkNumDay int `gorm:"column:max_work_num_day;type:int(11);default:0;comment:每日最大接诊数量" json:"max_work_num_day"`
|
||||
InquiryPrice string `gorm:"column:inquiry_price;type:varchar(255);comment:接诊价格" json:"inquiry_price"`
|
||||
MinInquiryPrice float64 `gorm:"column:min_inquiry_price;type:decimal(10,2);comment:最低接诊价格(专家问诊)" json:"min_inquiry_price"`
|
||||
MaxInquiryPrice float64 `gorm:"column:max_inquiry_price;type:decimal(10,2);comment:最高接诊价格(专家问诊)" json:"max_inquiry_price"`
|
||||
TimesNumber int `gorm:"column:times_number;type:int(11);default:0;comment:沟通次数(0为不限制次数)" json:"times_number"`
|
||||
Duration int `gorm:"column:duration;type:int(11);default:0;comment:沟通时长(分钟,0为不限制时长)" json:"duration"`
|
||||
Model
|
||||
}
|
||||
|
||||
func (m *SystemInquiryConfig) TableName() string {
|
||||
return "gdxz_system_inquiry_config"
|
||||
}
|
||||
|
||||
func (m *SystemInquiryConfig) BeforeCreate(tx *gorm.DB) error {
|
||||
if m.SystemInquiryConfigId == 0 {
|
||||
m.SystemInquiryConfigId = 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
|
||||
}
|
||||
Reference in New Issue
Block a user