From 899184e1adf96080e8bb2d6b84f37f65ed3d4607 Mon Sep 17 00:00:00 2001 From: gazebo Date: Thu, 20 Feb 2020 09:24:16 +0800 Subject: [PATCH 1/4] weimob order nameIDs --- business/cs/weimob_order.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/business/cs/weimob_order.go b/business/cs/weimob_order.go index f487a5290..6cece1baa 100644 --- a/business/cs/weimob_order.go +++ b/business/cs/weimob_order.go @@ -73,7 +73,7 @@ func changeStoreSkusByOrder(order *weimobapi.OrderDetail) { nameIDs = append(nameIDs, v.NameID) } if skuNamesInfo, err := cms.GetSkuNames(ctx, "", false, map[string]interface{}{ - "nameIDs": nameIDs, + "nameIDs": string(utils.MustMarshal(nameIDs)), }, 0, 0); err == nil { for _, skuName := range skuNamesInfo.SkuNames { if skuName.Status != model.SkuStatusNormal { From 692b1a6f01b387d77510e98d9ef6fe66ca387398 Mon Sep 17 00:00:00 2001 From: gazebo Date: Thu, 20 Feb 2020 12:10:08 +0800 Subject: [PATCH 2/4] =?UTF-8?q?updateSingleOrderEarningPrice=E4=B8=AD?= =?UTF-8?q?=E7=9B=B4=E6=8E=A5=E4=BD=BF=E7=94=A8v.SkuID=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxcallback/orderman/order.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/business/jxcallback/orderman/order.go b/business/jxcallback/orderman/order.go index 21c2445bf..82326ba96 100644 --- a/business/jxcallback/orderman/order.go +++ b/business/jxcallback/orderman/order.go @@ -374,7 +374,9 @@ func updateSingleOrderEarningPrice(order *model.GoodsOrder, db *dao.DaoDB) { jxStoreID := jxutils.GetShowStoreIDFromOrder(order) skuIDMap := make(map[int]int) for _, v := range order.Skus { - skuIDMap[v.SkuID] = 1 + if skuID := jxutils.GetSkuIDFromOrderSku(v); skuID > 0 { + skuIDMap[skuID] = 1 + } } if len(skuIDMap) > 0 { actStoreSkuList, err := dao.GetEffectiveActStoreSkuInfo(db, 0, []int{order.VendorID}, model.ActTypeAll, []int{jxStoreID}, jxutils.IntMap2List(skuIDMap), order.OrderCreatedAt, order.OrderCreatedAt) From 313cd9a22622b1bc909dfa2f91138140ce0f24bb Mon Sep 17 00:00:00 2001 From: gazebo Date: Thu, 20 Feb 2020 12:46:36 +0800 Subject: [PATCH 3/4] up --- business/jxcallback/orderman/financial.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/business/jxcallback/orderman/financial.go b/business/jxcallback/orderman/financial.go index f00091462..f253fd30a 100644 --- a/business/jxcallback/orderman/financial.go +++ b/business/jxcallback/orderman/financial.go @@ -111,6 +111,9 @@ func (c *OrderManager) SaveOrderFinancialInfo(order *model.OrderFinancial, opera } if len(order.Skus) > 0 { sku := order.Skus[0] + if sku.SkuID > math.MaxInt32 { + sku.SkuID = 0 + } sku.UserMoney = order.SalePriceMoney - order.DiscountMoney - sku.UserMoney sku.PmSubsidyMoney = platOrderGoodsDiscountMoney + order.SelfDeliveryDiscountMoney - sku.PmSubsidyMoney sku.JxSubsidyMoney = order.JxSubsidyMoney - sku.JxSubsidyMoney From 4159a6198eec41f0c51ab39ebd0f1d2ee70ae2ce Mon Sep 17 00:00:00 2001 From: gazebo Date: Thu, 20 Feb 2020 14:35:37 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E5=AF=B9=E4=BA=8ESkuID=E8=B6=85=E8=8C=83?= =?UTF-8?q?=E5=9B=B4=E7=9A=84=EF=BC=8C=E6=94=B9=E4=B8=BA=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E6=88=90JxSkuID?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxcallback/orderman/financial.go | 4 ++-- business/jxutils/jxutils.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/business/jxcallback/orderman/financial.go b/business/jxcallback/orderman/financial.go index f253fd30a..e7e915a86 100644 --- a/business/jxcallback/orderman/financial.go +++ b/business/jxcallback/orderman/financial.go @@ -98,7 +98,7 @@ func (c *OrderManager) SaveOrderFinancialInfo(order *model.OrderFinancial, opera sku.JxShopMoney = sku.ShopMoneyByCal + sku.JxSubsidyMoney - sku.JxDeductionsMoney order.Skus[0].JxShopMoney += sku.JxShopMoney if sku.SkuID >= math.MaxInt32 { - sku.SkuID = 0 + sku.SkuID = sku.JxSkuID } if err = dao.CreateEntity(db, sku); err != nil { if !dao.IsDuplicateError(err) { @@ -112,7 +112,7 @@ func (c *OrderManager) SaveOrderFinancialInfo(order *model.OrderFinancial, opera if len(order.Skus) > 0 { sku := order.Skus[0] if sku.SkuID > math.MaxInt32 { - sku.SkuID = 0 + sku.SkuID = sku.JxSkuID } sku.UserMoney = order.SalePriceMoney - order.DiscountMoney - sku.UserMoney sku.PmSubsidyMoney = platOrderGoodsDiscountMoney + order.SelfDeliveryDiscountMoney - sku.PmSubsidyMoney diff --git a/business/jxutils/jxutils.go b/business/jxutils/jxutils.go index 517882740..160073540 100644 --- a/business/jxutils/jxutils.go +++ b/business/jxutils/jxutils.go @@ -524,7 +524,7 @@ func RefreshOrderSkuRelated(order *model.GoodsOrder) *model.GoodsOrder { order.EarningPrice = 0 for _, sku := range order.Skus { if sku.SkuID > math.MaxInt32 { - sku.SkuID = 0 + sku.SkuID = sku.JxSkuID } sku.OrderCreatedAt = order.OrderCreatedAt sku.VendorID = order.VendorID @@ -545,7 +545,7 @@ func RefreshAfsOrderSkuRelated(afsOrder *model.AfsOrder) *model.AfsOrder { afsOrder.PmSkuSubsidyMoney = 0 for _, orderSku := range afsOrder.Skus { if orderSku.SkuID > math.MaxInt32 { - orderSku.SkuID = 0 + orderSku.SkuID = orderSku.JxSkuID } afsOrder.SkuUserMoney += orderSku.UserMoney afsOrder.PmSkuSubsidyMoney += orderSku.PmSkuSubsidyMoney