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
17ffef31
authored
Dec 19, 2025
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
未税自营成本价
parent
44ceced1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
5 deletions
model/ly_sku.go
service/service_ly_common.go
model/ly_sku.go
View file @
17ffef31
...
...
@@ -96,7 +96,8 @@ type LySku struct {
OnwayStock
int
`json:"onway_stock"`
CompareRatio
float64
`json:"compare_ratio"`
//兼容自营下单的字段,取成本价的第一个阶梯的人民币
Cost
float64
`json:"cost"`
Cost
float64
`json:"cost"`
CostNoTax
float64
`json:"cost_no_tax`
}
type
DiscountRatio
struct
{
...
...
service/service_ly_common.go
View file @
17ffef31
...
...
@@ -312,13 +312,17 @@ func (ls *LyService) GetCoefficientAndPrice(sku model.LySku) model.LySku {
ladderPrice
:=
sku
.
LadderPrice
//这里是存了一些特殊供应商价格的判断,数据库里不是所有供应商都是存的人民币/美金
sku
=
priceService
.
TransformSpecialSupplierPrice
(
sku
)
//这里还有两个个特殊判断
//猎芯自营 L0018319 WMS同步过来的未税成本单价(人民币),需乘以关税,再填入到基石该SKU的 成本价——国内含税(¥)
// 香港自营(L0018562)WMS同步过来的未税成本单价(美金)
//需更新到 基石该SKU的 成本价——香港交货($)且也需乘美金转人民币汇率, 再乘以关税,填入到基石该SKU的 成本价——国内含税(¥)价
//这里要获取一个第一个阶梯的未税成本价
var
costNoTax
float64
if
sku
.
Canal
==
"L0018319"
{
for
_
,
price
:=
range
sku
.
OriginalPrice
{
for
index
,
price
:=
range
sku
.
OriginalPrice
{
if
index
==
0
{
costNoTax
=
price
.
PriceCn
}
originalPrice
=
append
(
originalPrice
,
model
.
OriginPrice
{
Purchases
:
price
.
Purchases
,
PriceCn
:
c
.
MyRound
(
c
.
MulFloat
(
price
.
PriceCn
,
tax
),
4
),
...
...
@@ -334,10 +338,14 @@ func (ls *LyService) GetCoefficientAndPrice(sku model.LySku) model.LySku {
redisCon
:=
gredis
.
Conn
(
"default_r"
)
defer
redisCon
.
Close
()
usdRatio
,
_
:=
redis
.
Float64
(
redisCon
.
Do
(
"HGET"
,
"erp_rate"
,
2
))
for
_
,
price
:=
range
sku
.
OriginalPrice
{
for
index
,
price
:=
range
sku
.
OriginalPrice
{
priceCnNoTax
:=
c
.
MulFloat
(
price
.
PriceUs
,
usdRatio
)
if
index
==
0
{
costNoTax
=
priceCnNoTax
}
originalPrice
=
append
(
originalPrice
,
model
.
OriginPrice
{
Purchases
:
price
.
Purchases
,
PriceCn
:
c
.
MyRound
(
c
.
MulFloat
(
price
.
PriceUs
,
usdRatio
*
tax
),
4
),
PriceCn
:
c
.
MyRound
(
c
.
MulFloat
(
price
CnNoTax
,
tax
),
4
),
PriceUs
:
price
.
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