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
55e7752d
authored
Aug 18, 2023
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
temp
parent
2e147269
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
1 deletions
service/service_ly_common.go
service/service_price.go
service/service_ly_common.go
View file @
55e7752d
...
@@ -393,6 +393,7 @@ func (ls *LyService) GetCoefficientAndPrice(sku model.LySku) model.LySku {
...
@@ -393,6 +393,7 @@ func (ls *LyService) GetCoefficientAndPrice(sku model.LySku) model.LySku {
//价格计算文档 https://docs.qq.com/doc/DR3RJcnNPeUNkWHRk
//价格计算文档 https://docs.qq.com/doc/DR3RJcnNPeUNkWHRk
// 为何是固定的1.13,关税基本不会变,有变的话跟产品沟通手动修改即可
// 为何是固定的1.13,关税基本不会变,有变的话跟产品沟通手动修改即可
tax
:=
1.13
tax
:=
1.13
//var showPriceRatioList []model.PriceRatio
for
key
,
price
:=
range
sku
.
LadderPrice
{
for
key
,
price
:=
range
sku
.
LadderPrice
{
//这里有个前置条件处理美金价,因为element(6)存到美金字段里面的是港币,rs(21)存到美金字段里的是人民币,buerklin(1676)是欧元
//这里有个前置条件处理美金价,因为element(6)存到美金字段里面的是港币,rs(21)存到美金字段里的是人民币,buerklin(1676)是欧元
//所以要全部先转成正确的美金价才能显示,目前先写死汇率,因为目前没有地方能获取实时的各种转美金的汇率
//所以要全部先转成正确的美金价才能显示,目前先写死汇率,因为目前没有地方能获取实时的各种转美金的汇率
...
@@ -432,13 +433,15 @@ func (ls *LyService) GetCoefficientAndPrice(sku model.LySku) model.LySku {
...
@@ -432,13 +433,15 @@ func (ls *LyService) GetCoefficientAndPrice(sku model.LySku) model.LySku {
priceCostUs
:=
c
.
MulFloat
(
price
.
PriceUs
,
sku
.
DiscountRatio
.
RatioUsd
)
priceCostUs
:=
c
.
MulFloat
(
price
.
PriceUs
,
sku
.
DiscountRatio
.
RatioUsd
)
priceCostUs
=
c
.
MyRound
(
priceCostUs
,
4
)
priceCostUs
=
c
.
MyRound
(
priceCostUs
,
4
)
//美金售价
//美金售价
fmt
.
Println
(
"计算美金价的系数"
,
priceRatio
.
RatioUsd
)
priceUs
:=
c
.
MulFloat
(
priceCostUs
,
priceRatio
.
RatioUsd
)
priceUs
:=
c
.
MulFloat
(
priceCostUs
,
priceRatio
.
RatioUsd
)
//人民币成本价,mro只有人民币,所以人民币价格不是从美金来的,而且人民币是含税的.就它要特殊处理
//人民币成本价,mro只有人民币,所以人民币价格不是从美金来的,而且人民币是含税的.就它要特殊处理
var
priceCostCn
float64
var
priceCostCn
float64
if
sku
.
SupplierId
==
1688
{
if
sku
.
SupplierId
==
1688
{
priceCostCn
=
c
.
MulFloat
(
price
.
PriceCn
,
1
)
priceCostCn
=
c
.
MulFloat
(
price
.
PriceCn
,
1
)
}
else
{
}
else
{
priceCostCn
=
c
.
MulFloat
(
price
.
PriceUs
,
coefficient
.
Ratio
,
tax
)
usdRatio
,
_
:=
redis
.
Float64
(
redisCon
.
Do
(
"HGET"
,
"erp_rate"
,
2
))
priceCostCn
=
c
.
MulFloat
(
price
.
PriceUs
,
usdRatio
,
tax
)
}
}
priceCostCn
=
c
.
MulFloat
(
c
.
MyRound
(
priceCostCn
,
4
),
sku
.
DiscountRatio
.
Ratio
)
priceCostCn
=
c
.
MulFloat
(
c
.
MyRound
(
priceCostCn
,
4
),
sku
.
DiscountRatio
.
Ratio
)
priceCostCn
=
c
.
MyRound
(
priceCostCn
,
4
)
priceCostCn
=
c
.
MyRound
(
priceCostCn
,
4
)
...
...
service/service_price.go
View file @
55e7752d
...
@@ -654,6 +654,7 @@ func (ps *PriceService) TransformSpecialSupplierPrice(sku model.LySku, priceUs f
...
@@ -654,6 +654,7 @@ func (ps *PriceService) TransformSpecialSupplierPrice(sku model.LySku, priceUs f
}
else
{
}
else
{
currency
,
_
=
redis
.
Int
(
redisCon
.
Do
(
"HGET"
,
"magic_cube_supplier_currency"
,
sku
.
Canal
))
currency
,
_
=
redis
.
Int
(
redisCon
.
Do
(
"HGET"
,
"magic_cube_supplier_currency"
,
sku
.
Canal
))
}
}
fmt
.
Println
(
"进来的美金价格:"
,
priceUs
)
if
currency
>
0
{
if
currency
>
0
{
//这里进行转换,因为这里都只能取到对应的币种转人民币的比率,我们没有直接各种币种转美金的数据,所以我这边要
//这里进行转换,因为这里都只能取到对应的币种转人民币的比率,我们没有直接各种币种转美金的数据,所以我这边要
//先根据对应币种转人民币,然后根据人民币转美金,才能得到不同币种对应美金的汇率
//先根据对应币种转人民币,然后根据人民币转美金,才能得到不同币种对应美金的汇率
...
@@ -664,6 +665,7 @@ func (ps *PriceService) TransformSpecialSupplierPrice(sku model.LySku, priceUs f
...
@@ -664,6 +665,7 @@ func (ps *PriceService) TransformSpecialSupplierPrice(sku model.LySku, priceUs f
//人民币汇率转美金汇率
//人民币汇率转美金汇率
usRatio
=
c
.
MyRound
(
c
.
DivFloat
(
rmbRatio
,
usRatio
),
4
)
usRatio
=
c
.
MyRound
(
c
.
DivFloat
(
rmbRatio
,
usRatio
),
4
)
priceUs
=
c
.
MyRound
(
c
.
MulFloat
(
priceUs
,
usRatio
),
4
)
priceUs
=
c
.
MyRound
(
c
.
MulFloat
(
priceUs
,
usRatio
),
4
)
fmt
.
Println
(
priceUs
)
}
}
return
priceUs
return
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