Merge branch 'dev-zhengzhou' into test
正在显示
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 | ||
@@ -613,8 +618,11 @@ func (srv *SummaryEvaluationService) GetEvaluationHRBP(param *command.QueryEvalu | @@ -613,8 +618,11 @@ func (srv *SummaryEvaluationService) GetEvaluationHRBP(param *command.QueryEvalu | ||
613 | if err != nil { | 618 | if err != nil { |
614 | return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) | 619 | return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) |
615 | } | 620 | } |
616 | - if len(evaluations) == 0 { | ||
617 | - return nil, application.ThrowError(application.BUSINESS_ERROR, "数据不存在") | 621 | + if len(evaluations) == 0 { // 数据不存在 |
622 | + result := adapter.EvaluationInfoAdapter{} | ||
623 | + result.EvaluationItems = make([]adapter.EvaluationItemAdapter, 0) | ||
624 | + return &result, nil | ||
625 | + //return nil, application.ThrowError(application.BUSINESS_ERROR, "数据不存在") | ||
618 | } | 626 | } |
619 | sEvaluation := evaluations[0] | 627 | sEvaluation := evaluations[0] |
620 | 628 |
@@ -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 |
-
请 注册 或 登录 后发表评论