作者 Your Name

更新接口

@@ -553,6 +553,7 @@ func (srv StaffAssessServeice) AnalysisData(param *query.ListAssessContentCycleD @@ -553,6 +553,7 @@ func (srv StaffAssessServeice) AnalysisData(param *query.ListAssessContentCycleD
553 return &result, nil 553 return &result, nil
554 } 554 }
555 555
  556 +// 员工绩效-综合管理-导出绩效指标
556 func (srv StaffAssessServeice) ExportUserAssess2(param *query.SummaryCommand) (*excelize.File, error) { 557 func (srv StaffAssessServeice) ExportUserAssess2(param *query.SummaryCommand) (*excelize.File, error) {
557 transactionContext, err := factory.CreateTransactionContext(nil) 558 transactionContext, err := factory.CreateTransactionContext(nil)
558 if err != nil { 559 if err != nil {
@@ -420,3 +420,30 @@ func (c *StaffAssessController) AnalysisData() { @@ -420,3 +420,30 @@ func (c *StaffAssessController) AnalysisData() {
420 data, err := srv.AnalysisData(paramReq) 420 data, err := srv.AnalysisData(paramReq)
421 c.Response(data, err) 421 c.Response(data, err)
422 } 422 }
  423 +
  424 +// 根据周期里的考核日期,获取员工填写评估内容列表,导出为xlsx文件
  425 +func (c *StaffAssessController) ExportUserAssess2() {
  426 + srv := service.NewStaffAssessServeice()
  427 + paramReq := &query.SummaryCommand{}
  428 + err := c.BindJSON(paramReq)
  429 + if err != nil {
  430 + e := application.ThrowError(application.ARG_ERROR, "json 解析错误"+err.Error())
  431 + c.Response(nil, e)
  432 + return
  433 + }
  434 + userReq := middlewares.GetUser(c.Ctx)
  435 + paramReq.CompanyId = int(userReq.CompanyId)
  436 + paramReq.OperatorId = int(userReq.UserId)
  437 + data, err := srv.ExportUserAssess2(paramReq)
  438 + if err != nil {
  439 + c.Response(nil, err)
  440 + return
  441 + }
  442 + fileName := "个人绩效评估等级统计表"
  443 + c.Ctx.Output.Header("Content-Disposition", "attachment;filename="+fileName)
  444 + c.Ctx.Output.Header("Content-Description", "FileTransfer")
  445 + c.Ctx.Output.Header("Content-Type", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet")
  446 + c.Ctx.Output.Header("Content-Transfer-Encoding", "binary")
  447 + c.Ctx.Output.Header("Expires", "0")
  448 + data.Write(c.Ctx.ResponseWriter)
  449 +}
@@ -18,6 +18,7 @@ func init() { @@ -18,6 +18,7 @@ func init() {
18 web.NSCtrlPost("/cycle/day/content", (*controllers.StaffAssessController).ListAssessContentCycleDay), //根据周期里的考核日期,获取员工填写评估内容列表 18 web.NSCtrlPost("/cycle/day/content", (*controllers.StaffAssessController).ListAssessContentCycleDay), //根据周期里的考核日期,获取员工填写评估内容列表
19 web.NSCtrlPost("/cycle/day/content/export", (*controllers.StaffAssessController).ExportAssessContentCycleDay), //根据周期里的考核日期,导出员工填写评估内容列表 19 web.NSCtrlPost("/cycle/day/content/export", (*controllers.StaffAssessController).ExportAssessContentCycleDay), //根据周期里的考核日期,导出员工填写评估内容列表
20 web.NSCtrlPost("/cycle/day/analysis", (*controllers.StaffAssessController).AnalysisData), //员工绩效-项目管理-矩阵分析 20 web.NSCtrlPost("/cycle/day/analysis", (*controllers.StaffAssessController).AnalysisData), //员工绩效-项目管理-矩阵分析
  21 + web.NSCtrlPost("/cycle/day/content/export2", (*controllers.StaffAssessController).ExportUserAssess2), //员工绩效-综合管理-导出绩效指标
21 ) 22 )
22 23
23 assessNS := web.NewNamespace("/v1/staff-assess", 24 assessNS := web.NewNamespace("/v1/staff-assess",