- ebai.SyncAct
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user