要实现POI导出EXCEL形如

--A1(LV1)

----B1(LV2)

----B2(LV2)

------C1(LV3)

------C2(LV3)

----B3(LV2)

--A1(LV1)

aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAl4AAAGKCAIAAABSBNh1AAAgAElEQVR4nO2dz4o1S1bF85FqdJ5GURQbRWnxKYTCkbPvMWpQkwLhUBMnPeqBLdX3crEVabk09hscByWn4mRE7IzMjJUrY33rx+ZSJ/LP2fuj7lq1I/LP9PMf/vjzH/74j//0zy+vbz/95++hccBXOBzfQ7w/P93+7U/04v35if5viwhV6ROua7I1OhzDxfvz0+3f/1QvbI1jhXBdtkaHY7x4f366ffyZXtgaxwrhurDW+Ovf/PA9/DsqxeVyoefgWIz356fbb/8cGpcM9Dfefvvnh1njrDT01x0gfQdXxKrrmNKw1vjr3/zwL+//evC/o2Nn2BqHiPfnp9uPf4GOy+USfETEMdY4+yXXsMZZIYdZyMF1HVMa0Bo/fdHWOFZ8/s7ZHc8f789Pt5/+Eh2XyyX4iIgDrDH/9Za0Rsm6juyGIdZ490Vb41hhaxwl3p+fbv/xV+i4XC7Fn3FBscYDwtbYpa6xrTH1RVvjWGFrHCXen59uv/sFOh4WGvFfd/vdL2yNHUtTssbj11A7W+PMF22NY4WtcZR4f366/ddfo+NyuRR/xoWtsWNpStZ4WEX3unpaY+6LtsaBgnKFm2NbvD8/3f77b9BxuVyCj4iwNXYszda4p65u1lj0RVvjQHH85W2OzfH+/HT7/d+i43K5BB8R4ctwOpamWtcB0c0aa75oaxwobI0Dxfvz0+1//g4dl8sl+IiI42/eUL3JQbWuY0rz03Ac/x/pPKrnVM8f789Pt59/CY1LBvobbz//8vhb/o/5Ot/y36uuwyzf1uhwjBfvz0+3P/y9XvhBcWOFcF22RodjvHh/frr97z/oha1xrBCu68EaHQ7HEPH+/KQa9H9bh+MltcZjrPhmjNnPNEnGt19pxlUU9v8GMH412RqNGRC2h9kabY1XWyPIGqdpKv6cfywyZfT6ZzHm7LA9zNZoa7zaG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ltMNP4iugg6HHmw1QOCsNSyU4AgXNe6mzfWNpFQa/y2ZH61CdXFkfatDgcr2OoBQVhq2SlAEK5rjJs3PiOdIE0Hg/1bBm2NjhGDrR4QhKWWnQIE4bpWWOOMfOti35laYyPpzumx6Q8192q3xpYcHI5TBVs9IAhLLTsFCMJ1jfQM1c8ozpcWPcxdo0M42OoBQVhq2SlAEK5rPGt0OBzfbI1D4brG4sEaX17fDoirMaYH9NegOxzCcXTXyNYTY0Rg/2EN4UO3C2GnAEG4LlujMUPCVg8IwlLLTgGCcF0jWeM0TfsFJT/J4hWq+7/UmO6w1QOCsNSyU4AgXBfTGtd60n2k3b3uW9Nja6etnSFWKGMosNUDgrDUslOAIFzXMF3jzKLSj0EjmB9iazQasNUDgrDUslOAIFzXugfFFe/3/6nhOTg7rTHv+WJrLI7bGo0SbPWAICy17BQgCNfV4VXGjY/C2WmNs0YwmCBNj8r3CVrMxnldY84AWz0gCEstOwUIwnV1eIbqAV3jJ7nDFX2r6G1eazRisNUDgrDUslOAIFzXxrXG462xNjsa9HbFZtHWaDRgqwcEYallpwBBuK4t1thxrbFxGnPRz2rTpLmg5Oe3NZoRYasHBGGpZacAQbiu1dbY8tbGI9caix+vjxYYmG6+NTZpY04CWz0gCEstOwUIwnWts8aaBR6z1pgS2OT1cSVybQO6aqsxLNjqAUFYatkpQBCua93NGxs24azxumR+tQnVxZH2rcawYKsHBGGpZacAQbiuwa5Qzb0wsC5boxGGrR4QhKWWnQIE4bpWWOOM4jh0rTH9mP5Qc692a/RaoxkOtnpAEJZadgoQhOuiPShu0ZBqtlScLy3u7K7RCMNWDwjCUstOAYJwXcM8Q9UYk8JWDwjCUstOAYJwXf8HHhR7hCryAI8AAAAASUVORK5CYII=" alt="" />

一.能用到的数据字段

ID(主键)、PID(父科目ID)、NAME(名称)、LEVEL(当前层级)

二.思路:

定义一个空的科目列表用来存放已经排好序的科目。创建一个迭代器传入父节点查出它的所有子节点,遍历子节点插入到科目列表的同时再次调用这个迭代器,这样程序能够在插入一个节点后如果发现有子节点继续插入子节点。最后返回排好序的科目树。

三.JAVA代码

/**
*
* <p>Description: 根据根节点获取嵌套科目树</p>
* @param root 根节点,只需itemCode
* @return 嵌套科目树
*/
public List<Subject> getSubjectListByRoot(Subject root){
//定义一个空的科目列表
List<Subject> subjectTree = new ArrayList<Subject>();
//查询出根节点的具体信息
root = this.subjectManager.searchSubjectByCode(root.getItemCode());
//将根节点插入到嵌套科目树里,因为迭代出来的科目树是没有根节点的
subjectTree.add(root);
//调用迭代器
subjectTree = SubjectIteration(root, subjectTree);
return subjectTree;
} /**
*
* <p>Description: 嵌套科目树迭代器</p>
* @param subject 父节点
* @param subjectTree 科目树
* @return 嵌套科目树
*/
public List<Subject> SubjectIteration(Subject subject, List<Subject> subjectTree) {
//根据父节点查子节点
List<Subject> subjects = this.subjectManager.searchListSubjectByParent(subject);
if (subjects != null) {
//遍历子节点并迭代
for (Subject subjectResult : subjects) {
//将节点插入到嵌套科目树里
subjectTree.add(subjectResult);
SubjectIteration(subjectResult,subjectTree);
}
}
return subjectTree;
}

四.SQL

根据父节点查子节点的一段SQL只需比对父节点的ID和子节点的PID即可

五.POI导出

/**
*
* <p>Description: 科目树导出</p>
* @param request
* @param response
* @return Excel文件
* @throws Exception
*/
public ModelAndView downloadExcel(HttpServletRequest request,
HttpServletResponse response) throws Exception {
//文件配置
String fileName = new String(("科目导出文件.xls").getBytes("UTF-8"), "iso-8859-1");
response.reset();
response.setHeader("Content-disposition", "attachment;filename=" + fileName);
response.setContentType("application/vnd.ms-excel;charset=utf-8");
//创建POI-workbook文件
XSSFWorkbook workbook = new XSSFWorkbook();
XSSFSheet sheet = workbook.createSheet("科目树");
//插入抬头
PoiUtil.addRowSXSSF(sheet, 0, new String[] { "说明:", "level1", "level2", "level3", "level4", "level5", "level6",
"level7", "level8" });
//调整sheet样式
//红
CellStyle styleRed = workbook.createCellStyle();
styleRed.setFillPattern(XSSFCellStyle.SOLID_FOREGROUND);
styleRed.setFillForegroundColor(IndexedColors.RED.index);
//绿
CellStyle styleGreen = workbook.createCellStyle();
styleGreen.setFillPattern(XSSFCellStyle.SOLID_FOREGROUND);
styleGreen.setFillForegroundColor(IndexedColors.LIME.index);
//灰
CellStyle styleGrey = workbook.createCellStyle();
styleGrey.setFillPattern(XSSFCellStyle.SOLID_FOREGROUND);
styleGrey.setFillForegroundColor(IndexedColors.GREY_25_PERCENT.index);
//白
CellStyle styleWhite = workbook.createCellStyle();
styleWhite.setFillPattern(XSSFCellStyle.SOLID_FOREGROUND);
styleWhite.setFillForegroundColor(IndexedColors.WHITE.index);
//金黄
CellStyle styleGold = workbook.createCellStyle();
styleGold.setFillPattern(XSSFCellStyle.SOLID_FOREGROUND);
styleGold.setFillForegroundColor(IndexedColors.GOLD.index);
//黄
CellStyle styleYellow = workbook.createCellStyle();
styleYellow.setFillPattern(XSSFCellStyle.SOLID_FOREGROUND);
styleYellow.setFillForegroundColor(IndexedColors.YELLOW.index);
//亮黄
CellStyle styleLight = workbook.createCellStyle();
styleLight.setFillPattern(XSSFCellStyle.SOLID_FOREGROUND);
styleLight.setFillForegroundColor(IndexedColors.LIGHT_YELLOW.index);
//柠檬
CellStyle styleLemon = workbook.createCellStyle();
styleLemon.setFillPattern(XSSFCellStyle.SOLID_FOREGROUND);
styleLemon.setFillForegroundColor(IndexedColors.LEMON_CHIFFON.index);
//设置抬头颜色
XSSFRow row = sheet.getRow(0);
Cell cell = row.getCell(1);
cell.setCellStyle(styleRed);
cell = row.getCell(2);
cell.setCellStyle(styleGreen);
cell = row.getCell(3);
cell.setCellStyle(styleGrey);
cell = row.getCell(4);
cell.setCellStyle(styleWhite);
cell = row.getCell(5);
cell.setCellStyle(styleGold);
cell = row.getCell(6);
cell.setCellStyle(styleYellow);
cell = row.getCell(7);
cell.setCellStyle(styleLight);
cell = row.getCell(8);
cell.setCellStyle(styleLemon);
//查询Excel用科目树
List<Subject> subjectTree = new ArrayList<Subject>();
Subject root = new Subject();
root.setItemCode("1001");
subjectTree = getSubjectListByRoot(root);
//插入数据
int index = 0;
for(Subject subject : subjectTree){
index = index + 1;
Row dataRow = sheet.createRow(index);
String lv = subject.getLevel();
if(lv.equals("1")){
Cell dataCell = dataRow.createCell(0);
dataCell.setCellValue(subject.getItemName());
dataCell.setCellStyle(styleRed);
}
else if(lv.equals("2")){
Cell dataCell = dataRow.createCell(0);
dataCell.setCellValue(subject.getItemName());
dataCell.setCellStyle(styleGreen);
}
else if(lv.equals("3")){
Cell dataCell = dataRow.createCell(0);
dataCell.setCellValue(subject.getItemName());
dataCell.setCellStyle(styleGrey);
}
else if(lv.equals("4")){
Cell dataCell = dataRow.createCell(0);
dataCell.setCellValue(subject.getItemName());
dataCell.setCellStyle(styleWhite);
}
else if(lv.equals("5")){
Cell dataCell = dataRow.createCell(0);
dataCell.setCellValue(subject.getItemName());
dataCell.setCellStyle(styleGold);
}
else if(lv.equals("6")){
Cell dataCell = dataRow.createCell(0);
dataCell.setCellValue(subject.getItemName());
dataCell.setCellStyle(styleYellow);
}
else if(lv.equals("7")){
Cell dataCell = dataRow.createCell(0);
dataCell.setCellValue(subject.getItemName());
dataCell.setCellStyle(styleLight);
}
else if(lv.equals("8")){
Cell dataCell = dataRow.createCell(0);
dataCell.setCellValue(subject.getItemName());
dataCell.setCellStyle(styleLemon);
}
}
sheet.setColumnWidth(0, 9000);
//创建输出流,生成文件
OutputStream out = new BufferedOutputStream(response.getOutputStream());
workbook.write(out);
out.flush();
out.close();
return null;
}

JAVA代码实现嵌套层级列表,POI导出嵌套层级列表的更多相关文章

  1. AndroidStudio中使用XML和Java代码混合控制UI界面实现QQ相册照片列表页面

    场景 效果 注: 博客: https://blog.csdn.net/badao_liumang_qizhi 关注公众号 霸道的程序猿 获取编程相关电子书.教程推送与免费下载. 实现 新建Androi ...

  2. java 通过Apache poi导出excel代码demo实例

    package com.zuidaima.excel.util; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutput ...

  3. Java POI 导出EXCEL经典实现 Java导出Excel

    转自http://blog.csdn.net/evangel_z/article/details/7332535 在web开发中,有一个经典的功能,就是数据的导入导出.特别是数据的导出,在生产管理或者 ...

  4. Java使用POI导出excel(下)——实例与小技巧

    [更新]:thinkgem的导出工具类: /** * Copyright © 2012-2016 <a href="https://github.com/thinkgem/jeesit ...

  5. 重构:以Java POI 导出EXCEL为例

    重构 开头先抛出几个问题吧,这几个问题也是<重构:改善既有代码的设计>这本书第2章的问题. 什么是重构? 为什么要重构? 什么时候要重构? 接下来就从这几个问题出发,通过这几个问题来系统的 ...

  6. 重构:以Java POI 导出EXCEL为例2

    前言 上一篇博文已经将一些对象抽象成成员变量以及将一些代码块提炼成函数.这一节将会继续重构原有的代码,将一些函数抽象成类,增加成员变量,将传入的参数合成类等等. 上一篇博文地址:http://www. ...

  7. Java之POI导出Excel(一):单sheet

    相信在大部分的web项目中都会有导出导入Excel的需求,今天我们就来看看如何用Java代码去实现 用POI导出Excel表格. 一.pom引用 pom文件中,添加以下依赖 查看代码  <!-- ...

  8. [改善Java代码]列表相等只需关系元素数据

    来看一个判断列表相等的例子,看代码: import java.util.ArrayList; import java.util.Vector; public class Client { public ...

  9. java中使用poi导出excel表格数据并且可以手动修改导出路径

    在我们开发项目中,很多时候会提出这样的需求:将前端的某某数据以excel表格导出,今天就给大家写一个简单的模板. 这里我们选择使用poi导出excel: 第一步:导入需要的jar包到 lib 文件夹下

随机推荐

  1. Pipeline in scala——给scala添加管道操作

     linux系统中管道这一功能相信大家肯定使用过,比如现在想找到用户目录下文件名包含db的所有文件,ls ~的结果,作为grep db的参数: ➜ ~ ls ~ | grep db kv.mv.db ...

  2. ASP.NET MVC下自定义错误页和展示错误页的几种方式

    在网站运行中,错误是不可避免的,错误页的产生也是不可缺少的. 这几天看了博友的很多文章,自己想总结下我从中学到的和实际中配置的. 首先,需要知道产生错误页的来源,一种是我们的.NET平台抛出的,一种是 ...

  3. HTML5 给图形绘制阴影(绘制五角星示例)

    几个属性 shadowOffsetX:阴影的横向位移量. shadowOffsetY:阴影的纵向位移量. shadowColor:阴影的颜色. shadowBlur:阴影的模糊范围. 属性说明 sha ...

  4. whereis 命令详解

    whereis 作用:whereis命令只能用于程序名的搜索,而且只搜索二进制文件(参数-b).man说明文件(参数-m)和源代码文件(参数-s).如果省略参数,则返回所有信息.  参数:-b 定位可 ...

  5. mkdir 命令详解

    rmdir  <man.linuxde.net> 作用: rmdir 命令用来创建目录,该命令创建由dirname 命名的目录.如果在目录名的前面没有添加任何路径名,则在当前目录下创建由d ...

  6. Python-String字符串的相关方法

  7. 3、树莓派的配置:改静态IP、连接ssh、安装中文字体、安装谷歌输入法、增加USB电流、修改触摸屏分辨率、扩展sd卡空间、修复vi和vim乱码问题、安装配置远程桌面vnc

    本博文仅作本人操作过程的记录,留作备忘.自强不息 QQ1222698 1.连接上HDMI线,插上触摸屏,插上键盘,鼠标,网线,启动.系统正常启动,但是一直闪烁,不停的黑屏,是由于触摸屏的usb口供电不 ...

  8. 豹哥嵌入式讲堂:ARM开发中有用的文件(1)- source文件

    大家好,我是豹哥,猎豹的豹,犀利哥的哥.今天豹哥给大家讲的是嵌入式开发里的source文件种类. 众所周知,嵌入式开发属于偏底层的开发,主要编程语言是C和汇编.所以本文要讲的source文件主要指的就 ...

  9. C# new关键字和对象类型转换(双括号、is操作符、as操作符)

    一.new关键字 CLR要求所有的对象都通过new来创建,代码如下: Object obj=new Object(); 以下是new操作符做的事情 1.计算类型及其所有基类型(一直到System.Ob ...

  10. CSS学习之首页简单布局

    作为一个PHPer,在前端方面javascript.jquery这些的日常工作还搞的定.可对于div+css这些东西可就头疼了,所以现在开始学习CSS 跟着燕十八的教程开始从最基础学起,首先练习一个简 ...