fix add
This commit is contained in:
@@ -390,6 +390,23 @@ type QYGL5A3CReq struct {
|
|||||||
PageNum int64 `json:"page_num" validate:"omitempty,min=1"`
|
PageNum int64 `json:"page_num" validate:"omitempty,min=1"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type QYGL2naoReq struct {
|
||||||
|
EntCode string `json:"ent_code" validate:"required,validUSCI"`
|
||||||
|
PageSize int64 `json:"page_size" validate:"omitempty,min=1,max=100"`
|
||||||
|
PageNum int64 `json:"page_num" validate:"omitempty,min=1"`
|
||||||
|
}
|
||||||
|
type QYGLNIO8Req struct {
|
||||||
|
EntCode string `json:"ent_code" validate:"required,validUSCI"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type QYGLP0HTReq struct {
|
||||||
|
EntCode string `json:"ent_code" validate:"required,validUSCI"`
|
||||||
|
Flag string `json:"flag" validate:"omitempty"`
|
||||||
|
Dir string `json:"dir" validate:"omitempty,oneof=up down"`
|
||||||
|
MinPercent string `json:"min_percent" validate:"omitempty"`
|
||||||
|
MaxPercent string `json:"max_percent" validate:"omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
type QYGL8B4DReq struct {
|
type QYGL8B4DReq struct {
|
||||||
EntCode string `json:"ent_code" validate:"required,validUSCI"`
|
EntCode string `json:"ent_code" validate:"required,validUSCI"`
|
||||||
PageSize int64 `json:"page_size" validate:"omitempty,min=1,max=100"`
|
PageSize int64 `json:"page_size" validate:"omitempty,min=1,max=100"`
|
||||||
|
|||||||
@@ -160,6 +160,9 @@ func registerAllProcessors(combService *comb.CombService) {
|
|||||||
"QYGL2S0W": qygl.ProcessQYGL2S0WRequest, //失信被执行企业个人查询
|
"QYGL2S0W": qygl.ProcessQYGL2S0WRequest, //失信被执行企业个人查询
|
||||||
"QYGL5CMP": qygl.ProcessQYGL5CMPRequest, //企业五要素验证
|
"QYGL5CMP": qygl.ProcessQYGL5CMPRequest, //企业五要素验证
|
||||||
"QYGL66SL": qygl.ProcessQYGL66SLRequest, //全国企业司法模型服务查询_V1
|
"QYGL66SL": qygl.ProcessQYGL66SLRequest, //全国企业司法模型服务查询_V1
|
||||||
|
"QYGL2NAO": qygl.ProcessQYGL2naoRequest, //股权变更
|
||||||
|
"QYGLNIO8": qygl.ProcessQYGLNIO8Request, //企业基本信息
|
||||||
|
"QYGLP0HT": qygl.ProcessQYGLP0HTRequest, //股权穿透
|
||||||
|
|
||||||
// YYSY系列处理器
|
// YYSY系列处理器
|
||||||
"YYSYD50F": yysy.ProcessYYSYD50FRequest,
|
"YYSYD50F": yysy.ProcessYYSYD50FRequest,
|
||||||
|
|||||||
@@ -207,6 +207,10 @@ func (s *FormConfigServiceImpl) getDTOStruct(ctx context.Context, apiCode string
|
|||||||
"QYGL66SL": &dto.QYGL66SLReq{}, //全国企业司法模型服务查询_V1
|
"QYGL66SL": &dto.QYGL66SLReq{}, //全国企业司法模型服务查询_V1
|
||||||
"QCXG5F3A": &dto.QCXG5F3AReq{}, //极光个人车辆查询
|
"QCXG5F3A": &dto.QCXG5F3AReq{}, //极光个人车辆查询
|
||||||
"QCXG4D2E": &dto.QCXG4D2EReq{}, //极光名下车辆数量查询
|
"QCXG4D2E": &dto.QCXG4D2EReq{}, //极光名下车辆数量查询
|
||||||
|
"QYGLP0HT": &dto.QYGLP0HTReq{}, //股权穿透
|
||||||
|
"QYGL2NAO": &dto.QYGL2naoReq{}, //股权变更
|
||||||
|
"QYGLNIO8": &dto.QYGLNIO8Req{}, //企业基本信息
|
||||||
|
"QYGL4B2E": &dto.QYGL5A3CReq{}, //税收违法
|
||||||
}
|
}
|
||||||
|
|
||||||
// 优先返回已配置的DTO
|
// 优先返回已配置的DTO
|
||||||
@@ -407,6 +411,10 @@ func (s *FormConfigServiceImpl) generateFieldLabel(jsonTag string) string {
|
|||||||
"owner_type": "企业主类型",
|
"owner_type": "企业主类型",
|
||||||
"type": "查询类型",
|
"type": "查询类型",
|
||||||
"query_reason_id": "查询原因ID",
|
"query_reason_id": "查询原因ID",
|
||||||
|
"flag": "层次",
|
||||||
|
"dir": "方向",
|
||||||
|
"min_percent": "股权穿透比例下限",
|
||||||
|
"max_percent": "股权穿透比例上限",
|
||||||
}
|
}
|
||||||
|
|
||||||
if label, exists := labelMap[jsonTag]; exists {
|
if label, exists := labelMap[jsonTag]; exists {
|
||||||
@@ -452,6 +460,10 @@ func (s *FormConfigServiceImpl) generateExampleValue(fieldType reflect.Type, jso
|
|||||||
"ownerType": "1",
|
"ownerType": "1",
|
||||||
"type": "per",
|
"type": "per",
|
||||||
"query_reason_id": "1",
|
"query_reason_id": "1",
|
||||||
|
"flag": "4",
|
||||||
|
"dir": "down",
|
||||||
|
"min_percent": "0",
|
||||||
|
"max_percent": "1",
|
||||||
}
|
}
|
||||||
|
|
||||||
if example, exists := exampleMap[jsonTag]; exists {
|
if example, exists := exampleMap[jsonTag]; exists {
|
||||||
@@ -506,6 +518,10 @@ func (s *FormConfigServiceImpl) generatePlaceholder(jsonTag string, fieldType st
|
|||||||
"ownerType": "请选择企业主类型",
|
"ownerType": "请选择企业主类型",
|
||||||
"type": "请选择查询类型",
|
"type": "请选择查询类型",
|
||||||
"query_reason_id": "请选择查询原因ID",
|
"query_reason_id": "请选择查询原因ID",
|
||||||
|
"flag": "请输入层次(最大4)",
|
||||||
|
"dir": "请选择方向(up-向上,down-向下)",
|
||||||
|
"min_percent": "请输入股权穿透比例下限(默认0)",
|
||||||
|
"max_percent": "请输入股权穿透比例上限(默认1)",
|
||||||
}
|
}
|
||||||
|
|
||||||
if placeholder, exists := placeholderMap[jsonTag]; exists {
|
if placeholder, exists := placeholderMap[jsonTag]; exists {
|
||||||
@@ -562,6 +578,10 @@ func (s *FormConfigServiceImpl) generateDescription(jsonTag string, validation s
|
|||||||
"owner_type": "企业主类型编码:1-法定代表人;2-主要人员;3-自然人股东;4-法定代表人及自然人股东;5-其他",
|
"owner_type": "企业主类型编码:1-法定代表人;2-主要人员;3-自然人股东;4-法定代表人及自然人股东;5-其他",
|
||||||
"type": "查询类型:per-人员,ent-企业 ",
|
"type": "查询类型:per-人员,ent-企业 ",
|
||||||
"query_reason_id": "查询原因ID:1-授信审批;2-贷中管理;3-贷后管理;4-异议处理;5-担保查询;6-租赁资质审查;7-融资租赁审批;8-借贷撮合查询;9-保险审批;10-资质审核;11-风控审核;12-企业背调",
|
"query_reason_id": "查询原因ID:1-授信审批;2-贷中管理;3-贷后管理;4-异议处理;5-担保查询;6-租赁资质审查;7-融资租赁审批;8-借贷撮合查询;9-保险审批;10-资质审核;11-风控审核;12-企业背调",
|
||||||
|
"flag": "层次,最大4",
|
||||||
|
"dir": "方向:up-向上穿透,down-向下穿透",
|
||||||
|
"min_percent": "股权穿透比例下限(大于等于),默认为0,支持小数点后两位(以小数指代百分比)",
|
||||||
|
"max_percent": "股权穿透比例上限(小于等于),默认为1,支持小数点后两位(以小数指代百分比)",
|
||||||
}
|
}
|
||||||
|
|
||||||
if desc, exists := descMap[jsonTag]; exists {
|
if desc, exists := descMap[jsonTag]; exists {
|
||||||
|
|||||||
@@ -0,0 +1,58 @@
|
|||||||
|
package qygl
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"encoding/json"
|
||||||
|
"errors"
|
||||||
|
"strconv"
|
||||||
|
|
||||||
|
"tyapi-server/internal/domains/api/dto"
|
||||||
|
"tyapi-server/internal/domains/api/services/processors"
|
||||||
|
)
|
||||||
|
|
||||||
|
// ProcessQYGL2naoRequest QYGL2NAO API处理方法 - 股权变更
|
||||||
|
func ProcessQYGL2naoRequest(ctx context.Context, params []byte, deps *processors.ProcessorDependencies) ([]byte, error) {
|
||||||
|
var paramsDto dto.QYGL2naoReq
|
||||||
|
if err := json.Unmarshal(params, ¶msDto); err != nil {
|
||||||
|
return nil, errors.Join(processors.ErrSystem, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := deps.Validator.ValidateStruct(paramsDto); err != nil {
|
||||||
|
return nil, errors.Join(processors.ErrInvalidParam, err)
|
||||||
|
}
|
||||||
|
// 设置默认值
|
||||||
|
pageSize := paramsDto.PageSize
|
||||||
|
if pageSize == 0 {
|
||||||
|
pageSize = int64(20)
|
||||||
|
}
|
||||||
|
pageNum := paramsDto.PageNum
|
||||||
|
if pageNum == 0 {
|
||||||
|
pageNum = int64(1)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 构建API调用参数
|
||||||
|
apiParams := map[string]string{
|
||||||
|
"keyword": paramsDto.EntCode,
|
||||||
|
"pageSize": strconv.FormatInt(pageSize, 10),
|
||||||
|
"pageNum": strconv.FormatInt(pageNum, 10),
|
||||||
|
}
|
||||||
|
|
||||||
|
// 调用天眼查API - 企业基本信息
|
||||||
|
response, err := deps.TianYanChaService.CallAPI(ctx, "holderChange", apiParams)
|
||||||
|
if err != nil {
|
||||||
|
return nil, convertTianYanChaError(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 检查天眼查API调用是否成功
|
||||||
|
if !response.Success {
|
||||||
|
return nil, errors.Join(processors.ErrDatasource, errors.New(response.Message))
|
||||||
|
}
|
||||||
|
|
||||||
|
// 返回天眼查响应数据
|
||||||
|
respBytes, err := json.Marshal(response.Data)
|
||||||
|
if err != nil {
|
||||||
|
return nil, errors.Join(processors.ErrSystem, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
return respBytes, nil
|
||||||
|
}
|
||||||
@@ -0,0 +1,46 @@
|
|||||||
|
package qygl
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"encoding/json"
|
||||||
|
"errors"
|
||||||
|
|
||||||
|
"tyapi-server/internal/domains/api/dto"
|
||||||
|
"tyapi-server/internal/domains/api/services/processors"
|
||||||
|
)
|
||||||
|
|
||||||
|
// ProcessQYGLNIO8Request QYGLNIO8 API处理方法 - 企业基本信息
|
||||||
|
func ProcessQYGLNIO8Request(ctx context.Context, params []byte, deps *processors.ProcessorDependencies) ([]byte, error) {
|
||||||
|
var paramsDto dto.QYGLNIO8Req
|
||||||
|
if err := json.Unmarshal(params, ¶msDto); err != nil {
|
||||||
|
return nil, errors.Join(processors.ErrSystem, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := deps.Validator.ValidateStruct(paramsDto); err != nil {
|
||||||
|
return nil, errors.Join(processors.ErrInvalidParam, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 构建API调用参数
|
||||||
|
apiParams := map[string]string{
|
||||||
|
"keyword": paramsDto.EntCode,
|
||||||
|
}
|
||||||
|
|
||||||
|
// 调用天眼查API - 企业基本信息
|
||||||
|
response, err := deps.TianYanChaService.CallAPI(ctx, "baseinfo", apiParams)
|
||||||
|
if err != nil {
|
||||||
|
return nil, convertTianYanChaError(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 检查天眼查API调用是否成功
|
||||||
|
if !response.Success {
|
||||||
|
return nil, errors.Join(processors.ErrDatasource, errors.New(response.Message))
|
||||||
|
}
|
||||||
|
|
||||||
|
// 返回天眼查响应数据
|
||||||
|
respBytes, err := json.Marshal(response.Data)
|
||||||
|
if err != nil {
|
||||||
|
return nil, errors.Join(processors.ErrSystem, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
return respBytes, nil
|
||||||
|
}
|
||||||
@@ -0,0 +1,68 @@
|
|||||||
|
package qygl
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"encoding/json"
|
||||||
|
"errors"
|
||||||
|
|
||||||
|
"tyapi-server/internal/domains/api/dto"
|
||||||
|
"tyapi-server/internal/domains/api/services/processors"
|
||||||
|
)
|
||||||
|
|
||||||
|
// ProcessQYGLP0HTRequest QYGLP0HT API处理方法 - 股权穿透
|
||||||
|
func ProcessQYGLP0HTRequest(ctx context.Context, params []byte, deps *processors.ProcessorDependencies) ([]byte, error) {
|
||||||
|
var paramsDto dto.QYGLP0HTReq
|
||||||
|
if err := json.Unmarshal(params, ¶msDto); err != nil {
|
||||||
|
return nil, errors.Join(processors.ErrSystem, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := deps.Validator.ValidateStruct(paramsDto); err != nil {
|
||||||
|
return nil, errors.Join(processors.ErrInvalidParam, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 设置默认值
|
||||||
|
flag := paramsDto.Flag
|
||||||
|
if flag == "" {
|
||||||
|
flag = "4"
|
||||||
|
}
|
||||||
|
dir := paramsDto.Dir
|
||||||
|
if dir == "" {
|
||||||
|
dir = "down"
|
||||||
|
}
|
||||||
|
minPercent := paramsDto.MinPercent
|
||||||
|
if minPercent == "" {
|
||||||
|
minPercent = "0"
|
||||||
|
}
|
||||||
|
maxPercent := paramsDto.MaxPercent
|
||||||
|
if maxPercent == "" {
|
||||||
|
maxPercent = "1"
|
||||||
|
}
|
||||||
|
|
||||||
|
// 构建API调用参数
|
||||||
|
apiParams := map[string]string{
|
||||||
|
"keyword": paramsDto.EntCode,
|
||||||
|
"flag": flag,
|
||||||
|
"dir": dir,
|
||||||
|
"minPercent": minPercent,
|
||||||
|
"maxPercent": maxPercent,
|
||||||
|
}
|
||||||
|
|
||||||
|
// 调用天眼查API - 企股权穿透
|
||||||
|
response, err := deps.TianYanChaService.CallAPI(ctx, "investtree", apiParams)
|
||||||
|
if err != nil {
|
||||||
|
return nil, convertTianYanChaError(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 检查天眼查API调用是否成功
|
||||||
|
if !response.Success {
|
||||||
|
return nil, errors.Join(processors.ErrDatasource, errors.New(response.Message))
|
||||||
|
}
|
||||||
|
|
||||||
|
// 返回天眼查响应数据
|
||||||
|
respBytes, err := json.Marshal(response.Data)
|
||||||
|
if err != nil {
|
||||||
|
return nil, errors.Join(processors.ErrSystem, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
return respBytes, nil
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user