|
|
@ -34,8 +34,7 @@ public class SuoyinService {
|
|
|
|
//统计出需要使用的 胶片量
|
|
|
|
//统计出需要使用的 胶片量
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void index(String path, String indexType) throws IOException {
|
|
|
|
public void index(String path) throws IOException {
|
|
|
|
|
|
|
|
Map<String, IndexPlate> map = new HashMap<>();
|
|
|
|
Map<String, IndexPlate> map = new HashMap<>();
|
|
|
|
findAllDir(path, map);
|
|
|
|
findAllDir(path, map);
|
|
|
|
|
|
|
|
|
|
|
@ -176,7 +175,7 @@ public class SuoyinService {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (indexType.equals("简略索引")) {
|
|
|
|
List<IndexPageRow> indexPageRows = indexGen(indexPlate, rollList, pianPageNum, totalSize);
|
|
|
|
List<IndexPageRow> indexPageRows = indexGen(indexPlate, rollList, pianPageNum, totalSize);
|
|
|
|
//修正数据
|
|
|
|
//修正数据
|
|
|
|
System.out.println(new Gson().toJson(indexPageRows));
|
|
|
|
System.out.println(new Gson().toJson(indexPageRows));
|
|
|
@ -227,9 +226,13 @@ public class SuoyinService {
|
|
|
|
File xlsParentFile = xls.getParentFile().getParentFile();
|
|
|
|
File xlsParentFile = xls.getParentFile().getParentFile();
|
|
|
|
File file2 = new File(xlsParentFile.getAbsolutePath() + "/" + indexPlate.getName() + ".xls");
|
|
|
|
File file2 = new File(xlsParentFile.getAbsolutePath() + "/" + indexPlate.getName() + ".xls");
|
|
|
|
Files.move(xls.toPath(), file2.toPath());
|
|
|
|
Files.move(xls.toPath(), file2.toPath());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//计算完整索引
|
|
|
|
//计算完整索引
|
|
|
|
|
|
|
|
if (indexType.equals("详细索引")) {
|
|
|
|
List<FullIndexPageRow> fullIndexPageRows = new ArrayList<>();
|
|
|
|
List<FullIndexPageRow> fullIndexPageRows = new ArrayList<>();
|
|
|
|
int i = 1;
|
|
|
|
int i = 1;
|
|
|
|
for (Roll roll : rollList) {
|
|
|
|
for (Roll roll : rollList) {
|
|
|
@ -246,6 +249,8 @@ public class SuoyinService {
|
|
|
|
|
|
|
|
|
|
|
|
File file1 = new File(indexPlate.getAbsolutePath());
|
|
|
|
File file1 = new File(indexPlate.getAbsolutePath());
|
|
|
|
EasyExcel.write(file1.getParentFile().getAbsolutePath() + "/full-index-" + indexPlate.getName() + ".xls", FullIndexPageRow.class).sheet("test").doWrite(fullIndexPageRows);
|
|
|
|
EasyExcel.write(file1.getParentFile().getAbsolutePath() + "/full-index-" + indexPlate.getName() + ".xls", FullIndexPageRow.class).sheet("test").doWrite(fullIndexPageRows);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -274,7 +279,7 @@ public class SuoyinService {
|
|
|
|
BufferedImage image = ImageIO.read(docfile);
|
|
|
|
BufferedImage image = ImageIO.read(docfile);
|
|
|
|
int height = image.getHeight();
|
|
|
|
int height = image.getHeight();
|
|
|
|
int width = image.getWidth();
|
|
|
|
int width = image.getWidth();
|
|
|
|
Document document = new Document(width, height, 300, docfile.getName(),null);
|
|
|
|
Document document = new Document(width, height, 300, docfile.getName(), null);
|
|
|
|
documentList.add(document);
|
|
|
|
documentList.add(document);
|
|
|
|
} catch (IOException e) {
|
|
|
|
} catch (IOException e) {
|
|
|
|
throw new RuntimeException(e);
|
|
|
|
throw new RuntimeException(e);
|
|
|
@ -286,7 +291,7 @@ public class SuoyinService {
|
|
|
|
int height = imageInfo.getHeight();
|
|
|
|
int height = imageInfo.getHeight();
|
|
|
|
int width = imageInfo.getWidth();
|
|
|
|
int width = imageInfo.getWidth();
|
|
|
|
int physicalHeightDpi = imageInfo.getPhysicalHeightDpi();
|
|
|
|
int physicalHeightDpi = imageInfo.getPhysicalHeightDpi();
|
|
|
|
Document document = new Document(width, height, physicalHeightDpi, docfile.getName(),null);
|
|
|
|
Document document = new Document(width, height, physicalHeightDpi, docfile.getName(), null);
|
|
|
|
documentList.add(document);
|
|
|
|
documentList.add(document);
|
|
|
|
} catch (IOException e) {
|
|
|
|
} catch (IOException e) {
|
|
|
|
throw new RuntimeException("非图片格式", e);
|
|
|
|
throw new RuntimeException("非图片格式", e);
|
|
|
|