- 适应门店商品修复API,添加trackInfo参数
This commit is contained in:
@@ -180,17 +180,17 @@ func storeSku2Jd(actStoreSku []*model.ActStoreSku2, handler func(syncStatus int8
|
||||
}
|
||||
|
||||
func createSkuAct(ctx *jxcontext.Context, act *model.Act2, actStoreSku []*model.ActStoreSku2) (vendorActID string, err error) {
|
||||
traceID := ctx.GetAccessUUID()
|
||||
traceInfo := ctx.GetTrackInfo()
|
||||
outInfoID := ""
|
||||
if act.VendorActID == "" {
|
||||
outInfoID = utils.Int2Str(act.ID)
|
||||
}
|
||||
infoID, err2 := CreatePromotionInfos(act.Type, act.GetRealActName(), act.BeginAt, act.EndAt, outInfoID, act.Advertising, traceID)
|
||||
infoID, err2 := CreatePromotionInfos(act.Type, act.GetRealActName(), act.BeginAt, act.EndAt, outInfoID, act.Advertising, traceInfo)
|
||||
if err = err2; err == nil {
|
||||
vendorActID = utils.Int64ToStr(infoID)
|
||||
if err = CreatePromotionRules(act.Type, infoID, "", act.LimitUser, act.LimitUser, act.LimitCount, 1, traceID); err == nil {
|
||||
if _, err = CreatePromotionSku(act.Type, infoID, "", storeSku2Jd(actStoreSku, model.IsSyncStatusNeedCreate), traceID); err == nil {
|
||||
if err = ConfirmPromotion(act.Type, infoID, "", traceID); err == nil {
|
||||
if err = CreatePromotionRules(act.Type, infoID, "", act.LimitUser, act.LimitUser, act.LimitCount, 1, traceInfo); err == nil {
|
||||
if _, err = CreatePromotionSku(act.Type, infoID, "", storeSku2Jd(actStoreSku, model.IsSyncStatusNeedCreate), traceInfo); err == nil {
|
||||
if err = ConfirmPromotion(act.Type, infoID, "", traceInfo); err == nil {
|
||||
for _, v := range actStoreSku {
|
||||
v.VendorActID = vendorActID
|
||||
}
|
||||
@@ -198,7 +198,7 @@ func createSkuAct(ctx *jxcontext.Context, act *model.Act2, actStoreSku []*model.
|
||||
}
|
||||
}
|
||||
if err != nil {
|
||||
CancelPromotion(act.Type, infoID, "", traceID)
|
||||
CancelPromotion(act.Type, infoID, "", traceInfo)
|
||||
}
|
||||
}
|
||||
return vendorActID, err
|
||||
@@ -207,7 +207,7 @@ func createSkuAct(ctx *jxcontext.Context, act *model.Act2, actStoreSku []*model.
|
||||
func cancelSkuActSkus(ctx *jxcontext.Context, actType int, vendorActID string, actStoreSku []*model.ActStoreSku2) (err error) {
|
||||
if vendorActID != "" {
|
||||
if skuList := storeSku2Jd(actStoreSku, model.IsSyncStatusNeedDelete); len(skuList) > 0 {
|
||||
err = CancelPromotionSku(actType, utils.Str2Int64(vendorActID), "", skuList, ctx.GetAccessUUID())
|
||||
err = CancelPromotionSku(actType, utils.Str2Int64(vendorActID), "", skuList, ctx.GetTrackInfo())
|
||||
}
|
||||
}
|
||||
return err
|
||||
@@ -215,7 +215,7 @@ func cancelSkuActSkus(ctx *jxcontext.Context, actType int, vendorActID string, a
|
||||
|
||||
func cancelSkuAct(ctx *jxcontext.Context, actType int, vendorActID string) (err error) {
|
||||
if vendorActID != "" {
|
||||
err = CancelPromotion(actType, utils.Str2Int64(vendorActID), "", ctx.GetAccessUUID())
|
||||
err = CancelPromotion(actType, utils.Str2Int64(vendorActID), "", ctx.GetTrackInfo())
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user