| | |
| | | stuStudent.setClassId(classId); |
| | | save(stuStudent); |
| | | }else { |
| | | return new Result(false,"班级不存在或学生不存在"); |
| | | return new Result(false,"班级不存在或学生不存在"); |
| | | } |
| | | } |
| | | |
| | |
| | | List<StuStudent> stuStudents = find(hql.toString(), args, StuStudent.class); |
| | | |
| | | ExcelExportUtils<StuStudent> ex = new ExcelExportUtils<StuStudent>(); |
| | | String[] headers = { "姓名", "性别" ,"手机号" ,"身份证"}; |
| | | String[] headers = { "姓名", "性别" ,"手机号" ,"身份证"}; |
| | | List<StuStudent> dataset = new ArrayList<StuStudent>(); |
| | | for (StuStudent stuStudent: |
| | | stuStudents) { |
| | |
| | | obj.setOut(out); |
| | | ex.exportExcel(obj); |
| | | out.close(); |
| | | System.out.println("excel导出成功!"); |
| | | System.out.println("excel导出成功!"); |
| | | } catch (FileNotFoundException e) { |
| | | e.printStackTrace(); |
| | | } catch (IOException e) { |
| | |
| | | obj.setOut(out); |
| | | ex.exportExcelByColomn(obj); |
| | | out.close(); |
| | | System.out.println("excel指定列导出成功!"); |
| | | System.out.println("excel指定列导出成功!"); |
| | | } catch (FileNotFoundException e) { |
| | | e.printStackTrace(); |
| | | } catch (IOException e) { |