|
@@ -530,6 +530,43 @@ public class ApiManagerTeacherController extends BaseController {
|
|
|
return response;
|
|
|
}
|
|
|
|
|
|
+ @RequestMapping(value = "/exportRegisterList", method = RequestMethod.GET)
|
|
|
+ @ApiOperation(value = "导出注册老师列表", notes = "导出注册老师列表")
|
|
|
+ @ResponseBody
|
|
|
+ public void exportRegisterList(@RequestParam(name = "accessToken") String accessToken,String searchKey) {
|
|
|
+ ServletOutputStream os = null;
|
|
|
+ try {
|
|
|
+ String libName="注册老师";
|
|
|
+ //获得输出流
|
|
|
+ os = response.getOutputStream();
|
|
|
+ //清空输出流
|
|
|
+ response.reset();
|
|
|
+ exportExcelHead(response,libName);
|
|
|
+ Map<String,Object> params = new HashMap<>(2);
|
|
|
+ params.put("searchKey",searchKey);
|
|
|
+ List<Map<String,Object>> list = teacherEnrollment.findRegisterList(params);
|
|
|
+ String head = "姓名|name;电话|phone_number;类型|type;登记时间|create_time;";
|
|
|
+ List<ExcelExportEntity> entity = addEntity(head);
|
|
|
+ //把我们构造好的bean对象放到params就可以了
|
|
|
+ Workbook workbook = ExcelExportUtil.exportExcel(new ExportParams(libName, libName, ExcelType.XSSF), entity,
|
|
|
+ list);
|
|
|
+ workbook.write(os);
|
|
|
+ }catch (IOException e) {
|
|
|
+ logger.error("异常", e);
|
|
|
+ } catch (Exception e) {
|
|
|
+ logger.error("导出注册老师列表异常", e);
|
|
|
+ }finally {
|
|
|
+ if(os != null){
|
|
|
+ try {
|
|
|
+ os.flush();
|
|
|
+ os.close();
|
|
|
+ } catch (IOException e) {
|
|
|
+ logger.error("异常", e);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* ----------------解析文档相关功能-----------------------
|
|
|
*/
|