From 85bc4e30b3d7cb403615ffee036f2565835d57ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E5=AE=97=E6=A5=A0?= Date: Thu, 10 Oct 2024 15:57:18 +0800 Subject: [PATCH] 1 --- business/jxstore/cms/store_sku.go | 43 ++++++++++--------------------- 1 file changed, 14 insertions(+), 29 deletions(-) diff --git a/business/jxstore/cms/store_sku.go b/business/jxstore/cms/store_sku.go index 7d265f3de..cb9c562af 100644 --- a/business/jxstore/cms/store_sku.go +++ b/business/jxstore/cms/store_sku.go @@ -1744,17 +1744,10 @@ func UpdateStoresSkus(ctx *jxcontext.Context, causeFlag int, storeIDs []int, sku } } else { flag, _ := doStoreSkuAudit(ctx, storeIDs, skuBindInfos) - if storeIDs[0] == 668470 { - globals.SugarLogger.Debugf("--------UpdateStoresSkus %s,%s", utils.Format4Output(storeIDs, false), utils.Format4Output(skuBindInfos, false)) - globals.SugarLogger.Debugf("--------flag := %s", utils.Format4Output(flag, false)) - } if !flag { var num int64 db := dao.GetDB() skuIDs, err := updateStoresSkusWithoutSync(ctx, db, storeIDs, skuBindInfos, isScale, isRefreshHigh) // 这个方法再通知京东创建商品 - if storeIDs[0] == 668470 { - globals.SugarLogger.Debugf("----------updateStoresSkusWithoutSync :%s", utils.Format4Output(skuIDs, false)) - } if err != nil { return "", err } @@ -2049,30 +2042,22 @@ func updateStoresSkusWithoutSync(ctx *jxcontext.Context, db *dao.DaoDB, storeIDs Status: model.StoreSkuBindStatusDontSale, // 缺省不可售? } skuBind.JxPrice = jxutils.CaculatePriceByPricePack(storeDetail.PricePercentagePackObj, int(storeDetail.PricePercentage), skuBind.Price) - tmpStatus := getSkuSaleStatus(inSkuBind, skuBindInfo) - if storeID == 668470 { - globals.SugarLogger.Debugf("---------------tmpStatus := %s", utils.Format4Output(tmpStatus, false)) - globals.SugarLogger.Debugf("---------------inSkuBind := %s", utils.Format4Output(inSkuBind, false)) - } - if tmpStatus != model.StoreSkuBindStatusNA { + if tmpStatus := getSkuSaleStatus(inSkuBind, skuBindInfo); tmpStatus != model.StoreSkuBindStatusNA { skuBind.Status = tmpStatus - if inSkuBind != nil { - if storeID == 668470 { - globals.SugarLogger.Debugf("---------------inSkuBind.Stock := %s", utils.Format4Output(inSkuBind.Stock, false)) - } - if inSkuBind.Stock != nil { - skuBind.Stock = *inSkuBind.Stock - } else { - skuBind.Stock = model.MaxStoreSkuStockQty - } - } else { - if tmpStatus == model.StoreSkuBindStatusNormal { - skuBind.Stock = model.MaxStoreSkuStockQty - } - } + //if inSkuBind != nil { + // if inSkuBind.Stock != nil { + // skuBind.Stock = *inSkuBind.Stock + // } else { + // skuBind.Stock = model.MaxStoreSkuStockQty + // } + //} else { + // if tmpStatus == model.StoreSkuBindStatusNormal { + // skuBind.Stock = model.MaxStoreSkuStockQty + // } + //} } - if storeID == 668470 { - globals.SugarLogger.Debugf("---------------skuBind2 := %s", utils.Format4Output(skuBind, false)) + if inSkuBind != nil && inSkuBind.Stock != nil { + skuBind.Stock = *inSkuBind.Stock } if globals.IsAddEvent { err = AddEventDetail(db, ctx, model.OperateAdd, v.RealSkuID, model.ThingTypeSku, storeID, "", utils.Int2Str(skuBind.UnitPrice))