正在显示
1 个修改的文件
包含
30 行增加
和
27 行删除
@@ -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,38 +59,38 @@ func (srv *SummaryEvaluationService) GetEvaluationShow1(param command.QueryEvalu | @@ -56,38 +59,38 @@ 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 | - // 如果没有评估考核结果也没有上级评估的内容 | ||
67 | - // 就查找 360 或人资评估数据 | ||
68 | - if len(evaluationList) == 0 { | ||
69 | - _, evaluationList, err = evaluationRepo.Find(map[string]interface{}{ | ||
70 | - "limit": 500, | ||
71 | - "companyId": param.CompanyId, | ||
72 | - "cycleId": param.CycleId, | ||
73 | - "targetUserId": param.TargetUserId, | ||
74 | - "typesList": []int{int(domain.EvaluationHrbp), int(domain.Evaluation360)}, | ||
75 | - }) | ||
76 | - if err != nil { | ||
77 | - return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) | ||
78 | - } | ||
79 | - evaluationIds := []int{} | ||
80 | - for _, val := range evaluationList { | ||
81 | - evaluationIds = append(evaluationIds, val.Id) | ||
82 | - } | ||
83 | - _, evaluationValueList, err = evaluationValueRepo.Find(map[string]interface{}{"summaryEvaluationIdList": evaluationIds}) | ||
84 | - if err != nil { | ||
85 | - return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) | 68 | + // 如果没有评估考核结果的填写内容 |
69 | + // 也没有上级评估 | ||
70 | + // 就查找 360 或人资评估数据 | ||
71 | + if len(evaluationList2) == 0 { | ||
72 | + _, evaluationList3, err := evaluationRepo.Find(map[string]interface{}{ | ||
73 | + "limit": 500, | ||
74 | + "companyId": param.CompanyId, | ||
75 | + "cycleId": param.CycleId, | ||
76 | + "targetUserId": param.TargetUserId, | ||
77 | + "typesList": []int{int(domain.EvaluationHrbp), int(domain.Evaluation360)}, | ||
78 | + }) | ||
79 | + if err != nil { | ||
80 | + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) | ||
81 | + } | ||
82 | + evaluationIds := []int{} | ||
83 | + for _, val := range evaluationList3 { | ||
84 | + evaluationIds = append(evaluationIds, val.Id) | ||
85 | + } | ||
86 | + if len(evaluationIds) > 0 { | ||
87 | + _, evaluationValueList, err = evaluationValueRepo.Find(map[string]interface{}{"summaryEvaluationIdList": evaluationIds}) | ||
88 | + if err != nil { | ||
89 | + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) | ||
90 | + } | ||
91 | + } | ||
86 | } | 92 | } |
87 | } | 93 | } |
88 | - if len(evaluationList) == 0 { | ||
89 | - return nil, application.ThrowError(application.BUSINESS_ERROR, "该人员没有上级评估、人资评估、360评估。") | ||
90 | - } | ||
91 | evaluationProjectId := evaluationList[0].EvaluationProjectId | 94 | evaluationProjectId := evaluationList[0].EvaluationProjectId |
92 | //获取所有题目 | 95 | //获取所有题目 |
93 | _, itemUsedList, err := itemUsedRepo.Find(map[string]interface{}{ | 96 | _, itemUsedList, err := itemUsedRepo.Find(map[string]interface{}{ |
-
请 注册 或 登录 后发表评论