Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
黄成意
/
go_sku_server
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
ad7f120b
authored
Mar 11, 2025
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
修复价格
parent
6209d9c3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
service/service_price.go
service/service_price.go
View file @
ad7f120b
...
...
@@ -38,7 +38,7 @@ func (ps *PriceService) GenerateLadderPrice(sku model.LySku) model.LySku {
//而华云(或者以后的新组织),存的哈希对应的key是 供应商编码_组织ID (L00232_3)
ruleKey
:=
sku
.
Canal
if
sku
.
OrgId
!=
1
{
ruleKey
=
sku
.
Canal
+
"_"
+
gconv
.
String
(
sku
.
OrgId
)
ruleKey
=
sku
.
Canal
+
"_"
+
gconv
.
String
(
sku
.
OrgId
)
}
priceRatioCache
,
_
:=
redis
.
String
(
redisCon
.
Do
(
"HGET"
,
"magic_cube_price_rule_v2"
,
ruleKey
))
//判断是否是空
...
...
@@ -305,7 +305,6 @@ func (ps *PriceService) GenerateLadderPrice(sku model.LySku) model.LySku {
//如:库存满足1、2、3层阶梯,最小利润点层级是第5个层级,则利润点取3、4、5层级的
//最小利润点层级 - 库存满足多少个阶梯 + i
costMapIndex
:=
ladderPriceMiniProfitLevel
-
costLadderCount
+
i
//fmt.Println(costMapIndex)
if
costMapIndex
<=
0
{
costMapIndex
=
0
}
...
...
@@ -426,9 +425,9 @@ func (ps *PriceService) GetDiscountRatio(sku model.LySku) model.LySku {
discountRatioRedisKey
=
"magic_cube_channel_discount_zhuanying"
discountRatioDefaultRedisKey
=
"magic_cube_channel_discount_default_zhuanying"
//这里还要判断是否是华云,如果是华云的话,key的格式应该是 L0012323_3
if
sku
.
OrgId
==
1
{
if
sku
.
OrgId
==
1
{
supplierKey
=
sku
.
Canal
}
else
{
}
else
{
supplierKey
=
sku
.
Canal
+
"-_"
+
gconv
.
String
(
sku
.
OrgId
)
}
}
...
...
@@ -657,6 +656,9 @@ func (ps PriceService) GetPriceRatio(sku model.LySku) (model.LySku, []model.Pric
// 这里有个前置条件处理美金价,因为element(6)存到美金字段里面的是港币,rs(21)存到美金字段里的是人民币,buerklin(1676)是欧元
// 所以要全部先转成正确的美金价才能显示
func
(
ps
*
PriceService
)
TransformSpecialSupplierPrice
(
sku
model
.
LySku
)
model
.
LySku
{
if
sku
.
OrgId
!=
1
{
return
sku
}
//去redis获取价格
redisCon
:=
gredis
.
Conn
(
"default_r"
)
defer
func
()
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment