测试环境多点审核去除云证书操作
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 userDoctor.DepartmentCustomId != departmentCustomId {
|
||||||
if req.SignImage != "" && req.IdCardBack != "" && req.IdCardFront != "" {
|
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("科室错误")
|
return false, errors.New("科室错误")
|
||||||
}
|
}
|
||||||
|
|
||||||
// 处理审核拒绝的情况
|
// 处理审核通过的情况
|
||||||
if req.MultiPointStatus == 1 {
|
if config.C.Env == "prod" {
|
||||||
if userCaCert == nil {
|
if req.MultiPointStatus == 1 {
|
||||||
// 申请云证书
|
if userCaCert == nil {
|
||||||
cloudCertRequestData := &ca.AddCloudCertRequest{
|
// 申请云证书
|
||||||
EntityId: strconv.FormatInt(userDoctor.UserId, 10),
|
cloudCertRequestData := &ca.AddCloudCertRequest{
|
||||||
EntityType: "Personal",
|
EntityId: strconv.FormatInt(userDoctor.UserId, 10),
|
||||||
PersonalPhone: user.Mobile,
|
EntityType: "Personal",
|
||||||
PersonalName: userDoctorInfo.CardName,
|
PersonalPhone: user.Mobile,
|
||||||
PersonalIdNumber: userDoctorInfo.CardNum,
|
PersonalName: userDoctorInfo.CardName,
|
||||||
OrgName: "",
|
PersonalIdNumber: userDoctorInfo.CardNum,
|
||||||
OrgNumber: "",
|
OrgName: "",
|
||||||
Pin: strconv.FormatInt(userDoctor.UserId, 10),
|
OrgNumber: "",
|
||||||
OrgDept: hospitalDepartment.DepartmentName, // // 卫生证书:医院部门
|
Pin: strconv.FormatInt(userDoctor.UserId, 10),
|
||||||
Province: "四川省",
|
OrgDept: hospitalDepartment.DepartmentName, // // 卫生证书:医院部门
|
||||||
Locality: "成都市",
|
Province: "四川省",
|
||||||
AuthType: "实人认证",
|
Locality: "成都市",
|
||||||
AuthTime: strconv.FormatInt(time.Now().Unix(), 10),
|
AuthType: "实人认证",
|
||||||
AuthResult: "认证通过",
|
AuthTime: strconv.FormatInt(time.Now().Unix(), 10),
|
||||||
AuthNoticeType: "数字证书申请告知",
|
AuthResult: "认证通过",
|
||||||
}
|
AuthNoticeType: "数字证书申请告知",
|
||||||
|
}
|
||||||
|
|
||||||
cloudCertResponse, err := ca.AddCloudCert(cloudCertRequestData)
|
cloudCertResponse, err := ca.AddCloudCert(cloudCertRequestData)
|
||||||
if err != nil || cloudCertResponse == nil {
|
if err != nil || cloudCertResponse == nil {
|
||||||
tx.Rollback()
|
tx.Rollback()
|
||||||
return false, errors.New(err.Error())
|
return false, errors.New(err.Error())
|
||||||
}
|
}
|
||||||
|
|
||||||
// 新增ca监管证书表
|
// 新增ca监管证书表
|
||||||
userCaCert := &model.UserCaCert{
|
userCaCert := &model.UserCaCert{
|
||||||
UserId: &userDoctor.UserId,
|
UserId: &userDoctor.UserId,
|
||||||
IsSystem: 0,
|
IsSystem: 0,
|
||||||
Type: 2,
|
Type: 2,
|
||||||
CertBase64: cloudCertResponse.CertBase64,
|
CertBase64: cloudCertResponse.CertBase64,
|
||||||
CertChainP7: cloudCertResponse.CertP7,
|
CertChainP7: cloudCertResponse.CertP7,
|
||||||
CertSerialNumber: cloudCertResponse.CertSerialnumber,
|
CertSerialNumber: cloudCertResponse.CertSerialnumber,
|
||||||
CaPin: strconv.FormatInt(userDoctor.UserId, 10),
|
CaPin: strconv.FormatInt(userDoctor.UserId, 10),
|
||||||
IsSignConfig: 0,
|
IsSignConfig: 0,
|
||||||
SignConfig: "",
|
SignConfig: "",
|
||||||
}
|
}
|
||||||
|
|
||||||
userCaCert, err = userCaCertDao.AddUserCaCert(tx, userCaCert)
|
userCaCert, err = userCaCertDao.AddUserCaCert(tx, userCaCert)
|
||||||
if err != nil || userCaCert == nil {
|
if err != nil || userCaCert == nil {
|
||||||
tx.Rollback()
|
tx.Rollback()
|
||||||
return false, errors.New(err.Error())
|
return false, errors.New(err.Error())
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// 修改云证书
|
// 修改云证书
|
||||||
cloudCertRequestData := &ca.EditCloudCertRequestData{
|
cloudCertRequestData := &ca.EditCloudCertRequestData{
|
||||||
EntityId: strconv.FormatInt(userDoctor.UserId, 10),
|
EntityId: strconv.FormatInt(userDoctor.UserId, 10),
|
||||||
EntityType: "Personal",
|
EntityType: "Personal",
|
||||||
PersonalPhone: user.Mobile,
|
PersonalPhone: user.Mobile,
|
||||||
PersonalName: userDoctorInfo.CardName,
|
PersonalName: userDoctorInfo.CardName,
|
||||||
PersonalIdNumber: userDoctorInfo.CardNum,
|
PersonalIdNumber: userDoctorInfo.CardNum,
|
||||||
OrgName: "",
|
OrgName: "",
|
||||||
OrgNumber: "",
|
OrgNumber: "",
|
||||||
Pin: strconv.FormatInt(userDoctor.UserId, 10),
|
Pin: strconv.FormatInt(userDoctor.UserId, 10),
|
||||||
OrgDept: hospitalDepartment.DepartmentName, // // 卫生证书:医院部门
|
OrgDept: hospitalDepartment.DepartmentName, // // 卫生证书:医院部门
|
||||||
Province: "四川省",
|
Province: "四川省",
|
||||||
Locality: "成都市",
|
Locality: "成都市",
|
||||||
AuthType: "实人认证",
|
AuthType: "实人认证",
|
||||||
AuthTime: strconv.FormatInt(time.Now().Unix(), 10),
|
AuthTime: strconv.FormatInt(time.Now().Unix(), 10),
|
||||||
AuthResult: "认证通过",
|
AuthResult: "认证通过",
|
||||||
AuthNoticeType: "数字证书变更告知",
|
AuthNoticeType: "数字证书变更告知",
|
||||||
}
|
}
|
||||||
|
|
||||||
cloudCertResponse, err := ca.EditCloudCert(cloudCertRequestData)
|
cloudCertResponse, err := ca.EditCloudCert(cloudCertRequestData)
|
||||||
if err != nil || cloudCertResponse == nil {
|
if err != nil || cloudCertResponse == nil {
|
||||||
tx.Rollback()
|
tx.Rollback()
|
||||||
return false, errors.New(err.Error())
|
return false, errors.New(err.Error())
|
||||||
}
|
}
|
||||||
|
|
||||||
// 修改ca监管证书表
|
// 修改ca监管证书表
|
||||||
userCaCertDao := dao.UserCaCert{}
|
userCaCertDao := dao.UserCaCert{}
|
||||||
data := make(map[string]interface{})
|
data := make(map[string]interface{})
|
||||||
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, userCaCert.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