From 4f6566da3dce9dd9efb610f5a1c550298e4a0c05 Mon Sep 17 00:00:00 2001 From: gazebo Date: Tue, 25 Jun 2019 17:08:02 +0800 Subject: [PATCH] =?UTF-8?q?-=20=E8=B0=83=E6=95=B4lng,lat=E5=92=8Cshop=5Fsc?= =?UTF-8?q?ore=E7=9A=84=E6=95=B0=E6=8D=AE=E6=A0=BC=E5=BC=8F=E4=B8=BAnumeri?= =?UTF-8?q?c?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/model/net_spider.go | 12 ++++++------ business/partner/purchase/ebai/net_spider.go | 2 +- business/partner/purchase/jd/net_spider.go | 6 ++++-- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/business/model/net_spider.go b/business/model/net_spider.go index cf3efaa65..d7b747e29 100644 --- a/business/model/net_spider.go +++ b/business/model/net_spider.go @@ -13,16 +13,16 @@ type PageShop struct { CityCode int `orm:"default(0)" json:"cityCode"` // todo ? DistrictCode int `orm:"default(0)" json:"districtCode"` // todo ? Address string `orm:"size(255)" json:"address"` - Lng float64 `json:"lng"` - Lat float64 `json:"lat"` + Lng float64 `orm:"digits(10);decimals(6)" json:"lng"` + Lat float64 `orm:"digits(10);decimals(6)" json:"lat"` Tel1 string `orm:"size(32);index" json:"tel1"` Tel2 string `orm:"size(32);index" json:"tel2"` - ShopScore float32 `json:"shopScore"` // 店铺评分 - RecentOrderNum int `orm:"size(48)" json:"recentOrderNum"` // 月订单量 - SkuCount int `orm:"size(48)" json:"skuCount"` // 商品总量 - BusinessType string `orm:"size(48)" json:"businessType"` // 经营范围 + ShopScore float64 `orm:"digits(3);decimals(1)" json:"shopScore"` // 店铺评分 + RecentOrderNum int `orm:"size(48)" json:"recentOrderNum"` // 月订单量 + SkuCount int `orm:"size(48)" json:"skuCount"` // 商品总量 + BusinessType string `orm:"size(48)" json:"businessType"` // 经营范围 } func (*PageShop) TableUnique() [][]string { diff --git a/business/partner/purchase/ebai/net_spider.go b/business/partner/purchase/ebai/net_spider.go index 14475124d..caddae4b2 100644 --- a/business/partner/purchase/ebai/net_spider.go +++ b/business/partner/purchase/ebai/net_spider.go @@ -43,7 +43,7 @@ func (c *PurchaseHandler) GetStorePageInfo(ctx *jxcontext.Context, cityInfo, sto RecentOrderNum: shopInfo.RecentOrderNum, SkuCount: shopInfo.SkuCount, BusinessType: shopInfo.Category, - ShopScore: float32(shopInfo.ShopScore), + ShopScore: float64(shopInfo.ShopScore), }, nil } return nil, err diff --git a/business/partner/purchase/jd/net_spider.go b/business/partner/purchase/jd/net_spider.go index 32b1ca35e..2b6e11c1f 100644 --- a/business/partner/purchase/jd/net_spider.go +++ b/business/partner/purchase/jd/net_spider.go @@ -1,6 +1,8 @@ package jd import ( + "fmt" + "git.rosy.net.cn/baseapi/utils" "git.rosy.net.cn/jx-callback/business/jxutils/ditu" "git.rosy.net.cn/jx-callback/business/jxutils/jxcontext" @@ -9,7 +11,7 @@ import ( ) func (c *PurchaseHandler) GetStoreIDListByCoordinates(ctx *jxcontext.Context, coord *ditu.Coordinate) (storeIDList []string, err error) { - shopListInfo, err := api.JdAPI.GetStoreList(utils.Float64ToStr(coord.Lng), utils.Float64ToStr(coord.Lat)) + shopListInfo, err := api.JdAPI.GetStoreList(fmt.Sprintf("%.6f", coord.Lng), fmt.Sprintf("%.6f", coord.Lat)) if err != nil { return nil, err } @@ -47,7 +49,7 @@ func (c *PurchaseHandler) GetStorePageInfo(ctx *jxcontext.Context, cityInfo, sto RecentOrderNum: int(utils.Str2Int64WithDefault(shopInfo.StoreInfo.MonthSaleNum, 0)), SkuCount: int(utils.Str2Int64WithDefault(shopInfo.StoreInfo.InSaleNum, 0)), BusinessType: shopInfo.StoreInfo.Industry, - ShopScore: float32(shopInfo.StoreCommentVO.ScoreAvg), + ShopScore: float64(shopInfo.StoreCommentVO.ScoreAvg), }, nil } return nil, err