修改云证书申请判断
This commit is contained in:
@@ -61,10 +61,6 @@ func (r *UserCaCertService) AddUserCloudCert(tx *gorm.DB, userId int64) (bool, e
|
||||
return false, errors.New("医生详情数据错误")
|
||||
}
|
||||
|
||||
if userDoctor.IdenAuthStatus != 1 {
|
||||
return false, errors.New("请先通过身份认证")
|
||||
}
|
||||
|
||||
departmentCustomId = userDoctor.DepartmentCustomId // 自定义科室id
|
||||
cardName = userDoctorInfo.CardName // 身份证名称
|
||||
cardNum = userDoctorInfo.CardNum // 身份证号码
|
||||
@@ -236,14 +232,6 @@ func (r *UserCaCertService) EditUserCloudCert(tx *gorm.DB, userId int64) (bool,
|
||||
return false, errors.New("医生详情数据错误")
|
||||
}
|
||||
|
||||
if userDoctor.IdenAuthStatus != 1 {
|
||||
return false, errors.New("请先通过身份认证")
|
||||
}
|
||||
|
||||
if userDoctor.MultiPointStatus != 1 {
|
||||
return false, errors.New("请先完成多点执业认证")
|
||||
}
|
||||
|
||||
// 检测是否存在正在审核中的处方
|
||||
orderPrescriptionDao := dao.OrderPrescriptionDao{}
|
||||
|
||||
@@ -347,31 +335,6 @@ func (r *UserCaCertService) RenewUserCloudCert(tx *gorm.DB, userId int64) (bool,
|
||||
return false, errors.New("用户数据错误")
|
||||
}
|
||||
|
||||
// 医生
|
||||
if user.UserType == 2 {
|
||||
// 获取医生数据
|
||||
userDoctorDao := dao.UserDoctorDao{}
|
||||
userDoctor, err := userDoctorDao.GetUserDoctorByUserId(userId)
|
||||
if err != nil || userDoctor == nil {
|
||||
return false, errors.New("医生数据错误")
|
||||
}
|
||||
|
||||
// 获取医生详情数据
|
||||
userDoctorInfoDao := dao.UserDoctorInfoDao{}
|
||||
userDoctorInfo, err := userDoctorInfoDao.GetUserDoctorInfoByDoctorId(userDoctor.DoctorId)
|
||||
if err != nil || userDoctorInfo == nil {
|
||||
return false, errors.New("医生详情数据错误")
|
||||
}
|
||||
|
||||
if userDoctor.IdenAuthStatus != 1 {
|
||||
return false, errors.New("请先通过身份认证")
|
||||
}
|
||||
|
||||
if userDoctor.MultiPointStatus != 1 {
|
||||
return false, errors.New("请先完成多点执业认证")
|
||||
}
|
||||
}
|
||||
|
||||
// 修改云证书
|
||||
cloudCertRequestData := &ca.RenewCloudCertRequest{
|
||||
EntityId: fmt.Sprintf("%d", userId),
|
||||
@@ -475,31 +438,6 @@ func (r *UserCaCertService) RemoveUserCloudCert(tx *gorm.DB, userId int64) (bool
|
||||
return false, errors.New("用户数据错误")
|
||||
}
|
||||
|
||||
// 医生
|
||||
if user.UserType == 2 {
|
||||
// 获取医生数据
|
||||
userDoctorDao := dao.UserDoctorDao{}
|
||||
userDoctor, err := userDoctorDao.GetUserDoctorByUserId(userId)
|
||||
if err != nil || userDoctor == nil {
|
||||
return false, errors.New("医生数据错误")
|
||||
}
|
||||
|
||||
// 获取医生详情数据
|
||||
userDoctorInfoDao := dao.UserDoctorInfoDao{}
|
||||
userDoctorInfo, err := userDoctorInfoDao.GetUserDoctorInfoByDoctorId(userDoctor.DoctorId)
|
||||
if err != nil || userDoctorInfo == nil {
|
||||
return false, errors.New("医生详情数据错误")
|
||||
}
|
||||
|
||||
if userDoctor.IdenAuthStatus != 1 {
|
||||
return false, errors.New("请先通过身份认证")
|
||||
}
|
||||
|
||||
if userDoctor.MultiPointStatus != 1 {
|
||||
return false, errors.New("请先完成多点执业认证")
|
||||
}
|
||||
}
|
||||
|
||||
// 删除签章配置
|
||||
deleteUserSignConfigRequestData := &ca.DeleteUserSignConfigRequestData{
|
||||
UserId: fmt.Sprintf("%d", userCaCert.UserId),
|
||||
@@ -587,14 +525,6 @@ func (r *UserCaCertService) AddUserSignConfig(tx *gorm.DB, req requests.AddUserS
|
||||
return false, errors.New("医生详情数据错误")
|
||||
}
|
||||
|
||||
if userDoctor.IdenAuthStatus != 1 {
|
||||
return false, errors.New("请先通过身份认证")
|
||||
}
|
||||
|
||||
if userDoctor.MultiPointStatus != 1 {
|
||||
return false, errors.New("请先完成多点执业认证")
|
||||
}
|
||||
|
||||
cardNum = userDoctorInfo.CardNum
|
||||
signImagePath = strings.TrimLeft(userDoctorInfo.SignImage, "/")
|
||||
}
|
||||
|
||||
@@ -1142,6 +1142,13 @@ func (r *UserDoctorService) GetUserDoctorPending(doctorId int64) (g *dto.UserDoc
|
||||
return nil, errors.New(err.Error())
|
||||
}
|
||||
|
||||
// 获取医生云证书数据
|
||||
userCaCertDao := dao.UserCaCertDao{}
|
||||
maps := make(map[string]interface{})
|
||||
maps["user_id"] = userDoctor.UserId
|
||||
maps["type"] = 2
|
||||
userCaCert, _ := userCaCertDao.GetUserCaCert(maps)
|
||||
|
||||
// 处理返回值
|
||||
g = dto.GetUserDoctorPendingDto(userDoctor)
|
||||
|
||||
@@ -1160,6 +1167,9 @@ func (r *UserDoctorService) GetUserDoctorPending(doctorId int64) (g *dto.UserDoc
|
||||
// 加载医生审核失败原因
|
||||
g.IdenAuthFailReason = dto.GetIdenAuthFailReasonDto(doctorIdenFail)
|
||||
|
||||
// 加载医生云证书详情
|
||||
g.LoadUserCaCert(userCaCert)
|
||||
|
||||
return g, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user