From 650669b31e1a98d6fd94ebb9f8807c5585f3013a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E5=AE=97=E6=A5=A0?= Date: Thu, 5 Dec 2024 11:39:22 +0800 Subject: [PATCH] 1 --- business/jxstore/cms/store_sku.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/business/jxstore/cms/store_sku.go b/business/jxstore/cms/store_sku.go index 490fc3262..0460e0b22 100644 --- a/business/jxstore/cms/store_sku.go +++ b/business/jxstore/cms/store_sku.go @@ -1903,6 +1903,7 @@ func updateStoresSkusWithoutSync(ctx *jxcontext.Context, db *dao.DaoDB, storeIDs // if len(storeIDs)*len(skuBindInfos) > maxStoreNameBind2 { // return nil, fmt.Errorf("门店商品信息大于%d", maxStoreNameBind2) // } + globals.SugarLogger.Debugf("skuBindInfos--------:= %s", utils.Format4Output(skuBindInfos, false)) storeIDs = uniqueStoreIDs(storeIDs) skuBindInfos = uniqueStoreNameBind(skuBindInfos) @@ -2028,6 +2029,7 @@ func updateStoresSkusWithoutSync(ctx *jxcontext.Context, db *dao.DaoDB, storeIDs } } unitPrice = int(math.Floor(float64(unitPrice)*scaleFactor/10+0.5)) * 10 //四舍五入 价格为100倍 角分为十位个位 除以10 + 0.5对分位向下取整(完成四舍五入的方法) + globals.SugarLogger.Debugf("allBinds--------:= %s", utils.Format4Output(allBinds, false)) for _, v := range allBinds { if v.Stock == 0 { v.Stock = model.MaxStoreSkuStockQty @@ -2075,12 +2077,14 @@ func updateStoresSkusWithoutSync(ctx *jxcontext.Context, db *dao.DaoDB, storeIDs setStoreSkuBindStatus(skuBind, model.SyncFlagNewMask) dao.WrapAddIDCULDEntity(skuBind, userName) if deletedSku := dao.GetDeletedStoreSkuBind(db, skuBind.StoreID, skuBind.SkuID); deletedSku == nil { + globals.SugarLogger.Debugf("deletedSku--------1:= %s", utils.Format4Output(deletedSku, false)) if err = dao.CreateEntity(db, skuBind); err != nil { dao.Rollback(db, txDB) return nil, err } num = 1 } else { + globals.SugarLogger.Debugf("deletedSku--------2:= %s", utils.Format4Output(deletedSku, false)) // 需要处理,在删除某个门店商品,同步失败的情况下,又把商品重新关注。 // 所以统一处理成恢复删除的记录,这样避免问题 skuBind.ID = deletedSku.ID