...
|
...
|
@@ -102,6 +102,7 @@ func (rs *EvaluationCycleService) Create(in *command.CreateCycleCommand) (interf |
|
|
cycleTemplate := &domain.EvaluationCycleTemplate{
|
|
|
Id: 0,
|
|
|
Name: v.Name,
|
|
|
TemplateCreatedAt: v.CreatedAt,
|
|
|
Template: v,
|
|
|
CycleId: cycle.Id,
|
|
|
}
|
...
|
...
|
@@ -114,7 +115,7 @@ func (rs *EvaluationCycleService) Create(in *command.CreateCycleCommand) (interf |
|
|
ctAdapter.TemplateSimples = append(ctAdapter.TemplateSimples, &domain.TemplateSimple{
|
|
|
Id: cycleTemplate.Id,
|
|
|
Name: cycleTemplate.Name,
|
|
|
CreatedAt: cycleTemplate.CreatedAt,
|
|
|
CreatedAt: cycleTemplate.TemplateCreatedAt, // 模板创建时间
|
|
|
})
|
|
|
}
|
|
|
|
...
|
...
|
@@ -190,6 +191,7 @@ func (rs *EvaluationCycleService) Update(in *command.UpdateCycleCommand) (interf |
|
|
cycleTemplate := &domain.EvaluationCycleTemplate{
|
|
|
Id: 0,
|
|
|
Name: v.Name,
|
|
|
TemplateCreatedAt: v.CreatedAt,
|
|
|
Template: v,
|
|
|
CycleId: cycle.Id,
|
|
|
}
|
...
|
...
|
@@ -220,7 +222,7 @@ func (rs *EvaluationCycleService) Update(in *command.UpdateCycleCommand) (interf |
|
|
ctAdapter.TemplateSimples = append(ctAdapter.TemplateSimples, &domain.TemplateSimple{
|
|
|
Id: cycleTemplates[i].Id,
|
|
|
Name: cycleTemplates[i].Name,
|
|
|
CreatedAt: cycleTemplates[i].CreatedAt,
|
|
|
CreatedAt: cycleTemplates[i].TemplateCreatedAt,
|
|
|
})
|
|
|
}
|
|
|
|
...
|
...
|
@@ -257,7 +259,7 @@ func (rs *EvaluationCycleService) Get(in *command.GetCycleCommand) (interface{}, |
|
|
ctAdapter.TemplateSimples = append(ctAdapter.TemplateSimples, &domain.TemplateSimple{
|
|
|
Id: cycleTemplates[i].Id,
|
|
|
Name: cycleTemplates[i].Name,
|
|
|
CreatedAt: cycleTemplates[i].CreatedAt,
|
|
|
CreatedAt: cycleTemplates[i].TemplateCreatedAt,
|
|
|
})
|
|
|
}
|
|
|
|
...
|
...
|
@@ -361,3 +363,30 @@ func (rs *EvaluationCycleService) StatisticCycleUser(in *command.StatisticCycleP |
|
|
}
|
|
|
return map[string]interface{}{"userTotal": userTotal, "departmentTotal": departmentTotal}, nil
|
|
|
}
|
|
|
|
|
|
func (rs *EvaluationCycleService) CycleTemplateList(in *command.CycleTemplateCommand) (interface{}, error) {
|
|
|
transactionContext, err := factory.ValidateStartTransaction(in)
|
|
|
if err != nil {
|
|
|
return nil, err
|
|
|
}
|
|
|
defer func() {
|
|
|
transactionContext.RollbackTransaction()
|
|
|
}()
|
|
|
|
|
|
cycleTemplateRepository := factory.CreateEvaluationCycleTemplateRepository(map[string]interface{}{"transactionContext": transactionContext})
|
|
|
_, cycleTemplates, err := cycleTemplateRepository.Find(map[string]interface{}{"cycleId": in.CycleId}, "template")
|
|
|
|
|
|
list := make([]*domain.TemplateSimple, 0)
|
|
|
for i := range cycleTemplates {
|
|
|
list = append(list, &domain.TemplateSimple{
|
|
|
Id: cycleTemplates[i].Id,
|
|
|
Name: cycleTemplates[i].Name,
|
|
|
CreatedAt: cycleTemplates[i].TemplateCreatedAt,
|
|
|
})
|
|
|
}
|
|
|
|
|
|
if err := transactionContext.CommitTransaction(); err != nil {
|
|
|
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
|
|
|
}
|
|
|
return map[string]interface{}{"list": list}, nil
|
|
|
} |
...
|
...
|
|