...
|
...
|
@@ -538,6 +538,14 @@ func (taskService *TaskService) UpdateTask(updateTaskCommand *command.UpdateTask |
|
|
} else {
|
|
|
taskRepository = value
|
|
|
}
|
|
|
var taskDao *dao.TaskDao
|
|
|
if value, err := factory.CreateTaskDao(map[string]interface{}{
|
|
|
"transactionContext": transactionContext,
|
|
|
}); err != nil {
|
|
|
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
|
|
|
} else {
|
|
|
taskDao = value
|
|
|
}
|
|
|
task, err := taskRepository.FindOne(map[string]interface{}{"taskId": updateTaskCommand.TaskId})
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
...
|
...
|
@@ -551,6 +559,11 @@ func (taskService *TaskService) UpdateTask(updateTaskCommand *command.UpdateTask |
|
|
if task, err := taskRepository.Save(task); err != nil {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
} else {
|
|
|
if task.TaskType == domain.TASK_TYPE_BID {
|
|
|
if err := taskDao.UpdateBidInfo(updateTaskCommand.TaskId, updateTaskCommand.BidStartTime, updateTaskCommand.BidEndTime); err != nil {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
}
|
|
|
}
|
|
|
if err := transactionContext.CommitTransaction(); err != nil {
|
|
|
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
|
|
|
}
|
...
|
...
|
|