新增医生问诊配置详情
This commit is contained in:
@@ -7,21 +7,23 @@ import (
|
||||
)
|
||||
|
||||
type DoctorInquiryConfigDto struct {
|
||||
InquiryConfigId string `json:"inquiry_config_id"` // 主键id
|
||||
DoctorId string `json:"doctor_id"` // 医生id
|
||||
InquiryType int `json:"inquiry_type"` // 接诊类型(1:专家问诊 2:快速问诊 3:公益问诊 4:问诊购药);NOT NULL
|
||||
InquiryMode int `json:"inquiry_mode"` // 接诊方式(1:图文 2:视频 3:语音 4:电话 5:会员);NOT NULL
|
||||
IsEnable int `json:"is_enable"` // 是否启用(0:否 1:是)
|
||||
LastEnableMethod int `json:"last_enable_method"` // 最后开启方式(1:自己 2:后台)
|
||||
WorkNumDay int `json:"work_num_day"` // 每日接诊数量
|
||||
InquiryPrice float64 `json:"inquiry_price"` // 接诊价格(专家问诊-公益问诊)
|
||||
CreatedAt model.LocalTime `json:"created_at"` // 创建时间
|
||||
UpdatedAt model.LocalTime `json:"updated_at"` // 修改时间
|
||||
DoctorName string `json:"doctor_name"` // 医生姓名
|
||||
MobileMask string `json:"mobile_mask"` // 医生电话(掩码)
|
||||
DepartmentCustomName string `json:"department_custom_name"` // 科室名称
|
||||
DoctorTitle *int `json:"doctor_title"` // 医生职称(1:主任医师 2:主任中医师 3:副主任医师 4:副主任中医师 5:主治医师 6:住院医师)
|
||||
MultiPointStatus int `json:"multi_point_status"` // 医生多点执业认证状态(0:未认证 1:认证通过 2:审核中 3:认证失败)
|
||||
InquiryConfigId string `json:"inquiry_config_id"` // 主键id
|
||||
DoctorId string `json:"doctor_id"` // 医生id
|
||||
InquiryType int `json:"inquiry_type"` // 接诊类型(1:专家问诊 2:快速问诊 3:公益问诊 4:问诊购药);NOT NULL
|
||||
InquiryMode int `json:"inquiry_mode"` // 接诊方式(1:图文 2:视频 3:语音 4:电话 5:会员);NOT NULL
|
||||
IsEnable int `json:"is_enable"` // 是否启用(0:否 1:是)
|
||||
LastEnableMethod int `json:"last_enable_method"` // 最后开启方式(1:自己 2:后台)
|
||||
WorkNumDay int `json:"work_num_day"` // 每日接诊数量
|
||||
InquiryPrice float64 `json:"inquiry_price"` // 接诊价格(专家问诊-公益问诊)
|
||||
CreatedAt model.LocalTime `json:"created_at"` // 创建时间
|
||||
UpdatedAt model.LocalTime `json:"updated_at"` // 修改时间
|
||||
DoctorName string `json:"doctor_name"` // 医生姓名
|
||||
MobileMask string `json:"mobile_mask"` // 医生电话(掩码)
|
||||
DepartmentCustomName string `json:"department_custom_name"` // 科室名称
|
||||
DoctorTitle *int `json:"doctor_title"` // 医生职称(1:主任医师 2:主任中医师 3:副主任医师 4:副主任中医师 5:主治医师 6:住院医师)
|
||||
MultiPointStatus int `json:"multi_point_status"` // 医生多点执业认证状态(0:未认证 1:认证通过 2:审核中 3:认证失败)
|
||||
UserDoctor *UserDoctorDto `json:"user_doctor"` // 医生数据
|
||||
DoctorInquiryTime []*DoctorInquiryTimeDto `json:"doctor_inquiry_time"` // 医生问诊时间配置
|
||||
}
|
||||
|
||||
func GetDoctorInquiryConfigDto(m *model.DoctorInquiryConfig) *DoctorInquiryConfigDto {
|
||||
@@ -130,3 +132,27 @@ func (r *DoctorInquiryConfigDto) LoadDoctorMultiPointStatus(m *model.UserDoctor)
|
||||
}
|
||||
return r
|
||||
}
|
||||
|
||||
// LoadUserDoctor 加载医生数据
|
||||
func (r *DoctorInquiryConfigDto) LoadUserDoctor(m *model.UserDoctor) *DoctorInquiryConfigDto {
|
||||
if m != nil {
|
||||
r.UserDoctor = GetUserDoctorDto(m)
|
||||
}
|
||||
return r
|
||||
}
|
||||
|
||||
// LoadUserDoctorHospital 加载医生医院数据
|
||||
func (r *DoctorInquiryConfigDto) LoadUserDoctorHospital(m *model.Hospital) *DoctorInquiryConfigDto {
|
||||
if m != nil && r.UserDoctor != nil {
|
||||
r.UserDoctor.Hospital = GetHospitalDto(m)
|
||||
}
|
||||
return r
|
||||
}
|
||||
|
||||
// LoadDoctorInquiryTime 加载医生问诊时间
|
||||
func (r *DoctorInquiryConfigDto) LoadDoctorInquiryTime(m []*model.DoctorInquiryTime) *DoctorInquiryConfigDto {
|
||||
if len(m) > 0 {
|
||||
r.DoctorInquiryTime = GetDoctorInquiryTimeListDto(m)
|
||||
}
|
||||
return r
|
||||
}
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
package dto
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"hospital-admin-api/api/model"
|
||||
)
|
||||
|
||||
type DoctorInquiryTimeDto struct {
|
||||
InquiryTimeId string `json:"inquiry_time_id"` // 主键id
|
||||
DoctorId string `json:"doctor_id"` // 医生id
|
||||
InquiryType int `json:"inquiry_type"` // 接诊类型(1:专家问诊 2:快速问诊 3:公益问诊 4:问诊购药)
|
||||
InquiryMode int `json:"inquiry_mode"` // 接诊方式(1:图文 2:视频 3:语音 4:电话 5:会员)
|
||||
InquiryDate model.LocalTime `json:"inquiry_date"` // 日期(可为空)
|
||||
StartTime string `json:"start_time"` // 开始时间
|
||||
EndTime string `json:"end_time"` // 结束时间
|
||||
CreatedAt model.LocalTime `json:"created_at"` // 创建时间
|
||||
UpdatedAt model.LocalTime `json:"updated_at"` // 修改时间
|
||||
}
|
||||
|
||||
func GetDoctorInquiryTimeDto(m *model.DoctorInquiryTime) *DoctorInquiryTimeDto {
|
||||
return &DoctorInquiryTimeDto{
|
||||
InquiryTimeId: fmt.Sprintf("%d", m.InquiryTimeId),
|
||||
DoctorId: fmt.Sprintf("%d", m.DoctorId),
|
||||
InquiryType: m.InquiryType,
|
||||
InquiryMode: m.InquiryMode,
|
||||
InquiryDate: m.InquiryDate,
|
||||
StartTime: m.StartTime,
|
||||
EndTime: m.EndTime,
|
||||
CreatedAt: m.CreatedAt,
|
||||
UpdatedAt: m.UpdatedAt,
|
||||
}
|
||||
}
|
||||
|
||||
func GetDoctorInquiryTimeListDto(m []*model.DoctorInquiryTime) []*DoctorInquiryTimeDto {
|
||||
// 处理返回值
|
||||
responses := make([]*DoctorInquiryTimeDto, len(m))
|
||||
|
||||
if len(m) > 0 {
|
||||
for i, v := range m {
|
||||
response := &DoctorInquiryTimeDto{
|
||||
InquiryTimeId: fmt.Sprintf("%d", v.InquiryTimeId),
|
||||
DoctorId: fmt.Sprintf("%d", v.DoctorId),
|
||||
InquiryType: v.InquiryType,
|
||||
InquiryMode: v.InquiryMode,
|
||||
InquiryDate: v.InquiryDate,
|
||||
StartTime: v.StartTime[:2] + ":" + v.StartTime[2:],
|
||||
EndTime: v.EndTime[:2] + ":" + v.EndTime[2:],
|
||||
CreatedAt: v.CreatedAt,
|
||||
UpdatedAt: v.UpdatedAt,
|
||||
}
|
||||
|
||||
// 将转换后的结构体添加到新切片中
|
||||
responses[i] = response
|
||||
}
|
||||
}
|
||||
|
||||
return responses
|
||||
}
|
||||
Reference in New Issue
Block a user