diff --git a/backend/src/main/java/com/yfd/platform/qgc_base/controller/SdFpssBHController.java b/backend/src/main/java/com/yfd/platform/qgc_base/controller/SdFpssBHController.java index efbb84c1..9089ba20 100644 --- a/backend/src/main/java/com/yfd/platform/qgc_base/controller/SdFpssBHController.java +++ b/backend/src/main/java/com/yfd/platform/qgc_base/controller/SdFpssBHController.java @@ -95,11 +95,18 @@ public class SdFpssBHController { return result ? ResponseResult.success("修改成功") : ResponseResult.error("修改失败"); } - @Log(module = "过鱼设施管理", value = "删除过鱼设施") +// @Log(module = "过鱼设施管理", value = "删除过鱼设施") +// @PostMapping("/delete") +// @Operation(summary = "删除过鱼设施") +// public ResponseResult delete(@RequestParam String stcd, @RequestParam String sttp) { +// boolean result = sdFpssBHService.deleteById(stcd, sttp); +// return result ? ResponseResult.success("删除成功") : ResponseResult.error("删除失败"); +// } + @PostMapping("/delete") - @Operation(summary = "删除过鱼设施") - public ResponseResult delete(@RequestParam String stcd, @RequestParam String sttp) { - boolean result = sdFpssBHService.deleteById(stcd, sttp); + @Operation(summary = "删除") + public ResponseResult delete(@RequestBody SdEngInfoBHOperateRequest request) { + boolean result = sdFpssBHService.delete(request == null ? null : request.getIds(), request == null ? null : request.getSource()); return result ? ResponseResult.success("删除成功") : ResponseResult.error("删除失败"); } } \ No newline at end of file diff --git a/backend/src/main/java/com/yfd/platform/qgc_base/domain/SdFpssBH.java b/backend/src/main/java/com/yfd/platform/qgc_base/domain/SdFpssBH.java index eeee4a8a..a1696b68 100644 --- a/backend/src/main/java/com/yfd/platform/qgc_base/domain/SdFpssBH.java +++ b/backend/src/main/java/com/yfd/platform/qgc_base/domain/SdFpssBH.java @@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; import lombok.Data; import java.io.Serializable; @@ -425,4 +426,42 @@ public class SdFpssBH implements Serializable { * 数据来源时间 */ private Date vlsrTm; + + /** + * 创建人 + */ + private String recordUser; + + /** + * 创建时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date recordTime; + + /** + * 更新人 + */ + private String modifyUser; + + /** + * 更新时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date modifyTime; + + /** + * 是否已删除 + */ + private Integer isDeleted; + + /** + * 删除人 + */ + private String deleteUser; + + /** + * 删除时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date deleteTime; } \ No newline at end of file diff --git a/backend/src/main/java/com/yfd/platform/qgc_base/service/IMsOperationLogService.java b/backend/src/main/java/com/yfd/platform/qgc_base/service/IMsOperationLogService.java index 85c9882a..203aae65 100644 --- a/backend/src/main/java/com/yfd/platform/qgc_base/service/IMsOperationLogService.java +++ b/backend/src/main/java/com/yfd/platform/qgc_base/service/IMsOperationLogService.java @@ -32,4 +32,30 @@ public interface IMsOperationLogService { * @param 实体类型 */ void recordModifyDetailLog(String tableName, T before, T after, String source); + + /** + * 通用新增操作详情日志(含字段级详情) + *

+ * 通过反射遍历实体所有非空字段,将每个字段值 + * 记录为一条操作日志详情。 + *

+ * @param tableName 表名 + * @param entity 新增的实体 + * @param source 操作来源 + * @param 实体类型 + */ + void recordAddDetailLog(String tableName, T entity, String source); + + /** + * 通用删除操作详情日志(含字段级详情) + *

+ * 通过反射遍历实体所有非空字段,将每个被删除的字段值 + * 记录为一条操作日志详情。 + *

+ * @param tableName 表名 + * @param entity 被删除的实体 + * @param source 操作来源 + * @param 实体类型 + */ + void recordDeleteDetailLog(String tableName, T entity, String source); } diff --git a/backend/src/main/java/com/yfd/platform/qgc_base/service/ISdFpssBHService.java b/backend/src/main/java/com/yfd/platform/qgc_base/service/ISdFpssBHService.java index cbcd2fcb..d3009d7f 100644 --- a/backend/src/main/java/com/yfd/platform/qgc_base/service/ISdFpssBHService.java +++ b/backend/src/main/java/com/yfd/platform/qgc_base/service/ISdFpssBHService.java @@ -31,4 +31,6 @@ public interface ISdFpssBHService extends IService { SdFpssBH getDetail(String stcd, String sttp); Page queryPageList(DataSourceRequest request); + + boolean delete(List stcds, String source); } \ No newline at end of file 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 b4854359..9067a8dd 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 @@ -438,6 +438,69 @@ public class MsOperationLogServiceImpl implements IMsOperationLogService { batchInsertDetails(details); } + @Override + public void recordAddDetailLog(String tableName, T entity, String source) { + if (entity == null) { + return; + } + String recordId = getStcd(entity); + MsOperationLog mainLog = buildMainLog(tableName, recordId, "新增", source); + msOperationLogMapper.insert(mainLog); + + List details = new ArrayList<>(); + Set processedColumns = new HashSet<>(); + Class entityClass = entity.getClass(); + + for (Field field : entityClass.getDeclaredFields()) { + if (shouldSkipField(field)) { + continue; + } + field.setAccessible(true); + String columnName = resolveColumnName(field); + if (processedColumns.contains(columnName)) { + continue; + } + Object newValue = getFieldValue(field, entity); + details.add(buildGenericDetail(mainLog.getId(), tableName, recordId, columnName, + null, newValue, "新增字段值")); + processedColumns.add(columnName); + } + batchInsertDetails(details); + } + + @Override + public void recordDeleteDetailLog(String tableName, T entity, String source) { + if (entity == null) { + return; + } + String recordId = getStcd(entity); + MsOperationLog mainLog = buildMainLog(tableName, recordId, "删除", source); + msOperationLogMapper.insert(mainLog); + + List details = new ArrayList<>(); + Set processedColumns = new HashSet<>(); + Class entityClass = entity.getClass(); + + for (Field field : entityClass.getDeclaredFields()) { + if (shouldSkipField(field)) { + continue; + } + field.setAccessible(true); + String columnName = resolveColumnName(field); + if (processedColumns.contains(columnName)) { + continue; + } + Object oldValue = getFieldValue(field, entity); +// if (oldValue == null) { +// continue; +// } + details.add(buildGenericDetail(mainLog.getId(), tableName, recordId, columnName, + oldValue, null, "删除字段值")); + processedColumns.add(columnName); + } + batchInsertDetails(details); + } + private MsOperationLogDetail buildDetail(String mainId, String stationCode, String fieldCode, diff --git a/backend/src/main/java/com/yfd/platform/qgc_base/service/impl/SdAiboxBHServiceImpl.java b/backend/src/main/java/com/yfd/platform/qgc_base/service/impl/SdAiboxBHServiceImpl.java index 0169a429..37e13342 100644 --- a/backend/src/main/java/com/yfd/platform/qgc_base/service/impl/SdAiboxBHServiceImpl.java +++ b/backend/src/main/java/com/yfd/platform/qgc_base/service/impl/SdAiboxBHServiceImpl.java @@ -71,7 +71,7 @@ public class SdAiboxBHServiceImpl extends ServiceImpl 0; diff --git a/backend/src/main/java/com/yfd/platform/qgc_base/service/impl/SdArtsgBHServiceImpl.java b/backend/src/main/java/com/yfd/platform/qgc_base/service/impl/SdArtsgBHServiceImpl.java index 6d3e6087..9c25ab10 100644 --- a/backend/src/main/java/com/yfd/platform/qgc_base/service/impl/SdArtsgBHServiceImpl.java +++ b/backend/src/main/java/com/yfd/platform/qgc_base/service/impl/SdArtsgBHServiceImpl.java @@ -66,7 +66,7 @@ public class SdArtsgBHServiceImpl extends ServiceImpl 0; diff --git a/backend/src/main/java/com/yfd/platform/qgc_base/service/impl/SdDwBHServiceImpl.java b/backend/src/main/java/com/yfd/platform/qgc_base/service/impl/SdDwBHServiceImpl.java index 0688aee9..04109a2f 100644 --- a/backend/src/main/java/com/yfd/platform/qgc_base/service/impl/SdDwBHServiceImpl.java +++ b/backend/src/main/java/com/yfd/platform/qgc_base/service/impl/SdDwBHServiceImpl.java @@ -68,7 +68,7 @@ public class SdDwBHServiceImpl extends ServiceImpl impleme public boolean add(SdDwBH entity, String source) { boolean result = this.save(entity); if (result) { - msOperationLogService.recordOperationLog(TABLE_NAME, entity.getStcd(), "新增", source); + msOperationLogService.recordAddDetailLog(TABLE_NAME, entity, source); } return result; } @@ -96,8 +96,8 @@ public class SdDwBHServiceImpl extends ServiceImpl impleme wrapper.set(SdDwBH::getDeleteUser, SecurityUtils.getCurrentUsername()); wrapper.set(SdDwBH::getDeleteTime, new Date()); if (this.update(wrapper)) { - msOperationLogService.recordOperationLog(TABLE_NAME, stcd, "删除", source); - count++; + SdDwBH entity = this.getById(stcd); + msOperationLogService.recordDeleteDetailLog(TABLE_NAME, entity, source); count++; } } return count > 0; diff --git a/backend/src/main/java/com/yfd/platform/qgc_base/service/impl/SdEqBHServiceImpl.java b/backend/src/main/java/com/yfd/platform/qgc_base/service/impl/SdEqBHServiceImpl.java index 23bf1859..bda41c3b 100644 --- a/backend/src/main/java/com/yfd/platform/qgc_base/service/impl/SdEqBHServiceImpl.java +++ b/backend/src/main/java/com/yfd/platform/qgc_base/service/impl/SdEqBHServiceImpl.java @@ -68,7 +68,7 @@ public class SdEqBHServiceImpl extends ServiceImpl impleme public boolean add(SdEqBH entity, String source) { boolean result = this.save(entity); if (result) { - msOperationLogService.recordOperationLog(TABLE_NAME, entity.getStcd(), "新增", source); + msOperationLogService.recordAddDetailLog(TABLE_NAME, entity, source); } return result; } @@ -96,8 +96,8 @@ public class SdEqBHServiceImpl extends ServiceImpl impleme wrapper.set(SdEqBH::getDeleteUser, SecurityUtils.getCurrentUsername()); wrapper.set(SdEqBH::getDeleteTime, new Date()); if (this.update(wrapper)) { - msOperationLogService.recordOperationLog(TABLE_NAME, stcd, "删除", source); - count++; + SdEqBH entity = this.getById(stcd); + msOperationLogService.recordDeleteDetailLog(TABLE_NAME, entity, source); count++; } } return count > 0; diff --git a/backend/src/main/java/com/yfd/platform/qgc_base/service/impl/SdFbrdBHServiceImpl.java b/backend/src/main/java/com/yfd/platform/qgc_base/service/impl/SdFbrdBHServiceImpl.java index fefa8f9b..36f8caa5 100644 --- a/backend/src/main/java/com/yfd/platform/qgc_base/service/impl/SdFbrdBHServiceImpl.java +++ b/backend/src/main/java/com/yfd/platform/qgc_base/service/impl/SdFbrdBHServiceImpl.java @@ -65,7 +65,7 @@ public class SdFbrdBHServiceImpl extends ServiceImpl i public boolean add(SdFbrdBH entity, String source) { boolean result = this.save(entity); if (result) { - msOperationLogService.recordOperationLog(TABLE_NAME, entity.getStcd(), "新增", source); + msOperationLogService.recordAddDetailLog(TABLE_NAME, entity, source); } return result; } @@ -88,7 +88,8 @@ public class SdFbrdBHServiceImpl extends ServiceImpl i int count = 0; for (String stcd : stcds) { if (this.removeById(stcd)) { - msOperationLogService.recordOperationLog(TABLE_NAME, stcd, "删除", source); + SdFbrdBH entity = this.getById(stcd); + msOperationLogService.recordDeleteDetailLog(TABLE_NAME, entity, source); count++; } } diff --git a/backend/src/main/java/com/yfd/platform/qgc_base/service/impl/SdFhbtBHServiceImpl.java b/backend/src/main/java/com/yfd/platform/qgc_base/service/impl/SdFhbtBHServiceImpl.java index 407806d9..c61dd69a 100644 --- a/backend/src/main/java/com/yfd/platform/qgc_base/service/impl/SdFhbtBHServiceImpl.java +++ b/backend/src/main/java/com/yfd/platform/qgc_base/service/impl/SdFhbtBHServiceImpl.java @@ -69,7 +69,7 @@ public class SdFhbtBHServiceImpl extends ServiceImpl i public boolean add(SdFhbtBH entity, String source) { boolean result = this.save(entity); if (result) { - msOperationLogService.recordOperationLog(TABLE_NAME, entity.getStcd(), "新增", source); + msOperationLogService.recordAddDetailLog(TABLE_NAME, entity, source); } return result; } @@ -97,8 +97,8 @@ public class SdFhbtBHServiceImpl extends ServiceImpl i wrapper.set(SdFhbtBH::getDeleteUser, SecurityUtils.getCurrentUsername()); wrapper.set(SdFhbtBH::getDeleteTime, new Date()); if (this.update(wrapper)) { - msOperationLogService.recordOperationLog(TABLE_NAME, stcd, "删除", source); - count++; + SdFhbtBH entity = this.getById(stcd); + msOperationLogService.recordDeleteDetailLog(TABLE_NAME, entity, source); count++; } } return count > 0; diff --git a/backend/src/main/java/com/yfd/platform/qgc_base/service/impl/SdFpssBHServiceImpl.java b/backend/src/main/java/com/yfd/platform/qgc_base/service/impl/SdFpssBHServiceImpl.java index 152ded95..99528a60 100644 --- a/backend/src/main/java/com/yfd/platform/qgc_base/service/impl/SdFpssBHServiceImpl.java +++ b/backend/src/main/java/com/yfd/platform/qgc_base/service/impl/SdFpssBHServiceImpl.java @@ -1,6 +1,7 @@ package com.yfd.platform.qgc_base.service.impl; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.yfd.platform.common.DataSourceRequest; @@ -21,10 +22,7 @@ import jakarta.annotation.Resource; import org.springframework.stereotype.Service; import org.springframework.util.StringUtils; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Set; +import java.util.*; import java.util.stream.Collectors; @Service @@ -217,17 +215,20 @@ public class SdFpssBHServiceImpl extends ServiceImpl i public boolean add(SdFpssBH entity, String source) { boolean result = save(entity); if (result) { - msOperationLogService.recordOperationLog(TABLE_NAME, entity.getStcd(), "新增", source); +// msOperationLogService.recordOperationLog(TABLE_NAME, entity.getStcd(), "新增", source); + msOperationLogService.recordAddDetailLog(TABLE_NAME, entity, source); } return result; } @Override - public boolean updateById(SdFpssBH sdFpssBH, String source) { - LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); - wrapper.eq(SdFpssBH::getStcd, sdFpssBH.getStcd()) - .eq(SdFpssBH::getSttp, sdFpssBH.getSttp()); - return update(sdFpssBH, wrapper); + public boolean updateById(SdFpssBH entity, String source) { + SdFpssBH before = this.getById(entity.getStcd()); + boolean result = this.updateById(entity); + if (result && before != null) { + msOperationLogService.recordModifyDetailLog(TABLE_NAME, before, entity, source); + } + return result; } @Override @@ -252,4 +253,22 @@ public class SdFpssBHServiceImpl extends ServiceImpl i dictCodeToNameConverter.convertCodeToName(sdFpssBHPage, CODE_TO_NAME_META_LIST); return sdFpssBHPage; } + + @Override + public boolean delete(List stcds, String source) { + if (stcds == null || stcds.isEmpty()) return false; + int count = 0; + for (String stcd : stcds) { + LambdaUpdateWrapper wrapper = new LambdaUpdateWrapper<>(); + wrapper.eq(SdFpssBH::getStcd, stcd); + wrapper.set(SdFpssBH::getIsDeleted, 1); + wrapper.set(SdFpssBH::getDeleteUser, SecurityUtils.getCurrentUsername()); + wrapper.set(SdFpssBH::getDeleteTime, new Date()); + if (this.update(wrapper)) { + SdFpssBH entity = this.getById(stcd); + msOperationLogService.recordDeleteDetailLog(TABLE_NAME, entity, source); count++; + } + } + return count > 0; + } } diff --git a/backend/src/main/java/com/yfd/platform/qgc_base/service/impl/SdOpinfoBHServiceImpl.java b/backend/src/main/java/com/yfd/platform/qgc_base/service/impl/SdOpinfoBHServiceImpl.java index a696f953..c6eb7fc2 100644 --- a/backend/src/main/java/com/yfd/platform/qgc_base/service/impl/SdOpinfoBHServiceImpl.java +++ b/backend/src/main/java/com/yfd/platform/qgc_base/service/impl/SdOpinfoBHServiceImpl.java @@ -69,7 +69,7 @@ public class SdOpinfoBHServiceImpl extends ServiceImpl i public boolean add(SdOtteBH entity, String source) { boolean result = this.save(entity); if (result) { - msOperationLogService.recordOperationLog(TABLE_NAME, entity.getStcd(), "新增", source); + msOperationLogService.recordAddDetailLog(TABLE_NAME, entity, source); } return result; } @@ -90,7 +90,8 @@ public class SdOtteBHServiceImpl extends ServiceImpl i int count = 0; for (String stcd : stcds) { if (this.removeById(stcd)) { - msOperationLogService.recordOperationLog(TABLE_NAME, stcd, "删除", source); + SdOtteBH entity = this.getById(stcd); + msOperationLogService.recordDeleteDetailLog(TABLE_NAME, entity, source); count++; } } diff --git a/backend/src/main/java/com/yfd/platform/qgc_base/service/impl/SdOtweBHServiceImpl.java b/backend/src/main/java/com/yfd/platform/qgc_base/service/impl/SdOtweBHServiceImpl.java index 00b87e2d..4a3a4516 100644 --- a/backend/src/main/java/com/yfd/platform/qgc_base/service/impl/SdOtweBHServiceImpl.java +++ b/backend/src/main/java/com/yfd/platform/qgc_base/service/impl/SdOtweBHServiceImpl.java @@ -66,7 +66,7 @@ public class SdOtweBHServiceImpl extends ServiceImpl i public boolean add(SdOtweBH entity, String source) { boolean result = this.save(entity); if (result) { - msOperationLogService.recordOperationLog(TABLE_NAME, entity.getStcd(), "新增", source); + msOperationLogService.recordAddDetailLog(TABLE_NAME, entity, source); } return result; } @@ -89,7 +89,8 @@ public class SdOtweBHServiceImpl extends ServiceImpl i int count = 0; for (String stcd : stcds) { if (this.removeById(stcd)) { - msOperationLogService.recordOperationLog(TABLE_NAME, stcd, "删除", source); + SdOtweBH entity = this.getById(stcd); + msOperationLogService.recordDeleteDetailLog(TABLE_NAME, entity, source); count++; } } diff --git a/backend/src/main/java/com/yfd/platform/qgc_base/service/impl/SdSonarBHServiceImpl.java b/backend/src/main/java/com/yfd/platform/qgc_base/service/impl/SdSonarBHServiceImpl.java index 2ce05e0e..4b48a182 100644 --- a/backend/src/main/java/com/yfd/platform/qgc_base/service/impl/SdSonarBHServiceImpl.java +++ b/backend/src/main/java/com/yfd/platform/qgc_base/service/impl/SdSonarBHServiceImpl.java @@ -70,7 +70,7 @@ public class SdSonarBHServiceImpl extends ServiceImpl impleme public boolean add(SdTeBH entity, String source) { boolean result = this.save(entity); if (result) { - msOperationLogService.recordOperationLog(TABLE_NAME, entity.getStcd(), "新增", source); + msOperationLogService.recordAddDetailLog(TABLE_NAME, entity, source); } return result; } @@ -89,7 +89,8 @@ public class SdTeBHServiceImpl extends ServiceImpl impleme int count = 0; for (String stcd : stcds) { if (this.removeById(stcd)) { - msOperationLogService.recordOperationLog(TABLE_NAME, stcd, "删除", source); + SdTeBH entity = this.getById(stcd); + msOperationLogService.recordDeleteDetailLog(TABLE_NAME, entity, source); count++; } } diff --git a/backend/src/main/java/com/yfd/platform/qgc_base/service/impl/SdVaBHServiceImpl.java b/backend/src/main/java/com/yfd/platform/qgc_base/service/impl/SdVaBHServiceImpl.java index 992d4536..5be94d58 100644 --- a/backend/src/main/java/com/yfd/platform/qgc_base/service/impl/SdVaBHServiceImpl.java +++ b/backend/src/main/java/com/yfd/platform/qgc_base/service/impl/SdVaBHServiceImpl.java @@ -67,7 +67,7 @@ public class SdVaBHServiceImpl extends ServiceImpl impleme public boolean add(SdVaBH entity, String source) { boolean result = this.save(entity); if (result) { - msOperationLogService.recordOperationLog(TABLE_NAME, entity.getStcd(), "新增", source); + msOperationLogService.recordAddDetailLog(TABLE_NAME, entity, source); } return result; } @@ -95,7 +95,8 @@ public class SdVaBHServiceImpl extends ServiceImpl impleme wrapper.set(SdVaBH::getDeleteUser, SecurityUtils.getCurrentUsername()); wrapper.set(SdVaBH::getDeleteTime, new Date()); if (this.update(wrapper)) { - msOperationLogService.recordOperationLog(TABLE_NAME, stcd, "删除", source); + SdVaBH entity = this.getById(stcd); + msOperationLogService.recordDeleteDetailLog(TABLE_NAME, entity, source); count++; } } diff --git a/backend/src/main/java/com/yfd/platform/qgc_base/service/impl/SdVdinfoBServiceImpl.java b/backend/src/main/java/com/yfd/platform/qgc_base/service/impl/SdVdinfoBServiceImpl.java index 2b01dd72..6d431473 100644 --- a/backend/src/main/java/com/yfd/platform/qgc_base/service/impl/SdVdinfoBServiceImpl.java +++ b/backend/src/main/java/com/yfd/platform/qgc_base/service/impl/SdVdinfoBServiceImpl.java @@ -66,8 +66,7 @@ public class SdVdinfoBServiceImpl extends ServiceImpl 0; diff --git a/backend/src/main/java/com/yfd/platform/qgc_base/service/impl/SdVpBHServiceImpl.java b/backend/src/main/java/com/yfd/platform/qgc_base/service/impl/SdVpBHServiceImpl.java index 57480536..5ae15e39 100644 --- a/backend/src/main/java/com/yfd/platform/qgc_base/service/impl/SdVpBHServiceImpl.java +++ b/backend/src/main/java/com/yfd/platform/qgc_base/service/impl/SdVpBHServiceImpl.java @@ -67,8 +67,7 @@ public class SdVpBHServiceImpl extends ServiceImpl impleme public boolean add(SdVpBH entity, String source) { boolean result = this.save(entity); if (result) { - msOperationLogService.recordOperationLog(TABLE_NAME, entity.getStcd(), "新增", source); - } + msOperationLogService.recordAddDetailLog(TABLE_NAME, entity, source); } return result; } @@ -95,8 +94,8 @@ public class SdVpBHServiceImpl extends ServiceImpl impleme wrapper.set(SdVpBH::getDeleteUser, SecurityUtils.getCurrentUsername()); wrapper.set(SdVpBH::getDeleteTime, new Date()); if (this.update(wrapper)) { - msOperationLogService.recordOperationLog(TABLE_NAME, stcd, "删除", source); - count++; + SdVpBH entity = this.getById(stcd); + msOperationLogService.recordDeleteDetailLog(TABLE_NAME, entity, source); count++; } } return count > 0; diff --git a/backend/src/main/java/com/yfd/platform/qgc_base/service/impl/SdWeBHServiceImpl.java b/backend/src/main/java/com/yfd/platform/qgc_base/service/impl/SdWeBHServiceImpl.java index 171d91b5..b0ca0a7e 100644 --- a/backend/src/main/java/com/yfd/platform/qgc_base/service/impl/SdWeBHServiceImpl.java +++ b/backend/src/main/java/com/yfd/platform/qgc_base/service/impl/SdWeBHServiceImpl.java @@ -68,8 +68,7 @@ public class SdWeBHServiceImpl extends ServiceImpl impleme public boolean add(SdWeBH entity, String source) { boolean result = this.save(entity); if (result) { - msOperationLogService.recordOperationLog(TABLE_NAME, entity.getStcd(), "新增", source); - } + msOperationLogService.recordAddDetailLog(TABLE_NAME, entity, source); } return result; } @@ -91,8 +90,8 @@ public class SdWeBHServiceImpl extends ServiceImpl impleme int count = 0; for (String stcd : stcds) { if (this.removeById(stcd)) { - msOperationLogService.recordOperationLog(TABLE_NAME, stcd, "删除", source); - count++; + SdWeBH entity = this.getById(stcd); + msOperationLogService.recordDeleteDetailLog(TABLE_NAME, entity, source); count++; } } return count > 0; diff --git a/backend/src/main/java/com/yfd/platform/qgc_base/service/impl/SdWqBHServiceImpl.java b/backend/src/main/java/com/yfd/platform/qgc_base/service/impl/SdWqBHServiceImpl.java index 0f7bb30c..c9ec411f 100644 --- a/backend/src/main/java/com/yfd/platform/qgc_base/service/impl/SdWqBHServiceImpl.java +++ b/backend/src/main/java/com/yfd/platform/qgc_base/service/impl/SdWqBHServiceImpl.java @@ -69,8 +69,7 @@ public class SdWqBHServiceImpl extends ServiceImpl impleme public boolean add(SdWqBH entity, String source) { boolean result = this.save(entity); if (result) { - msOperationLogService.recordOperationLog(TABLE_NAME, entity.getStcd(), "新增", source); - } + msOperationLogService.recordAddDetailLog(TABLE_NAME, entity, source); } return result; } @@ -97,8 +96,8 @@ public class SdWqBHServiceImpl extends ServiceImpl impleme wrapper.set(SdWqBH::getDeleteUser, SecurityUtils.getCurrentUsername()); wrapper.set(SdWqBH::getDeleteTime, new Date()); if (this.update(wrapper)) { - msOperationLogService.recordOperationLog(TABLE_NAME, stcd, "删除", source); - count++; + SdWqBH entity = this.getById(stcd); + msOperationLogService.recordDeleteDetailLog(TABLE_NAME, entity, source); count++; } } return count > 0; diff --git a/backend/src/main/java/com/yfd/platform/qgc_base/service/impl/SdWtBHServiceImpl.java b/backend/src/main/java/com/yfd/platform/qgc_base/service/impl/SdWtBHServiceImpl.java index ac2e140c..b7e4838b 100644 --- a/backend/src/main/java/com/yfd/platform/qgc_base/service/impl/SdWtBHServiceImpl.java +++ b/backend/src/main/java/com/yfd/platform/qgc_base/service/impl/SdWtBHServiceImpl.java @@ -72,7 +72,7 @@ public class SdWtBHServiceImpl extends ServiceImpl impleme public boolean add(SdWtBH entity, String source) { boolean result = this.save(entity); if (result) { - msOperationLogService.recordOperationLog(TABLE_NAME, entity.getStcd(), "新增", source); + msOperationLogService.recordAddDetailLog(TABLE_NAME, entity, source); } return result; } @@ -100,7 +100,8 @@ public class SdWtBHServiceImpl extends ServiceImpl impleme wrapper.set(SdWtBH::getDeleteUser, SecurityUtils.getCurrentUsername()); wrapper.set(SdWtBH::getDeleteTime, new Date()); if (this.update(wrapper)) { - msOperationLogService.recordOperationLog(TABLE_NAME, stcd, "删除", source); + SdWtBH entity = this.getById(stcd); + msOperationLogService.recordDeleteDetailLog(TABLE_NAME, entity, source); count++; } } diff --git a/backend/src/main/java/com/yfd/platform/qgc_lygk/along/service/impl/MsAlongBServiceImpl.java b/backend/src/main/java/com/yfd/platform/qgc_lygk/along/service/impl/MsAlongBServiceImpl.java index 1ffdaba2..50a58573 100644 --- a/backend/src/main/java/com/yfd/platform/qgc_lygk/along/service/impl/MsAlongBServiceImpl.java +++ b/backend/src/main/java/com/yfd/platform/qgc_lygk/along/service/impl/MsAlongBServiceImpl.java @@ -171,7 +171,7 @@ public class MsAlongBServiceImpl extends ServiceImpl i ); if (StrUtil.isNotBlank(filterSql)) { - sql.append("AND ").append(filterSql).append(" "); + sql.append(" AND ").append(filterSql).append(" "); } // 解析过滤条件