修改多点状态修改
This commit is contained in:
+30
-30
@@ -184,27 +184,6 @@ func (r *UserDoctorService) PutUserDoctor(doctorId int64, req requests.PutUserDo
|
||||
}
|
||||
}
|
||||
|
||||
// 修改科室数据,重新认定为未审核
|
||||
if userDoctor.DepartmentCustomId != departmentCustomId {
|
||||
// 检测是否存在正在审核中的处方
|
||||
orderPrescriptionDao := dao.OrderPrescriptionDao{}
|
||||
|
||||
maps := make(map[string]interface{})
|
||||
maps["doctor_id"] = doctorId
|
||||
maps["prescription_status"] = 1
|
||||
orderPrescription, err := orderPrescriptionDao.GetList(maps)
|
||||
if err != nil {
|
||||
return false, errors.New("修改失败")
|
||||
}
|
||||
|
||||
if len(orderPrescription) > 0 {
|
||||
return false, errors.New("存在审核中的处方,请勿修改科室数据")
|
||||
}
|
||||
|
||||
userDoctorData["multi_point_status"] = 2
|
||||
userDoctorData["multi_point_fail_reason"] = ""
|
||||
}
|
||||
|
||||
// 处理科室电话
|
||||
if userDoctor.DepartmentCustomMobile != req.DepartmentCustomMobile {
|
||||
userDoctorData["department_custom_id"] = req.DepartmentCustomMobile
|
||||
@@ -312,7 +291,6 @@ func (r *UserDoctorService) PutUserDoctor(doctorId int64, req requests.PutUserDo
|
||||
if userDoctorInfo.IdCardFront != "" && req.IdCardFront == "" {
|
||||
return false, errors.New("未上传新的身份证图片")
|
||||
}
|
||||
|
||||
if req.IdCardFront != "" {
|
||||
idCardFront := strings.Replace(req.IdCardFront, "https://img.applets.igandanyiyuan.com", "", 1)
|
||||
if idCardFront != userDoctorInfo.IdCardFront {
|
||||
@@ -385,6 +363,29 @@ func (r *UserDoctorService) PutUserDoctor(doctorId int64, req requests.PutUserDo
|
||||
}
|
||||
}
|
||||
|
||||
// 处理多点状态
|
||||
if userDoctor.DepartmentCustomId != departmentCustomId {
|
||||
if req.SignImage != "" && req.IdCardBack != "" && req.IdCardFront != "" {
|
||||
// 检测是否存在正在审核中的处方
|
||||
orderPrescriptionDao := dao.OrderPrescriptionDao{}
|
||||
|
||||
maps := make(map[string]interface{})
|
||||
maps["doctor_id"] = doctorId
|
||||
maps["prescription_status"] = 1
|
||||
orderPrescription, err := orderPrescriptionDao.GetList(maps)
|
||||
if err != nil {
|
||||
return false, errors.New("修改失败")
|
||||
}
|
||||
|
||||
if len(orderPrescription) > 0 {
|
||||
return false, errors.New("存在审核中的处方,请勿修改科室数据")
|
||||
}
|
||||
|
||||
userDoctorData["multi_point_status"] = 2
|
||||
userDoctorData["multi_point_fail_reason"] = ""
|
||||
}
|
||||
}
|
||||
|
||||
// 处理银行卡
|
||||
if (userDoctorInfo.IdCardFront != "" || req.IdCardFront != "") && (userDoctorInfo.IdCardBack != "" || req.IdCardBack != "") && (userDoctorInfo.SignImage != "" || req.SignImage != "") {
|
||||
// 签名、身份证数据不为空的情况下,银行卡数据必填
|
||||
@@ -520,17 +521,14 @@ func (r *UserDoctorService) PutUserDoctor(doctorId int64, req requests.PutUserDo
|
||||
}
|
||||
|
||||
// 处理医生详情数据
|
||||
if userDoctorInfo == nil {
|
||||
// 新增医生详情表
|
||||
if len(userDoctorInfoData) != 0 {
|
||||
if len(userDoctorInfoData) != 0 {
|
||||
if userDoctorInfo == nil {
|
||||
userDoctorInfo, err := userDoctorInfoDao.AddUserDoctorInfoByMap(tx, userDoctorInfoData)
|
||||
if userDoctorInfo == nil || err != nil {
|
||||
tx.Rollback()
|
||||
return false, errors.New("修改失败")
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if len(userDoctorInfoData) != 0 {
|
||||
} else {
|
||||
err = userDoctorInfoDao.EditUserDoctorInfoById(tx, userDoctorInfo.DoctorInfoId, userDoctorInfoData)
|
||||
if err != nil {
|
||||
tx.Rollback()
|
||||
@@ -611,7 +609,9 @@ func (r *UserDoctorService) PutUserDoctor(doctorId int64, req requests.PutUserDo
|
||||
return false, errors.New(err.Error())
|
||||
}
|
||||
}
|
||||
} else {
|
||||
}
|
||||
|
||||
if doctorBankCard != nil {
|
||||
// 修改
|
||||
doctorBankCardData := make(map[string]interface{}) // 医生银行卡数据
|
||||
if bankId != 0 {
|
||||
@@ -674,7 +674,7 @@ func (r *UserDoctorService) PutUserDoctor(doctorId int64, req requests.PutUserDo
|
||||
return false, errors.New("修改失败")
|
||||
}
|
||||
|
||||
if userCaCerts != nil && len(userCaCerts) > 0 {
|
||||
if len(userCaCerts) > 0 {
|
||||
userCaCert := userCaCerts[0]
|
||||
// 检测是否已经添加签章配置
|
||||
if userCaCert.IsSignConfig == 1 {
|
||||
|
||||
Reference in New Issue
Block a user