From 07ebec37758b70d23470afd75e1948f736b088e5 Mon Sep 17 00:00:00 2001 From: suyl <770236076@qq.com> Date: Wed, 19 May 2021 16:56:46 +0800 Subject: [PATCH] aa --- business/jxstore/cms/store.go | 79 +++++++++++++++++++++++++++++++ business/jxstore/misc/misc.go | 6 +++ business/jxstore/tempop/tempop.go | 3 +- 3 files changed, 86 insertions(+), 2 deletions(-) diff --git a/business/jxstore/cms/store.go b/business/jxstore/cms/store.go index 180ca58f1..07d35ea57 100644 --- a/business/jxstore/cms/store.go +++ b/business/jxstore/cms/store.go @@ -4221,6 +4221,85 @@ func UpdateVendorStoreBussinessStatus(ctx *jxcontext.Context, storeID, vendorID, return err } +type JdPage struct { + ID int `orm:"column(id)" json:"id"` + Name string `json:"name"` + MonthSalesTip string `json:"month_sales_tip"` + ShippingTime string `json:"shipping_time"` + Address string `json:"address"` + Phone string `json:"phone"` + Pj string `json:"pj"` + Orgcode string `json:"orgcode"` + Wmpoiid string `json:"wmpoiid"` + ThirdCategory string `json:"third_category"` + Set string `json:"set"` + Settime string `json:"settime"` + Latr string `json:"latr"` + Longr string `json:"longr"` + Rek string `json:"rek"` + BakInfo string `json:"bak_info"` + GoodsNumber int `json:"goods_number"` + Lat string `json:"lat"` + Lng string `json:"lng"` + DistrictName string `json:"district_name"` +} + +type MtPage struct { + ID int `orm:"column(id)" json:"id"` + Name string `json:"name"` + MonthSalesTip string `json:"month_sales_tip"` + ShippingTime string `json:"shipping_time"` + Address string `json:"address"` + Phone string `json:"phone"` + Pj string `json:"pj"` + Wmpoiid string `json:"wmpoiid"` + ThirdCategory string `json:"third_category"` + Set string `json:"set"` + Settime string `json:"settime"` + Latr string `json:"latr"` + Longr string `json:"longr"` + Rek string `json:"rek"` + CityName string `json:"city_name"` + GoodsNumber int `json:"goods_number"` + Lat string `json:"lat"` + Lng string `json:"lng"` + DistrictName string `json:"district_name"` +} + +func RefreshPageStore() { + var ( + db = dao.GetDB() + jds []*JdPage + mts []*MtPage + ) + sql := ` + SELECT * FROM jingdong_showd WHERE lng IS NULL AND lat IS NULL + ` + dao.GetRows(db, &jds, sql, nil) + for _, v := range jds { + if v.Lat == "" && v.Lng == "" { + if v.BakInfo != "" { + result, _ := api.AutonaviAPI.GetCoordinateFromAddressAll(v.Address, v.BakInfo) + v.Lng, v.Lat, v.DistrictName = utils.Float64ToStr(result.Lng), utils.Float64ToStr(result.Lat), result.AdName + dao.UpdateEntity(db, v, "Lng", "Lat", "DistrictName") + } + } + } + sql2 := ` + SELECT * FROM meituan_showd WHERE lng IS NULL AND lat IS NULL + ` + dao.GetRows(db, &mts, sql2, nil) + for _, v := range mts { + if v.Lat == "" && v.Lng == "" { + if v.CityName != "" { + result, _ := api.AutonaviAPI.GetCoordinateFromAddressAll(v.Address, v.CityName) + v.Lng, v.Lat, v.DistrictName = utils.Float64ToStr(result.Lng), utils.Float64ToStr(result.Lat), result.AdName + dao.UpdateEntity(db, v, "Lng", "Lat", "DistrictName") + } + } + } +} + func QueryPageStores2(db *dao.DaoDB, pageSize, offset int, keyword string, vendorStoreID string, vendorID, cityCode, districtCode int, tel string, minShopScore float32, minRecentOrderNum, minSkuCount int, lng1, lat1, lng2, lat2 float64) (pagedInfo *model.PagedInfo, err error) { db.Db = orm.NewOrmUsingDB("c4beta") diff --git a/business/jxstore/misc/misc.go b/business/jxstore/misc/misc.go index b8f1a6dcd..25a804a59 100644 --- a/business/jxstore/misc/misc.go +++ b/business/jxstore/misc/misc.go @@ -299,6 +299,12 @@ func Init() { }, []string{ "22:00:00", }) + //刷新门店数据坐标等 + ScheduleTimerFunc("RefreshPageStore", func() { + cms.RefreshPageStore() + }, []string{ + "20:00:00", + }) } if configs, err := dao.QueryConfigs(dao.GetDB(), "ebaiStorePageCookie", model.ConfigTypeCookie, ""); err == nil { ebaiStorePageCookie = configs[0].Value diff --git a/business/jxstore/tempop/tempop.go b/business/jxstore/tempop/tempop.go index 768aeadc8..8395c7fa8 100644 --- a/business/jxstore/tempop/tempop.go +++ b/business/jxstore/tempop/tempop.go @@ -4,7 +4,6 @@ import ( "bytes" "context" "fmt" - "git.rosy.net.cn/jx-callback/business/jxcallback/orderman" "regexp" "strings" "time" @@ -1924,7 +1923,7 @@ func UploadJdsImage(ctx *jxcontext.Context) (err error) { // dao.UpdateEntity(db, v, "ConsigneeMobile2") // } //} - orderman.FixedOrderManager.AmendMissingOrders(ctx, []int{1}, 100920, time.Now().AddDate(0, 0, -18), time.Now(), false, true) + cms.RefreshPageStore() return err }