新增未分类的分类
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
},
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -14,6 +14,10 @@ const (
|
||||
SpecUnitML = 3
|
||||
)
|
||||
|
||||
const (
|
||||
NoCatCatgoryID = 291
|
||||
)
|
||||
|
||||
const (
|
||||
SkuStatusDeleted = -1
|
||||
SkuStatusDontSale = 0
|
||||
|
||||
Reference in New Issue
Block a user