|
@@ -313,6 +313,7 @@ func (rs *EvaluationCycleService) Remove(in *command.DeleteCycleCommand) (interf |
|
@@ -313,6 +313,7 @@ func (rs *EvaluationCycleService) Remove(in *command.DeleteCycleCommand) (interf |
313
|
cycleTemplateRepository := factory.CreateEvaluationCycleTemplateRepository(map[string]interface{}{"transactionContext": transactionContext})
|
313
|
cycleTemplateRepository := factory.CreateEvaluationCycleTemplateRepository(map[string]interface{}{"transactionContext": transactionContext})
|
314
|
projectRepository := factory.CreateEvaluationProjectRepository(map[string]interface{}{"transactionContext": transactionContext})
|
314
|
projectRepository := factory.CreateEvaluationProjectRepository(map[string]interface{}{"transactionContext": transactionContext})
|
315
|
taskRepository := factory.CreateNodeTaskRepository(map[string]interface{}{"transactionContext": transactionContext})
|
315
|
taskRepository := factory.CreateNodeTaskRepository(map[string]interface{}{"transactionContext": transactionContext})
|
|
|
316
|
+ staffRepository := factory.CreateStaffAssessTaskRepository(map[string]interface{}{"transactionContext": transactionContext})
|
316
|
|
317
|
|
317
|
// 删除周期
|
318
|
// 删除周期
|
318
|
cycle, err := cycleRepository.FindOne(map[string]interface{}{"id": in.Id})
|
319
|
cycle, err := cycleRepository.FindOne(map[string]interface{}{"id": in.Id})
|
|
@@ -337,9 +338,14 @@ func (rs *EvaluationCycleService) Remove(in *command.DeleteCycleCommand) (interf |
|
@@ -337,9 +338,14 @@ func (rs *EvaluationCycleService) Remove(in *command.DeleteCycleCommand) (interf |
337
|
if _, err := projectRepository.Remove(projects[i]); err != nil {
|
338
|
if _, err := projectRepository.Remove(projects[i]); err != nil {
|
338
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
339
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
339
|
}
|
340
|
}
|
|
|
341
|
+
|
|
|
342
|
+ // 删除项目已生成的周期评估数据
|
|
|
343
|
+ if err := staffRepository.RemoveByProjectId(int(projects[i].Id)); err != nil {
|
|
|
344
|
+ return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
345
|
+ }
|
340
|
}
|
346
|
}
|
341
|
|
347
|
|
342
|
- // 删除周期下的所有任务
|
348
|
+ // 删除周期下的所有定时任务
|
343
|
tasks, err := taskRepository.Find(map[string]interface{}{"cycleId": in.Id})
|
349
|
tasks, err := taskRepository.Find(map[string]interface{}{"cycleId": in.Id})
|
344
|
if err != nil {
|
350
|
if err != nil {
|
345
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
351
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|