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
d1b6f109
authored
Apr 28, 2025
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Plain Diff
Merge branch 'master' into dev
parents
74a0d406
6bdd5ce6
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
3 deletions
model/ly_sku.go
service/service_ly_common.go
service/service_price.go
model/ly_sku.go
View file @
d1b6f109
...
...
@@ -91,6 +91,7 @@ type LySku struct {
Coo
string
`json:"coo"`
Tariff
float64
`json:"tariff"`
TariffFormat
string
`json:"tariff_format"`
AbilityLevel
int
`json:"ability_level"`
}
type
DiscountRatio
struct
{
...
...
@@ -283,6 +284,8 @@ func InitSkuData(sku string) (data LySku) {
data
.
Coo
=
gjson
.
Get
(
sku
,
"coo"
)
.
String
()
data
.
AbilityLevel
=
int
(
gjson
.
Get
(
sku
,
"ability_level"
)
.
Int
())
return
}
...
...
service/service_ly_common.go
View file @
d1b6f109
...
...
@@ -566,8 +566,10 @@ func (ls *LyService) GetCoefficientAndPrice(sku model.LySku) model.LySku {
func
(
ls
*
LyService
)
GetTariffAndPrice
(
sku
model
.
LySku
)
model
.
LySku
{
if
len
(
sku
.
LadderPrice
)
==
0
{
sku
.
Coo
=
""
return
sku
}
//判断场地是否是美国,是美国的话,输出关税率以及转换价格
//https://cf.ichunt.net/pages/viewpage.action?pageId=35326045
usLabelList
:=
[]
string
{
...
...
@@ -583,6 +585,7 @@ func (ls *LyService) GetTariffAndPrice(sku model.LySku) model.LySku {
}
//先判断供应商对不对
if
!
c
.
CheckIntSliceContains
(
int
(
sku
.
SupplierId
),
usSupplierIdList
)
{
sku
.
Coo
=
""
return
sku
}
...
...
@@ -591,12 +594,18 @@ func (ls *LyService) GetTariffAndPrice(sku model.LySku) model.LySku {
//判断原始人民币有没有价格,没有的话,那就是最终的人民币价格 X 2.25
var
transformedLadderPrice
[]
model
.
LadderPrice
transformedLadderPrice
=
sku
.
LadderPrice
//digikey暂时不处理
if
sku
.
SupplierId
!=
7
{
for
index
,
price
:=
range
sku
.
LadderPrice
{
transformedLadderPrice
[
index
]
.
PriceCn
=
c
.
MyRound
(
c
.
MulFloat
(
price
.
PriceCn
,
2.25
),
4
)
transformedLadderPrice
[
index
]
.
PriceAc
=
c
.
MyRound
(
c
.
MulFloat
(
price
.
PriceAc
,
2.25
),
4
)
transformedLadderPrice
[
index
]
.
PriceCn
=
c
.
MyRound
(
c
.
MulFloat
(
price
.
PriceCn
,
2.25
),
4
)
transformedLadderPrice
[
index
]
.
PriceAc
=
c
.
MyRound
(
c
.
MulFloat
(
price
.
PriceAc
,
2.25
),
4
)
}
}
sku
.
Tariff
=
2.25
sku
.
TariffFormat
=
"125%"
}
else
{
sku
.
Coo
=
""
}
return
sku
...
...
service/service_price.go
View file @
d1b6f109
...
...
@@ -707,7 +707,7 @@ func (ps *PriceService) TransformSpecialSupplierPrice(sku model.LySku) model.LyS
//这里面还要判断,如果是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
)
priceCn
:=
c
.
MyRound
(
c
.
MulFloat
(
priceUs
,
rmbRatio
,
1.13
),
4
)
sku
.
LadderPrice
[
index
]
.
PriceCn
=
priceCn
}
}
...
...
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