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
2a977c78
authored
Apr 15, 2025
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Plain Diff
Merge branch 'ysx-特定专营供应商自动转换人民币-20250415' into dev
parents
e7d262a2
ab8360bc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
1 deletions
service/service_price.go
service/service_price.go
View file @
2a977c78
...
@@ -276,7 +276,6 @@ func (ps *PriceService) GenerateLadderPrice(sku model.LySku) model.LySku {
...
@@ -276,7 +276,6 @@ func (ps *PriceService) GenerateLadderPrice(sku model.LySku) model.LySku {
})
})
sku
.
LadderPrice
=
generatedLadderPrice
sku
.
LadderPrice
=
generatedLadderPrice
sku
.
PriceRatio
=
showPriceRatioList
sku
.
PriceRatio
=
showPriceRatioList
return
sku
return
sku
}
}
// 成本价阶梯数 由最高库存计算得到
// 成本价阶梯数 由最高库存计算得到
...
@@ -674,6 +673,7 @@ func (ps *PriceService) TransformSpecialSupplierPrice(sku model.LySku) model.LyS
...
@@ -674,6 +673,7 @@ func (ps *PriceService) TransformSpecialSupplierPrice(sku model.LySku) model.LyS
}
}
hasTax
:=
false
hasTax
:=
false
symbol
:=
"$"
symbol
:=
"$"
usToCn
:=
false
if
currencyConfig
!=
""
{
if
currencyConfig
!=
""
{
currency
=
int
(
gjson
.
Get
(
currencyConfig
,
"currency"
)
.
Int
())
currency
=
int
(
gjson
.
Get
(
currencyConfig
,
"currency"
)
.
Int
())
if
currency
==
0
{
if
currency
==
0
{
...
@@ -681,6 +681,7 @@ func (ps *PriceService) TransformSpecialSupplierPrice(sku model.LySku) model.LyS
...
@@ -681,6 +681,7 @@ func (ps *PriceService) TransformSpecialSupplierPrice(sku model.LySku) model.LyS
}
}
hasTax
=
gjson
.
Get
(
currencyConfig
,
"has_tax"
)
.
Bool
()
hasTax
=
gjson
.
Get
(
currencyConfig
,
"has_tax"
)
.
Bool
()
symbol
=
gjson
.
Get
(
currencyConfig
,
"symbol"
)
.
String
()
symbol
=
gjson
.
Get
(
currencyConfig
,
"symbol"
)
.
String
()
usToCn
=
gjson
.
Get
(
currencyConfig
,
"us_to_cn"
)
.
Bool
()
//自定义汇率优先级最高
//自定义汇率优先级最高
customizeRateRmb
:=
gjson
.
Get
(
currencyConfig
,
"customize_rate_rmb"
)
.
Float
()
customizeRateRmb
:=
gjson
.
Get
(
currencyConfig
,
"customize_rate_rmb"
)
.
Float
()
...
@@ -699,6 +700,19 @@ func (ps *PriceService) TransformSpecialSupplierPrice(sku model.LySku) model.LyS
...
@@ -699,6 +700,19 @@ func (ps *PriceService) TransformSpecialSupplierPrice(sku model.LySku) model.LyS
}
}
}
}
if
customizeRateRmb
==
0
{
for
index
,
price
:=
range
sku
.
LadderPrice
{
priceUs
:=
price
.
PriceUs
//sku.OriginalPrice[index].PriceCn = priceCn
//这里面还要判断,如果是usToCn为true代表也要走美金转人民币的逻辑(前提是没有人民币价格)
if
price
.
PriceCn
==
0
&&
usToCn
==
true
{
rmbRatio
,
_
:=
redis
.
Float64
(
redisCon
.
Do
(
"HGET"
,
"erp_rate"
,
currency
))
priceCn
:=
c
.
MyRound
(
c
.
MulFloat
(
priceUs
,
rmbRatio
),
4
)
sku
.
LadderPrice
[
index
]
.
PriceCn
=
priceCn
}
}
}
if
customizeRateUsd
!=
0
{
if
customizeRateUsd
!=
0
{
for
index
,
price
:=
range
sku
.
LadderPrice
{
for
index
,
price
:=
range
sku
.
LadderPrice
{
priceUs
:=
price
.
PriceUs
priceUs
:=
price
.
PriceUs
...
@@ -708,6 +722,7 @@ func (ps *PriceService) TransformSpecialSupplierPrice(sku model.LySku) model.LyS
...
@@ -708,6 +722,7 @@ func (ps *PriceService) TransformSpecialSupplierPrice(sku model.LySku) model.LyS
}
}
sku
.
LadderPrice
[
index
]
.
PriceUs
=
priceUs
sku
.
LadderPrice
[
index
]
.
PriceUs
=
priceUs
sku
.
OriginalPrice
[
index
]
.
PriceUs
=
priceUs
sku
.
OriginalPrice
[
index
]
.
PriceUs
=
priceUs
}
}
}
}
...
...
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