|
@@ -205,7 +205,7 @@ func compareStage(u *domain.UserAuth, id int, srcStage []*domain.TaskStage, newS |
|
@@ -205,7 +205,7 @@ func compareStage(u *domain.UserAuth, id int, srcStage []*domain.TaskStage, newS |
205
|
}
|
205
|
}
|
206
|
if it.PlanCompletedAt != v.PlanCompletedAt {
|
206
|
if it.PlanCompletedAt != v.PlanCompletedAt {
|
207
|
logOpt := createdLogOpt(u, taskId)
|
207
|
logOpt := createdLogOpt(u, taskId)
|
208
|
- logOpt.OptField = "修改了里程碑" + it.Name + "计划完成时间"
|
208
|
+ logOpt.OptField = "修改了里程碑" + it.Name + "的计划完成时间"
|
209
|
if it.PlanCompletedAt == 0 {
|
209
|
if it.PlanCompletedAt == 0 {
|
210
|
logOpt.OptValue = "未设置时间"
|
210
|
logOpt.OptValue = "未设置时间"
|
211
|
} else {
|
211
|
} else {
|
|
@@ -230,15 +230,24 @@ func getUserMap(ids []int) (map[int]*domain.User, error) { |
|
@@ -230,15 +230,24 @@ func getUserMap(ids []int) (map[int]*domain.User, error) { |
230
|
if len(ids) == 0 {
|
230
|
if len(ids) == 0 {
|
231
|
return userMap, nil
|
231
|
return userMap, nil
|
232
|
}
|
232
|
}
|
233
|
- transactionContext, err := factory.CreateTransactionContext(nil)
|
233
|
+
|
|
|
234
|
+ transactionContext, err := factory.StartTransaction()
|
234
|
if err != nil {
|
235
|
if err != nil {
|
235
|
return userMap, err
|
236
|
return userMap, err
|
236
|
}
|
237
|
}
|
|
|
238
|
+ defer func() {
|
|
|
239
|
+ _ = transactionContext.RollbackTransaction()
|
|
|
240
|
+ }()
|
|
|
241
|
+
|
237
|
userRepo := factory.CreateUserRepository(map[string]interface{}{"transactionContext": transactionContext})
|
242
|
userRepo := factory.CreateUserRepository(map[string]interface{}{"transactionContext": transactionContext})
|
238
|
_, users, err := userRepo.Find(map[string]interface{}{"ids": ids, "limit": len(ids)})
|
243
|
_, users, err := userRepo.Find(map[string]interface{}{"ids": ids, "limit": len(ids)})
|
239
|
if err != nil {
|
244
|
if err != nil {
|
240
|
return userMap, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
245
|
return userMap, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
241
|
}
|
246
|
}
|
|
|
247
|
+ if err := transactionContext.CommitTransaction(); err != nil {
|
|
|
248
|
+ return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
249
|
+ }
|
|
|
250
|
+
|
242
|
for i := range users {
|
251
|
for i := range users {
|
243
|
user := users[i]
|
252
|
user := users[i]
|
244
|
userMap[int(user.Id)] = user
|
253
|
userMap[int(user.Id)] = user
|