...
|
...
|
@@ -198,8 +198,8 @@ func (rs *EvaluationProjectService) UpdateTemplate(in *command.UpdateProjectTemp |
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
}
|
|
|
|
|
|
minTime := time.Date(cycle.TimeStart.Year(), cycle.TimeStart.Month(), cycle.TimeStart.Day(), cycle.TimeStart.Hour(), cycle.TimeStart.Minute(), 0, 0, time.Local)
|
|
|
maxTime := time.Date(cycle.TimeEnd.Year(), cycle.TimeEnd.Month(), cycle.TimeEnd.Day(), cycle.TimeEnd.Hour(), cycle.TimeEnd.Minute(), 0, 0, time.Local)
|
|
|
minTime := cycle.TimeStart.Local()
|
|
|
maxTime := cycle.TimeEnd.Local()
|
|
|
|
|
|
if start.Before(minTime) {
|
|
|
return nil, application.ThrowError(application.BUSINESS_ERROR, "评估起始时间不能超出周期起始时间")
|
...
|
...
|
@@ -393,15 +393,20 @@ func (rs *EvaluationProjectService) Activate(in *command.ActivateProjectCommand) |
|
|
TimeEnd: node.TimeEnd,
|
|
|
KpiCycle: node.KpiCycle,
|
|
|
}
|
|
|
|
|
|
// 环节起始和截止本地时间
|
|
|
startLocal := node.TimeStart.Local()
|
|
|
endLocal := node.TimeEnd.Local()
|
|
|
|
|
|
// 在当前时间之前,则计算下一个周期时间
|
|
|
if node.TimeStart.Before(now) {
|
|
|
nextTime := utils.NextTime(nowO, node.TimeStart, node.KpiCycle)
|
|
|
if startLocal.Before(now) {
|
|
|
nextTime := utils.NextTime(nowO, startLocal, node.KpiCycle)
|
|
|
task.NextSentAt = &nextTime
|
|
|
} else {
|
|
|
task.NextSentAt = node.TimeStart
|
|
|
task.NextSentAt = &startLocal
|
|
|
}
|
|
|
// 如果超出截至时间,则周期置空
|
|
|
if task.NextSentAt.After(*node.TimeEnd) {
|
|
|
if task.NextSentAt.After(endLocal) {
|
|
|
task.NextSentAt = nil
|
|
|
}
|
|
|
|
...
|
...
|
|