每日订单打款测试,2020-02-13 9.30

This commit is contained in:
苏尹岚
2020-02-13 09:25:57 +08:00
parent 68e690f6db
commit e46e86396c
2 changed files with 13 additions and 6 deletions

View File

@@ -6,6 +6,8 @@ import (
"sync"
"time"
"git.rosy.net.cn/jx-callback/business/partner/purchase/jx/localjx"
"git.rosy.net.cn/jx-callback/business/jxstore/event"
"git.rosy.net.cn/jx-callback/business/jxstore/report"
@@ -91,6 +93,9 @@ var (
sendSecKillWarnList = []string{
"9:00:00",
}
autoPayForPopluarManList = []string{
"9:30:00",
}
autoSaleStoreSkuTimeList = []string{
cms.AutoSaleAtStr,
@@ -170,6 +175,9 @@ func Init() {
ScheduleTimerFunc("每日报警心跳", func() {
globals.SugarLogger.Warnf("每日报警心跳,这不是报警。启动时间:%s", cms.GetServiceInfo(jxcontext.AdminCtx)["startupTime"])
}, dailyHeartbeat)
ScheduleTimerFunc("AutoPayForPopluarMan", func() {
localjx.AutoPayForPopluarMan(jxcontext.AdminCtx)
}, autoPayForPopluarManList)
}
ScheduleTimerFunc("AutoSaleStoreSku", func() {
cms.AutoSaleStoreSku(jxcontext.AdminCtx, nil, false)

View File

@@ -656,14 +656,14 @@ func PayForPopluarMan(ctx *jxcontext.Context, vendorOrderID, userID string, pric
//自动打款给市场推广人
func AutoPayForPopluarMan(ctx *jxcontext.Context) (err error) {
var (
errMsg string
db = dao.GetDB()
fromDateStr = time.Now().AddDate(0, 0, -1).Format("2006-1-2") + " 00:00:00"
toDateStr = time.Now().AddDate(0, 0, -1).Format("2006-1-2") + " 23:59:59"
fromDateStr = time.Now().AddDate(0, 0, -2).Format("2006-1-2") + " 00:00:00"
toDateStr = time.Now().AddDate(0, 0, -2).Format("2006-1-2") + " 23:59:59"
)
result, err := dao.GetOrdersForJxPay(db, utils.Str2Time(fromDateStr), utils.Str2Time(toDateStr))
for _, goods := range result {
var (
errMsg string
param = &wxpayapi.TransfersParam{
CheckName: wxpayapi.CheckName,
PartnerTradeNo: goods.VendorOrderID,
@@ -713,9 +713,8 @@ func AutoPayForPopluarMan(ctx *jxcontext.Context) (err error) {
}
}
user, _ := dao.GetUserByID(dao.GetDB(), "mobile", "18160030913")
noticeMsg := err.Error()
if user != nil && err != nil {
ddmsg.SendUserMessage(dingdingapi.MsgTyeText, user.UserID, "每日打款错误", noticeMsg)
if user != nil && errMsg != "" {
ddmsg.SendUserMessage(dingdingapi.MsgTyeText, user.UserID, "每日打款错误", errMsg)
}
return err
}