...
|
...
|
@@ -1182,15 +1182,6 @@ func (srv StaffAssessServeice) StaffAssessSuperBeforeEdit(param *query.AssessInf |
|
|
return result, nil
|
|
|
}
|
|
|
|
|
|
// 自评评估内容编辑前
|
|
|
// func (srv StaffAssessServeice) StaffAssessSelfBeforeEdit(param *query.AssessInfoQuery) (*adapter.AssessInfoResp, error) {
|
|
|
// result, err := srv.GetAssessInfo(param)
|
|
|
// if err != nil {
|
|
|
// return &adapter.AssessInfoResp{}, err
|
|
|
// }
|
|
|
// return result, nil
|
|
|
// }
|
|
|
|
|
|
func (srv StaffAssessServeice) getStaffAssessBeforeEdit(param *query.AssessInfoQuery) (*adapter.AssessInfoResp, error) {
|
|
|
transactionContext, err := factory.CreateTransactionContext(nil)
|
|
|
if err != nil {
|
...
|
...
|
@@ -1289,6 +1280,35 @@ func (srv StaffAssessServeice) ListExcutorUncompleted(param *query.ListExecutorQ |
|
|
defer func() {
|
|
|
_ = transactionContext.RollbackTransaction()
|
|
|
}()
|
|
|
|
|
|
if param.Types == "invite" {
|
|
|
staffAssessDao := dao.NewStaffAssessDao(map[string]interface{}{
|
|
|
"transactionContext": transactionContext,
|
|
|
})
|
|
|
targetUserList, err := staffAssessDao.ListTargetUserNoInvite(param.CompanyId, param.CycleId, param.BeginDay)
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "获取员工列表"+err.Error())
|
|
|
}
|
|
|
userList := []map[string]string{}
|
|
|
userMap := map[string]struct{}{} //过滤重复的用户id
|
|
|
for _, val := range targetUserList {
|
|
|
if _, ok := userMap[val.UserId]; ok {
|
|
|
continue
|
|
|
} else {
|
|
|
userMap[val.UserId] = struct{}{}
|
|
|
}
|
|
|
u := map[string]string{
|
|
|
"userId": val.UserId,
|
|
|
"userName": val.UserName,
|
|
|
}
|
|
|
userList = append(userList, u)
|
|
|
}
|
|
|
result := map[string]interface{}{
|
|
|
"userList": userList,
|
|
|
}
|
|
|
return result, nil
|
|
|
}
|
|
|
|
|
|
assessReps := factory.CreateStaffAssessRepository(map[string]interface{}{
|
|
|
"transactionContext": transactionContext,
|
|
|
})
|
...
|
...
|
@@ -1309,7 +1329,7 @@ func (srv StaffAssessServeice) ListExcutorUncompleted(param *query.ListExecutorQ |
|
|
}
|
|
|
_, assessList, err := assessReps.Find(condition)
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "获取员工的评估"+err.Error())
|
|
|
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())
|
...
|
...
|
|