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