...
|
...
|
@@ -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,
|
...
|
...
|
|