From 001389f1cba182aad16675a4a893a779236b417c Mon Sep 17 00:00:00 2001 From: gazebo Date: Tue, 6 Nov 2018 18:46:45 +0800 Subject: [PATCH] - change format in GetStoreStockCallbackMsg --- platformapi/jdapi/callback.go | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/platformapi/jdapi/callback.go b/platformapi/jdapi/callback.go index a13f761b..303e9d08 100644 --- a/platformapi/jdapi/callback.go +++ b/platformapi/jdapi/callback.go @@ -141,6 +141,21 @@ func (a *API) GetOrderDeliveryCallbackMsg(data []byte) (msg *CallbackDeliverySta func (a *API) GetStoreStockCallbackMsg(data []byte) (msg *CallbackStoreStockMsg, callbackResponse *CallbackResponse) { msg = new(CallbackStoreStockMsg) - callbackResponse = a.getCommonOrderCallbackMsg(data, msg, true) + tmpMsg := make(map[string]interface{}) + callbackResponse = a.getCommonOrderCallbackMsg(data, tmpMsg, true) + if callbackResponse == nil { + msg.StationNo = utils.Interface2String(tmpMsg["stationNo"]) + msg.SkuId = utils.Str2Int64(utils.Interface2String(tmpMsg["skuId"])) + msg.Vendibility = int(utils.Str2Int64(utils.Interface2String(tmpMsg["vendibility"]))) + msg.OperPin = utils.Interface2String(tmpMsg["operPin"]) + msg.OperTime = utils.Str2Int64(utils.Interface2String(tmpMsg["operTime"])) + msg.OpenSource = int( utils.Str2Int64((utils.Interface2String(tmpMsg["openSource"]))) + have := utils.Interface2String(tmpMsg["have"]) + if have == "true"{ + msg.Have = true + } else { + msg.Have = false + } + } return msg, callbackResponse }