a
This commit is contained in:
@@ -365,19 +365,19 @@ func bindSkuAllStore(v *dao.StoreSkuSyncInfo) (err error) {
|
|||||||
task := tasksch.NewParallelTask("京东商城门店建商品", tasksch.NewParallelConfig().SetParallelCount(1).SetIsContinueWhenError(true), jxcontext.AdminCtx,
|
task := tasksch.NewParallelTask("京东商城门店建商品", tasksch.NewParallelConfig().SetParallelCount(1).SetIsContinueWhenError(true), jxcontext.AdminCtx,
|
||||||
func(task *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (retVal interface{}, err error) {
|
func(task *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (retVal interface{}, err error) {
|
||||||
storeMap := batchItemList[0].(*model.StoreMap)
|
storeMap := batchItemList[0].(*model.StoreMap)
|
||||||
if err = api.JdShop2API.StoreSkuBindStore(false, []string{utils.Int64ToStr(v.JdsID)}, []string{storeMap.VendorStoreID}); err == nil {
|
if err = api.JdShop2API.StoreSkuBindStore(false, []string{v.VendorSkuID}, []string{storeMap.VendorStoreID}); err == nil {
|
||||||
storeSkus2, _ := dao.GetStoresSkusInfo(db, []int{storeMap.StoreID}, []int{v.SkuID})
|
storeSkus2, _ := dao.GetStoresSkusInfo(db, []int{storeMap.StoreID}, []int{v.SkuID})
|
||||||
if len(storeSkus2) > 0 {
|
if len(storeSkus2) > 0 {
|
||||||
status := storeSkus2[0].Status
|
status := storeSkus2[0].Status
|
||||||
stock := storeSkus2[0].Stock
|
stock := storeSkus2[0].Stock
|
||||||
price := storeSkus2[0].Price
|
price := storeSkus2[0].Price
|
||||||
if status == model.StoreSkuBindStatusNormal {
|
if status == model.StoreSkuBindStatusNormal {
|
||||||
api.JdShop2API.StoreWareDoUpdate(status, v.JdsID, storeMap.VendorStoreID)
|
api.JdShop2API.StoreWareDoUpdate(status, utils.Str2Int64(v.VendorSkuID), storeMap.VendorStoreID)
|
||||||
}
|
}
|
||||||
if stock != 0 {
|
if stock != 0 {
|
||||||
api.JdShop2API.StoreUpdateStock(stock, v.JdsID, storeMap.VendorStoreID)
|
api.JdShop2API.StoreUpdateStock(stock, utils.Str2Int64(v.VendorSkuID), storeMap.VendorStoreID)
|
||||||
}
|
}
|
||||||
api.JdShop2API.StoreUpdatePrice(utils.Float64ToStr(jxutils.IntPrice2Standard(int64(price))), v.JdsID, storeMap.VendorStoreID)
|
api.JdShop2API.StoreUpdatePrice(utils.Float64ToStr(jxutils.IntPrice2Standard(int64(price))), utils.Str2Int64(v.VendorSkuID), storeMap.VendorStoreID)
|
||||||
} else {
|
} else {
|
||||||
return retVal, err
|
return retVal, err
|
||||||
}
|
}
|
||||||
@@ -386,6 +386,7 @@ func bindSkuAllStore(v *dao.StoreSkuSyncInfo) (err error) {
|
|||||||
}, storeMaps)
|
}, storeMaps)
|
||||||
tasksch.HandleTask(task, nil, true).Run()
|
tasksch.HandleTask(task, nil, true).Run()
|
||||||
_, err = task.GetResult(0)
|
_, err = task.GetResult(0)
|
||||||
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
func updateStoreSku(db *dao.DaoDB, vendorID int, storeSkuList []*dao.StoreSkuSyncInfo, syncStatus int8) (num int64, err error) {
|
func updateStoreSku(db *dao.DaoDB, vendorID int, storeSkuList []*dao.StoreSkuSyncInfo, syncStatus int8) (num int64, err error) {
|
||||||
|
|||||||
Reference in New Issue
Block a user