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

@@ -327,7 +327,9 @@ func storeSkuSyncInfo2Bare(inSku *dao.StoreSkuSyncInfo) (outSku *partner.StoreSk
SpecQuality: inSku.SpecQuality,
}
if !isStoreSkuSyncNeedDelete(inSku) {
outSku.Stock = model.MaxStoreSkuStockQty
if inSku.Stock == 0 {
outSku.Stock = model.MaxStoreSkuStockQty
}
}
if inSku.VendorMainId != "" {
outSku.VendorMainId = inSku.VendorMainId
@@ -634,9 +636,6 @@ func syncStoreSkuNew(ctx *jxcontext.Context, parentTask tasksch.ITask, causeFlag
parentTask.AddFailedList(failedList)
}
} else {
if storeID == 20002 {
globals.SugarLogger.Debugf("----skus7 := %s", utils.Format4Output(skus, false))
}
isAdded2Update := false
// 修改商品信息时不改价(以免活动引起的失败),而用单独的改价来改
if (model.IsSyncStatusUpdate(sku.SkuSyncStatus) || (model.IsSyncStatusSeq(sku.SkuSyncStatus) && reorderHandler == nil)) && singleStoreHandler != nil {
@@ -867,9 +866,6 @@ func syncStoreSkuNew(ctx *jxcontext.Context, parentTask tasksch.ITask, causeFlag
}, ctx, task, updateList, singleStoreHandler.GetStoreSkusBatchSize(partner.FuncUpdateStoreSkus), isContinueWhenError2)
}
case 3:
if storeID == 20002 {
globals.SugarLogger.Debugf("----stockList := %s", utils.Format4Output(stockList, false))
}
// for k, list := range [][]*partner.StoreSkuInfo{stockList /*, onlineList*/} {
if len(stockList) > 0 {
_, err = putils.FreeBatchStoreSkuInfo("更新门店商品库存", func(task tasksch.ITask, batchedStoreSkuList []*partner.StoreSkuInfo) (result interface{}, successCount int, err error) {

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