- 拉取饿百门店营业执照信息
This commit is contained in:
@@ -23,6 +23,9 @@ type PageShop struct {
|
||||
RecentOrderNum int `orm:"size(48)" json:"recentOrderNum"` // 月订单量
|
||||
SkuCount int `orm:"size(48)" json:"skuCount"` // 商品总量
|
||||
BusinessType string `orm:"size(48)" json:"businessType"` // 经营范围
|
||||
|
||||
LicenceCode string `orm:"size(32)" json:"licenceCode"` // 营业执照
|
||||
LicenceImg string `orm:"size(255)" json:"licenceImg"` // 营业执照图片
|
||||
}
|
||||
|
||||
func (*PageShop) TableUnique() [][]string {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package ebai
|
||||
|
||||
import (
|
||||
"git.rosy.net.cn/baseapi/platformapi/autonavi"
|
||||
"git.rosy.net.cn/baseapi/platformapi/ebaiapi"
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
"git.rosy.net.cn/jx-callback/business/jxutils/ditu"
|
||||
"git.rosy.net.cn/jx-callback/business/jxutils/jxcontext"
|
||||
@@ -25,8 +25,9 @@ func (c *PurchaseHandler) GetStoreIDListByCoordinates(ctx *jxcontext.Context, co
|
||||
func (c *PurchaseHandler) GetStorePageInfo(ctx *jxcontext.Context, storeID string) (storePageInfo *model.PageShop, err error) {
|
||||
shopInfo, err2 := api.EbaiAPI.GetStoreInfo2(storeID)
|
||||
if err = err2; err == nil && shopInfo != nil {
|
||||
lng, lat, _ := api.AutonaviAPI.CoordinateConvert(shopInfo.Longitude/100000, shopInfo.Latitude/100000, autonavi.CoordSysBaidu)
|
||||
return &model.PageShop{
|
||||
// 饿百扒下来的坐标是加了密的,不能用
|
||||
// lng, lat, _ := api.AutonaviAPI.CoordinateConvert(shopInfo.Longitude/100000, shopInfo.Latitude/100000, autonavi.CoordSysBaidu)
|
||||
storePageInfo = &model.PageShop{
|
||||
Name: shopInfo.Name,
|
||||
VendorID: model.VendorIDEBAI,
|
||||
VendorStoreID: storeID,
|
||||
@@ -34,8 +35,8 @@ func (c *PurchaseHandler) GetStorePageInfo(ctx *jxcontext.Context, storeID strin
|
||||
VendorStatus: utils.Int2Str(shopInfo.BusinessStatus),
|
||||
|
||||
Address: shopInfo.Address,
|
||||
Lng: lng,
|
||||
Lat: lat,
|
||||
Lng: 0,
|
||||
Lat: 0,
|
||||
DistrictCode: 0,
|
||||
|
||||
Tel1: shopInfo.Phone,
|
||||
@@ -44,7 +45,21 @@ func (c *PurchaseHandler) GetStorePageInfo(ctx *jxcontext.Context, storeID strin
|
||||
SkuCount: shopInfo.SkuCount,
|
||||
BusinessType: shopInfo.Category,
|
||||
ShopScore: float64(shopInfo.ShopScore),
|
||||
}, nil
|
||||
}
|
||||
storePageInfo.LicenceCode, storePageInfo.LicenceImg = getLicenceInfoFromShopInfo(shopInfo)
|
||||
}
|
||||
return nil, err
|
||||
return storePageInfo, err
|
||||
}
|
||||
|
||||
func getLicenceInfoFromShopInfo(storeInfo *ebaiapi.PageShopInfo) (licenceCode, licenceImg string) {
|
||||
for _, v := range storeInfo.MedicineQualification {
|
||||
if v.AptitudeType == "101" { // 营业执照
|
||||
licenceCode = v.LicenseNumber
|
||||
if len(v.AptitudePhoto) > 0 {
|
||||
licenceImg = v.AptitudePhoto[0]
|
||||
}
|
||||
break
|
||||
}
|
||||
}
|
||||
return licenceCode, licenceImg
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user