Commit 0bb017b1 by 杨树贤

Merge branch 'ysx-自营库存特殊价格处理-20250903' into dev

parents f24c6b26 86ea8bda
Showing with 9 additions and 6 deletions
......@@ -2,6 +2,7 @@ package service
import (
"encoding/json"
"fmt"
"go_sku_server/model"
c "go_sku_server/pkg/common"
"go_sku_server/pkg/gredis"
......@@ -305,7 +306,7 @@ func (ls *LyService) GetCoefficientAndPrice(sku model.LySku) model.LySku {
//这里是存了一些特殊供应商价格的判断,数据库里不是所有供应商都是存的人民币/美金
sku = priceService.TransformSpecialSupplierPrice(sku)
//这里还有个特殊判断
//这里还有两个个特殊判断
//猎芯自营 L0018319 WMS同步过来的未税成本单价(人民币),需乘以关税,再填入到基石该SKU的 成本价——国内含税(¥)
// 香港自营(L0018562)WMS同步过来的未税成本单价(美金)
//需更新到 基石该SKU的 成本价——香港交货($)且也需乘美金转人民币汇率, 再乘以关税,填入到基石该SKU的 成本价——国内含税(¥)价
......@@ -314,6 +315,7 @@ func (ls *LyService) GetCoefficientAndPrice(sku model.LySku) model.LySku {
originalPrice = append(originalPrice, model.OriginPrice{
Purchases: price.Purchases,
PriceCn: c.MyRound(c.MulFloat(price.PriceCn, tax), 4),
PriceUs: price.PriceUs,
})
}
for index, price := range sku.LadderPrice {
......@@ -346,7 +348,7 @@ func (ls *LyService) GetCoefficientAndPrice(sku model.LySku) model.LySku {
ladderPrice = sku.LadderPrice
}
}
fmt.Println("原始价格", sku.OriginalPrice)
//获取折扣系数
sku = priceService.GetDiscountRatio(sku)
data = make([]model.LadderPrice, len(ladderPrice))
......@@ -373,10 +375,11 @@ func (ls *LyService) GetCoefficientAndPrice(sku model.LySku) model.LySku {
data[key].PriceCostUs = price.PriceCostUs
data[key].PriceCostCn = price.PriceCostCn
//判断原始价格有变化,那就要覆盖
if len(originalPrice) > 0 {
sku.OriginalPrice = originalPrice
}
}
//判断原始价格有变化,那就要覆盖
if len(originalPrice) > 0 {
sku.OriginalPrice = originalPrice
}
} else {
data = make([]model.LadderPrice, len(sku.LadderPrice))
......
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