f
This commit is contained in:
@@ -53,18 +53,22 @@ func (l *QueryServiceLogic) QueryService(req *types.QueryServiceReq) (resp *type
|
||||
type queryHandlerFunc func(l *QueryServiceLogic, decryptData []byte, product string) (map[string]interface{}, error)
|
||||
|
||||
var productHandlers = map[string]queryHandlerFunc{
|
||||
"marriage": runMarriageReq,
|
||||
"homeservice": runMarriageReq,
|
||||
"riskassessment": runMarriageReq,
|
||||
"companyinfo": runMarriageReq,
|
||||
"rentalinfo": runMarriageReq,
|
||||
"preloanbackgroundcheck": runMarriageReq,
|
||||
"backgroundcheck": runMarriageReq,
|
||||
"personalData": runMarriageReq,
|
||||
"toc_PersonalLawsuit": runMarriageReq,
|
||||
"toc_EnterpriseLawsuit": runEntLawsuitReq,
|
||||
"toc_ExecutedPerson": runMarriageReq,
|
||||
"toc_LimitHigh": runMarriageReq,
|
||||
"marriage": runMarriageReq,
|
||||
"homeservice": runMarriageReq,
|
||||
"riskassessment": runMarriageReq,
|
||||
"companyinfo": runMarriageReq,
|
||||
"rentalinfo": runMarriageReq,
|
||||
"preloanbackgroundcheck": runMarriageReq,
|
||||
"backgroundcheck": runMarriageReq,
|
||||
"personalData": runMarriageReq,
|
||||
"toc_PersonalLawsuit": runMarriageReq,
|
||||
"toc_EnterpriseLawsuit": runEntLawsuitReq,
|
||||
// 人企关系加强版:仅身份证号
|
||||
"toc_PersonEnterprisePro": runPersonEnterpriseProReq,
|
||||
// 新司法涉诉类产品
|
||||
"toc_EnterpriseLawsuitQYGL66SL": runEnterpriseLawsuitSimpleReq,
|
||||
"toc_LimitHighExecuted": runLimitHighExecutedReq,
|
||||
"toc_DishonestExecutedPerson": runDishonestExecutedReq,
|
||||
"toc_Marriage": runMarriageReq,
|
||||
"toc_PersonalMarriageStatus": runMarriageReq,
|
||||
"toc_MarriageStatusRegisterTime": runMarriageReq,
|
||||
@@ -185,6 +189,67 @@ func runEntLawsuitReq(l *QueryServiceLogic, decryptData []byte, product string)
|
||||
}, nil
|
||||
}
|
||||
|
||||
// 企业司法涉诉简版 QYGL66SL:仅企业名称,auth_date 与授权文件编码由后端自动生成
|
||||
func runEnterpriseLawsuitSimpleReq(l *QueryServiceLogic, decryptData []byte, product string) (map[string]interface{}, error) {
|
||||
var data types.EnterpriseLawsuitSimpleReq
|
||||
if unmarshalErr := json.Unmarshal(decryptData, &data); unmarshalErr != nil {
|
||||
return nil, errors.Wrapf(xerr.NewErrCode(xerr.SERVER_COMMON_ERROR), "查询服务, 解密后的数据格式不正确: %+v", unmarshalErr)
|
||||
}
|
||||
if validatorErr := validator.Validate(data); validatorErr != nil {
|
||||
return nil, errors.Wrapf(xerr.NewErrCodeMsg(xerr.PARAM_VERIFICATION_ERROR, validatorErr.Error()), "查询服务, 参数不正确: %+v", validatorErr)
|
||||
}
|
||||
now := time.Now()
|
||||
start := now.AddDate(0, 0, -7)
|
||||
end := now.AddDate(0, 0, 7)
|
||||
authDate := fmt.Sprintf("%s-%s", start.Format("20060102"), end.Format("20060102"))
|
||||
return map[string]interface{}{
|
||||
"ent_name": data.EntName,
|
||||
"auth_date": authDate,
|
||||
"auth_authorize_file_code": "AUTHTYC0001",
|
||||
}, nil
|
||||
}
|
||||
|
||||
// 限高被执行人 FLXG3A9B
|
||||
func runLimitHighExecutedReq(l *QueryServiceLogic, decryptData []byte, product string) (map[string]interface{}, error) {
|
||||
var data types.LimitHighExecutedReq
|
||||
if unmarshalErr := json.Unmarshal(decryptData, &data); unmarshalErr != nil {
|
||||
return nil, errors.Wrapf(xerr.NewErrCode(xerr.SERVER_COMMON_ERROR), "查询服务, 解密后的数据格式不正确: %+v", unmarshalErr)
|
||||
}
|
||||
if validatorErr := validator.Validate(data); validatorErr != nil {
|
||||
return nil, errors.Wrapf(xerr.NewErrCodeMsg(xerr.PARAM_VERIFICATION_ERROR, validatorErr.Error()), "查询服务, 参数不正确: %+v", validatorErr)
|
||||
}
|
||||
auth := data.Authorized
|
||||
if auth == "" {
|
||||
auth = "1"
|
||||
}
|
||||
return map[string]interface{}{
|
||||
"name": data.Name,
|
||||
"id_card": data.IDCard,
|
||||
"mobile_no": data.Mobile,
|
||||
"authorized": auth,
|
||||
}, nil
|
||||
}
|
||||
|
||||
// 失信被执行人 QYGL2S0W
|
||||
func runDishonestExecutedReq(l *QueryServiceLogic, decryptData []byte, product string) (map[string]interface{}, error) {
|
||||
var data types.DishonestExecutedReq
|
||||
if unmarshalErr := json.Unmarshal(decryptData, &data); unmarshalErr != nil {
|
||||
return nil, errors.Wrapf(xerr.NewErrCode(xerr.SERVER_COMMON_ERROR), "查询服务, 解密后的数据格式不正确: %+v", unmarshalErr)
|
||||
}
|
||||
if validatorErr := validator.Validate(data); validatorErr != nil {
|
||||
return nil, errors.Wrapf(xerr.NewErrCodeMsg(xerr.PARAM_VERIFICATION_ERROR, validatorErr.Error()), "查询服务, 参数不正确: %+v", validatorErr)
|
||||
}
|
||||
tp := data.Type
|
||||
if tp == "" {
|
||||
tp = "per"
|
||||
}
|
||||
return map[string]interface{}{
|
||||
"type": tp,
|
||||
"name": data.Name,
|
||||
"id_card": data.IDCard,
|
||||
}, nil
|
||||
}
|
||||
|
||||
// runDualMarriageReq 双人婚姻状态:男方/女方姓名+身份证+手机+验证码
|
||||
func runDualMarriageReq(l *QueryServiceLogic, decryptData []byte, product string) (map[string]interface{}, error) {
|
||||
var data types.TocDualMarriageReq
|
||||
@@ -413,6 +478,20 @@ func runVehicleClaimVerifyReq(l *QueryServiceLogic, decryptData []byte, product
|
||||
}, nil
|
||||
}
|
||||
|
||||
// runPersonEnterpriseProReq 人企关系加强版预查询:仅身份证号
|
||||
func runPersonEnterpriseProReq(l *QueryServiceLogic, decryptData []byte, product string) (map[string]interface{}, error) {
|
||||
var data types.TocPersonEnterpriseProReq
|
||||
if unmarshalErr := json.Unmarshal(decryptData, &data); unmarshalErr != nil {
|
||||
return nil, errors.Wrapf(xerr.NewErrCode(xerr.SERVER_COMMON_ERROR), "查询服务, 解密后的数据格式不正确: %+v", unmarshalErr)
|
||||
}
|
||||
if validatorErr := validator.Validate(data); validatorErr != nil {
|
||||
return nil, errors.Wrapf(xerr.NewErrCodeMsg(xerr.PARAM_VERIFICATION_ERROR, validatorErr.Error()), "查询服务, 参数不正确: %+v", validatorErr)
|
||||
}
|
||||
return map[string]interface{}{
|
||||
"id_card": data.IDCard,
|
||||
}, nil
|
||||
}
|
||||
|
||||
// --------------- 核验工具 handlers ---------------
|
||||
func runVerifyAuthTwoReq(l *QueryServiceLogic, decryptData []byte, product string) (map[string]interface{}, error) {
|
||||
var data types.TocVerifyAuthTwoReq
|
||||
|
||||
@@ -254,6 +254,10 @@ var requestProcessors = map[string]func(*ApiRequestService, []byte) ([]byte, err
|
||||
"QYGL5F6A": (*ApiRequestService).ProcessQYGL5F6ARequest,
|
||||
"JRZQACAB": (*ApiRequestService).ProcessJRZQACABRequest,
|
||||
"JRZQ0B6Y": (*ApiRequestService).ProcessJRZQ0B6YRequest,
|
||||
// 新增司法涉诉类接口
|
||||
"QYGL66SL": (*ApiRequestService).ProcessQYGL66SLRequest,
|
||||
"FLXG3A9B": (*ApiRequestService).ProcessFLXG3A9BRequest,
|
||||
"QYGL2S0W": (*ApiRequestService).ProcessQYGL2S0WRequest,
|
||||
}
|
||||
|
||||
// PreprocessRequestApi 调用指定的请求处理函数
|
||||
@@ -1475,6 +1479,21 @@ func (a *ApiRequestService) ProcessJRZQ0B6YRequest(params []byte) ([]byte, error
|
||||
return a.processVerifyPassThrough(params, "JRZQ0B6Y")
|
||||
}
|
||||
|
||||
// QYGL66SL 企业司法涉诉(简版)
|
||||
func (a *ApiRequestService) ProcessQYGL66SLRequest(params []byte) ([]byte, error) {
|
||||
return a.processVerifyPassThrough(params, "QYGL66SL")
|
||||
}
|
||||
|
||||
// FLXG3A9B 限高被执行人
|
||||
func (a *ApiRequestService) ProcessFLXG3A9BRequest(params []byte) ([]byte, error) {
|
||||
return a.processVerifyPassThrough(params, "FLXG3A9B")
|
||||
}
|
||||
|
||||
// QYGL2S0W 失信被执行人
|
||||
func (a *ApiRequestService) ProcessQYGL2S0WRequest(params []byte) ([]byte, error) {
|
||||
return a.processVerifyPassThrough(params, "QYGL2S0W")
|
||||
}
|
||||
|
||||
// buildVehicleBody 从 params 中取 required 与 optional 键,仅非空才写入 body
|
||||
func buildVehicleBody(params []byte, required, optional []string) map[string]interface{} {
|
||||
body := make(map[string]interface{})
|
||||
|
||||
@@ -64,6 +64,32 @@ type EntLawsuitReq struct {
|
||||
Mobile string `json:"mobile" validate:"required,mobile"`
|
||||
Code string `json:"code" validate:"required"`
|
||||
}
|
||||
|
||||
// EnterpriseLawsuitSimple 企业司法涉诉简版(QYGL66SL):仅企业名称,授权信息由后端补齐
|
||||
type EnterpriseLawsuitSimpleReq struct {
|
||||
EntName string `json:"ent_name" validate:"required"`
|
||||
}
|
||||
|
||||
// LimitHighExecuted 限高被执行人(FLXG3A9B)
|
||||
type LimitHighExecutedReq struct {
|
||||
Name string `json:"name" validate:"required,name"`
|
||||
IDCard string `json:"id_card" validate:"required,idCard"`
|
||||
Mobile string `json:"mobile" validate:"required,mobile"`
|
||||
Authorized string `json:"authorized"` // 可选,后端默认 1
|
||||
}
|
||||
|
||||
// DishonestExecuted 失信被执行人(QYGL2S0W)
|
||||
type DishonestExecutedReq struct {
|
||||
Type string `json:"type"` // 可选,后端默认 per
|
||||
Name string `json:"name" validate:"required,name"`
|
||||
IDCard string `json:"id_card" validate:"required,idCard"`
|
||||
}
|
||||
|
||||
// TocPersonEnterprisePro 人企关系加强版预查询:仅身份证号
|
||||
type TocPersonEnterpriseProReq struct {
|
||||
IDCard string `json:"id_card" validate:"required,idCard"`
|
||||
}
|
||||
|
||||
type TocPhoneThreeElements struct {
|
||||
Name string `json:"name" validate:"required,name"`
|
||||
IDCard string `json:"id_card" validate:"required,idCard"`
|
||||
|
||||
@@ -1172,6 +1172,249 @@ WHERE
|
||||
AND pf.del_state = 0
|
||||
);
|
||||
|
||||
-- 企业司法涉诉简版 QYGL66SL
|
||||
INSERT INTO
|
||||
`product` (
|
||||
`create_time`,
|
||||
`update_time`,
|
||||
`delete_time`,
|
||||
`del_state`,
|
||||
`version`,
|
||||
`product_name`,
|
||||
`product_en`,
|
||||
`description`,
|
||||
`notes`,
|
||||
`cost_price`,
|
||||
`sell_price`
|
||||
)
|
||||
VALUES (
|
||||
NOW(),
|
||||
NOW(),
|
||||
NULL,
|
||||
0,
|
||||
0,
|
||||
'企业司法涉诉',
|
||||
'toc_EnterpriseLawsuitQYGL66SL',
|
||||
'<p>企业司法涉诉(简版)</p>',
|
||||
NULL,
|
||||
0.50,
|
||||
28.80
|
||||
);
|
||||
|
||||
INSERT INTO
|
||||
`feature` (
|
||||
`create_time`,
|
||||
`update_time`,
|
||||
`delete_time`,
|
||||
`del_state`,
|
||||
`version`,
|
||||
`api_id`,
|
||||
`name`,
|
||||
`cost_price`
|
||||
)
|
||||
VALUES (
|
||||
NOW(),
|
||||
NOW(),
|
||||
NULL,
|
||||
0,
|
||||
0,
|
||||
'QYGL66SL',
|
||||
'企业司法涉诉',
|
||||
0.80
|
||||
)
|
||||
ON DUPLICATE KEY UPDATE
|
||||
`name` = VALUES(`name`),
|
||||
`cost_price` = VALUES(`cost_price`);
|
||||
|
||||
INSERT INTO
|
||||
`product_feature` (
|
||||
`product_id`,
|
||||
`feature_id`,
|
||||
`create_time`,
|
||||
`update_time`,
|
||||
`delete_time`,
|
||||
`del_state`,
|
||||
`version`,
|
||||
`sort`,
|
||||
`is_important`,
|
||||
`enable`
|
||||
)
|
||||
SELECT p.id, f.id, NOW(), NOW(), NULL, 0, 0, 1, 0, 1
|
||||
FROM `product` p
|
||||
JOIN `feature` f ON f.api_id = 'QYGL66SL'
|
||||
WHERE
|
||||
p.product_en = 'toc_EnterpriseLawsuitQYGL66SL'
|
||||
AND NOT EXISTS (
|
||||
SELECT 1
|
||||
FROM `product_feature` pf
|
||||
WHERE
|
||||
pf.product_id = p.id
|
||||
AND pf.feature_id = f.id
|
||||
AND pf.del_state = 0
|
||||
);
|
||||
|
||||
-- 限高被执行人 FLXG3A9B
|
||||
INSERT INTO
|
||||
`product` (
|
||||
`create_time`,
|
||||
`update_time`,
|
||||
`delete_time`,
|
||||
`del_state`,
|
||||
`version`,
|
||||
`product_name`,
|
||||
`product_en`,
|
||||
`description`,
|
||||
`notes`,
|
||||
`cost_price`,
|
||||
`sell_price`
|
||||
)
|
||||
VALUES (
|
||||
NOW(),
|
||||
NOW(),
|
||||
NULL,
|
||||
0,
|
||||
0,
|
||||
'限高被执行人',
|
||||
'toc_LimitHighExecuted',
|
||||
'<p>限高被执行人</p>',
|
||||
NULL,
|
||||
0.50,
|
||||
9.90
|
||||
);
|
||||
|
||||
INSERT INTO
|
||||
`feature` (
|
||||
`create_time`,
|
||||
`update_time`,
|
||||
`delete_time`,
|
||||
`del_state`,
|
||||
`version`,
|
||||
`api_id`,
|
||||
`name`,
|
||||
`cost_price`
|
||||
)
|
||||
VALUES (
|
||||
NOW(),
|
||||
NOW(),
|
||||
NULL,
|
||||
0,
|
||||
0,
|
||||
'FLXG3A9B',
|
||||
'限高被执行人',
|
||||
0.80
|
||||
)
|
||||
ON DUPLICATE KEY UPDATE
|
||||
`name` = VALUES(`name`),
|
||||
`cost_price` = VALUES(`cost_price`);
|
||||
|
||||
INSERT INTO
|
||||
`product_feature` (
|
||||
`product_id`,
|
||||
`feature_id`,
|
||||
`create_time`,
|
||||
`update_time`,
|
||||
`delete_time`,
|
||||
`del_state`,
|
||||
`version`,
|
||||
`sort`,
|
||||
`is_important`,
|
||||
`enable`
|
||||
)
|
||||
SELECT p.id, f.id, NOW(), NOW(), NULL, 0, 0, 1, 0, 1
|
||||
FROM `product` p
|
||||
JOIN `feature` f ON f.api_id = 'FLXG3A9B'
|
||||
WHERE
|
||||
p.product_en = 'toc_LimitHighExecuted'
|
||||
AND NOT EXISTS (
|
||||
SELECT 1
|
||||
FROM `product_feature` pf
|
||||
WHERE
|
||||
pf.product_id = p.id
|
||||
AND pf.feature_id = f.id
|
||||
AND pf.del_state = 0
|
||||
);
|
||||
|
||||
-- 失信被执行人 QYGL2S0W
|
||||
INSERT INTO
|
||||
`product` (
|
||||
`create_time`,
|
||||
`update_time`,
|
||||
`delete_time`,
|
||||
`del_state`,
|
||||
`version`,
|
||||
`product_name`,
|
||||
`product_en`,
|
||||
`description`,
|
||||
`notes`,
|
||||
`cost_price`,
|
||||
`sell_price`
|
||||
)
|
||||
VALUES (
|
||||
NOW(),
|
||||
NOW(),
|
||||
NULL,
|
||||
0,
|
||||
0,
|
||||
'失信被执行人',
|
||||
'toc_DishonestExecutedPerson',
|
||||
'<p>失信被执行人</p>',
|
||||
NULL,
|
||||
0.50,
|
||||
9.90
|
||||
);
|
||||
|
||||
INSERT INTO
|
||||
`feature` (
|
||||
`create_time`,
|
||||
`update_time`,
|
||||
`delete_time`,
|
||||
`del_state`,
|
||||
`version`,
|
||||
`api_id`,
|
||||
`name`,
|
||||
`cost_price`
|
||||
)
|
||||
VALUES (
|
||||
NOW(),
|
||||
NOW(),
|
||||
NULL,
|
||||
0,
|
||||
0,
|
||||
'QYGL2S0W',
|
||||
'失信被执行人',
|
||||
0.80
|
||||
)
|
||||
ON DUPLICATE KEY UPDATE
|
||||
`name` = VALUES(`name`),
|
||||
`cost_price` = VALUES(`cost_price`);
|
||||
|
||||
INSERT INTO
|
||||
`product_feature` (
|
||||
`product_id`,
|
||||
`feature_id`,
|
||||
`create_time`,
|
||||
`update_time`,
|
||||
`delete_time`,
|
||||
`del_state`,
|
||||
`version`,
|
||||
`sort`,
|
||||
`is_important`,
|
||||
`enable`
|
||||
)
|
||||
SELECT p.id, f.id, NOW(), NOW(), NULL, 0, 0, 1, 0, 1
|
||||
FROM `product` p
|
||||
JOIN `feature` f ON f.api_id = 'QYGL2S0W'
|
||||
WHERE
|
||||
p.product_en = 'toc_DishonestExecutedPerson'
|
||||
AND NOT EXISTS (
|
||||
SELECT 1
|
||||
FROM `product_feature` pf
|
||||
WHERE
|
||||
pf.product_id = p.id
|
||||
AND pf.feature_id = f.id
|
||||
AND pf.del_state = 0
|
||||
);
|
||||
|
||||
-- 公安三要素 IVYZA1B3
|
||||
INSERT INTO
|
||||
`product` (
|
||||
|
||||
Reference in New Issue
Block a user