From a8b994a0bd3ba5f72f0293dbcc7be87781012a8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E5=AE=97=E6=A5=A0?= Date: Fri, 28 Oct 2022 14:26:26 +0800 Subject: [PATCH 1/3] 1 --- business/partner/purchase/tiktok_store/order.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/business/partner/purchase/tiktok_store/order.go b/business/partner/purchase/tiktok_store/order.go index 8fbd05fbf..56d6ce5be 100644 --- a/business/partner/purchase/tiktok_store/order.go +++ b/business/partner/purchase/tiktok_store/order.go @@ -602,7 +602,7 @@ func (c *PurchaseHandler) Swtich2SelfDelivered(order *model.GoodsOrder, userName // SelfDeliverDelivering 订单在自配送中,表示三方品牌接单,通知抖音已经发货了 func (c *PurchaseHandler) SelfDeliverDelivering(order *model.GoodsOrder, userName string) (err error) { - return getAPI(order.VendorOrgCode, jxutils.GetSaleStoreIDFromOrder(order), "").OrderDelivering(&order_logisticsAdd_request.OrderLogisticsAddParam{ + param := &order_logisticsAdd_request.OrderLogisticsAddParam{ OrderId: order.VendorOrderID, Company: "", CompanyCode: "chengdouruoxi", @@ -612,7 +612,9 @@ func (c *PurchaseHandler) SelfDeliverDelivering(order *model.GoodsOrder, userNam SerialNumberList: nil, AddressId: 0, StoreId: utils.Str2Int64(order.VendorStoreID), - }) + } + globals.SugarLogger.Debugf("=============%s", utils.Format4Output(param, false)) + return getAPI(order.VendorOrgCode, jxutils.GetSaleStoreIDFromOrder(order), "").OrderDelivering(param) } // SelfDeliverDelivered 自配搜完成(暂无) From d523551a4cc0f2d4844297af4ef434add5840d58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E5=AE=97=E6=A5=A0?= Date: Fri, 28 Oct 2022 14:42:32 +0800 Subject: [PATCH 2/3] 1 --- business/jxcallback/scheduler/defsch/defsch.go | 4 ---- 1 file changed, 4 deletions(-) diff --git a/business/jxcallback/scheduler/defsch/defsch.go b/business/jxcallback/scheduler/defsch/defsch.go index 95d06ac04..d95c989ed 100644 --- a/business/jxcallback/scheduler/defsch/defsch.go +++ b/business/jxcallback/scheduler/defsch/defsch.go @@ -519,10 +519,6 @@ func (s *DefScheduler) OnWaybillStatusChanged(bill *model.Waybill, isPending boo //} // 暂时只处理抖音平台,抖音暂无配送,只要是抖音订单,三方配送压单了,直接通知送出 - if order.VendorID == model.VendorIDDD && bill.Status == model.WaybillStatusNew { - s.SelfDeliverDelivering(order, "自配送中") - } - if bill.Status == model.WaybillStatusNew { s.addWaybill2Map(savedOrderInfo, bill) if !isPending { From 3283b3d72cd1ad79bc8b8678c85f4027e8f4ccd7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E5=AE=97=E6=A5=A0?= Date: Fri, 28 Oct 2022 16:24:38 +0800 Subject: [PATCH 3/3] 1 --- .../partner/purchase/tiktok_store/order.go | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/business/partner/purchase/tiktok_store/order.go b/business/partner/purchase/tiktok_store/order.go index 56d6ce5be..28e78349b 100644 --- a/business/partner/purchase/tiktok_store/order.go +++ b/business/partner/purchase/tiktok_store/order.go @@ -664,9 +664,21 @@ func (c *PurchaseHandler) CancelOrder(ctx *jxcontext.Context, order *model.Goods for _, v := range order.Skus { count += v.Count } - if _, err = getAPI(order.VendorOrgCode, 0, "").ApplyMarketAfterSale(utils.Str2Int64(order.VendorOrderID), int64(count), 3); err == nil { - // 调用开放平台接口取消订单,不推送取消订单消息和退款消息。 - c.postFakeMsg(order.VendorOrderID, tiktokShop.CallbackCancelOrderMsgTagId, utils.Int2Str(tiktokShop.CreateOrderStatusCancel), order.VendorOrgCode) + api := getAPI(order.VendorOrgCode, 0, "") + // 获取订单详情 + orderDetail, err := api.GetTiktokOrderDetail(order.VendorOrderID) + if err != nil { + return err + } + + for _, v := range orderDetail.SkuOrderList { + _, err = api.ApplyMarketAfterSale(utils.Str2Int64(v.OrderId), v.ItemNum, 3) + } + + // 调用开放平台接口取消订单,不推送取消订单消息和退款消息。 + c.postFakeMsg(order.VendorOrderID, tiktokShop.CallbackCancelOrderMsgTagId, utils.Int2Str(tiktokShop.CreateOrderStatusCancel), order.VendorOrgCode) + if err != nil { + return errors.New(err.Error() + "-" + "系统退单错误请多次退单/联系管理员/前往抖店平台退单") } return err }