test: sync contract

This commit is contained in:
2025-10-31 16:15:47 +08:00
parent 1a615c9374
commit 7ea83200d2
3 changed files with 284 additions and 1 deletions

View File

@@ -381,7 +381,18 @@ public class ArchivesUploadController {
}
//查询公文文件表
String sqlFile = " select * from fujian where fawen_index = " + indexComment;
// 打印fawen_index对应的记录数量
String sqlCount = " select count(*) as record_count from fujian where fawen_index = " + indexComment;
ResultSet countResult = YcjSystemIntegration.executeQuery(sqlCount);
if (countResult.next()) {
int recordCount = countResult.getInt("record_count");
if (log.isInfoEnabled()) {
log.info("[DOC] fawen_index={} 对应的记录数量: {}", indexComment, recordCount);
}
}
YcjSystemIntegration.closeResources(null, null, countResult);
resultSetFile = YcjSystemIntegration.executeQuery(sqlFile);
while (resultSetFile.next()) {
String fileName = resultSetFile.getString("file_path");
// String[] split = file_path.split("/");
@@ -406,8 +417,9 @@ public class ArchivesUploadController {
} else if (log.isDebugEnabled()) {
log.debug("[DOC] 跳过重复附件登记: rec_id={}, fileName={}", jhId, fileName);
}
if(type.equalsIgnoreCase("jpg")||type.equalsIgnoreCase("png") || type.equalsIgnoreCase("pdf") ){
if(type.equalsIgnoreCase("jpg")||type.equalsIgnoreCase("png") ){
//生成一份pdf文件用于归档章的操作
String newName_pdf=fileNameServer.replace("."+type,".pdf");
PdfFileHelper.image2Pdf(dirPath.resolve(fileNameServer).toString(),dirPath.resolve(newName_pdf).toString());
@@ -420,6 +432,10 @@ public class ArchivesUploadController {
} finally {
binaryStream.close(); // 关闭流很重要,避免资源泄露
}
} else {
if (log.isInfoEnabled()) {
log.info("[DOC] binaryStream为空跳过文件处理: fawen_index={}, fileName={}", indexComment, fileName);
}
}
}
//更新原文数量
@@ -757,6 +773,16 @@ public class ArchivesUploadController {
}
//查询公文文件表
String sqlFile = " select * from fujian where fawen_index = " + indexComment;
// 打印fawen_index对应的记录数量
String sqlCount = " select count(*) as record_count from fujian where fawen_index = " + indexComment;
ResultSet countResult = YcjSystemIntegration.executeQuery(sqlCount);
if (countResult.next()) {
int recordCount = countResult.getInt("record_count");
if (log.isInfoEnabled()) {
log.info("[CONTRACT] fawen_index={} 对应的记录数量: {}", indexComment, recordCount);
}
}
YcjSystemIntegration.closeResources(null, null, countResult);
resultSetFile = YcjSystemIntegration.executeQuery(sqlFile);
while (resultSetFile.next()) {
String fileName = resultSetFile.getString("file_path");
@@ -854,6 +880,10 @@ public class ArchivesUploadController {
} finally {
binaryStream.close(); // 关闭流很重要,避免资源泄露
}
} else {
if (log.isInfoEnabled()) {
log.info("[CONTRACT] binaryStream为空跳过文件处理: fawen_index={}, fileName={}", indexComment, fileName);
}
}
}
//更新原文数量