jaryhe пре 7 месеци
родитељ
комит
da15eb94dc

+ 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,""},

+ 3 - 0
impl/vehicle/group.go

@@ -329,6 +329,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 {