This commit is contained in:
邹宗楠
2023-05-23 19:06:47 +08:00
parent bb57eacecc
commit dcc5c91f58
6 changed files with 18 additions and 34 deletions

View File

@@ -62,7 +62,7 @@ func (c *BaseScheduler) CreateWaybillOnProviders(ctx *jxcontext.Context, order *
}
err = nil
} else if errList.GetErrListAsOne() == nil {
err = fmt.Errorf("orderID:%s订单发三方配送亏损超6元/当前订单配送方式不是门店自送/没有绑定有效的三方配送门店", order.VendorOrderID)
err = fmt.Errorf("orderID:%s订单发三方配送亏损超6元/当前订单配送方式不是门店自送/没有绑定有效的三方配送门店", order.VendorOrderID)
} else {
err = fmt.Errorf("orderID:%s所有运单失败%s", order.VendorOrderID, errList.GetErrListAsOne().Error())
}

View File

@@ -891,7 +891,7 @@ func (s *DefScheduler) createWaybillOn3rdProviders(savedOrderInfo *WatchOrderInf
// excludeVendorIDs = append(excludeVendorIDs, model.VendorIDMTPS)
// }
//TODO 2020-08-18 饿百美团订单暂时不自动发送三方
if order.VendorID == model.VendorIDMTWM || order.VendorID == model.VendorIDEBAI || order.VendorID == model.VendorIDJD {
if order.VendorID == model.VendorIDMTWM || order.VendorID == model.VendorIDEBAI || order.VendorID == model.VendorIDJD || order.VendorID == model.VendorIDDD {
if order.DeliveryType != model.OrderDeliveryTypeStoreSelf {
excludeVendorIDs = append(excludeVendorIDs, waybillVendorIDs...)
}

View File

@@ -214,37 +214,14 @@ func (s *DefScheduler) CreateWaybillOnProviders4SavedOrder(ctx *jxcontext.Contex
partner.CurStoreAcctManager.InsertStoreAcctExpendAndUpdateStoreAcctBalance(ctx, jxutils.GetSaleStoreIDFromOrder(order), int(newPrice)-lastFee, partner.StoreAcctTypeExpendCreateWaybill2ndMore, order.VendorOrderID, "", expend.ID) //int(newPrice)-lastFee
}
}
} /*else { // 品牌发单,品牌支出运费
if storeAcct.AccountBalance > int(newPrice) {
if int(newPrice) > lastFee {
// 品牌支出费用
partner.CurStoreAcctManager.InsertBrandBill(jxcontext.AdminCtx, storeList.BrandID, int(newPrice), model.BrandBillTypeExpend, model.BrandBillFeeTypeDelivery, order.VendorOrderID, order.VendorWaybillID)
}
}
}*/
}
} else { // 新订单的发单记录,门店发单扣门店,品牌发单扣品牌
if len(courierVendorIDs) == 1 {
courierVendorID := courierVendorIDs[0]
if _, ok := deliveryFeeMap[courierVendorID]; ok {
//if storeList.BrandID != scheduler.JXC4B_SHOP && storeList.BrandID != scheduler.JXC4B_RAND_JXGY { // 非京西品牌,先扣门店在扣品牌
//if storeAcct.AccountBalance > int(model.Waybill{}.DesiredFee) {
if order.CreateDeliveryType == model.YES {
err = partner.CurStoreAcctManager.InsertStoreAcctExpendAndUpdateStoreAcctBalance(ctx, jxutils.GetSaleStoreIDFromOrder(order), int(deliveryFeeMap[courierVendorID].DeliveryFee), partner.StoreAcctTypeExpendCreateWaybillEx, order.VendorOrderID, "", 0) //int(newPrice)-lastFee
globals.SugarLogger.Debugf("InsertStoreAcctExpendAndUpdateStoreAcctBalance 238 err := %v", err)
} /*else {
partner.CurStoreAcctManager.InsertBrandBill(jxcontext.AdminCtx, storeList.BrandID, int(bill.DesiredFee), model.BrandBillTypeExpend, model.BrandBillFeeTypeDelivery, bill.VendorOrderID, bill.VendorWaybillID)
}*/
//} /*else if result > int(model.Waybill{}.DesiredFee) {
// 品牌支出费用
// partner.CurStoreAcctManager.InsertBrandBill(jxcontext.AdminCtx, storeList.BrandID, int(model.Waybill{}.DesiredFee), model.BrandBillTypeExpend, model.BrandBillFeeTypeDelivery, order.VendorOrderID, order.VendorWaybillID)
//}*/
//} else { // 京西品牌
// if storeAcct.AccountBalance > int(model.Waybill{}.DesiredFee) {
// // 门店支出费用
// partner.CurStoreAcctManager.InsertStoreAcctExpendAndUpdateStoreAcctBalance(ctx, jxutils.GetSaleStoreIDFromOrder(order), int(model.Waybill{}.DesiredFee), partner.StoreAcctTypeExpendCreateWaybill2ndMore, order.VendorOrderID, expend.ID) //int(newPrice)-lastFee
// }
//}
}
}
} else if len(courierVendorIDs) == 0 {
var maxFee int64
@@ -254,7 +231,6 @@ func (s *DefScheduler) CreateWaybillOnProviders4SavedOrder(ctx *jxcontext.Contex
}
}
err = partner.CurStoreAcctManager.InsertStoreAcctExpendAndUpdateStoreAcctBalance(ctx, jxutils.GetSaleStoreIDFromOrder(order), int(maxFee), partner.StoreAcctTypeExpendCreateWaybillEx, order.VendorOrderID, "", 0) //int(maxFee)
globals.SugarLogger.Debugf("InsertStoreAcctExpendAndUpdateStoreAcctBalance 260 err := %v", err)
}
}
} else {
@@ -273,7 +249,6 @@ func (s *DefScheduler) CreateWaybillOnProviders4SavedOrder(ctx *jxcontext.Contex
}
}
err = partner.CurStoreAcctManager.InsertBrandBill(jxcontext.AdminCtx, storeList.BrandID, int(maxFee), model.BrandBillTypeExpend, model.BrandBillFeeTypeDelivery, order.VendorOrderID, order.VendorWaybillID)
globals.SugarLogger.Debugf("InsertStoreAcctExpendAndUpdateStoreAcctBalance 260 err := %v", err)
}
}