- ebai.SyncAct

This commit is contained in:
gazebo
2019-07-02 13:36:16 +08:00
parent 4c6ebce30d
commit 9df7461b5b
4 changed files with 244 additions and 94 deletions

View File

@@ -205,6 +205,12 @@ func (c *PurchaseHandler) SyncAct(ctx *jxcontext.Context, parentTask tasksch.ITa
updateItems = append(updateItems, partner.Act2Update(act, model.SyncFlagDeletedMask))
} else if model.IsSyncStatusNeedUpdate(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)...)
}
for vendorActID := range deleteActInfoMap {
if vendorActID != "" {
if len(vendorActInfoMap[vendorActID]) == len(deleteActInfoMap[vendorActID]) {
@@ -218,12 +224,6 @@ func (c *PurchaseHandler) SyncAct(ctx *jxcontext.Context, parentTask tasksch.ITa
}
updateItems = append(updateItems, partner.ActStoreSku2Update(deleteActInfoMap[vendorActID], model.SyncFlagDeletedMask)...)
}
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.Act2Update(act, model.SyncFlagModifiedMask))
}
return nil