正在显示
3 个修改的文件
包含
28 行增加
和
28 行删除
@@ -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 |
@@ -67,19 +67,19 @@ func (c *StaffAssessController) AssessSelfMeList() { | @@ -67,19 +67,19 @@ func (c *StaffAssessController) AssessSelfMeList() { | ||
67 | } | 67 | } |
68 | 68 | ||
69 | // 更具项目评估的配置,创建员工的评估任务,(调试用) | 69 | // 更具项目评估的配置,创建员工的评估任务,(调试用) |
70 | -func (c *StaffAssessController) CreateStaffAssessTask() { | ||
71 | - srv := service.NewStaffAssessServeice() | ||
72 | - paramReq := &command.CreateStaffAssessTask{} | ||
73 | - err := c.BindJSON(paramReq) | ||
74 | - if err != nil { | ||
75 | - e := application.ThrowError(application.ARG_ERROR, "json 解析错误"+err.Error()) | ||
76 | - c.Response(nil, e) | ||
77 | - return | ||
78 | - } | ||
79 | - //服务调用,实际由定时任务触发 | ||
80 | - data, err := srv.CreateStaffAssessTask(paramReq) | ||
81 | - c.Response(data, err) | ||
82 | -} | 70 | +// func (c *StaffAssessController) CreateStaffAssessTask() { |
71 | +// srv := service.NewStaffAssessServeice() | ||
72 | +// paramReq := &command.CreateStaffAssessTask{} | ||
73 | +// err := c.BindJSON(paramReq) | ||
74 | +// if err != nil { | ||
75 | +// e := application.ThrowError(application.ARG_ERROR, "json 解析错误"+err.Error()) | ||
76 | +// c.Response(nil, e) | ||
77 | +// return | ||
78 | +// } | ||
79 | +// //服务调用,实际由定时任务触发 | ||
80 | +// data, err := srv.CreateStaffAssessTask(paramReq) | ||
81 | +// c.Response(data, err) | ||
82 | +// } | ||
83 | 83 | ||
84 | // 获取当前登录员工自评详情 | 84 | // 获取当前登录员工自评详情 |
85 | func (c *StaffAssessController) GetAssessSelfMeInfo() { | 85 | func (c *StaffAssessController) GetAssessSelfMeInfo() { |
@@ -10,7 +10,7 @@ func init() { | @@ -10,7 +10,7 @@ func init() { | ||
10 | // web.NSBefore(filters.AllowCors(), middlewares.CheckToken()), | 10 | // web.NSBefore(filters.AllowCors(), middlewares.CheckToken()), |
11 | web.NSCtrlPost("/search/me", (*controllers.StaffAssessController).SearchAssessTaskMe), //获取我参与过的评估项目列表 | 11 | web.NSCtrlPost("/search/me", (*controllers.StaffAssessController).SearchAssessTaskMe), //获取我参与过的评估项目列表 |
12 | web.NSCtrlPost("/desc/me", (*controllers.StaffAssessController).AssessTaskMeDesc), //获取我的项目评估进度描述 | 12 | web.NSCtrlPost("/desc/me", (*controllers.StaffAssessController).AssessTaskMeDesc), //获取我的项目评估进度描述 |
13 | - web.NSCtrlPost("/", (*controllers.StaffAssessController).CreateStaffAssessTask), //创建员工的评估任务 | 13 | + // web.NSCtrlPost("/", (*controllers.StaffAssessController).CreateStaffAssessTask), //创建员工的评估任务 |
14 | ) | 14 | ) |
15 | // /v1/staff-assess/self/me/list | 15 | // /v1/staff-assess/self/me/list |
16 | assessNS := web.NewNamespace("/v1/staff-assess", | 16 | assessNS := web.NewNamespace("/v1/staff-assess", |
-
请 注册 或 登录 后发表评论