作者 tangxvhui

修复查询错误

... ... @@ -555,13 +555,16 @@ func (srv TaskService) ListTask(param *command.ListTaskCommand) (map[string]inte
for _, val := range taskList {
taskIdList = append(taskIdList, val.Id)
}
_, stageList, err := taskStageRepo.Find(map[string]interface{}{
"taskIdList": taskIdList,
})
if err != nil {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "查询任务阶段数据"+err.Error())
var stageList []*domain.TaskStage
if len(taskIdList) > 0 {
_, stageList, err = taskStageRepo.Find(map[string]interface{}{
"taskIdList": taskIdList,
})
if err != nil {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "查询任务阶段数据"+err.Error())
}
}
if err := transactionContext.CommitTransaction(); err != nil {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
}
... ... @@ -668,6 +671,9 @@ func (srv TaskService) ListTask2(param *command.SearchTaskCommand) (map[string]i
if err != nil {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "获取用户的角色信息"+err.Error())
}
if len(param.SearchWord) > 0 {
param.SearchWord = "%" + param.SearchWord + "%"
}
if hrbpFlag == domain.RoleTypeSystem {
listData, err := srv.listTask2ForHrbp(param)
return listData, err
... ... @@ -681,11 +687,10 @@ func (srv TaskService) ListTask2(param *command.SearchTaskCommand) (map[string]i
}
}
condition := dao.ListTaskCondition{
Limit: limit,
Offset: offset,
UserId: param.UserId,
CompanyId: param.CompanyId,
Limit: limit,
Offset: offset,
UserId: param.UserId,
CompanyId: param.CompanyId,
OnlyMy: param.OnlyMy,
SearchWord: param.SearchWord,
}
... ...