作者 tangxvhui

修复 获取自评详情是 异常报错

... ... @@ -928,9 +928,13 @@ func (srv StaffAssessServeice) GetAssessInfo(param *query.AssessInfoQuery) (*ada
}
taskMap := map[int]*domain.Task{}
taskRepository := factory.CreateTaskRepository(map[string]interface{}{"transactionContext": transactionContext})
_, tasks, err := taskRepository.Find(map[string]interface{}{"ids": taskIdArray, "limit": len(taskIdArray)})
if err != nil {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "获取里程碑数据:"+err.Error())
var tasks []*domain.Task
if len(taskIdArray) > 0 {
_, tasks, err = taskRepository.Find(map[string]interface{}{"ids": taskIdArray, "limit": len(taskIdArray)})
if err != nil {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "获取里程碑数据:"+err.Error())
}
}
for i := range tasks {
taskMap[tasks[i].Id] = tasks[i]
... ...
... ... @@ -787,10 +787,14 @@ func (srv StaffAssessServeice) GetAssessSelfInfoV2(param *query.GetExecutorSelfA
taskMap := map[int]*domain.Task{}
taskRepository := factory.CreateTaskRepository(map[string]interface{}{"transactionContext": transactionContext})
_, tasks, err := taskRepository.Find(map[string]interface{}{"ids": taskIdArray, "limit": len(taskIdArray)})
if err != nil {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "获取里程碑数据:"+err.Error())
var tasks []*domain.Task
if len(taskIdArray) > 0 {
_, tasks, err = taskRepository.Find(map[string]interface{}{"ids": taskIdArray, "limit": len(taskIdArray)})
if err != nil {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "获取任务数据:"+err.Error())
}
}
for i := range tasks {
taskMap[tasks[i].Id] = tasks[i]
}
... ...