update
This commit is contained in:
+5
-2
@@ -1480,8 +1480,11 @@ public class FileSpiltService {
|
|||||||
HttpResponse res = client.execute(post);
|
HttpResponse res = client.execute(post);
|
||||||
String results = EntityUtils.toString(res.getEntity());
|
String results = EntityUtils.toString(res.getEntity());
|
||||||
|
|
||||||
if (StringUtils.isNotEmpty(results) && !StringUtils.equals(results,"非法请求!") && !StringUtils.equals(results,"非法参数!")) {
|
if (StringUtils.isNotEmpty(results)) {
|
||||||
result = new File(results);
|
boolean errorFlag = (StringUtils.equals(results,"非法请求!") || StringUtils.equals(results,"非法参数!") || StringUtils.equals(results,"转换失败!"));
|
||||||
|
if (!errorFlag) {
|
||||||
|
result = new File(results);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
|||||||
-25
@@ -606,31 +606,6 @@ public class POIReadExcelToHtml {
|
|||||||
return sheetIndexPicMap;
|
return sheetIndexPicMap;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void printImg(List<Map<String, PictureData>> sheetList) throws IOException {
|
|
||||||
for (Map<String, PictureData> map : sheetList) {
|
|
||||||
printImg(map);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void printImg(Map<String, PictureData> map) throws IOException {
|
|
||||||
Object key[] = map.keySet().toArray();
|
|
||||||
for (int i = 0; i < map.size(); i++) {
|
|
||||||
// 获取图片流
|
|
||||||
PictureData pic = map.get(key[i]);
|
|
||||||
// 获取图片索引
|
|
||||||
String picName = key[i].toString();
|
|
||||||
// 获取图片格式
|
|
||||||
String ext = pic.suggestFileExtension();
|
|
||||||
|
|
||||||
byte[] data = pic.getData();
|
|
||||||
|
|
||||||
FileOutputStream out = new FileOutputStream("D:\\pic" + picName + "." + ext);
|
|
||||||
out.write(data);
|
|
||||||
out.flush();
|
|
||||||
out.close();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private static int[] getColsOfTable(Sheet sheet) {
|
private static int[] getColsOfTable(Sheet sheet) {
|
||||||
int[] data = {0, 0};
|
int[] data = {0, 0};
|
||||||
for (int i = sheet.getFirstRowNum(); i < sheet.getLastRowNum(); i++) {
|
for (int i = sheet.getFirstRowNum(); i < sheet.getLastRowNum(); i++) {
|
||||||
|
|||||||
Reference in New Issue
Block a user