...
|
...
|
@@ -918,7 +918,7 @@ func (srv *SummaryEvaluationService) CountEvaluationSelfLevel(param *command.Que |
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
}
|
|
|
if len(evaluationList) == 0 {
|
|
|
return nil, nil
|
|
|
return &adapter.EvaluationInfoCountCodeAdapter{}, nil
|
|
|
}
|
|
|
evaluationData := evaluationList[0]
|
|
|
levelCodeCountList, err := assessDao.CountAssessContentLevelCode(evaluationData.EvaluationProjectId, param.TargetUserId, domain.AssessSelf, param.CycleId)
|
...
|
...
|
@@ -1018,22 +1018,21 @@ func (srv *SummaryEvaluationService) GetEvaluationSuper(param *command.QueryEval |
|
|
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())
|
|
|
// }
|
|
|
|
|
|
permissinData, err := getPermission(int64(param.CompanyId))
|
|
|
if err != nil {
|
|
|
return nil, err
|
|
|
}
|
|
|
evaluationData, err := evaluationRepo.FindOne(map[string]interface{}{
|
|
|
"id": param.SummaryEvaluationId,
|
|
|
_, evaluationList, err := evaluationRepo.Find(map[string]interface{}{
|
|
|
"id": []int{param.SummaryEvaluationId},
|
|
|
})
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
}
|
|
|
if len(evaluationList) == 0 {
|
|
|
return &adapter.EvaluationInfoSuperAdapter{}, nil
|
|
|
}
|
|
|
evaluationData := evaluationList[0]
|
|
|
if evaluationData.Types != domain.EvaluationSuper {
|
|
|
return nil, application.ThrowError(application.BUSINESS_ERROR, "没有操作权限")
|
|
|
}
|
...
|
...
|
@@ -1124,10 +1123,22 @@ func (srv *SummaryEvaluationService) GetEvaluationSuperForAdmin(param *command.Q |
|
|
evaluationRepo := factory.CreateSummaryEvaluationRepository(map[string]interface{}{"transactionContext": transactionContext})
|
|
|
evaluationItemRepo := factory.CreateEvaluationItemUsedRepository(map[string]interface{}{"transactionContext": transactionContext})
|
|
|
itemValueRepo := factory.CreateSummaryEvaluationValueRepository(map[string]interface{}{"transactionContext": transactionContext})
|
|
|
evaluationData, err := evaluationRepo.FindOne(map[string]interface{}{"id": param.SummaryEvaluationId})
|
|
|
// evaluationData, err := evaluationRepo.FindOne(map[string]interface{}{"id": param.SummaryEvaluationId})
|
|
|
// if err != nil {
|
|
|
// return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
// }
|
|
|
|
|
|
_, evaluationList, err := evaluationRepo.Find(map[string]interface{}{
|
|
|
"id": []int{param.SummaryEvaluationId},
|
|
|
})
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
}
|
|
|
if len(evaluationList) == 0 {
|
|
|
return &adapter.EvaluationInfoSuperAdapter{}, nil
|
|
|
}
|
|
|
evaluationData := evaluationList[0]
|
|
|
|
|
|
if evaluationData.CompanyId != param.CompanyId {
|
|
|
return nil, application.ThrowError(application.BUSINESS_ERROR, "没有操作权限")
|
|
|
}
|
...
|
...
|
@@ -1835,10 +1846,12 @@ func (srv *SummaryEvaluationService) GetTargetEvaluationResult(param *command.Qu |
|
|
continue
|
|
|
}
|
|
|
}
|
|
|
// if result == nil {
|
|
|
// return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "没有找到符合条件的数据")
|
|
|
// }
|
|
|
if result == nil {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "没有找到符合条件的数据")
|
|
|
return &adapter.EvaluationInfoSuperAdapter{}, nil
|
|
|
}
|
|
|
|
|
|
// 评估内容和值
|
|
|
var itemList []*domain.EvaluationItemUsed
|
|
|
var itemValues []*domain.SummaryEvaluationValue
|
...
|
...
|
|