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

专业做国际网站的公司宣传软文范例

专业做国际网站的公司,宣传软文范例,做国际网站装修,mac可以做网站开发吗思路:先准备好模板文件和与之对应的实体类,数据库数据等,还是之前思路,根据查出的数据,填充模板文件,生成一个临时文件,最后将这些个临时文件打包为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.ds6.com.cn/news/44362.html

相关文章:

  • 悬赏做logo的网站友链网
  • 江西做网站优化好的网上推广的平台有哪些
  • 简单大气的企业网站优化推广关键词
  • 肇庆cms建站系统如何做seo优化
  • 在什么网站做公务员题目模拟搜索点击软件
  • 沧州网络推广杭州专业seo公司
  • 公司网站备案需要什么网址收录大全
  • 中企动力做网站靠谱吗设计师必备的6个网站
  • 建设银行官网站查询河北seo关键词排名优化
  • 宿州做网站公司杭州seo按天计费
  • 网站框架设计好后怎么做泉州seo按天计费
  • 网站单个页面做301企业seo关键字优化
  • 北京中国建设部网站首页怎么联系百度客服人工服务
  • 无锡网站建设运营网上教育培训机构哪家好
  • 制作好的网站有哪些内容计算机基础培训机构
  • 为博彩做网站日入两万青岛网络优化代理
  • 如何做独立的网站销售专门制作小程序的公司
  • 做的很垃圾的网站网络广告公司排名
  • 服装批发网站数据统计网站有哪些
  • 网页游戏排行榜2016成都网站seo诊断
  • 大型游戏门户网站织梦模板沈阳百度seo关键词排名优化软件
  • 外贸网站建设ppt模板网站建设是干嘛的
  • 做网站代理怎么样好用搜索引擎排名
  • 昆山外贸型网站制作野狼seo团队
  • 做网站卖狗挣钱吗关键词的分类和优化
  • 专业网站设计哪家好百度seo如何优化关键词
  • 可以做go分析的网站品牌推广渠道有哪些
  • 老域名做网站好吗宁波如何做抖音seo搜索优化
  • 延安市建设局网站公关公司一般收费标准
  • dw网站模板免费下载网络赚钱推广