...
|
...
|
@@ -88,38 +88,43 @@ func (srv StaffAssessServeice) ListUserAssessContentCycleDay(param *query.ListAs |
|
|
_ = transactionContext.RollbackTransaction()
|
|
|
}()
|
|
|
|
|
|
roleRepo := factory.CreateRoleRepository(map[string]interface{}{
|
|
|
"transactionContext": transactionContext,
|
|
|
})
|
|
|
roleUserRepo := factory.CreateRoleUserRepository(map[string]interface{}{
|
|
|
"transactionContext": transactionContext,
|
|
|
})
|
|
|
_, roleList, err := roleRepo.Find(map[string]interface{}{
|
|
|
"type": domain.RoleTypeSystem,
|
|
|
"companyId": param.CompanyId,
|
|
|
})
|
|
|
hrbp, err := srv.getHRBP(transactionContext, param.CompanyId, param.OperaterId)
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "获取角色信息列表"+err.Error())
|
|
|
}
|
|
|
_, userRoleList, err := roleUserRepo.Find(map[string]interface{}{
|
|
|
"companyId": param.CompanyId,
|
|
|
"userId": param.OperaterId,
|
|
|
})
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "获取用户的角色信息列表"+err.Error())
|
|
|
}
|
|
|
hrbp := -1
|
|
|
for _, v := range userRoleList {
|
|
|
for _, v2 := range roleList {
|
|
|
if v.RoleId == v2.Id {
|
|
|
hrbp = 1
|
|
|
break
|
|
|
}
|
|
|
}
|
|
|
if hrbp == 1 {
|
|
|
break
|
|
|
}
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
}
|
|
|
|
|
|
//roleRepo := factory.CreateRoleRepository(map[string]interface{}{
|
|
|
// "transactionContext": transactionContext,
|
|
|
//})
|
|
|
//roleUserRepo := factory.CreateRoleUserRepository(map[string]interface{}{
|
|
|
// "transactionContext": transactionContext,
|
|
|
//})
|
|
|
//_, roleList, err := roleRepo.Find(map[string]interface{}{
|
|
|
// "type": domain.RoleTypeSystem,
|
|
|
// "companyId": param.CompanyId,
|
|
|
//})
|
|
|
//if err != nil {
|
|
|
// return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "获取角色信息列表"+err.Error())
|
|
|
//}
|
|
|
//_, userRoleList, err := roleUserRepo.Find(map[string]interface{}{
|
|
|
// "companyId": param.CompanyId,
|
|
|
// "userId": param.OperaterId,
|
|
|
//})
|
|
|
//if err != nil {
|
|
|
// return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "获取用户的角色信息列表"+err.Error())
|
|
|
//}
|
|
|
//hrbp := -1
|
|
|
//for _, v := range userRoleList {
|
|
|
// for _, v2 := range roleList {
|
|
|
// if v.RoleId == v2.Id {
|
|
|
// hrbp = 1
|
|
|
// break
|
|
|
// }
|
|
|
// }
|
|
|
// if hrbp == 1 {
|
|
|
// break
|
|
|
// }
|
|
|
//}
|
|
|
assessDao := dao.NewStaffAssessDao(map[string]interface{}{
|
|
|
"transactionContext": transactionContext,
|
|
|
})
|
...
|
...
|
@@ -225,38 +230,42 @@ func (srv StaffAssessServeice) ExportUserAssess(param *query.ListAssessContentCy |
|
|
_ = transactionContext.RollbackTransaction()
|
|
|
}()
|
|
|
|
|
|
roleRepo := factory.CreateRoleRepository(map[string]interface{}{
|
|
|
"transactionContext": transactionContext,
|
|
|
})
|
|
|
roleUserRepo := factory.CreateRoleUserRepository(map[string]interface{}{
|
|
|
"transactionContext": transactionContext,
|
|
|
})
|
|
|
_, roleList, err := roleRepo.Find(map[string]interface{}{
|
|
|
"type": domain.RoleTypeSystem,
|
|
|
"companyId": param.CompanyId,
|
|
|
})
|
|
|
hrbp, err := srv.getHRBP(transactionContext, param.CompanyId, param.OperaterId)
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "获取角色信息列表"+err.Error())
|
|
|
}
|
|
|
_, userRoleList, err := roleUserRepo.Find(map[string]interface{}{
|
|
|
"companyId": param.CompanyId,
|
|
|
"userId": param.OperaterId,
|
|
|
})
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "获取用户的角色信息列表"+err.Error())
|
|
|
}
|
|
|
hrbp := -1
|
|
|
for _, v := range userRoleList {
|
|
|
for _, v2 := range roleList {
|
|
|
if v.RoleId == v2.Id {
|
|
|
hrbp = 1
|
|
|
break
|
|
|
}
|
|
|
}
|
|
|
if hrbp == 1 {
|
|
|
break
|
|
|
}
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
}
|
|
|
//roleRepo := factory.CreateRoleRepository(map[string]interface{}{
|
|
|
// "transactionContext": transactionContext,
|
|
|
//})
|
|
|
//roleUserRepo := factory.CreateRoleUserRepository(map[string]interface{}{
|
|
|
// "transactionContext": transactionContext,
|
|
|
//})
|
|
|
//_, roleList, err := roleRepo.Find(map[string]interface{}{
|
|
|
// "type": domain.RoleTypeSystem,
|
|
|
// "companyId": param.CompanyId,
|
|
|
//})
|
|
|
//if err != nil {
|
|
|
// return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "获取角色信息列表"+err.Error())
|
|
|
//}
|
|
|
//_, userRoleList, err := roleUserRepo.Find(map[string]interface{}{
|
|
|
// "companyId": param.CompanyId,
|
|
|
// "userId": param.OperaterId,
|
|
|
//})
|
|
|
//if err != nil {
|
|
|
// return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "获取用户的角色信息列表"+err.Error())
|
|
|
//}
|
|
|
//hrbp := -1
|
|
|
//for _, v := range userRoleList {
|
|
|
// for _, v2 := range roleList {
|
|
|
// if v.RoleId == v2.Id {
|
|
|
// hrbp = 1
|
|
|
// break
|
|
|
// }
|
|
|
// }
|
|
|
// if hrbp == 1 {
|
|
|
// break
|
|
|
// }
|
|
|
//}
|
|
|
assessDao := dao.NewStaffAssessDao(map[string]interface{}{
|
|
|
"transactionContext": transactionContext,
|
|
|
})
|
...
|
...
|
@@ -457,38 +466,42 @@ func (srv StaffAssessServeice) AnalysisData(param *query.ListAssessContentCycleD |
|
|
_ = transactionContext.RollbackTransaction()
|
|
|
}()
|
|
|
|
|
|
roleRepo := factory.CreateRoleRepository(map[string]interface{}{
|
|
|
"transactionContext": transactionContext,
|
|
|
})
|
|
|
roleUserRepo := factory.CreateRoleUserRepository(map[string]interface{}{
|
|
|
"transactionContext": transactionContext,
|
|
|
})
|
|
|
_, roleList, err := roleRepo.Find(map[string]interface{}{
|
|
|
"type": domain.RoleTypeSystem,
|
|
|
"companyId": param.CompanyId,
|
|
|
})
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "获取角色信息列表"+err.Error())
|
|
|
}
|
|
|
_, userRoleList, err := roleUserRepo.Find(map[string]interface{}{
|
|
|
"companyId": param.CompanyId,
|
|
|
"userId": param.OperaterId,
|
|
|
})
|
|
|
hrbp, err := srv.getHRBP(transactionContext, param.CompanyId, param.OperaterId)
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "获取用户的角色信息列表"+err.Error())
|
|
|
}
|
|
|
hrbp := -1
|
|
|
for _, v := range userRoleList {
|
|
|
for _, v2 := range roleList {
|
|
|
if v.RoleId == v2.Id {
|
|
|
hrbp = 1
|
|
|
break
|
|
|
}
|
|
|
}
|
|
|
if hrbp == 1 {
|
|
|
break
|
|
|
}
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
}
|
|
|
//roleRepo := factory.CreateRoleRepository(map[string]interface{}{
|
|
|
// "transactionContext": transactionContext,
|
|
|
//})
|
|
|
//roleUserRepo := factory.CreateRoleUserRepository(map[string]interface{}{
|
|
|
// "transactionContext": transactionContext,
|
|
|
//})
|
|
|
//_, roleList, err := roleRepo.Find(map[string]interface{}{
|
|
|
// "type": domain.RoleTypeSystem,
|
|
|
// "companyId": param.CompanyId,
|
|
|
//})
|
|
|
//if err != nil {
|
|
|
// return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "获取角色信息列表"+err.Error())
|
|
|
//}
|
|
|
//_, userRoleList, err := roleUserRepo.Find(map[string]interface{}{
|
|
|
// "companyId": param.CompanyId,
|
|
|
// "userId": param.OperaterId,
|
|
|
//})
|
|
|
//if err != nil {
|
|
|
// return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "获取用户的角色信息列表"+err.Error())
|
|
|
//}
|
|
|
//hrbp := -1
|
|
|
//for _, v := range userRoleList {
|
|
|
// for _, v2 := range roleList {
|
|
|
// if v.RoleId == v2.Id {
|
|
|
// hrbp = 1
|
|
|
// break
|
|
|
// }
|
|
|
// }
|
|
|
// if hrbp == 1 {
|
|
|
// break
|
|
|
// }
|
|
|
//}
|
|
|
assessDao := dao.NewStaffAssessDao(map[string]interface{}{
|
|
|
"transactionContext": transactionContext,
|
|
|
})
|
...
|
...
|
|