This commit is contained in:
Mrx
2026-05-27 14:12:11 +08:00
parent 9e136bbd6b
commit f2c4618649
4 changed files with 64 additions and 0 deletions

View File

@@ -506,6 +506,12 @@ type QYGL2YSBReq struct {
EntCode string `json:"ent_code" validate:"required,validUSCI"` EntCode string `json:"ent_code" validate:"required,validUSCI"`
} }
type QYGLDG77Req struct {
EntName string `json:"ent_name" validate:"required,min=1,validEnterpriseName"`
AccountNo string `json:"account_no" validate:"required,min=1,"`
AccountBank string `json:"account_bank" validate:"required,min=1,"`
}
type IVYZ7C9DReq struct { type IVYZ7C9DReq struct {
IDCard string `json:"id_card" validate:"required,validIDCard"` IDCard string `json:"id_card" validate:"required,validIDCard"`
Name string `json:"name" validate:"required,min=1,validName"` Name string `json:"name" validate:"required,min=1,validName"`

View File

@@ -259,6 +259,7 @@ func registerAllProcessors(combService *comb.CombService) {
"QYGL4YAB": qygl.ProcessQYGL4YABRequest, //企业四要素认证shumai "QYGL4YAB": qygl.ProcessQYGL4YABRequest, //企业四要素认证shumai
"QYGL3YSB": qygl.ProcessQYGL3YSBRequest, //企业三要素认证shumai "QYGL3YSB": qygl.ProcessQYGL3YSBRequest, //企业三要素认证shumai
"QYGL2YSB": qygl.ProcessQYGL2YSBRequest, //企业二要素认证shumai "QYGL2YSB": qygl.ProcessQYGL2YSBRequest, //企业二要素认证shumai
"QYGLDG77": qygl.ProcessQYGLDG77Request, //企业对公打款认证shumai
// YYSY系列处理器 // YYSY系列处理器
"YYSY35TA": yysy.ProcessYYSY35TARequest, //运营商归属地数卖 "YYSY35TA": yysy.ProcessYYSY35TARequest, //运营商归属地数卖
"YYSYD50F": yysy.ProcessYYSYD50FRequest, "YYSYD50F": yysy.ProcessYYSYD50FRequest,

View File

@@ -286,6 +286,7 @@ func (s *FormConfigServiceImpl) getDTOStruct(ctx context.Context, apiCode string
"QYGL4YAB": &dto.QYGL4YABReq{}, //企业四要素认证shumai "QYGL4YAB": &dto.QYGL4YABReq{}, //企业四要素认证shumai
"QYGL3YSB": &dto.QYGL3YSBReq{}, //企业三要素认证shumai "QYGL3YSB": &dto.QYGL3YSBReq{}, //企业三要素认证shumai
"QYGL2YSB": &dto.QYGL2YSBReq{}, //企业二要素认证shumai "QYGL2YSB": &dto.QYGL2YSBReq{}, //企业二要素认证shumai
"QYGLDG77": &dto.QYGLDG77Req{}, //企业对公打款认证shumai
} }
// 优先返回已配置的DTO // 优先返回已配置的DTO
@@ -518,6 +519,8 @@ func (s *FormConfigServiceImpl) generateFieldLabel(jsonTag string) string {
"plate_color": "车牌颜色", "plate_color": "车牌颜色",
"marital_type": "婚姻状况类型", "marital_type": "婚姻状况类型",
"auth_authorize_file_base64": "PDF授权文件Base64编码≤500KB仅PDF", "auth_authorize_file_base64": "PDF授权文件Base64编码≤500KB仅PDF",
"accountNo": "企业账户",
"accountBank": "开户行",
} }
if label, exists := labelMap[jsonTag]; exists { if label, exists := labelMap[jsonTag]; exists {
@@ -584,6 +587,8 @@ func (s *FormConfigServiceImpl) generateExampleValue(fieldType reflect.Type, jso
"plate_color": "0", "plate_color": "0",
"marital_type": "10", "marital_type": "10",
"auth_authorize_file_base64": "JVBERi0xLjQKJcTl8uXr...示例PDF的Base64编码", "auth_authorize_file_base64": "JVBERi0xLjQKJcTl8uXr...示例PDF的Base64编码",
"accountNo": "6222021234567890123",
"accountBank": "中国工商银行",
} }
if example, exists := exampleMap[jsonTag]; exists { if example, exists := exampleMap[jsonTag]; exists {
@@ -659,6 +664,8 @@ func (s *FormConfigServiceImpl) generatePlaceholder(jsonTag string, fieldType st
"plate_color": "请输入车牌颜色", "plate_color": "请输入车牌颜色",
"marital_type": "请选择婚姻状况类型", "marital_type": "请选择婚姻状况类型",
"auth_authorize_file_base64": "请输入PDF文件的Base64编码字符串", "auth_authorize_file_base64": "请输入PDF文件的Base64编码字符串",
"accountNo": "请输入企业账户",
"accountBank": "请输入开户行",
} }
if placeholder, exists := placeholderMap[jsonTag]; exists { if placeholder, exists := placeholderMap[jsonTag]; exists {
@@ -736,6 +743,8 @@ func (s *FormConfigServiceImpl) generateDescription(jsonTag string, validation s
"plate_color": "车牌颜色", "plate_color": "车牌颜色",
"marital_type": "婚姻状况类型10-未登记无登记记录20-已婚30-丧偶40-离异", "marital_type": "婚姻状况类型10-未登记无登记记录20-已婚30-丧偶40-离异",
"auth_authorize_file_base64": "请输入PDF文件的Base64编码字符串", "auth_authorize_file_base64": "请输入PDF文件的Base64编码字符串",
"accountNo": "请输入企业账户",
"accountBank": "请输入开户行",
} }
if desc, exists := descMap[jsonTag]; exists { if desc, exists := descMap[jsonTag]; exists {

View File

@@ -0,0 +1,48 @@
package qygl
import (
"context"
"encoding/json"
"errors"
"tyapi-server/internal/domains/api/dto"
"tyapi-server/internal/domains/api/services/processors"
"tyapi-server/internal/infrastructure/external/shumai"
)
// ProcessQYGLDG77Request QYGLDG77 API处理方法 - 企业打款认证
func ProcessQYGLDG77Request(ctx context.Context, params []byte, deps *processors.ProcessorDependencies) ([]byte, error) {
var paramsDto dto.QYGLDG77Req
if err := json.Unmarshal(params, &paramsDto); err != nil {
return nil, errors.Join(processors.ErrSystem, err)
}
if err := deps.Validator.ValidateStruct(paramsDto); err != nil {
return nil, errors.Join(processors.ErrInvalidParam, err)
}
reqFormData := map[string]interface{}{
"companyName": paramsDto.EntName,
"accountNo": paramsDto.AccountNo,
"accountBank": paramsDto.AccountBank,
}
apiPath := "/v2/company/dkrz/check" // 接口路径,根据数脉文档填写(如 v4/xxx
respBytes, err := deps.ShumaiService.CallAPIForm(ctx, apiPath, reqFormData)
if err != nil {
if errors.Is(err, shumai.ErrDatasource) {
// 数据源错误
return nil, errors.Join(processors.ErrDatasource, err)
} else if errors.Is(err, shumai.ErrSystem) {
// 系统错误
return nil, errors.Join(processors.ErrSystem, err)
} else if errors.Is(err, shumai.ErrNotFound) {
// 查无记录
return nil, errors.Join(processors.ErrNotFound, err)
} else {
// 其他未知错误
return nil, errors.Join(processors.ErrSystem, err)
}
}
return respBytes, nil
}