作者 Your Name

Merge branch 'dev-tangxvhui' into test

@@ -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() {
@@ -12,7 +12,7 @@ func init() { @@ -12,7 +12,7 @@ func init() {
12 web.NSBefore(filters.AllowCors(), middlewares.CheckFontToken()), 12 web.NSBefore(filters.AllowCors(), middlewares.CheckFontToken()),
13 web.NSCtrlPost("/search/me", (*controllers.StaffAssessController).SearchAssessTaskMe), //获取我参与过的评估项目列表 13 web.NSCtrlPost("/search/me", (*controllers.StaffAssessController).SearchAssessTaskMe), //获取我参与过的评估项目列表
14 web.NSCtrlPost("/desc/me", (*controllers.StaffAssessController).AssessTaskMeDesc), //获取我的项目评估进度描述 14 web.NSCtrlPost("/desc/me", (*controllers.StaffAssessController).AssessTaskMeDesc), //获取我的项目评估进度描述
15 - web.NSCtrlPost("/", (*controllers.StaffAssessController).CreateStaffAssessTask), //创建员工的评估任务 15 + // web.NSCtrlPost("/", (*controllers.StaffAssessController).CreateStaffAssessTask), //创建员工的评估任务
16 ) 16 )
17 // /v1/staff-assess/self/me/list 17 // /v1/staff-assess/self/me/list
18 assessNS := web.NewNamespace("/v1/staff-assess", 18 assessNS := web.NewNamespace("/v1/staff-assess",