- 适应门店商品修复API,添加trackInfo参数
This commit is contained in:
@@ -98,7 +98,7 @@ func (p *PurchaseHandler) syncStoreSkus(ctx *jxcontext.Context, parentTask tasks
|
||||
// todo 以下可以优化为并行操作
|
||||
// globals.SugarLogger.Debug(utils.Format4Output(skuVendibilityList, false), utils.Format4Output(skuPriceInfoList, false), utils.Format4Output(skuStockList, false))
|
||||
if len(skuVendibilityList) > 0 {
|
||||
if _, err = api.JdAPI.BatchUpdateVendibility("", stationNo, skuVendibilityList, ctx.GetUserName()); err == nil {
|
||||
if _, err = api.JdAPI.BatchUpdateVendibility(ctx.GetTrackInfo(), "", stationNo, skuVendibilityList, ctx.GetUserName()); err == nil {
|
||||
syncMask |= model.SyncFlagSaleMask
|
||||
} else {
|
||||
if !isPartialFailed {
|
||||
@@ -109,9 +109,9 @@ func (p *PurchaseHandler) syncStoreSkus(ctx *jxcontext.Context, parentTask tasks
|
||||
}
|
||||
if (err == nil || isContinueWhenError) && len(skuStockList) > 0 {
|
||||
if len(skuStockList) == 1 {
|
||||
err = api.JdAPI.UpdateCurrentQty(stationNo, utils.Str2Int64WithDefault(vendorSkuID4Qty, 0), skuStockList[0].StockQty)
|
||||
err = api.JdAPI.UpdateCurrentQty(ctx.GetTrackInfo(), stationNo, utils.Str2Int64WithDefault(vendorSkuID4Qty, 0), skuStockList[0].StockQty)
|
||||
} else {
|
||||
_, err = api.JdAPI.BatchUpdateCurrentQtys("", stationNo, skuStockList, ctx.GetUserName())
|
||||
_, err = api.JdAPI.BatchUpdateCurrentQtys(ctx.GetTrackInfo(), "", stationNo, skuStockList, ctx.GetUserName())
|
||||
}
|
||||
if err == nil {
|
||||
syncMask |= model.SyncFlagNewMask | model.SyncFlagDeletedMask
|
||||
@@ -124,9 +124,9 @@ func (p *PurchaseHandler) syncStoreSkus(ctx *jxcontext.Context, parentTask tasks
|
||||
}
|
||||
if (err == nil || isContinueWhenError) && len(skuPriceInfoList) > 0 {
|
||||
if len(skuPriceInfoList) == 1 {
|
||||
_, err = api.JdAPI.UpdateStationPrice(utils.Str2Int64WithDefault(vendorSkuID4Price, 0), stationNo, skuPriceInfoList[0].Price)
|
||||
_, err = api.JdAPI.UpdateStationPrice(ctx.GetTrackInfo(), utils.Str2Int64WithDefault(vendorSkuID4Price, 0), stationNo, skuPriceInfoList[0].Price)
|
||||
} else {
|
||||
_, err = api.JdAPI.UpdateVendorStationPrice("", stationNo, skuPriceInfoList)
|
||||
_, err = api.JdAPI.UpdateVendorStationPrice(ctx.GetTrackInfo(), "", stationNo, skuPriceInfoList)
|
||||
}
|
||||
if err == nil {
|
||||
syncMask |= model.SyncFlagPriceMask
|
||||
|
||||
Reference in New Issue
Block a user