- test Convert2JDSPU
This commit is contained in:
@@ -204,7 +204,7 @@ func Convert2JDSPU(ctx *jxcontext.Context, isAsync, isContinueWhenError bool) (h
|
||||
LEFT JOIN sku_name t2 ON t1.link_id = t2.id
|
||||
WHERE t1.deleted_at = ? AND t1.status <> ? AND t1.is_spu = 0 AND t1.unit = '份'
|
||||
AND t2.id IS NULL
|
||||
LIMIT 1;
|
||||
LIMIT 10;
|
||||
`
|
||||
sqlParams := []interface{}{
|
||||
utils.DefaultTimeValue,
|
||||
@@ -246,6 +246,7 @@ func Convert2JDSPU(ctx *jxcontext.Context, isAsync, isContinueWhenError bool) (h
|
||||
}
|
||||
|
||||
if len(skuList) > 0 {
|
||||
globals.SugarLogger.Debugf("Convert2JDSPU, name:%s", skuName.Name)
|
||||
dao.Begin(db)
|
||||
skuNameNew2 := *skuName
|
||||
skuNameNew := &skuNameNew2
|
||||
@@ -288,13 +289,12 @@ func Convert2JDSPU(ctx *jxcontext.Context, isAsync, isContinueWhenError bool) (h
|
||||
FROM sku_name t1
|
||||
WHERE t1.link_id <> 0;
|
||||
`
|
||||
skuNameList = []*model.SkuName{}
|
||||
if err = dao.GetRows(db, &skuNameList, sql); err != nil {
|
||||
return "", err
|
||||
}
|
||||
globals.SugarLogger.Debug(utils.Format4Output(skuNameList, false))
|
||||
rootTask := tasksch.NewParallelTask("Convert2JDSPU", tasksch.NewParallelConfig().SetIsContinueWhenError(isContinueWhenError), ctx.GetUserName(), func(task *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (retVal interface{}, err error) {
|
||||
skuName := batchItemList[0].(*model.SkuName)
|
||||
globals.SugarLogger.Debug(utils.Format4Output(skuName, false))
|
||||
_, err = cms.CurVendorSync.SyncSku(ctx, db, skuName.ID, -1, false, ctx.GetUserName())
|
||||
return nil, err
|
||||
}, skuNameList)
|
||||
|
||||
Reference in New Issue
Block a user