master
金安民 6 months ago
parent fef43d4e47
commit e835467af5

Binary file not shown.

@ -142,7 +142,7 @@ public class Main extends Application {
statusBar.setStyle("-fx-background-color: #e8e8e8;");
Label statusLabel = new Label("就绪");
Label userLabel = new Label("当前用户:管理员");
Label userLabel = new Label("当前用户:系统管理员");
Label timeLabel = new Label(getCurrentTime());
Region spacer = new Region();

@ -100,7 +100,7 @@ public class DataGoods {
pstmt.executeUpdate();
addGoods(goods); // 同步内存中的数据
DataManager.getInstance().addOperationLog("新增", goods.getId(), "当前用户", "新增货物: " + goods.getName());
DataManager.getInstance().addOperationLog("新增", goods.getId(), "系统管理员", "新增货物: " + goods.getName());
} catch (SQLException e) {
e.printStackTrace();
DataManager.showAlert("错误", "添加货物失败:" + e.getMessage());
@ -128,7 +128,7 @@ public class DataGoods {
pstmt.executeUpdate();
addGoods(goods); // 同步内存中的数据
DataManager.getInstance().addOperationLog("更新", goods.getId(), "当前用户", "更新货物: " + goods.getName());
DataManager.getInstance().addOperationLog("更新", goods.getId(), "系统管理员", "更新货物: " + goods.getName());
} catch (SQLException e) {
e.printStackTrace();
DataManager.showAlert("错误", "更新货物失败:" + e.getMessage());

@ -324,7 +324,7 @@ public class DataManager {
// 将操作日志类型从"新增"改为"修改"
System.out.println("正在添加操作日志: " + "修改" + " - " + "修改货物: " + goods.getName());
addOperationLog("修改", goods.getId(), "当前用户", "修改货物: " + goods.getName());
addOperationLog("修改", goods.getId(), "系统管理员", "修改货物: " + goods.getName());
} catch (SQLException e) {
e.printStackTrace();
showAlert("错误", "添加货物失败:" + e.getMessage());
@ -347,7 +347,7 @@ public class DataManager {
pstmt.executeUpdate();
System.out.println("正在添加操作日志: " + "更新" + " - " + "更新货物: " + goods.getName());
addOperationLog("更新", goods.getId(), "当前用户", "更新货物: " + goods.getName());
addOperationLog("更新", goods.getId(), "系统管理员", "更新货物: " + goods.getName());
} catch (SQLException e) {
e.printStackTrace();
showAlert("错误", "更新货物失败:" + e.getMessage());

@ -229,11 +229,11 @@ public class GoodsManagementView extends BorderPane {
"(id, operation_type, operation_target, operator, operation_time, details) " +
"VALUES (?, ?, ?, ?, ?, ?)";
try (PreparedStatement logStmt = conn.prepareStatement(logSql)) {
String logId = "LOG" + System.currentTimeMillis();
String logId = String.format("LOG%014d", System.currentTimeMillis());
logStmt.setString(1, logId);
logStmt.setString(2, "修改");
logStmt.setString(3, name);
logStmt.setString(4, "当前用户");
logStmt.setString(4, "系统管理员");
logStmt.setString(5, LocalDateTime.now().toString());
logStmt.setString(6, String.format("修改货物信息:%s数量%d供应商%s",
name, quantity, supplier));

@ -182,7 +182,7 @@ public class InboundView extends BorderPane {
}
// 创建入库记录
String id = String.format("NO%014d", System.currentTimeMillis());
String id = String.format("IN%014d", System.currentTimeMillis());
LocalDateTime now = LocalDateTime.now();
// 修改数据库连接为相对路径
@ -197,7 +197,7 @@ public class InboundView extends BorderPane {
pstmt.setInt(3, quantity);
pstmt.setString(4, supplier);
pstmt.setString(5, now.toString());
pstmt.setString(6, "当前用户");
pstmt.setString(6, "系统管理员");
pstmt.setString(7, remark);
pstmt.executeUpdate();
@ -211,7 +211,7 @@ public class InboundView extends BorderPane {
quantity,
supplier,
now,
"当前用户",
"系统管理员",
remark
);
@ -227,7 +227,7 @@ public class InboundView extends BorderPane {
// 添加操作日志
String details = String.format("入库货物:%s数量%d供应商%s",
goodsName, quantity, supplier);
DataManager.getInstance().addOperationLog("入库", goodsName, "当前用户", details);
DataManager.getInstance().addOperationLog("入库", goodsName, "系统管理员", details);
showAlert("成功", "入库记录已保存!");

@ -249,7 +249,7 @@ public class OutboundView extends BorderPane {
System.out.println("正在添加出库日志: " + details);
try {
DataManager.getInstance().addOperationLog("出库", goodsName, "当前用户", details);
DataManager.getInstance().addOperationLog("出库", goodsName, "系统管理员", details);
System.out.println("出库日志添加成功");
} catch (Exception e) {
System.err.println("添加出库日志失败: " + e.getMessage());

Loading…
Cancel
Save