...
|
...
|
@@ -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)
|
|
|
} |
...
|
...
|
|