...
|
...
|
@@ -1015,11 +1015,15 @@ func (srv *SummaryEvaluationService) GetEvaluationSuper(param *command.QueryEval |
|
|
itemValueRepo := factory.CreateSummaryEvaluationValueRepository(map[string]interface{}{
|
|
|
"transactionContext": transactionContext,
|
|
|
})
|
|
|
permissionRepository := factory.CreatePermissionRepository(map[string]interface{}{"transactionContext": transactionContext})
|
|
|
// permissionRepository := factory.CreatePermissionRepository(map[string]interface{}{"transactionContext": transactionContext})
|
|
|
// 获取权限配置
|
|
|
_, permissionList, err := permissionRepository.Find(map[string]interface{}{"companyId": param.CompanyId})
|
|
|
// _, permissionList, err := permissionRepository.Find(map[string]interface{}{"companyId": param.CompanyId})
|
|
|
// if err != nil {
|
|
|
// return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
// }
|
|
|
permissinData, err := getPermission(int64(param.CompanyId))
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
return nil, err
|
|
|
}
|
|
|
evaluationData, err := evaluationRepo.FindOne(map[string]interface{}{
|
|
|
"id": param.SummaryEvaluationId,
|
...
|
...
|
@@ -1078,15 +1082,13 @@ func (srv *SummaryEvaluationService) GetEvaluationSuper(param *command.QueryEval |
|
|
//组合 评估填写的值和评估项
|
|
|
itemValuesAdapter := srv.buildSummaryItemValue(itemList, itemValues)
|
|
|
for i, v := range itemValuesAdapter {
|
|
|
if len(permissionList) > 0 {
|
|
|
if permissionList[0].OptEvalScore == domain.PermissionOff &&
|
|
|
v.EvaluatorId > 0 {
|
|
|
itemValuesAdapter[i].ForbidEdit = true
|
|
|
}
|
|
|
if permissionList[0].OptHrScore == domain.PermissionOff &&
|
|
|
v.EvaluatorId < 0 {
|
|
|
itemValuesAdapter[i].ForbidEdit = true
|
|
|
}
|
|
|
if permissinData.OptEvalScore == domain.PermissionOff &&
|
|
|
v.EvaluatorId > 0 {
|
|
|
itemValuesAdapter[i].ForbidEdit = true
|
|
|
}
|
|
|
if permissinData.OptHrScore == domain.PermissionOff &&
|
|
|
v.EvaluatorId < 0 {
|
|
|
itemValuesAdapter[i].ForbidEdit = true
|
|
|
}
|
|
|
}
|
|
|
result := adapter.EvaluationInfoSuperAdapter{
|
...
|
...
|
@@ -1214,16 +1216,19 @@ func (srv *SummaryEvaluationService) getEvaluationSuperDefaultValue(transactionC |
|
|
"transactionContext": transactionContext,
|
|
|
})
|
|
|
|
|
|
permissionRepository := factory.CreatePermissionRepository(map[string]interface{}{"transactionContext": transactionContext})
|
|
|
// 获取权限配置
|
|
|
_, permissionList, err := permissionRepository.Find(map[string]interface{}{"companyId": evaluationData.CompanyId})
|
|
|
// permissionRepository := factory.CreatePermissionRepository(map[string]interface{}{"transactionContext": transactionContext})
|
|
|
// // 获取权限配置
|
|
|
// _, permissionList, err := permissionRepository.Find(map[string]interface{}{"companyId": evaluationData.CompanyId})
|
|
|
// if err != nil {
|
|
|
// return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
// }
|
|
|
// if len(permissionList) == 0 {
|
|
|
// return nil, nil
|
|
|
// }
|
|
|
permissionData, err := getPermission(int64(evaluationData.CompanyId))
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
}
|
|
|
if len(permissionList) == 0 {
|
|
|
return nil, nil
|
|
|
}
|
|
|
permissionData := permissionList[0]
|
|
|
if permissionData.OptEvalScore == domain.PermissionOn && permissionData.OptHrScore == domain.PermissionOn {
|
|
|
return nil, nil
|
|
|
}
|
...
|
...
|
|