...
|
...
|
@@ -3,6 +3,7 @@ package service |
|
|
import (
|
|
|
"errors"
|
|
|
"fmt"
|
|
|
"strconv"
|
|
|
"strings"
|
|
|
"time"
|
|
|
|
...
|
...
|
@@ -1676,3 +1677,51 @@ func (srv *SummaryEvaluationService) editEvaluationValue( |
|
|
}
|
|
|
return nil
|
|
|
}
|
|
|
|
|
|
// 获取现在待执行的综合自评
|
|
|
func (srv *SummaryEvaluationService) ListExecutorNowEvaluationSelf(param *command.QueryExecutorEvaluationList) (map[string]interface{}, error) {
|
|
|
transactionContext, err := factory.CreateTransactionContext(nil)
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
|
|
|
}
|
|
|
if err := transactionContext.StartTransaction(); err != nil {
|
|
|
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
|
|
|
}
|
|
|
defer func() {
|
|
|
_ = transactionContext.RollbackTransaction()
|
|
|
}()
|
|
|
evaluationRepo := factory.CreateSummaryEvaluationRepository(map[string]interface{}{
|
|
|
"transactionContext": transactionContext,
|
|
|
})
|
|
|
condition1 := map[string]interface{}{
|
|
|
"types": int(domain.EvaluationSelf),
|
|
|
"targetUserId": param.ExecutorId,
|
|
|
"limit": 20,
|
|
|
"beginTime": time.Now(),
|
|
|
"endTime": time.Now(),
|
|
|
"status": string(domain.EvaluationUncompleted),
|
|
|
}
|
|
|
//获取评估列表信息
|
|
|
cnt, evaluationList, err := evaluationRepo.Find(condition1)
|
|
|
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())
|
|
|
}
|
|
|
|
|
|
listResult := []map[string]string{}
|
|
|
for _, v := range evaluationList {
|
|
|
item := map[string]string{
|
|
|
"summaryEvaluationId": strconv.Itoa(v.Id),
|
|
|
"cycleId": strconv.Itoa(int(v.CycleId)),
|
|
|
"cycleName": v.CycleName,
|
|
|
"evaluationStatus": string(v.Status),
|
|
|
"endTime": v.EndTime.Local().Format("2006-01-02 15:04:05"),
|
|
|
"beginTime": v.BeginTime.Local().Format("2006-01-02 15:04:05"),
|
|
|
}
|
|
|
listResult = append(listResult, item)
|
|
|
}
|
|
|
result := tool_funs.SimpleWrapGridMap(int64(cnt), listResult)
|
|
|
return result, nil
|
|
|
} |
...
|
...
|
|