From 5753bddea5ad83d85098d716952d91be16a53e34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E5=AE=97=E6=A5=A0?= Date: Thu, 17 Mar 2022 18:17:45 +0800 Subject: [PATCH] =?UTF-8?q?=E6=89=93=E6=A1=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxcallback/orderman/orderman.go | 3 ++- business/jxstore/cms/sync2.go | 12 ++++++++++++ business/partner/purchase/mtwm/callback.go | 1 + 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/business/jxcallback/orderman/orderman.go b/business/jxcallback/orderman/orderman.go index 83928bda3..a612bad2c 100644 --- a/business/jxcallback/orderman/orderman.go +++ b/business/jxcallback/orderman/orderman.go @@ -62,6 +62,7 @@ func init() { partner.InitOrderManager(FixedOrderManager) } +// 美团回调错误信息 func addOrderOrWaybillStatus(status *model.OrderStatus, db *dao.DaoDB) (isDuplicated bool, err error) { if status.OrderType == model.OrderTypeOrder { globals.SugarLogger.Debugf("addOrderStatus order:%v", status) @@ -70,7 +71,7 @@ func addOrderOrWaybillStatus(status *model.OrderStatus, db *dao.DaoDB) (isDuplic } else { globals.SugarLogger.Debugf("addOrderStatus afsOrder:%v", status) } - txDB , _ := dao.Begin(db) + txDB, _ := dao.Begin(db) defer func() { if r := recover(); r != nil || err != nil { globals.SugarLogger.Debug("rollback") diff --git a/business/jxstore/cms/sync2.go b/business/jxstore/cms/sync2.go index c0568e5c7..333e33058 100644 --- a/business/jxstore/cms/sync2.go +++ b/business/jxstore/cms/sync2.go @@ -42,6 +42,13 @@ func getMultiStoreVendorInfoList() (list []*MultiStoreVendorInfo) { func syncCategories(ctx *jxcontext.Context, db *dao.DaoDB, parentTask tasksch.ITask, catList []*dao.SkuStoreCatInfo, isAsync bool) (hint string, err error) { if len(catList) > 0 { + for _, v := range catList { + globals.SugarLogger.Debugf("可能同步数据==========%v", v.ID) + globals.SugarLogger.Debugf("可能同步数据==========%v", v.ParentCatName) + globals.SugarLogger.Debugf("可能同步数据==========%v", v.ParentVendorCatID) + globals.SugarLogger.Debugf("可能同步数据==========%v", v.StoreCatName) + globals.SugarLogger.Debugf("可能同步数据==========%v", v.StoreParentCatName) + } // todo 按vendorID orgCode合并操作 task := tasksch.NewParallelTask(fmt.Sprintf("同步分类2:%d", len(catList)), tasksch.NewParallelConfig().SetIsContinueWhenError(true), ctx, func(task *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (retVal interface{}, err error) { @@ -88,6 +95,8 @@ func syncCategories(ctx *jxcontext.Context, db *dao.DaoDB, parentTask tasksch.IT } } } + globals.SugarLogger.Debugf("可能同步数据==========%s", "未查询到同步数据") + return hint, err } @@ -680,10 +689,13 @@ func FullSyncVendorStuff(ctx *jxcontext.Context, parentTask tasksch.ITask, store step := batchItemList[0].(int) switch step { case 0: + // 有点儿像创建本地商品分类(需要第三方同步商店) _, err = amendAndPruneVendorStuff(ctx, task, storeID, vendorID, vendorOrgCode, false, isContinueWhenError, AmendPruneAll, false) case 1: + // 同步类别 _, err = SyncCategories(ctx, task, []int{vendorID}, []string{vendorOrgCode}, nil, false) case 2: + // 同步商品 _, err = SyncSkus(ctx, task, []int{vendorID}, []string{vendorOrgCode}, nil, nil, false) } return retVal, err diff --git a/business/partner/purchase/mtwm/callback.go b/business/partner/purchase/mtwm/callback.go index 6081f052b..7ad771f15 100644 --- a/business/partner/purchase/mtwm/callback.go +++ b/business/partner/purchase/mtwm/callback.go @@ -6,6 +6,7 @@ import ( "git.rosy.net.cn/jx-callback/business/model" ) +// 美团回调接口 func OnCallbackMsg(msg *mtwmapi.CallbackMsg) (response *mtwmapi.CallbackResponse) { if CurPurchaseHandler != nil { if msg.Cmd == mtwmapi.MsgTypeStoreStatusChanged || msg.Cmd == mtwmapi.MsgTypeStoreAuditStatusChanged {