|
@@ -14,7 +14,7 @@ import (
|
|
|
//"strings"
|
|
|
)
|
|
|
// 所有人验证组
|
|
|
-func ownerVerifyGroup(ctx context.Context, req *apis.CommonReq, reply *apis.CommonReply, reqData map[string]interface{}, respData map[string]string, providerMap map[string]apis.MerchantProviderLimitInfo, group []string, rangeNo int)error {
|
|
|
+func ownerVerifyGroup(ctx context.Context, req *apis.CommonReq, reply *apis.CommonReply, reqData map[string]interface{}, respData map[string]interface{}, providerMap map[string]apis.MerchantProviderLimitInfo, group []string, rangeNo int)error {
|
|
|
plateNo := dutils.GetStringParams(reqData,"plate_no")
|
|
|
plateType := dutils.GetStringParams(reqData,"plate_type")
|
|
|
owner := dutils.GetStringParams(reqData,"owner")
|
|
@@ -29,7 +29,7 @@ func ownerVerifyGroup(ctx context.Context, req *apis.CommonReq, reply *apis.Comm
|
|
|
}
|
|
|
switch v {
|
|
|
case utils.ADMV01:
|
|
|
- tReq.Params = map[string]string{
|
|
|
+ tReq.Params = map[string]interface{}{
|
|
|
"owner": owner,
|
|
|
"plate_no": plateNo,
|
|
|
"plate_type":plateType,
|
|
@@ -55,7 +55,7 @@ func ownerVerifyGroup(ctx context.Context, req *apis.CommonReq, reply *apis.Comm
|
|
|
respData["is_match"] = ret
|
|
|
return nil*/
|
|
|
case utils.ZRTWOELEMENTVERIFYNATIONAL:
|
|
|
- tReq.Params = map[string]string{
|
|
|
+ tReq.Params = map[string]interface{}{
|
|
|
"name": owner,
|
|
|
"plateNum": plateNo,
|
|
|
//"plateColor":plateType,
|
|
@@ -71,7 +71,7 @@ func ownerVerifyGroup(ctx context.Context, req *apis.CommonReq, reply *apis.Comm
|
|
|
}
|
|
|
|
|
|
// 身份验证组
|
|
|
-func identityVerifyGroup(ctx context.Context, req *apis.CommonReq, reply *apis.CommonReply, reqData map[string]interface{}, respData map[string]string, providerMap map[string]apis.MerchantProviderLimitInfo, group []string, rangeNo int) error {
|
|
|
+func identityVerifyGroup(ctx context.Context, req *apis.CommonReq, reply *apis.CommonReply, reqData map[string]interface{}, respData map[string]interface{}, providerMap map[string]apis.MerchantProviderLimitInfo, group []string, rangeNo int) error {
|
|
|
owner := dutils.GetStringParams(reqData,"owner")
|
|
|
idCard := dutils.GetStringParams(reqData,"id_card")
|
|
|
var err error
|
|
@@ -86,7 +86,7 @@ func identityVerifyGroup(ctx context.Context, req *apis.CommonReq, reply *apis.C
|
|
|
}
|
|
|
switch v {
|
|
|
case utils.ADMV02:
|
|
|
- tReq.Params = map[string]string{
|
|
|
+ tReq.Params = map[string]interface{}{
|
|
|
"name": owner,
|
|
|
"id_card": idCard,
|
|
|
}
|
|
@@ -157,7 +157,7 @@ func identityVerifyGroup(ctx context.Context, req *apis.CommonReq, reply *apis.C
|
|
|
}
|
|
|
*/
|
|
|
// 车牌查车档组
|
|
|
-func vehicleInfoByPlateGroup(ctx context.Context, req *apis.CommonReq, reply *apis.CommonReply, reqData map[string]interface{}, respData map[string]string, providerMap map[string]apis.MerchantProviderLimitInfo, group []string, rangeNo int) error {
|
|
|
+func vehicleInfoByPlateGroup(ctx context.Context, req *apis.CommonReq, reply *apis.CommonReply, reqData map[string]interface{}, respData map[string]interface{}, providerMap map[string]apis.MerchantProviderLimitInfo, group []string, rangeNo int) error {
|
|
|
plateNo := dutils.GetStringParams(reqData,"plate_no")
|
|
|
plateType := dutils.GetStringParams(reqData,"plate_type")
|
|
|
if plateNo == "" || plateType == ""{
|
|
@@ -177,7 +177,7 @@ func vehicleInfoByPlateGroup(ctx context.Context, req *apis.CommonReq, reply *ap
|
|
|
switch v {
|
|
|
// 车牌查车辆信息
|
|
|
case utils.ADMA04:
|
|
|
- tReq.Params = map[string]string{
|
|
|
+ tReq.Params = map[string]interface{}{
|
|
|
"plate_no": plateNo,
|
|
|
"plate_type":plateType,
|
|
|
}
|
|
@@ -199,7 +199,7 @@ func vehicleInfoByPlateGroup(ctx context.Context, req *apis.CommonReq, reply *ap
|
|
|
|
|
|
// 车牌查vin
|
|
|
case utils.ADMA01:
|
|
|
- tReq.Params = map[string]string{
|
|
|
+ tReq.Params = map[string]interface{}{
|
|
|
"plate_no": plateNo,
|
|
|
"plate_type":plateType,
|
|
|
}
|
|
@@ -210,7 +210,7 @@ func vehicleInfoByPlateGroup(ctx context.Context, req *apis.CommonReq, reply *ap
|
|
|
return nil
|
|
|
// 车牌查车辆信息
|
|
|
case utils.ZRVEHICLEINFO:
|
|
|
- tReq.Params = map[string]string{
|
|
|
+ tReq.Params = map[string]interface{}{
|
|
|
"plateNumber": plateNo,
|
|
|
}
|
|
|
err = thirdparty_impl.CallThirdparty(tReq,respData)
|
|
@@ -220,7 +220,7 @@ func vehicleInfoByPlateGroup(ctx context.Context, req *apis.CommonReq, reply *ap
|
|
|
return nil
|
|
|
// 车牌查vin
|
|
|
case utils.ZRVEHICLEVIN:
|
|
|
- tReq.Params = map[string]string{
|
|
|
+ tReq.Params = map[string]interface{}{
|
|
|
"vinOrPlateNumber": plateNo,
|
|
|
}
|
|
|
err = thirdparty_impl.CallThirdparty(tReq,respData)
|
|
@@ -230,7 +230,7 @@ func vehicleInfoByPlateGroup(ctx context.Context, req *apis.CommonReq, reply *ap
|
|
|
return nil
|
|
|
|
|
|
case utils.ZRVEHICLEFIVE:
|
|
|
- tReq.Params = map[string]string{
|
|
|
+ tReq.Params = map[string]interface{}{
|
|
|
"vinOrPlateNumber": plateNo,
|
|
|
}
|
|
|
err = thirdparty_impl.CallThirdparty(tReq,respData)
|
|
@@ -246,10 +246,10 @@ func vehicleInfoByPlateGroup(ctx context.Context, req *apis.CommonReq, reply *ap
|
|
|
}
|
|
|
|
|
|
// vin查车档组
|
|
|
-func vehicleInfoByVinGroup(ctx context.Context, req *apis.CommonReq, reply *apis.CommonReply, reqData map[string]interface{}, respData map[string]string, providerMap map[string]apis.MerchantProviderLimitInfo, group []string, rangeNo int) error {
|
|
|
+func vehicleInfoByVinGroup(ctx context.Context, req *apis.CommonReq, reply *apis.CommonReply, reqData map[string]interface{}, respData map[string]interface{}, providerMap map[string]apis.MerchantProviderLimitInfo, group []string, rangeNo int) error {
|
|
|
vin := dutils.GetStringParams(reqData,"vin")
|
|
|
if vin == "" {
|
|
|
- vin = respData["vin"]
|
|
|
+ vin = dutils.GetStringParams(respData,"vin")
|
|
|
}
|
|
|
|
|
|
if vin == "" {
|
|
@@ -269,7 +269,7 @@ func vehicleInfoByVinGroup(ctx context.Context, req *apis.CommonReq, reply *apis
|
|
|
switch v {
|
|
|
// vin查车辆信息
|
|
|
case utils.ADMA05:
|
|
|
- tReq.Params = map[string]string{
|
|
|
+ tReq.Params = map[string]interface{}{
|
|
|
"vin": vin,
|
|
|
}
|
|
|
err = thirdparty_impl.CallThirdparty(tReq,respData)
|
|
@@ -294,7 +294,7 @@ func vehicleInfoByVinGroup(ctx context.Context, req *apis.CommonReq, reply *apis
|
|
|
|
|
|
// vin 查车牌
|
|
|
case utils.ADMA02:
|
|
|
- tReq.Params = map[string]string{
|
|
|
+ tReq.Params = map[string]interface{}{
|
|
|
"vin": vin,
|
|
|
}
|
|
|
err = thirdparty_impl.CallThirdparty(tReq,respData)
|
|
@@ -312,6 +312,14 @@ func vehicleInfoByVinGroup(ctx context.Context, req *apis.CommonReq, reply *apis
|
|
|
return errors.NoRecord
|
|
|
}
|
|
|
|
|
|
+func getIsMatch(respData map[string]interface{}) string {
|
|
|
+ if v, ok := respData["is_match"]; ok {
|
|
|
+ if _, ok = v.(string); ok && v.(string) != "" {
|
|
|
+ return v.(string)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return "0"
|
|
|
+}
|
|
|
func group(ctx context.Context, req *apis.CommonReq, reply *apis.CommonReply) error {
|
|
|
reqData := req.Data.(map[string]interface{})
|
|
|
/*MerchantProviderLimitInfoList, err := utils.GetProviderInfo(req.MerchantApiInfo.MerchantChildApiId, req.BaseApiId)
|
|
@@ -321,7 +329,7 @@ func group(ctx context.Context, req *apis.CommonReq, reply *apis.CommonReply) er
|
|
|
|
|
|
providerMap, providerGroup := utils.GenProviderInfoMapNew(MerchantProviderLimitInfoList)*/
|
|
|
var err error
|
|
|
- respData := make(map[string]string)
|
|
|
+ respData := make(map[string]interface{})
|
|
|
reply.Data = respData
|
|
|
for groupNum, group := range req.ProviderGroup {
|
|
|
rangeNo := groupNum + 1
|
|
@@ -329,7 +337,7 @@ func group(ctx context.Context, req *apis.CommonReq, reply *apis.CommonReply) er
|
|
|
switch v {
|
|
|
// 人车核验组
|
|
|
case utils.ADMV01:
|
|
|
- if respData["is_match"] == "-1"{
|
|
|
+ if getIsMatch(respData) == "-1"{
|
|
|
continue
|
|
|
}
|
|
|
err = ownerVerifyGroup(ctx,req,reply,reqData,respData,req.ProviderMap,group,rangeNo)
|
|
@@ -338,7 +346,7 @@ func group(ctx context.Context, req *apis.CommonReq, reply *apis.CommonReply) er
|
|
|
}
|
|
|
// 人身核验组
|
|
|
case utils.ADMV02:
|
|
|
- if respData["is_match"] == "-1"{
|
|
|
+ if getIsMatch(respData) == "-1"{
|
|
|
continue
|
|
|
}
|
|
|
err = identityVerifyGroup(ctx,req,reply,reqData,respData,req.ProviderMap,group,rangeNo)
|
|
@@ -347,7 +355,7 @@ func group(ctx context.Context, req *apis.CommonReq, reply *apis.CommonReply) er
|
|
|
}
|
|
|
// 车牌查车辆信息组
|
|
|
case utils.ADMA01,utils.ADMA04:
|
|
|
- if req.NeedVehicleInfo || respData["is_match"] == "1"{
|
|
|
+ if req.NeedVehicleInfo || getIsMatch(respData) == "1"{
|
|
|
err = vehicleInfoByPlateGroup(ctx,req,reply,reqData,respData,req.ProviderMap,group,rangeNo)
|
|
|
if err != nil {
|
|
|
return errors.NoRecord
|
|
@@ -355,7 +363,7 @@ func group(ctx context.Context, req *apis.CommonReq, reply *apis.CommonReply) er
|
|
|
}
|
|
|
// vin查车辆信息组
|
|
|
case utils.ADMA02,utils.ADMA05:
|
|
|
- if req.NeedVehicleInfo || respData["is_match"] == "1"{
|
|
|
+ if req.NeedVehicleInfo || getIsMatch(respData) == "1"{
|
|
|
err = vehicleInfoByVinGroup(ctx,req,reply,reqData,respData,req.ProviderMap,group,rangeNo)
|
|
|
if err != nil {
|
|
|
return errors.NoRecord
|