- bug fix for many sync operation.
This commit is contained in:
@@ -4,7 +4,6 @@ import (
|
||||
"git.rosy.net.cn/baseapi/platformapi/ebaiapi"
|
||||
"git.rosy.net.cn/jx-callback/business/jxcallback/scheduler"
|
||||
"git.rosy.net.cn/jx-callback/business/model"
|
||||
"git.rosy.net.cn/jx-callback/globals/api"
|
||||
)
|
||||
|
||||
var (
|
||||
@@ -16,10 +15,8 @@ type PurchaseHandler struct {
|
||||
}
|
||||
|
||||
func init() {
|
||||
if api.EbaiAPI != nil {
|
||||
curPurchaseHandler = new(PurchaseHandler)
|
||||
scheduler.CurrentScheduler.RegisterPurchasePlatform(curPurchaseHandler)
|
||||
}
|
||||
curPurchaseHandler = new(PurchaseHandler)
|
||||
scheduler.CurrentScheduler.RegisterPurchasePlatform(curPurchaseHandler)
|
||||
}
|
||||
|
||||
func EbaiBusStatus2JxStatus(ebaiStatus int) int {
|
||||
|
||||
@@ -6,7 +6,6 @@ import (
|
||||
"git.rosy.net.cn/jx-callback/business/jxcallback/scheduler"
|
||||
"git.rosy.net.cn/jx-callback/business/jxutils"
|
||||
"git.rosy.net.cn/jx-callback/business/model"
|
||||
"git.rosy.net.cn/jx-callback/globals/api"
|
||||
)
|
||||
|
||||
var (
|
||||
@@ -18,10 +17,8 @@ type PurchaseHandler struct {
|
||||
}
|
||||
|
||||
func init() {
|
||||
if api.ElmAPI != nil {
|
||||
curPurchaseHandler = new(PurchaseHandler)
|
||||
scheduler.CurrentScheduler.RegisterPurchasePlatform(curPurchaseHandler)
|
||||
}
|
||||
curPurchaseHandler = new(PurchaseHandler)
|
||||
scheduler.CurrentScheduler.RegisterPurchasePlatform(curPurchaseHandler)
|
||||
}
|
||||
|
||||
func (c *PurchaseHandler) GetVendorID() int {
|
||||
|
||||
@@ -5,7 +5,6 @@ import (
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
"git.rosy.net.cn/jx-callback/business/jxcallback/scheduler"
|
||||
"git.rosy.net.cn/jx-callback/business/model"
|
||||
"git.rosy.net.cn/jx-callback/globals/api"
|
||||
)
|
||||
|
||||
var (
|
||||
@@ -17,10 +16,8 @@ type PurchaseHandler struct {
|
||||
}
|
||||
|
||||
func init() {
|
||||
if api.JdAPI != nil {
|
||||
curPurchaseHandler = new(PurchaseHandler)
|
||||
scheduler.CurrentScheduler.RegisterPurchasePlatform(curPurchaseHandler)
|
||||
}
|
||||
curPurchaseHandler = new(PurchaseHandler)
|
||||
scheduler.CurrentScheduler.RegisterPurchasePlatform(curPurchaseHandler)
|
||||
}
|
||||
|
||||
func (c *PurchaseHandler) GetVendorID() int {
|
||||
|
||||
@@ -21,7 +21,6 @@ const (
|
||||
|
||||
type tSkuInfoExt struct {
|
||||
model.SkuName
|
||||
Img string
|
||||
JdID int64 `orm:"column(jd_id)"` // 商家类别
|
||||
JdCategoryID int `orm:"column(jd_category_id)"` // 到家类别
|
||||
SkuCatID int64 `orm:"column(sku_cat_id)"` // 商家特殊类别
|
||||
|
||||
@@ -47,7 +47,7 @@ func (p *PurchaseHandler) SyncStoresSkus(db *dao.DaoDB, storeIDs []int, skuIDs [
|
||||
// globals.SugarLogger.Debug(sql, sqlParams)
|
||||
if err = dao.GetRows(db, &storeSkus, sql, sqlParams); err == nil {
|
||||
outStationNo := utils.Int2Str(storeID)
|
||||
task := tasksch.RunTask("", false, nil, 0, MaxSkuBatchSize, userName, func(batchItemList []interface{}, params ...interface{}) (interface{}, error) {
|
||||
task := tasksch.RunTask("SyncStoresSkus inner", false, nil, 0, MaxSkuBatchSize, userName, func(batchItemList []interface{}, params ...interface{}) (interface{}, error) {
|
||||
var skuPriceInfoList []*jdapi.SkuPriceInfo
|
||||
var skuVendibilityList []*jdapi.StockVendibility
|
||||
var skuStockList []*jdapi.SkuStock
|
||||
@@ -79,6 +79,7 @@ func (p *PurchaseHandler) SyncStoresSkus(db *dao.DaoDB, storeIDs []int, skuIDs [
|
||||
if storeSku.DeletedAt != utils.DefaultTimeValue {
|
||||
stock.StockQty = 0
|
||||
}
|
||||
skuStockList = append(skuStockList, stock)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user