专栏电商日志财经减肥爱情
投稿投诉
爱情常识
搭配分娩
减肥两性
孕期塑形
财经教案
论文美文
日志体育
养生学堂
电商科学
头戴业界
专栏星座
用品音乐

java使用easypoi导出多表头文件

  效果:
  导入依赖:dependencygroupIdcn。afterturngroupIdeasypoibaseartifactIdversion3。2。0versiondependencydependencygroupIdcn。afterturngroupIdeasypoiwebartifactIdversion3。2。0versiondependencydependencygroupIdcn。afterturngroupIdeasypoiannotationartifactIdversion3。2。0versiondependency
  创建Excel对应文件CostReductionStatiImprotVoDataEqualsAndHashCode(callSuperfalse)publicclassCostReductionStatiImprotVoimplementsSerializable{privatestaticfinallongserialVersionUID1L;年度Excel(isWrapfalse,name年度,orderNum1,width20,needMergetrue)privateStringyear;供应商编码Excel(isWrapfalse,name供应商编码,orderNum2,width23,needMergetrue)privateStringsuppCode;供应商名称Excel(isWrapfalse,name供应商名称,orderNum3,width30,needMergetrue)privateStringsuppName;物料编码Excel(isWrapfalse,name物料编码,orderNum4,width25,needMergetrue)privateStringmasterCode;物料名称Excel(isWrapfalse,name物料名称,orderNum5,width30,needMergetrue)privateStringmasterName;调价原因Excel(isWrapfalse,name调价原因,orderNum6,width30,needMergetrue)privateStringmodifyPriceReson;开始日期Excel(isWrapfalse,name开始日期,orderNum7,width30,needMergetrue)privateStringstartTime;单价差额Excel(isWrapfalse,name单价差额,orderNum8,width30,needMergetrue)privateStringunitPriceDifference;一月ExcelCollection(name一月,orderNum9)privateListJanMonthlyVojanuary;二月ExcelCollection(name二月,orderNum10)privateListFebMonthlyVofebruary;三月ExcelCollection(name三月,orderNum11)privateListMarMonthlyVomarch;四月ExcelCollection(name四月,orderNum12)privateListapril;五月ExcelCollection(name五月,orderNum13)privateListMayMonthlyVomay;六月ExcelCollection(name六月,orderNum14)privateListJunMonthlyVojune;七月ExcelCollection(name七月,orderNum15)privateListJulyMonthlyVojuly;八月ExcelCollection(name八月,orderNum16)privateListaugust;九月ExcelCollection(name九月,orderNum17)privateListSepMonthlyVoseptember;十月ExcelCollection(name十月,orderNum18)privateListOctMonthlyVooctober;十一月ExcelCollection(name十一月,orderNum19)privateListNovMonthlyVonovember;十二月ExcelCollection(name十二月,orderNum20)privateListDecMonthlyVodecember;累计用量合计Excel(isWrapfalse,name累计用量合计,orderNum21,width30,needMergetrue)privateLongcumulativeUsSum;降本金额合计Excel(isWrapfalse,name降本金额合计,orderNum22,width30,needMergetrue)privateStringcostReductAmountSum;统计时间Excel(isWrapfalse,name统计时间,orderNum23,width30,needMergetrue)privateStringstatiTime;}说明:orderNum:排序,如果属性顺序和表格字段顺序不一致,可已设置顺序width:表格列宽needMerge:是否需要合并单元格ExcelCollection(name十二月,orderNum20)对应双层表头字段特别注意!!!!踩坑属性字段必须遵守驼峰命名发,首字母小写!!!!!!注意属性,Excel支持属性类型不多,我使用的都是基本常用属性,在serviceImpl类中再做在转换
  CostReductionStatiImprotVo类中,多层表头字段对应一个lislist里面的也需单独建VO
  例如:JanMonthlyVoDataEqualsAndHashCode(callSuperfalse)publicclassJanMonthlyVoimplementsSerializable{privatestaticfinallongserialVersionUID2L;一月累计用量Excel(isWrapfalse,name一月累计用量,orderNum1,width15)privateIntegercumulativeUsJan;一月降本金额Excel(isWrapfalse,name一月降本金额,orderNum2,width15)privateStringcostReductAmountJan;}
  Contorller层:导出多重表头paramresponsethrowsExceptionPostMapping(exportExcel)publicvoidexportExcel(HttpServletResponseresponse,RequestBodyPageParamVOparams)throwsException{buCostReductionStatiYWService。exportExcel(response,params);}
  ServiceImpl层:导出paramresponsethrowsExceptionOverridepublicvoidexportExcel(HttpServletResponseresponse,PageParamVOparamVO)throwsException{ListCostReductionStatiImprotVoimportInfoListgetAllCostReductionImportInfo(paramVO);response。setContentType(applicationvnd。openxmlformatsofficedocument。spreadsheetml。sheet;charsetutf8);test。xls是弹出下载对话框的文件名,不能为中文,中文请自行编码response。setHeader(ContentDisposition,attachment;filenamefile。xlsx);HashMapString,ObjectmapnewHashMap();WorkbookworkbookExcelExportUtil。exportExcel(newExportParams(),CostReductionStatiImprotVo。class,importInfoList);workbook。setSheetName(0,降本统计);ServletOutputStreamoutputStreamresponse。getOutputStream();workbook。write(outputStream);outputStream。flush();outputStream。close();workbook。close();}获取数据publicListCostReductionStatiImprotVogetAllCostReductionImportInfo(PageParamVOparamVO){ArrayListCostReductionStatiImprotVoImprotVoListnewArrayList();ListDataFilterfilterparamVO。getFilter();ListBuCostReductionStatiEntityentityListbuCostReductionStatiMapper。selectList(WrapperFilter。buildQueryWrapper(newQueryWrapper(),filter));SimpleDateFormatformatnewSimpleDateFormat(yyyyMMddHH:ss:mm);if(CollectionUtils。isNotEmpty(entityList)){for(BuCostReductionStatiEntityentity:entityList){JanMonthlyVojanMonthlyVonewJanMonthlyVo();FebMonthlyVofebMonthlyVonewFebMonthlyVo();MarMonthlyVomarMonthlyVonewMarMonthlyVo();AprMonthlyVoaprMonthlyVonewAprMonthlyVo();MayMonthlyVomayMonthlyVonewMayMonthlyVo();JunMonthlyVojunMonthlyVonewJunMonthlyVo();JulyMonthlyVojulyMonthlyVonewJulyMonthlyVo();AugMonthlyVoaugMonthlyVonewAugMonthlyVo();SepMonthlyVosepMonthlyVonewSepMonthlyVo();OctMonthlyVooctMonthlyVonewOctMonthlyVo();NovMonthlyVonovMonthlyVonewNovMonthlyVo();DecMonthlyVodecMonthlyVonewDecMonthlyVo();ArrayListJanMonthlyVojanMonthlyVosnewArrayList();ArrayListFebMonthlyVofebMonthlyVosnewArrayList();ArrayListMarMonthlyVomarMonthlyVosnewArrayList();ArrayListaprMonthlyVosnewArrayList();ArrayListMayMonthlyVomayMonthlyVosnewArrayList();ArrayListJunMonthlyVojunMonthlyVosnewArrayList();ArrayListJulyMonthlyVojulyMonthlyVosnewArrayList();ArrayListaugMonthlyVosnewArrayList();ArrayListSepMonthlyVosepMonthlyVosnewArrayList();ArrayListOctMonthlyVooctMonthlyVosnewArrayList();ArrayListNovMonthlyVonovMonthlyVosnewArrayList();ArrayListDecMonthlyVodecMonthlyVosnewArrayList();CostReductionStatiImprotVoimprotVonewCostReductionStatiImprotVo();improtVo。setYear(entity。getYear());improtVo。setMasterCode(entity。getMasterCode());improtVo。setMasterName(entity。getMasterName());improtVo。setSuppCode(entity。getSuppCode());improtVo。setSuppName(entity。getSuppName());switch(entity。getModifyPriceReson()){caseT02:improtVo。setModifyPriceReson(BuCostReductionStatiConstans。T02CH);break;caseT03:improtVo。setModifyPriceReson(BuCostReductionStatiConstans。T03CH);break;caseT04:improtVo。setModifyPriceReson(BuCostReductionStatiConstans。T04CH);break;caseT05:improtVo。setModifyPriceReson(BuCostReductionStatiConstans。T05CH);break;caseT06:improtVo。setModifyPriceReson(BuCostReductionStatiConstans。T06CH);break;}improtVo。setStartTime(format。format(entity。getStartTime()));improtVo。setUnitPriceDifference(entity。getUnitPriceDifference()null?null:entity。getUnitPriceDifference()。toString());improtVo。setCumulativeUsSum(entity。getCumulativeUsSum());improtVo。setCostReductAmountSum(entity。getCostReductAmountSum()null?null:entity。getCostReductAmountSum()。toString());improtVo。setStatiTime(format。format(entity。getStatiTime()));janMonthlyVo。setCumulativeUsJan(entity。getCumulativeUsJan());janMonthlyVo。setCostReductAmountJan(entity。getCostReductAmountJan()null?null:entity。getCostReductAmountJan()。toString());janMonthlyVos。add(janMonthlyVo);improtVo。setJanuary(janMonthlyVos);febMonthlyVo。setCumulativeUsFeb(entity。getCumulativeUsFeb());febMonthlyVo。setCostReductAmountFeb(entity。getCostReductAmountFeb()null?null:entity。getCostReductAmountFeb()。toString());febMonthlyVos。add(febMonthlyVo);improtVo。setFebruary(febMonthlyVos);marMonthlyVo。setCumulativeUsMar(entity。getCumulativeUsMar());marMonthlyVo。setCostReductAmountMar(entity。getCostReductAmountMar()null?null:entity。getCostReductAmountMar()。toString());marMonthlyVos。add(marMonthlyVo);improtVo。setMarch(marMonthlyVos);aprMonthlyVo。setCumulativeUsApr(entity。getCumulativeUsApr());aprMonthlyVo。setCostReductAmountApr(entity。getCostReductAmountApr()null?null:entity。getCostReductAmountApr()。toString());aprMonthlyVos。add(aprMonthlyVo);improtVo。setApril(aprMonthlyVos);mayMonthlyVo。setCumulativeUsMay(entity。getCumulativeUsMay());mayMonthlyVo。setCostReductAmountMay(entity。getCostReductAmountMay()null?null:entity。getCostReductAmountMay()。toString());mayMonthlyVos。add(mayMonthlyVo);improtVo。setMay(mayMonthlyVos);junMonthlyVo。setCumulativeUsJun(entity。getCumulativeUsJun());junMonthlyVo。setCostReductAmountJun(entity。getCostReductAmountJun()null?null:entity。getCostReductAmountJun()。toString());junMonthlyVos。add(junMonthlyVo);improtVo。setJune(junMonthlyVos);julyMonthlyVo。setCumulativeUsJul(entity。getCumulativeUsJul());julyMonthlyVo。setCostReductAmountJul(entity。getCostReductAmountJul()null?null:entity。getCostReductAmountJul()。toString());julyMonthlyVos。add(julyMonthlyVo);improtVo。setJuly(julyMonthlyVos);augMonthlyVo。setCumulativeUsAug(entity。getCumulativeUsAug());augMonthlyVo。setCostReductAmountAug(entity。getCostReductAmountAug()null?null:entity。getCostReductAmountAug()。toString());augMonthlyVos。add(augMonthlyVo);improtVo。setAugust(augMonthlyVos);sepMonthlyVo。setCumulativeUsSep(entity。getCumulativeUsSep());sepMonthlyVo。setCostReductAmountSep(entity。getCostReductAmountSep()null?null:entity。getCostReductAmountSep()。toString());sepMonthlyVos。add(sepMonthlyVo);improtVo。setSeptember(sepMonthlyVos);improtVo。getSeptember();octMonthlyVo。setCumulativeUsOct(entity。getCumulativeUsOct());octMonthlyVo。setCostReductAmountOct(entity。getCostReductAmountOct()null?null:entity。getCostReductAmountOct()。toString());octMonthlyVos。add(octMonthlyVo);improtVo。setOctober(octMonthlyVos);novMonthlyVo。setCumulativeUsNov(entity。getCumulativeUsNov());novMonthlyVo。setCostReductAmountNov(entity。getCostReductAmountNov()null?null:entity。getCostReductAmountNov()。toString());novMonthlyVos。add(novMonthlyVo);improtVo。setNovember(novMonthlyVos);decMonthlyVo。setCumulativeUsDec(entity。getCumulativeUsDec());decMonthlyVo。setCostReductAmountDec(entity。getCostReductAmountDec()null?null:entity。getCostReductAmountDec()。toString());decMonthlyVos。add(decMonthlyVo);improtVo。setDecember(decMonthlyVos);ImprotVoList。add(improtVo);}returnImprotVoList;}returnnull;}
  第一次写多表头导出,特意记录一下。

宋朝的雕母原来长这样?中国古代是如何铸钱的?关注大咖美泉,赏美泉美文!首先要说明一下,中国不同的大朝代如唐宋元明清,其铸钱的工艺流程多少都会有些变化和自己的特色。因此不能拿某一朝代去类比其它朝代。比如我们现在比较熟悉清代的铸皇十子胤地位仅次于太子,与胤禩交好与雍正作对,却得善终!康熙六十一年十二月,文韬武略的康熙大帝病逝于畅春园按照康熙的遗诏,皇四子胤禛承继皇位,史称雍正帝就这样雍正成为康熙晚年九王夺嫡最后的赢家,登基后开始对自己九王夺嫡的敌人们动手皇八子武惠妃杨贵妃婆婆,唐玄宗前半生最爱的女人,死后丈夫抢她儿媳一提到唐玄宗的后宫,大多数人想起的,都是四大美人之一风华绝代的杨贵妃。后世演绎和评论最多的,也都是唐玄宗和杨贵妃的爱情故事。然而,在杨贵妃进宫之前,唐玄宗还有过一个深爱的女子。唐玄大运集团远勤山中国品牌要飞起来文图广州日报全媒体记者邓莉新能源车市场从不缺乏胆大的新品牌,大运集团旗下远航汽车就是其中一个。在广州车展上,远航汽车品牌首次亮相就带来了四款高端豪华车型,还携手博世华为阿里等顶级供开门红!中兴通讯斩获中国移动2023年智能机顶盒集采大单近日,中国移动公布了2023年智能机顶盒产品(公开采购部分)的集采结果,中兴通讯两款产品全部入围并分别获得综合排名第二和第三的好成绩,中选份额共计26。4。中兴通讯此次中标的两款机华为应战特斯拉,中国新能源车降价大戏开幕,未来趋势如何演变?在进入2023年的两周时间,几乎2022年所有大市场趋势都在发生了逆转。2022年美元指数的快速飙升,从95一路飙升至9月的114,几乎让所有国家都濒临经济崩溃的边缘。但也成为了美2022年111月中国服装行业生产内销效益各项指标降幅扩大2022年以来,我国服装行业经济运行总体呈现持续放缓态势,尤其是进入11月,国际环境更趋严峻复杂,全球经济继续走弱,国内疫情反弹影响加大,国内外市场需求收缩趋势更加明显,行业经济运出口311万辆!2022年中国汽车出口量跃居世界第二!根据中国汽车工业协会(下称中汽协)的数据,由于海外供给不足和中国车企出口竞争力的大幅增强,2022年中国汽车出口量同比增长54。4,达到311。1万辆。中国超过德国,正式成为全球第兴发集团预计净利润增长40,江瀚新材完成股票配售,住友化学PMMA回收设施竣工,2022年中国GDP达1210207亿国内要闻兴发集团预计净利润增长40近日,湖北兴发化工集团有限公司(兴发集团)发布2022年度业绩预增公告。根据公布显示,兴发集团预计2022年度实现归母净利润将达到58亿60亿元,当左小青撞衫宋慧乔,终于见识了中国美与韩式美的差距有多大了撞衫不可怕,谁丑谁尴尬,虽然咱们都流行lovepeace的交流方式,也都认同美是一种平等无差别的事物,但是咱们纵观女明星们的撞衫现场,也不得不承认,选对适合自己的造型,从妆发服装到都是篡位,武则天的周朝名正言顺,这种骚操作值得野心家膜拜周朝,又称武周,武则天当皇帝时的国号是周。从690年9月到705年2月,先后15年,中国唯一女皇帝武则天的朝代。武则天刘晓庆扮演工作履历1第一份工作14岁入宫,当唐太宗的才人,从6
情趣用品也不好卖了,网易们靠创新续命撰文财经天下周刊作者魏一宁编辑董雨晴一款新品,让网易春风差点翻车。网易春风是网易旗下的原创情趣用品品牌,在国内已属头部,年销售额破亿。不久前,其新出的情趣玩具被人解读为采用了元宇宙土耳其发现稀土资源,满足全球1000年需求,我国地位或将不保?土耳其发现稀土资源,满足全球1000年需求,我国地位或将不保?要知道现在是经济全球化发展的时代了,每个国家都削尖了脑袋想要让自己发展得更好,更厉害。所以也就努力地发展自己国内的工业掩不住的兴奋!普京这么快就论功行赏参战将士了作者朱长生(沃民高科沃德研究院院长)7月4日,俄罗斯总统在克里姆林宫召见俄罗斯国防部部长绍伊古大将,专门听取了俄军在顿巴斯地区特别军事行动的战况与最新进展,看得出他的内心是异常兴奋跨界协同打造电动汽车加充电网状生态来源中国经济网陈梦宇海晓涛表示,在绿色低碳出行和数字经济的推动下,电动汽车产业生态正由传统上下游链式关系,逐步演变为汽车能源交通信息等多领域多主体参与的网状生态。开放合作共生共赢成正式官宣!汽车狂人李书福开造手机中国基金报记者吴君如今,不仅是手机厂商要造车,车企也要进军手机行业了。7月4日,由李书福担任董事长的星纪时代,与国产手机厂商魅族科技进行战略投资签约,正式宣布星纪时代持有魅族科技7挑明针对钓鱼岛!日本巡逻舰下水搭载舰炮,满排6000吨堪比驱逐舰日本虽然国土面积狭小,但野心却不小,否则也不会跟我国争夺钓鱼岛的主权。不过呢,也正是因为钓鱼岛归属中国是有历史记载的,所以日本即使再有胆子,那也是无济于事的。然而很迷惑的是,日本方欧洲成了冤大头?欧洲面临天然气危机,而美国趁机出口赚大钱文庞建国工作室李不言西方面临能源危机自从制裁俄罗斯之后,欧洲国家在能源食品等方面不仅面临着价格的飙升,还遭遇着供应短缺的危机。为了应对石油危机,英国曾呼吁民众以步行或者骑自行车的方10个体制内相对清闲的单位,榜首在意料之中,两院没有上榜大学生找工作难已经成为了现实问题,如果自身能力不强,很难会找到一份满意的工作。大多数学生毕业后会选择老三样,即考公考研考编。虽说考编能提升学习,增加含金量,但是研究生毕业仍旧面临找马来西亚政府援助金为历届最高总理物价若继续上涨援助金或加码马来西亚总理伊斯梅尔萨布里指出,若物价持续上扬,马来西亚一家援助金(BKM)可能再加码。伊斯兰党则促请政府每月发放高达1000林吉特(约合1500元人民币)援助金。马来西亚总理伊斯搞笑萌宠gif篇1,看完让你恨不得马上养个宠物1,像不像想打喷嚏又打不出的你2,温馨又治愈3,老子已经很努力了!4,坚果生产基地的流水线员工5,鹅鹅鹅,曲项咬住哥6,找我有事吗?7,铲屎官,大黑吃那么多你看8滚开,劳资拖地呢9单手压M264,上战场开直播,半只狐狸什么来头敢这么硬核?别人当游戏主播是玩物丧志,这哥们当游戏主播是玩物丧命。别人都是网络上开枪丢雷,这哥们全部真枪实弹。他的直播间荒无人烟,尘土飞扬。他本人手持AK,脚踩军用直升机。嚣张无视对面那一梭子
友情链接:快好找快生活快百科快传网中准网文好找聚热点快软网