...
|
...
|
@@ -4,6 +4,7 @@ import ( |
|
|
"fmt"
|
|
|
"sort"
|
|
|
"strconv"
|
|
|
"time"
|
|
|
|
|
|
"github.com/linmadan/egglib-go/core/application"
|
|
|
"github.com/linmadan/egglib-go/utils/tool_funs"
|
...
|
...
|
@@ -373,7 +374,7 @@ func (srv StaffAssessServeice) ListExecutorInviteAssessV2(param *query.ListExecu |
|
|
continue
|
|
|
}
|
|
|
projectIdMap[assessList[i].EvaluationProjectId] = struct{}{}
|
|
|
assessContentListTemp, err := srv.getAssessSelfInfoUncompleted(transactionContext, assessList[i])
|
|
|
assessContentListTemp, err := srv.getAssessInfoUncompletedV2(transactionContext, assessList[i])
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "获取评估任务"+err.Error())
|
|
|
}
|
...
|
...
|
@@ -720,7 +721,7 @@ func (srv StaffAssessServeice) GetAssessSelfInfoV2(param *query.GetExecutorSelfA |
|
|
}
|
|
|
} else if assessData.Status == domain.StaffAssessUncompleted {
|
|
|
//未完成
|
|
|
assessContentList, err = srv.getAssessSelfInfoUncompleted(transactionContext, assessData)
|
|
|
assessContentList, err = srv.getAssessInfoUncompletedV2(transactionContext, assessData)
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "获取项目填写内容"+err.Error())
|
|
|
}
|
...
|
...
|
@@ -795,7 +796,7 @@ func (srv StaffAssessServeice) ListTargetUserInviteAssess(param *query.ListTarge |
|
|
if err := transactionContext.CommitTransaction(); err != nil {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
}
|
|
|
var resultList []map[string]interface{}
|
|
|
resultList := []map[string]interface{}{}
|
|
|
for _, v := range assessList {
|
|
|
item := map[string]interface{}{
|
|
|
"id": v.Id,
|
...
|
...
|
@@ -922,3 +923,65 @@ func (srv StaffAssessServeice) SelectAssessInviteUserV2(param *query.SelectAsses |
|
|
}
|
|
|
return tool_funs.SimpleWrapGridMap(int64(cnt), listData), nil
|
|
|
}
|
|
|
|
|
|
// 获取未完成的员工评估内容
|
|
|
func (srv StaffAssessServeice) getAssessInfoUncompletedV2(transactionContext application.TransactionContext,
|
|
|
assess *domain.StaffAssess) ([]*domain.StaffAssessContent, error) {
|
|
|
evaluationItemRepo := factory.CreateEvaluationItemUsedRepository(map[string]interface{}{
|
|
|
"transactionContext": transactionContext,
|
|
|
})
|
|
|
var evaluationItemList []*domain.EvaluationItemUsed
|
|
|
var err error
|
|
|
_, evaluationItemList, err = evaluationItemRepo.Find(map[string]interface{}{
|
|
|
"evaluationProjectId": assess.EvaluationProjectId,
|
|
|
"nodeId": assess.LinkNodeId,
|
|
|
})
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "获取项目填写内容"+err.Error())
|
|
|
}
|
|
|
if len(evaluationItemList) == 0 {
|
|
|
//如果当前节点没有评估内容,就去 使用自评节点的评估内容
|
|
|
_, evaluationItemList, err = evaluationItemRepo.Find(map[string]interface{}{
|
|
|
"evaluationProjectId": assess.EvaluationProjectId,
|
|
|
"nodeType": domain.LinkNodeSelfAssessment,
|
|
|
})
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "获取自评项目填写内容"+err.Error())
|
|
|
}
|
|
|
}
|
|
|
var contentList []*domain.StaffAssessContent
|
|
|
nowTime := time.Now()
|
|
|
for i, v := range evaluationItemList {
|
|
|
item := &domain.StaffAssessContent{
|
|
|
Id: 0,
|
|
|
StaffAssessId: assess.Id,
|
|
|
SortBy: i + 1,
|
|
|
Category: v.Category,
|
|
|
Name: v.Name,
|
|
|
PromptTitle: v.PromptTitle,
|
|
|
PromptText: v.PromptText,
|
|
|
Remark: nil,
|
|
|
Value: "",
|
|
|
ReteResult: "",
|
|
|
CreatedAt: nowTime,
|
|
|
Weight: v.Weight,
|
|
|
Required: v.Required,
|
|
|
UpdatedAt: nowTime,
|
|
|
DeletedAt: nil,
|
|
|
Rule: v.Rule,
|
|
|
}
|
|
|
var remarks []domain.AssessContemtRemark
|
|
|
for _, vv := range v.EntryItems {
|
|
|
ritem := domain.AssessContemtRemark{
|
|
|
Title: vv.Title,
|
|
|
HintText: vv.HintText,
|
|
|
Definition: vv.Definition,
|
|
|
RemarkText: "",
|
|
|
}
|
|
|
remarks = append(remarks, ritem)
|
|
|
}
|
|
|
item.Remark = remarks
|
|
|
contentList = append(contentList, item)
|
|
|
}
|
|
|
return contentList, nil
|
|
|
} |
...
|
...
|
|