正在显示
2 个修改的文件
包含
14 行增加
和
6 行删除
@@ -212,8 +212,10 @@ func (srv *SummaryEvaluationService) GetEvaluation360(param *command.QueryEvalua | @@ -212,8 +212,10 @@ func (srv *SummaryEvaluationService) GetEvaluation360(param *command.QueryEvalua | ||
212 | if err != nil { | 212 | if err != nil { |
213 | return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) | 213 | return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) |
214 | } | 214 | } |
215 | - if len(evaluations) == 0 { | ||
216 | - return nil, application.ThrowError(application.BUSINESS_ERROR, "数据不存在") | 215 | + if len(evaluations) == 0 { // 数据不存在 |
216 | + result := adapter.EvaluationInfoAdapter{} | ||
217 | + result.EvaluationItems = make([]adapter.EvaluationItemAdapter, 0) | ||
218 | + return &result, nil | ||
217 | } | 219 | } |
218 | sEvaluation := evaluations[0] | 220 | sEvaluation := evaluations[0] |
219 | 221 | ||
@@ -280,7 +282,10 @@ func (srv *SummaryEvaluationService) GetEvaluation360All(param *command.QueryEva | @@ -280,7 +282,10 @@ func (srv *SummaryEvaluationService) GetEvaluation360All(param *command.QueryEva | ||
280 | return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) | 282 | return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) |
281 | } | 283 | } |
282 | if len(evaluations) == 0 { | 284 | if len(evaluations) == 0 { |
283 | - return nil, application.ThrowError(application.BUSINESS_ERROR, "数据不存在") | 285 | + result := adapter.EvaluationInfoAdapter{} |
286 | + result.EvaluationItems = make([]adapter.EvaluationItemAdapter, 0) | ||
287 | + return &result, nil | ||
288 | + //return nil, application.ThrowError(application.BUSINESS_ERROR, "数据不存在") | ||
284 | } | 289 | } |
285 | sEvaluation := evaluations[0] | 290 | sEvaluation := evaluations[0] |
286 | 291 | ||
@@ -611,8 +616,11 @@ func (srv *SummaryEvaluationService) GetEvaluationHRBP(param *command.QueryEvalu | @@ -611,8 +616,11 @@ func (srv *SummaryEvaluationService) GetEvaluationHRBP(param *command.QueryEvalu | ||
611 | if err != nil { | 616 | if err != nil { |
612 | return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) | 617 | return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) |
613 | } | 618 | } |
614 | - if len(evaluations) == 0 { | ||
615 | - return nil, application.ThrowError(application.BUSINESS_ERROR, "数据不存在") | 619 | + if len(evaluations) == 0 { // 数据不存在 |
620 | + result := adapter.EvaluationInfoAdapter{} | ||
621 | + result.EvaluationItems = make([]adapter.EvaluationItemAdapter, 0) | ||
622 | + return &result, nil | ||
623 | + //return nil, application.ThrowError(application.BUSINESS_ERROR, "数据不存在") | ||
616 | } | 624 | } |
617 | sEvaluation := evaluations[0] | 625 | sEvaluation := evaluations[0] |
618 | 626 |
@@ -154,7 +154,7 @@ func (repo *SummaryEvaluationRepository) Find(queryOptions map[string]interface{ | @@ -154,7 +154,7 @@ func (repo *SummaryEvaluationRepository) Find(queryOptions map[string]interface{ | ||
154 | query.Where(`summary_evaluation.target_user->>'userId'='?'`, v) | 154 | query.Where(`summary_evaluation.target_user->>'userId'='?'`, v) |
155 | } | 155 | } |
156 | 156 | ||
157 | - if v, ok := queryOptions["targetUserName"]; ok { | 157 | + if v, ok := queryOptions["targetUserName"].(string); ok && len(v) > 0 { |
158 | query.Where(`summary_evaluation.target_user->>'userName' like ?`, v) | 158 | query.Where(`summary_evaluation.target_user->>'userName' like ?`, v) |
159 | } | 159 | } |
160 | 160 |
-
请 注册 或 登录 后发表评论