diff --git a/business/jxstore/cms/sync_store_sku.go b/business/jxstore/cms/sync_store_sku.go index cf55571b9..561b566ef 100644 --- a/business/jxstore/cms/sync_store_sku.go +++ b/business/jxstore/cms/sync_store_sku.go @@ -540,7 +540,6 @@ func syncStoreSkuNew(ctx *jxcontext.Context, parentTask tasksch.ITask, causeFlag } skus = skus2 } - globals.SugarLogger.Debugf("============len := %d", len(skus)) formalizeStoreSkuList(skus) //京东商城的商品名规则不同 // name,空格,comment,约xxg @@ -746,6 +745,19 @@ func syncStoreSkuNew(ctx *jxcontext.Context, parentTask tasksch.ITask, causeFlag } } + + if storeID == 668545 { + globals.SugarLogger.Debugf("============len := %d", len(skus)) + globals.SugarLogger.Debugf("createList===========%s", utils.Format4Output(createList, false)) + globals.SugarLogger.Debugf("updateList===========%s", utils.Format4Output(updateList, false)) + globals.SugarLogger.Debugf("deleteList===========%s", utils.Format4Output(deleteList, false)) + globals.SugarLogger.Debugf("stockList===========%s", utils.Format4Output(stockList, false)) + globals.SugarLogger.Debugf("onlineList===========%s", utils.Format4Output(onlineList, false)) + globals.SugarLogger.Debugf("offlineList===========%s", utils.Format4Output(offlineList, false)) + globals.SugarLogger.Debugf("priceList===========%s", utils.Format4Output(priceList, false)) + globals.SugarLogger.Debugf("updateItems===========%s", utils.Format4Output(updateItems, false)) + globals.SugarLogger.Debugf("reorderSkuMap===========%s", utils.Format4Output(reorderSkuMap, false)) + } task := tasksch.NewParallelTask("syncStoreSkuNew", tasksch.NewParallelConfig().SetParallelCount(1).SetIsContinueWhenError(isContinueWhenError2), ctx, func(task *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (retVal interface{}, err error) { step := batchItemList[0].(int) @@ -821,8 +833,10 @@ func syncStoreSkuNew(ctx *jxcontext.Context, parentTask tasksch.ITask, causeFlag case 2: if len(updateList) > 0 { _, err = putils.FreeBatchStoreSkuSyncInfo("更新门店商品基础信息", func(task tasksch.ITask, batchedStoreSkuList []*dao.StoreSkuSyncInfo) (result interface{}, successCount int, err error) { - globals.SugarLogger.Debugf("===============lenupdateList %d ", len(updateList)) - globals.SugarLogger.Debugf("===============batchedStoreSkuList %d ", len(batchedStoreSkuList)) + if storeID == 668545 { + globals.SugarLogger.Debugf("===============lenupdateList %d : %s", len(updateList), vendorStoreID) + globals.SugarLogger.Debugf("===============batchedStoreSkuList %d : %s ", len(batchedStoreSkuList), vendorStoreID) + } var failedList []*partner.StoreSkuInfoWithErr failedList, err = singleStoreHandler.UpdateStoreSkus(ctx, storeID, vendorStoreID, batchedStoreSkuList) failedList, err = buildFailedListAndErr(failedList, err, nil, batchedStoreSkuList, storeID, vendorID, "更新门店商品基础信息") diff --git a/business/partner/purchase/mtwm/store.go b/business/partner/purchase/mtwm/store.go index 644d71894..0b1f09273 100644 --- a/business/partner/purchase/mtwm/store.go +++ b/business/partner/purchase/mtwm/store.go @@ -344,6 +344,14 @@ func (p *PurchaseHandler) onStoreStatusChanged(msg *mtwmapi.CallbackMsg) (respon } if err == nil { + if storeStatus == model.StoreStatusDisabled { + switch beego.BConfig.RunMode { + case "jxgy": + ddmsg.SendUserMessage(dingdingapi.MsgTyeText, model.DefaultUserIdGuoYuan, fmt.Sprintf("果园美团门店被下线了:门店id[%s],平台门店id[%s]", "暂未获取", vendorStoreID), "!") + default: + ddmsg.SendUserMessage(dingdingapi.MsgTyeText, model.DefaultUserIdCaiShi, fmt.Sprintf("菜市美团门店被下线了:门店id[%s],平台门店id[%s]", "暂未获取", vendorStoreID), "!") + } + } err = partner.CurStoreManager.OnStoreStatusChanged(vendorStoreID, model.VendorIDMTWM, storeStatus) } response = mtwmapi.Err2CallbackResponse(err, "") diff --git a/business/partner/purchase/mtwm/store_sku2.go b/business/partner/purchase/mtwm/store_sku2.go index a1324549d..bc1238cd8 100644 --- a/business/partner/purchase/mtwm/store_sku2.go +++ b/business/partner/purchase/mtwm/store_sku2.go @@ -324,7 +324,9 @@ func (p *PurchaseHandler) CreateStoreSkus(ctx *jxcontext.Context, storeID int, v // 对于多门店平台来说,storeSkuList中只有SkuID与VendorSkuID有意义 func (p *PurchaseHandler) createOrUpdateStoreSkus(ctx *jxcontext.Context, storeID int, vendorStoreID string, storeSkuList []*dao.StoreSkuSyncInfo, isCreate bool) (failedList []*partner.StoreSkuInfoWithErr, err error) { - globals.SugarLogger.Debugf("================storeSkuList %d", len(storeSkuList)) + if storeID == 668545 { + globals.SugarLogger.Debugf("================storeSkuList %d : %s", len(storeSkuList), vendorStoreID) + } var syncType string foodDataList := make([]map[string]interface{}, len(storeSkuList)) if isCreate { @@ -442,6 +444,10 @@ func (p *PurchaseHandler) createOrUpdateStoreSkus(ctx *jxcontext.Context, storeI } } + if storeID == 668545 { + globals.SugarLogger.Debugf("================lenfoodDataList %d", len(foodDataList)) + globals.SugarLogger.Debugf("================lenfoodDataList %s", utils.Format4Output(foodDataList, false)) + } if globals.EnableMtwmStoreWrite { if len(foodDataList) == 1 { foodDataList[0]["skus"] = string(utils.MustMarshal(foodDataList[0]["skus"])) @@ -449,7 +455,6 @@ func (p *PurchaseHandler) createOrUpdateStoreSkus(ctx *jxcontext.Context, storeI failedList = putils.GetErrMsg2FailedSingleList(storeSkuList, err, storeID, model.VendorChineseNames[model.VendorIDMTWM], syncType) } } else if len(foodDataList) > 0 { - globals.SugarLogger.Debugf("================lenfoodDataList %d", len(foodDataList)) failedFoodList, err2 := getAPI(getStoreVendorOrgCode(storeID), storeID, vendorStoreID).RetailBatchInitData(ctx.GetTrackInfo(), vendorStoreID, foodDataList) if err = err2; err == nil { if err = putils.GenPartialFailedErr(failedFoodList, len(failedFoodList)); err != nil {