商品前缀打标记修改

This commit is contained in:
苏尹岚
2020-07-07 08:36:42 +08:00
parent c9bc47d142
commit c54a5689cd

View File

@@ -1253,6 +1253,11 @@ func SyncSkuExperfixAndWatermark(ctx *jxcontext.Context) (err error) {
task := tasksch.NewParallelTask("SyncSkuExperfixAndWatermark", tasksch.NewParallelConfig().SetIsContinueWhenError(true), ctx,
func(task *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (retVal interface{}, err error) {
skuExinfo := batchItemList[0].(*model.SkuExinfoMap)
if time.Now().Sub(skuExinfo.EndAt) > 0 {
skuExinfo.DeletedAt = time.Now()
dao.UpdateEntity(db, skuExinfo, "DeletedAt")
return retVal, err
}
skus, err := dao.GetSkus(db, nil, []int{skuExinfo.NameID}, nil, nil, nil)
var skuIDs []int
for _, v := range skus {
@@ -1262,12 +1267,10 @@ func SyncSkuExperfixAndWatermark(ctx *jxcontext.Context) (err error) {
for _, v := range skuIDs {
OnUpdateThing(ctx, db, nil, int64(v), model.ThingTypeSku)
}
// CurVendorSync.SyncSkus(ctx, db, nil, skuIDs, true, true, ctx.GetUserName())
} else {
if len(skuIDs) > 0 {
SetStoreSkuSyncStatus2(db, nil, []int{skuExinfo.VendorID}, skuIDs, model.SyncFlagModifiedMask)
}
// CurVendorSync.SyncStoresSkus2(ctx, nil, 0, db, []int{skuExinfo.VendorID}, nil, false, skuIDs, nil, model.SyncFlagModifiedMask, true, true)
}
return retVal, err
}, skuExinfos)