From f4d436e94178df5727bb55bca9853d31f35f7d2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E5=AE=97=E6=A5=A0?= Date: Fri, 8 Apr 2022 18:56:55 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=97=A8=E5=BA=97=E5=8F=91?= =?UTF-8?q?=E5=8D=95=E6=89=8D=E6=94=B6=E9=92=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../jxcallback/scheduler/basesch/basesch.go | 24 ++++++++++--------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/business/jxcallback/scheduler/basesch/basesch.go b/business/jxcallback/scheduler/basesch/basesch.go index 0c7c7874f..0f146e910 100644 --- a/business/jxcallback/scheduler/basesch/basesch.go +++ b/business/jxcallback/scheduler/basesch/basesch.go @@ -180,21 +180,23 @@ func (c *BaseScheduler) CreateWaybill(platformVendorID int, order *model.GoodsOr return nil, err } var balance int - if storeDetail.BrandID == scheduler.JXC4B_SHOP || storeDetail.BrandID == scheduler.JXC4B_RAND_JXGY { // 京西品牌,扣门店 - balance = storeAcct.AccountBalance - } else { - if storeAcct.AccountBalance >= model.BrandBalanceLimit { + + if order.CreateDeliveryType == model.YES { + if storeDetail.BrandID == scheduler.JXC4B_SHOP || storeDetail.BrandID == scheduler.JXC4B_RAND_JXGY { // 京西品牌,扣门店 balance = storeAcct.AccountBalance - } else if storeAcct.AccountBalance < model.BrandBalanceLimit && result >= model.BrandBalanceLimit { - balance = result } else { - balance = 0 + if storeAcct.AccountBalance >= model.BrandBalanceLimit { + balance = storeAcct.AccountBalance + } else if storeAcct.AccountBalance < model.BrandBalanceLimit && result >= model.BrandBalanceLimit { + balance = result + } else { + balance = 0 + } } + }else { + balance, _ = partner.CurStoreAcctManager.GetBrandBalance(storeDetail.BrandID) } - fmt.Println("1111111111111111111111", storeAcct) - fmt.Println("1111111111111111111111", result) - fmt.Println("1111111111111111111111", balance) - //balance, _ = partner.CurStoreAcctManager.GetBrandBalance(storeDetail.BrandID) + handlerInfo := partner.GetDeliveryPlatformFromVendorID(platformVendorID) if handlerInfo != nil && handlerInfo.Use4CreateWaybill { if model.DeliveryBrandMarkMap[platformVendorID]&storeDetail.BrandIsOpen != 0 && balance >= model.BrandBalanceLimit {