From af545c9cd3047875e1a701da7e64b3d0cdad93fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E5=B0=B9=E5=B2=9A?= <770236076@qq.com> Date: Sun, 28 Jun 2020 08:57:33 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=8C=E6=AD=A5=E5=95=86=E5=93=81=E6=B0=B4?= =?UTF-8?q?=E5=8D=B0=E6=94=B9=E4=B8=BA=E5=8F=AA=E6=89=93=E6=A0=87=E6=9C=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxstore/cms/sync.go | 21 +++++++++++++-------- business/jxstore/misc/misc.go | 5 +++-- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/business/jxstore/cms/sync.go b/business/jxstore/cms/sync.go index 667f1d49d..d3069e6d9 100644 --- a/business/jxstore/cms/sync.go +++ b/business/jxstore/cms/sync.go @@ -713,12 +713,14 @@ func buildSetFinishHook(task tasksch.ITask, ctx *jxcontext.Context) { globals.SugarLogger.Debugf("同步错误发送钉钉消息失败, authinfo [%v] , [%v]", *authInfo, err) } } else { - if time.Now().Hour() >= 20 || time.Now().Hour() < 7 { - downloadURL, _, _ := WirteToExcelBySyncFailed(task) - user, err := dao.GetUserByID(dao.GetDB(), "mobile", "18160030913") - noticeMsg += fmt.Sprintf("[详情点我]%s/billshow/?normal=true&path=%s \n", globals.BackstageHost, downloadURL) - if user != nil && err == nil { - ddmsg.SendUserMessage(dingdingapi.MsgTyeText, user.UserID, "同步错误返回", noticeMsg) + if len(task.GetFailedList()) > 1 { + if time.Now().Hour() >= 20 || time.Now().Hour() < 7 { + downloadURL, _, _ := WirteToExcelBySyncFailed(task) + user, err := dao.GetUserByID(dao.GetDB(), "mobile", "18160030913") + noticeMsg += fmt.Sprintf("[详情点我]%s/billshow/?normal=true&path=%s \n", globals.BackstageHost, downloadURL) + if user != nil && err == nil { + ddmsg.SendUserMessage(dingdingapi.MsgTyeText, user.UserID, "同步错误返回", noticeMsg) + } } } } @@ -1235,9 +1237,12 @@ func SyncSkuExperfixAndWatermark(ctx *jxcontext.Context) (err error) { for _, v := range skuIDs { OnUpdateThing(ctx, db, nil, int64(v), model.ThingTypeSku) } - CurVendorSync.SyncSkus(ctx, db, nil, skuIDs, true, true, ctx.GetUserName()) + // CurVendorSync.SyncSkus(ctx, db, nil, skuIDs, true, true, ctx.GetUserName()) } else { - CurVendorSync.SyncStoresSkus2(ctx, nil, 0, db, []int{skuExinfo.VendorID}, nil, false, skuIDs, nil, model.SyncFlagModifiedMask, true, true) + if len(skuIDs) > 0 { + SetStoreSkuSyncStatus2(db, nil, []int{skuExinfo.VendorID}, skuIDs, model.SyncFlagModifiedMask) + } + // CurVendorSync.SyncStoresSkus2(ctx, nil, 0, db, []int{skuExinfo.VendorID}, nil, false, skuIDs, nil, model.SyncFlagModifiedMask, true, true) } return retVal, err }, skuExinfos) diff --git a/business/jxstore/misc/misc.go b/business/jxstore/misc/misc.go index 5890b2b1f..2f84dd366 100644 --- a/business/jxstore/misc/misc.go +++ b/business/jxstore/misc/misc.go @@ -390,6 +390,9 @@ func doDailyWork2() { func doDailyWork() { globals.SugarLogger.Debug("doDailyWork") + //同步商品额外前缀和水印图(打标记) + cms.SyncSkuExperfixAndWatermark(jxcontext.AdminCtx) + dao.SetStoresMapSyncStatus(dao.GetDB(), nil, nil, model.SyncFlagStoreStatus) cms.CurVendorSync.SyncStore2(jxcontext.AdminCtx, dao.GetDB(), nil, nil, true, true) @@ -419,8 +422,6 @@ func doDailyWork() { orderman.RefreshJdShopOrdersEarningPrice(jxcontext.AdminCtx, time.Now().AddDate(0, 0, -3).Format("20060102"), time.Now().Format("20060102")) //同步上架京东商城待售商品 cms.RefreshJdsSkusStatus(jxcontext.AdminCtx) - //同步商品额外前缀和水印图 - cms.SyncSkuExperfixAndWatermark(jxcontext.AdminCtx) } func RefreshRealMobile(ctx *jxcontext.Context, vendorID int, fromTime, toTime time.Time, isAsync, isContinueWhenError bool) (hint string, err error) {