测试环境多点审核去除云证书操作
This commit is contained in:
parent
5efe4ef606
commit
a434046216
@ -363,7 +363,7 @@ func (r *UserDoctorService) PutUserDoctor(doctorId int64, req requests.PutUserDo
|
||||
}
|
||||
}
|
||||
|
||||
// 处理多点状态
|
||||
// 处理多点状态--------
|
||||
if userDoctor.DepartmentCustomId != departmentCustomId {
|
||||
if req.SignImage != "" && req.IdCardBack != "" && req.IdCardFront != "" {
|
||||
// 检测是否存在正在审核中的处方
|
||||
@ -1591,88 +1591,90 @@ func (r *UserDoctorService) PutMulti(doctorId int64, req requests.PutMulti) (boo
|
||||
return false, errors.New("科室错误")
|
||||
}
|
||||
|
||||
// 处理审核拒绝的情况
|
||||
if req.MultiPointStatus == 1 {
|
||||
if userCaCert == nil {
|
||||
// 申请云证书
|
||||
cloudCertRequestData := &ca.AddCloudCertRequest{
|
||||
EntityId: strconv.FormatInt(userDoctor.UserId, 10),
|
||||
EntityType: "Personal",
|
||||
PersonalPhone: user.Mobile,
|
||||
PersonalName: userDoctorInfo.CardName,
|
||||
PersonalIdNumber: userDoctorInfo.CardNum,
|
||||
OrgName: "",
|
||||
OrgNumber: "",
|
||||
Pin: strconv.FormatInt(userDoctor.UserId, 10),
|
||||
OrgDept: hospitalDepartment.DepartmentName, // // 卫生证书:医院部门
|
||||
Province: "四川省",
|
||||
Locality: "成都市",
|
||||
AuthType: "实人认证",
|
||||
AuthTime: strconv.FormatInt(time.Now().Unix(), 10),
|
||||
AuthResult: "认证通过",
|
||||
AuthNoticeType: "数字证书申请告知",
|
||||
}
|
||||
// 处理审核通过的情况
|
||||
if config.C.Env == "prod" {
|
||||
if req.MultiPointStatus == 1 {
|
||||
if userCaCert == nil {
|
||||
// 申请云证书
|
||||
cloudCertRequestData := &ca.AddCloudCertRequest{
|
||||
EntityId: strconv.FormatInt(userDoctor.UserId, 10),
|
||||
EntityType: "Personal",
|
||||
PersonalPhone: user.Mobile,
|
||||
PersonalName: userDoctorInfo.CardName,
|
||||
PersonalIdNumber: userDoctorInfo.CardNum,
|
||||
OrgName: "",
|
||||
OrgNumber: "",
|
||||
Pin: strconv.FormatInt(userDoctor.UserId, 10),
|
||||
OrgDept: hospitalDepartment.DepartmentName, // // 卫生证书:医院部门
|
||||
Province: "四川省",
|
||||
Locality: "成都市",
|
||||
AuthType: "实人认证",
|
||||
AuthTime: strconv.FormatInt(time.Now().Unix(), 10),
|
||||
AuthResult: "认证通过",
|
||||
AuthNoticeType: "数字证书申请告知",
|
||||
}
|
||||
|
||||
cloudCertResponse, err := ca.AddCloudCert(cloudCertRequestData)
|
||||
if err != nil || cloudCertResponse == nil {
|
||||
tx.Rollback()
|
||||
return false, errors.New(err.Error())
|
||||
}
|
||||
cloudCertResponse, err := ca.AddCloudCert(cloudCertRequestData)
|
||||
if err != nil || cloudCertResponse == nil {
|
||||
tx.Rollback()
|
||||
return false, errors.New(err.Error())
|
||||
}
|
||||
|
||||
// 新增ca监管证书表
|
||||
userCaCert := &model.UserCaCert{
|
||||
UserId: &userDoctor.UserId,
|
||||
IsSystem: 0,
|
||||
Type: 2,
|
||||
CertBase64: cloudCertResponse.CertBase64,
|
||||
CertChainP7: cloudCertResponse.CertP7,
|
||||
CertSerialNumber: cloudCertResponse.CertSerialnumber,
|
||||
CaPin: strconv.FormatInt(userDoctor.UserId, 10),
|
||||
IsSignConfig: 0,
|
||||
SignConfig: "",
|
||||
}
|
||||
// 新增ca监管证书表
|
||||
userCaCert := &model.UserCaCert{
|
||||
UserId: &userDoctor.UserId,
|
||||
IsSystem: 0,
|
||||
Type: 2,
|
||||
CertBase64: cloudCertResponse.CertBase64,
|
||||
CertChainP7: cloudCertResponse.CertP7,
|
||||
CertSerialNumber: cloudCertResponse.CertSerialnumber,
|
||||
CaPin: strconv.FormatInt(userDoctor.UserId, 10),
|
||||
IsSignConfig: 0,
|
||||
SignConfig: "",
|
||||
}
|
||||
|
||||
userCaCert, err = userCaCertDao.AddUserCaCert(tx, userCaCert)
|
||||
if err != nil || userCaCert == nil {
|
||||
tx.Rollback()
|
||||
return false, errors.New(err.Error())
|
||||
}
|
||||
} else {
|
||||
// 修改云证书
|
||||
cloudCertRequestData := &ca.EditCloudCertRequestData{
|
||||
EntityId: strconv.FormatInt(userDoctor.UserId, 10),
|
||||
EntityType: "Personal",
|
||||
PersonalPhone: user.Mobile,
|
||||
PersonalName: userDoctorInfo.CardName,
|
||||
PersonalIdNumber: userDoctorInfo.CardNum,
|
||||
OrgName: "",
|
||||
OrgNumber: "",
|
||||
Pin: strconv.FormatInt(userDoctor.UserId, 10),
|
||||
OrgDept: hospitalDepartment.DepartmentName, // // 卫生证书:医院部门
|
||||
Province: "四川省",
|
||||
Locality: "成都市",
|
||||
AuthType: "实人认证",
|
||||
AuthTime: strconv.FormatInt(time.Now().Unix(), 10),
|
||||
AuthResult: "认证通过",
|
||||
AuthNoticeType: "数字证书变更告知",
|
||||
}
|
||||
userCaCert, err = userCaCertDao.AddUserCaCert(tx, userCaCert)
|
||||
if err != nil || userCaCert == nil {
|
||||
tx.Rollback()
|
||||
return false, errors.New(err.Error())
|
||||
}
|
||||
} else {
|
||||
// 修改云证书
|
||||
cloudCertRequestData := &ca.EditCloudCertRequestData{
|
||||
EntityId: strconv.FormatInt(userDoctor.UserId, 10),
|
||||
EntityType: "Personal",
|
||||
PersonalPhone: user.Mobile,
|
||||
PersonalName: userDoctorInfo.CardName,
|
||||
PersonalIdNumber: userDoctorInfo.CardNum,
|
||||
OrgName: "",
|
||||
OrgNumber: "",
|
||||
Pin: strconv.FormatInt(userDoctor.UserId, 10),
|
||||
OrgDept: hospitalDepartment.DepartmentName, // // 卫生证书:医院部门
|
||||
Province: "四川省",
|
||||
Locality: "成都市",
|
||||
AuthType: "实人认证",
|
||||
AuthTime: strconv.FormatInt(time.Now().Unix(), 10),
|
||||
AuthResult: "认证通过",
|
||||
AuthNoticeType: "数字证书变更告知",
|
||||
}
|
||||
|
||||
cloudCertResponse, err := ca.EditCloudCert(cloudCertRequestData)
|
||||
if err != nil || cloudCertResponse == nil {
|
||||
tx.Rollback()
|
||||
return false, errors.New(err.Error())
|
||||
}
|
||||
cloudCertResponse, err := ca.EditCloudCert(cloudCertRequestData)
|
||||
if err != nil || cloudCertResponse == nil {
|
||||
tx.Rollback()
|
||||
return false, errors.New(err.Error())
|
||||
}
|
||||
|
||||
// 修改ca监管证书表
|
||||
userCaCertDao := dao.UserCaCert{}
|
||||
data := make(map[string]interface{})
|
||||
data["cert_base64"] = cloudCertResponse.CertBase64
|
||||
data["cert_chain_p7"] = cloudCertResponse.CertP7
|
||||
data["cert_serial_number"] = cloudCertResponse.CertSerialnumber
|
||||
err = userCaCertDao.EditUserCaCertById(tx, userCaCert.CertId, data)
|
||||
if err != nil {
|
||||
tx.Rollback()
|
||||
return false, errors.New("审核失败")
|
||||
// 修改ca监管证书表
|
||||
userCaCertDao := dao.UserCaCert{}
|
||||
data := make(map[string]interface{})
|
||||
data["cert_base64"] = cloudCertResponse.CertBase64
|
||||
data["cert_chain_p7"] = cloudCertResponse.CertP7
|
||||
data["cert_serial_number"] = cloudCertResponse.CertSerialnumber
|
||||
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