新增医生服务设置-疑难会诊
This commit is contained in:
parent
6a4db0422e
commit
478ac7a5a3
72
api/dao/doctorInquiryConfigService.go
Normal file
72
api/dao/doctorInquiryConfigService.go
Normal file
@ -0,0 +1,72 @@
|
||||
package dao
|
||||
|
||||
import (
|
||||
"gorm.io/gorm"
|
||||
"hospital-admin-api/api/model"
|
||||
"hospital-admin-api/global"
|
||||
)
|
||||
|
||||
type DoctorInquiryConfigServiceDao struct {
|
||||
}
|
||||
|
||||
// GetDoctorInquiryConfigServiceByDoctorId 获取医生问诊配置数据-医生id
|
||||
func (r *DoctorInquiryConfigServiceDao) GetDoctorInquiryConfigServiceByDoctorId(doctorId int64) (m *model.DoctorInquiryConfigService, err error) {
|
||||
err = global.Db.Where("doctor_id = ?", doctorId).First(&m).Error
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return m, nil
|
||||
}
|
||||
|
||||
// GetDoctorInquiryConfigServiceById 获取医生问诊配置数据-问诊配置id
|
||||
func (r *DoctorInquiryConfigServiceDao) GetDoctorInquiryConfigServiceById(ConfigServiceId int64) (m *model.DoctorInquiryConfigService, err error) {
|
||||
err = global.Db.First(&m, ConfigServiceId).Error
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return m, nil
|
||||
}
|
||||
|
||||
// DeleteDoctorInquiryConfigService 删除医生问诊配置
|
||||
func (r *DoctorInquiryConfigServiceDao) DeleteDoctorInquiryConfigService(tx *gorm.DB, maps interface{}) error {
|
||||
err := tx.Where(maps).Delete(&model.DoctorInquiryConfigService{}).Error
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// EditDoctorInquiryConfigServiceById 修改医生问诊配置-问诊配置id
|
||||
func (r *DoctorInquiryConfigServiceDao) EditDoctorInquiryConfigServiceById(tx *gorm.DB, ConfigServiceId int64, data interface{}) error {
|
||||
err := tx.Model(&model.DoctorInquiryConfigService{}).Where("config_service_id = ?", ConfigServiceId).Updates(data).Error
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// GetDoctorInquiryConfigServiceList 获取医生问诊配置列表
|
||||
func (r *DoctorInquiryConfigServiceDao) GetDoctorInquiryConfigServiceList(maps interface{}) (m []*model.DoctorInquiryConfigService, err error) {
|
||||
err = global.Db.Where(maps).Find(&m).Error
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return m, nil
|
||||
}
|
||||
|
||||
// AddDoctorInquiryConfigService 新增医生问诊配置
|
||||
func (r *DoctorInquiryConfigServiceDao) AddDoctorInquiryConfigService(tx *gorm.DB, model *model.DoctorInquiryConfigService) (*model.DoctorInquiryConfigService, error) {
|
||||
if err := tx.Create(model).Error; err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return model, nil
|
||||
}
|
||||
|
||||
// GetDoctorInquiryConfigServiceFirst 获取医生问诊配置-map-第一条
|
||||
func (r *DoctorInquiryConfigServiceDao) GetDoctorInquiryConfigServiceFirst(maps interface{}) (m *model.DoctorInquiryConfigService, err error) {
|
||||
err = global.Db.Where(maps).First(&m).Error
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return m, nil
|
||||
}
|
||||
61
api/dto/DoctorInquiryConfigService.go
Normal file
61
api/dto/DoctorInquiryConfigService.go
Normal file
@ -0,0 +1,61 @@
|
||||
package dto
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"hospital-admin-api/api/model"
|
||||
)
|
||||
|
||||
type DoctorInquiryConfigServiceDto struct {
|
||||
ConfigServiceId string `json:"config_service_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:会员 6:疑难会诊 7:附赠)
|
||||
ServiceContent string `json:"service_content"` // 服务内容
|
||||
ServiceProcess string `json:"service_process"` // 服务流程
|
||||
ServicePeriod uint `json:"service_period"` // 服务周期
|
||||
ServiceRounds uint `json:"service_rounds"` // 服务回合数(0表示不限次)
|
||||
CreatedAt model.LocalTime `json:"created_at"` // 创建时间
|
||||
UpdatedAt model.LocalTime `json:"updated_at"` // 修改时间
|
||||
}
|
||||
|
||||
func GetDoctorInquiryConfigServiceDto(m *model.DoctorInquiryConfigService) *DoctorInquiryConfigServiceDto {
|
||||
return &DoctorInquiryConfigServiceDto{
|
||||
ConfigServiceId: fmt.Sprintf("%d", m.ConfigServiceId),
|
||||
DoctorId: fmt.Sprintf("%d", m.DoctorId),
|
||||
InquiryType: m.InquiryType,
|
||||
InquiryMode: m.InquiryMode,
|
||||
ServiceContent: m.ServiceContent,
|
||||
ServiceProcess: m.ServiceProcess,
|
||||
ServicePeriod: m.ServicePeriod,
|
||||
ServiceRounds: m.ServiceRounds,
|
||||
CreatedAt: m.CreatedAt,
|
||||
UpdatedAt: m.UpdatedAt,
|
||||
}
|
||||
}
|
||||
|
||||
func GetDoctorInquiryConfigServiceListDto(m []*model.DoctorInquiryConfigService) []*DoctorInquiryConfigServiceDto {
|
||||
// 处理返回值
|
||||
responses := make([]*DoctorInquiryConfigServiceDto, len(m))
|
||||
|
||||
if len(m) > 0 {
|
||||
for i, v := range m {
|
||||
response := &DoctorInquiryConfigServiceDto{
|
||||
ConfigServiceId: fmt.Sprintf("%d", v.ConfigServiceId),
|
||||
DoctorId: fmt.Sprintf("%d", v.DoctorId),
|
||||
InquiryType: v.InquiryType,
|
||||
InquiryMode: v.InquiryMode,
|
||||
ServiceContent: v.ServiceContent,
|
||||
ServiceProcess: v.ServiceProcess,
|
||||
ServicePeriod: v.ServicePeriod,
|
||||
ServiceRounds: v.ServiceRounds,
|
||||
CreatedAt: v.CreatedAt,
|
||||
UpdatedAt: v.UpdatedAt,
|
||||
}
|
||||
|
||||
// 将转换后的结构体添加到新切片中
|
||||
responses[i] = response
|
||||
}
|
||||
}
|
||||
|
||||
return responses
|
||||
}
|
||||
@ -7,23 +7,24 @@ 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:认证失败)
|
||||
UserDoctor *UserDoctorDto `json:"user_doctor"` // 医生数据
|
||||
DoctorInquiryTime []*DoctorInquiryTimeDto `json:"doctor_inquiry_time"` // 医生问诊时间配置
|
||||
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"` // 医生问诊时间配置
|
||||
DoctorInquiryConfigService *DoctorInquiryConfigServiceDto `json:"doctor_inquiry_config_service"` // 医生问诊配置-疑难会诊
|
||||
}
|
||||
|
||||
func GetDoctorInquiryConfigDto(m *model.DoctorInquiryConfig) *DoctorInquiryConfigDto {
|
||||
@ -156,3 +157,11 @@ func (r *DoctorInquiryConfigDto) LoadDoctorInquiryTime(m []*model.DoctorInquiryT
|
||||
}
|
||||
return r
|
||||
}
|
||||
|
||||
// LoadDoctorInquiryConfigService 加载医生问诊配置-疑难会诊
|
||||
func (r *DoctorInquiryConfigDto) LoadDoctorInquiryConfigService(m *model.DoctorInquiryConfigService) *DoctorInquiryConfigDto {
|
||||
if m != nil {
|
||||
r.DoctorInquiryConfigService = GetDoctorInquiryConfigServiceDto(m)
|
||||
}
|
||||
return r
|
||||
}
|
||||
|
||||
37
api/model/doctorInquiryConfigService.go
Normal file
37
api/model/doctorInquiryConfigService.go
Normal file
@ -0,0 +1,37 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"gorm.io/gorm"
|
||||
"hospital-admin-api/global"
|
||||
"time"
|
||||
)
|
||||
|
||||
type DoctorInquiryConfigService struct {
|
||||
ConfigServiceId int64 `gorm:"column:config_service_id;type:bigint(19);primary_key;comment:主键id" json:"config_service_id"`
|
||||
DoctorId int64 `gorm:"column:doctor_id;type:bigint(19);comment:医生id;NOT NULL" json:"doctor_id"`
|
||||
InquiryType int `gorm:"column:inquiry_type;type:tinyint(1);comment:接诊类型(1:专家问诊 2:快速问诊 3:公益问诊 4:问诊购药);NOT NULL" json:"inquiry_type"`
|
||||
InquiryMode int `gorm:"column:inquiry_mode;type:tinyint(1);comment:接诊方式(1:图文 2:视频 3:语音 4:电话 5:会员 6:疑难会诊 7:附赠);NOT NULL" json:"inquiry_mode"`
|
||||
ServiceContent string `gorm:"column:service_content;type:text;comment:服务内容" json:"service_content"`
|
||||
ServiceProcess string `gorm:"column:service_process;type:text;comment:服务流程" json:"service_process"`
|
||||
ServicePeriod uint `gorm:"column:service_period;type:int(10) unsigned;comment:服务周期;NOT NULL" json:"service_period"`
|
||||
ServiceRounds uint `gorm:"column:service_rounds;type:int(1) unsigned;default:0;comment:服务回合数(0表示不限次)" json:"service_rounds"`
|
||||
Model
|
||||
}
|
||||
|
||||
func (m *DoctorInquiryConfigService) TableName() string {
|
||||
return "gdxz_doctor_inquiry_config_service"
|
||||
}
|
||||
|
||||
func (m *DoctorInquiryConfigService) BeforeCreate(tx *gorm.DB) error {
|
||||
if m.ConfigServiceId == 0 {
|
||||
m.ConfigServiceId = 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
|
||||
}
|
||||
@ -22,13 +22,14 @@ type GetDoctorInquiryConfigPage struct {
|
||||
|
||||
// PutDoctorInquiryConfig 修改医生问诊配置
|
||||
type PutDoctorInquiryConfig struct {
|
||||
DoctorId string `json:"doctor_id" form:"doctor_id" validate:"required"` // 医生id
|
||||
InquiryType int `json:"inquiry_type" form:"inquiry_type" validate:"required,oneof=1 2 3 4 5" label:"问诊类型"` // 1:专家问诊 2:快速问诊 3:公益问诊 4:问诊购药 5:检测
|
||||
InquiryMode int `json:"inquiry_mode" form:"inquiry_mode" validate:"required,oneof=1 2 3 4 5" label:"问诊方式"` // 1:图文 2:视频 3:语音 4:电话 5:会员
|
||||
WorkNumDay int `json:"work_num_day" label:"每日接诊数量"`
|
||||
InquiryPrice float64 `json:"inquiry_price" label:"接诊价格"`
|
||||
IsEnable int `json:"is_enable" form:"is_enable" validate:"oneof=0 1" label:"是否启用"` // 0:否 1:是
|
||||
DoctorInquiryTime []*doctorInquiryTime `json:"doctor_inquiry_time" form:"doctor_inquiry_time" label:"医生问诊配置-时间配置"`
|
||||
DoctorId string `json:"doctor_id" form:"doctor_id" validate:"required"` // 医生id
|
||||
InquiryType int `json:"inquiry_type" form:"inquiry_type" validate:"required,oneof=1 2 3 4 5" label:"问诊类型"` // 1:专家问诊 2:快速问诊 3:公益问诊 4:问诊购药 5:检测
|
||||
InquiryMode int `json:"inquiry_mode" form:"inquiry_mode" validate:"required,oneof=1 2 3 4 5 6" label:"问诊方式"` // 1:图文 2:视频 3:语音 4:电话 5:会员
|
||||
WorkNumDay int `json:"work_num_day" form:"work_num_day" label:"每日接诊数量"`
|
||||
InquiryPrice float64 `json:"inquiry_price" form:"inquiry_price" label:"接诊价格"`
|
||||
IsEnable int `json:"is_enable" form:"is_enable" validate:"oneof=0 1" label:"是否启用"` // 0:否 1:是
|
||||
DoctorInquiryTime []*doctorInquiryTime `json:"doctor_inquiry_time" form:"doctor_inquiry_time" label:"医生问诊配置-时间配置"`
|
||||
DoctorInquiryConfigService *DoctorInquiryConfigService `json:"doctor_inquiry_config_service" form:"doctor_inquiry_config_service" label:"医生问诊服务配置-疑难会诊"`
|
||||
}
|
||||
|
||||
// doctorInquiryTime 医生问诊配置-时间配置
|
||||
@ -38,15 +39,24 @@ type doctorInquiryTime struct {
|
||||
EndTime string `json:"end_time" form:"end_time" label:"结束时间"`
|
||||
}
|
||||
|
||||
// DoctorInquiryConfigService 医生问诊服务配置-疑难会诊
|
||||
type DoctorInquiryConfigService struct {
|
||||
ServiceContent string `json:"service_content" form:"service_content" label:"服务内容"`
|
||||
ServiceProcess string `json:"service_process" form:"service_process" label:"服务流程"`
|
||||
ServicePeriod uint `json:"service_period" form:"service_period" label:"服务周期"`
|
||||
ServiceRounds uint `json:"service_rounds" form:"service_rounds" label:"服务回合数"` // (0表示不限次)
|
||||
}
|
||||
|
||||
// AddDoctorInquiryConfig 新增医生问诊配置
|
||||
type AddDoctorInquiryConfig struct {
|
||||
DoctorId string `json:"doctor_id" form:"doctor_id" validate:"required"` // 医生id
|
||||
InquiryType int `json:"inquiry_type" form:"inquiry_type" validate:"required,oneof=1 2 3 4 5" label:"问诊类型"` // 1:专家问诊 2:快速问诊 3:公益问诊 4:问诊购药 5:检测
|
||||
InquiryMode int `json:"inquiry_mode" form:"inquiry_mode" validate:"required,oneof=1 2 3 4 5" label:"问诊方式"` // 1:图文 2:视频 3:语音 4:电话 5:会员
|
||||
WorkNumDay int `json:"work_num_day" label:"每日接诊数量"`
|
||||
InquiryPrice float64 `json:"inquiry_price" label:"接诊价格"`
|
||||
IsEnable int `json:"is_enable" form:"is_enable" validate:"oneof=0 1" label:"是否启用"` // 0:否 1:是
|
||||
DoctorInquiryTime []*doctorInquiryTime `json:"doctor_inquiry_time" form:"doctor_inquiry_time" label:"医生问诊配置-时间配置"`
|
||||
DoctorId string `json:"doctor_id" form:"doctor_id" validate:"required"` // 医生id
|
||||
InquiryType int `json:"inquiry_type" form:"inquiry_type" validate:"required,oneof=1 2 3 4 5" label:"问诊类型"` // 1:专家问诊 2:快速问诊 3:公益问诊 4:问诊购药 5:检测
|
||||
InquiryMode int `json:"inquiry_mode" form:"inquiry_mode" validate:"required,oneof=1 2 3 4 5" label:"问诊方式"` // 1:图文 2:视频 3:语音 4:电话 5:会员
|
||||
WorkNumDay int `json:"work_num_day" label:"每日接诊数量"`
|
||||
InquiryPrice float64 `json:"inquiry_price" label:"接诊价格"`
|
||||
IsEnable int `json:"is_enable" form:"is_enable" validate:"oneof=0 1" label:"是否启用"` // 0:否 1:是
|
||||
DoctorInquiryTime []*doctorInquiryTime `json:"doctor_inquiry_time" form:"doctor_inquiry_time" label:"医生问诊配置-时间配置"`
|
||||
DoctorInquiryConfigService *DoctorInquiryConfigService `json:"doctor_inquiry_config_service" form:"doctor_inquiry_config_service" label:"医生问诊服务配置-疑难会诊"`
|
||||
}
|
||||
|
||||
// GetSystemInquiryConfigPage 获取系统问诊配置列表-分页
|
||||
|
||||
@ -115,14 +115,14 @@ func (r *DoctorInquiryConfigService) GetDoctorInquiryConfig(inquiryConfigId int6
|
||||
// 获取医生问诊配置
|
||||
doctorInquiryConfig, err := doctorInquiryConfigDao.GetDoctorInquiryConfigById(inquiryConfigId)
|
||||
if err != nil || doctorInquiryConfig == nil {
|
||||
return nil, errors.New(err.Error())
|
||||
return nil, errors.New("获取失败")
|
||||
}
|
||||
|
||||
// 获取医生数据
|
||||
userDoctorDao := dao.UserDoctorDao{}
|
||||
userDoctor, err := userDoctorDao.GetUserDoctorById(doctorInquiryConfig.DoctorId)
|
||||
if err != nil || userDoctor == nil {
|
||||
return nil, errors.New(err.Error())
|
||||
return nil, errors.New("获取失败")
|
||||
}
|
||||
|
||||
// 获取医生医院数据
|
||||
@ -137,7 +137,7 @@ func (r *DoctorInquiryConfigService) GetDoctorInquiryConfig(inquiryConfigId int6
|
||||
maps["inquiry_mode"] = doctorInquiryConfig.InquiryMode
|
||||
systemInquiryConfig, err := systemInquiryConfigDao.GetSystemInquiryConfig(maps)
|
||||
if err != nil || systemInquiryConfig == nil {
|
||||
return nil, errors.New(err.Error())
|
||||
return nil, errors.New("获取失败")
|
||||
}
|
||||
|
||||
// 获取医生问诊时间
|
||||
@ -165,6 +165,20 @@ func (r *DoctorInquiryConfigService) GetDoctorInquiryConfig(inquiryConfigId int6
|
||||
res.LoadDoctorInquiryTime(doctorInquiryTimes)
|
||||
}
|
||||
|
||||
// 获取医生问诊配置-疑难问诊-服务设置
|
||||
if doctorInquiryConfig.InquiryType == 1 && doctorInquiryConfig.InquiryMode == 6 {
|
||||
doctorInquiryConfigServiceDao := dao.DoctorInquiryConfigServiceDao{}
|
||||
|
||||
maps = make(map[string]interface{})
|
||||
maps["doctor_id"] = doctorInquiryConfig.DoctorId
|
||||
maps["inquiry_type"] = doctorInquiryConfig.InquiryType
|
||||
maps["inquiry_mode"] = doctorInquiryConfig.InquiryMode
|
||||
doctorInquiryConfigService, err := doctorInquiryConfigServiceDao.GetDoctorInquiryConfigServiceFirst(maps)
|
||||
if doctorInquiryConfigService != nil && err == nil {
|
||||
res.LoadDoctorInquiryConfigService(doctorInquiryConfigService)
|
||||
}
|
||||
}
|
||||
|
||||
return res, nil
|
||||
}
|
||||
|
||||
@ -244,6 +258,13 @@ func (r *DoctorInquiryConfigService) PutDoctorInquiryConfig(inquiryConfigId int6
|
||||
}
|
||||
}
|
||||
|
||||
// 验证医生服务设置-疑难会诊
|
||||
if doctorInquiryConfig.InquiryType == 1 || doctorInquiryConfig.InquiryType == 6 {
|
||||
if req.DoctorInquiryConfigService == nil {
|
||||
return false, errors.New("请填写疑难会诊服务设置")
|
||||
}
|
||||
}
|
||||
|
||||
// 开始事务
|
||||
tx := global.Db.Begin()
|
||||
defer func() {
|
||||
@ -330,6 +351,44 @@ func (r *DoctorInquiryConfigService) PutDoctorInquiryConfig(inquiryConfigId int6
|
||||
}
|
||||
}
|
||||
|
||||
// 修改医生服务设置-疑难会诊
|
||||
if doctorInquiryConfig.InquiryType == 1 || doctorInquiryConfig.InquiryType == 6 {
|
||||
// 获取医生服务设置-疑难会诊
|
||||
doctorInquiryConfigServiceDao := dao.DoctorInquiryConfigServiceDao{}
|
||||
|
||||
maps = make(map[string]interface{})
|
||||
maps["doctor_id"] = doctorInquiryConfig.DoctorId
|
||||
maps["inquiry_type"] = doctorInquiryConfig.InquiryType
|
||||
maps["inquiry_mode"] = doctorInquiryConfig.InquiryMode
|
||||
doctorInquiryConfigService, err := doctorInquiryConfigServiceDao.GetDoctorInquiryConfigServiceFirst(maps)
|
||||
if doctorInquiryConfigService != nil && err != nil {
|
||||
doctorInquiryConfigServiceData := make(map[string]interface{})
|
||||
|
||||
if req.DoctorInquiryConfigService.ServiceContent != doctorInquiryConfigService.ServiceContent {
|
||||
doctorInquiryConfigServiceData["service_content"] = req.DoctorInquiryConfigService.ServiceContent
|
||||
}
|
||||
|
||||
if req.DoctorInquiryConfigService.ServiceProcess != doctorInquiryConfigService.ServiceProcess {
|
||||
doctorInquiryConfigServiceData["service_process"] = req.DoctorInquiryConfigService.ServiceProcess
|
||||
}
|
||||
|
||||
if req.DoctorInquiryConfigService.ServicePeriod != doctorInquiryConfigService.ServicePeriod {
|
||||
doctorInquiryConfigServiceData["service_period"] = req.DoctorInquiryConfigService.ServicePeriod
|
||||
}
|
||||
|
||||
if req.DoctorInquiryConfigService.ServiceRounds != doctorInquiryConfigService.ServiceRounds {
|
||||
doctorInquiryConfigServiceData["service_rounds"] = req.DoctorInquiryConfigService.ServiceRounds
|
||||
}
|
||||
|
||||
err := doctorInquiryConfigServiceDao.EditDoctorInquiryConfigServiceById(tx, doctorInquiryConfigService.ConfigServiceId, doctorInquiryConfigServiceData)
|
||||
if err != nil {
|
||||
tx.Rollback()
|
||||
return false, errors.New("修改失败")
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
tx.Commit()
|
||||
return true, nil
|
||||
}
|
||||
@ -503,6 +562,27 @@ func (r *DoctorInquiryConfigService) AddDoctorInquiryConfig(req requests.AddDoct
|
||||
}
|
||||
}
|
||||
|
||||
// 新增医生服务设置-疑难会诊
|
||||
if req.InquiryType == 1 || req.InquiryMode == 6 {
|
||||
doctorInquiryConfigServiceDao := dao.DoctorInquiryConfigServiceDao{}
|
||||
|
||||
doctorInquiryConfigService := &model.DoctorInquiryConfigService{
|
||||
DoctorId: doctorId,
|
||||
InquiryType: req.InquiryType,
|
||||
InquiryMode: req.InquiryMode,
|
||||
ServiceContent: req.DoctorInquiryConfigService.ServiceContent,
|
||||
ServiceProcess: req.DoctorInquiryConfigService.ServiceProcess,
|
||||
ServicePeriod: req.DoctorInquiryConfigService.ServicePeriod,
|
||||
ServiceRounds: req.DoctorInquiryConfigService.ServiceRounds,
|
||||
}
|
||||
|
||||
doctorInquiryConfigService, err = doctorInquiryConfigServiceDao.AddDoctorInquiryConfigService(tx, doctorInquiryConfigService)
|
||||
if err != nil || doctorInquiryConfigService == nil {
|
||||
tx.Rollback()
|
||||
return false, errors.New(err.Error())
|
||||
}
|
||||
}
|
||||
|
||||
tx.Commit()
|
||||
return true, nil
|
||||
}
|
||||
@ -541,6 +621,14 @@ func (r *SystemInquiryConfigService) PutSystemInquiryConfig(systemInquiryConfigI
|
||||
if req.InquiryPrice == "" {
|
||||
return false, errors.New("请设置问诊价格")
|
||||
}
|
||||
} else if systemInquiryConfig.InquiryType == 1 && systemInquiryConfig.InquiryMode == 2 {
|
||||
if req.MaxInquiryPrice == 0 {
|
||||
return false, errors.New("最高接诊价格应大于0")
|
||||
}
|
||||
} else if systemInquiryConfig.InquiryType == 1 && systemInquiryConfig.InquiryMode == 6 {
|
||||
if req.MaxInquiryPrice == 0 {
|
||||
return false, errors.New("最高接诊价格应大于0")
|
||||
}
|
||||
}
|
||||
|
||||
// 开始事务
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user