作者 郑周

1. 优化启动任务

@@ -589,6 +589,11 @@ func (rs *EvaluationProjectService) Activate(in *command.ActivateProjectCommand) @@ -589,6 +589,11 @@ func (rs *EvaluationProjectService) Activate(in *command.ActivateProjectCommand)
589 principalId = intId 589 principalId = intId
590 } 590 }
591 591
  592 + tasks, err := taskRepository.Find(map[string]interface{}{"projectId": project.Id})
  593 + if err != nil {
  594 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
  595 + }
  596 + if len(tasks) == 0 {
592 now := time.Now().Local() 597 now := time.Now().Local()
593 year, month, day := now.Date() 598 year, month, day := now.Date()
594 nowO := time.Date(year, month, day, 0, 0, 0, 0, time.Local) // 当前时间0点0分0秒时刻 599 nowO := time.Date(year, month, day, 0, 0, 0, 0, time.Local) // 当前时间0点0分0秒时刻
@@ -654,6 +659,7 @@ func (rs *EvaluationProjectService) Activate(in *command.ActivateProjectCommand) @@ -654,6 +659,7 @@ func (rs *EvaluationProjectService) Activate(in *command.ActivateProjectCommand)
654 if err != nil { 659 if err != nil {
655 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) 660 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
656 } 661 }
  662 + }
657 663
658 if err := transactionContext.CommitTransaction(); err != nil { 664 if err := transactionContext.CommitTransaction(); err != nil {
659 return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) 665 return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())