From 85e7efd3c49fba3eaf20d7b05e5e3804d3745499 Mon Sep 17 00:00:00 2001 From: tangwei Date: Tue, 1 Sep 2026 18:00:17 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BC=98=E5=8C=96=E5=9F=BA=E6=9C=AC?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=88=A0=E9=99=A4=E6=93=8D=E4=BD=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../qgc_base/domain/MsOperationLog.java | 3 +- .../impl/MsOperationLogServiceImpl.java | 35 +++++++++++++------ 2 files changed, 27 insertions(+), 11 deletions(-) diff --git a/backend/src/main/java/com/yfd/platform/qgc_base/domain/MsOperationLog.java b/backend/src/main/java/com/yfd/platform/qgc_base/domain/MsOperationLog.java index 13f1f80b..a62bc1c3 100644 --- a/backend/src/main/java/com/yfd/platform/qgc_base/domain/MsOperationLog.java +++ b/backend/src/main/java/com/yfd/platform/qgc_base/domain/MsOperationLog.java @@ -42,7 +42,8 @@ public class MsOperationLog implements Serializable { /** * 操作记录的名称(瞬态字段,不持久化,由后端查询后填充) */ - @TableField(exist = false) +// @TableField(exist = false) + @TableField("RECORD_NAME") private String recordName; } diff --git a/backend/src/main/java/com/yfd/platform/qgc_base/service/impl/MsOperationLogServiceImpl.java b/backend/src/main/java/com/yfd/platform/qgc_base/service/impl/MsOperationLogServiceImpl.java index 2cba93c6..9d4a67fb 100644 --- a/backend/src/main/java/com/yfd/platform/qgc_base/service/impl/MsOperationLogServiceImpl.java +++ b/backend/src/main/java/com/yfd/platform/qgc_base/service/impl/MsOperationLogServiceImpl.java @@ -345,7 +345,7 @@ public class MsOperationLogServiceImpl extends ServiceImpl details = new ArrayList<>(); @@ -381,7 +381,7 @@ public class MsOperationLogServiceImpl extends ServiceImpl details = new ArrayList<>(); @@ -418,7 +418,7 @@ public class MsOperationLogServiceImpl extends ServiceImpl details = new ArrayList<>(); @@ -448,14 +448,15 @@ public class MsOperationLogServiceImpl extends ServiceImpl codeToNameFieldMap = buildCodeToNameFieldMap(codeToNameMetaList); - MsOperationLog mainLog = buildMainLog(tableName, recordId, "新增", source,"01"); + // 调用示例:尝试获取 name,如果没有则尝试获取 code + String stnm = getFieldValue(entity, "stnm"); + MsOperationLog mainLog = buildMainLog(tableName, recordId, stnm, "新增", source,"01"); msOperationLogMapper.insert(mainLog); List details = new ArrayList<>(); @@ -580,6 +583,17 @@ public class MsOperationLogServiceImpl extends ServiceImpl void recordDeleteDetailLog(String recordId,String tableName, T entity, String source) { if (entity == null) { @@ -621,7 +635,8 @@ public class MsOperationLogServiceImpl extends ServiceImpl codeToNameFieldMap = buildCodeToNameFieldMap(codeToNameMetaList); - MsOperationLog mainLog = buildMainLog(tableName, recordId, "修改", source,"02"); + String stnm = getFieldValue(after, "stnm"); + MsOperationLog mainLog = buildMainLog(tableName, recordId,stnm, "修改", source,"02"); msOperationLogMapper.insert(mainLog); List details = new ArrayList<>(); @@ -664,8 +679,8 @@ public class MsOperationLogServiceImpl extends ServiceImpl codeToNameFieldMap = buildCodeToNameFieldMap(codeToNameMetaList); - - MsOperationLog mainLog = buildMainLog(tableName, recordId, "删除", source,"03"); + String stnm = getFieldValue(entity, "stnm"); + MsOperationLog mainLog = buildMainLog(tableName, recordId,stnm, "删除", source,"03"); msOperationLogMapper.insert(mainLog); List details = new ArrayList<>();