From 7c913c0d5bcbb31aa48bafdbf475f5c1bfbec38f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E5=B0=B9=E5=B2=9A?= <770236076@qq.com> Date: Wed, 27 Nov 2019 11:04:03 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A0=B9=E6=8D=AE=E5=BE=AE=E7=9B=9F=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E4=BA=AC=E8=A5=BF=E4=BB=B7=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxstore/yonghui/yonghui.go | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/business/jxstore/yonghui/yonghui.go b/business/jxstore/yonghui/yonghui.go index c4443afd9..3087d3209 100644 --- a/business/jxstore/yonghui/yonghui.go +++ b/business/jxstore/yonghui/yonghui.go @@ -771,6 +771,7 @@ func UpdateJxPriceByWeimob(ctx *jxcontext.Context, storeIDs []int, isAsync, isCo var ( storeSkuBindInfoList []interface{} skuBindInfos []*cms.StoreSkuBindInfo + nameID int ) db := dao.GetDB() dataFailed.dataFailedList = dataFailed.dataFailedList[0:0] @@ -793,9 +794,19 @@ func UpdateJxPriceByWeimob(ctx *jxcontext.Context, storeIDs []int, isAsync, isCo if err != nil { baseapi.SugarLogger.Errorf("QueryGoodsDetail error:%v", err) } - nameID := int(utils.Str2Int64(goodsDetail.SkuMap.SingleSku.OuterSkuCode)) - unitPrice := int(utils.Float64TwoInt64(goodsDetail.SkuMap.SingleSku.CostPrice * 100)) goodsID := goodsDetail.OuterGoodsCode + unitPrice := int(utils.Float64TwoInt64(goodsDetail.SkuMap.SingleSku.CostPrice * 100)) + if goodsDetail.SkuMap.SingleSku.OuterSkuCode != "" { + nameID = int(utils.Str2Int64(goodsDetail.SkuMap.SingleSku.OuterSkuCode)) + } else { + outPutData := DataFailed{ + GoodsID: goodsID, + GoodsName: goodsDetail.Title, + Comment: "微盟上没有该商品的商品编码", + } + dataFailed.AppendData2(outPutData) + nameID = -1 + } skuList, err := dao.GetStoreSkusByNameIDs(db, storeIDs, nameID) if len(skuList) > 0 { if goodsDetail.OuterGoodsCode != "" {