|
@@ -918,7 +918,7 @@ func (srv *SummaryEvaluationService) CountEvaluationSelfLevel(param *command.Que |
|
@@ -918,7 +918,7 @@ func (srv *SummaryEvaluationService) CountEvaluationSelfLevel(param *command.Que |
918
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
918
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
919
|
}
|
919
|
}
|
920
|
if len(evaluationList) == 0 {
|
920
|
if len(evaluationList) == 0 {
|
921
|
- return nil, nil
|
921
|
+ return &adapter.EvaluationInfoCountCodeAdapter{}, nil
|
922
|
}
|
922
|
}
|
923
|
evaluationData := evaluationList[0]
|
923
|
evaluationData := evaluationList[0]
|
924
|
levelCodeCountList, err := assessDao.CountAssessContentLevelCode(evaluationData.EvaluationProjectId, param.TargetUserId, domain.AssessSelf, param.CycleId)
|
924
|
levelCodeCountList, err := assessDao.CountAssessContentLevelCode(evaluationData.EvaluationProjectId, param.TargetUserId, domain.AssessSelf, param.CycleId)
|
|
@@ -1018,22 +1018,21 @@ func (srv *SummaryEvaluationService) GetEvaluationSuper(param *command.QueryEval |
|
@@ -1018,22 +1018,21 @@ func (srv *SummaryEvaluationService) GetEvaluationSuper(param *command.QueryEval |
1018
|
itemValueRepo := factory.CreateSummaryEvaluationValueRepository(map[string]interface{}{
|
1018
|
itemValueRepo := factory.CreateSummaryEvaluationValueRepository(map[string]interface{}{
|
1019
|
"transactionContext": transactionContext,
|
1019
|
"transactionContext": transactionContext,
|
1020
|
})
|
1020
|
})
|
1021
|
- // permissionRepository := factory.CreatePermissionRepository(map[string]interface{}{"transactionContext": transactionContext})
|
|
|
1022
|
- // 获取权限配置
|
|
|
1023
|
- // _, permissionList, err := permissionRepository.Find(map[string]interface{}{"companyId": param.CompanyId})
|
|
|
1024
|
- // if err != nil {
|
|
|
1025
|
- // return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
1026
|
- // }
|
1021
|
+
|
1027
|
permissinData, err := getPermission(int64(param.CompanyId))
|
1022
|
permissinData, err := getPermission(int64(param.CompanyId))
|
1028
|
if err != nil {
|
1023
|
if err != nil {
|
1029
|
return nil, err
|
1024
|
return nil, err
|
1030
|
}
|
1025
|
}
|
1031
|
- evaluationData, err := evaluationRepo.FindOne(map[string]interface{}{
|
|
|
1032
|
- "id": param.SummaryEvaluationId,
|
1026
|
+ _, evaluationList, err := evaluationRepo.Find(map[string]interface{}{
|
|
|
1027
|
+ "id": []int{param.SummaryEvaluationId},
|
1033
|
})
|
1028
|
})
|
1034
|
if err != nil {
|
1029
|
if err != nil {
|
1035
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
1030
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
1036
|
}
|
1031
|
}
|
|
|
1032
|
+ if len(evaluationList) == 0 {
|
|
|
1033
|
+ return &adapter.EvaluationInfoSuperAdapter{}, nil
|
|
|
1034
|
+ }
|
|
|
1035
|
+ evaluationData := evaluationList[0]
|
1037
|
if evaluationData.Types != domain.EvaluationSuper {
|
1036
|
if evaluationData.Types != domain.EvaluationSuper {
|
1038
|
return nil, application.ThrowError(application.BUSINESS_ERROR, "没有操作权限")
|
1037
|
return nil, application.ThrowError(application.BUSINESS_ERROR, "没有操作权限")
|
1039
|
}
|
1038
|
}
|
|
@@ -1124,10 +1123,22 @@ func (srv *SummaryEvaluationService) GetEvaluationSuperForAdmin(param *command.Q |
|
@@ -1124,10 +1123,22 @@ func (srv *SummaryEvaluationService) GetEvaluationSuperForAdmin(param *command.Q |
1124
|
evaluationRepo := factory.CreateSummaryEvaluationRepository(map[string]interface{}{"transactionContext": transactionContext})
|
1123
|
evaluationRepo := factory.CreateSummaryEvaluationRepository(map[string]interface{}{"transactionContext": transactionContext})
|
1125
|
evaluationItemRepo := factory.CreateEvaluationItemUsedRepository(map[string]interface{}{"transactionContext": transactionContext})
|
1124
|
evaluationItemRepo := factory.CreateEvaluationItemUsedRepository(map[string]interface{}{"transactionContext": transactionContext})
|
1126
|
itemValueRepo := factory.CreateSummaryEvaluationValueRepository(map[string]interface{}{"transactionContext": transactionContext})
|
1125
|
itemValueRepo := factory.CreateSummaryEvaluationValueRepository(map[string]interface{}{"transactionContext": transactionContext})
|
1127
|
- evaluationData, err := evaluationRepo.FindOne(map[string]interface{}{"id": param.SummaryEvaluationId})
|
1126
|
+ // evaluationData, err := evaluationRepo.FindOne(map[string]interface{}{"id": param.SummaryEvaluationId})
|
|
|
1127
|
+ // if err != nil {
|
|
|
1128
|
+ // return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
1129
|
+ // }
|
|
|
1130
|
+
|
|
|
1131
|
+ _, evaluationList, err := evaluationRepo.Find(map[string]interface{}{
|
|
|
1132
|
+ "id": []int{param.SummaryEvaluationId},
|
|
|
1133
|
+ })
|
1128
|
if err != nil {
|
1134
|
if err != nil {
|
1129
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
1135
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
1130
|
}
|
1136
|
}
|
|
|
1137
|
+ if len(evaluationList) == 0 {
|
|
|
1138
|
+ return &adapter.EvaluationInfoSuperAdapter{}, nil
|
|
|
1139
|
+ }
|
|
|
1140
|
+ evaluationData := evaluationList[0]
|
|
|
1141
|
+
|
1131
|
if evaluationData.CompanyId != param.CompanyId {
|
1142
|
if evaluationData.CompanyId != param.CompanyId {
|
1132
|
return nil, application.ThrowError(application.BUSINESS_ERROR, "没有操作权限")
|
1143
|
return nil, application.ThrowError(application.BUSINESS_ERROR, "没有操作权限")
|
1133
|
}
|
1144
|
}
|
|
@@ -1835,10 +1846,12 @@ func (srv *SummaryEvaluationService) GetTargetEvaluationResult(param *command.Qu |
|
@@ -1835,10 +1846,12 @@ func (srv *SummaryEvaluationService) GetTargetEvaluationResult(param *command.Qu |
1835
|
continue
|
1846
|
continue
|
1836
|
}
|
1847
|
}
|
1837
|
}
|
1848
|
}
|
|
|
1849
|
+ // if result == nil {
|
|
|
1850
|
+ // return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "没有找到符合条件的数据")
|
|
|
1851
|
+ // }
|
1838
|
if result == nil {
|
1852
|
if result == nil {
|
1839
|
- return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "没有找到符合条件的数据")
|
1853
|
+ return &adapter.EvaluationInfoSuperAdapter{}, nil
|
1840
|
}
|
1854
|
}
|
1841
|
-
|
|
|
1842
|
// 评估内容和值
|
1855
|
// 评估内容和值
|
1843
|
var itemList []*domain.EvaluationItemUsed
|
1856
|
var itemList []*domain.EvaluationItemUsed
|
1844
|
var itemValues []*domain.SummaryEvaluationValue
|
1857
|
var itemValues []*domain.SummaryEvaluationValue
|