diff --git a/mt/src/main/java/com/ccsens/mt/service/ExcelService.java b/mt/src/main/java/com/ccsens/mt/service/ExcelService.java index 64b5906e..018ec558 100644 --- a/mt/src/main/java/com/ccsens/mt/service/ExcelService.java +++ b/mt/src/main/java/com/ccsens/mt/service/ExcelService.java @@ -1470,7 +1470,7 @@ public class ExcelService implements IExcelService { PoiUtil.PoiUtilCell oneFive=new PoiUtil.PoiUtilCell("总成绩", 1, 2); PoiUtil.PoiUtilCell oneSix=new PoiUtil.PoiUtilCell("扣除次数", 1, 2); PoiUtil.PoiUtilCell oneSeven=new PoiUtil.PoiUtilCell("最终成绩", 1, 2); - PoiUtil.PoiUtilCell oneEight=new PoiUtil.PoiUtilCell("名词", 1, 2); + PoiUtil.PoiUtilCell oneEight=new PoiUtil.PoiUtilCell("名次", 1, 2); PoiUtil.PoiUtilCell oneNine=new PoiUtil.PoiUtilCell("备注", 1, 2); one.add(oneOne); diff --git a/util/src/test/java/com/ccsens/util/VideoTest.java b/util/src/test/java/com/ccsens/util/VideoTest.java index f2535fcc..70026770 100644 --- a/util/src/test/java/com/ccsens/util/VideoTest.java +++ b/util/src/test/java/com/ccsens/util/VideoTest.java @@ -5,6 +5,7 @@ import java.net.HttpURLConnection; import java.net.MalformedURLException; import java.net.URL; import java.net.URLConnection; +import java.util.List; public class VideoTest { @@ -30,7 +31,7 @@ public class VideoTest { //设置超时 httpURLConnection.setConnectTimeout(1000*5); //设置请求方式,默认是GET - httpURLConnection.setRequestMethod("POST"); + httpURLConnection.setRequestMethod("GET"); // 设置字符编码 httpURLConnection.setRequestProperty("Charset", "UTF-8"); // 打开到此 URL引用的资源的通信链接(如果尚未建立这样的连接)。 @@ -46,10 +47,10 @@ public class VideoTest { BufferedInputStream bin = new BufferedInputStream(httpURLConnection.getInputStream()); // 指定文件名称(有需求可以自定义) - String fileFullName=""; - if(urlPath.contains("=")){ - fileFullName=urlPath.substring(urlPath.lastIndexOf("=")+1); - } + String fileFullName=urlPath.substring(urlPath.lastIndexOf("/") + 1); +// if(urlPath.contains("=")){ +// fileFullName=urlPath.substring(urlPath.lastIndexOf("=")+1); +// } // 指定存放位置(有需求可以自定义) String path = downloadDir + File.separatorChar + fileFullName; @@ -58,6 +59,9 @@ public class VideoTest { if (!file.getParentFile().exists()) { file.getParentFile().mkdirs(); } + if (!file.exists()) { + file.createNewFile(); + } OutputStream out = new FileOutputStream(file); int size = 0; @@ -90,10 +94,26 @@ public class VideoTest { * 测试 * @param args */ - public static void main(String[] args) { + public static void main(String[] args) throws Exception { // 指定资源地址,下载文件测试 - downloadFile("http://1258473962.vod2.myqcloud.com/1e124671vodcq1258473962/76557f735285890810478037694/VCj25SXUgFsA.mp4", "D:/temp/"); + downloadFile("http://1258473962.vod2.myqcloud.com/1e124671vodcq1258473962/d4650b135285890810564491478/wyGRWPX5qlgA.mp4", "D:/temp/"); +// List objects = PoiUtil.readExce(new File("D:\\temp\\test.xlsx"), 0, null, 0, false); +//// for (int i = 0; i < objects.size(); i++) { +//// Object[] obj = objects.get(i); +//// if (obj == null || obj.length < 3) { +//// continue; +//// } +//// String path = (String)obj[2]; +//// String dir = "D:\\temp\\" + obj[0] + "\\" + obj[1]; +//// try{ +//// downloadFile(path, dir); +//// } catch (Exception e) { +//// System.out.println("下载失败:" + dir); +//// e.printStackTrace(); +//// +//// } +//// } } }