作者 linmadan

修复关闭任务记录任务不显示bug

... ... @@ -331,23 +331,29 @@ func (taskService *TaskService) SearchOffTaskRecord(searchOffTaskRecordCommand *
if err != nil {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
}
fmt.Println(tasks)
var taskIds []int64
for _, task := range tasks {
taskIds = append(taskIds, task.TaskId)
}
if count, offTaskRecords, err := offTaskRecordRepository.Find(map[string]interface{}{
"taskIds": taskIds,
"customerValue": searchOffTaskRecordCommand.CustomerValue,
"offStartTime": searchOffTaskRecordCommand.OffStartTime,
"offEndTime": searchOffTaskRecordCommand.OffEndTime,
"limit": searchOffTaskRecordCommand.Limit,
"taskIds": taskIds,
"offStartTime": searchOffTaskRecordCommand.OffStartTime,
"offEndTime": searchOffTaskRecordCommand.OffEndTime,
"offset": searchOffTaskRecordCommand.Offset,
"limit": searchOffTaskRecordCommand.Limit,
}); err != nil {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
} else {
if err := transactionContext.CommitTransaction(); err != nil {
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
}
for _, offTaskRecord := range offTaskRecords {
for _, task := range tasks {
if offTaskRecord.Task.TaskId == task.TaskId {
offTaskRecord.Task = task
}
}
}
return map[string]interface{}{
"count": count,
"offTaskRecords": offTaskRecords,
... ...
... ... @@ -100,7 +100,6 @@ func (repository *OffTaskRecordRepository) Find(queryOptions map[string]interfac
} else {
offTaskRecords = append(offTaskRecords, offTaskRecord)
}
offTaskRecords = append(offTaskRecords, &domain.OffTaskRecord{})
}
return int64(count), offTaskRecords, nil
}
... ...