Commit 14b9872c by huangchengyi

1.0

parent 657403bc
...@@ -2,38 +2,48 @@ package model ...@@ -2,38 +2,48 @@ package model
//联营请求外链后格式化数据 //联营请求外链后格式化数据
type LyClearGoodsList struct { type LyClearGoodsList struct {
SkuId string `json:"sku_id"` //平台型号id (非必填) SkuId string `json:"sku_id"` //平台型号id (非必填)
SpuId string `json:"spu_id"` //平台spuId (非必填) SpuId string `json:"spu_id"` //平台spuId (非必填)
BrandId string `json:"brand_id"` //平台品牌id (非必填) BrandId string `json:"brand_id"` //平台品牌id (非必填)
GoodsName string `json:"goods_name"` //型号名称 GoodsName string `json:"goods_name"` //型号名称
BrandName string `json:"brand_name"` //品牌名称 BrandName string `json:"brand_name"` //品牌名称
Desc string `json:"desc"` //描述 Desc string `json:"desc"` //描述
BatchSn string `json:"batch_sn"` //批次号 BatchSn string `json:"batch_sn"` //批次号
GoodsSn string `json:"goods_sn"` //api唯一编码 GoodsSn string `json:"goods_sn"` //api唯一编码
Docurl string `json:"docurl"` //sku对应供应商的文档路径 Docurl string `json:"docurl"` //sku对应供应商的文档路径
Url string `json:"url"` //sku对应供应商的商品详情 Url string `json:"url"` //sku对应供应商的商品详情
GoodsImg string `json:"goods_img"` //sku图片 GoodsImg string `json:"goods_img"` //sku图片
Cat string `json:"cat"` //分类 Cat string `json:"cat"` //分类
Encap string `json:"encap"` //包装 Encap string `json:"encap"` //包装
Canal string `json:"canal"` //渠道标签 Canal string `json:"canal"` //渠道标签
Encoded string `json:"encoded"` //内部编码 Encoded string `json:"encoded"` //内部编码
RestrictionMessage string `json:"RestrictionMessage"` //额外购买限制内容,如 ‘当前商品不在本地区销售’ RestrictionMessage string `json:"RestrictionMessage"` //额外购买限制内容,如 ‘当前商品不在本地区销售’
Increment int64 `json:"increment"` //最小包装量、倍数 =Mpq Increment int64 `json:"increment"` //最小包装量、倍数 =Mpq
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"` //最小起订量、起订量
RawGoodsId string `json:"raw_goods_id"` //外链原始goods_sn,如digikey:{'raw_goods_id': 'AT28C64X-25PC-ND', 'raw_brand_name': 'Microchip Technology'} Packaging string `json:"Packaging"` //包装
RawBrandName string `json:"raw_brand_name"` //外链原始品牌名称,如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'}
Tiered []*TierItem `json:"tiered"` //价格梯度数量 RawBrandName string `json:"raw_brand_name"` //外链原始品牌名称,如digikey:{'raw_goods_id': 'AT28C64X-25PC-ND', 'raw_brand_name': 'Microchip Technology'}
PriceTemp []interface{} `json:"price_temp"` //拼接梯度,目前只有联营推送队列用 Tiered []*TierItem `json:"tiered"` //价格梯度数量
PriceTemp []interface{} `json:"price_temp"` //拼接梯度,目前只有联营推送队列用
DigiKeyPartNumber string `json:"DigiKeyPartNumber"` //digkey 唯一编码 (额外字段)
ManufacturerLeadWeeks string `json:"ManufacturerLeadWeeks"` //digikey交期(额外字段)
} }
type TierItem struct { type TierItem struct {
Purchases uint64 `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
......
...@@ -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 //原始数据
} }
//初始化类 //初始化类
......
...@@ -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").Uint() quantity := gjson.Get(priceItemStr, "Quantity").Int()
if apiLowerPrice == 0 { if apiLowerPrice == 0 {
apiLowerPrice = skuPrice apiLowerPrice = skuPrice
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment