1
This commit is contained in:
@@ -171,12 +171,22 @@ func (p *PurchaseHandler) UpdateStoreSkusPrice(ctx *jxcontext.Context, vendorOrg
|
||||
}
|
||||
|
||||
func (p *PurchaseHandler) UpdateStoreSkusStock(ctx *jxcontext.Context, vendorOrgCode string, storeID int, vendorStoreID string, storeSkuList []*partner.StoreSkuInfo) (failedList []*partner.StoreSkuInfoWithErr, err error) {
|
||||
if storeID == 20002 {
|
||||
globals.SugarLogger.Debugf("----stockList1 := %s,%s,%d,%s", vendorOrgCode, vendorStoreID, storeID, utils.Format4Output(storeSkuList, false))
|
||||
}
|
||||
if len(storeSkuList) == 1 && vendorOrgCode != apimanager.FakeJdOrgCode {
|
||||
if globals.EnableJdStoreWrite {
|
||||
err = getAPI(vendorOrgCode).UpdateCurrentQty(ctx.GetTrackInfo(), vendorStoreID, utils.Str2Int64WithDefault(storeSkuList[0].VendorSkuID, 0), storeSkuList[0].Stock)
|
||||
if storeID == 20002 {
|
||||
globals.SugarLogger.Debugf("----stockList2 := %s", utils.Format4Output(storeSkuList, false))
|
||||
globals.SugarLogger.Debugf("----stockList3 err := %v", err)
|
||||
}
|
||||
failedList = putils.GetErrMsg2FailedSingleList(storeSkuList, err, storeID, model.VendorChineseNames[model.VendorIDJD], "更新商品库存")
|
||||
}
|
||||
} else {
|
||||
if storeID == 20002 {
|
||||
globals.SugarLogger.Debugf("----stockList4 := %s,%s,%d,%s", vendorOrgCode, vendorStoreID, storeID, utils.Format4Output(storeSkuList, false))
|
||||
}
|
||||
var skuStockList []*jdapi.SkuStock
|
||||
for _, v := range storeSkuList {
|
||||
skuStockList = append(skuStockList, &jdapi.SkuStock{
|
||||
@@ -184,6 +194,9 @@ func (p *PurchaseHandler) UpdateStoreSkusStock(ctx *jxcontext.Context, vendorOrg
|
||||
StockQty: v.Stock,
|
||||
})
|
||||
}
|
||||
if storeID == 20002 {
|
||||
globals.SugarLogger.Debugf("----skuStockList := %s,%s,%d,%s", vendorOrgCode, vendorStoreID, storeID, utils.Format4Output(skuStockList, false))
|
||||
}
|
||||
if globals.EnableJdStoreWrite {
|
||||
var responseList []*jdapi.StoreSkuBatchUpdateResponse
|
||||
var err2 error
|
||||
|
||||
Reference in New Issue
Block a user