feat: 优化删除和新增日志

This commit is contained in:
tangwei 2026-07-21 09:57:44 +08:00
parent be1d3d95ff
commit 5425db84e8
24 changed files with 222 additions and 62 deletions

View File

@ -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("删除失败");
}
}

View File

@ -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;
}

View File

@ -32,4 +32,30 @@ public interface IMsOperationLogService {
* @param <T> 实体类型
*/
<T> void recordModifyDetailLog(String tableName, T before, T after, String source);
/**
* 通用新增操作详情日志含字段级详情
* <p>
* 通过反射遍历实体所有非空字段将每个字段值
* 记录为一条操作日志详情
* </p>
* @param tableName 表名
* @param entity 新增的实体
* @param source 操作来源
* @param <T> 实体类型
*/
<T> void recordAddDetailLog(String tableName, T entity, String source);
/**
* 通用删除操作详情日志含字段级详情
* <p>
* 通过反射遍历实体所有非空字段将每个被删除的字段值
* 记录为一条操作日志详情
* </p>
* @param tableName 表名
* @param entity 被删除的实体
* @param source 操作来源
* @param <T> 实体类型
*/
<T> void recordDeleteDetailLog(String tableName, T entity, String source);
}

View File

@ -31,4 +31,6 @@ public interface ISdFpssBHService extends IService<SdFpssBH> {
SdFpssBH getDetail(String stcd, String sttp);
Page<SdFpssBH> queryPageList(DataSourceRequest request);
boolean delete(List<String> stcds, String source);
}

View File

@ -438,6 +438,69 @@ public class MsOperationLogServiceImpl implements IMsOperationLogService {
batchInsertDetails(details);
}
@Override
public <T> 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<MsOperationLogDetail> details = new ArrayList<>();
Set<String> 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 <T> 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<MsOperationLogDetail> details = new ArrayList<>();
Set<String> 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,

View File

@ -71,7 +71,7 @@ public class SdAiboxBHServiceImpl extends ServiceImpl<SdAiboxBHMapper, SdAiboxBH
public boolean add(SdAiboxBH 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;
}
@ -99,8 +99,8 @@ public class SdAiboxBHServiceImpl extends ServiceImpl<SdAiboxBHMapper, SdAiboxBH
wrapper.set(SdAiboxBH::getDeleteUser, SecurityUtils.getCurrentUsername());
wrapper.set(SdAiboxBH::getDeleteTime, new Date());
if (this.update(wrapper)) {
msOperationLogService.recordOperationLog(TABLE_NAME, stcd, "删除", source);
count++;
SdAiboxBH entity = this.getById(stcd);
msOperationLogService.recordDeleteDetailLog(TABLE_NAME, entity, source); count++;
}
}
return count > 0;

View File

@ -66,7 +66,7 @@ public class SdArtsgBHServiceImpl extends ServiceImpl<SdArtsgBHMapper, SdArtsgBH
public boolean add(SdArtsgBH 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,8 +89,8 @@ public class SdArtsgBHServiceImpl extends ServiceImpl<SdArtsgBHMapper, SdArtsgBH
int count = 0;
for (String stcd : stcds) {
if (this.removeById(stcd)) {
msOperationLogService.recordOperationLog(TABLE_NAME, stcd, "删除", source);
count++;
SdArtsgBH entity = this.getById(stcd);
msOperationLogService.recordDeleteDetailLog(TABLE_NAME, entity, source); count++;
}
}
return count > 0;

View File

@ -68,7 +68,7 @@ public class SdDwBHServiceImpl extends ServiceImpl<SdDwBHMapper, SdDwBH> 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<SdDwBHMapper, SdDwBH> 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;

View File

@ -68,7 +68,7 @@ public class SdEqBHServiceImpl extends ServiceImpl<SdEqBHMapper, SdEqBH> 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<SdEqBHMapper, SdEqBH> 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;

View File

@ -65,7 +65,7 @@ public class SdFbrdBHServiceImpl extends ServiceImpl<SdFbrdBHMapper, SdFbrdBH> 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<SdFbrdBHMapper, SdFbrdBH> 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++;
}
}

View File

@ -69,7 +69,7 @@ public class SdFhbtBHServiceImpl extends ServiceImpl<SdFhbtBHMapper, SdFhbtBH> 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<SdFhbtBHMapper, SdFhbtBH> 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;

View File

@ -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<SdFpssBHMapper, SdFpssBH> 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<SdFpssBH> 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<SdFpssBHMapper, SdFpssBH> i
dictCodeToNameConverter.convertCodeToName(sdFpssBHPage, CODE_TO_NAME_META_LIST);
return sdFpssBHPage;
}
@Override
public boolean delete(List<String> stcds, String source) {
if (stcds == null || stcds.isEmpty()) return false;
int count = 0;
for (String stcd : stcds) {
LambdaUpdateWrapper<SdFpssBH> 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;
}
}

View File

@ -69,7 +69,7 @@ public class SdOpinfoBHServiceImpl extends ServiceImpl<SdOpinfoBHMapper, SdOpinf
public boolean add(SdOpinfoBH 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,7 +97,8 @@ public class SdOpinfoBHServiceImpl extends ServiceImpl<SdOpinfoBHMapper, SdOpinf
wrapper.set(SdOpinfoBH::getDeleteUser, SecurityUtils.getCurrentUsername());
wrapper.set(SdOpinfoBH::getDeleteTime, new Date());
if (this.update(wrapper)) {
msOperationLogService.recordOperationLog(TABLE_NAME, stcd, "删除", source);
SdOpinfoBH entity = this.getById(stcd);
msOperationLogService.recordDeleteDetailLog(TABLE_NAME, entity, source);
count++;
}
}

View File

@ -67,7 +67,7 @@ public class SdOtteBHServiceImpl extends ServiceImpl<SdOtteBHMapper, SdOtteBH> 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<SdOtteBHMapper, SdOtteBH> 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++;
}
}

View File

@ -66,7 +66,7 @@ public class SdOtweBHServiceImpl extends ServiceImpl<SdOtweBHMapper, SdOtweBH> 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<SdOtweBHMapper, SdOtweBH> 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++;
}
}

View File

@ -70,7 +70,7 @@ public class SdSonarBHServiceImpl extends ServiceImpl<SdSonarBHMapper, SdSonarBH
public boolean add(SdSonarBH 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;
}
@ -98,7 +98,8 @@ public class SdSonarBHServiceImpl extends ServiceImpl<SdSonarBHMapper, SdSonarBH
wrapper.set(SdSonarBH::getDeleteUser, SecurityUtils.getCurrentUsername());
wrapper.set(SdSonarBH::getDeleteTime, new Date());
if (this.update(wrapper)) {
msOperationLogService.recordOperationLog(TABLE_NAME, stcd, "删除", source);
SdSonarBH entity = this.getById(stcd);
msOperationLogService.recordDeleteDetailLog(TABLE_NAME, entity, source);
count++;
}
}

View File

@ -66,7 +66,7 @@ public class SdTeBHServiceImpl extends ServiceImpl<SdTeBHMapper, SdTeBH> 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<SdTeBHMapper, SdTeBH> 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++;
}
}

View File

@ -67,7 +67,7 @@ public class SdVaBHServiceImpl extends ServiceImpl<SdVaBHMapper, SdVaBH> 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<SdVaBHMapper, SdVaBH> 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++;
}
}

View File

@ -66,8 +66,7 @@ public class SdVdinfoBServiceImpl extends ServiceImpl<SdVdinfoBMapper, SdVdinfoB
public boolean add(SdVdinfoB 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,8 +88,8 @@ public class SdVdinfoBServiceImpl extends ServiceImpl<SdVdinfoBMapper, SdVdinfoB
int count = 0;
for (String stcd : stcds) {
if (this.removeById(stcd)) {
msOperationLogService.recordOperationLog(TABLE_NAME, stcd, "删除", source);
count++;
SdVdinfoB entity = this.getById(stcd);
msOperationLogService.recordDeleteDetailLog(TABLE_NAME, entity, source); count++;
}
}
return count > 0;

View File

@ -67,8 +67,7 @@ public class SdVpBHServiceImpl extends ServiceImpl<SdVpBHMapper, SdVpBH> 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<SdVpBHMapper, SdVpBH> 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;

View File

@ -68,8 +68,7 @@ public class SdWeBHServiceImpl extends ServiceImpl<SdWeBHMapper, SdWeBH> 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<SdWeBHMapper, SdWeBH> 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;

View File

@ -69,8 +69,7 @@ public class SdWqBHServiceImpl extends ServiceImpl<SdWqBHMapper, SdWqBH> 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<SdWqBHMapper, SdWqBH> 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;

View File

@ -72,7 +72,7 @@ public class SdWtBHServiceImpl extends ServiceImpl<SdWtBHMapper, SdWtBH> 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<SdWtBHMapper, SdWtBH> 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++;
}
}

View File

@ -171,7 +171,7 @@ public class MsAlongBServiceImpl extends ServiceImpl<MsAlongBMapper, MsAlongB> i
);
if (StrUtil.isNotBlank(filterSql)) {
sql.append("AND ").append(filterSql).append(" ");
sql.append(" AND ").append(filterSql).append(" ");
}
// 解析过滤条件