作者 tangxvhui

更新

... ... @@ -41,6 +41,7 @@ type EvaluationItemAdapter struct {
Remark string `json:"remark"` //填写的内容反馈
EvaluatorId int `json:"evaluatorId"` //评估人id
EvaluatorName string `json:"evaluatorName"` //评估人名称
ForbidEdit bool `json:"forbidEdit"` //页面操作控制是否禁用编辑
}
// 评级数量
... ...
... ... @@ -1115,6 +1115,12 @@ func (srv *SummaryEvaluationService) GetTargetUserEvaluationSuper(param *command
itemValueRepo := factory.CreateSummaryEvaluationValueRepository(map[string]interface{}{
"transactionContext": transactionContext,
})
permissionRepository := factory.CreatePermissionRepository(map[string]interface{}{"transactionContext": transactionContext})
// 获取权限配置
_, permissionList, err := permissionRepository.Find(map[string]interface{}{"companyId": param.CompanyId})
if err != nil {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
}
_, evaluationList, err := evaluationRepo.Find(map[string]interface{}{
"limit": 1,
"cycleId": param.CycleId,
... ... @@ -1177,7 +1183,7 @@ func (srv *SummaryEvaluationService) GetTargetUserEvaluationSuper(param *command
itemValuesAdapter := srv.buildSummaryItemValue(itemList, itemValues)
codeList := []*adapter.LevalCodeCount{}
codeMap := map[string]*adapter.LevalCodeCount{}
for _, v := range itemValuesAdapter {
for i, v := range itemValuesAdapter {
if v.Weight > 0 {
continue
}
... ... @@ -1192,7 +1198,19 @@ func (srv *SummaryEvaluationService) GetTargetUserEvaluationSuper(param *command
}
codeMap[v.Value].ItemList = append(codeMap[v.Value].ItemList, v.Name)
codeMap[v.Value].Number += 1
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
}
}
}
result := adapter.EvaluationInfoSuperAdapter{
EvaluationBaseAdapter: evaluationBase,
LevelCount: codeList,
... ...