...
|
...
|
@@ -331,16 +331,15 @@ 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,
|
|
|
"offset": searchOffTaskRecordCommand.Offset,
|
|
|
"limit": searchOffTaskRecordCommand.Limit,
|
|
|
}); err != nil {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
...
|
...
|
@@ -348,6 +347,13 @@ func (taskService *TaskService) SearchOffTaskRecord(searchOffTaskRecordCommand * |
|
|
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,
|
...
|
...
|
|