aa
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package misc
|
||||
|
||||
import (
|
||||
"git.rosy.net.cn/jx-callback/business/jxstore/partner/pdd"
|
||||
"time"
|
||||
|
||||
"git.rosy.net.cn/jx-callback/business/jxstore/event"
|
||||
@@ -24,6 +25,12 @@ var (
|
||||
|
||||
func Init() {
|
||||
if globals.IsProductEnv() {
|
||||
|
||||
//拼多多订单轮询
|
||||
ScheduleTimerFuncByInterval(func() {
|
||||
pdd.GetUnionOrders()
|
||||
}, 5*time.Second, 5*time.Minute)
|
||||
|
||||
ScheduleTimerFunc("doDailyWork", doDailyWork, dailyWorkTimeList)
|
||||
|
||||
ScheduleTimerFunc("InitStation", func() {
|
||||
|
||||
@@ -5,10 +5,14 @@ import (
|
||||
"git.rosy.net.cn/baseapi/platformapi/pddapi"
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
"git.rosy.net.cn/jx-callback/business/jxstore/partner"
|
||||
"git.rosy.net.cn/jx-callback/business/jxutils"
|
||||
"git.rosy.net.cn/jx-callback/business/jxutils/jxcontext"
|
||||
"git.rosy.net.cn/jx-callback/business/jxutils/tasksch"
|
||||
"git.rosy.net.cn/jx-callback/business/model"
|
||||
"git.rosy.net.cn/jx-callback/business/model/dao"
|
||||
"git.rosy.net.cn/jx-callback/globals/api"
|
||||
"strings"
|
||||
"time"
|
||||
)
|
||||
|
||||
var (
|
||||
@@ -181,3 +185,22 @@ func (s *UnionHandler) GetUnionMatterListRcmmd(ctx *jxcontext.Context, goodsID s
|
||||
}
|
||||
return list, err
|
||||
}
|
||||
|
||||
func GetUnionOrders() {
|
||||
var (
|
||||
page = 1
|
||||
pageSize = 50
|
||||
)
|
||||
orders, err := api.PddAPI.OrderListIncrementGet(time.Now().Add(-time.Minute*5).Unix(), time.Now().Unix(), page, pageSize)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
task := tasksch.NewParallelTask("TempJob1", tasksch.NewParallelConfig().SetParallelCount(1).SetIsContinueWhenError(true), ctx,
|
||||
func(task *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (retVal interface{}, err error) {
|
||||
order := batchItemList[0].(*pddapi.OrderListIncrementGetResult)
|
||||
|
||||
return retVal, err
|
||||
}, orders)
|
||||
tasksch.HandleTask(task, nil, true).Run()
|
||||
task.GetResult(0)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user