...
|
...
|
@@ -294,7 +294,7 @@ func (srv *SummaryEvaluationServeice) GetEvaluationSelf(param *command.QueryEval |
|
|
evaluationItemRepo := factory.CreateEvaluationItemUsedRepository(map[string]interface{}{
|
|
|
"transactionContext": transactionContext,
|
|
|
})
|
|
|
itemValueRepo := factory.CreateSummaryEvaluationRepository(map[string]interface{}{
|
|
|
itemValueRepo := factory.CreateSummaryEvaluationValueRepository(map[string]interface{}{
|
|
|
"transactionContext": transactionContext,
|
|
|
})
|
|
|
_, evaluationList, err := evaluationRepo.Find(map[string]interface{}{
|
...
|
...
|
@@ -313,20 +313,42 @@ func (srv *SummaryEvaluationServeice) GetEvaluationSelf(param *command.QueryEval |
|
|
_, itemList, err := evaluationItemRepo.Find(map[string]interface{}{
|
|
|
"evaluationProjectId": evaluationData.EvaluationProjectId,
|
|
|
"nodeType": int(domain.LinkNodeSelfAssessment),
|
|
|
"limit": 300,
|
|
|
})
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
}
|
|
|
|
|
|
_, itemValues, err := itemValueRepo.Find(map[string]interface{}{
|
|
|
"summaryEvaluationId": evaluationData.Id,
|
|
|
})
|
|
|
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
}
|
|
|
|
|
|
if err := transactionContext.CommitTransaction(); err != nil {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
}
|
|
|
_ = itemList
|
|
|
_ = itemValueRepo
|
|
|
return nil, nil
|
|
|
|
|
|
itemValuesAdapter := srv.buildSummaryItemValue(itemList, itemValues)
|
|
|
result := adapter.EvaluationInfoAdapter{
|
|
|
SummaryEvaluationId: evaluationData.Id,
|
|
|
CycleId: int(evaluationData.CycleId),
|
|
|
CycleName: evaluationData.CycleName,
|
|
|
EvaluationProjectId: evaluationData.EvaluationProjectId,
|
|
|
EvaluationProjectName: evaluationData.EvaluationProjectName,
|
|
|
LinkNodeId: evaluationData.NodeId,
|
|
|
BeginTime: evaluationData.BeginTime.Format("2006-01-02 15:04:05"),
|
|
|
EndTime: evaluationData.EndTime.Format("2006-01-02 15:04:05"),
|
|
|
Status: string(evaluationData.Status),
|
|
|
EvaluationItems: itemValuesAdapter,
|
|
|
}
|
|
|
return &result, nil
|
|
|
}
|
|
|
|
|
|
// 编辑综合自评详情
|
|
|
func (srv *SummaryEvaluationServeice) EditEvaluationSelf() (map[string][]adapter.EvaluationItemAdapter, error) {
|
|
|
func (srv *SummaryEvaluationServeice) EditEvaluationSelf(param *command.EditEvaluationValue) (map[string][]adapter.EvaluationItemAdapter, error) {
|
|
|
transactionContext, err := factory.CreateTransactionContext(nil)
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
|
...
|
...
|
@@ -337,7 +359,33 @@ func (srv *SummaryEvaluationServeice) EditEvaluationSelf() (map[string][]adapter |
|
|
defer func() {
|
|
|
_ = transactionContext.RollbackTransaction()
|
|
|
}()
|
|
|
evaluationRepo := factory.CreateSummaryEvaluationRepository(map[string]interface{}{
|
|
|
"transactionContext": transactionContext,
|
|
|
})
|
|
|
itemUsedRepo := factory.CreateEvaluationItemUsedRepository(map[string]interface{}{
|
|
|
"transactionContext": transactionContext,
|
|
|
})
|
|
|
|
|
|
itemValueRepo := factory.CreateSummaryEvaluationValueRepository(map[string]interface{}{
|
|
|
"transactionContext": transactionContext,
|
|
|
})
|
|
|
evaluationData, err := evaluationRepo.FindOne(map[string]interface{}{
|
|
|
"id": param.SummaryEvaluationId,
|
|
|
})
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
}
|
|
|
|
|
|
_, itemList, err := itemUsedRepo.Find(map[string]interface{}{
|
|
|
"evaluationProjectId": int(domain.LinkNodeSelfAssessment),
|
|
|
"limit": 300,
|
|
|
})
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
}
|
|
|
_ = itemValueRepo
|
|
|
_ = evaluationData
|
|
|
_ = itemList
|
|
|
if err := transactionContext.CommitTransaction(); err != nil {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
}
|
...
|
...
|
|