1
This commit is contained in:
parent
0a6efd0cff
commit
3b219986aa
@ -2,6 +2,7 @@ package service
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"hospital-admin-api/api/dao"
|
||||
"hospital-admin-api/api/model"
|
||||
"hospital-admin-api/api/requests"
|
||||
@ -30,7 +31,7 @@ func (r *UserDoctorService) GetUserDoctor(doctorId int64) (getUserDoctorResponse
|
||||
userDoctorDao := dao.UserDoctorDao{}
|
||||
userDoctor, err := userDoctorDao.GetUserDoctorPreloadById(doctorId)
|
||||
if err != nil || userDoctor == nil {
|
||||
return nil, errors.New("用户数据错误")
|
||||
return nil, errors.New(err.Error())
|
||||
}
|
||||
|
||||
userDoctorService := UserDoctorService{}
|
||||
@ -141,7 +142,7 @@ func (r *UserDoctorService) PutUserDoctor(doctorId int64, putUserDoctorRequest r
|
||||
userData := make(map[string]interface{}) // 用户数据
|
||||
|
||||
// 处理头像
|
||||
avatar := strings.Replace(putUserDoctorRequest.Avatar, config.C.Oss.OssCustomDomainName, "", 1)
|
||||
avatar := utils.RemoveOssDomain(putUserDoctorRequest.Avatar)
|
||||
if userDoctor.Avatar != avatar {
|
||||
userDoctorData["avatar"] = avatar
|
||||
userData["avatar"] = avatar
|
||||
@ -177,6 +178,8 @@ func (r *UserDoctorService) PutUserDoctor(doctorId int64, putUserDoctorRequest r
|
||||
}
|
||||
}
|
||||
|
||||
fmt.Println(userDoctorData)
|
||||
|
||||
// 修改科室数据,重新认定为未审核
|
||||
if userDoctor.DepartmentCustomId != departmentCustomId {
|
||||
// 检测是否存在正在审核中的处方
|
||||
@ -828,7 +831,7 @@ func (r *UserDoctorService) GetUserDoctorBankByDoctorId(doctorId int64) (*doctor
|
||||
// 获取医生银行卡
|
||||
doctorBankCardDao := dao.DoctorBankCardDao{}
|
||||
doctorBankCard, err := doctorBankCardDao.GetDoctorBankCardByDoctorId(doctorId)
|
||||
if err != nil {
|
||||
if err != nil && doctorBankCard == nil {
|
||||
return nil, errors.New("用户数据错误")
|
||||
}
|
||||
|
||||
@ -1260,7 +1263,7 @@ func (r *UserDoctorService) PutMulti(doctorId int64, req requests.PutMulti) (boo
|
||||
|
||||
userDoctorData := make(map[string]interface{}) // 医生数据
|
||||
|
||||
if userDoctor.IdenAuthStatus == req.MultiPointStatus {
|
||||
if userDoctor.MultiPointStatus == req.MultiPointStatus {
|
||||
return false, errors.New("请勿重复操作")
|
||||
}
|
||||
|
||||
@ -1274,11 +1277,7 @@ func (r *UserDoctorService) PutMulti(doctorId int64, req requests.PutMulti) (boo
|
||||
|
||||
// 检测是否存在云证书
|
||||
userCaCertDao := dao.UserCaCert{}
|
||||
userCaCerts, err := userCaCertDao.GetUserCaCertListByUserId(userDoctor.UserId)
|
||||
if err != nil {
|
||||
tx.Rollback()
|
||||
return false, errors.New("修改失败")
|
||||
}
|
||||
userCaCert, _ := userCaCertDao.GetUserCaCertByUserId(userDoctor.UserId)
|
||||
|
||||
// 获取自定义科室数据
|
||||
hospitalDepartmentCustomDao := dao.HospitalDepartmentCustom{}
|
||||
@ -1296,7 +1295,7 @@ func (r *UserDoctorService) PutMulti(doctorId int64, req requests.PutMulti) (boo
|
||||
return false, errors.New("科室错误")
|
||||
}
|
||||
|
||||
if userCaCerts == nil && len(userCaCerts) == 0 {
|
||||
if userCaCert == nil {
|
||||
// 申请云证书
|
||||
cloudCertRequestData := &ca.AddCloudCertRequest{
|
||||
EntityId: strconv.FormatInt(userDoctor.UserId, 10),
|
||||
@ -1372,7 +1371,7 @@ func (r *UserDoctorService) PutMulti(doctorId int64, req requests.PutMulti) (boo
|
||||
data["cert_base64"] = cloudCertResponse.CertBase64
|
||||
data["cert_chain_p7"] = cloudCertResponse.CertP7
|
||||
data["cert_serial_number"] = cloudCertResponse.CertSerialnumber
|
||||
err = userCaCertDao.EditUserCaCertById(tx, userCaCerts[0].CertId, data)
|
||||
err = userCaCertDao.EditUserCaCertById(tx, userCaCert.CertId, data)
|
||||
if err != nil {
|
||||
tx.Rollback()
|
||||
return false, errors.New("审核失败")
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user