|
@@ -176,7 +176,8 @@ func (rs *EvaluationProjectService) UpdateTemplate(in *command.UpdateProjectTemp |
|
@@ -176,7 +176,8 @@ func (rs *EvaluationProjectService) UpdateTemplate(in *command.UpdateProjectTemp |
|
176
|
}
|
176
|
}
|
|
177
|
|
177
|
|
|
178
|
now := time.Now().Local()
|
178
|
now := time.Now().Local()
|
|
179
|
- nowO := time.Date(now.Year(), now.Month(), now.Day(), 0, 0, 0, 0, time.Local) // 当前时间0点0分0秒时刻
|
179
|
+ year, month, day := now.Date()
|
|
|
|
180
|
+ nowO := time.Date(year, month, day, 0, 0, 0, 0, time.Local) // 当前时间0点0分0秒时刻
|
|
180
|
|
181
|
|
|
181
|
for i := range tasks {
|
182
|
for i := range tasks {
|
|
182
|
task := tasks[i]
|
183
|
task := tasks[i]
|
|
@@ -191,7 +192,7 @@ func (rs *EvaluationProjectService) UpdateTemplate(in *command.UpdateProjectTemp |
|
@@ -191,7 +192,7 @@ func (rs *EvaluationProjectService) UpdateTemplate(in *command.UpdateProjectTemp |
|
191
|
endLocal := task.TimeEnd.Local()
|
192
|
endLocal := task.TimeEnd.Local()
|
|
192
|
|
193
|
|
|
193
|
// 在当前时间之前,则计算下一个周期时间
|
194
|
// 在当前时间之前,则计算下一个周期时间
|
|
194
|
- if startLocal.Before(now) {
|
195
|
+ if startLocal.Before(nowO) {
|
|
195
|
nextTime := utils.NextTime(nowO, startLocal, task.KpiCycle)
|
196
|
nextTime := utils.NextTime(nowO, startLocal, task.KpiCycle)
|
|
196
|
task.NextSentAt = &nextTime
|
197
|
task.NextSentAt = &nextTime
|
|
197
|
} else {
|
198
|
} else {
|
|
@@ -460,7 +461,8 @@ func (rs *EvaluationProjectService) Activate(in *command.ActivateProjectCommand) |
|
@@ -460,7 +461,8 @@ func (rs *EvaluationProjectService) Activate(in *command.ActivateProjectCommand) |
|
460
|
}
|
461
|
}
|
|
461
|
|
462
|
|
|
462
|
now := time.Now().Local()
|
463
|
now := time.Now().Local()
|
|
463
|
- nowO := time.Date(now.Year(), now.Month(), now.Day(), 0, 0, 0, 0, time.Local) // 当前时间0点0分0秒时刻
|
464
|
+ year, month, day := now.Date()
|
|
|
|
465
|
+ nowO := time.Date(year, month, day, 0, 0, 0, 0, time.Local) // 当前时间0点0分0秒时刻
|
|
464
|
|
466
|
|
|
465
|
for i := range project.Template.LinkNodes {
|
467
|
for i := range project.Template.LinkNodes {
|
|
466
|
node := project.Template.LinkNodes[i]
|
468
|
node := project.Template.LinkNodes[i]
|
|
@@ -486,7 +488,7 @@ func (rs *EvaluationProjectService) Activate(in *command.ActivateProjectCommand) |
|
@@ -486,7 +488,7 @@ func (rs *EvaluationProjectService) Activate(in *command.ActivateProjectCommand) |
|
486
|
endLocal := task.TimeEnd.Local()
|
488
|
endLocal := task.TimeEnd.Local()
|
|
487
|
|
489
|
|
|
488
|
// 在当前时间之前,则计算下一个周期时间
|
490
|
// 在当前时间之前,则计算下一个周期时间
|
|
489
|
- if startLocal.Before(now) {
|
491
|
+ if startLocal.Before(nowO) {
|
|
490
|
nextTime := utils.NextTime(nowO, startLocal, node.KpiCycle)
|
492
|
nextTime := utils.NextTime(nowO, startLocal, node.KpiCycle)
|
|
491
|
task.NextSentAt = &nextTime
|
493
|
task.NextSentAt = &nextTime
|
|
492
|
} else {
|
494
|
} else {
|