From f7b2baec57a19039ca85880bbba4e17fe27f0511 Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期三, 10 三月 2021 18:21:13 +0800 Subject: [PATCH] 删除冗余代码,初步优化首页的推荐专题,3.8.7之后在我的里面添加VIP分类 --- src/main/java/com/yeshi/buwan/util/ExcelReadUtil.java | 107 ----------------------------------------------------- 1 files changed, 0 insertions(+), 107 deletions(-) diff --git a/src/main/java/com/yeshi/buwan/util/ExcelReadUtil.java b/src/main/java/com/yeshi/buwan/util/ExcelReadUtil.java index cacf27f..270786d 100644 --- a/src/main/java/com/yeshi/buwan/util/ExcelReadUtil.java +++ b/src/main/java/com/yeshi/buwan/util/ExcelReadUtil.java @@ -1,112 +1,5 @@ package com.yeshi.buwan.util; -import java.io.File; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; - -import com.yeshi.buwan.domain.LeShiAccountVideo; -import com.yeshi.buwan.domain.entity.VideoAccount; - -import jxl.Cell; -import jxl.Sheet; -import jxl.Workbook; -import jxl.read.biff.BiffException; - public class ExcelReadUtil { - public static List<LeShiAccountVideo> getLeShiAccountFromExcel(int start, - int end) { - List<LeShiAccountVideo> list = new ArrayList<LeShiAccountVideo>(); - try { - String fileName = "C:/Users/Administrator/Desktop/褰辩墖鏈湴琛�.xls"; // Excel鏂囦欢鎵�鍦ㄨ矾寰� - File file = new File(fileName); // 鍒涘缓鏂囦欢瀵硅薄 - Workbook wb = Workbook.getWorkbook(file); // 浠庢枃浠舵祦涓幏鍙朎xcel宸ヤ綔鍖哄璞★紙WorkBook锛� - Sheet sheet = wb.getSheet(0); // 浠庡伐浣滃尯涓彇寰楅〉锛圫heet锛� - - for (int i = start - 1; i < end; i++) { // 寰幆鎵撳嵃Excel琛ㄤ腑鐨勫唴瀹� - Cell cell = sheet.getCell(0, i); - Cell cell1 = sheet.getCell(1, i); - Cell cell2 = sheet.getCell(2, i); - LeShiAccountVideo video = new LeShiAccountVideo(); - video.setAccount(cell.getContents().trim() + "@" - + cell1.getContents().trim()); - video.setPwd(cell2.getContents().trim()); - video.setState("0"); - video.setValid("0"); - video.setDetailId("0"); - video.setUsecount("0"); - // juhe.setRegisterip().trim()); - list.add(video); - LogUtil.i(cell.getContents()); - } - } catch (BiffException e) { - e.printStackTrace(); - } catch (IOException e) { - e.printStackTrace(); - } - return list; - } - - public static List<VideoAccount> getRegisterLeShiAccountFromExcel( - int start, int count) { - List<VideoAccount> list = new ArrayList<VideoAccount>(); - try { - String fileName = "C:/Users/Administrator/Desktop/褰辩墖鏈湴琛�.xls"; // Excel鏂囦欢鎵�鍦ㄨ矾寰� - File file = new File(fileName); // 鍒涘缓鏂囦欢瀵硅薄 - Workbook wb = Workbook.getWorkbook(file); // 浠庢枃浠舵祦涓幏鍙朎xcel宸ヤ綔鍖哄璞★紙WorkBook锛� - Sheet sheet = wb.getSheet(0); // 浠庡伐浣滃尯涓彇寰楅〉锛圫heet锛� - - for (int i = start - 1; i < 1 + start + count; i++) { // 寰幆鎵撳嵃Excel琛ㄤ腑鐨勫唴瀹� - Cell cell = sheet.getCell(0, i);// 璐﹀彿 - Cell cell1 = sheet.getCell(1, i);// 璐﹀彿 - Cell cell2 = sheet.getCell(2, i);// 璐﹀彿 - Cell cell3 = sheet.getCell(5, i);// 璐﹀彿 - String account = cell.getContents() + "@" + cell1.getContents(); - String pwd = cell2.getContents(); - String url = cell3.getContents(); - VideoAccount video = new VideoAccount(); - video.setAccount(account); - video.setName(pwd); - video.setBeizhu(url); - // if (url != null && url.length() > 20) - list.add(video); - LogUtil.i(cell.getContents()); - } - } catch (BiffException e) { - e.printStackTrace(); - } catch (IOException e) { - e.printStackTrace(); - } - return list; - } - - public static List<VideoAccount> getLeShiAccount(String filePath, - int start, int end) { - List<VideoAccount> list = new ArrayList<VideoAccount>(); - try { - String fileName = filePath; // Excel鏂囦欢鎵�鍦ㄨ矾寰� - File file = new File(fileName); // 鍒涘缓鏂囦欢瀵硅薄 - Workbook wb = Workbook.getWorkbook(file); // 浠庢枃浠舵祦涓幏鍙朎xcel宸ヤ綔鍖哄璞★紙WorkBook锛� - Sheet sheet = wb.getSheet(0); // 浠庡伐浣滃尯涓彇寰楅〉锛圫heet锛� - - for (int i = start; i < end; i++) { // 寰幆鎵撳嵃Excel琛ㄤ腑鐨勫唴瀹� - Cell cell = sheet.getCell(0, i);// 璐﹀彿 - Cell cell1 = sheet.getCell(3, i);// 瀵嗙爜 - String account = cell.getContents(); - String pwd = cell1.getContents(); - VideoAccount video = new VideoAccount(); - video.setAccount(account); - video.setName(pwd); - if (!StringUtil.isNullOrEmpty(account)) - list.add(video); - LogUtil.i(account); - } - } catch (BiffException e) { - e.printStackTrace(); - } catch (IOException e) { - e.printStackTrace(); - } - return list; - } } -- Gitblit v1.8.0