作者 Your Name

更新接口

... ... @@ -553,6 +553,7 @@ func (srv StaffAssessServeice) AnalysisData(param *query.ListAssessContentCycleD
return &result, nil
}
// 员工绩效-综合管理-导出绩效指标
func (srv StaffAssessServeice) ExportUserAssess2(param *query.SummaryCommand) (*excelize.File, error) {
transactionContext, err := factory.CreateTransactionContext(nil)
if err != nil {
... ...
... ... @@ -420,3 +420,30 @@ func (c *StaffAssessController) AnalysisData() {
data, err := srv.AnalysisData(paramReq)
c.Response(data, err)
}
// 根据周期里的考核日期,获取员工填写评估内容列表,导出为xlsx文件
func (c *StaffAssessController) ExportUserAssess2() {
srv := service.NewStaffAssessServeice()
paramReq := &query.SummaryCommand{}
err := c.BindJSON(paramReq)
if err != nil {
e := application.ThrowError(application.ARG_ERROR, "json 解析错误"+err.Error())
c.Response(nil, e)
return
}
userReq := middlewares.GetUser(c.Ctx)
paramReq.CompanyId = int(userReq.CompanyId)
paramReq.OperatorId = int(userReq.UserId)
data, err := srv.ExportUserAssess2(paramReq)
if err != nil {
c.Response(nil, err)
return
}
fileName := "个人绩效评估等级统计表"
c.Ctx.Output.Header("Content-Disposition", "attachment;filename="+fileName)
c.Ctx.Output.Header("Content-Description", "FileTransfer")
c.Ctx.Output.Header("Content-Type", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet")
c.Ctx.Output.Header("Content-Transfer-Encoding", "binary")
c.Ctx.Output.Header("Expires", "0")
data.Write(c.Ctx.ResponseWriter)
}
... ...
... ... @@ -18,6 +18,7 @@ func init() {
web.NSCtrlPost("/cycle/day/content", (*controllers.StaffAssessController).ListAssessContentCycleDay), //根据周期里的考核日期,获取员工填写评估内容列表
web.NSCtrlPost("/cycle/day/content/export", (*controllers.StaffAssessController).ExportAssessContentCycleDay), //根据周期里的考核日期,导出员工填写评估内容列表
web.NSCtrlPost("/cycle/day/analysis", (*controllers.StaffAssessController).AnalysisData), //员工绩效-项目管理-矩阵分析
web.NSCtrlPost("/cycle/day/content/export2", (*controllers.StaffAssessController).ExportUserAssess2), //员工绩效-综合管理-导出绩效指标
)
assessNS := web.NewNamespace("/v1/staff-assess",
... ...