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