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("修改失败"); 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") @PostMapping("/delete")
@Operation(summary = "删除过鱼设施") @Operation(summary = "删除")
public ResponseResult delete(@RequestParam String stcd, @RequestParam String sttp) { public ResponseResult delete(@RequestBody SdEngInfoBHOperateRequest request) {
boolean result = sdFpssBHService.deleteById(stcd, sttp); boolean result = sdFpssBHService.delete(request == null ? null : request.getIds(), request == null ? null : request.getSource());
return result ? ResponseResult.success("删除成功") : ResponseResult.error("删除失败"); 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.TableField;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data; import lombok.Data;
import java.io.Serializable; import java.io.Serializable;
@ -425,4 +426,42 @@ public class SdFpssBH implements Serializable {
* 数据来源时间 * 数据来源时间
*/ */
private Date vlsrTm; 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> 实体类型 * @param <T> 实体类型
*/ */
<T> void recordModifyDetailLog(String tableName, T before, T after, String source); <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); SdFpssBH getDetail(String stcd, String sttp);
Page<SdFpssBH> queryPageList(DataSourceRequest request); 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); 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, private MsOperationLogDetail buildDetail(String mainId,
String stationCode, String stationCode,
String fieldCode, String fieldCode,

View File

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

View File

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

View File

@ -68,7 +68,7 @@ public class SdDwBHServiceImpl extends ServiceImpl<SdDwBHMapper, SdDwBH> impleme
public boolean add(SdDwBH entity, String source) { public boolean add(SdDwBH entity, String source) {
boolean result = this.save(entity); boolean result = this.save(entity);
if (result) { if (result) {
msOperationLogService.recordOperationLog(TABLE_NAME, entity.getStcd(), "新增", source); msOperationLogService.recordAddDetailLog(TABLE_NAME, entity, source);
} }
return result; return result;
} }
@ -96,8 +96,8 @@ public class SdDwBHServiceImpl extends ServiceImpl<SdDwBHMapper, SdDwBH> impleme
wrapper.set(SdDwBH::getDeleteUser, SecurityUtils.getCurrentUsername()); wrapper.set(SdDwBH::getDeleteUser, SecurityUtils.getCurrentUsername());
wrapper.set(SdDwBH::getDeleteTime, new Date()); wrapper.set(SdDwBH::getDeleteTime, new Date());
if (this.update(wrapper)) { if (this.update(wrapper)) {
msOperationLogService.recordOperationLog(TABLE_NAME, stcd, "删除", source); SdDwBH entity = this.getById(stcd);
count++; msOperationLogService.recordDeleteDetailLog(TABLE_NAME, entity, source); count++;
} }
} }
return count > 0; return count > 0;

View File

@ -68,7 +68,7 @@ public class SdEqBHServiceImpl extends ServiceImpl<SdEqBHMapper, SdEqBH> impleme
public boolean add(SdEqBH entity, String source) { public boolean add(SdEqBH entity, String source) {
boolean result = this.save(entity); boolean result = this.save(entity);
if (result) { if (result) {
msOperationLogService.recordOperationLog(TABLE_NAME, entity.getStcd(), "新增", source); msOperationLogService.recordAddDetailLog(TABLE_NAME, entity, source);
} }
return result; return result;
} }
@ -96,8 +96,8 @@ public class SdEqBHServiceImpl extends ServiceImpl<SdEqBHMapper, SdEqBH> impleme
wrapper.set(SdEqBH::getDeleteUser, SecurityUtils.getCurrentUsername()); wrapper.set(SdEqBH::getDeleteUser, SecurityUtils.getCurrentUsername());
wrapper.set(SdEqBH::getDeleteTime, new Date()); wrapper.set(SdEqBH::getDeleteTime, new Date());
if (this.update(wrapper)) { if (this.update(wrapper)) {
msOperationLogService.recordOperationLog(TABLE_NAME, stcd, "删除", source); SdEqBH entity = this.getById(stcd);
count++; msOperationLogService.recordDeleteDetailLog(TABLE_NAME, entity, source); count++;
} }
} }
return count > 0; return count > 0;

View File

@ -65,7 +65,7 @@ public class SdFbrdBHServiceImpl extends ServiceImpl<SdFbrdBHMapper, SdFbrdBH> i
public boolean add(SdFbrdBH entity, String source) { public boolean add(SdFbrdBH entity, String source) {
boolean result = this.save(entity); boolean result = this.save(entity);
if (result) { if (result) {
msOperationLogService.recordOperationLog(TABLE_NAME, entity.getStcd(), "新增", source); msOperationLogService.recordAddDetailLog(TABLE_NAME, entity, source);
} }
return result; return result;
} }
@ -88,7 +88,8 @@ public class SdFbrdBHServiceImpl extends ServiceImpl<SdFbrdBHMapper, SdFbrdBH> i
int count = 0; int count = 0;
for (String stcd : stcds) { for (String stcd : stcds) {
if (this.removeById(stcd)) { if (this.removeById(stcd)) {
msOperationLogService.recordOperationLog(TABLE_NAME, stcd, "删除", source); SdFbrdBH entity = this.getById(stcd);
msOperationLogService.recordDeleteDetailLog(TABLE_NAME, entity, source);
count++; count++;
} }
} }

View File

@ -69,7 +69,7 @@ public class SdFhbtBHServiceImpl extends ServiceImpl<SdFhbtBHMapper, SdFhbtBH> i
public boolean add(SdFhbtBH entity, String source) { public boolean add(SdFhbtBH entity, String source) {
boolean result = this.save(entity); boolean result = this.save(entity);
if (result) { if (result) {
msOperationLogService.recordOperationLog(TABLE_NAME, entity.getStcd(), "新增", source); msOperationLogService.recordAddDetailLog(TABLE_NAME, entity, source);
} }
return result; return result;
} }
@ -97,8 +97,8 @@ public class SdFhbtBHServiceImpl extends ServiceImpl<SdFhbtBHMapper, SdFhbtBH> i
wrapper.set(SdFhbtBH::getDeleteUser, SecurityUtils.getCurrentUsername()); wrapper.set(SdFhbtBH::getDeleteUser, SecurityUtils.getCurrentUsername());
wrapper.set(SdFhbtBH::getDeleteTime, new Date()); wrapper.set(SdFhbtBH::getDeleteTime, new Date());
if (this.update(wrapper)) { if (this.update(wrapper)) {
msOperationLogService.recordOperationLog(TABLE_NAME, stcd, "删除", source); SdFhbtBH entity = this.getById(stcd);
count++; msOperationLogService.recordDeleteDetailLog(TABLE_NAME, entity, source); count++;
} }
} }
return count > 0; return count > 0;

View File

@ -1,6 +1,7 @@
package com.yfd.platform.qgc_base.service.impl; package com.yfd.platform.qgc_base.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; 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.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yfd.platform.common.DataSourceRequest; import com.yfd.platform.common.DataSourceRequest;
@ -21,10 +22,7 @@ import jakarta.annotation.Resource;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
import java.util.ArrayList; import java.util.*;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@Service @Service
@ -217,17 +215,20 @@ public class SdFpssBHServiceImpl extends ServiceImpl<SdFpssBHMapper, SdFpssBH> i
public boolean add(SdFpssBH entity, String source) { public boolean add(SdFpssBH entity, String source) {
boolean result = save(entity); boolean result = save(entity);
if (result) { if (result) {
msOperationLogService.recordOperationLog(TABLE_NAME, entity.getStcd(), "新增", source); // msOperationLogService.recordOperationLog(TABLE_NAME, entity.getStcd(), "新增", source);
msOperationLogService.recordAddDetailLog(TABLE_NAME, entity, source);
} }
return result; return result;
} }
@Override @Override
public boolean updateById(SdFpssBH sdFpssBH, String source) { public boolean updateById(SdFpssBH entity, String source) {
LambdaQueryWrapper<SdFpssBH> wrapper = new LambdaQueryWrapper<>(); SdFpssBH before = this.getById(entity.getStcd());
wrapper.eq(SdFpssBH::getStcd, sdFpssBH.getStcd()) boolean result = this.updateById(entity);
.eq(SdFpssBH::getSttp, sdFpssBH.getSttp()); if (result && before != null) {
return update(sdFpssBH, wrapper); msOperationLogService.recordModifyDetailLog(TABLE_NAME, before, entity, source);
}
return result;
} }
@Override @Override
@ -252,4 +253,22 @@ public class SdFpssBHServiceImpl extends ServiceImpl<SdFpssBHMapper, SdFpssBH> i
dictCodeToNameConverter.convertCodeToName(sdFpssBHPage, CODE_TO_NAME_META_LIST); dictCodeToNameConverter.convertCodeToName(sdFpssBHPage, CODE_TO_NAME_META_LIST);
return sdFpssBHPage; 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) { public boolean add(SdOpinfoBH entity, String source) {
boolean result = this.save(entity); boolean result = this.save(entity);
if (result) { if (result) {
msOperationLogService.recordOperationLog(TABLE_NAME, entity.getStcd(), "新增", source); msOperationLogService.recordAddDetailLog(TABLE_NAME, entity, source);
} }
return result; return result;
} }
@ -97,7 +97,8 @@ public class SdOpinfoBHServiceImpl extends ServiceImpl<SdOpinfoBHMapper, SdOpinf
wrapper.set(SdOpinfoBH::getDeleteUser, SecurityUtils.getCurrentUsername()); wrapper.set(SdOpinfoBH::getDeleteUser, SecurityUtils.getCurrentUsername());
wrapper.set(SdOpinfoBH::getDeleteTime, new Date()); wrapper.set(SdOpinfoBH::getDeleteTime, new Date());
if (this.update(wrapper)) { if (this.update(wrapper)) {
msOperationLogService.recordOperationLog(TABLE_NAME, stcd, "删除", source); SdOpinfoBH entity = this.getById(stcd);
msOperationLogService.recordDeleteDetailLog(TABLE_NAME, entity, source);
count++; count++;
} }
} }

View File

@ -67,7 +67,7 @@ public class SdOtteBHServiceImpl extends ServiceImpl<SdOtteBHMapper, SdOtteBH> i
public boolean add(SdOtteBH entity, String source) { public boolean add(SdOtteBH entity, String source) {
boolean result = this.save(entity); boolean result = this.save(entity);
if (result) { if (result) {
msOperationLogService.recordOperationLog(TABLE_NAME, entity.getStcd(), "新增", source); msOperationLogService.recordAddDetailLog(TABLE_NAME, entity, source);
} }
return result; return result;
} }
@ -90,7 +90,8 @@ public class SdOtteBHServiceImpl extends ServiceImpl<SdOtteBHMapper, SdOtteBH> i
int count = 0; int count = 0;
for (String stcd : stcds) { for (String stcd : stcds) {
if (this.removeById(stcd)) { if (this.removeById(stcd)) {
msOperationLogService.recordOperationLog(TABLE_NAME, stcd, "删除", source); SdOtteBH entity = this.getById(stcd);
msOperationLogService.recordDeleteDetailLog(TABLE_NAME, entity, source);
count++; count++;
} }
} }

View File

@ -66,7 +66,7 @@ public class SdOtweBHServiceImpl extends ServiceImpl<SdOtweBHMapper, SdOtweBH> i
public boolean add(SdOtweBH entity, String source) { public boolean add(SdOtweBH entity, String source) {
boolean result = this.save(entity); boolean result = this.save(entity);
if (result) { if (result) {
msOperationLogService.recordOperationLog(TABLE_NAME, entity.getStcd(), "新增", source); msOperationLogService.recordAddDetailLog(TABLE_NAME, entity, source);
} }
return result; return result;
} }
@ -89,7 +89,8 @@ public class SdOtweBHServiceImpl extends ServiceImpl<SdOtweBHMapper, SdOtweBH> i
int count = 0; int count = 0;
for (String stcd : stcds) { for (String stcd : stcds) {
if (this.removeById(stcd)) { if (this.removeById(stcd)) {
msOperationLogService.recordOperationLog(TABLE_NAME, stcd, "删除", source); SdOtweBH entity = this.getById(stcd);
msOperationLogService.recordDeleteDetailLog(TABLE_NAME, entity, source);
count++; count++;
} }
} }

View File

@ -70,7 +70,7 @@ public class SdSonarBHServiceImpl extends ServiceImpl<SdSonarBHMapper, SdSonarBH
public boolean add(SdSonarBH entity, String source) { public boolean add(SdSonarBH entity, String source) {
boolean result = this.save(entity); boolean result = this.save(entity);
if (result) { if (result) {
msOperationLogService.recordOperationLog(TABLE_NAME, entity.getStcd(), "新增", source); msOperationLogService.recordAddDetailLog(TABLE_NAME, entity, source);
} }
return result; return result;
} }
@ -98,7 +98,8 @@ public class SdSonarBHServiceImpl extends ServiceImpl<SdSonarBHMapper, SdSonarBH
wrapper.set(SdSonarBH::getDeleteUser, SecurityUtils.getCurrentUsername()); wrapper.set(SdSonarBH::getDeleteUser, SecurityUtils.getCurrentUsername());
wrapper.set(SdSonarBH::getDeleteTime, new Date()); wrapper.set(SdSonarBH::getDeleteTime, new Date());
if (this.update(wrapper)) { if (this.update(wrapper)) {
msOperationLogService.recordOperationLog(TABLE_NAME, stcd, "删除", source); SdSonarBH entity = this.getById(stcd);
msOperationLogService.recordDeleteDetailLog(TABLE_NAME, entity, source);
count++; count++;
} }
} }

View File

@ -66,7 +66,7 @@ public class SdTeBHServiceImpl extends ServiceImpl<SdTeBHMapper, SdTeBH> impleme
public boolean add(SdTeBH entity, String source) { public boolean add(SdTeBH entity, String source) {
boolean result = this.save(entity); boolean result = this.save(entity);
if (result) { if (result) {
msOperationLogService.recordOperationLog(TABLE_NAME, entity.getStcd(), "新增", source); msOperationLogService.recordAddDetailLog(TABLE_NAME, entity, source);
} }
return result; return result;
} }
@ -89,7 +89,8 @@ public class SdTeBHServiceImpl extends ServiceImpl<SdTeBHMapper, SdTeBH> impleme
int count = 0; int count = 0;
for (String stcd : stcds) { for (String stcd : stcds) {
if (this.removeById(stcd)) { if (this.removeById(stcd)) {
msOperationLogService.recordOperationLog(TABLE_NAME, stcd, "删除", source); SdTeBH entity = this.getById(stcd);
msOperationLogService.recordDeleteDetailLog(TABLE_NAME, entity, source);
count++; count++;
} }
} }

View File

@ -67,7 +67,7 @@ public class SdVaBHServiceImpl extends ServiceImpl<SdVaBHMapper, SdVaBH> impleme
public boolean add(SdVaBH entity, String source) { public boolean add(SdVaBH entity, String source) {
boolean result = this.save(entity); boolean result = this.save(entity);
if (result) { if (result) {
msOperationLogService.recordOperationLog(TABLE_NAME, entity.getStcd(), "新增", source); msOperationLogService.recordAddDetailLog(TABLE_NAME, entity, source);
} }
return result; return result;
} }
@ -95,7 +95,8 @@ public class SdVaBHServiceImpl extends ServiceImpl<SdVaBHMapper, SdVaBH> impleme
wrapper.set(SdVaBH::getDeleteUser, SecurityUtils.getCurrentUsername()); wrapper.set(SdVaBH::getDeleteUser, SecurityUtils.getCurrentUsername());
wrapper.set(SdVaBH::getDeleteTime, new Date()); wrapper.set(SdVaBH::getDeleteTime, new Date());
if (this.update(wrapper)) { if (this.update(wrapper)) {
msOperationLogService.recordOperationLog(TABLE_NAME, stcd, "删除", source); SdVaBH entity = this.getById(stcd);
msOperationLogService.recordDeleteDetailLog(TABLE_NAME, entity, source);
count++; count++;
} }
} }

View File

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

View File

@ -67,8 +67,7 @@ public class SdVpBHServiceImpl extends ServiceImpl<SdVpBHMapper, SdVpBH> impleme
public boolean add(SdVpBH entity, String source) { public boolean add(SdVpBH entity, String source) {
boolean result = this.save(entity); boolean result = this.save(entity);
if (result) { if (result) {
msOperationLogService.recordOperationLog(TABLE_NAME, entity.getStcd(), "新增", source); msOperationLogService.recordAddDetailLog(TABLE_NAME, entity, source); }
}
return result; return result;
} }
@ -95,8 +94,8 @@ public class SdVpBHServiceImpl extends ServiceImpl<SdVpBHMapper, SdVpBH> impleme
wrapper.set(SdVpBH::getDeleteUser, SecurityUtils.getCurrentUsername()); wrapper.set(SdVpBH::getDeleteUser, SecurityUtils.getCurrentUsername());
wrapper.set(SdVpBH::getDeleteTime, new Date()); wrapper.set(SdVpBH::getDeleteTime, new Date());
if (this.update(wrapper)) { if (this.update(wrapper)) {
msOperationLogService.recordOperationLog(TABLE_NAME, stcd, "删除", source); SdVpBH entity = this.getById(stcd);
count++; msOperationLogService.recordDeleteDetailLog(TABLE_NAME, entity, source); count++;
} }
} }
return count > 0; return count > 0;

View File

@ -68,8 +68,7 @@ public class SdWeBHServiceImpl extends ServiceImpl<SdWeBHMapper, SdWeBH> impleme
public boolean add(SdWeBH entity, String source) { public boolean add(SdWeBH entity, String source) {
boolean result = this.save(entity); boolean result = this.save(entity);
if (result) { if (result) {
msOperationLogService.recordOperationLog(TABLE_NAME, entity.getStcd(), "新增", source); msOperationLogService.recordAddDetailLog(TABLE_NAME, entity, source); }
}
return result; return result;
} }
@ -91,8 +90,8 @@ public class SdWeBHServiceImpl extends ServiceImpl<SdWeBHMapper, SdWeBH> impleme
int count = 0; int count = 0;
for (String stcd : stcds) { for (String stcd : stcds) {
if (this.removeById(stcd)) { if (this.removeById(stcd)) {
msOperationLogService.recordOperationLog(TABLE_NAME, stcd, "删除", source); SdWeBH entity = this.getById(stcd);
count++; msOperationLogService.recordDeleteDetailLog(TABLE_NAME, entity, source); count++;
} }
} }
return count > 0; return count > 0;

View File

@ -69,8 +69,7 @@ public class SdWqBHServiceImpl extends ServiceImpl<SdWqBHMapper, SdWqBH> impleme
public boolean add(SdWqBH entity, String source) { public boolean add(SdWqBH entity, String source) {
boolean result = this.save(entity); boolean result = this.save(entity);
if (result) { if (result) {
msOperationLogService.recordOperationLog(TABLE_NAME, entity.getStcd(), "新增", source); msOperationLogService.recordAddDetailLog(TABLE_NAME, entity, source); }
}
return result; return result;
} }
@ -97,8 +96,8 @@ public class SdWqBHServiceImpl extends ServiceImpl<SdWqBHMapper, SdWqBH> impleme
wrapper.set(SdWqBH::getDeleteUser, SecurityUtils.getCurrentUsername()); wrapper.set(SdWqBH::getDeleteUser, SecurityUtils.getCurrentUsername());
wrapper.set(SdWqBH::getDeleteTime, new Date()); wrapper.set(SdWqBH::getDeleteTime, new Date());
if (this.update(wrapper)) { if (this.update(wrapper)) {
msOperationLogService.recordOperationLog(TABLE_NAME, stcd, "删除", source); SdWqBH entity = this.getById(stcd);
count++; msOperationLogService.recordDeleteDetailLog(TABLE_NAME, entity, source); count++;
} }
} }
return count > 0; return count > 0;

View File

@ -72,7 +72,7 @@ public class SdWtBHServiceImpl extends ServiceImpl<SdWtBHMapper, SdWtBH> impleme
public boolean add(SdWtBH entity, String source) { public boolean add(SdWtBH entity, String source) {
boolean result = this.save(entity); boolean result = this.save(entity);
if (result) { if (result) {
msOperationLogService.recordOperationLog(TABLE_NAME, entity.getStcd(), "新增", source); msOperationLogService.recordAddDetailLog(TABLE_NAME, entity, source);
} }
return result; return result;
} }
@ -100,7 +100,8 @@ public class SdWtBHServiceImpl extends ServiceImpl<SdWtBHMapper, SdWtBH> impleme
wrapper.set(SdWtBH::getDeleteUser, SecurityUtils.getCurrentUsername()); wrapper.set(SdWtBH::getDeleteUser, SecurityUtils.getCurrentUsername());
wrapper.set(SdWtBH::getDeleteTime, new Date()); wrapper.set(SdWtBH::getDeleteTime, new Date());
if (this.update(wrapper)) { if (this.update(wrapper)) {
msOperationLogService.recordOperationLog(TABLE_NAME, stcd, "删除", source); SdWtBH entity = this.getById(stcd);
msOperationLogService.recordDeleteDetailLog(TABLE_NAME, entity, source);
count++; count++;
} }
} }

View File

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