|
@@ -1023,6 +1023,7 @@ func (taskService *TaskService) UpdateTask(updateTaskCommand *command.UpdateTask |
|
@@ -1023,6 +1023,7 @@ func (taskService *TaskService) UpdateTask(updateTaskCommand *command.UpdateTask |
1023
|
defer func() {
|
1023
|
defer func() {
|
1024
|
transactionContext.RollbackTransaction()
|
1024
|
transactionContext.RollbackTransaction()
|
1025
|
}()
|
1025
|
}()
|
|
|
1026
|
+
|
1026
|
var taskRepository domain.TaskRepository
|
1027
|
var taskRepository domain.TaskRepository
|
1027
|
if value, err := factory.CreateTaskRepository(map[string]interface{}{
|
1028
|
if value, err := factory.CreateTaskRepository(map[string]interface{}{
|
1028
|
"transactionContext": transactionContext,
|
1029
|
"transactionContext": transactionContext,
|
|
@@ -1031,6 +1032,7 @@ func (taskService *TaskService) UpdateTask(updateTaskCommand *command.UpdateTask |
|
@@ -1031,6 +1032,7 @@ func (taskService *TaskService) UpdateTask(updateTaskCommand *command.UpdateTask |
1031
|
} else {
|
1032
|
} else {
|
1032
|
taskRepository = value
|
1033
|
taskRepository = value
|
1033
|
}
|
1034
|
}
|
|
|
1035
|
+
|
1034
|
var taskDao *dao.TaskDao
|
1036
|
var taskDao *dao.TaskDao
|
1035
|
if value, err := factory.CreateTaskDao(map[string]interface{}{
|
1037
|
if value, err := factory.CreateTaskDao(map[string]interface{}{
|
1036
|
"transactionContext": transactionContext,
|
1038
|
"transactionContext": transactionContext,
|
|
@@ -1039,6 +1041,7 @@ func (taskService *TaskService) UpdateTask(updateTaskCommand *command.UpdateTask |
|
@@ -1039,6 +1041,7 @@ func (taskService *TaskService) UpdateTask(updateTaskCommand *command.UpdateTask |
1039
|
} else {
|
1041
|
} else {
|
1040
|
taskDao = value
|
1042
|
taskDao = value
|
1041
|
}
|
1043
|
}
|
|
|
1044
|
+
|
1042
|
task, err := taskRepository.FindOne(map[string]interface{}{"taskId": updateTaskCommand.TaskId})
|
1045
|
task, err := taskRepository.FindOne(map[string]interface{}{"taskId": updateTaskCommand.TaskId})
|
1043
|
if err != nil {
|
1046
|
if err != nil {
|
1044
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
1047
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
@@ -1046,6 +1049,7 @@ func (taskService *TaskService) UpdateTask(updateTaskCommand *command.UpdateTask |
|
@@ -1046,6 +1049,7 @@ func (taskService *TaskService) UpdateTask(updateTaskCommand *command.UpdateTask |
1046
|
if task == nil {
|
1049
|
if task == nil {
|
1047
|
return nil, application.ThrowError(application.RES_NO_FIND_ERROR, fmt.Sprintf("%s", string(updateTaskCommand.TaskId)))
|
1050
|
return nil, application.ThrowError(application.RES_NO_FIND_ERROR, fmt.Sprintf("%s", string(updateTaskCommand.TaskId)))
|
1048
|
}
|
1051
|
}
|
|
|
1052
|
+
|
1049
|
if updateTaskCommand.ReferenceResourceItems != nil && len(updateTaskCommand.ReferenceResourceItems) > 0 {
|
1053
|
if updateTaskCommand.ReferenceResourceItems != nil && len(updateTaskCommand.ReferenceResourceItems) > 0 {
|
1050
|
var referenceResourceIds []int64
|
1054
|
var referenceResourceIds []int64
|
1051
|
for _, referenceResourceItem := range updateTaskCommand.ReferenceResourceItems {
|
1055
|
for _, referenceResourceItem := range updateTaskCommand.ReferenceResourceItems {
|
|
@@ -1068,8 +1072,11 @@ func (taskService *TaskService) UpdateTask(updateTaskCommand *command.UpdateTask |
|
@@ -1068,8 +1072,11 @@ func (taskService *TaskService) UpdateTask(updateTaskCommand *command.UpdateTask |
1068
|
}
|
1072
|
}
|
1069
|
}
|
1073
|
}
|
1070
|
}
|
1074
|
}
|
|
|
1075
|
+
|
1071
|
updateData := tool_funs.SimpleStructToMap(updateTaskCommand)
|
1076
|
updateData := tool_funs.SimpleStructToMap(updateTaskCommand)
|
|
|
1077
|
+
|
1072
|
fmt.Println(updateTaskCommand.AssignedPerson != int64(0))
|
1078
|
fmt.Println(updateTaskCommand.AssignedPerson != int64(0))
|
|
|
1079
|
+
|
1073
|
if task.TaskType == domain.TASK_TYPE_DESIGNATE {
|
1080
|
if task.TaskType == domain.TASK_TYPE_DESIGNATE {
|
1074
|
if updateTaskCommand.AssignedPerson != int64(0) {
|
1081
|
if updateTaskCommand.AssignedPerson != int64(0) {
|
1075
|
var employeeRepository domain.EmployeeRepository
|
1082
|
var employeeRepository domain.EmployeeRepository
|