This commit is contained in:
zc
2026-03-03 11:42:23 +08:00
parent 3892fffa37
commit 7e7db23d82
48 changed files with 149 additions and 2099 deletions

View File

@@ -30,9 +30,6 @@ public class DemoEnvironmentJob {
private final DictItemMapper dictItemMapper;
private final DictMapper dictMapper;
private final StorageMapper storageMapper;
private final NoticeMapper noticeMapper;
private final MessageMapper messageMapper;
private final MessageUserMapper messageUserMapper;
private final UserMapper userMapper;
private final UserRoleMapper userRoleMapper;
private final UserSocialMapper userSocialMapper;
@@ -67,10 +64,6 @@ public class DemoEnvironmentJob {
this.log(dictCount, "字典");
Long storageCount = storageMapper.lambdaQuery().gt(StorageDO::getId, DELETE_FLAG).count();
this.log(storageCount, "存储");
Long noticeCount = noticeMapper.lambdaQuery().gt(NoticeDO::getId, DELETE_FLAG).count();
this.log(noticeCount, "公告");
Long messageCount = messageMapper.lambdaQuery().count();
this.log(messageCount, "通知");
Long userCount = userMapper.lambdaQuery().notIn(UserDO::getId, USER_FLAG).count();
this.log(userCount, "用户");
Long roleCount = roleMapper.lambdaQuery().notIn(RoleDO::getId, ROLE_FLAG).count();
@@ -83,8 +76,6 @@ public class DemoEnvironmentJob {
this.log(clientCount, "终端");
InterceptorIgnoreHelper.handle(IgnoreStrategy.builder().blockAttack(true).build());
SnailJobLog.REMOTE.info("演示环境待清理数据项检测完成,开始执行清理。");
// 清理关联数据
messageUserMapper.lambdaUpdate().gt(MessageUserDO::getMessageId, MESSAGE_FLAG).remove();
userRoleMapper.lambdaUpdate().notIn(UserRoleDO::getRoleId, ROLE_FLAG).remove();
userRoleMapper.lambdaUpdate().notIn(UserRoleDO::getUserId, USER_FLAG).remove();
roleDeptMapper.lambdaUpdate().notIn(RoleDeptDO::getRoleId, ROLE_FLAG).remove();
@@ -100,12 +91,6 @@ public class DemoEnvironmentJob {
this.clean(storageCount, "存储", null, () -> storageMapper.lambdaUpdate()
.gt(StorageDO::getId, DELETE_FLAG)
.remove());
this.clean(noticeCount, "公告", null, () -> noticeMapper.lambdaUpdate()
.gt(NoticeDO::getId, DELETE_FLAG)
.remove());
this.clean(messageCount, "通知", null, () -> messageMapper.lambdaUpdate()
.gt(MessageDO::getId, MESSAGE_FLAG)
.remove());
this.clean(userCount, "用户", null, () -> userMapper.lambdaUpdate().notIn(UserDO::getId, USER_FLAG).remove());
this.clean(roleCount, "角色", null, () -> roleMapper.lambdaUpdate().notIn(RoleDO::getId, ROLE_FLAG).remove());
this.clean(menuCount, "菜单", CacheConstants.ROLE_MENU_KEY_PREFIX, () -> menuMapper.lambdaUpdate()