优化代码

master
zhanghai 2 years ago
parent 4cbfaec723
commit a4cfcc0fbb

@ -101,10 +101,6 @@
</dependency> </dependency>
</dependencies> </dependencies>
<build> <build>

@ -132,7 +132,6 @@ public class FenpanService {
} catch (IOException e) { } catch (IOException e) {
throw new RuntimeException(e); throw new RuntimeException(e);
} }
// ImageInfo imageInfo = Imaging.getImageInfo(inputFile);
} else { } else {
try { try {
@ -162,7 +161,6 @@ public class FenpanService {
File file = new File(piece.getAbsolutePath()); File file = new File(piece.getAbsolutePath());
File parentFile = file.getParentFile(); File parentFile = file.getParentFile();
String name = parentFile.getName(); String name = parentFile.getName();
// System.out.println(name);
Roll roll = rollMap.get(name); Roll roll = rollMap.get(name);
if (roll == null) { if (roll == null) {
roll = new Roll(name, parentFile.getAbsolutePath()); roll = new Roll(name, parentFile.getAbsolutePath());
@ -176,7 +174,6 @@ public class FenpanService {
if (zong == null) { if (zong == null) {
zong = new Zong(parentFile.getParentFile().getAbsolutePath(), parentFile.getParentFile().getName()); zong = new Zong(parentFile.getParentFile().getAbsolutePath(), parentFile.getParentFile().getName());
} }
// zong.put(rollMap.get(name));
zongMap.put(zongName, zong); zongMap.put(zongName, zong);
} }
@ -208,20 +205,6 @@ public class FenpanService {
zong.put(roll); zong.put(roll);
} }
} }
// //填充宗
// for (String name : rollMap.keySet()) {
// Roll roll = rollMap.get(name);
// File file = new File(roll.getAbsolutePath());
// String zongName = file.getParentFile().getName();
// Zong zong = zongMap.get(zongName);
// if (zong == null) {
// zong = new Zong(file.getParentFile().getAbsolutePath(), file.getParentFile().getName());
// }
// zong.put(rollMap.get(name));
// zongMap.put(zongName, zong);
// }
return zongMap; return zongMap;

@ -36,7 +36,6 @@ public class SuoyinService {
} }
public void index(String path) { public void index(String path) {
// ArrayList<IndexPlate> indexPlates = new ArrayList<>();
Map<String,IndexPlate> map = new HashMap<>(); Map<String,IndexPlate> map = new HashMap<>();
findAllDir(path, map); findAllDir(path, map);
@ -88,7 +87,6 @@ public class SuoyinService {
} catch (IOException e) { } catch (IOException e) {
throw new RuntimeException(e); throw new RuntimeException(e);
} }
// ImageInfo imageInfo = Imaging.getImageInfo(inputFile);
} else { } else {
try { try {
@ -99,13 +97,11 @@ public class SuoyinService {
Document document = new Document(width, height, physicalHeightDpi); Document document = new Document(width, height, physicalHeightDpi);
documentList.add(document); documentList.add(document);
} catch (IOException e) { } catch (IOException e) {
// FileUtils.delete(file);
throw new RuntimeException("非图片格式", e); throw new RuntimeException("非图片格式", e);
} catch (ImageReadException e) { } catch (ImageReadException e) {
// FileUtils.delete(file);
throw new RuntimeException(e); throw new RuntimeException(e);
} catch (IllegalArgumentException e) { } catch (IllegalArgumentException e) {
// FileUtils.delete(file); throw new RuntimeException(e);
} }
} }

Loading…
Cancel
Save