diff --git a/internal/domains/api/services/processors/qygl/qygl45bd_processor.go b/internal/domains/api/services/processors/qygl/qygl45bd_processor.go index 8296b43..59d1aa7 100644 --- a/internal/domains/api/services/processors/qygl/qygl45bd_processor.go +++ b/internal/domains/api/services/processors/qygl/qygl45bd_processor.go @@ -54,6 +54,9 @@ func ProcessQYGL45BDRequest(ctx context.Context, params []byte, deps *processors respBytes, err := deps.WestDexService.CallAPI("WEST00021", reqData) if err != nil { if errors.Is(err, westdex.ErrDatasource) { + if respBytes != nil { + return respBytes,nil + } return nil, fmt.Errorf("%s: %w", processors.ErrDatasource, err) } else { return nil, fmt.Errorf("%s: %w", processors.ErrSystem, err) diff --git a/internal/domains/certification/services/enterprise_info_submit_record_service.go b/internal/domains/certification/services/enterprise_info_submit_record_service.go index 6f7f998..2132b9c 100644 --- a/internal/domains/certification/services/enterprise_info_submit_record_service.go +++ b/internal/domains/certification/services/enterprise_info_submit_record_service.go @@ -58,12 +58,12 @@ func (s *EnterpriseInfoSubmitRecordService) ValidateWithWestdex(ctx context.Cont } // 开发环境下跳过外部验证 - if s.appConfig.IsDevelopment() { - s.logger.Info("开发环境:跳过企业信息外部验证", - zap.String("company_name", info.CompanyName), - zap.String("legal_person", info.LegalPersonName)) - return nil - } + // if s.appConfig.IsDevelopment() { + // s.logger.Info("开发环境:跳过企业信息外部验证", + // zap.String("company_name", info.CompanyName), + // zap.String("legal_person", info.LegalPersonName)) + // return nil + // } encryptedEntName, err := s.westdexService.Encrypt(info.CompanyName) if err != nil { return fmt.Errorf("%s: %w", "企业四要素验证", err) @@ -92,14 +92,20 @@ func (s *EnterpriseInfoSubmitRecordService) ValidateWithWestdex(ctx context.Cont "idcard": encryptedIDCard, }, } + var respData []byte resp, err := s.westdexService.CallAPI("WEST00021", reqParams) if err != nil { - return err + if errors.Is(err, westdex.ErrDatasource) && resp != nil { + respData = resp + } else { + return err + } } - s.logger.Info("验证企业四要素响应", zap.Any("response", resp)) - resultState := gjson.GetBytes(resp, "result.state") + respData = resp + s.logger.Info("验证企业四要素响应", zap.Any("response", respData)) + resultState := gjson.GetBytes(respData, "result.state") if !resultState.Exists() { - return fmt.Errorf("校验企业信息错误") + return fmt.Errorf("企业信息不一致") } if resultState.Int() != 1 { return fmt.Errorf("企业信息不一致")