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
1fb099af
authored
Aug 18, 2023
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
继续优化
parent
99d38893
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
7 deletions
service/service_price.go
service/service_price.go
View file @
1fb099af
...
@@ -191,6 +191,7 @@ func (ps *PriceService) GenerateLadderPrice(sku model.LySku) model.LySku {
...
@@ -191,6 +191,7 @@ func (ps *PriceService) GenerateLadderPrice(sku model.LySku) model.LySku {
//判断是否走成本价判断还是走阶梯价判断,因为上传sku的时候,可以设置每个sku的成本价(人民币&&美金),也可以设置每个sku的阶梯价
//判断是否走成本价判断还是走阶梯价判断,因为上传sku的时候,可以设置每个sku的成本价(人民币&&美金),也可以设置每个sku的阶梯价
//如果有阶梯价,就要跳过设置的成本价(假设有设置的话)
//如果有阶梯价,就要跳过设置的成本价(假设有设置的话)
if
isCostPrice
{
if
isCostPrice
{
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)
...
@@ -269,7 +270,6 @@ func (ps *PriceService) GenerateLadderPrice(sku model.LySku) model.LySku {
...
@@ -269,7 +270,6 @@ func (ps *PriceService) GenerateLadderPrice(sku model.LySku) model.LySku {
return
sku
return
sku
}
}
fmt
.
Println
(
"是成本价"
)
// 成本价阶梯数 由最高库存计算得到
// 成本价阶梯数 由最高库存计算得到
costLadderCount
:=
0
costLadderCount
:=
0
for
i
:=
0
;
i
<
len
(
priceRatioList
);
i
++
{
for
i
:=
0
;
i
<
len
(
priceRatioList
);
i
++
{
...
@@ -359,7 +359,7 @@ func (ps *PriceService) GenerateLadderPrice(sku model.LySku) model.LySku {
...
@@ -359,7 +359,7 @@ func (ps *PriceService) GenerateLadderPrice(sku model.LySku) model.LySku {
}
}
//fmt.Println(costMapIndex)
//fmt.Println(costMapIndex)
priceRatio
:=
priceRatioList
[
costMapIndex
]
priceRatio
:=
priceRatioList
[
costMapIndex
]
//
fmt.Println("获取到的阶梯系数为 : ", priceRatio)
fmt
.
Println
(
"获取到的阶梯系数为 : "
,
priceRatio
)
priceCnRatio
:=
priceRatio
.
Ratio
priceCnRatio
:=
priceRatio
.
Ratio
priceUsRatio
:=
priceRatio
.
RatioUsd
priceUsRatio
:=
priceRatio
.
RatioUsd
// 阶梯价格系数正序取
// 阶梯价格系数正序取
...
@@ -648,11 +648,6 @@ func (ps *PriceService) TransformSpecialSupplierPrice(sku model.LySku, priceUs f
...
@@ -648,11 +648,6 @@ func (ps *PriceService) TransformSpecialSupplierPrice(sku model.LySku, priceUs f
}()
}()
usRatio
,
_
:=
redis
.
Float64
(
redisCon
.
Do
(
"HGET"
,
"erp_rate"
,
2
))
usRatio
,
_
:=
redis
.
Float64
(
redisCon
.
Do
(
"HGET"
,
"erp_rate"
,
2
))
var
currency
int
var
currency
int
//这个供应商把人民币存到美金这个字段了,所以要提前判断和返回
if
sku
.
SupplierId
==
6
{
priceUs
=
c
.
MyRound
(
c
.
DivFloat
(
priceUs
,
usRatio
),
4
)
return
priceUs
}
if
sku
.
SupplierId
!=
17
{
if
sku
.
SupplierId
!=
17
{
currency
,
_
=
redis
.
Int
(
redisCon
.
Do
(
"HGET"
,
"magic_cube_supplier_currency"
,
sku
.
SupplierId
))
currency
,
_
=
redis
.
Int
(
redisCon
.
Do
(
"HGET"
,
"magic_cube_supplier_currency"
,
sku
.
SupplierId
))
}
else
{
}
else
{
...
...
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