- fix return bug in CreateJdPromotion
This commit is contained in:
@@ -285,13 +285,9 @@ func CreateJdPromotion(ctx *jxcontext.Context, isIDJd bool, isAsync bool, params
|
||||
return nil, nil
|
||||
}, jxStoreIDs)
|
||||
task.AddChild(task1).Run()
|
||||
if _, err = task1.GetResult(0); err != nil {
|
||||
return "", err
|
||||
}
|
||||
_, err = task1.GetResult(0)
|
||||
} else if step == 1 {
|
||||
if err = promotionHandler.CreatePromotionRules(infoId, "", 1, 1, 1, 1); err != nil {
|
||||
return "", err
|
||||
}
|
||||
err = promotionHandler.CreatePromotionRules(infoId, "", 1, 1, 1, 1)
|
||||
} else if step == 2 {
|
||||
task2 := tasksch.NewParallelTask("CreateJdPromotion CreatePromotionSku", tasksch.NewParallelConfig().SetBatchSize(jdapi.MaxPromotionSkuCount), userName, func(task *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (retVal interface{}, err error) {
|
||||
skus := make([]map[string]interface{}, len(batchItemList))
|
||||
@@ -302,9 +298,7 @@ func CreateJdPromotion(ctx *jxcontext.Context, isIDJd bool, isAsync bool, params
|
||||
return nil, err
|
||||
}, promotionPrices)
|
||||
task.AddChild(task2).Run()
|
||||
if _, err = task2.GetResult(0); err != nil {
|
||||
return "", err
|
||||
}
|
||||
_, err = task2.GetResult(0)
|
||||
} else if step == 3 {
|
||||
err = promotionHandler.ConfirmPromotion(infoId, "")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user