...
|
...
|
@@ -1278,6 +1278,59 @@ func (srv StaffAssessServeice) getStaffAssessBeforeEdit(param *query.AssessInfoQ |
|
|
}
|
|
|
|
|
|
// 获取未完成评估任务的执行人员名单
|
|
|
func (srv StaffAssessServeice) ListExcutorUncompleted() error {
|
|
|
return nil
|
|
|
func (srv StaffAssessServeice) ListExcutorUncompleted(param *query.ListExecutorQuery) (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()
|
|
|
}()
|
|
|
assessReps := factory.CreateStaffAssessRepository(map[string]interface{}{
|
|
|
"transactionContext": transactionContext,
|
|
|
})
|
|
|
condition := map[string]interface{}{
|
|
|
"cycleId": param.CycleId,
|
|
|
"beginDay": param.BeginDay,
|
|
|
"companyId": param.CompanyId,
|
|
|
"status": string(domain.StaffAssessUncompleted),
|
|
|
"typesList": []string{""},
|
|
|
}
|
|
|
switch param.Types {
|
|
|
case "self":
|
|
|
condition["typesList"] = []string{string(domain.AssessSelf)}
|
|
|
case "super":
|
|
|
condition["typesList"] = []string{string(domain.AssessSuper)}
|
|
|
case "invite":
|
|
|
condition["typesList"] = []string{string(domain.AssessInviteDiffSuper), string(domain.AssessInviteSameSuper)}
|
|
|
}
|
|
|
|
|
|
_, assessList, err := assessReps.Find(condition)
|
|
|
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())
|
|
|
}
|
|
|
userList := []map[string]string{}
|
|
|
userMap := map[int]struct{}{} //过滤重复的用户id
|
|
|
for _, val := range assessList {
|
|
|
if _, ok := userMap[val.TargetUser.UserId]; ok {
|
|
|
continue
|
|
|
} else {
|
|
|
userMap[val.TargetUser.UserId] = struct{}{}
|
|
|
}
|
|
|
u := map[string]string{
|
|
|
"userId": strconv.Itoa(val.TargetUser.UserId),
|
|
|
"userName": val.TargetUser.UserName,
|
|
|
}
|
|
|
userList = append(userList, u)
|
|
|
}
|
|
|
result := map[string]interface{}{
|
|
|
"userList": userList,
|
|
|
}
|
|
|
return result, nil
|
|
|
} |
...
|
...
|
|