- new config param:EnableEbaiStoreWrite

This commit is contained in:
gazebo
2018-11-13 10:11:41 +08:00
parent 49b9d07153
commit 84f79249c8
5 changed files with 39 additions and 20 deletions

View File

@@ -142,7 +142,7 @@ func (p *PurchaseHandler) SyncStoreSkus(ctx *jxcontext.Context, parentTask tasks
storeSku := batchItemList[0].(*tStoreSkuFullInfo)
updateFields := []string{model.FieldEbaiSyncStatus}
isCreate := false
if globals.EnableStoreWrite {
if globals.EnableStoreWrite && globals.EnableEbaiStoreWrite {
if storeSku.EbaiSyncStatus&model.SyncFlagDeletedMask != 0 {
err = api.EbaiAPI.SkuDelete(strStoreID, utils.Int64ToStr(storeSku.EbaiID))
} else if storeSku.EbaiSyncStatus&model.SyncFlagNewMask != 0 {
@@ -237,7 +237,7 @@ func (p *PurchaseHandler) DeleteRemoteSkus(storeID int, vendorSkuIDs []string) (
for k, v := range batchItemList {
strList[k] = v.(string)
}
if globals.EnableStoreWrite {
if globals.EnableStoreWrite && globals.EnableEbaiStoreWrite {
err = api.EbaiAPI.SkuDelete(utils.Int2Str(storeID), strings.Join(strList, ","))
}
return nil, err
@@ -259,7 +259,7 @@ func (p *PurchaseHandler) DeleteRemoteCategories(storeID int, vendorCatIDs []int
}
}
task := tasksch.NewParallelTask("DeleteRemoteCategories", nil, "", func(t *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (retVal interface{}, err error) {
if globals.EnableStoreWrite {
if globals.EnableStoreWrite && globals.EnableEbaiStoreWrite {
err = api.EbaiAPI.ShopCategoryDelete(strStoreID, batchItemList[0].(int64))
}
return nil, err
@@ -393,7 +393,7 @@ func (p *PurchaseHandler) SyncStoreCategory(ctx *jxcontext.Context, parentTask t
updateFields := []string{model.FieldEbaiSyncStatus}
catInfo := batchItemList[0].(*tStoreCatInfo)
// globals.SugarLogger.Debug(utils.Format4Output(catInfo, false))
if globals.EnableStoreWrite {
if globals.EnableStoreWrite && globals.EnableEbaiStoreWrite {
if catInfo.EbaiSyncStatus&model.SyncFlagDeletedMask != 0 { // 删除
err = api.EbaiAPI.ShopCategoryDelete(strStoreID, catInfo.EbaiID)
} else if catInfo.EbaiSyncStatus&model.SyncFlagNewMask != 0 { // 新增