Merge remote-tracking branch 'origin/master'
# Conflicts: # src/main/java/top/r3944realms/docchecktoolrefactored/ui/module/DuplicateDocumentPaneController.java # src/main/java/top/r3944realms/docchecktoolrefactored/ui/module/PathCheckPaneController.java # src/main/resources/fxml/module/step-1-pane.fxml # src/main/resources/fxml/module/step-7-pane.fxml
This commit is contained in:
commit
81b420bacb
|
|
@ -27,7 +27,7 @@ public enum System {
|
|||
private static final ReentrantReadWriteLock lock = new ReentrantReadWriteLock();
|
||||
// 默认值
|
||||
private static final long DEFAULT_SINGLE_TIMEOUT = 30;
|
||||
private static final long DEFAULT_TOTAL_TIMEOUT = 300;
|
||||
private static final long DEFAULT_TOTAL_TIMEOUT = 12600;
|
||||
private static final boolean DEFAULT_ENABLE_STEP = false;
|
||||
|
||||
public static void init() {
|
||||
|
|
|
|||
|
|
@ -136,7 +136,7 @@ public class HashFileGenerator {
|
|||
return;
|
||||
}
|
||||
|
||||
String hash = hashCalculator.calculatePartialHash(file);
|
||||
String hash = hashCalculator.calculateHash(file);
|
||||
String[] result = {file.getFileName().toString(), hash};
|
||||
|
||||
synchronized (results) {
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import org.apache.poi.hssf.usermodel.HSSFWorkbook;
|
|||
import org.apache.poi.ss.usermodel.*;
|
||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||
import top.r3944realms.docchecktoolrefactored.core.LogicalAddressFileGenerator;
|
||||
import top.r3944realms.docchecktoolrefactored.ui.utils.DialogUtil;
|
||||
import top.r3944realms.docchecktoolrefactored.util.FileUtil;
|
||||
import top.r3944realms.docchecktoolrefactored.util.LoggerMarker;
|
||||
|
||||
|
|
@ -34,11 +35,11 @@ public class ExcelFileReader implements CatalogFileReader {
|
|||
Sheet sheet = workbook.getSheetAt(0);
|
||||
log.debug(LoggerMarker.DEBUG_MARKER, "读取工作表: {}", sheet.getSheetName());
|
||||
|
||||
// 获取标题行
|
||||
// 获取列标题行
|
||||
Row headerRow = sheet.getRow(0);
|
||||
if (headerRow == null) {
|
||||
log.error(LoggerMarker.RELEASE_MARKER, "Excel文件缺少标题行");
|
||||
throw new IllegalArgumentException("Excel文件缺少标题行");
|
||||
log.error(LoggerMarker.RELEASE_MARKER, "Excel文件缺少列标题行");
|
||||
throw new IllegalArgumentException("Excel文件缺少列标题行");
|
||||
}
|
||||
// 查找"档号"和"页数"列的索引
|
||||
int archiveCodeIndex = -1;
|
||||
|
|
@ -79,7 +80,7 @@ public class ExcelFileReader implements CatalogFileReader {
|
|||
)
|
||||
);
|
||||
}
|
||||
// 从第二行开始读取数据(跳过标题行)
|
||||
// 从第二行开始读取数据(跳过列标题行,只取数据部分内容)
|
||||
int totalRows = sheet.getLastRowNum();
|
||||
int validRecords = 0;
|
||||
int skippedRecords = 0;
|
||||
|
|
@ -107,9 +108,12 @@ public class ExcelFileReader implements CatalogFileReader {
|
|||
|
||||
// 验证数据有效性
|
||||
if (archiveCode.isEmpty()) {
|
||||
DialogUtil.showWarningDialog("警告", "操作有误", "第" + ( i + 1 ) + "行档号为空,停止处理");
|
||||
throw new IllegalArgumentException("第" + ( i + 1 ) + "行档号为空,停止处理");
|
||||
|
||||
}
|
||||
if (page <= 0) {
|
||||
DialogUtil.showWarningDialog("警告", "操作有误", "第" + ( i + 1 ) + "第" + ( i + 1 ) + "行页数无效: " + page + ",停止处理");
|
||||
throw new IllegalArgumentException("第" + ( i + 1 ) + "行页数无效: " + page + ",停止处理");
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -7,15 +7,20 @@ import javafx.scene.input.KeyCode;
|
|||
import javafx.scene.input.KeyCodeCombination;
|
||||
import javafx.scene.input.KeyCombination;
|
||||
import javafx.scene.input.KeyEvent;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import top.r3944realms.docchecktoolrefactored.System;
|
||||
import top.r3944realms.docchecktoolrefactored.core.Setting;
|
||||
import top.r3944realms.docchecktoolrefactored.ui.utils.DialogUtil;
|
||||
import top.r3944realms.docchecktoolrefactored.util.LoggerMarker;
|
||||
|
||||
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* The type Main stage controller.
|
||||
*/
|
||||
|
|
@ -153,12 +158,17 @@ public class MainStageController {
|
|||
SceneManager.openSettingView();
|
||||
}
|
||||
|
||||
@FXML void onOpenHelpDoc(ActionEvent actionEvent) {
|
||||
DialogUtil.showDetailedInformationDialog("未实现", "敬请期待","待完善文档后内置");
|
||||
|
||||
@FXML
|
||||
void onOpenHelpDoc(ActionEvent actionEvent) {
|
||||
DialogUtil.showDetailedInformationDialog("帮助文档", "操作手册","见.exe程序同文件夹下的“操作手册。docx”文件。");
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@FXML void onAbout(ActionEvent actionEvent) {
|
||||
DialogUtil.showDetailedInformationDialog("版本", "版本信息","这里写些信息");
|
||||
DialogUtil.showDetailedInformationDialog("版本", "版本信息","1.0.0-beta");
|
||||
}
|
||||
public void updateStepButtonsVisibility() {
|
||||
Setting setting = System.getSetting();
|
||||
|
|
|
|||
|
|
@ -161,6 +161,7 @@ public class StorageCarrierPaneController {
|
|||
applySuccessStyle(result7TA);
|
||||
generateHashFile7B.setDisable(false);
|
||||
log.info(LoggerMarker.DEBUG_MARKER, "文件哈希值计算完成: {}", hashResult);
|
||||
log.info(LoggerMarker.RELEASE_MARKER, "文件哈希值计算完成.\t{}文件的哈希值: {}", filePath,hashResult);
|
||||
} catch (IOException e) {
|
||||
log.error(LoggerMarker.DEBUG_MARKER, "计算文件哈希值时出错: {}", filePath, e);
|
||||
DialogUtil.showDetailedErrorDialog("错误", "生成哈希文件时出错:", e.getMessage());
|
||||
|
|
@ -253,6 +254,7 @@ public class StorageCarrierPaneController {
|
|||
applySuccessStyle(result7TA);
|
||||
resetButtonStyle(caculateHash7B, calculateHashOriginalText);
|
||||
result7TA.setText(task.getValue());
|
||||
log.info(LoggerMarker.RELEASE_MARKER, task.getValue());
|
||||
});
|
||||
|
||||
// 任务失败处理
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ public class HashFileGenerationTask extends Task<String> {
|
|||
generator.setCallback((current, total) -> {
|
||||
updateProgress(current, total);
|
||||
updateMessage("处理文件: " + current + "/" + total);
|
||||
if (current % 500 == 0 || current == total) {
|
||||
if (current % 5000 == 0 || current == total) {
|
||||
log.info(LoggerMarker.DEBUG_MARKER, "处理进度: {}/{}", current, total);
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@
|
|||
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0" />
|
||||
</GridPane.margin>
|
||||
<font>
|
||||
<Font size="14.0" />
|
||||
<Font size="16.0" />
|
||||
</font>
|
||||
</Button>
|
||||
<TextField fx:id="loadCatalog2TF" GridPane.columnIndex="2">
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
<!-- 属性定义保持不变 -->
|
||||
<property name="APP_NAME" value="DocCheckTool"/>
|
||||
<property name="LOG_HOME" value="${APP_NAME}/${log.dir:-logs}"/>
|
||||
<property name="LOG_HOME" value="${log.dir:-logs}"/>
|
||||
<property name="RELEASE_PATTERN" value="%d{yyyy-MM-dd HH:mm:ss} [%level] %msg%n"/>
|
||||
<property name="DEBUG_PATTERN" value="%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{80} - %msg%n"/>
|
||||
<property name="TRACKER_PATTERN" value="%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{80} - %msg%n"/>
|
||||
|
|
@ -12,7 +12,7 @@
|
|||
|
||||
<!-- 控制台输出 -->
|
||||
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<encoder>
|
||||
<encoder charset="UTF-8" >
|
||||
<pattern>${DEBUG_PATTERN}</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
|
@ -31,7 +31,7 @@
|
|||
<onMatch>ACCEPT</onMatch>
|
||||
<onMismatch>DENY</onMismatch>
|
||||
</filter>
|
||||
<encoder>
|
||||
<encoder charset="UTF-8">
|
||||
<pattern>${RELEASE_PATTERN}</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
|
@ -50,7 +50,7 @@
|
|||
<onMatch>ACCEPT</onMatch>
|
||||
<onMismatch>DENY</onMismatch>
|
||||
</filter>
|
||||
<encoder>
|
||||
<encoder charset="UTF-8">
|
||||
<pattern>${DEBUG_PATTERN}</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
|
@ -69,7 +69,7 @@
|
|||
<onMatch>ACCEPT</onMatch>
|
||||
<onMismatch>DENY</onMismatch>
|
||||
</filter>
|
||||
<encoder>
|
||||
<encoder charset="UTF-8">
|
||||
<pattern>${TRACKER_PATTERN}</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
|
@ -89,6 +89,13 @@
|
|||
<appender-ref ref="TRACKER_FILE"/>
|
||||
<appender-ref ref="STDOUT"/>
|
||||
</logger>
|
||||
<!-- 添加你刚刚添加的logger -->
|
||||
<logger name="top.r3944realms.docchecktoolrefactored" level="DEBUG" additivity="false">
|
||||
<appender-ref ref="RELEASE_FILE"/>
|
||||
<appender-ref ref="DEBUG_FILE"/>
|
||||
<appender-ref ref="TRACKER_FILE"/>
|
||||
<appender-ref ref="STDOUT"/>
|
||||
</logger>
|
||||
|
||||
<!-- ROOT Logger - 输出到控制台 -->
|
||||
<root level="INFO">
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user