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
148648b5
authored
Aug 18, 2023
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Plain Diff
Merge branch 'ysx-价格体系修改-20230815' into dev
parents
1bac2e2d
634a1bf4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
4 deletions
service/service_price.go
service/service_price.go
View file @
148648b5
...
@@ -191,7 +191,7 @@ func (ps *PriceService) GenerateLadderPrice(sku model.LySku) model.LySku {
...
@@ -191,7 +191,7 @@ func (ps *PriceService) GenerateLadderPrice(sku model.LySku) model.LySku {
//判断是否走成本价判断还是走阶梯价判断,因为上传sku的时候,可以设置每个sku的成本价(人民币&&美金),也可以设置每个sku的阶梯价
//判断是否走成本价判断还是走阶梯价判断,因为上传sku的时候,可以设置每个sku的成本价(人民币&&美金),也可以设置每个sku的阶梯价
//如果有阶梯价,就要跳过设置的成本价(假设有设置的话)
//如果有阶梯价,就要跳过设置的成本价(假设有设置的话)
if
isCostPrice
{
if
isCostPrice
{
fmt
.
Println
(
"
是
成本价"
)
fmt
.
Println
(
"成本价"
)
costPriceCn
:=
sku
.
LadderPrice
[
0
]
.
PriceCn
costPriceCn
:=
sku
.
LadderPrice
[
0
]
.
PriceCn
costPriceUs
:=
sku
.
LadderPrice
[
0
]
.
PriceUs
costPriceUs
:=
sku
.
LadderPrice
[
0
]
.
PriceUs
//fmt.Println("人民币和美金的成本价分别为 : ", costPriceCn, costPriceUs)
//fmt.Println("人民币和美金的成本价分别为 : ", costPriceCn, costPriceUs)
...
@@ -296,8 +296,9 @@ func (ps *PriceService) GenerateLadderPrice(sku model.LySku) model.LySku {
...
@@ -296,8 +296,9 @@ func (ps *PriceService) GenerateLadderPrice(sku model.LySku) model.LySku {
//如:库存满足1、2、3层阶梯,最小利润点层级是第5个层级,则利润点取3、4、5层级的
//如:库存满足1、2、3层阶梯,最小利润点层级是第5个层级,则利润点取3、4、5层级的
//最小利润点层级 - 库存满足多少个阶梯 + i
//最小利润点层级 - 库存满足多少个阶梯 + i
costMapIndex
:=
ladderPriceMiniProfitLevel
-
costLadderCount
+
i
costMapIndex
:=
ladderPriceMiniProfitLevel
-
costLadderCount
+
i
fmt
.
Println
(
costMapIndex
)
if
costMapIndex
<=
0
{
if
costMapIndex
<=
0
{
costMapIndex
=
1
costMapIndex
=
0
}
}
priceRatioAndPurchases
=
priceRatioList
[
costMapIndex
]
priceRatioAndPurchases
=
priceRatioList
[
costMapIndex
]
//fmt.Println("获取到的阶梯系数为 : ", priceRatioAndPurchases)
//fmt.Println("获取到的阶梯系数为 : ", priceRatioAndPurchases)
...
@@ -658,9 +659,11 @@ func (ps *PriceService) TransformSpecialSupplierPrice(sku model.LySku, priceUs f
...
@@ -658,9 +659,11 @@ func (ps *PriceService) TransformSpecialSupplierPrice(sku model.LySku, priceUs f
//先根据对应币种转人民币,然后根据人民币转美金,才能得到不同币种对应美金的汇率
//先根据对应币种转人民币,然后根据人民币转美金,才能得到不同币种对应美金的汇率
rmbRatio
,
_
:=
redis
.
Float64
(
redisCon
.
Do
(
"HGET"
,
"erp_rate"
,
currency
))
rmbRatio
,
_
:=
redis
.
Float64
(
redisCon
.
Do
(
"HGET"
,
"erp_rate"
,
currency
))
fmt
.
Println
(
"特殊转换"
,
rmbRatio
)
fmt
.
Println
(
"特殊转换"
,
rmbRatio
)
fmt
.
Println
(
rmbRatio
,
usRatio
)
//人民币汇率转美金汇率
//人民币汇率转美金汇率
usRatio
=
c
.
MyRound
(
c
.
DivFloat
(
rmbRatio
,
usRatio
),
2
)
usRatio
=
c
.
MyRound
(
c
.
DivFloat
(
rmbRatio
,
usRatio
),
4
)
priceUs
=
c
.
MyRound
(
c
.
Div
Float
(
priceUs
,
usRatio
),
4
)
priceUs
=
c
.
MyRound
(
c
.
Mul
Float
(
priceUs
,
usRatio
),
4
)
}
}
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