优化代码

master
zhanghai 2 years ago
parent 4cbfaec723
commit a4cfcc0fbb

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

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

@ -36,7 +36,6 @@ public class SuoyinService {
}
public void index(String path) {
// ArrayList<IndexPlate> indexPlates = new ArrayList<>();
Map<String,IndexPlate> map = new HashMap<>();
findAllDir(path, map);
@ -52,12 +51,12 @@ public class SuoyinService {
//卷
for (File rollFile : files) {
if (rollFile.getName().equals("片头")) {
//填充卷
//填充卷
Roll roll = new Roll(rollFile.getName(), rollFile.getAbsolutePath());
rollList.add(roll);
} else if (rollFile.getName().equals("片尾")) {
//填充卷
//填充卷
Roll roll = new Roll(rollFile.getName(), rollFile.getAbsolutePath());
rollList.add(roll);
@ -88,7 +87,6 @@ public class SuoyinService {
} catch (IOException e) {
throw new RuntimeException(e);
}
// ImageInfo imageInfo = Imaging.getImageInfo(inputFile);
} else {
try {
@ -99,13 +97,11 @@ public class SuoyinService {
Document document = new Document(width, height, physicalHeightDpi);
documentList.add(document);
} catch (IOException e) {
// FileUtils.delete(file);
throw new RuntimeException("非图片格式", e);
} catch (ImageReadException e) {
// FileUtils.delete(file);
throw new RuntimeException(e);
} catch (IllegalArgumentException e) {
// FileUtils.delete(file);
throw new RuntimeException(e);
}
}

Loading…
Cancel
Save