2 Revize 0ddca08e9a ... e6acbe693e

Autor SHA1 Zpráva Datum
  jaryhe e6acbe693e add u01 před 7 měsíci
  jaryhe da15eb94dc update před 7 měsíci

+ 2 - 2
common.in/utils/conversion.go

@@ -3,7 +3,7 @@ package utils
 import jsoniter "github.com/json-iterator/go"
 
 func Convertion(dest map[string]interface{}, source string) {
-	s := make(map[string]string)
+	s := make(map[string]interface{})
 	err := jsoniter.UnmarshalFromString(source, &s)
 	if err != nil {
 		return
@@ -28,7 +28,7 @@ func Convertion(dest map[string]interface{}, source string) {
 
 // 覆盖
 func ConvertionCover(dest map[string]interface{}, source string) {
-	s := make(map[string]string)
+	s := make(map[string]interface{})
 	err := jsoniter.UnmarshalFromString(source, &s)
 	if err != nil {
 		return

+ 1 - 0
consts/adm.go

@@ -7,6 +7,7 @@ const (
 	IS01 = "IS01"
 	A01  = "A01"
 	U01  = "U01"
+	U02  = "U02"
 	A04  = "A04"
 	A05  = "A05"
 	F01  = "F01"

+ 24 - 0
impl/thirdparty_impl/adm/u02.go

@@ -0,0 +1,24 @@
+package adm
+
+import (
+	"gd_vehicle/apis"
+	"gd_vehicle/consts"
+	"gd_vehicle/errors"
+	gutils "gd_vehicle/common.in/utils"
+)
+
+func U02(req *apis.ThirdpartRequest, respMap map[string]interface{}) error{
+	req.ProviderInfo.ThirdpartApiRouter = consts.U02
+	str, err := AdmRequest(req)
+	if err != nil {
+		return err
+	}
+
+	if str == "" {
+		return  errors.VendorError
+	}
+	//respData := make(map[string]string)
+	//utils.Convertion(respData, str)
+	gutils.Convertion(respMap, str)
+	return nil
+}

+ 2 - 1
impl/thirdparty_impl/center.go

@@ -38,7 +38,8 @@ var ThirdpartyFuncMap = map[string]ThirdpartyFunc{
 	dutils.ADMA04:               {nil, adm.A04, false, true,"plate_no"},
 	dutils.ADMA05:               {nil, adm.A05, false, true,"vin"},
 	dutils.ADMIS01:              {nil, adm.IS01, false, true,"vin"},
-	dutils.ADMU01:               {nil, adm.U01, false, true,""},
+	dutils.ADMU01:               {nil, adm.U01, false, true,"plate_no"},
+	dutils.ADMU02:               {nil, adm.U02, false, true,"plate_no"},
 	dutils.ADMV01:               {nil, adm.V01, false, true,"plate_no"},
 	dutils.ADMV02:               {nil, adm.V02, false, true,"id_card"},
 	dutils.ADMF01:               {nil, adm.F01, false, true,""},

+ 16 - 0
impl/vehicle/group.go

@@ -7,6 +7,7 @@ import (
 	"context"
 	"gd_vehicle/apis"
 	gutils "gd_vehicle/common.in/utils"
+	"gd_vehicle/consts"
 	"gd_vehicle/errors"
 	"gd_vehicle/impl/thirdparty_impl"
 	"gd_vehicle/utils"
@@ -329,6 +330,9 @@ func getIsMatch(respData map[string]interface{}) string {
 func group(ctx context.Context, req *apis.CommonReq, reply *apis.CommonReply) error {
 	reqData := req.Data.(map[string]interface{})
 	respData := reply.Data.(map[string]interface{})
+	defer func() {
+		reply.Data = respData
+	}()
 	var err error
 	//reply.Data = respData
 	for groupNum, group := range req.ProviderGroup {
@@ -361,6 +365,18 @@ func group(ctx context.Context, req *apis.CommonReq, reply *apis.CommonReply) er
 						return errors.NoRecord
 					}
 				}
+
+				tReq := &apis.ThirdpartRequest{
+					Ctx: ctx,
+					Params: respData,
+					ProviderApiCode: dutils.ADMU01,
+					ProviderMap:     req.ProviderMap,
+					RangeNo:         consts.RANGEONE,
+					Req:             req,
+					Reply:           reply,
+				}
+				//respData := make(map[string]interface{})
+				thirdparty_impl.CallThirdparty(tReq,respData)
 			// vin查车辆信息组
 			case  utils.ADMA02,utils.ADMA05:
 				if req.NeedVehicleInfo || getIsMatch(respData) == "1"{