...
|
...
|
@@ -255,17 +255,40 @@ func (srv StaffAssessServeice) AssessSelfList(param query.AssessSelfListQuery) ( |
|
|
}
|
|
|
|
|
|
//获取用户数据
|
|
|
userRep := factory.CreateUserRepository(map[string]interface{}{
|
|
|
userRepo := factory.CreateUserRepository(map[string]interface{}{
|
|
|
"transactionContext": transactionContext,
|
|
|
})
|
|
|
userData, err := userRep.FindOne(map[string]interface{}{
|
|
|
userData, err := userRepo.FindOne(map[string]interface{}{
|
|
|
"id": param.UserId,
|
|
|
})
|
|
|
if err != nil {
|
|
|
log.Logger.Error("获取用户信息," + err.Error())
|
|
|
return nil, application.ThrowError(application.TRANSACTION_ERROR, "获取用户信息,"+err.Error())
|
|
|
}
|
|
|
|
|
|
departmentRepo := factory.CreateDepartmentRepository(map[string]interface{}{
|
|
|
"transactionContext": transactionContext,
|
|
|
})
|
|
|
var supperUserList []*domain.User
|
|
|
if len(userData.DepartmentId) > 0 {
|
|
|
_, departmentList, err := departmentRepo.Find(map[string]interface{}{
|
|
|
"ids": userData.DepartmentId,
|
|
|
})
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.TRANSACTION_ERROR, "获取部门信息,"+err.Error())
|
|
|
}
|
|
|
var chargeUserIds []int64
|
|
|
for _, v := range departmentList {
|
|
|
chargeUserIds = append(chargeUserIds, v.ChargeUserIds...)
|
|
|
}
|
|
|
if len(chargeUserIds) > 0 {
|
|
|
_, supperUserList, err = userRepo.Find(map[string]interface{}{
|
|
|
"ids": chargeUserIds,
|
|
|
})
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.TRANSACTION_ERROR, "获取员工上级信息,"+err.Error())
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
if err := transactionContext.CommitTransaction(); err != nil {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
}
|
...
|
...
|
@@ -289,6 +312,9 @@ func (srv StaffAssessServeice) AssessSelfList(param query.AssessSelfListQuery) ( |
|
|
SupperUserName: "",
|
|
|
DutyTime: userData.CreateAt.Local().Format("2006-01-02 15:04:05"),
|
|
|
}
|
|
|
for _, v := range supperUserList {
|
|
|
userInfo.SupperUserName = userInfo.SupperUserName + v.Name + ";"
|
|
|
}
|
|
|
result := tool_funs.SimpleWrapGridMap(int64(cnt), listData)
|
|
|
result["userInfo"] = userInfo
|
|
|
return result, nil
|
...
|
...
|
@@ -313,7 +339,7 @@ func (srv StaffAssessServeice) CreateStaffAssessTask() error { |
|
|
return nil
|
|
|
}
|
|
|
|
|
|
func (srv StaffAssessServeice) getStaffDesc(userId int) *domain.StaffDesc {
|
|
|
// 获取员工自评详情
|
|
|
func (srv StaffAssessServeice) StaffAssessSelfInfo() {
|
|
|
|
|
|
return &domain.StaffDesc{}
|
|
|
} |
...
|
...
|
|