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

哪些网站能够免费做公考题网络营销策划方案800字

哪些网站能够免费做公考题,网络营销策划方案800字,山东滕州做网站技术电话,wordpress上传大附件思路:先准备好模板文件和与之对应的实体类,数据库数据等,还是之前思路,根据查出的数据,填充模板文件,生成一个临时文件,最后将这些个临时文件打包为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.khdw.cn/news/32627.html

相关文章:

  • 长兴企业网站开发怎么在百度上推广自己
  • 一个空间怎么做两个网站百度广告联系方式
  • 山东网站建设公司哪家权威杭州百度推广
  • 哈尔滨网站设计公司重庆seo代理计费
  • 广西建设职业技术学院石景山区百科seo
  • wordpress怎么查找文件上海网站seo优化
  • 快速建设网站视频教程百度关键词刷排名软件
  • vb做网站时怎么添加图片网站首页制作网站
  • 新开的网站怎么做seo优化上海百度seo网站优化
  • 快站如何做网站西安百度seo
  • 国外开源网站系统百度今日数据统计
  • 免费贴图素材网站优就业seo课程学多久
  • 2021网站建设前景怎么样网络推广与优化
  • 湛江电子商务网站建设中国十大软件外包公司
  • 管理咨询培训杭州seo专员
  • 新闻网站设计中国新闻社
  • 做网站要怎样加盟欧普南昌企业网站建设
  • 科技有限公司图片长沙专业竞价优化首选
  • wordpress更改本地主题代哥seo
  • 做好网站建设工作网络营销公司
  • 天猫商城商品来源杭州网站seo
  • 本地网站构建东营网站seo
  • 网站建设属于什么职位类别网站建设软件
  • 企业网站 flash个人网站模板
  • 网站建设公司好不好怎样宣传自己的品牌
  • 哪个网站做网上旅社预定九个关键词感悟中国理念
  • 老司机的公众号推荐windows优化大师免费版
  • 合山市网站如何做好营销
  • 开发电商网站要多少钱什么是推广
  • 西安做网站那家好网络营销的六个特点