|
@@ -90,23 +90,18 @@ func (notices notifyConfirmEvaluationScore) ifSend(index int) (bool, error) { |
|
@@ -90,23 +90,18 @@ func (notices notifyConfirmEvaluationScore) ifSend(index int) (bool, error) { |
90
|
}
|
90
|
}
|
91
|
|
91
|
|
92
|
// 输入的时间为基础微调短信的执行时间
|
92
|
// 输入的时间为基础微调短信的执行时间
|
93
|
-// 适配规则 :(23:00-7:00期间不提醒)
|
93
|
+// 适配规则 :每隔6个小时进行提醒(23:00-7:00期间不提醒)
|
94
|
func (notices notifyConfirmEvaluationScore) getTimeExecuteAt(nowTime time.Time) time.Time {
|
94
|
func (notices notifyConfirmEvaluationScore) getTimeExecuteAt(nowTime time.Time) time.Time {
|
95
|
nowHour := nowTime.Local().Hour()
|
95
|
nowHour := nowTime.Local().Hour()
|
96
|
- if nowHour < 23 && nowHour > 7 {
|
96
|
+ if nowHour < 23 && nowHour >= 7 {
|
97
|
return nowTime
|
97
|
return nowTime
|
98
|
}
|
98
|
}
|
99
|
- year, month, day := nowTime.Local().Date()
|
|
|
100
|
- //微调执行时间
|
|
|
101
|
- if nowHour >= 23 {
|
|
|
102
|
- //第二天:7:00
|
|
|
103
|
- t1 := time.Date(year, month, day, 23, 59, 59, 0, time.Local)
|
|
|
104
|
- return t1.Add(7 * time.Hour)
|
99
|
+ t1 := nowTime.Add(6 * time.Hour)
|
|
|
100
|
+ hour1 := t1.Local().Hour()
|
|
|
101
|
+ if hour1 < 23 && hour1 >= 7 {
|
|
|
102
|
+ return t1
|
105
|
}
|
103
|
}
|
106
|
- if nowHour <= 7 {
|
|
|
107
|
- //当天 7:00
|
|
|
108
|
- t1 := time.Date(year, month, day, 0, 0, 0, 0, time.Local)
|
|
|
109
|
- return t1.Add(7 * time.Hour)
|
|
|
110
|
- }
|
|
|
111
|
- return nowTime
|
104
|
+
|
|
|
105
|
+ return t1.Add(6 * time.Hour)
|
|
|
106
|
+
|
112
|
} |
107
|
} |