|
@@ -330,17 +330,17 @@ func (srv StaffAssessServeice) AssessSelfList(param *query.AssessSelfListQuery) |
|
@@ -330,17 +330,17 @@ func (srv StaffAssessServeice) AssessSelfList(param *query.AssessSelfListQuery) |
|
330
|
}
|
330
|
}
|
|
331
|
|
331
|
|
|
332
|
// 根据项目评估的配置,创建员工的评估任务
|
332
|
// 根据项目评估的配置,创建员工的评估任务
|
|
333
|
-func (srv StaffAssessServeice) CreateStaffAssessTask(param *command.CreateStaffAssessTask) (map[string]interface{}, error) {
|
|
|
|
334
|
- transactionContext, err := factory.CreateTransactionContext(nil)
|
|
|
|
335
|
- if err != nil {
|
|
|
|
336
|
- return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
|
|
|
|
337
|
- }
|
|
|
|
338
|
- if err := transactionContext.StartTransaction(); err != nil {
|
|
|
|
339
|
- return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
|
|
|
|
340
|
- }
|
|
|
|
341
|
- defer func() {
|
|
|
|
342
|
- _ = transactionContext.RollbackTransaction()
|
|
|
|
343
|
- }()
|
333
|
+func (srv StaffAssessServeice) CreateStaffAssessTask(transactionContext application.TransactionContext, param *command.CreateStaffAssessTask) (map[string]interface{}, error) {
|
|
|
|
334
|
+ // transactionContext, err := factory.CreateTransactionContext(nil)
|
|
|
|
335
|
+ // if err != nil {
|
|
|
|
336
|
+ // return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
|
|
|
|
337
|
+ // }
|
|
|
|
338
|
+ // if err := transactionContext.StartTransaction(); err != nil {
|
|
|
|
339
|
+ // return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
|
|
|
|
340
|
+ // }
|
|
|
|
341
|
+ // defer func() {
|
|
|
|
342
|
+ // _ = transactionContext.RollbackTransaction()
|
|
|
|
343
|
+ // }()
|
|
344
|
assessTaskRepo := factory.CreateStaffAssessTaskRepository(map[string]interface{}{
|
344
|
assessTaskRepo := factory.CreateStaffAssessTaskRepository(map[string]interface{}{
|
|
345
|
"transactionContext": transactionContext,
|
345
|
"transactionContext": transactionContext,
|
|
346
|
})
|
346
|
})
|
|
@@ -449,9 +449,9 @@ func (srv StaffAssessServeice) CreateStaffAssessTask(param *command.CreateStaffA |
|
@@ -449,9 +449,9 @@ func (srv StaffAssessServeice) CreateStaffAssessTask(param *command.CreateStaffA |
|
449
|
}
|
449
|
}
|
|
450
|
}
|
450
|
}
|
|
451
|
|
451
|
|
|
452
|
- if err := transactionContext.CommitTransaction(); err != nil {
|
|
|
|
453
|
- return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
|
454
|
- }
|
452
|
+ // if err := transactionContext.CommitTransaction(); err != nil {
|
|
|
|
453
|
+ // return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
|
454
|
+ // }
|
|
455
|
return map[string]interface{}{
|
455
|
return map[string]interface{}{
|
|
456
|
"assessTaskId": assessTaskData.Id,
|
456
|
"assessTaskId": assessTaskData.Id,
|
|
457
|
}, nil
|
457
|
}, nil
|