当前位置: 首页 > news >正文

wordpress建英文站太原seo关键词排名优化

wordpress建英文站,太原seo关键词排名优化,单机网页游戏网站,网站续费怎么做帐思路:先准备好模板文件和与之对应的实体类,数据库数据等,还是之前思路,根据查出的数据,填充模板文件,生成一个临时文件,最后将这些个临时文件打包为zip返回前端,并将多个临时文件删除…

思路:先准备好模板文件和与之对应的实体类,数据库数据等,还是之前思路,根据查出的数据,填充模板文件,生成一个临时文件,最后将这些个临时文件打包为zip返回前端,并将多个临时文件删除掉就ok了

紧接着就是copy

    @Log(title = "表格管理-批量导出", businessType = BusinessType.EXPORT)@Operation(description = "下载表格")@PostMapping("/imports")public void excelimport(HttpServletResponse response, @RequestBody List<FormVo> formVo) throws IOException {response.setContentType("application/zip");response.setCharacterEncoding("UTF-8");String fileName = "/home/ag/project/files/templates/" + System.currentTimeMillis() + ".zip";response.setHeader("Content-Disposition", "attachment; filename=\"" + URLEncoder.encode(fileName, "UTF-8"));FileOutputStream fos = new FileOutputStream(fileName);ZipOutputStream zos = new ZipOutputStream(fos);ExcelWriter writer = null;ArrayList<String> o = new ArrayList<>();for (FormVo f : formVo) {// 模板文件路径   switch case部分是我的业务代码(多个不同的模板文件)  各位就不用看了,删掉即可String templateFilePath;String type = f.getType();switch (type) {case "1":templateFilePath = form;break;case "2":templateFilePath = formCao;break;case "3":templateFilePath = formLin;break;case "4":templateFilePath = formYuan;break;case "5":templateFilePath = formShui;break;case "6":templateFilePath = formJian;break;case "7":templateFilePath = formQi;break;default:throw new RuntimeException("表格类型有误");}// 创建 ExcelWriter 实例String fileName1 = "/home/ag/project/files/templates/" + System.currentTimeMillis() + "听忆计划表.xlsx";writer = EasyExcel// 写入到临时文件.write(fileName1)// 指定模板.withTemplate(templateFilePath).build();WriteSheet sheet = EasyExcel.writerSheet().build();FillConfig fillConfig = FillConfig.builder()// 开启填充换行.forceNewRow(true).build();List list = getjituan1(f, f.getType());//计算公式Workbook workbook = writer.writeContext().writeWorkbookHolder().getWorkbook();workbook.setForceFormulaRecalculation(true);// 执行填充操作writer.fill(list, fillConfig, sheet);o.add(fileName1);
//            // 压缩文件writer.finish();}for (String f:o){// 压缩文件File file1 = new File(f);addFileToZip(file1, zos);
//            删除临时文件deleteFile(f);}zos.close();//将压缩文件输入流传给response输出流InputStream fileInputStream = new FileInputStream(fileName);OutputStream outputStream = response.getOutputStream();byte[] bytes = new byte[1024 * 8];int len;while ((len = fileInputStream.read(bytes)) != -1) {outputStream.write(bytes, 0, len);}outputStream.close();fileInputStream.close();}static void deleteFile(String path) {File file = new File(path);if (file.exists()) {file.delete();}}public static void addFileToZip(File file, ZipOutputStream zos) throws IOException {InputStream fileInputStream = new FileInputStream(file);//zip中要放文件称为zipEntryZipEntry zipEntry = new ZipEntry(file.getName());zos.putNextEntry(zipEntry);byte[] bytes = new byte[1024];int len;while ((len = fileInputStream.read(bytes)) > 0) {//读的内容会自动放到zip条目中,因此zipentry再输出流读完需要关闭zos.write(bytes, 0, len);}fileInputStream.close();zos.closeEntry();}

http://www.hkea.cn/news/930716/

相关文章:

  • 网站右侧浮动广告代码百度推广代理公司广州
  • 固原建站公司旺道seo推广系统怎么收费
  • 适合做外链的网站海外广告联盟平台推广
  • 建筑模板规格型号郑州厉害的seo顾问
  • ppt做书模板下载网站有哪些内容国际婚恋网站排名
  • 上海网站建设内容更新网络营销策划目的
  • 重庆市建设信息网站关键词查询网
  • 做哪种网站流量大怎么打广告宣传自己的产品
  • 免费表白网站制作seo网络优化推广
  • 网站建设中可能升级中国科技新闻网
  • 网站制作内容文案网站如何快速被百度收录
  • 淘宝淘宝网页版登录入口免费seo公司
  • 竹溪县县建设局网站短视频营销
  • 好的网站有哪些搜索引擎seo是什么意思
  • 做音乐网站赚钱吗做小程序的公司
  • 坪地网站建设域名流量查询工具
  • 网站建设部署万能推广app
  • 网站的重要性怎么做个网站
  • 做网站的经验百度旗下有哪些app
  • 化工网站开发推广点击器
  • 怎么访问日本竹中建设网站外贸seo推广
  • 惠阳建设局网站引流推广接单
  • 北京通州网站建设公司如何建立公司网站网页
  • 网站换程序301seo优化按天扣费
  • html5 网站自适应长尾关键词挖掘爱站工具
  • 网站设计公司(信科网络)潍坊网站定制模板建站
  • 番禺网站开发报价百度竞价排名软件
  • 做企业网站接单seo网站优化技术
  • 建设网站行业云网络推广理实一体化软件
  • 如何用自己公司网站做邮箱关键字是什么意思