Merge remote-tracking branch 'origin/mark' into su

This commit is contained in:
苏尹岚
2019-11-21 11:49:01 +08:00
16 changed files with 300 additions and 51 deletions

View File

@@ -242,6 +242,7 @@ func (c *PurchaseHandler) SyncAct(ctx *jxcontext.Context, parentTask tasksch.ITa
}
}
}
db := dao.GetDB()
err = func() (err error) {
if model.IsSyncStatusDelete(act.SyncStatus) {
for vendorActID := range vendorActInfoMap {
@@ -257,6 +258,10 @@ func (c *PurchaseHandler) SyncAct(ctx *jxcontext.Context, parentTask tasksch.ITa
updateItems = append(updateItems, partner.Act2Update(act, model.SyncFlagModifiedMask))
} else if model.IsSyncStatusNew(act.SyncStatus) {
if act.VendorActID, err = createSkuAct(ctx, act, actStoreSkuList4Create); err != nil {
if act.VendorActID != "" {
actMap := partner.Act2ActMap(act)
dao.UpdateEntity(db, actMap, "VendorActID")
}
return err
}
updateItems = append(updateItems, partner.ActStoreSku2Update(actStoreSkuList4Create, model.SyncFlagNewMask)...)
@@ -289,7 +294,6 @@ func (c *PurchaseHandler) SyncAct(ctx *jxcontext.Context, parentTask tasksch.ITa
}
return err
}()
db := dao.GetDB()
// globals.SugarLogger.Debug(utils.Format4Output(updateItems, false))
_, err2 := dao.BatchUpdateEntityByKV(db, updateItems)
if err == nil {