目录

所需要的jar包

导入模板

实体类

ExcelUtil工具类

controller层导入

controller层导出


  • 所需要的jar包

jxl-2.6.jar

poi-3.17.jar

  • 导入模板

  • 实体类

package schooloa.bean;import schooloa.util.ExcelVOAttribute;public class ToolsList {private Integer id;@ExcelVOAttribute(name = "年份", column = "A")private String time;@ExcelVOAttribute(name = "学期", column = "B")private String semester;//学期@ExcelVOAttribute(name = "专业", column = "C")private String professional;@ExcelVOAttribute(name = "教师姓名", column = "D")private String teachername;@ExcelVOAttribute(name = "蓝圆珠笔", column = "E")private String lyzb;@ExcelVOAttribute(name = "红圆珠笔", column = "F")private String hyzb;@ExcelVOAttribute(name = "蓝圆珠笔芯", column = "G")private String lyzbx;@ExcelVOAttribute(name = "红圆珠笔芯", column = "H")private String hyzbx;@ExcelVOAttribute(name = "晨光0.5中性笔(黑)", column = "I")private String cgfivezxbh;@ExcelVOAttribute(name = "晨光0.5中性笔(红)", column = "J")private String cgfivezxbhong;@ExcelVOAttribute(name = "晨光0.7中性笔", column = "K")private String cgsevenzxb;@ExcelVOAttribute(name = "晨光1.0中性笔", column = "L")private String cgonezxb;@ExcelVOAttribute(name = "红蓝铅笔", column = "M")private String hlqb;@ExcelVOAttribute(name = "铅笔(2B)", column = "N")private String twobqb;@ExcelVOAttribute(name = "彩色铅笔", column = "O")private String csqb;@ExcelVOAttribute(name = "白板笔", column = "P")private String baibanbi;@ExcelVOAttribute(name = "白板笔油", column = "Q")private String baibanbiyou;@ExcelVOAttribute(name = "晨光0.5中性笔芯(黑)", column = "R")private String chengguangwuzhongxingbixinhei;@ExcelVOAttribute(name = "晨光0.5中性笔芯(红)", column = "S")private String chengguangwuzhongxingbixinhong;@ExcelVOAttribute(name = "晨光0.7中性笔芯", column = "T")private String chenguangqizhongxingbixin;@ExcelVOAttribute(name = "晨光1.0中性笔芯", column = "U")private String chenguangyizhongxingbixin;@ExcelVOAttribute(name = "油性记号笔", column = "V")private String youxingjihaobi;@ExcelVOAttribute(name = "大信笺", column = "W")private String daxinfa;@ExcelVOAttribute(name = "稿纸", column = "X")private String gaozhi;@ExcelVOAttribute(name = "牛皮纸档案袋", column = "Y")private String niupizhidangandai;@ExcelVOAttribute(name = "塑料档案袋", column = "Z")private String suliaodangandai;@ExcelVOAttribute(name = "透明窄胶带", column = "AA")private String toumingzhaijiaodai;@ExcelVOAttribute(name = "透明宽胶带", column = "AB")private String toumingkuangjiaodai;@ExcelVOAttribute(name = "双面窄胶带", column = "AC")private String shuangmianzhaijiaodai;@ExcelVOAttribute(name = "双面宽胶带", column = "AD")private String shuangmiankuanjiaodai;@ExcelVOAttribute(name = "泡沫双面胶带", column = "AE")private String paomoshuangmianjiaodai;@ExcelVOAttribute(name = "大红纸", column = "AF")private String dahongzhi;@ExcelVOAttribute(name = "宣纸", column = "AG")private String xuanzhi;@ExcelVOAttribute(name = "3.5得力档案盒", column = "AH")private String sanwudelidanganhe;@ExcelVOAttribute(name = "5.5得力档案盒", column = "AI")private String wuwudelidanganhe;@ExcelVOAttribute(name = "文件夹", column = "AJ")private String wenjianjia;@ExcelVOAttribute(name = "A4抽杆夹", column = "AK")private String asichouganjia;@ExcelVOAttribute(name = "锥子", column = "AL")private String zhuizi;@ExcelVOAttribute(name = "胶水", column = "AM")private String jiaoshui;@ExcelVOAttribute(name = "胶棒", column = "AN")private String jiaobang;@ExcelVOAttribute(name = "橡皮", column = "AO")private String xiangpi;@ExcelVOAttribute(name = "浆糊", column = "AP")private String jianghu;@ExcelVOAttribute(name = "墨汁", column = "AQ")private String mozhi;@ExcelVOAttribute(name = "PU皮黑硬皮本", column = "AR")private String pupiheiyingpiben;@ExcelVOAttribute(name = "软皮本", column = "AS")private String ruanpiben;@ExcelVOAttribute(name = "速写本", column = "AT")private String suxieben;@ExcelVOAttribute(name = "红印泥", column = "AU")private String hongyinni;@ExcelVOAttribute(name = "转笔刀", column = "AV")private String zhuanbidao;@ExcelVOAttribute(name = "壁纸刀", column = "AW")private String bizhidao;@ExcelVOAttribute(name = "剪刀", column = "AX")private String jiandao;@ExcelVOAttribute(name = "小刀", column = "AY")private String xiaodao;@ExcelVOAttribute(name = "得力订书机", column = "AZ")private String delidingshuji;@ExcelVOAttribute(name = "得力订书钉", column = "BA")private String delidingshuding;@ExcelVOAttribute(name = "计算器", column = "BB")private String jisuanqi;@ExcelVOAttribute(name = "得力函数计算器", column = "BC")private String delihanshujisuanqi;@ExcelVOAttribute(name = "口取纸", column = "BD")private String kouquzhi;@ExcelVOAttribute(name = "塑料长直尺30cm", column = "BE")private String suliaochangzhichisanshi;@ExcelVOAttribute(name = "塑料长直尺40cm", column = "BF")private String suliaochangzhichisishi;@ExcelVOAttribute(name = "得力长尾夹(大)", column = "BG")private String delichangweijiada;@ExcelVOAttribute(name = "得力长尾夹(中)", column = "BH")private String delichangweijiazhong;@ExcelVOAttribute(name = "得力长尾夹(小)", column = "BI")private String delichangweijiaxiao;@ExcelVOAttribute(name = "5号南孚电池", column = "BJ")private String wuhaonanfudianchi;@ExcelVOAttribute(name = "7号南孚电池", column = "BK")private String qihaonanfudianchi;@ExcelVOAttribute(name = "9V双鹿电池", column = "BL")private String jiufushuangludianchi;@ExcelVOAttribute(name = "得力回形针", column = "BM")private String delihuixingzhen;@ExcelVOAttribute(name = "得力起钉器", column = "BN")private String deliqidingqi;@ExcelVOAttribute(name = "塑料文件架", column = "BO")private String suliaowenjianjia;@ExcelVOAttribute(name = "塑料笔筒", column = "BP")private String suliaobitong;@ExcelVOAttribute(name = "木质笔筒", column = "BQ")private String muzhibitong;@ExcelVOAttribute(name = "1.8米插排", column = "BR")private String yidianbamichapai;@ExcelVOAttribute(name = "3米插排", column = "BS")private String sanmichapai;@ExcelVOAttribute(name = "5米插排", column = "BT")private String wumichapai;public Integer getId() {return id;}public void setId(Integer id) {this.id = id;}public String getTime() {return time;}public void setTime(String time) {this.time = time == null ? null : time.trim();}public String getSemester() {return semester;}public void setSemester(String semester) {this.semester = semester == null ? null : semester.trim();}public String getTeachername() {return teachername;}public void setTeachername(String teachername) {this.teachername = teachername == null ? null : teachername.trim();}public String getLyzb() {return lyzb;}public void setLyzb(String lyzb) {this.lyzb = lyzb == null ? null : lyzb.trim();}public String getHyzb() {return hyzb;}public void setHyzb(String hyzb) {this.hyzb = hyzb == null ? null : hyzb.trim();}public String getLyzbx() {return lyzbx;}public void setLyzbx(String lyzbx) {this.lyzbx = lyzbx == null ? null : lyzbx.trim();}public String getHyzbx() {return hyzbx;}public String getZhuizi() {return zhuizi;}public void setZhuizi(String zhuizi) {this.zhuizi = zhuizi;}public void setHyzbx(String hyzbx) {this.hyzbx = hyzbx == null ? null : hyzbx.trim();}public String getCgfivezxbh() {return cgfivezxbh;}public void setCgfivezxbh(String cgfivezxbh) {this.cgfivezxbh = cgfivezxbh == null ? null : cgfivezxbh.trim();}public String getCgfivezxbhong() {return cgfivezxbhong;}public void setCgfivezxbhong(String cgfivezxbhong) {this.cgfivezxbhong = cgfivezxbhong == null ? null : cgfivezxbhong.trim();}public String getCgsevenzxb() {return cgsevenzxb;}public void setCgsevenzxb(String cgsevenzxb) {this.cgsevenzxb = cgsevenzxb == null ? null : cgsevenzxb.trim();}public String getCgonezxb() {return cgonezxb;}public void setCgonezxb(String cgonezxb) {this.cgonezxb = cgonezxb == null ? null : cgonezxb.trim();}public String getHlqb() {return hlqb;}public void setHlqb(String hlqb) {this.hlqb = hlqb == null ? null : hlqb.trim();}public String getTwobqb() {return twobqb;}public void setTwobqb(String twobqb) {this.twobqb = twobqb == null ? null : twobqb.trim();}public String getCsqb() {return csqb;}public void setCsqb(String csqb) {this.csqb = csqb == null ? null : csqb.trim();}public String getBaibanbi() {return baibanbi;}public void setBaibanbi(String baibanbi) {this.baibanbi = baibanbi == null ? null : baibanbi.trim();}public String getBaibanbiyou() {return baibanbiyou;}public void setBaibanbiyou(String baibanbiyou) {this.baibanbiyou = baibanbiyou == null ? null : baibanbiyou.trim();}public String getChengguangwuzhongxingbixinhei() {return chengguangwuzhongxingbixinhei;}public void setChengguangwuzhongxingbixinhei(String chengguangwuzhongxingbixinhei) {this.chengguangwuzhongxingbixinhei = chengguangwuzhongxingbixinhei == null ? null : chengguangwuzhongxingbixinhei.trim();}public String getChengguangwuzhongxingbixinhong() {return chengguangwuzhongxingbixinhong;}public void setChengguangwuzhongxingbixinhong(String chengguangwuzhongxingbixinhong) {this.chengguangwuzhongxingbixinhong = chengguangwuzhongxingbixinhong == null ? null : chengguangwuzhongxingbixinhong.trim();}public String getChenguangqizhongxingbixin() {return chenguangqizhongxingbixin;}public void setChenguangqizhongxingbixin(String chenguangqizhongxingbixin) {this.chenguangqizhongxingbixin = chenguangqizhongxingbixin == null ? null : chenguangqizhongxingbixin.trim();}public String getChenguangyizhongxingbixin() {return chenguangyizhongxingbixin;}public void setChenguangyizhongxingbixin(String chenguangyizhongxingbixin) {this.chenguangyizhongxingbixin = chenguangyizhongxingbixin == null ? null : chenguangyizhongxingbixin.trim();}public String getYouxingjihaobi() {return youxingjihaobi;}public void setYouxingjihaobi(String youxingjihaobi) {this.youxingjihaobi = youxingjihaobi == null ? null : youxingjihaobi.trim();}public String getDaxinfa() {return daxinfa;}public void setDaxinfa(String daxinfa) {this.daxinfa = daxinfa == null ? null : daxinfa.trim();}public String getGaozhi() {return gaozhi;}public void setGaozhi(String gaozhi) {this.gaozhi = gaozhi == null ? null : gaozhi.trim();}public String getNiupizhidangandai() {return niupizhidangandai;}public void setNiupizhidangandai(String niupizhidangandai) {this.niupizhidangandai = niupizhidangandai == null ? null : niupizhidangandai.trim();}public String getSuliaodangandai() {return suliaodangandai;}public void setSuliaodangandai(String suliaodangandai) {this.suliaodangandai = suliaodangandai == null ? null : suliaodangandai.trim();}public String getToumingzhaijiaodai() {return toumingzhaijiaodai;}public void setToumingzhaijiaodai(String toumingzhaijiaodai) {this.toumingzhaijiaodai = toumingzhaijiaodai == null ? null : toumingzhaijiaodai.trim();}public String getToumingkuangjiaodai() {return toumingkuangjiaodai;}public void setToumingkuangjiaodai(String toumingkuangjiaodai) {this.toumingkuangjiaodai = toumingkuangjiaodai == null ? null : toumingkuangjiaodai.trim();}public String getShuangmianzhaijiaodai() {return shuangmianzhaijiaodai;}public void setShuangmianzhaijiaodai(String shuangmianzhaijiaodai) {this.shuangmianzhaijiaodai = shuangmianzhaijiaodai == null ? null : shuangmianzhaijiaodai.trim();}public String getShuangmiankuanjiaodai() {return shuangmiankuanjiaodai;}public void setShuangmiankuanjiaodai(String shuangmiankuanjiaodai) {this.shuangmiankuanjiaodai = shuangmiankuanjiaodai == null ? null : shuangmiankuanjiaodai.trim();}public String getPaomoshuangmianjiaodai() {return paomoshuangmianjiaodai;}public void setPaomoshuangmianjiaodai(String paomoshuangmianjiaodai) {this.paomoshuangmianjiaodai = paomoshuangmianjiaodai == null ? null : paomoshuangmianjiaodai.trim();}public String getDahongzhi() {return dahongzhi;}public void setDahongzhi(String dahongzhi) {this.dahongzhi = dahongzhi == null ? null : dahongzhi.trim();}public String getXuanzhi() {return xuanzhi;}public void setXuanzhi(String xuanzhi) {this.xuanzhi = xuanzhi == null ? null : xuanzhi.trim();}public String getSanwudelidanganhe() {return sanwudelidanganhe;}public void setSanwudelidanganhe(String sanwudelidanganhe) {this.sanwudelidanganhe = sanwudelidanganhe == null ? null : sanwudelidanganhe.trim();}public String getWuwudelidanganhe() {return wuwudelidanganhe;}public void setWuwudelidanganhe(String wuwudelidanganhe) {this.wuwudelidanganhe = wuwudelidanganhe == null ? null : wuwudelidanganhe.trim();}public String getWenjianjia() {return wenjianjia;}public void setWenjianjia(String wenjianjia) {this.wenjianjia = wenjianjia == null ? null : wenjianjia.trim();}public String getAsichouganjia() {return asichouganjia;}public void setAsichouganjia(String asichouganjia) {this.asichouganjia = asichouganjia == null ? null : asichouganjia.trim();}public String getJiaoshui() {return jiaoshui;}public void setJiaoshui(String jiaoshui) {this.jiaoshui = jiaoshui == null ? null : jiaoshui.trim();}public String getJiaobang() {return jiaobang;}public void setJiaobang(String jiaobang) {this.jiaobang = jiaobang == null ? null : jiaobang.trim();}public String getXiangpi() {return xiangpi;}public void setXiangpi(String xiangpi) {this.xiangpi = xiangpi == null ? null : xiangpi.trim();}public String getJianghu() {return jianghu;}public void setJianghu(String jianghu) {this.jianghu = jianghu == null ? null : jianghu.trim();}public String getMozhi() {return mozhi;}public void setMozhi(String mozhi) {this.mozhi = mozhi == null ? null : mozhi.trim();}public String getPupiheiyingpiben() {return pupiheiyingpiben;}public void setPupiheiyingpiben(String pupiheiyingpiben) {this.pupiheiyingpiben = pupiheiyingpiben == null ? null : pupiheiyingpiben.trim();}public String getRuanpiben() {return ruanpiben;}public void setRuanpiben(String ruanpiben) {this.ruanpiben = ruanpiben == null ? null : ruanpiben.trim();}public String getSuxieben() {return suxieben;}public void setSuxieben(String suxieben) {this.suxieben = suxieben == null ? null : suxieben.trim();}public String getHongyinni() {return hongyinni;}public void setHongyinni(String hongyinni) {this.hongyinni = hongyinni == null ? null : hongyinni.trim();}public String getZhuanbidao() {return zhuanbidao;}public void setZhuanbidao(String zhuanbidao) {this.zhuanbidao = zhuanbidao == null ? null : zhuanbidao.trim();}public String getBizhidao() {return bizhidao;}public void setBizhidao(String bizhidao) {this.bizhidao = bizhidao == null ? null : bizhidao.trim();}public String getJiandao() {return jiandao;}public void setJiandao(String jiandao) {this.jiandao = jiandao == null ? null : jiandao.trim();}public String getXiaodao() {return xiaodao;}public void setXiaodao(String xiaodao) {this.xiaodao = xiaodao == null ? null : xiaodao.trim();}public String getDelidingshuji() {return delidingshuji;}public void setDelidingshuji(String delidingshuji) {this.delidingshuji = delidingshuji == null ? null : delidingshuji.trim();}public String getDelidingshuding() {return delidingshuding;}public void setDelidingshuding(String delidingshuding) {this.delidingshuding = delidingshuding == null ? null : delidingshuding.trim();}public String getJisuanqi() {return jisuanqi;}public void setJisuanqi(String jisuanqi) {this.jisuanqi = jisuanqi == null ? null : jisuanqi.trim();}public String getDelihanshujisuanqi() {return delihanshujisuanqi;}public void setDelihanshujisuanqi(String delihanshujisuanqi) {this.delihanshujisuanqi = delihanshujisuanqi == null ? null : delihanshujisuanqi.trim();}public String getKouquzhi() {return kouquzhi;}public void setKouquzhi(String kouquzhi) {this.kouquzhi = kouquzhi == null ? null : kouquzhi.trim();}public String getSuliaochangzhichisanshi() {return suliaochangzhichisanshi;}public void setSuliaochangzhichisanshi(String suliaochangzhichisanshi) {this.suliaochangzhichisanshi = suliaochangzhichisanshi == null ? null : suliaochangzhichisanshi.trim();}public String getSuliaochangzhichisishi() {return suliaochangzhichisishi;}public void setSuliaochangzhichisishi(String suliaochangzhichisishi) {this.suliaochangzhichisishi = suliaochangzhichisishi == null ? null : suliaochangzhichisishi.trim();}public String getDelichangweijiada() {return delichangweijiada;}public void setDelichangweijiada(String delichangweijiada) {this.delichangweijiada = delichangweijiada == null ? null : delichangweijiada.trim();}public String getDelichangweijiazhong() {return delichangweijiazhong;}public void setDelichangweijiazhong(String delichangweijiazhong) {this.delichangweijiazhong = delichangweijiazhong == null ? null : delichangweijiazhong.trim();}public String getDelichangweijiaxiao() {return delichangweijiaxiao;}public void setDelichangweijiaxiao(String delichangweijiaxiao) {this.delichangweijiaxiao = delichangweijiaxiao == null ? null : delichangweijiaxiao.trim();}public String getWuhaonanfudianchi() {return wuhaonanfudianchi;}public void setWuhaonanfudianchi(String wuhaonanfudianchi) {this.wuhaonanfudianchi = wuhaonanfudianchi == null ? null : wuhaonanfudianchi.trim();}public String getQihaonanfudianchi() {return qihaonanfudianchi;}public void setQihaonanfudianchi(String qihaonanfudianchi) {this.qihaonanfudianchi = qihaonanfudianchi == null ? null : qihaonanfudianchi.trim();}public String getJiufushuangludianchi() {return jiufushuangludianchi;}public void setJiufushuangludianchi(String jiufushuangludianchi) {this.jiufushuangludianchi = jiufushuangludianchi == null ? null : jiufushuangludianchi.trim();}public String getDelihuixingzhen() {return delihuixingzhen;}public void setDelihuixingzhen(String delihuixingzhen) {this.delihuixingzhen = delihuixingzhen == null ? null : delihuixingzhen.trim();}public String getDeliqidingqi() {return deliqidingqi;}public void setDeliqidingqi(String deliqidingqi) {this.deliqidingqi = deliqidingqi == null ? null : deliqidingqi.trim();}public String getSuliaowenjianjia() {return suliaowenjianjia;}public void setSuliaowenjianjia(String suliaowenjianjia) {this.suliaowenjianjia = suliaowenjianjia == null ? null : suliaowenjianjia.trim();}public String getSuliaobitong() {return suliaobitong;}public void setSuliaobitong(String suliaobitong) {this.suliaobitong = suliaobitong == null ? null : suliaobitong.trim();}public String getMuzhibitong() {return muzhibitong;}public void setMuzhibitong(String muzhibitong) {this.muzhibitong = muzhibitong == null ? null : muzhibitong.trim();}public String getYidianbamichapai() {return yidianbamichapai;}public void setYidianbamichapai(String yidianbamichapai) {this.yidianbamichapai = yidianbamichapai == null ? null : yidianbamichapai.trim();}public String getSanmichapai() {return sanmichapai;}public void setSanmichapai(String sanmichapai) {this.sanmichapai = sanmichapai == null ? null : sanmichapai.trim();}public String getWumichapai() {return wumichapai;}public void setWumichapai(String wumichapai) {this.wumichapai = wumichapai == null ? null : wumichapai.trim();}public String getProfessional() {return professional;}public void setProfessional(String professional) {this.professional = professional == null ? null : professional.trim();}
}
  • ExcelUtil工具类

ExcelVOAttribute:

package schooloa.util;import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;@Retention(RetentionPolicy.RUNTIME)
@Target( { java.lang.annotation.ElementType.FIELD })
public @interface ExcelVOAttribute {/*** 导出到Excel中的名字.*/public abstract String name();/*** 配置列的名称,对应A,B,C,D....*/public abstract String column();/*** 提示信息*/public abstract String prompt() default "";/*** 设置只能选择不能输入的列内容.*/public abstract String[] combo() default {};/*** 是否导出数据,应对需求:有时我们需要导出一份模板,这是标题需要但内容需要用户手工填写.*/public abstract boolean isExport() default true;}

ExcelUtil:

package schooloa.util;import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;import jxl.Cell;
import jxl.Sheet;
import jxl.Workbook;
import jxl.read.biff.BiffException;import org.apache.poi.hssf.usermodel.DVConstraint;
import org.apache.poi.hssf.usermodel.HSSFCell;
import org.apache.poi.hssf.usermodel.HSSFDataValidation;
import org.apache.poi.hssf.usermodel.HSSFRow;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.util.CellRangeAddressList;/** ExcelUtil工具类实现功能:* 导出时传入list<T>,即可实现导出为一个excel,其中每个对象T为Excel中的一条记录.* 导入时读取excel,得到的结果是一个list<T>.T是自己定义的对象.* 需要导出的实体对象只需简单配置注解就能实现灵活导出,通过注解您可以方便实现下面功能:* 1.实体属性配置了注解就能导出到excel中,每个属性都对应一列.* 2.列名称可以通过注解配置.* 3.导出到哪一列可以通过注解配置.* 4.鼠标移动到该列时提示信息可以通过注解配置.* 5.用注解设置只能下拉选择不能随意填写功能.* 6.用注解设置是否只导出标题而不导出内容,这在导出内容作为模板以供用户填写时比较实用.* 本工具类以后可能还会加功能,请关注我的博客: http://blog.csdn.net/lk_blog*/
public class ExcelUtil<T> {Class<T> clazz;public ExcelUtil(Class<T> clazz) {this.clazz = clazz;}public List<T> importExcel(String sheetName, InputStream input) {List<T> list = new ArrayList<T>();try {Workbook book = Workbook.getWorkbook(input);Sheet sheet = null;if (!sheetName.trim().equals("")) {sheet = book.getSheet(sheetName);// 如果指定sheet名,则取指定sheet中的内容.}if (sheet == null) {sheet = book.getSheet(0);// 如果传入的sheet名不存在则默认指向第1个sheet.System.out.println(sheet.toString());}int rows = sheet.getRows();// 得到数据的行数if (rows > 0) {// 有数据时才处理Field[] allFields = clazz.getDeclaredFields();// 得到类的所有field.Map<Integer, Field> fieldsMap = new HashMap<Integer, Field>();// 定义一个map用于存放列的序号和field.for (Field field : allFields) {// 将有注解的field存放到map中.if (field.isAnnotationPresent(ExcelVOAttribute.class)) {ExcelVOAttribute attr = field.getAnnotation(ExcelVOAttribute.class);int col = getExcelCol(attr.column());// 获得列号// System.out.println(col + "====" + field.getName());field.setAccessible(true);// 设置类的私有字段属性可访问.fieldsMap.put(col, field);}}for (int i = 1; i < rows; i++) {// 从第2行开始取数据,默认第一行是表头.Cell[] cells = sheet.getRow(i);// 得到一行中的所有单元格对象.T entity = null;for (int j = 0; j < cells.length; j++) {String c = cells[j].getContents();// 单元格中的内容.if (c.equals("")) {continue;}entity = (entity == null ? clazz.newInstance() : entity);// 如果不存在实例则新建.// System.out.println(cells[j].getContents());Field field = fieldsMap.get(j);// 从map中得到对应列的field.// 取得类型,并根据对象类型设置值.Class<?> fieldType = field.getType();if ((Integer.TYPE == fieldType)|| (Integer.class == fieldType)) {field.set(entity, Integer.parseInt(c));} else if (String.class == fieldType) {field.set(entity, String.valueOf(c));} else if ((Long.TYPE == fieldType)|| (Long.class == fieldType)) {field.set(entity, Long.valueOf(c));} else if ((Float.TYPE == fieldType)|| (Float.class == fieldType)) {field.set(entity, Float.valueOf(c));} else if ((Short.TYPE == fieldType)|| (Short.class == fieldType)) {field.set(entity, Short.valueOf(c));} else if ((Double.TYPE == fieldType)|| (Double.class == fieldType)) {field.set(entity, Double.valueOf(c));} else if (Character.TYPE == fieldType) {if ((c != null) && (c.length() > 0)) {field.set(entity, Character.valueOf(c.charAt(0)));}}}if (entity != null) {list.add(entity);}}}} catch (BiffException e) {e.printStackTrace();} catch (IOException e) {e.printStackTrace();} catch (InstantiationException e) {e.printStackTrace();} catch (IllegalAccessException e) {e.printStackTrace();} catch (IllegalArgumentException e) {e.printStackTrace();}return list;}/*** 对list数据源将其里面的数据导入到excel表单* * @param sheetName*            工作表的名称* @param sheetSize*            每个sheet中数据的行数,此数值必须小于65536* @param output*            java输出流*/public boolean exportExcel(List<T> list, String sheetName, int sheetSize,OutputStream output) {Field[] allFields = clazz.getDeclaredFields();// 得到所有定义字段List<Field> fields = new ArrayList<Field>();// 得到所有field并存放到一个list中.for (Field field : allFields) {if (field.isAnnotationPresent(ExcelVOAttribute.class)) {fields.add(field);}}HSSFWorkbook workbook = new HSSFWorkbook();// 产生工作薄对象// excel2003中每个sheet中最多有65536行,为避免产生错误所以加这个逻辑.if (sheetSize > 65536 || sheetSize < 1) {sheetSize = 65536;}double sheetNo = Math.ceil(list.size() / sheetSize);// 取出一共有多少个sheet.for (int index = 0; index <= sheetNo; index++) {HSSFSheet sheet = workbook.createSheet();// 产生工作表对象workbook.setSheetName(index, sheetName + index);// 设置工作表的名称.HSSFRow row;HSSFCell cell;// 产生单元格row = sheet.createRow(0);// 产生一行// 写入各个字段的列头名称for (int i = 0; i < fields.size(); i++) {Field field = fields.get(i);ExcelVOAttribute attr = field.getAnnotation(ExcelVOAttribute.class);int col = getExcelCol(attr.column());// 获得列号cell = row.createCell(col);// 创建列cell.setCellType(HSSFCell.CELL_TYPE_STRING);// 设置列中写入内容为String类型cell.setCellValue(attr.name());// 写入列名// 如果设置了提示信息则鼠标放上去提示.if (!attr.prompt().trim().equals("")) {setHSSFPrompt(sheet, "", attr.prompt(), 1, 100, col, col);// 这里默认设了2-101列提示.}// 如果设置了combo属性则本列只能选择不能输入if (attr.combo().length > 0) {setHSSFValidation(sheet, attr.combo(), 1, 100, col, col);// 这里默认设了2-101列只能选择不能输入.}}int startNo = index * sheetSize;int endNo = Math.min(startNo + sheetSize, list.size());// 写入各条记录,每条记录对应excel表中的一行for (int i = startNo; i < endNo; i++) {row = sheet.createRow(i + 1 - startNo);T vo = (T) list.get(i); // 得到导出对象.for (int j = 0; j < fields.size(); j++) {Field field = fields.get(j);// 获得field.field.setAccessible(true);// 设置实体类私有属性可访问ExcelVOAttribute attr = field.getAnnotation(ExcelVOAttribute.class);try {// 根据ExcelVOAttribute中设置情况决定是否导出,有些情况需要保持为空,希望用户填写这一列.if (attr.isExport()) {cell = row.createCell(getExcelCol(attr.column()));// 创建cellcell.setCellType(HSSFCell.CELL_TYPE_STRING);cell.setCellValue(field.get(vo) == null ? "": String.valueOf(field.get(vo)));// 如果数据存在就填入,不存在填入空格.}} catch (IllegalArgumentException e) {e.printStackTrace();} catch (IllegalAccessException e) {e.printStackTrace();}}}}try {output.flush();workbook.write(output);output.close();return true;} catch (IOException e) {e.printStackTrace();System.out.println("Output is closed ");return false;}}/*** 将EXCEL中A,B,C,D,E列映射成0,1,2,3* * @param col*/public static int getExcelCol(String col) {col = col.toUpperCase();// 从-1开始计算,字母重1开始运算。这种总数下来算数正好相同。int count = -1;char[] cs = col.toCharArray();for (int i = 0; i < cs.length; i++) {count += (cs[i] - 64) * Math.pow(26, cs.length - 1 - i);}return count;}/*** 设置单元格上提示* * @param sheet*            要设置的sheet.* @param promptTitle*            标题* @param promptContent*            内容* @param firstRow*            开始行* @param endRow*            结束行* @param firstCol*            开始列* @param endCol*            结束列* @return 设置好的sheet.*/public static HSSFSheet setHSSFPrompt(HSSFSheet sheet, String promptTitle,String promptContent, int firstRow, int endRow, int firstCol,int endCol) {// 构造constraint对象DVConstraint constraint = DVConstraint.createCustomFormulaConstraint("DD1");// 四个参数分别是:起始行、终止行、起始列、终止列CellRangeAddressList regions = new CellRangeAddressList(firstRow,endRow, firstCol, endCol);// 数据有效性对象HSSFDataValidation data_validation_view = new HSSFDataValidation(regions, constraint);data_validation_view.createPromptBox(promptTitle, promptContent);sheet.addValidationData(data_validation_view);return sheet;}/*** 设置某些列的值只能输入预制的数据,显示下拉框.* * @param sheet*            要设置的sheet.* @param textlist*            下拉框显示的内容* @param firstRow*            开始行* @param endRow*            结束行* @param firstCol*            开始列* @param endCol*            结束列* @return 设置好的sheet.*/public static HSSFSheet setHSSFValidation(HSSFSheet sheet,String[] textlist, int firstRow, int endRow, int firstCol,int endCol) {// 加载下拉列表内容DVConstraint constraint = DVConstraint.createExplicitListConstraint(textlist);// 设置数据有效性加载在哪个单元格上,四个参数分别是:起始行、终止行、起始列、终止列CellRangeAddressList regions = new CellRangeAddressList(firstRow,endRow, firstCol, endCol);// 数据有效性对象HSSFDataValidation data_validation_list = new HSSFDataValidation(regions, constraint);sheet.addValidationData(data_validation_list);return sheet;}
}
  • controller层导入

 @RequestMapping("/importOfficeExcel")@ResponseBodypublic JsonData importExcel(MultipartFile file) throws IOException {CommonsMultipartFile cFile = (CommonsMultipartFile) file;DiskFileItem fileItem = (DiskFileItem) cFile.getFileItem();InputStream inputStream = fileItem.getInputStream();ExcelUtil<ToolsList> util = new ExcelUtil<ToolsList>(ToolsList.class);// 创建excel工具类List<ToolsList> list = util.importExcel("Sheet1", inputStream);// 导入for (int i = 0; i < list.size(); i++) {int insertSelective = toolsListMapper.insertSelective(list.get(i));}System.out.println(list);return JsonData.success(null, "上传成功");}
  • controller层导出

 @RequestMapping("/exportExcel")@ResponseBodypublic JsonData exportexcel(HttpServletResponse response,HttpServletRequest request,@RequestParam(value="time") String time,@RequestParam(value="semester") String semester,@RequestParam(value="professional") String professional) throws IOException{response.setCharacterEncoding("utf-8");response.setContentType("text/html;charset=utf-8");ToolsList toolsList=toolsListMapper.selectByTimeAndSemeterAndProfessional(time, semester, professional);if(toolsList==null){return JsonData.fail("没有数据");}else{// Create Blank workbookXSSFWorkbook workbook = new XSSFWorkbook(); // 创建一个表XSSFSheet xssfSheet = workbook.createSheet("空表");// 一个SheetxssfSheet.addMergedRegion(new CellRangeAddress(0, 0, 0, 10));// 合并单元格xssfSheet.addMergedRegion(new CellRangeAddress(1, 1, 0, 4));xssfSheet.addMergedRegion(new CellRangeAddress(1, 1, 6, 10));XSSFCellStyle xssfCellStyle = workbook.createCellStyle();xssfCellStyle.setVerticalAlignment(CellStyle.ALIGN_CENTER);XSSFRow xssfRow = xssfSheet.createRow((short) 0);// short0表示从第1行开始输出xssfRow.createCell(0).setCellValue("济南大学泉城学院"+toolsList.getTime()+"年办公用品采购目录");// 第一行的第一列xssfRow = xssfSheet.createRow((short) 1);// 第二行xssfRow.createCell(0).setCellValue("单位:");// 第二行的第一列xssfRow.createCell(6).setCellValue("人数:");xssfRow = xssfSheet.createRow((short) 3);xssfRow.createCell(0).setCellValue("名称");// 0代表第1列xssfRow.createCell(1).setCellValue("单位");xssfRow.createCell(2).setCellValue("单价");// double类型xssfRow.createCell(3).setCellValue("数量");xssfRow.createCell(4).setCellValue("金额");xssfRow.createCell(6).setCellValue("名称");// 0代表列xssfRow.createCell(7).setCellValue("单位");xssfRow.createCell(8).setCellValue("单价");// double类型xssfRow.createCell(9).setCellValue("数量");xssfRow.createCell(10).setCellValue("金额");xssfRow = xssfSheet.createRow((short) 4);xssfRow.createCell(0).setCellValue("蓝圆珠笔");// 0代表第1列xssfRow.createCell(1).setCellValue("支");xssfRow.createCell(2).setCellValue(0.5);// 蓝圆珠笔的单价xssfRow.createCell(3).setCellValue(toolsList.getLyzb());// 蓝圆珠笔的数量try {xssfRow.createCell(4).setCellValue(Integer.parseInt(toolsList.getLyzb())*0.5);// 蓝圆珠笔的数量} catch (NumberFormatException e) {xssfRow.createCell(4).setCellValue(0);// 蓝圆珠笔的数量}xssfRow.createCell(6).setCellValue("胶水");// 0代表第1列xssfRow.createCell(7).setCellValue("瓶");xssfRow.createCell(8).setCellValue(1);// 胶水的单价xssfRow.createCell(9).setCellValue(toolsList.getJiaoshui());// 胶水的数量try {xssfRow.createCell(10).setCellValue(Integer.parseInt(toolsList.getJiaoshui())*1);// 胶水的数量} catch (NumberFormatException e) {xssfRow.createCell(10).setCellValue(0);// 胶水的数量}xssfRow = xssfSheet.createRow((short) 5);xssfRow.createCell(0).setCellValue("红圆珠笔");// 0代表第1列xssfRow.createCell(1).setCellValue("支");xssfRow.createCell(2).setCellValue(0.5);xssfRow.createCell(3).setCellValue(toolsList.getHyzb());try {xssfRow.createCell(4).setCellValue(Integer.parseInt(toolsList.getHyzb())*0.5);} catch (NumberFormatException e) {xssfRow.createCell(4).setCellValue(0);}xssfRow.createCell(6).setCellValue("胶棒");// 0代表第1列xssfRow.createCell(7).setCellValue("个");xssfRow.createCell(8).setCellValue(1);xssfRow.createCell(9).setCellValue(toolsList.getJiaobang());try {xssfRow.createCell(10).setCellValue(Integer.parseInt(toolsList.getJiaobang())*1);} catch (NumberFormatException e) {xssfRow.createCell(10).setCellValue(0);}xssfRow = xssfSheet.createRow((short) 6);xssfRow.createCell(0).setCellValue("蓝圆珠笔芯");// 0代表第1列xssfRow.createCell(1).setCellValue("支");xssfRow.createCell(2).setCellValue(0.1);xssfRow.createCell(3).setCellValue(toolsList.getLyzbx());try {xssfRow.createCell(4).setCellValue(Integer.parseInt(toolsList.getLyzbx())*0.1);} catch (NumberFormatException e) {xssfRow.createCell(4).setCellValue(0);}xssfRow.createCell(6).setCellValue("橡皮");// 0代表第1列xssfRow.createCell(7).setCellValue("块");xssfRow.createCell(8).setCellValue(0.4);xssfRow.createCell(9).setCellValue(toolsList.getXiangpi());try {xssfRow.createCell(10).setCellValue(Integer.parseInt(toolsList.getXiangpi())*0.4);} catch (NumberFormatException e) {xssfRow.createCell(10).setCellValue(0);}xssfRow = xssfSheet.createRow((short) 7);xssfRow.createCell(0).setCellValue("红圆珠笔芯");// 0代表第1列xssfRow.createCell(1).setCellValue("支");xssfRow.createCell(2).setCellValue(0.1);xssfRow.createCell(3).setCellValue(toolsList.getHyzbx());try {xssfRow.createCell(4).setCellValue(Integer.parseInt(toolsList.getHyzbx())*0.1);} catch (NumberFormatException e) {xssfRow.createCell(4).setCellValue(0);}xssfRow.createCell(6).setCellValue("浆糊");// 0代表第1列xssfRow.createCell(7).setCellValue("瓶");xssfRow.createCell(8).setCellValue(1.5);xssfRow.createCell(9).setCellValue(toolsList.getJianghu());try {xssfRow.createCell(10).setCellValue(Integer.parseInt(toolsList.getJianghu())*1.5);} catch (NumberFormatException e) {xssfRow.createCell(10).setCellValue(0);}xssfRow = xssfSheet.createRow((short) 8);xssfRow.createCell(0).setCellValue("晨光0.5中性笔(黑)");// 0代表第1列xssfRow.createCell(1).setCellValue("支");xssfRow.createCell(2).setCellValue(0.8);xssfRow.createCell(3).setCellValue(toolsList.getCgfivezxbh());try {xssfRow.createCell(4).setCellValue(Integer.parseInt(toolsList.getCgfivezxbh())*0.8);} catch (NumberFormatException e) {xssfRow.createCell(4).setCellValue(0);}xssfRow.createCell(6).setCellValue("墨汁");// 0代表第1列xssfRow.createCell(7).setCellValue("瓶");xssfRow.createCell(8).setCellValue(3);xssfRow.createCell(9).setCellValue(toolsList.getMozhi());try {xssfRow.createCell(10).setCellValue(Integer.parseInt(toolsList.getMozhi())*3);} catch (NumberFormatException e) {xssfRow.createCell(10).setCellValue(0);}xssfRow = xssfSheet.createRow((short) 9);xssfRow.createCell(0).setCellValue("晨光0.5中性笔(红)");// 0代表第1列xssfRow.createCell(1).setCellValue("支");xssfRow.createCell(2).setCellValue(0.8);xssfRow.createCell(3).setCellValue(toolsList.getCgfivezxbhong());try {xssfRow.createCell(4).setCellValue(Integer.parseInt(toolsList.getCgfivezxbhong())*0.8);} catch (NumberFormatException e) {xssfRow.createCell(4).setCellValue(0);}xssfRow.createCell(6).setCellValue("PU皮黑硬皮本");// 0代表第1列xssfRow.createCell(7).setCellValue("本");xssfRow.createCell(8).setCellValue(4.5);xssfRow.createCell(9).setCellValue(toolsList.getPupiheiyingpiben());try {xssfRow.createCell(10).setCellValue(Integer.parseInt(toolsList.getPupiheiyingpiben())*4.5);} catch (NumberFormatException e) {xssfRow.createCell(10).setCellValue(0);}xssfRow = xssfSheet.createRow((short) 10);xssfRow.createCell(0).setCellValue("晨光0.7中性笔");// 0代表第1列xssfRow.createCell(1).setCellValue("支");xssfRow.createCell(2).setCellValue(1.8);xssfRow.createCell(3).setCellValue(toolsList.getCgsevenzxb());try {xssfRow.createCell(4).setCellValue(Integer.parseInt(toolsList.getCgsevenzxb())*1.8);} catch (NumberFormatException e) {xssfRow.createCell(4).setCellValue(0);}xssfRow.createCell(6).setCellValue("软皮本");// 0代表第1列xssfRow.createCell(7).setCellValue("本");xssfRow.createCell(8).setCellValue(1);xssfRow.createCell(9).setCellValue(toolsList.getRuanpiben());try {xssfRow.createCell(10).setCellValue(Integer.parseInt(toolsList.getRuanpiben())*1);} catch (NumberFormatException e) {xssfRow.createCell(10).setCellValue(0);}xssfRow = xssfSheet.createRow((short) 11);xssfRow.createCell(0).setCellValue("晨光1.0中性笔");// 0代表第1列xssfRow.createCell(1).setCellValue("支");xssfRow.createCell(2).setCellValue(1.8);xssfRow.createCell(3).setCellValue(toolsList.getCgonezxb());try {xssfRow.createCell(4).setCellValue(Integer.parseInt(toolsList.getCgonezxb())*1.8);} catch (NumberFormatException e) {xssfRow.createCell(4).setCellValue(0);}xssfRow.createCell(6).setCellValue("速写本");// 0代表第1列xssfRow.createCell(7).setCellValue("本");xssfRow.createCell(8).setCellValue(3.5);xssfRow.createCell(9).setCellValue(toolsList.getSuxieben());try {xssfRow.createCell(10).setCellValue(Integer.parseInt(toolsList.getSuxieben())*3.5);} catch (NumberFormatException e) {xssfRow.createCell(10).setCellValue(0);}xssfRow = xssfSheet.createRow((short) 12);xssfRow.createCell(0).setCellValue("红蓝铅笔");// 0代表第1列xssfRow.createCell(1).setCellValue("支");xssfRow.createCell(2).setCellValue(0.3);xssfRow.createCell(3).setCellValue(toolsList.getHlqb());try {xssfRow.createCell(4).setCellValue(Integer.parseInt(toolsList.getHlqb())*0.3);} catch (NumberFormatException e) {xssfRow.createCell(4).setCellValue(0);}xssfRow.createCell(6).setCellValue("红印尼");// 0代表第1列xssfRow.createCell(7).setCellValue("盒");xssfRow.createCell(8).setCellValue(2);xssfRow.createCell(9).setCellValue(toolsList.getHongyinni());try {xssfRow.createCell(10).setCellValue(Integer.parseInt(toolsList.getHongyinni())*2);} catch (NumberFormatException e) {xssfRow.createCell(10).setCellValue(0);}xssfRow = xssfSheet.createRow((short) 13);xssfRow.createCell(0).setCellValue("铅笔(2B)");// 0代表第1列xssfRow.createCell(1).setCellValue("支");xssfRow.createCell(2).setCellValue(0.5);xssfRow.createCell(3).setCellValue(toolsList.getTwobqb());try {xssfRow.createCell(4).setCellValue(Integer.parseInt(toolsList.getTwobqb())*0.5);} catch (NumberFormatException e) {xssfRow.createCell(4).setCellValue(0);}xssfRow.createCell(6).setCellValue("转笔刀");// 0代表第1列xssfRow.createCell(7).setCellValue("个");xssfRow.createCell(8).setCellValue(1);xssfRow.createCell(9).setCellValue(toolsList.getZhuanbidao());try {xssfRow.createCell(10).setCellValue(Integer.parseInt(toolsList.getZhuanbidao())*1);} catch (NumberFormatException e) {xssfRow.createCell(10).setCellValue(0);}xssfRow = xssfSheet.createRow((short) 14);xssfRow.createCell(0).setCellValue("彩色铅笔");// 0代表第1列xssfRow.createCell(1).setCellValue("盒");xssfRow.createCell(2).setCellValue(3.5);xssfRow.createCell(3).setCellValue(toolsList.getCsqb());try {xssfRow.createCell(4).setCellValue(Integer.parseInt(toolsList.getCsqb())*3.5);} catch (NumberFormatException e) {xssfRow.createCell(4).setCellValue(0);}xssfRow.createCell(6).setCellValue("壁纸刀");// 0代表第1列xssfRow.createCell(7).setCellValue("把");xssfRow.createCell(8).setCellValue(2);xssfRow.createCell(9).setCellValue(toolsList.getBizhidao());try {xssfRow.createCell(10).setCellValue(Integer.parseInt(toolsList.getBizhidao())*2);} catch (NumberFormatException e) {xssfRow.createCell(10).setCellValue(0);}xssfRow = xssfSheet.createRow((short) 15);xssfRow.createCell(0).setCellValue("白板笔");// 0代表第1列xssfRow.createCell(1).setCellValue("支");xssfRow.createCell(2).setCellValue(1);xssfRow.createCell(3).setCellValue(toolsList.getBaibanbi());try {xssfRow.createCell(4).setCellValue(Integer.parseInt(toolsList.getBaibanbi())*4);} catch (NumberFormatException e) {xssfRow.createCell(4).setCellValue(0);}xssfRow.createCell(6).setCellValue("剪刀");// 0代表第1列xssfRow.createCell(7).setCellValue("把");xssfRow.createCell(8).setCellValue(2.5);xssfRow.createCell(9).setCellValue(toolsList.getJiandao());try {xssfRow.createCell(10).setCellValue(Integer.parseInt(toolsList.getJiandao())*2.5);} catch (NumberFormatException e) {xssfRow.createCell(10).setCellValue(0);}xssfRow = xssfSheet.createRow((short) 16);xssfRow.createCell(0).setCellValue("白板笔油");// 0代表第1列xssfRow.createCell(1).setCellValue("支");xssfRow.createCell(2).setCellValue(1.5);xssfRow.createCell(3).setCellValue(toolsList.getBaibanbiyou());try {xssfRow.createCell(4).setCellValue(Integer.parseInt(toolsList.getBaibanbiyou())*1.5);} catch (NumberFormatException e) {xssfRow.createCell(4).setCellValue(0);}xssfRow.createCell(6).setCellValue("小刀");// 0代表第1列xssfRow.createCell(7).setCellValue("把");xssfRow.createCell(8).setCellValue(0.25);xssfRow.createCell(9).setCellValue(toolsList.getXiaodao());try {xssfRow.createCell(10).setCellValue(Integer.parseInt(toolsList.getXiaodao())*0.25);} catch (NumberFormatException e) {xssfRow.createCell(10).setCellValue(0);}xssfRow = xssfSheet.createRow((short) 17);xssfRow.createCell(0).setCellValue("晨光0.5中性笔芯(黑)");// 0代表第1列xssfRow.createCell(1).setCellValue("支");xssfRow.createCell(2).setCellValue(0.3);xssfRow.createCell(3).setCellValue(toolsList.getChengguangwuzhongxingbixinhei());try {xssfRow.createCell(4).setCellValue(Integer.parseInt(toolsList.getChengguangwuzhongxingbixinhei())*0.3);} catch (NumberFormatException e) {xssfRow.createCell(4).setCellValue(0);}xssfRow.createCell(6).setCellValue("得力订书机");// 0代表第1列xssfRow.createCell(7).setCellValue("个");xssfRow.createCell(8).setCellValue(10);xssfRow.createCell(9).setCellValue(toolsList.getDelidingshuji());try {xssfRow.createCell(10).setCellValue(Integer.parseInt(toolsList.getDelidingshuji())*10);} catch (NumberFormatException e) {xssfRow.createCell(10).setCellValue(0);}xssfRow = xssfSheet.createRow((short) 18);xssfRow.createCell(0).setCellValue("晨光0.5中性笔芯(红)");// 0代表第1列xssfRow.createCell(1).setCellValue("支");xssfRow.createCell(2).setCellValue(0.3);xssfRow.createCell(3).setCellValue(toolsList.getChengguangwuzhongxingbixinhong());try {xssfRow.createCell(4).setCellValue(Integer.parseInt(toolsList.getChengguangwuzhongxingbixinhong())*0.3);} catch (NumberFormatException e) {xssfRow.createCell(4).setCellValue(0);}xssfRow.createCell(6).setCellValue("得力订书钉");// 0代表第1列xssfRow.createCell(7).setCellValue("盒");xssfRow.createCell(8).setCellValue(1);xssfRow.createCell(9).setCellValue(toolsList.getDelidingshuding());try {xssfRow.createCell(10).setCellValue(Integer.parseInt(toolsList.getDelidingshuding())*1);} catch (NumberFormatException e) {xssfRow.createCell(10).setCellValue(0);}xssfRow = xssfSheet.createRow((short) 19);xssfRow.createCell(0).setCellValue("晨光0.7中性笔芯");// 0代表第1列xssfRow.createCell(1).setCellValue("支");xssfRow.createCell(2).setCellValue(0.45);xssfRow.createCell(3).setCellValue(toolsList.getChenguangqizhongxingbixin());try {xssfRow.createCell(4).setCellValue(Integer.parseInt(toolsList.getChenguangqizhongxingbixin())*0.45);} catch (NumberFormatException e) {xssfRow.createCell(4).setCellValue(0);}xssfRow.createCell(6).setCellValue("计算器");// 0代表第1列xssfRow.createCell(7).setCellValue("个");xssfRow.createCell(8).setCellValue(12);xssfRow.createCell(9).setCellValue(toolsList.getJisuanqi());try {xssfRow.createCell(10).setCellValue(Integer.parseInt(toolsList.getJisuanqi())*12);} catch (NumberFormatException e) {xssfRow.createCell(10).setCellValue(0);}xssfRow = xssfSheet.createRow((short) 20);xssfRow.createCell(0).setCellValue("晨光1.0中性笔芯");// 0代表第1列xssfRow.createCell(1).setCellValue("支");xssfRow.createCell(2).setCellValue(0.45);xssfRow.createCell(3).setCellValue(toolsList.getChenguangyizhongxingbixin());try {xssfRow.createCell(4).setCellValue(Integer.parseInt(toolsList.getChenguangyizhongxingbixin())*0.45);} catch (NumberFormatException e) {xssfRow.createCell(4).setCellValue(0);}xssfRow.createCell(6).setCellValue("得力函数计算器");// 0代表第1列xssfRow.createCell(7).setCellValue("个");xssfRow.createCell(8).setCellValue(38);xssfRow.createCell(9).setCellValue(toolsList.getDelihanshujisuanqi());try {xssfRow.createCell(10).setCellValue(Integer.parseInt(toolsList.getDelihanshujisuanqi())*38);} catch (NumberFormatException e) {xssfRow.createCell(10).setCellValue(0);}xssfRow = xssfSheet.createRow((short) 21);xssfRow.createCell(0).setCellValue("油性记号笔");// 0代表第1列xssfRow.createCell(1).setCellValue("支");xssfRow.createCell(2).setCellValue(1.8);xssfRow.createCell(3).setCellValue(toolsList.getYouxingjihaobi());try {xssfRow.createCell(4).setCellValue(Integer.parseInt(toolsList.getYouxingjihaobi())*1.8);} catch (NumberFormatException e) {xssfRow.createCell(4).setCellValue(0);}xssfRow.createCell(6).setCellValue("口取纸");// 0代表第1列xssfRow.createCell(7).setCellValue("张");xssfRow.createCell(8).setCellValue(0.1);xssfRow.createCell(9).setCellValue(toolsList.getKouquzhi());try {xssfRow.createCell(10).setCellValue(Integer.parseInt(toolsList.getKouquzhi())*0.1);} catch (NumberFormatException e) {xssfRow.createCell(10).setCellValue(0);}xssfRow = xssfSheet.createRow((short) 22);xssfRow.createCell(0).setCellValue("大信笺");// 0代表第1列xssfRow.createCell(1).setCellValue("本");xssfRow.createCell(2).setCellValue(0.75);xssfRow.createCell(3).setCellValue(toolsList.getDaxinfa());try {xssfRow.createCell(4).setCellValue(Integer.parseInt(toolsList.getDaxinfa())*0.75);} catch (NumberFormatException e) {xssfRow.createCell(4).setCellValue(0);}xssfRow.createCell(6).setCellValue("塑料长直尺30cm");// 0代表第1列xssfRow.createCell(7).setCellValue("把");xssfRow.createCell(8).setCellValue(1.5);xssfRow.createCell(9).setCellValue(toolsList.getSuliaochangzhichisanshi());try {xssfRow.createCell(10).setCellValue(Integer.parseInt(toolsList.getSuliaochangzhichisanshi())*1.5);} catch (NumberFormatException e) {xssfRow.createCell(10).setCellValue(0);}xssfRow = xssfSheet.createRow((short) 23);xssfRow.createCell(0).setCellValue("稿纸");// 0代表第1列xssfRow.createCell(1).setCellValue("本");xssfRow.createCell(2).setCellValue(0.75);xssfRow.createCell(3).setCellValue(toolsList.getGaozhi());try {xssfRow.createCell(4).setCellValue(Integer.parseInt(toolsList.getGaozhi())*0.75);} catch (NumberFormatException e) {xssfRow.createCell(4).setCellValue(0);}xssfRow.createCell(6).setCellValue("塑料长直尺40cm");// 0代表第1列xssfRow.createCell(7).setCellValue("把");xssfRow.createCell(8).setCellValue(2);xssfRow.createCell(9).setCellValue(toolsList.getSuliaochangzhichisishi());try {xssfRow.createCell(10).setCellValue(Integer.parseInt(toolsList.getSuliaochangzhichisishi())*2);} catch (NumberFormatException e) {xssfRow.createCell(10).setCellValue(0);}xssfRow = xssfSheet.createRow((short) 24);xssfRow.createCell(0).setCellValue("牛皮纸档案袋");// 0代表第1列xssfRow.createCell(1).setCellValue("个");xssfRow.createCell(2).setCellValue(0.4);xssfRow.createCell(3).setCellValue(toolsList.getNiupizhidangandai());try {xssfRow.createCell(4).setCellValue(Integer.parseInt(toolsList.getNiupizhidangandai())*0.4);} catch (NumberFormatException e) {xssfRow.createCell(4).setCellValue(0);}xssfRow.createCell(6).setCellValue("得力长尾夹(大)");// 0代表第1列xssfRow.createCell(7).setCellValue("个");xssfRow.createCell(8).setCellValue(0.6);xssfRow.createCell(9).setCellValue(toolsList.getDelichangweijiada());try {xssfRow.createCell(10).setCellValue(Integer.parseInt(toolsList.getDelichangweijiada())*0.6);} catch (NumberFormatException e) {xssfRow.createCell(10).setCellValue(0);}xssfRow = xssfSheet.createRow((short) 25);xssfRow.createCell(0).setCellValue("塑料档案袋");// 0代表第1列xssfRow.createCell(1).setCellValue("个");xssfRow.createCell(2).setCellValue(0.8);xssfRow.createCell(3).setCellValue(toolsList.getSuliaodangandai());try {xssfRow.createCell(4).setCellValue(Integer.parseInt(toolsList.getSuliaodangandai())*0.8);} catch (NumberFormatException e) {xssfRow.createCell(4).setCellValue(0);}xssfRow.createCell(6).setCellValue("得力长尾夹(中)");// 0代表第1列xssfRow.createCell(7).setCellValue("个");xssfRow.createCell(8).setCellValue(0.45);xssfRow.createCell(9).setCellValue(toolsList.getDelichangweijiazhong());try {xssfRow.createCell(10).setCellValue(Integer.parseInt(toolsList.getDelichangweijiazhong())*0.45);} catch (NumberFormatException e) {xssfRow.createCell(10).setCellValue(0);}xssfRow = xssfSheet.createRow((short) 26);xssfRow.createCell(0).setCellValue("透明窄胶带");// 0代表第1列xssfRow.createCell(1).setCellValue("卷");xssfRow.createCell(2).setCellValue(0.3);xssfRow.createCell(3).setCellValue(toolsList.getToumingzhaijiaodai());try {xssfRow.createCell(4).setCellValue(Integer.parseInt(toolsList.getToumingzhaijiaodai())*0.3);} catch (NumberFormatException e) {xssfRow.createCell(4).setCellValue(0);}xssfRow.createCell(6).setCellValue("得力长尾夹(小)");// 0代表第1列xssfRow.createCell(7).setCellValue("个");xssfRow.createCell(8).setCellValue(0.25);xssfRow.createCell(9).setCellValue(toolsList.getDelichangweijiaxiao());try {xssfRow.createCell(10).setCellValue(Integer.parseInt(toolsList.getDelichangweijiaxiao())*0.25);} catch (NumberFormatException e) {xssfRow.createCell(10).setCellValue(0);}xssfRow = xssfSheet.createRow((short) 27);xssfRow.createCell(0).setCellValue("透明宽胶带");// 0代表第1列xssfRow.createCell(1).setCellValue("卷");xssfRow.createCell(2).setCellValue(3.5);xssfRow.createCell(3).setCellValue(toolsList.getToumingkuangjiaodai());try {xssfRow.createCell(4).setCellValue(Integer.parseInt(toolsList.getToumingkuangjiaodai())*3.5);} catch (NumberFormatException e) {xssfRow.createCell(4).setCellValue(0);}xssfRow.createCell(6).setCellValue("5号南孚电池");// 0代表第1列xssfRow.createCell(7).setCellValue("节");xssfRow.createCell(8).setCellValue(1.8);xssfRow.createCell(9).setCellValue(toolsList.getWuhaonanfudianchi());try {xssfRow.createCell(10).setCellValue(Integer.parseInt(toolsList.getWuhaonanfudianchi())*1.8);} catch (NumberFormatException e) {xssfRow.createCell(10).setCellValue(0);}xssfRow = xssfSheet.createRow((short) 28);xssfRow.createCell(0).setCellValue("双面窄胶带");// 0代表第1列xssfRow.createCell(1).setCellValue("卷");xssfRow.createCell(2).setCellValue(0.5);xssfRow.createCell(3).setCellValue(toolsList.getShuangmianzhaijiaodai());try {xssfRow.createCell(4).setCellValue(Integer.parseInt(toolsList.getShuangmianzhaijiaodai())*0.5);} catch (NumberFormatException e) {xssfRow.createCell(4).setCellValue(0);}xssfRow.createCell(6).setCellValue("7号南孚电池");// 0代表第1列xssfRow.createCell(7).setCellValue("节");xssfRow.createCell(8).setCellValue(1.8);xssfRow.createCell(9).setCellValue(toolsList.getQihaonanfudianchi());try {xssfRow.createCell(10).setCellValue(Integer.parseInt(toolsList.getQihaonanfudianchi())*1.8);} catch (NumberFormatException e) {xssfRow.createCell(10).setCellValue(0);}xssfRow = xssfSheet.createRow((short) 29);xssfRow.createCell(0).setCellValue("双面宽胶带");// 0代表第1列xssfRow.createCell(1).setCellValue("卷");xssfRow.createCell(2).setCellValue(1.2);xssfRow.createCell(3).setCellValue(toolsList.getShuangmiankuanjiaodai()); try {xssfRow.createCell(4).setCellValue(Integer.parseInt(toolsList.getShuangmiankuanjiaodai())*1.2);} catch (NumberFormatException e) {xssfRow.createCell(4).setCellValue(0); } xssfRow.createCell(6).setCellValue("9V双鹿电池");// 0代表第1列xssfRow.createCell(7).setCellValue("节");xssfRow.createCell(8).setCellValue(2.8);xssfRow.createCell(9).setCellValue(toolsList.getJiufushuangludianchi());try {xssfRow.createCell(10).setCellValue(Integer.parseInt(toolsList.getJiufushuangludianchi())*2.8);} catch (NumberFormatException e) {xssfRow.createCell(10).setCellValue(0);}xssfRow = xssfSheet.createRow((short) 30);xssfRow.createCell(0).setCellValue("泡沫双面胶带");// 0代表第1列xssfRow.createCell(1).setCellValue("卷");xssfRow.createCell(2).setCellValue(1);xssfRow.createCell(3).setCellValue(toolsList.getPaomoshuangmianjiaodai());try {xssfRow.createCell(4).setCellValue(Integer.parseInt(toolsList.getPaomoshuangmianjiaodai())*1);} catch (NumberFormatException e) {xssfRow.createCell(4).setCellValue(0);}xssfRow.createCell(6).setCellValue("得力回形针");// 0代表第1列xssfRow.createCell(7).setCellValue("盒");xssfRow.createCell(8).setCellValue(1);xssfRow.createCell(9).setCellValue(toolsList.getDelihuixingzhen());try {xssfRow.createCell(10).setCellValue(Integer.parseInt(toolsList.getDelihuixingzhen())*1);} catch (NumberFormatException e) {xssfRow.createCell(10).setCellValue(0);}xssfRow = xssfSheet.createRow((short) 31);xssfRow.createCell(0).setCellValue("大红纸");// 0代表第1列xssfRow.createCell(1).setCellValue("张");xssfRow.createCell(2).setCellValue(0.4);xssfRow.createCell(3).setCellValue(toolsList.getDahongzhi());try {xssfRow.createCell(4).setCellValue(Integer.parseInt(toolsList.getDahongzhi())*0.4);} catch (NumberFormatException e) {xssfRow.createCell(4).setCellValue(0);}xssfRow.createCell(6).setCellValue("得力起钉器");// 0代表第1列xssfRow.createCell(7).setCellValue("个");xssfRow.createCell(8).setCellValue(1.8);xssfRow.createCell(9).setCellValue(toolsList.getDeliqidingqi());try {xssfRow.createCell(10).setCellValue(Integer.parseInt(toolsList.getDeliqidingqi())*1.8);} catch (NumberFormatException e) {xssfRow.createCell(10).setCellValue(0);}xssfRow = xssfSheet.createRow((short) 32);xssfRow.createCell(0).setCellValue("宣纸");// 0代表第1列xssfRow.createCell(1).setCellValue("张");xssfRow.createCell(2).setCellValue(0.5);xssfRow.createCell(3).setCellValue(toolsList.getXuanzhi());try {xssfRow.createCell(4).setCellValue(Integer.parseInt(toolsList.getXuanzhi())*0.5);} catch (NumberFormatException e) {xssfRow.createCell(4).setCellValue(0);}xssfRow.createCell(6).setCellValue("塑料文件架");// 0代表第1列xssfRow.createCell(7).setCellValue("个");xssfRow.createCell(8).setCellValue(9.5);xssfRow.createCell(9).setCellValue(toolsList.getSuliaowenjianjia());try {xssfRow.createCell(10).setCellValue(Integer.parseInt(toolsList.getSuliaowenjianjia())*9.5);} catch (NumberFormatException e) {xssfRow.createCell(10).setCellValue(0);}xssfRow = xssfSheet.createRow((short) 33);xssfRow.createCell(0).setCellValue("3.5得力档案盒");// 0代表第1列xssfRow.createCell(1).setCellValue("个");xssfRow.createCell(2).setCellValue(6);xssfRow.createCell(3).setCellValue(toolsList.getSanwudelidanganhe());try {xssfRow.createCell(4).setCellValue(Integer.parseInt(toolsList.getSanwudelidanganhe())*6);} catch (NumberFormatException e) {xssfRow.createCell(4).setCellValue(0);}xssfRow.createCell(6).setCellValue("塑料笔筒");// 0代表第1列xssfRow.createCell(7).setCellValue("个");xssfRow.createCell(8).setCellValue(5);xssfRow.createCell(9).setCellValue(toolsList.getSuliaobitong());try {xssfRow.createCell(10).setCellValue(Integer.parseInt(toolsList.getSuliaobitong())*5);} catch (NumberFormatException e) {xssfRow.createCell(10).setCellValue(0);}xssfRow = xssfSheet.createRow((short) 34);xssfRow.createCell(0).setCellValue("5.5得力档案盒");// 0代表第1列xssfRow.createCell(1).setCellValue("个");xssfRow.createCell(2).setCellValue(8);xssfRow.createCell(3).setCellValue(toolsList.getWuwudelidanganhe());try {xssfRow.createCell(4).setCellValue(Integer.parseInt(toolsList.getWuwudelidanganhe())*8);} catch (NumberFormatException e) {xssfRow.createCell(4).setCellValue(0);}xssfRow.createCell(6).setCellValue("木质笔筒");// 0代表第1列xssfRow.createCell(7).setCellValue("个");xssfRow.createCell(8).setCellValue(9);xssfRow.createCell(9).setCellValue(toolsList.getMuzhibitong());try {xssfRow.createCell(10).setCellValue(Integer.parseInt(toolsList.getMuzhibitong())*9);} catch (NumberFormatException e) {xssfRow.createCell(10).setCellValue(0);}xssfRow = xssfSheet.createRow((short) 35);xssfRow.createCell(0).setCellValue("文件夹");// 0代表第1列xssfRow.createCell(1).setCellValue("个");xssfRow.createCell(2).setCellValue(3.2);xssfRow.createCell(3).setCellValue(toolsList.getWenjianjia());try {xssfRow.createCell(4).setCellValue(Integer.parseInt(toolsList.getWenjianjia())*3.2);} catch (NumberFormatException e) {xssfRow.createCell(4).setCellValue(0);}xssfRow.createCell(6).setCellValue("1.8米插排");// 0代表第1列xssfRow.createCell(7).setCellValue("个");xssfRow.createCell(8).setCellValue(28);xssfRow.createCell(9).setCellValue(toolsList.getYidianbamichapai());try {xssfRow.createCell(10).setCellValue(Integer.parseInt(toolsList.getYidianbamichapai())*28);} catch (NumberFormatException e) {xssfRow.createCell(10).setCellValue(0);}xssfRow = xssfSheet.createRow((short) 36);xssfRow.createCell(0).setCellValue("A4抽杆夹");// 0代表第1列xssfRow.createCell(1).setCellValue("个");xssfRow.createCell(2).setCellValue(1);xssfRow.createCell(3).setCellValue(toolsList.getAsichouganjia());try {xssfRow.createCell(4).setCellValue(Integer.parseInt(toolsList.getAsichouganjia())*1);} catch (NumberFormatException e) {xssfRow.createCell(4).setCellValue(0);}xssfRow.createCell(6).setCellValue("3米插排");// 0代表第1列xssfRow.createCell(7).setCellValue("个");xssfRow.createCell(8).setCellValue(38);xssfRow.createCell(9).setCellValue(toolsList.getSanmichapai());try {xssfRow.createCell(10).setCellValue(Integer.parseInt(toolsList.getSanmichapai())*38);} catch (NumberFormatException e) {xssfRow.createCell(10).setCellValue(0);}xssfRow = xssfSheet.createRow((short) 37);xssfRow.createCell(0).setCellValue("锥子");// 0代表第1列xssfRow.createCell(1).setCellValue("把");xssfRow.createCell(2).setCellValue(1);xssfRow.createCell(3).setCellValue(toolsList.getZhuizi());//没找到对应的字段try {xssfRow.createCell(4).setCellValue(Integer.parseInt(toolsList.getZhuizi())*1);//没找到对应的字段} catch (NumberFormatException e) {xssfRow.createCell(4).setCellValue(0);//没找到对应的字段}xssfRow.createCell(6).setCellValue("5米插排");// 0代表第1列xssfRow.createCell(7).setCellValue("个");xssfRow.createCell(8).setCellValue(48);xssfRow.createCell(9).setCellValue(toolsList.getWumichapai());try {xssfRow.createCell(10).setCellValue(Integer.parseInt(toolsList.getWumichapai())*48);} catch (NumberFormatException e) {xssfRow.createCell(10).setCellValue(0);}SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMddHHmmss");Date date = new Date();String dateString = formatter.format(date);// Create file system using specific nameString path=request.getSession().getServletContext().getRealPath("/");System.out.println(path);FileOutputStream out = new FileOutputStream(new File(path+dateString+"办公用品.xlsx"));// 先在本地生成文件// write operation workbook using file out objectworkbook.write(out);out.close();return JsonData.success(dateString+"办公用品.xlsx");}}

SSM使用poi把Excel内容读取到数据库和把数据库内容导出到Excel相关推荐

  1. c# cad二次开发通过获取excel数据 在CAD绘图,将CAD属性导出到excel

    c# cad二次开发通过获取excel数据 在CAD绘图,将CAD属性导出到excel using Autodesk.AutoCAD.ApplicationServices; using Autode ...

  2. c#如何实现excel导入到sqlserver,如何实现从sqlserver导出到excel中(详细)

    对于从sqlserver中导入.导出excel,虽然sqlserver已经给了较为简单的方式,通过交互式的对话框形式实现,但是有时这种方式存在的很多问题,比方说导入.导出数据不全.而且,对于一个项目而 ...

  3. 如何将python数据输入到excel中_如何使用python将大量数据导出到Excel中的小技巧之一...

    如何使用python将大量数据导出到Excel中的小技巧 (1) 问题描述:为了更好地展示数据,Excel格式的数据文件往往比文本文件更具有优势,但是具体到python中,该如何导出数据到Excel呢 ...

  4. 【vue + Excel表格导入与导出】导入Excel并展示在el-table表格中,表格导出为Excel文件

    注:末尾有完整代码 效果图 Excel 1.下载依赖 xlsx是导入所需依赖 file-saver是导出所需依赖 npm install xlsx --save npm install file-sa ...

  5. php导入excel源码,利用PHPExcel类库,实现PHP导出导入Excel表格Excel文件!

    [温馨提示]源码包解压密码:www.youhutong.com 利用PHPExcel类库,实现PHP导出导入Excel文件!(案例教程源码) 需要注意的地方就是: 1.导出文件时,如果你的字段过多,可 ...

  6. python xmind转excel 知乎_XMind: ZEN 重磅更新!新增导出Word/Excel,自定义快捷键和其他...

    重磅! XMind: ZEN 升级了! 自 XMind: ZEN 上线以来,我们收到了很多很棒的建议.在过去几个月里,我们不断优化和升级,终于迎来了这次大版本更新: 1.更多导入导出选项,优化工作流 ...

  7. 如何将html表格导出到excel,html 页面导出到excel表格数据类型-如何将html里面的table导出成excel...

    怎么把html导出到excel表格 1先,我们打开要转换成THML的表格文件.下是我用的WPS2019版截图,EXCEL软件操作上差不多 2.接下来,点击左上角的[文件] 3.在[文件]菜单里找到并点 ...

  8. 从数据库中将SQL查询结果导出到Excel中中午乱码及数字问题解决

    从事数据工作者经常会涉及数据采集,将采集结果从数据库中导出到xls/csv文件格式中,给到业务分析人员,经常遇到导出乱码问题,或者身份证号码在Excel中展示格式不对导致错误问题,下面来说说我的解决方 ...

  9. java 对excel操作 读取、写入、修改数据;导出数据库数据到excel

    ============前提加入jar包jxl.jar========================= // 从数据库导出数据到excel  public List<Xskh> outP ...

  10. plsql导出表结构到excel_将数据库中的表结构导出到excel中(写数据库设计说明书)...

    这两天接到一个任务,写数据库设计说明书.很头疼啊~~ 网上翻阅了下范本,发现数据库设计说明书一般由数据库结构.数据字典.sql附件组成.这是我刚刚写好的数据库设计说明书. 这里记录下,方便自己下次查阅 ...

最新文章

  1. python在化学方面的应用-学材料、化学的要不要担心人工智能抢了自己的饭碗?...
  2. matlab如何表示一阶导数,三阶样条插值(一阶导数边界条件) matlab程序
  3. Product search parameter的determine逻辑
  4. CentOS7.5 使用二进制程序部署Kubernetes1.12.2(三)
  5. 要不要赶个时髦,去建设一个「 中台 」?
  6. Pentium 4处理器架构/微架构/流水线 (4) - NetBurst框图
  7. MySQL存储过程语句(if,while)的使用
  8. 关于QTP 9.2 .NET 插件破解的尝试
  9. 教会别人编程,你能收获什么?
  10. mysql timestamp 值不合法问题
  11. 魔方矩阵 C++实现
  12. 《通信技术 - 以太网》详解以太网(二)
  13. Twitter开发者账号申请流程
  14. 只有程序猿才能看懂的段子,不笑你拿小拳拳捶我!!!
  15. 安卓非微信内置浏览器中的网页调起微信支付的方案研究
  16. 一种逐样本的偏AUC优化框架
  17. Js 高德地图SDK
  18. GPS授时系统(北斗授时设备)应用及案例
  19. 大型医院信息系统HIS源码 HIS系统全套源码
  20. 瓦隆大区,西欧数据中心优选

热门文章

  1. windows XP系统文件诠释C(转)
  2. Learning Lightroom CC 学习Lightroom CC Lynda课程中文字幕
  3. 宝塔界面为什么无法访问_宝塔面板登陆不上?宝塔面板打不开解决办法
  4. 【论文阅读】A CNN-Transformer Hybrid Approach for CropClassification Using MultitemporalMultisensor Images
  5. 睡眠经济崛起,智能床垫品牌们的可为和有为
  6. 【地理人工智能交叉】通过整合兴趣点和Word2Vec模型感知城市土地利用的空间分布
  7. 横屏模式下,编辑手机联系人添加图片,保存后联系人头像与之前默认的图片重叠或者是有阴影在头像上
  8. 【Unity3D插件】AVPro Video2.x rtmp流媒体播放设置问题
  9. SecurityException: Uid 0312 does not have permission content://com.android.providers...
  10. 分析图第二讲导出图片和后期PS5.12