This commit is contained in:
邹宗楠
2025-02-07 11:53:55 +08:00
parent fe7120d334
commit 8eface8714
2 changed files with 3 additions and 20 deletions

View File

@@ -171,22 +171,12 @@ 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{
@@ -194,9 +184,6 @@ 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