抖音授权登录,小程序门店切换,门店状态改变日志打印!

This commit is contained in:
邹宗楠
2022-04-15 18:09:48 +08:00
parent 852a4f555d
commit df304dcc81
13 changed files with 110 additions and 77 deletions

View File

@@ -6,6 +6,7 @@ import (
"encoding/json"
"errors"
"fmt"
"git.rosy.net.cn/jx-callback/business/jxstore/event"
"io"
"math"
"mime/multipart"
@@ -537,6 +538,7 @@ func GetStores(ctx *jxcontext.Context, keyword string, params map[string]interfa
}
} else {
//storeIDs2 = append(storeIDs2, -1)
// 商家小程序用户切换门店,如果角色storeIDsMap没有数据则查询传入数据
storeIDs2 = append(storeIDs2, int(utils.Interface2Int64WithDefault(params["storeID"], 0)))
}
}
@@ -5262,11 +5264,17 @@ func UpdateOrCreateCourierStoresByBrand(ctx *jxcontext.Context, brandID, vendorI
return hint, err
}
//StoreStatusDisabled = -2
//StoreStatusClosed = -1
//StoreStatusHaveRest = 0
//StoreStatusOpened = 1
// 定时任务更新门店信息,添加storeStatuss参数,只查询和同步营业的门店 1营业0临时休息-1休息-2禁用
func RefreshStoreIsOnline(ctx *jxcontext.Context) (err error) {
var (
db = dao.GetDB()
)
stores, _ := dao.GetStoresMapList(db, []int{model.VendorIDMTWM, model.VendorIDJD, model.VendorIDEBAI}, nil, nil, model.StoreStatusAll, model.StoreIsSyncAll, "", "", "")
stores, _ := dao.GetStoresMapList(db, []int{model.VendorIDMTWM, model.VendorIDJD, model.VendorIDEBAI}, nil, []int{model.StoreStatusOpened, model.StoreStatusHaveRest}, model.StoreStatusAll, model.StoreIsSyncAll, "", "", "")
task := tasksch.NewParallelTask("RefreshStoreBind", tasksch.NewParallelConfig().SetIsContinueWhenError(true), ctx,
func(task *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (retVal interface{}, err error) {
storeMap := batchItemList[0].(*model.StoreMap)
@@ -5278,6 +5286,8 @@ func RefreshStoreIsOnline(ctx *jxcontext.Context) (err error) {
storeMap.IsOnline = -1
}
dao.UpdateEntity(db, storeMap, "IsOnline")
store := fmt.Sprintf("门店id:%d,门店名称:%s,第三方门店状态:%d,本地门店修改后状态:%d,第三方平台Id(美团,饿了么...):%d", store.Store.ID, store.Store.Name, store.Store.Status, storeMap.IsOnline, storeMap.VendorID)
event.AddOperateEvent(ctx, ctx.GetTrackInfo(), store, err.Error(), "", int(time.Now().UnixNano()/1000), "UpdateStore")
}
}
return retVal, err

View File

@@ -2,6 +2,7 @@ package misc
import (
"fmt"
"git.rosy.net.cn/jx-callback/business/partner/delivery"
"sync"
"time"
@@ -388,7 +389,7 @@ func Init() {
})
// 每五分钟轮询一次推送骑手信息坐标给美团
ScheduleTimerFuncByInterval(func() {
//delivery.GetOrderRiderInfoToPlatform("")
delivery.GetOrderRiderInfoToPlatform("")
}, 10*time.Second, 5*time.Minute)
}
if configs, err := dao.QueryConfigs(dao.GetDB(), "ebaiStorePageCookie", model.ConfigTypeCookie, ""); err == nil {