取消活动时,也要将act_store_sku_map中条目相应置删除标志

This commit is contained in:
gazebo
2019-11-29 20:27:07 +08:00
parent 6d1129a61c
commit 5f2da8a4dc
5 changed files with 30 additions and 26 deletions

View File

@@ -262,9 +262,9 @@ func (c *PurchaseHandler) SyncAct(ctx *jxcontext.Context, parentTask tasksch.ITa
}
}
for _, actStoreSkuList := range vendorActInfoMap {
updateItems = append(updateItems, partner.ActStoreSku2Update(actStoreSkuList, model.SyncFlagModifiedMask)...)
updateItems = append(updateItems, partner.ActStoreSku2Update(ctx, actStoreSkuList, model.SyncFlagModifiedMask)...)
}
updateItems = append(updateItems, partner.Act2Update(act, model.SyncFlagModifiedMask))
updateItems = append(updateItems, partner.Act2Update(ctx, act, model.SyncFlagModifiedMask))
} else if model.IsSyncStatusNew(act.SyncStatus) {
if act.VendorActID, err = createSkuAct(ctx, act, actStoreSkuList4Create); err != nil {
if act.VendorActID != "" {
@@ -273,15 +273,15 @@ func (c *PurchaseHandler) SyncAct(ctx *jxcontext.Context, parentTask tasksch.ITa
}
return err
}
updateItems = append(updateItems, partner.ActStoreSku2Update(actStoreSkuList4Create, model.SyncFlagNewMask)...)
updateItems = append(updateItems, partner.Act2Update(act, model.SyncFlagNewMask))
updateItems = append(updateItems, partner.ActStoreSku2Update(ctx, actStoreSkuList4Create, model.SyncFlagNewMask)...)
updateItems = append(updateItems, partner.Act2Update(ctx, act, model.SyncFlagNewMask))
} else if model.IsSyncStatusUpdate(act.SyncStatus) {
// globals.SugarLogger.Debug(utils.Format4Output(updateItems, false))
if len(actStoreSkuList4Create) > 0 {
if _, err = createSkuAct(ctx, act, actStoreSkuList4Create); err != nil {
return err
}
updateItems = append(updateItems, partner.ActStoreSku2Update(actStoreSkuList4Create, model.SyncFlagNewMask)...)
updateItems = append(updateItems, partner.ActStoreSku2Update(ctx, actStoreSkuList4Create, model.SyncFlagNewMask)...)
}
for vendorActID := range deleteActInfoMap {
if vendorActID != "" {
@@ -295,10 +295,10 @@ func (c *PurchaseHandler) SyncAct(ctx *jxcontext.Context, parentTask tasksch.ITa
return err
}
}
updateItems = append(updateItems, partner.ActStoreSku2Update(deleteActInfoMap[vendorActID], model.SyncFlagDeletedMask)...)
updateItems = append(updateItems, partner.ActStoreSku2Update(ctx, deleteActInfoMap[vendorActID], model.SyncFlagDeletedMask)...)
}
if err == nil {
updateItems = append(updateItems, partner.Act2Update(act, model.SyncFlagModifiedMask))
updateItems = append(updateItems, partner.Act2Update(ctx, act, model.SyncFlagModifiedMask))
}
}
return err