|
|
@@ -10,10 +10,14 @@ import ( |
|
|
|
"applet/consume/md" |
|
|
|
"code.fnuoos.com/go_rely_warehouse/zyos_go_mq.git/rabbit" |
|
|
|
"code.fnuoos.com/go_rely_warehouse/zyos_go_order_relate_rule.git/rule/one_circles" |
|
|
|
"code.fnuoos.com/go_rely_warehouse/zyos_go_third_party_api.git/jd_union" |
|
|
|
"code.fnuoos.com/go_rely_warehouse/zyos_go_third_party_api.git/md/cps_jd" |
|
|
|
"encoding/json" |
|
|
|
"errors" |
|
|
|
"fmt" |
|
|
|
"github.com/streadway/amqp" |
|
|
|
"github.com/syyongx/php2go" |
|
|
|
"github.com/tidwall/gjson" |
|
|
|
"time" |
|
|
|
) |
|
|
|
|
|
|
@@ -81,6 +85,25 @@ func handleZhiosOrderTrackCreateForJdConsume(msgData []byte) error { |
|
|
|
return nil |
|
|
|
} |
|
|
|
engine := db.DBs[msg.DbName] |
|
|
|
OrderData := make([]md2.OrderInfo, 0) |
|
|
|
for _, v := range *msg.OrderData { |
|
|
|
if utils.StrToInt64(v.SkuId) == 0 && php2go.IsNumeric(v.ItemId) == false { |
|
|
|
param := map[string]interface{}{} |
|
|
|
param["itemIds"] = []string{v.ItemId} |
|
|
|
keyArr := db.JdUnionComm() |
|
|
|
goods, _ := jd_union.SearchGoods(keyArr, param) |
|
|
|
resp := gjson.Get(goods, "jd_union_open_goods_query_responce.queryResult").String() |
|
|
|
var data cps_jd.JdSearchGoods |
|
|
|
json.Unmarshal([]byte(resp), &data) |
|
|
|
if len(data.Data) > 0 { |
|
|
|
for _, v1 := range data.Data { |
|
|
|
v.SkuId = utils.Int64ToStr(v1.SkuId) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
OrderData = append(OrderData, v) |
|
|
|
} |
|
|
|
msg.OrderData = &OrderData |
|
|
|
err = svc2.OrderSaveCreate(engine, msg.Pvd, msg.OrderData, msg.Opts, msg.DbName) |
|
|
|
if err != nil { |
|
|
|
fmt.Println("order_track_create_for_Jd_ERR:::::::::::>>>>>>>>>", err.Error()) |
|
|
|