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
be89a166
authored
Jan 22, 2026
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
去除字段
parent
d216fb49
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
31 deletions
model/ly_sku.go
service/service_ly_common.go
model/ly_sku.go
View file @
be89a166
...
...
@@ -97,8 +97,7 @@ type LySku struct {
OnwayStock
int
`json:"onway_stock"`
CompareRatio
float64
`json:"compare_ratio"`
//兼容自营下单的字段,取成本价的第一个阶梯的人民币
Cost
float64
`json:"cost"`
CostNoTax
float64
`json:"cost_no_tax"`
Cost
float64
`json:"cost"`
}
type
DiscountRatio
struct
{
...
...
service/service_ly_common.go
View file @
be89a166
...
...
@@ -318,59 +318,39 @@ func (ls *LyService) GetCoefficientAndPrice(sku model.LySku) model.LySku {
//需更新到 基石该SKU的 成本价——香港交货($)且也需乘美金转人民币汇率, 再乘以关税,填入到基石该SKU的 成本价——国内含税(¥)价
//这里要获取一个第一个阶梯的未税成本价
// L0003270 这个供应商的话
var
costNoTax
float64
if
sku
.
Canal
==
"L0018319"
||
sku
.
Canal
==
"L0003270"
{
for
index
,
price
:=
range
sku
.
OriginalPrice
{
priceCnNoTax
:=
price
.
PriceCn
if
index
==
0
{
costNoTax
=
priceCnNoTax
if
costNoTax
==
0
{
continue
}
}
originalPrice
=
append
(
originalPrice
,
model
.
OriginPrice
{
Purchases
:
price
.
Purchases
,
PriceCn
:
c
.
MyRound
(
c
.
MulFloat
(
price
.
PriceCn
,
tax
),
4
),
PriceUs
:
price
.
PriceUs
,
})
}
for
index
,
price
:=
range
sku
.
LadderPrice
{
ladderPrice
[
index
]
.
PriceCn
=
c
.
MyRound
(
c
.
MulFloat
(
price
.
PriceCn
,
tax
),
4
)
}
}
if
sku
.
Canal
==
"L0018562"
||
sku
.
Canal
==
"L0003270"
{
var
costTax
float64
if
sku
.
Canal
==
"L0018562"
{
redisCon
:=
gredis
.
Conn
(
"default_r"
)
defer
redisCon
.
Close
()
usdRatio
,
_
:=
redis
.
Float64
(
redisCon
.
Do
(
"HGET"
,
"erp_rate"
,
2
))
for
index
,
price
:=
range
sku
.
OriginalPrice
{
priceCn
No
Tax
:=
c
.
MulFloat
(
price
.
PriceUs
,
usdRatio
)
priceCnTax
:=
c
.
MulFloat
(
price
.
PriceUs
,
usdRatio
)
if
index
==
0
{
costNoTax
=
priceCnNoTax
if
costNoTax
==
0
{
if
priceCnTax
==
0
{
continue
}
costTax
=
priceCnTax
}
//如果有人民币的话,就用人民币,没有的话,就用上面的美元算出来的人民币
//L0018562一定有美元的,所以不能提前判断
if
price
.
PriceCn
!=
0
{
priceCn
No
Tax
=
price
.
PriceCn
priceCnTax
=
price
.
PriceCn
}
originalPrice
=
append
(
originalPrice
,
model
.
OriginPrice
{
Purchases
:
price
.
Purchases
,
PriceCn
:
c
.
MyRound
(
c
.
MulFloat
(
priceCnNoTax
,
tax
),
4
)
,
PriceCn
:
priceCnTax
,
PriceUs
:
price
.
PriceUs
,
})
}
for
index
,
price
:=
range
sku
.
LadderPrice
{
if
cost
No
Tax
==
0
{
if
costTax
==
0
{
continue
}
ladderPrice
[
index
]
.
PriceCn
=
c
.
MyRound
(
c
.
MulFloat
(
price
.
PriceUs
,
usdRatio
*
tax
),
4
)
}
}
sku
.
CostNoTax
=
costNoTax
//判断redis里面是否有成本价,有的话,那就直接去取价格,不需要生成阶梯价
//如果没有成本价字段,就要去生成阶梯价格
if
len
(
ladderPrice
)
>
0
{
...
...
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