Merge remote-tracking branch 'origin/mark' into don
This commit is contained in:
@@ -99,8 +99,12 @@ func (w *OrderManager) OnWaybillStatusChanged(bill *model.Waybill) (err error) {
|
||||
duplicatedCount = 1
|
||||
}
|
||||
} else {
|
||||
existingBill, err2 := w.LoadWaybill(bill.VendorWaybillID, bill.WaybillVendorID)
|
||||
// todo
|
||||
if err2 == nil {
|
||||
bill.DeliveryFlag = existingBill.DeliveryFlag
|
||||
}
|
||||
if bill.Status == model.WaybillStatusAccepted { // 处理美团配送丢失新运单消息的情况
|
||||
existingBill, err2 := w.LoadWaybill(bill.VendorWaybillID, bill.WaybillVendorID)
|
||||
if err2 != nil {
|
||||
if dao.IsNoRowsError(err2) || err2 == ErrCanNotFindWaybill {
|
||||
existingBill = bill
|
||||
|
||||
@@ -15,6 +15,7 @@ import (
|
||||
// todo 是否需要将Store.MarketManPhone与OperatorPhone成角色?
|
||||
|
||||
func TransferLegacyWeixins(mobile string) (err error) {
|
||||
globals.SugarLogger.Debugf("TransferLegacyWeixins mobile:%s", mobile)
|
||||
if !globals.EnableWXAuth2 {
|
||||
return nil
|
||||
}
|
||||
@@ -44,7 +45,7 @@ func TransferLegacyWeixins(mobile string) (err error) {
|
||||
} else {
|
||||
sql += " t2.id IS NULL OR (t1.openid <> '' AND t3.id IS NULL) OR (t1.openid_mini <> '' AND t4.id IS NULL)"
|
||||
}
|
||||
sql += `ORDER BY t1.parentid;`
|
||||
sql += " ORDER BY t1.parentid;"
|
||||
var weixinList []*legacymodel.WeiXins
|
||||
db := dao.GetDB()
|
||||
err = dao.GetRows(db, &weixinList, sql, sqlParams...)
|
||||
|
||||
@@ -13,6 +13,8 @@ import (
|
||||
"git.rosy.net.cn/jx-callback/business/auth2"
|
||||
"git.rosy.net.cn/jx-callback/business/authz"
|
||||
|
||||
"git.rosy.net.cn/baseapi/platformapi/autonavi"
|
||||
"git.rosy.net.cn/baseapi/platformapi/baidunavi"
|
||||
"git.rosy.net.cn/baseapi/platformapi/dingdingapi"
|
||||
"git.rosy.net.cn/baseapi/platformapi/jdapi"
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
@@ -406,29 +408,29 @@ func GetStores(ctx *jxcontext.Context, keyword string, params map[string]interfa
|
||||
retVal.Stores = retVal.Stores[offset : offset+pageSize]
|
||||
}
|
||||
if needConver2Baidu {
|
||||
// task := tasksch.NewParallelTask("坐标转换", tasksch.NewParallelConfig().SetParallelCount(4).SetBatchSize(autonavi.MaxConvertCount), ctx,
|
||||
// func(task *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (retVal interface{}, err error) {
|
||||
// var coords []*autonavi.Coordinate
|
||||
// for _, v := range batchItemList {
|
||||
// store := v.(*StoreExt)
|
||||
// coords = append(coords, &autonavi.Coordinate{
|
||||
// Lng: store.FloatLng,
|
||||
// Lat: store.FloatLat,
|
||||
// })
|
||||
// }
|
||||
// coords, err = api.AutonaviAPI.BatchCoordinateConvert(coords, autonavi.CoordSysBaidu)
|
||||
// if err == nil {
|
||||
// for k, v := range batchItemList {
|
||||
// store := v.(*StoreExt)
|
||||
// coord := coords[k]
|
||||
// store.FloatLng = coord.Lng
|
||||
// store.FloatLat = coord.Lat
|
||||
// }
|
||||
// }
|
||||
// return retVal, err
|
||||
// }, retVal.Stores)
|
||||
// task.Run()
|
||||
// task.GetResult(0)
|
||||
task := tasksch.NewParallelTask("坐标转换", tasksch.NewParallelConfig().SetParallelCount(4).SetBatchSize(autonavi.MaxConvertCount), ctx,
|
||||
func(task *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (retVal interface{}, err error) {
|
||||
var coords []*baidunavi.Coordinate
|
||||
for _, v := range batchItemList {
|
||||
store := v.(*StoreExt)
|
||||
coords = append(coords, &baidunavi.Coordinate{
|
||||
Lng: store.FloatLng,
|
||||
Lat: store.FloatLat,
|
||||
})
|
||||
}
|
||||
coords, err = api.BaiDuNaviAPI.BatchCoordinateConvert(coords, baidunavi.CoordSysGCJ02, baidunavi.CoordSysBaiDu)
|
||||
if err == nil {
|
||||
for k, v := range batchItemList {
|
||||
store := v.(*StoreExt)
|
||||
coord := coords[k]
|
||||
store.FloatLng = coord.Lng
|
||||
store.FloatLat = coord.Lat
|
||||
}
|
||||
}
|
||||
return retVal, err
|
||||
}, retVal.Stores)
|
||||
task.Run()
|
||||
task.GetResult(0)
|
||||
}
|
||||
// if mapLimit {
|
||||
// retVal.TotalCount = len(retVal.Stores)
|
||||
|
||||
@@ -34,7 +34,7 @@ func GetStoreUsers(ctx *jxcontext.Context, storeID int) (storeUserInfos []*dao.S
|
||||
WHERE t1.parentid = -1 AND t1.jxstoreid = ?
|
||||
GROUP BY 1,2,3,4,5,6,7;
|
||||
`
|
||||
globals.SugarLogger.Debug(sql)
|
||||
// globals.SugarLogger.Debug(sql)
|
||||
if err = dao.GetRows(nil, &storeUserInfos, sql, storeID); err == nil {
|
||||
for _, storeUserInfo := range storeUserInfos {
|
||||
if storeUserInfo.MembersStr != "" {
|
||||
@@ -111,6 +111,7 @@ func BindMobile2Store(ctx *jxcontext.Context, mobile string, storeID int) (num i
|
||||
dao.Commit(db)
|
||||
}
|
||||
} else {
|
||||
// globals.SugarLogger.Debug(utils.Format4Output(user, false))
|
||||
dao.WrapAddIDCULEntity(user, ctx.GetUserName())
|
||||
user.ParentID = -1
|
||||
if err = dao.CreateWeiXins(db, user); err == nil {
|
||||
|
||||
@@ -18,6 +18,9 @@ mtwmCallbackURL = "http://callback.jxc4.com"
|
||||
|
||||
autonaviKey = "4427170f870af2110becb8852d36ab08"
|
||||
|
||||
baidunaviAK = "eL94zToVOdGDTkNQxV8dnEQ1ZRcB2UKb"
|
||||
baidunaviSK = "ZG0OOpOsOVURUwAkkmoHQFKRCbzn0zGb"
|
||||
|
||||
disableElm = true
|
||||
disableWeimob = true
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ import (
|
||||
|
||||
"git.rosy.net.cn/baseapi/platformapi"
|
||||
"git.rosy.net.cn/baseapi/platformapi/autonavi"
|
||||
"git.rosy.net.cn/baseapi/platformapi/baidunavi"
|
||||
"git.rosy.net.cn/baseapi/platformapi/dadaapi"
|
||||
"git.rosy.net.cn/baseapi/platformapi/dingdingapi"
|
||||
"git.rosy.net.cn/baseapi/platformapi/ebaiapi"
|
||||
@@ -42,6 +43,7 @@ var (
|
||||
WeixinPageAPI *weixinapi.API // 用户微信扫码登录
|
||||
|
||||
AutonaviAPI *autonavi.API
|
||||
BaiDuNaviAPI *baidunavi.API
|
||||
QiniuAPI *qbox.Mac
|
||||
ShowAPI *showapi.API
|
||||
WeimobAPI *weimobapi.API
|
||||
@@ -138,6 +140,7 @@ func Init() {
|
||||
WeixinPageAPI = weixinapi.New(beego.AppConfig.String("weixinPageAppID"), beego.AppConfig.String("weixinPageSecret"))
|
||||
|
||||
AutonaviAPI = autonavi.New(beego.AppConfig.String("autonaviKey"))
|
||||
BaiDuNaviAPI = baidunavi.New(beego.AppConfig.String("baidunaviAK"), beego.AppConfig.String("baidunaviSK"))
|
||||
QiniuAPI = qbox.NewMac(beego.AppConfig.String("qiniuAK"), beego.AppConfig.String("qiniuSK"))
|
||||
ShowAPI = showapi.New(beego.AppConfig.DefaultInt("showAppID", 0), beego.AppConfig.DefaultString("showAppSecret", ""))
|
||||
Cacher = redis.New(beego.AppConfig.DefaultString("redisHost", "localhost"), beego.AppConfig.DefaultInt("redisPort", 0), beego.AppConfig.DefaultString("redisPassword", ""))
|
||||
|
||||
Reference in New Issue
Block a user