- 活动平台实际测试通过
This commit is contained in:
@@ -153,27 +153,27 @@ func (c *PurchaseHandler) SyncAct(ctx *jxcontext.Context, parentTask tasksch.ITa
|
||||
actStoreSkuMap := partner.SplitActStoreSku(actStoreSkuList)
|
||||
for storeID := range actStoreSkuMap {
|
||||
for _, actStoreSku := range actStoreSkuMap[storeID] {
|
||||
if model.IsSyncStatusNeedCreate(actStoreSku.SyncStatus) {
|
||||
actStoreSkuList4Create = append(actStoreSkuList4Create, actStoreSku)
|
||||
} else if model.IsSyncStatusNeedDelete(actStoreSku.SyncStatus) {
|
||||
if model.IsSyncStatusDelete(actStoreSku.SyncStatus) {
|
||||
actStoreSkuList4Delete = append(actStoreSkuList4Delete, actStoreSku)
|
||||
} else if model.IsSyncStatusNew(actStoreSku.SyncStatus) {
|
||||
actStoreSkuList4Create = append(actStoreSkuList4Create, actStoreSku)
|
||||
}
|
||||
}
|
||||
}
|
||||
err = func() (err error) {
|
||||
if model.IsSyncStatusNeedCreate(act.SyncStatus) {
|
||||
createdList, err2 := createSkuAct(ctx, nil, act, actStoreSkuList4Create)
|
||||
updateItems = append(updateItems, partner.ActStoreSku2Update(createdList, model.SyncFlagNewMask)...)
|
||||
if err = err2; err == nil {
|
||||
updateItems = append(updateItems, partner.Act2Update(act, model.SyncFlagNewMask))
|
||||
}
|
||||
} else if model.IsSyncStatusNeedDelete(act.SyncStatus) {
|
||||
if model.IsSyncStatusDelete(act.SyncStatus) {
|
||||
canceledList, err2 := cancelSkuAct(ctx, nil, actStoreSkuList)
|
||||
updateItems = append(updateItems, partner.ActStoreSku2Update(canceledList, model.SyncFlagDeletedMask)...)
|
||||
if err = err2; err == nil {
|
||||
updateItems = append(updateItems, partner.Act2Update(act, model.SyncFlagDeletedMask))
|
||||
}
|
||||
} else if model.IsSyncStatusNeedUpdate(act.SyncStatus) {
|
||||
} else if model.IsSyncStatusNew(act.SyncStatus) {
|
||||
createdList, err2 := createSkuAct(ctx, nil, act, actStoreSkuList4Create)
|
||||
updateItems = append(updateItems, partner.ActStoreSku2Update(createdList, model.SyncFlagNewMask)...)
|
||||
if err = err2; err == nil {
|
||||
updateItems = append(updateItems, partner.Act2Update(act, model.SyncFlagNewMask))
|
||||
}
|
||||
} else if model.IsSyncStatusUpdate(act.SyncStatus) {
|
||||
// globals.SugarLogger.Debug(utils.Format4Output(updateItems, false))
|
||||
if len(actStoreSkuList4Create) > 0 {
|
||||
addedList, err2 := createSkuAct(ctx, nil, act, actStoreSkuList4Create)
|
||||
|
||||
Reference in New Issue
Block a user