we
This commit is contained in:
parent
7b2ef6e239
commit
33372af1fc
@ -216,8 +216,6 @@ func (r *DoctorInquiryConfigService) PutDoctorInquiryConfig(inquiryConfigId int6
|
||||
return false, errors.New(err.Error())
|
||||
}
|
||||
|
||||
utils.LogJsonInfo("234", doctorInquiryConfig);
|
||||
|
||||
// 获取医生数据
|
||||
userDoctorDao := dao.UserDoctorDao{}
|
||||
userDoctor, err := userDoctorDao.GetUserDoctorById(doctorInquiryConfig.DoctorId)
|
||||
@ -249,14 +247,11 @@ func (r *DoctorInquiryConfigService) PutDoctorInquiryConfig(inquiryConfigId int6
|
||||
return false, errors.New("系统问诊配置错误")
|
||||
}
|
||||
|
||||
utils.LogJsonInfo("AAA", doctorInquiryConfig);
|
||||
|
||||
// 验证问诊数量
|
||||
if req.WorkNumDay > systemInquiryConfig.MaxWorkNumDay {
|
||||
return false, errors.New("超出每日最大接诊数量")
|
||||
}
|
||||
|
||||
utils.LogJsonInfo("AAA1", doctorInquiryConfig);
|
||||
// 验证问诊价格-在线问诊
|
||||
if doctorInquiryConfig.InquiryType == 1 {
|
||||
if req.InquiryPrice > systemInquiryConfig.MaxInquiryPrice || req.InquiryPrice < systemInquiryConfig.MinInquiryPrice {
|
||||
@ -264,7 +259,6 @@ func (r *DoctorInquiryConfigService) PutDoctorInquiryConfig(inquiryConfigId int6
|
||||
}
|
||||
}
|
||||
|
||||
utils.LogJsonInfo("AAA2", doctorInquiryConfig);
|
||||
// 验证问诊价格-快速问诊/问诊购药
|
||||
if doctorInquiryConfig.InquiryType == 2 || doctorInquiryConfig.InquiryType == 4 {
|
||||
inquiryPrice := strconv.FormatFloat(req.InquiryPrice, 'f', -1, 64)
|
||||
@ -272,7 +266,7 @@ func (r *DoctorInquiryConfigService) PutDoctorInquiryConfig(inquiryConfigId int6
|
||||
return false, errors.New("问诊价格填写错误")
|
||||
}
|
||||
}
|
||||
utils.LogJsonInfo("AAA3", doctorInquiryConfig);
|
||||
|
||||
// 验证问诊价格-公益问诊
|
||||
if doctorInquiryConfig.InquiryType == 3 {
|
||||
inquiryPrice := strconv.FormatFloat(req.InquiryPrice, 'f', -1, 64)
|
||||
@ -280,22 +274,21 @@ func (r *DoctorInquiryConfigService) PutDoctorInquiryConfig(inquiryConfigId int6
|
||||
return false, errors.New("问诊价格填写错误")
|
||||
}
|
||||
}
|
||||
utils.LogJsonInfo("AAA4", doctorInquiryConfig);
|
||||
|
||||
// 验证医生坐班时间
|
||||
if doctorInquiryConfig.InquiryType == 2 || doctorInquiryConfig.InquiryType == 4 {
|
||||
if userDoctor.IsPlatformDeepCooperation == 1 && len(req.DoctorInquiryTime) <= 0 {
|
||||
return false, errors.New("请填写坐班时间")
|
||||
}
|
||||
}
|
||||
utils.LogJsonInfo("AAA5", doctorInquiryConfig);
|
||||
|
||||
// 验证医生服务设置-疑难会诊
|
||||
if doctorInquiryConfig.InquiryType == 1 && doctorInquiryConfig.InquiryMode == 6 {
|
||||
if req.DoctorInquiryConfigService == nil {
|
||||
return false, errors.New("请填写疑难会诊服务设置")
|
||||
}
|
||||
}
|
||||
utils.LogJsonInfo("AAA6", doctorInquiryConfig);
|
||||
utils.LogJsonInfo("123", doctorInquiryConfig);
|
||||
|
||||
// 开始事务
|
||||
tx := global.Db.Begin()
|
||||
defer func() {
|
||||
@ -303,7 +296,7 @@ func (r *DoctorInquiryConfigService) PutDoctorInquiryConfig(inquiryConfigId int6
|
||||
tx.Rollback()
|
||||
}
|
||||
}()
|
||||
utils.LogJsonInfo("AAA61", doctorInquiryConfig);
|
||||
|
||||
// 修改医生问诊配置
|
||||
doctorInquiryConfigData := make(map[string]interface{})
|
||||
if req.IsEnable != doctorInquiryConfig.IsEnable {
|
||||
@ -312,15 +305,15 @@ func (r *DoctorInquiryConfigService) PutDoctorInquiryConfig(inquiryConfigId int6
|
||||
doctorInquiryConfigData["last_enable_method"] = 2
|
||||
}
|
||||
}
|
||||
utils.LogJsonInfo("AAA62", doctorInquiryConfig);
|
||||
|
||||
if req.WorkNumDay != doctorInquiryConfig.WorkNumDay {
|
||||
doctorInquiryConfigData["work_num_day"] = req.WorkNumDay
|
||||
}
|
||||
utils.LogJsonInfo("AAA63", doctorInquiryConfig);
|
||||
|
||||
if req.InquiryPrice != *doctorInquiryConfig.InquiryPrice {
|
||||
doctorInquiryConfigData["inquiry_price"] = req.InquiryPrice
|
||||
}
|
||||
utils.LogJsonInfo("AAA64", doctorInquiryConfig);
|
||||
|
||||
if len(doctorInquiryConfigData) > 0 {
|
||||
err = doctorInquiryConfigDao.EditDoctorInquiryConfigById(tx, doctorInquiryConfig.InquiryConfigId, doctorInquiryConfigData)
|
||||
if err != nil {
|
||||
@ -328,12 +321,10 @@ func (r *DoctorInquiryConfigService) PutDoctorInquiryConfig(inquiryConfigId int6
|
||||
return false, errors.New("修改失败")
|
||||
}
|
||||
}
|
||||
utils.LogJsonInfo("AAA65", doctorInquiryConfig);
|
||||
|
||||
// 处理医生问诊时间
|
||||
if req.InquiryType == 2 || req.InquiryType == 4 {
|
||||
utils.LogJsonInfo("AAA6E", doctorInquiryConfig);
|
||||
if userDoctor.IsPlatformDeepCooperation == 1 && len(req.DoctorInquiryTime) > 0 {
|
||||
utils.LogJsonInfo("AAA6W", doctorInquiryConfig);
|
||||
// 获取医生问诊时间-获取一条即可,用以区分添加/删除
|
||||
doctorInquiryTimeDao := dao.DoctorInquiryTimeDao{}
|
||||
|
||||
@ -383,10 +374,8 @@ func (r *DoctorInquiryConfigService) PutDoctorInquiryConfig(inquiryConfigId int6
|
||||
}
|
||||
}
|
||||
}
|
||||
utils.LogJsonInfo("AAA6", doctorInquiryConfig);
|
||||
// 修改医生服务设置-疑难会诊
|
||||
if doctorInquiryConfig.InquiryType == 1 && doctorInquiryConfig.InquiryMode == 6 {
|
||||
utils.LogJsonInfo("AAA6Q", doctorInquiryConfig);
|
||||
// 获取医生服务设置-疑难会诊
|
||||
doctorInquiryConfigServiceDao := dao.DoctorInquiryConfigServiceDao{}
|
||||
|
||||
@ -420,9 +409,7 @@ func (r *DoctorInquiryConfigService) PutDoctorInquiryConfig(inquiryConfigId int6
|
||||
return false, errors.New("修改失败")
|
||||
}
|
||||
}
|
||||
utils.LogJsonInfo("AAA6A", doctorInquiryConfig);
|
||||
}
|
||||
utils.LogJsonInfo("AAA6B", doctorInquiryConfig);
|
||||
tx.Commit()
|
||||
return true, nil
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user