正在显示
1 个修改的文件
包含
13 行增加
和
10 行删除
| @@ -38,6 +38,9 @@ func (srv *SummaryEvaluationService) GetEvaluationShow1(param command.QueryEvalu | @@ -38,6 +38,9 @@ func (srv *SummaryEvaluationService) GetEvaluationShow1(param command.QueryEvalu | ||
| 38 | if err != nil { | 38 | if err != nil { |
| 39 | return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) | 39 | return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) |
| 40 | } | 40 | } |
| 41 | + if len(evaluationList) == 0 { | ||
| 42 | + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "该人员缺少考评评估结果") | ||
| 43 | + } | ||
| 41 | if len(evaluationList) > 0 { | 44 | if len(evaluationList) > 0 { |
| 42 | _, evaluationValueList, err = evaluationValueRepo.Find(map[string]interface{}{"summaryEvaluationId": evaluationList[0].Id}) | 45 | _, evaluationValueList, err = evaluationValueRepo.Find(map[string]interface{}{"summaryEvaluationId": evaluationList[0].Id}) |
| 43 | if err != nil { | 46 | if err != nil { |
| @@ -46,7 +49,7 @@ func (srv *SummaryEvaluationService) GetEvaluationShow1(param command.QueryEvalu | @@ -46,7 +49,7 @@ func (srv *SummaryEvaluationService) GetEvaluationShow1(param command.QueryEvalu | ||
| 46 | } | 49 | } |
| 47 | //如果没有评估考核结果,就获取上级评估的内容 | 50 | //如果没有评估考核结果,就获取上级评估的内容 |
| 48 | if len(evaluationValueList) == 0 { | 51 | if len(evaluationValueList) == 0 { |
| 49 | - _, evaluationList, err = evaluationRepo.Find(map[string]interface{}{ | 52 | + _, evaluationList2, err := evaluationRepo.Find(map[string]interface{}{ |
| 50 | "limit": 1, | 53 | "limit": 1, |
| 51 | "companyId": param.CompanyId, | 54 | "companyId": param.CompanyId, |
| 52 | "cycleId": param.CycleId, | 55 | "cycleId": param.CycleId, |
| @@ -56,17 +59,17 @@ func (srv *SummaryEvaluationService) GetEvaluationShow1(param command.QueryEvalu | @@ -56,17 +59,17 @@ func (srv *SummaryEvaluationService) GetEvaluationShow1(param command.QueryEvalu | ||
| 56 | if err != nil { | 59 | if err != nil { |
| 57 | return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) | 60 | return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) |
| 58 | } | 61 | } |
| 59 | - if len(evaluationList) > 0 { | ||
| 60 | - _, evaluationValueList, err = evaluationValueRepo.Find(map[string]interface{}{"summaryEvaluationId": evaluationList[0].Id}) | 62 | + if len(evaluationList2) > 0 { |
| 63 | + _, evaluationValueList, err = evaluationValueRepo.Find(map[string]interface{}{"summaryEvaluationId": evaluationList2[0].Id}) | ||
| 61 | if err != nil { | 64 | if err != nil { |
| 62 | return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) | 65 | return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) |
| 63 | } | 66 | } |
| 64 | } | 67 | } |
| 65 | - } | ||
| 66 | - // 如果没有评估考核结果也没有上级评估的内容 | 68 | + // 如果没有评估考核结果的填写内容 |
| 69 | + // 也没有上级评估 | ||
| 67 | // 就查找 360 或人资评估数据 | 70 | // 就查找 360 或人资评估数据 |
| 68 | - if len(evaluationList) == 0 { | ||
| 69 | - _, evaluationList, err = evaluationRepo.Find(map[string]interface{}{ | 71 | + if len(evaluationList2) == 0 { |
| 72 | + _, evaluationList3, err := evaluationRepo.Find(map[string]interface{}{ | ||
| 70 | "limit": 500, | 73 | "limit": 500, |
| 71 | "companyId": param.CompanyId, | 74 | "companyId": param.CompanyId, |
| 72 | "cycleId": param.CycleId, | 75 | "cycleId": param.CycleId, |
| @@ -77,16 +80,16 @@ func (srv *SummaryEvaluationService) GetEvaluationShow1(param command.QueryEvalu | @@ -77,16 +80,16 @@ func (srv *SummaryEvaluationService) GetEvaluationShow1(param command.QueryEvalu | ||
| 77 | return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) | 80 | return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) |
| 78 | } | 81 | } |
| 79 | evaluationIds := []int{} | 82 | evaluationIds := []int{} |
| 80 | - for _, val := range evaluationList { | 83 | + for _, val := range evaluationList3 { |
| 81 | evaluationIds = append(evaluationIds, val.Id) | 84 | evaluationIds = append(evaluationIds, val.Id) |
| 82 | } | 85 | } |
| 86 | + if len(evaluationIds) > 0 { | ||
| 83 | _, evaluationValueList, err = evaluationValueRepo.Find(map[string]interface{}{"summaryEvaluationIdList": evaluationIds}) | 87 | _, evaluationValueList, err = evaluationValueRepo.Find(map[string]interface{}{"summaryEvaluationIdList": evaluationIds}) |
| 84 | if err != nil { | 88 | if err != nil { |
| 85 | return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) | 89 | return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) |
| 86 | } | 90 | } |
| 87 | } | 91 | } |
| 88 | - if len(evaluationList) == 0 { | ||
| 89 | - return nil, application.ThrowError(application.BUSINESS_ERROR, "该人员没有上级评估、人资评估、360评估。") | 92 | + } |
| 90 | } | 93 | } |
| 91 | evaluationProjectId := evaluationList[0].EvaluationProjectId | 94 | evaluationProjectId := evaluationList[0].EvaluationProjectId |
| 92 | //获取所有题目 | 95 | //获取所有题目 |
-
请 注册 或 登录 后发表评论