diff --git a/business/jxstore/cms/sku.go b/business/jxstore/cms/sku.go index 465a27c61..6bea6d64b 100644 --- a/business/jxstore/cms/sku.go +++ b/business/jxstore/cms/sku.go @@ -7,8 +7,10 @@ import ( "strings" "time" + "git.rosy.net.cn/baseapi/platformapi/dingdingapi" "git.rosy.net.cn/baseapi/platformapi/ebaiapi" + "git.rosy.net.cn/jx-callback/business/jxutils/ddmsg" "git.rosy.net.cn/jx-callback/business/jxutils/tasksch" "git.rosy.net.cn/baseapi/platformapi/jdapi" @@ -39,6 +41,13 @@ var ( ebaiUploadRTFShopID string // 饿百找一个店用于调用SkuUploadRTF ) +var ( + sendNoCatSkusMobile = []string{ + "18048531223", + "18982250714", + } +) + // func getAndSetEbaiUploadRTFShopID() (shopID string) { // if ebaiUploadRTFShopID == "" { // if storeDetail, err := dao.GetStoreDetail(dao.GetDB(), 0, model.VendorIDEBAI); err == nil { @@ -1674,3 +1683,30 @@ func UpdateExianDaSkuCategory(ctx *jxcontext.Context, isAsync, isContinueWhenErr } return hint, err } + +func SendNoCatSkusToOperater(ctx *jxcontext.Context) (err error) { + var ( + db = dao.GetDB() + skuNames []*model.SkuName + ) + sql := ` + SELECT * FROM sku_name WHERE deleted_at = ? AND category_id = ? + ` + sqlParams := []interface{}{utils.DefaultTimeValue, model.NoCatCatgoryID} + err = dao.GetRows(db, &skuNames, sql, sqlParams) + if err != nil { + return err + } + if len(skuNames) > 10 { + noticeMsg := "有超过10个标品未进行分类!" + for _, v := range skuNames { + noticeMsg += "NameID:" + utils.Int2Str(v.ID) + ",商品名:" + v.Name + "," + } + for _, mobile := range sendNoCatSkusMobile { + if user, err := dao.GetUserByID(db, "mobile", mobile); err != nil { + ddmsg.SendUserMessage(dingdingapi.MsgTyeText, user.UserID, "标品未分类", noticeMsg) + } + } + } + return err +} diff --git a/business/jxstore/cms/store_sku.go b/business/jxstore/cms/store_sku.go index 0f615d6c1..94ff4d22c 100644 --- a/business/jxstore/cms/store_sku.go +++ b/business/jxstore/cms/store_sku.go @@ -4135,7 +4135,7 @@ func CreateSkusAndFocusFromYb(ctx *jxcontext.Context, isAsync, isContinueWhenErr Name: productInfo.Name, Upc: &productInfo.UpcCode, Status: model.SkuStatusNormal, - CategoryID: 291, + CategoryID: model.NoCatCatgoryID, IsGlobal: model.YES, Unit: productInfo.Unit, }, @@ -4253,7 +4253,7 @@ func CreateSkusAndFocusFromWx(ctx *jxcontext.Context, productInfo *jdapi.Product Name: productInfo.Name, Upc: &productInfo.UpcCode, Status: model.SkuStatusNormal, - CategoryID: 291, + CategoryID: model.NoCatCatgoryID, IsGlobal: model.YES, Unit: productInfo.Unit, }, diff --git a/business/jxstore/misc/misc.go b/business/jxstore/misc/misc.go index 076ede790..7fd366742 100644 --- a/business/jxstore/misc/misc.go +++ b/business/jxstore/misc/misc.go @@ -206,6 +206,9 @@ func Init() { ScheduleTimerFunc("BackUpStoreSkuBind", func() { cms.BackUpStoreSkuBind(jxcontext.AdminCtx, true, true) }, backUpStoreSkuBindList) + ScheduleTimerFunc("SendNoCatSkusToOperater", func() { + cms.SendNoCatSkusToOperater(jxcontext.AdminCtx) + }, autoPayForPopluarManList) } ScheduleTimerFunc("AutoSaleStoreSku", func() { cms.AutoSaleStoreSku(jxcontext.AdminCtx, nil, false) diff --git a/business/model/sku.go b/business/model/sku.go index 93256e65a..87741def0 100644 --- a/business/model/sku.go +++ b/business/model/sku.go @@ -14,6 +14,10 @@ const ( SpecUnitML = 3 ) +const ( + NoCatCatgoryID = 291 +) + const ( SkuStatusDeleted = -1 SkuStatusDontSale = 0