新增未分类的分类
This commit is contained in:
@@ -7,8 +7,10 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"git.rosy.net.cn/baseapi/platformapi/dingdingapi"
|
||||||
"git.rosy.net.cn/baseapi/platformapi/ebaiapi"
|
"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/jx-callback/business/jxutils/tasksch"
|
||||||
|
|
||||||
"git.rosy.net.cn/baseapi/platformapi/jdapi"
|
"git.rosy.net.cn/baseapi/platformapi/jdapi"
|
||||||
@@ -39,6 +41,13 @@ var (
|
|||||||
ebaiUploadRTFShopID string // 饿百找一个店用于调用SkuUploadRTF
|
ebaiUploadRTFShopID string // 饿百找一个店用于调用SkuUploadRTF
|
||||||
)
|
)
|
||||||
|
|
||||||
|
var (
|
||||||
|
sendNoCatSkusMobile = []string{
|
||||||
|
"18048531223",
|
||||||
|
"18982250714",
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
// func getAndSetEbaiUploadRTFShopID() (shopID string) {
|
// func getAndSetEbaiUploadRTFShopID() (shopID string) {
|
||||||
// if ebaiUploadRTFShopID == "" {
|
// if ebaiUploadRTFShopID == "" {
|
||||||
// if storeDetail, err := dao.GetStoreDetail(dao.GetDB(), 0, model.VendorIDEBAI); err == nil {
|
// 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
|
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,
|
Name: productInfo.Name,
|
||||||
Upc: &productInfo.UpcCode,
|
Upc: &productInfo.UpcCode,
|
||||||
Status: model.SkuStatusNormal,
|
Status: model.SkuStatusNormal,
|
||||||
CategoryID: 291,
|
CategoryID: model.NoCatCatgoryID,
|
||||||
IsGlobal: model.YES,
|
IsGlobal: model.YES,
|
||||||
Unit: productInfo.Unit,
|
Unit: productInfo.Unit,
|
||||||
},
|
},
|
||||||
@@ -4253,7 +4253,7 @@ func CreateSkusAndFocusFromWx(ctx *jxcontext.Context, productInfo *jdapi.Product
|
|||||||
Name: productInfo.Name,
|
Name: productInfo.Name,
|
||||||
Upc: &productInfo.UpcCode,
|
Upc: &productInfo.UpcCode,
|
||||||
Status: model.SkuStatusNormal,
|
Status: model.SkuStatusNormal,
|
||||||
CategoryID: 291,
|
CategoryID: model.NoCatCatgoryID,
|
||||||
IsGlobal: model.YES,
|
IsGlobal: model.YES,
|
||||||
Unit: productInfo.Unit,
|
Unit: productInfo.Unit,
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -206,6 +206,9 @@ func Init() {
|
|||||||
ScheduleTimerFunc("BackUpStoreSkuBind", func() {
|
ScheduleTimerFunc("BackUpStoreSkuBind", func() {
|
||||||
cms.BackUpStoreSkuBind(jxcontext.AdminCtx, true, true)
|
cms.BackUpStoreSkuBind(jxcontext.AdminCtx, true, true)
|
||||||
}, backUpStoreSkuBindList)
|
}, backUpStoreSkuBindList)
|
||||||
|
ScheduleTimerFunc("SendNoCatSkusToOperater", func() {
|
||||||
|
cms.SendNoCatSkusToOperater(jxcontext.AdminCtx)
|
||||||
|
}, autoPayForPopluarManList)
|
||||||
}
|
}
|
||||||
ScheduleTimerFunc("AutoSaleStoreSku", func() {
|
ScheduleTimerFunc("AutoSaleStoreSku", func() {
|
||||||
cms.AutoSaleStoreSku(jxcontext.AdminCtx, nil, false)
|
cms.AutoSaleStoreSku(jxcontext.AdminCtx, nil, false)
|
||||||
|
|||||||
@@ -14,6 +14,10 @@ const (
|
|||||||
SpecUnitML = 3
|
SpecUnitML = 3
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
NoCatCatgoryID = 291
|
||||||
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
SkuStatusDeleted = -1
|
SkuStatusDeleted = -1
|
||||||
SkuStatusDontSale = 0
|
SkuStatusDontSale = 0
|
||||||
|
|||||||
Reference in New Issue
Block a user