This commit is contained in:
邹宗楠
2025-02-07 11:34:50 +08:00
parent 5e29b3471d
commit fe7120d334
2 changed files with 17 additions and 27 deletions

View File

@@ -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