From 0508fd922bef330fefaad7bb03ba2b019eedbd05 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, 5 Aug 2020 11:21:48 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=A2=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxcallback/orderman/order.go | 20 ++++++++++++++++---- business/jxstore/cms/sync.go | 6 ++++++ 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/business/jxcallback/orderman/order.go b/business/jxcallback/orderman/order.go index 768b1b30a..841c2e7ad 100644 --- a/business/jxcallback/orderman/order.go +++ b/business/jxcallback/orderman/order.go @@ -199,12 +199,24 @@ func (c *OrderManager) OnOrderStatusChanged(vendorOrgCode string, orderStatus *m waybill, _ := c.LoadWaybill(order.VendorWaybillID, order.WaybillVendorID) store, _ := c.LoadStoreDetail(jxutils.GetSaleStoreIDFromOrder(order), order.VendorID) if waybill == nil { - if order.NewEarningPrice == 0 || order.NewEarningPrice != order.TotalShopMoney*int64(100-store.PayPercentage)/int64(100) { - order.NewEarningPrice = order.TotalShopMoney * int64(100-store.PayPercentage) / int64(100) + if order.VendorID == model.VendorIDJDShop || order.VendorID == model.VendorIDJX { + if order.NewEarningPrice == 0 || order.NewEarningPrice != order.TotalShopMoney*int64(100-store.PayPercentage)/int64(100) { + order.NewEarningPrice = order.TotalShopMoney * int64(100-store.PayPercentage) / int64(100) + } + } else { + if order.NewEarningPrice == 0 || order.NewEarningPrice != order.TotalShopMoney*int64(100-store.PayPercentage/2)/int64(100) { + order.NewEarningPrice = order.TotalShopMoney * int64(100-store.PayPercentage/2) / int64(100) + } } } else { - if order.NewEarningPrice == 0 || order.NewEarningPrice != (order.TotalShopMoney-waybill.DesiredFee)*int64(100-store.PayPercentage)/int64(100) { - order.NewEarningPrice = (order.TotalShopMoney - waybill.DesiredFee) * int64(100-store.PayPercentage) / int64(100) + if order.VendorID == model.VendorIDJDShop || order.VendorID == model.VendorIDJX { + if order.NewEarningPrice == 0 || order.NewEarningPrice != (order.TotalShopMoney-waybill.DesiredFee)*int64(100-store.PayPercentage)/int64(100) { + order.NewEarningPrice = (order.TotalShopMoney - waybill.DesiredFee) * int64(100-store.PayPercentage) / int64(100) + } + } else { + if order.NewEarningPrice == 0 || order.NewEarningPrice != (order.TotalShopMoney-waybill.DesiredFee)*int64(100-store.PayPercentage/2)/int64(100) { + order.NewEarningPrice = (order.TotalShopMoney - waybill.DesiredFee) * int64(100-store.PayPercentage/2) / int64(100) + } } } dao.UpdateEntity(db, order, "NewEarningPrice") diff --git a/business/jxstore/cms/sync.go b/business/jxstore/cms/sync.go index 7974fcc30..4b84bae1d 100644 --- a/business/jxstore/cms/sync.go +++ b/business/jxstore/cms/sync.go @@ -1297,6 +1297,12 @@ func SetMTPSStatus(ctx *jxcontext.Context, storeId, courierStatus int) { ShopInfo, _ := api.MtpsAPI.ShopQuery(strconv.Itoa(storeId)) if ShopInfo != nil { ShopName = ShopInfo.ShopName + if ShopName == "" { + if StoreLists[0].Name[len(StoreLists[0].Name)-1:] == "εΊ—" { + + } + ShopName = StoreLists[0].Name + } StoreInfoList, _ = api.MtpsAPI.GetStoreStatus(ShopName) if StoreInfoList != nil && StoreInfoList.DataList != nil { goto ifExist