Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
杨树贤
/
search_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
14b9872c
authored
Aug 03, 2020
by
huangchengyi
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
1.0
parent
657403bc
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
2 deletions
model/ly.go
service/ly/common.go
service/ly/digikey.go
service/ly/mouser.go
model/ly.go
View file @
14b9872c
...
@@ -22,18 +22,28 @@ type LyClearGoodsList struct {
...
@@ -22,18 +22,28 @@ type LyClearGoodsList struct {
SinglePrice
float64
`json:"single_price"`
//最小单价
SinglePrice
float64
`json:"single_price"`
//最小单价
Stock
int64
`json:"stock"`
//库存
Stock
int64
`json:"stock"`
//库存
Moq
int64
`json:"moq"`
//最小起订量、起订量
Moq
int64
`json:"moq"`
//最小起订量、起订量
Packaging
string
`json:"Packaging"`
//包装
RawGoodsId
string
`json:"raw_goods_id"`
//外链原始goods_sn,如digikey:{'raw_goods_id': 'AT28C64X-25PC-ND', 'raw_brand_name': 'Microchip Technology'}
RawGoodsId
string
`json:"raw_goods_id"`
//外链原始goods_sn,如digikey:{'raw_goods_id': 'AT28C64X-25PC-ND', 'raw_brand_name': 'Microchip Technology'}
RawBrandName
string
`json:"raw_brand_name"`
//外链原始品牌名称,如digikey:{'raw_goods_id': 'AT28C64X-25PC-ND', 'raw_brand_name': 'Microchip Technology'}
RawBrandName
string
`json:"raw_brand_name"`
//外链原始品牌名称,如digikey:{'raw_goods_id': 'AT28C64X-25PC-ND', 'raw_brand_name': 'Microchip Technology'}
Tiered
[]
*
TierItem
`json:"tiered"`
//价格梯度数量
Tiered
[]
*
TierItem
`json:"tiered"`
//价格梯度数量
PriceTemp
[]
interface
{}
`json:"price_temp"`
//拼接梯度,目前只有联营推送队列用
PriceTemp
[]
interface
{}
`json:"price_temp"`
//拼接梯度,目前只有联营推送队列用
DigiKeyPartNumber
string
`json:"DigiKeyPartNumber"`
//digkey 唯一编码 (额外字段)
ManufacturerLeadWeeks
string
`json:"ManufacturerLeadWeeks"`
//digikey交期(额外字段)
}
}
type
TierItem
struct
{
type
TierItem
struct
{
Purchases
u
int64
`json:"purchases"`
//购买数量
Purchases
int64
`json:"purchases"`
//购买数量
PriceUs
float64
`json:"price_us"`
//数量对应的英文价格
PriceUs
float64
`json:"price_us"`
//数量对应的英文价格
PriceCn
float64
`json:"price_cn"`
//数量对应的中文价格
PriceCn
float64
`json:"price_cn"`
//数量对应的中文价格
PriceAc
float64
`json:"price_ac"`
PriceAc
float64
`json:"price_ac"`
}
}
//原始品牌(目前只有digikey使用)
type
RawGoods
struct
{
RawGoodsId
string
`json:"raw_goods_id"`
//原始goods_sn
RawBrandName
string
`json:"raw_brand_name"`
//原始品牌名称
Pack
string
`json:"pack"`
//包装
}
/*
/*
供应商详情
供应商详情
Array
Array
...
...
service/ly/common.go
View file @
14b9872c
...
@@ -26,6 +26,7 @@ type CommonLyService struct {
...
@@ -26,6 +26,7 @@ type CommonLyService struct {
supplierId
int64
//调用当前方法的供应商ID
supplierId
int64
//调用当前方法的供应商ID
supplierName
string
//调用当前方法的供应商名称
supplierName
string
//调用当前方法的供应商名称
skuEsUpdataList
[]
string
//组装批量更新es数据
skuEsUpdataList
[]
string
//组装批量更新es数据
RawGoods
map
[
string
]
*
model
.
RawGoods
//原始数据
}
}
//初始化类
//初始化类
...
...
service/ly/digikey.go
View file @
14b9872c
This diff is collapsed.
Click to expand it.
service/ly/mouser.go
View file @
14b9872c
...
@@ -53,7 +53,7 @@ func OutLinkMouser(goodsName *string) map[string]*model.LyClearGoodsList {
...
@@ -53,7 +53,7 @@ func OutLinkMouser(goodsName *string) map[string]*model.LyClearGoodsList {
onePrice
=
strings
.
ReplaceAll
(
strings
.
Trim
(
onePrice
,
"$"
),
","
,
""
)
onePrice
=
strings
.
ReplaceAll
(
strings
.
Trim
(
onePrice
,
"$"
),
","
,
""
)
skuPrice
,
_
:=
strconv
.
ParseFloat
(
onePrice
,
64
)
//转成float64
skuPrice
,
_
:=
strconv
.
ParseFloat
(
onePrice
,
64
)
//转成float64
//数量转换
//数量转换
quantity
:=
gjson
.
Get
(
priceItemStr
,
"Quantity"
)
.
Ui
nt
()
quantity
:=
gjson
.
Get
(
priceItemStr
,
"Quantity"
)
.
I
nt
()
if
apiLowerPrice
==
0
{
if
apiLowerPrice
==
0
{
apiLowerPrice
=
skuPrice
apiLowerPrice
=
skuPrice
...
...
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