|
@@ -365,7 +365,7 @@ func (rs *EvaluationProjectService) Remove(in *command.DeleteProjectCommand) (in |
|
@@ -365,7 +365,7 @@ func (rs *EvaluationProjectService) Remove(in *command.DeleteProjectCommand) (in |
365
|
projectRepository := factory.CreateEvaluationProjectRepository(map[string]interface{}{"transactionContext": transactionContext})
|
365
|
projectRepository := factory.CreateEvaluationProjectRepository(map[string]interface{}{"transactionContext": transactionContext})
|
366
|
taskRepository := factory.CreateNodeTaskRepository(map[string]interface{}{"transactionContext": transactionContext})
|
366
|
taskRepository := factory.CreateNodeTaskRepository(map[string]interface{}{"transactionContext": transactionContext})
|
367
|
staffRepository := factory.CreateStaffAssessTaskRepository(map[string]interface{}{"transactionContext": transactionContext})
|
367
|
staffRepository := factory.CreateStaffAssessTaskRepository(map[string]interface{}{"transactionContext": transactionContext})
|
368
|
-
|
368
|
+ summaryRepository := factory.CreateSummaryEvaluationRepository(map[string]interface{}{"transactionContext": transactionContext})
|
369
|
project, err := projectRepository.FindOne(map[string]interface{}{"id": in.Id})
|
369
|
project, err := projectRepository.FindOne(map[string]interface{}{"id": in.Id})
|
370
|
if err != nil {
|
370
|
if err != nil {
|
371
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
371
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
@@ -378,7 +378,10 @@ func (rs *EvaluationProjectService) Remove(in *command.DeleteProjectCommand) (in |
|
@@ -378,7 +378,10 @@ func (rs *EvaluationProjectService) Remove(in *command.DeleteProjectCommand) (in |
378
|
if err := staffRepository.RemoveByProjectId(int(project.Id)); err != nil {
|
378
|
if err := staffRepository.RemoveByProjectId(int(project.Id)); err != nil {
|
379
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
379
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
380
|
}
|
380
|
}
|
381
|
-
|
381
|
+ // 删除项目已生成的周期评估数据
|
|
|
382
|
+ if err := summaryRepository.RemoveByProjectId(int(project.Id)); err != nil {
|
|
|
383
|
+ return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
384
|
+ }
|
382
|
// 移除项目关联的所有定时任务
|
385
|
// 移除项目关联的所有定时任务
|
383
|
tasks, err := taskRepository.Find(map[string]interface{}{"projectId": project.Id})
|
386
|
tasks, err := taskRepository.Find(map[string]interface{}{"projectId": project.Id})
|
384
|
if err != nil {
|
387
|
if err != nil {
|