|
@@ -270,7 +270,18 @@ var EdbTaskRunNum int
|
|
|
|
|
|
// AddEdbTask 新增手工指标数据录入提醒
|
|
|
func AddEdbTask(cont context.Context) (err error) {
|
|
|
- //func AddEdbTask() (err error) {
|
|
|
+ //失败列表
|
|
|
+ failList := make([]string, 0)
|
|
|
+
|
|
|
+ defer func() {
|
|
|
+ if len(failList) > 0 {
|
|
|
+ fmt.Println("提醒失败:")
|
|
|
+ for _, v := range failList {
|
|
|
+ fmt.Println(v)
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ }()
|
|
|
list, err := models.GetEdbInfoByFrequencyNotDay()
|
|
|
if err != nil {
|
|
|
fmt.Println("查询获取频度非日度 且 提醒时间不为空 的指标数据失败,Err:", err.Error())
|
|
@@ -304,9 +315,6 @@ func AddEdbTask(cont context.Context) (err error) {
|
|
|
nowYearFirstDay := utils.GetNowYearFirstDay()
|
|
|
nowYearLastDay := utils.GetNowYearLastDay()
|
|
|
|
|
|
- //失败列表
|
|
|
- failList := make([]string, 0)
|
|
|
-
|
|
|
debugNoticeUserId := 0 //测试环境,需要发送消息的用户
|
|
|
if utils.RunMode == "debug" {
|
|
|
tmpWxUser, tmpErr := models.GetWxUserByMobile("17634786714")
|
|
@@ -432,7 +440,7 @@ func AddEdbTask(cont context.Context) (err error) {
|
|
|
|
|
|
if isNotice {
|
|
|
taskName := "edb_task_" + todayStr + ":" + fmt.Sprint(edb.TradeCode)
|
|
|
- fmt.Println(taskName, ";", edb.SecName)
|
|
|
+ //fmt.Println(taskName, ";", edb.SecName)
|
|
|
|
|
|
//定时任务
|
|
|
tmpTaskFunc := func(ctx context.Context) (funcErr error) {
|
|
@@ -556,7 +564,7 @@ func AddEdbTask(cont context.Context) (err error) {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- fmt.Println(tmpEdb.TradeCode, " funcIsNotice:", funcIsNotice)
|
|
|
+ //fmt.Println(tmpEdb.TradeCode, " funcIsNotice:", funcIsNotice)
|
|
|
//如果还是要提醒
|
|
|
if funcIsNotice {
|
|
|
//用户微信openid列表数据
|
|
@@ -659,10 +667,6 @@ func AddEdbTask(cont context.Context) (err error) {
|
|
|
}
|
|
|
//手工指标定时任务开始次数累加
|
|
|
EdbTaskRunNum++
|
|
|
-
|
|
|
- for _, v := range failList {
|
|
|
- fmt.Println(v)
|
|
|
- }
|
|
|
return
|
|
|
//fmt.Println(task.NewMapSorter())
|
|
|
}
|