From c82db73cc1d2971c381b105fd942eff035fc11c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E5=AE=97=E6=A5=A0?= Date: Mon, 22 Jan 2024 14:37:31 +0800 Subject: [PATCH] 1 --- .../jxcallback/scheduler/basesch/basesch_ext.go | 6 +++--- .../jxcallback/scheduler/defsch/defsch_ext.go | 12 +++++++++++- business/model/order.go | 2 +- business/partner/purchase/ebai/order.go | 2 +- business/partner/purchase/jdshop/order.go | 2 +- business/partner/purchase/tiktok_store/order.go | 2 +- controllers/taobao_vegetable.go | 16 ++++++++++++++-- 7 files changed, 32 insertions(+), 10 deletions(-) diff --git a/business/jxcallback/scheduler/basesch/basesch_ext.go b/business/jxcallback/scheduler/basesch/basesch_ext.go index ed807e0d7..7e957ecbe 100644 --- a/business/jxcallback/scheduler/basesch/basesch_ext.go +++ b/business/jxcallback/scheduler/basesch/basesch_ext.go @@ -382,9 +382,9 @@ func (c *BaseScheduler) CheckStoreBalanceWithTip(ctx *jxcontext.Context, order * if roundTipFee != tipFee { return model.ErrCodeOnePayTipFeeMore, fmt.Errorf("小费必须是1元的整数倍") } - if order.WaybillTipMoney >= tipFee { - return model.ErrCodeOnePayTipFeeMore, fmt.Errorf("本次小费金额不能小于已经支付的小费") - } + //if order.WaybillTipMoney >= tipFee { + // return model.ErrCodeOnePayTipFeeMore, fmt.Errorf("本次小费金额不能小于已经支付的小费") + //} if order.CreateDeliveryType == model.YES { //加小费只判断余额 storeAcct, err := cms.GetStoreAcctBalance(ctx, jxutils.GetSaleStoreIDFromOrder(order)) diff --git a/business/jxcallback/scheduler/defsch/defsch_ext.go b/business/jxcallback/scheduler/defsch/defsch_ext.go index cde152d6c..411153ad6 100644 --- a/business/jxcallback/scheduler/defsch/defsch_ext.go +++ b/business/jxcallback/scheduler/defsch/defsch_ext.go @@ -287,6 +287,16 @@ func (s *DefScheduler) CreateWaybillOnProvidersEx(ctx *jxcontext.Context, vendor return nil, errCode, err } } + excludeCourierVendorIDs := make([]int, 0, 0) + allDelivery := map[int]int{model.VendorIDFengNiao: 1, model.VendorIDDada: 1, model.VendorIDMTPS: 1, model.VendorIDUUPT: 1, model.VendorIDSFPS: 1} + for _, v := range courierVendorIDs { + if allDelivery[v] == model.YES { + delete(allDelivery, v) + } + } + for _, v := range allDelivery { + excludeCourierVendorIDs = append(excludeCourierVendorIDs, v) + } billFunc := func() { bills, err = func() (bills []*model.Waybill, err error) { @@ -312,7 +322,7 @@ func (s *DefScheduler) CreateWaybillOnProvidersEx(ctx *jxcontext.Context, vendor order.DeliveryFlag = 0 err = partner.CurOrderManager.UpdateOrderStatusAndDeliveryFlag(order) // 创建订单 - if bills, err = s.CreateWaybillOnProviders4SavedOrder(ctx, savedOrderInfo, courierVendorIDs, nil, forceCreate, maxDeliveryFee); err == nil && len(bills) > 0 { + if bills, err = s.CreateWaybillOnProviders4SavedOrder(ctx, savedOrderInfo, courierVendorIDs, excludeCourierVendorIDs, forceCreate, maxDeliveryFee); err == nil && len(bills) > 0 { partner.CurOrderManager.OnOrderMsg(order, "手动创建运单成功", fmt.Sprintf("%s创建%s平台运单,强发:%t,最高限价:%d", ctx.GetUserName(), model.VendorChineseNames[bills[0].WaybillVendorID], forceCreate, maxDeliveryFee)) } } diff --git a/business/model/order.go b/business/model/order.go index 5f14ea437..66bef4fdc 100644 --- a/business/model/order.go +++ b/business/model/order.go @@ -137,7 +137,7 @@ type GoodsOrder struct { ExpectedDeliveredTime time.Time `orm:"type(datetime)" json:"expectedDeliveredTime"` // 预期送达时间 CancelApplyReason string `orm:"size(255)" json:"-"` // ""表示没有申请,不为null表示用户正在取消申请 DeliveryType string `orm:"size(32)" json:"deliveryType"` // 订单配送方式,缺省是平台配送 - CreateDeliveryType int `orm:"default(0)" json:"createDeliveryType"` //默认0系统发单,1为门店发单 + CreateDeliveryType int `orm:"default(0)" json:"createDeliveryType"` // 默认0系统发单,1为门店发单 VendorWaybillID string `orm:"column(vendor_waybill_id);size(48)" json:"vendorWaybillID"` // 运单id WaybillVendorID int `orm:"column(waybill_vendor_id)" json:"waybillVendorID"` // 表示当前承运商,-1表示还没有安排 AdjustCount int8 `json:"adjustCount"` // 调整单(次数) diff --git a/business/partner/purchase/ebai/order.go b/business/partner/purchase/ebai/order.go index b48d10d47..1507eaa46 100644 --- a/business/partner/purchase/ebai/order.go +++ b/business/partner/purchase/ebai/order.go @@ -796,7 +796,7 @@ func (c *PurchaseHandler) ConfirmSelfTake(ctx *jxcontext.Context, order *model.G } func (c *PurchaseHandler) ComplaintRider(vendorOrderId string, resonID int, resonContent string) (err error) { - return fmt.Errorf("饿了么暂无投诉骑手API") + return fmt.Errorf("饿了么暂无投诉骑手,请联系饿了么客服") } // 转自配送时取消非专送混合送门店取消理由 diff --git a/business/partner/purchase/jdshop/order.go b/business/partner/purchase/jdshop/order.go index 95f0904af..c78bc4b8e 100644 --- a/business/partner/purchase/jdshop/order.go +++ b/business/partner/purchase/jdshop/order.go @@ -311,7 +311,7 @@ func (c *PurchaseHandler) ListOrders(ctx *jxcontext.Context, vendorOrgCode strin } func (c *PurchaseHandler) ComplaintRider(vendorOrderId string, resonID int, resonContent string) (err error) { - return err + return fmt.Errorf("暂无投诉渠道,请致电京东客服") } // 转自配送时取消非专送混合送门店取消理由 diff --git a/business/partner/purchase/tiktok_store/order.go b/business/partner/purchase/tiktok_store/order.go index 46688fdbe..ba3903548 100644 --- a/business/partner/purchase/tiktok_store/order.go +++ b/business/partner/purchase/tiktok_store/order.go @@ -990,7 +990,7 @@ func (c *PurchaseHandler) ConfirmSelfTake(ctx *jxcontext.Context, order *model.G } func (c *PurchaseHandler) ComplaintRider(vendorOrderId string, resonID int, resonContent string) (err error) { - return fmt.Errorf("抖店暂不提供投诉骑手API") + return fmt.Errorf("抖店暂不提供投诉骑手API,联系客服") } // GetCancelDeliveryReason 转自配送时取消非专送混合送门店取消理由 diff --git a/controllers/taobao_vegetable.go b/controllers/taobao_vegetable.go index e7716e690..7595e0709 100644 --- a/controllers/taobao_vegetable.go +++ b/controllers/taobao_vegetable.go @@ -225,13 +225,25 @@ func (c *TaoBaoVegetableController) CancelOnSaleRefundOrder() { } default: order, err := partner.CurOrderManager.LoadOrder(utils.Int64ToStr(afsOrder.PartCancelRequest.BizOrderId), model.VendorIDTaoVegetable) - if err != nil || order.Status < model.OrderStatusDelivering || order.Status == model.OrderStatusCanceled { + if err != nil { c.Data["json"] = tao_vegetable.CallBackResultOnSaleCancel(nil) c.ServeJSON() - } else { + return + } + if order.Status == model.OrderStatusCanceled { + c.Data["json"] = tao_vegetable.CallBackResultOnSaleCancel(nil) + c.ServeJSON() + return + } + + if order.Status >= model.OrderStatusDelivering { c.Data["json"] = tao_vegetable.CallBackResultOnSaleCancel(fmt.Errorf("不支持售中取消")) c.ServeJSON() + } else { + c.Data["json"] = tao_vegetable.CallBackResultOnSaleCancel(nil) + c.ServeJSON() } + return } }