|
|
@ -140,7 +140,6 @@ public class SuoyinService {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
indexPlate.putAll(rollList);
|
|
|
|
indexPlate.putAll(rollList);
|
|
|
|
|
|
|
|
|
|
|
@ -201,7 +200,6 @@ public class SuoyinService {
|
|
|
|
Integer page = PdfUtil.getPage(indexPlate.getAbsolutePath() + "/" + indexPlate.getName() + ".pdf");
|
|
|
|
Integer page = PdfUtil.getPage(indexPlate.getAbsolutePath() + "/" + indexPlate.getName() + ".pdf");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
indexPageRows = indexGen(indexPlate, rollList, page, totalSize);
|
|
|
|
indexPageRows = indexGen(indexPlate, rollList, page, totalSize);
|
|
|
|
//修正数据
|
|
|
|
//修正数据
|
|
|
|
System.out.println(new Gson().toJson(indexPageRows));
|
|
|
|
System.out.println(new Gson().toJson(indexPageRows));
|
|
|
@ -235,6 +233,22 @@ public class SuoyinService {
|
|
|
|
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());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//计算完整索引
|
|
|
|
|
|
|
|
List<FullIndexPageRow> fullIndexPageRows = new ArrayList<>();
|
|
|
|
|
|
|
|
int i = 1;
|
|
|
|
|
|
|
|
for (Roll roll : rollList) {
|
|
|
|
|
|
|
|
List<Pieces> piecesList = roll.getPiecesList();
|
|
|
|
|
|
|
|
for (Pieces pieces : piecesList) {
|
|
|
|
|
|
|
|
List<Document> documentList = pieces.getDocumentList();
|
|
|
|
|
|
|
|
for (Document document : documentList) {
|
|
|
|
|
|
|
|
FullIndexPageRow fullIndexPageRow = new FullIndexPageRow(indexPlate.getZongName(), indexPlate.getName(), roll.getName(), pieces.getName(), document.getName(), document.isA3() ? "A3" : "A4", i);
|
|
|
|
|
|
|
|
fullIndexPageRows.add(fullIndexPageRow);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
EasyExcel.write(indexPlate.getAbsolutePath() + "/full-index-" + indexPlate.getName() + ".xls", MesEasyExcel.class).sheet("test").doWrite(fullIndexPageRows);
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//读取片头
|
|
|
|
//读取片头
|
|
|
@ -262,7 +276,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);
|
|
|
|
Document document = new Document(width, height, 300, docfile.getName());
|
|
|
|
documentList.add(document);
|
|
|
|
documentList.add(document);
|
|
|
|
} catch (IOException e) {
|
|
|
|
} catch (IOException e) {
|
|
|
|
throw new RuntimeException(e);
|
|
|
|
throw new RuntimeException(e);
|
|
|
@ -274,7 +288,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);
|
|
|
|
Document document = new Document(width, height, physicalHeightDpi, docfile.getName());
|
|
|
|
documentList.add(document);
|
|
|
|
documentList.add(document);
|
|
|
|
} catch (IOException e) {
|
|
|
|
} catch (IOException e) {
|
|
|
|
throw new RuntimeException("非图片格式", e);
|
|
|
|
throw new RuntimeException("非图片格式", e);
|
|
|
@ -289,7 +303,6 @@ public class SuoyinService {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private List<IndexPageRow> indexGen(IndexPlate indexPlate, List<Roll> rollList, Integer pianPageNum, Integer totalSize) {
|
|
|
|
private List<IndexPageRow> indexGen(IndexPlate indexPlate, List<Roll> rollList, Integer pianPageNum, Integer totalSize) {
|
|
|
|