Commit 1fb099af by 杨树贤

继续优化

parent 99d38893
Showing with 2 additions and 7 deletions
......@@ -191,6 +191,7 @@ func (ps *PriceService) GenerateLadderPrice(sku model.LySku) model.LySku {
//判断是否走成本价判断还是走阶梯价判断,因为上传sku的时候,可以设置每个sku的成本价(人民币&&美金),也可以设置每个sku的阶梯价
//如果有阶梯价,就要跳过设置的成本价(假设有设置的话)
if isCostPrice {
fmt.Println("是成本价")
costPriceCn := sku.LadderPrice[0].PriceCn
costPriceUs := sku.LadderPrice[0].PriceUs
//fmt.Println("人民币和美金的成本价分别为 : ", costPriceCn, costPriceUs)
......@@ -269,7 +270,6 @@ func (ps *PriceService) GenerateLadderPrice(sku model.LySku) model.LySku {
return sku
}
fmt.Println("是成本价")
// 成本价阶梯数 由最高库存计算得到
costLadderCount := 0
for i := 0; i < len(priceRatioList); i++ {
......@@ -359,7 +359,7 @@ func (ps *PriceService) GenerateLadderPrice(sku model.LySku) model.LySku {
}
//fmt.Println(costMapIndex)
priceRatio := priceRatioList[costMapIndex]
//fmt.Println("获取到的阶梯系数为 : ", priceRatio)
fmt.Println("获取到的阶梯系数为 : ", priceRatio)
priceCnRatio := priceRatio.Ratio
priceUsRatio := priceRatio.RatioUsd
// 阶梯价格系数正序取
......@@ -648,11 +648,6 @@ func (ps *PriceService) TransformSpecialSupplierPrice(sku model.LySku, priceUs f
}()
usRatio, _ := redis.Float64(redisCon.Do("HGET", "erp_rate", 2))
var currency int
//这个供应商把人民币存到美金这个字段了,所以要提前判断和返回
if sku.SupplierId == 6 {
priceUs = c.MyRound(c.DivFloat(priceUs, usRatio), 4)
return priceUs
}
if sku.SupplierId != 17 {
currency, _ = redis.Int(redisCon.Do("HGET", "magic_cube_supplier_currency", sku.SupplierId))
} else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment