|
@@ -331,16 +331,15 @@ func (taskService *TaskService) SearchOffTaskRecord(searchOffTaskRecordCommand * |
|
@@ -331,16 +331,15 @@ func (taskService *TaskService) SearchOffTaskRecord(searchOffTaskRecordCommand * |
331
|
if err != nil {
|
331
|
if err != nil {
|
332
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
332
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
333
|
}
|
333
|
}
|
334
|
- fmt.Println(tasks)
|
|
|
335
|
var taskIds []int64
|
334
|
var taskIds []int64
|
336
|
for _, task := range tasks {
|
335
|
for _, task := range tasks {
|
337
|
taskIds = append(taskIds, task.TaskId)
|
336
|
taskIds = append(taskIds, task.TaskId)
|
338
|
}
|
337
|
}
|
339
|
if count, offTaskRecords, err := offTaskRecordRepository.Find(map[string]interface{}{
|
338
|
if count, offTaskRecords, err := offTaskRecordRepository.Find(map[string]interface{}{
|
340
|
"taskIds": taskIds,
|
339
|
"taskIds": taskIds,
|
341
|
- "customerValue": searchOffTaskRecordCommand.CustomerValue,
|
|
|
342
|
"offStartTime": searchOffTaskRecordCommand.OffStartTime,
|
340
|
"offStartTime": searchOffTaskRecordCommand.OffStartTime,
|
343
|
"offEndTime": searchOffTaskRecordCommand.OffEndTime,
|
341
|
"offEndTime": searchOffTaskRecordCommand.OffEndTime,
|
|
|
342
|
+ "offset": searchOffTaskRecordCommand.Offset,
|
344
|
"limit": searchOffTaskRecordCommand.Limit,
|
343
|
"limit": searchOffTaskRecordCommand.Limit,
|
345
|
}); err != nil {
|
344
|
}); err != nil {
|
346
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
345
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
@@ -348,6 +347,13 @@ func (taskService *TaskService) SearchOffTaskRecord(searchOffTaskRecordCommand * |
|
@@ -348,6 +347,13 @@ func (taskService *TaskService) SearchOffTaskRecord(searchOffTaskRecordCommand * |
348
|
if err := transactionContext.CommitTransaction(); err != nil {
|
347
|
if err := transactionContext.CommitTransaction(); err != nil {
|
349
|
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
|
348
|
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
|
350
|
}
|
349
|
}
|
|
|
350
|
+ for _, offTaskRecord := range offTaskRecords {
|
|
|
351
|
+ for _, task := range tasks {
|
|
|
352
|
+ if offTaskRecord.Task.TaskId == task.TaskId {
|
|
|
353
|
+ offTaskRecord.Task = task
|
|
|
354
|
+ }
|
|
|
355
|
+ }
|
|
|
356
|
+ }
|
351
|
return map[string]interface{}{
|
357
|
return map[string]interface{}{
|
352
|
"count": count,
|
358
|
"count": count,
|
353
|
"offTaskRecords": offTaskRecords,
|
359
|
"offTaskRecords": offTaskRecords,
|