SpringPOI如何应用于长尾词数据提取与分析?

2026-04-15 11:063阅读0评论SEO资源
  • 内容介绍
  • 文章标签
  • 相关推荐

本文共计235个文字,预计阅读时间需要1分钟。

SpringPOI如何应用于长尾词数据提取与分析?

javapublic void downloadExcel(InputStream is) throws Exception { Workbook wb=null; try { wb=new HSSFWorkbook(is); Sheet sheet=wb.getSheetAt(0); String sheetName=sheet.getSheetName(); } catch (IOException e) { e.printStackTrace(); } finally { if (wb !=null) { wb.close(); } }}

SpringPOI如何应用于长尾词数据提取与分析?

downloadExcel

public void doImport(InputStream is) throws Exception{ //读取工作簿 Workbook wb = null; try { wb = new HSSFWorkbook(is); //得到第一个工作表 Sheet sheet = wb.getSheetAt(0); //得到 工作表名称 String sheetName = sheet.getSheetName(); String type = ""; if("供应商".equals(sheetName)){ type = Supplier.TYPE_PURCHASE; } if("客户".equals(sheetName)){ type = Supplier.TYPE_CUSTOMER; } int rowCnt = sheet.getLastRowNum();//最后一行的索引 Row row = null; for(int i = 1; i <= rowCnt; i++){ row = sheet.getRow(i); //供应商名称 String name = row.getCell(0).getStringCellValue(); //构建查询条件 Supplier supplier = new Supplier(); //设置查询条件 supplier.setName(name); List list = supplierDao.getList(null, supplier, null); if(list.size() > 0){ //存在, 进入持久化 supplier = list.get(0); } supplier.setAddress(row.getCell(1).getStringCellValue()); supplier.setContact(row.getCell(2).getStringCellValue()); supplier.setTele(row.getCell(3).getStringCellValue()); supplier.setEmail(row.getCell(4).getStringCellValue()); //不存在,就新增 if(list.size() == 0){ //设置类型 supplier.setType(type); supplierDao.add(supplier); } } } finally { if(null != wb){ wb.close(); } } }

本文共计235个文字,预计阅读时间需要1分钟。

SpringPOI如何应用于长尾词数据提取与分析?

javapublic void downloadExcel(InputStream is) throws Exception { Workbook wb=null; try { wb=new HSSFWorkbook(is); Sheet sheet=wb.getSheetAt(0); String sheetName=sheet.getSheetName(); } catch (IOException e) { e.printStackTrace(); } finally { if (wb !=null) { wb.close(); } }}

SpringPOI如何应用于长尾词数据提取与分析?

downloadExcel

public void doImport(InputStream is) throws Exception{ //读取工作簿 Workbook wb = null; try { wb = new HSSFWorkbook(is); //得到第一个工作表 Sheet sheet = wb.getSheetAt(0); //得到 工作表名称 String sheetName = sheet.getSheetName(); String type = ""; if("供应商".equals(sheetName)){ type = Supplier.TYPE_PURCHASE; } if("客户".equals(sheetName)){ type = Supplier.TYPE_CUSTOMER; } int rowCnt = sheet.getLastRowNum();//最后一行的索引 Row row = null; for(int i = 1; i <= rowCnt; i++){ row = sheet.getRow(i); //供应商名称 String name = row.getCell(0).getStringCellValue(); //构建查询条件 Supplier supplier = new Supplier(); //设置查询条件 supplier.setName(name); List list = supplierDao.getList(null, supplier, null); if(list.size() > 0){ //存在, 进入持久化 supplier = list.get(0); } supplier.setAddress(row.getCell(1).getStringCellValue()); supplier.setContact(row.getCell(2).getStringCellValue()); supplier.setTele(row.getCell(3).getStringCellValue()); supplier.setEmail(row.getCell(4).getStringCellValue()); //不存在,就新增 if(list.size() == 0){ //设置类型 supplier.setType(type); supplierDao.add(supplier); } } } finally { if(null != wb){ wb.close(); } } }