1
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user