正在显示
2 个修改的文件
包含
11 行增加
和
3 行删除
@@ -928,10 +928,14 @@ func (srv StaffAssessServeice) GetAssessInfo(param *query.AssessInfoQuery) (*ada | @@ -928,10 +928,14 @@ func (srv StaffAssessServeice) GetAssessInfo(param *query.AssessInfoQuery) (*ada | ||
928 | } | 928 | } |
929 | taskMap := map[int]*domain.Task{} | 929 | taskMap := map[int]*domain.Task{} |
930 | taskRepository := factory.CreateTaskRepository(map[string]interface{}{"transactionContext": transactionContext}) | 930 | taskRepository := factory.CreateTaskRepository(map[string]interface{}{"transactionContext": transactionContext}) |
931 | - _, tasks, err := taskRepository.Find(map[string]interface{}{"ids": taskIdArray, "limit": len(taskIdArray)}) | 931 | + |
932 | + var tasks []*domain.Task | ||
933 | + if len(taskIdArray) > 0 { | ||
934 | + _, tasks, err = taskRepository.Find(map[string]interface{}{"ids": taskIdArray, "limit": len(taskIdArray)}) | ||
932 | if err != nil { | 935 | if err != nil { |
933 | return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "获取里程碑数据:"+err.Error()) | 936 | return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "获取里程碑数据:"+err.Error()) |
934 | } | 937 | } |
938 | + } | ||
935 | for i := range tasks { | 939 | for i := range tasks { |
936 | taskMap[tasks[i].Id] = tasks[i] | 940 | taskMap[tasks[i].Id] = tasks[i] |
937 | } | 941 | } |
@@ -787,10 +787,14 @@ func (srv StaffAssessServeice) GetAssessSelfInfoV2(param *query.GetExecutorSelfA | @@ -787,10 +787,14 @@ func (srv StaffAssessServeice) GetAssessSelfInfoV2(param *query.GetExecutorSelfA | ||
787 | 787 | ||
788 | taskMap := map[int]*domain.Task{} | 788 | taskMap := map[int]*domain.Task{} |
789 | taskRepository := factory.CreateTaskRepository(map[string]interface{}{"transactionContext": transactionContext}) | 789 | taskRepository := factory.CreateTaskRepository(map[string]interface{}{"transactionContext": transactionContext}) |
790 | - _, tasks, err := taskRepository.Find(map[string]interface{}{"ids": taskIdArray, "limit": len(taskIdArray)}) | 790 | + var tasks []*domain.Task |
791 | + if len(taskIdArray) > 0 { | ||
792 | + _, tasks, err = taskRepository.Find(map[string]interface{}{"ids": taskIdArray, "limit": len(taskIdArray)}) | ||
791 | if err != nil { | 793 | if err != nil { |
792 | - return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "获取里程碑数据:"+err.Error()) | 794 | + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "获取任务数据:"+err.Error()) |
795 | + } | ||
793 | } | 796 | } |
797 | + | ||
794 | for i := range tasks { | 798 | for i := range tasks { |
795 | taskMap[tasks[i].Id] = tasks[i] | 799 | taskMap[tasks[i].Id] = tasks[i] |
796 | } | 800 | } |
-
请 注册 或 登录 后发表评论