【更新】mybatisplus升级后removeBatchByIds改为removeByIds

This commit is contained in:
徐玉祥 2023-03-02 23:32:53 +08:00
parent ce403d8528
commit f06b637e47
25 changed files with 33 additions and 32 deletions

View File

@ -220,7 +220,7 @@ public class BizOrgServiceImpl extends ServiceImpl<BizOrgMapper, BizOrg> impleme
throw new CommonException("请先删除机构下的岗位"); throw new CommonException("请先删除机构下的岗位");
} }
// 执行删除 // 执行删除
this.removeBatchByIds(toDeleteOrgIdList); this.removeByIds(toDeleteOrgIdList);
} }
} }

View File

@ -175,7 +175,7 @@ public class BizPositionServiceImpl extends ServiceImpl<BizPositionMapper, BizPo
} }
} }
// 执行删除 // 执行删除
this.removeBatchByIds(positionIdList); this.removeByIds(positionIdList);
} }
} }

View File

@ -267,7 +267,7 @@ public class BizUserServiceImpl extends ServiceImpl<BizUserMapper, BizUser> impl
.set(BizUser::getPositionJson, JSONUtil.toJsonStr(handledJsonObjectList))); .set(BizUser::getPositionJson, JSONUtil.toJsonStr(handledJsonObjectList)));
}); });
// 执行删除 // 执行删除
this.removeBatchByIds(bizUserIdList); this.removeByIds(bizUserIdList);
// TODO 此处需要将这些人员踢下线并永久注销这些人员 // TODO 此处需要将这些人员踢下线并永久注销这些人员
} }

View File

@ -201,7 +201,7 @@ public class ClientUserServiceImpl extends ServiceImpl<ClientUserMapper, ClientU
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
@Override @Override
public void delete(List<ClientUserIdParam> clientUserIdParamList) { public void delete(List<ClientUserIdParam> clientUserIdParamList) {
this.removeBatchByIds(CollStreamUtil.toList(clientUserIdParamList, ClientUserIdParam::getId)); this.removeByIds(CollStreamUtil.toList(clientUserIdParamList, ClientUserIdParam::getId));
} }
@Override @Override

View File

@ -154,7 +154,7 @@ public class DevConfigServiceImpl extends ServiceImpl<DevConfigMapper, DevConfig
commonCacheOperator.remove(CONFIG_CACHE_KEY + devConfig.getConfigKey()); commonCacheOperator.remove(CONFIG_CACHE_KEY + devConfig.getConfigKey());
}); });
// 执行删除 // 执行删除
this.removeBatchByIds(devConfigIdList); this.removeByIds(devConfigIdList);
} }
} }
} }

View File

@ -173,7 +173,7 @@ public class DevDictServiceImpl extends ServiceImpl<DevDictMapper, DevDict> impl
throw new CommonException("不可删除系统内置字典"); throw new CommonException("不可删除系统内置字典");
} }
// 删除 // 删除
this.removeBatchByIds(devDictIdList); this.removeByIds(devDictIdList);
} }
} }

View File

@ -182,7 +182,7 @@ public class DevEmailServiceImpl extends ServiceImpl<DevEmailMapper, DevEmail> i
@Override @Override
public void delete(List<DevEmailIdParam> devEmailIdParamList) { public void delete(List<DevEmailIdParam> devEmailIdParamList) {
this.removeBatchByIds(CollStreamUtil.toList(devEmailIdParamList, DevEmailIdParam::getId)); this.removeByIds(CollStreamUtil.toList(devEmailIdParamList, DevEmailIdParam::getId));
} }
@Override @Override

View File

@ -114,7 +114,7 @@ public class DevFileServiceImpl extends ServiceImpl<DevFileMapper, DevFile> impl
@Override @Override
public void delete(List<DevFileIdParam> devFileIdParamList) { public void delete(List<DevFileIdParam> devFileIdParamList) {
this.removeBatchByIds(CollStreamUtil.toList(devFileIdParamList, DevFileIdParam::getId)); this.removeByIds(CollStreamUtil.toList(devFileIdParamList, DevFileIdParam::getId));
} }
/** /**

View File

@ -169,7 +169,7 @@ public class DevJobServiceImpl extends ServiceImpl<DevJobMapper, DevJob> impleme
// 将运行中的停止 // 将运行中的停止
devJobIdList.forEach(CronUtil::remove); devJobIdList.forEach(CronUtil::remove);
// 执行删除 // 执行删除
this.removeBatchByIds(devJobIdList); this.removeByIds(devJobIdList);
} }
} }

View File

@ -13,6 +13,7 @@
package vip.xiaonuo.dev.modular.log.service.impl; package vip.xiaonuo.dev.modular.log.service.impl;
import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.convert.Convert;
import cn.hutool.core.date.DateTime; import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUnit; import cn.hutool.core.date.DateUnit;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
@ -109,14 +110,14 @@ public class DevLogServiceImpl extends ServiceImpl<DevLogMapper, DevLog> impleme
List<DevLogVisPieChartDataResult> resultList = CollectionUtil.newArrayList(); List<DevLogVisPieChartDataResult> resultList = CollectionUtil.newArrayList();
DevLogVisPieChartDataResult devLogLoginPieChartDataResult = new DevLogVisPieChartDataResult(); DevLogVisPieChartDataResult devLogLoginPieChartDataResult = new DevLogVisPieChartDataResult();
devLogLoginPieChartDataResult.setType("登录"); devLogLoginPieChartDataResult.setType("登录");
devLogLoginPieChartDataResult.setValue(this.count(new LambdaQueryWrapper<DevLog>() devLogLoginPieChartDataResult.setValue(Convert.toLong(this.count(new LambdaQueryWrapper<DevLog>()
.eq(DevLog::getCategory, DevLogCategoryEnum.LOGIN.getValue()))); .eq(DevLog::getCategory, DevLogCategoryEnum.LOGIN.getValue()))));
resultList.add(devLogLoginPieChartDataResult); resultList.add(devLogLoginPieChartDataResult);
DevLogVisPieChartDataResult devLogLogoutPieChartDataResult = new DevLogVisPieChartDataResult(); DevLogVisPieChartDataResult devLogLogoutPieChartDataResult = new DevLogVisPieChartDataResult();
devLogLogoutPieChartDataResult.setType("登出"); devLogLogoutPieChartDataResult.setType("登出");
devLogLogoutPieChartDataResult.setValue(this.count(new LambdaQueryWrapper<DevLog>() devLogLogoutPieChartDataResult.setValue(Convert.toLong(this.count(new LambdaQueryWrapper<DevLog>()
.eq(DevLog::getCategory, DevLogCategoryEnum.LOGOUT.getValue()))); .eq(DevLog::getCategory, DevLogCategoryEnum.LOGOUT.getValue()))));
resultList.add(devLogLogoutPieChartDataResult); resultList.add(devLogLogoutPieChartDataResult);
return resultList; return resultList;
} }
@ -160,14 +161,14 @@ public class DevLogServiceImpl extends ServiceImpl<DevLogMapper, DevLog> impleme
List<DevLogOpPieChartDataResult> resultList = CollectionUtil.newArrayList(); List<DevLogOpPieChartDataResult> resultList = CollectionUtil.newArrayList();
DevLogOpPieChartDataResult devLogOperatePieChartDataResult = new DevLogOpPieChartDataResult(); DevLogOpPieChartDataResult devLogOperatePieChartDataResult = new DevLogOpPieChartDataResult();
devLogOperatePieChartDataResult.setType("操作日志"); devLogOperatePieChartDataResult.setType("操作日志");
devLogOperatePieChartDataResult.setValue(this.count(new LambdaQueryWrapper<DevLog>() devLogOperatePieChartDataResult.setValue(Convert.toLong(this.count(new LambdaQueryWrapper<DevLog>()
.eq(DevLog::getCategory, DevLogCategoryEnum.OPERATE.getValue()))); .eq(DevLog::getCategory, DevLogCategoryEnum.OPERATE.getValue()))));
resultList.add(devLogOperatePieChartDataResult); resultList.add(devLogOperatePieChartDataResult);
DevLogOpPieChartDataResult devLogExceptionPieChartDataResult = new DevLogOpPieChartDataResult(); DevLogOpPieChartDataResult devLogExceptionPieChartDataResult = new DevLogOpPieChartDataResult();
devLogExceptionPieChartDataResult.setType("异常日志"); devLogExceptionPieChartDataResult.setType("异常日志");
devLogExceptionPieChartDataResult.setValue(this.count(new LambdaQueryWrapper<DevLog>() devLogExceptionPieChartDataResult.setValue(Convert.toLong(this.count(new LambdaQueryWrapper<DevLog>()
.eq(DevLog::getCategory, DevLogCategoryEnum.EXCEPTION.getValue()))); .eq(DevLog::getCategory, DevLogCategoryEnum.EXCEPTION.getValue()))));
resultList.add(devLogExceptionPieChartDataResult); resultList.add(devLogExceptionPieChartDataResult);
return resultList; return resultList;
} }

View File

@ -161,7 +161,7 @@ public class DevMessageServiceImpl extends ServiceImpl<DevMessageMapper, DevMess
devRelationService.remove(new LambdaUpdateWrapper<DevRelation>().eq(DevRelation::getCategory, DevRelationCategoryEnum.MSG_TO_USER.getValue()) devRelationService.remove(new LambdaUpdateWrapper<DevRelation>().eq(DevRelation::getCategory, DevRelationCategoryEnum.MSG_TO_USER.getValue())
.in(DevRelation::getObjectId, devMessageIdList)); .in(DevRelation::getObjectId, devMessageIdList));
// 执行删除 // 执行删除
this.removeBatchByIds(devMessageIdList); this.removeByIds(devMessageIdList);
} }
} }

View File

@ -92,7 +92,7 @@ public class DevSmsServiceImpl extends ServiceImpl<DevSmsMapper, DevSms> impleme
@Override @Override
public void delete(List<DevSmsIdParam> devSmsIdParamList) { public void delete(List<DevSmsIdParam> devSmsIdParamList) {
this.removeBatchByIds(CollStreamUtil.toList(devSmsIdParamList, DevSmsIdParam::getId)); this.removeByIds(CollStreamUtil.toList(devSmsIdParamList, DevSmsIdParam::getId));
} }
@Override @Override

View File

@ -98,7 +98,7 @@ public class ${className}ServiceImpl extends ServiceImpl<${className}Mapper, ${c
// 执行删除 // 执行删除
<% for(var i = 0; i < configList.~size; i++) { %> <% for(var i = 0; i < configList.~size; i++) { %>
<% if(configList[i].needTableId) { %> <% if(configList[i].needTableId) { %>
this.removeBatchByIds(CollStreamUtil.toList(${classNameFirstLower}IdParamList, ${className}IdParam::get${configList[i].fieldNameCamelCaseFirstUpper})); this.removeByIds(CollStreamUtil.toList(${classNameFirstLower}IdParamList, ${className}IdParam::get${configList[i].fieldNameCamelCaseFirstUpper}));
<% } %> <% } %>
<% } %> <% } %>
} }

View File

@ -114,7 +114,7 @@ public class MobileButtonServiceImpl extends ServiceImpl<MobileButtonMapper, Mob
// 清除对应的角色与移动端菜单信息中的授权的移动端按钮信息 // 清除对应的角色与移动端菜单信息中的授权的移动端按钮信息
sysRelationApi.removeRoleHasMobileButtonRelation(parentMenuIdList, buttonIdList); sysRelationApi.removeRoleHasMobileButtonRelation(parentMenuIdList, buttonIdList);
// 执行删除 // 执行删除
this.removeBatchByIds(buttonIdList); this.removeByIds(buttonIdList);
} }
} }
} }

View File

@ -158,7 +158,7 @@ public class MobileMenuServiceImpl extends ServiceImpl<MobileMenuMapper, MobileM
// 清除对应的角色与移动端资源信息 // 清除对应的角色与移动端资源信息
sysRelationApi.removeRoleHasMobileMenuRelation(toDeleteMenuIdList); sysRelationApi.removeRoleHasMobileMenuRelation(toDeleteMenuIdList);
// 执行删除 // 执行删除
this.removeBatchByIds(toDeleteMenuIdList); this.removeByIds(toDeleteMenuIdList);
} }
} }
} }

View File

@ -117,7 +117,7 @@ public class MobileModuleServiceImpl extends ServiceImpl<MobileModuleMapper, Mob
// 清除对应的角色与移动端资源信息 // 清除对应的角色与移动端资源信息
sysRelationApi.removeRoleHasMobileMenuRelation(toDeleteMenuIdList); sysRelationApi.removeRoleHasMobileMenuRelation(toDeleteMenuIdList);
// 执行删除 // 执行删除
this.removeBatchByIds(toDeleteMenuIdList); this.removeByIds(toDeleteMenuIdList);
} }
} }
} }

View File

@ -66,7 +66,7 @@ public class SysIndexServiceImpl implements SysIndexService {
List<String> scheduleIdList = sysIndexScheduleIdParamList.stream().map(SysIndexScheduleIdParam::getId) List<String> scheduleIdList = sysIndexScheduleIdParamList.stream().map(SysIndexScheduleIdParam::getId)
.collect(Collectors.toList()); .collect(Collectors.toList());
if(ObjectUtil.isNotEmpty(scheduleIdList)) { if(ObjectUtil.isNotEmpty(scheduleIdList)) {
sysRelationService.removeBatchByIds(scheduleIdList); sysRelationService.removeByIds(scheduleIdList);
} }
} }

View File

@ -172,7 +172,7 @@ public class SysOrgServiceImpl extends ServiceImpl<SysOrgMapper, SysOrg> impleme
throw new CommonException("请先删除组织下的职位"); throw new CommonException("请先删除组织下的职位");
} }
// 执行删除 // 执行删除
this.removeBatchByIds(toDeleteOrgIdList); this.removeByIds(toDeleteOrgIdList);
} }
} }

View File

@ -135,7 +135,7 @@ public class SysPositionServiceImpl extends ServiceImpl<SysPositionMapper, SysPo
} }
} }
// 执行删除 // 执行删除
this.removeBatchByIds(positionIdList); this.removeByIds(positionIdList);
} }
} }

View File

@ -151,7 +151,7 @@ public class SysButtonServiceImpl extends ServiceImpl<SysButtonMapper, SysButton
.set(SysRelation::getExtJson, JSONUtil.toJsonStr(extJsonObject))); .set(SysRelation::getExtJson, JSONUtil.toJsonStr(extJsonObject)));
}); });
// 执行删除 // 执行删除
this.removeBatchByIds(buttonIdList); this.removeByIds(buttonIdList);
} }
} }
} }

View File

@ -265,7 +265,7 @@ public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenu> impl
sysRelationService.remove(new LambdaUpdateWrapper<SysRelation>().in(SysRelation::getTargetId, toDeleteMenuIdList) sysRelationService.remove(new LambdaUpdateWrapper<SysRelation>().in(SysRelation::getTargetId, toDeleteMenuIdList)
.eq(SysRelation::getCategory, SysRelationCategoryEnum.SYS_ROLE_HAS_RESOURCE.getValue())); .eq(SysRelation::getCategory, SysRelationCategoryEnum.SYS_ROLE_HAS_RESOURCE.getValue()));
// 执行删除 // 执行删除
this.removeBatchByIds(toDeleteMenuIdList); this.removeByIds(toDeleteMenuIdList);
} }
} }
} }

View File

@ -129,7 +129,7 @@ public class SysModuleServiceImpl extends ServiceImpl<SysModuleMapper, SysModule
sysRelationService.remove(new LambdaUpdateWrapper<SysRelation>().in(SysRelation::getTargetId, toDeleteMenuIdList) sysRelationService.remove(new LambdaUpdateWrapper<SysRelation>().in(SysRelation::getTargetId, toDeleteMenuIdList)
.eq(SysRelation::getCategory, SysRelationCategoryEnum.SYS_ROLE_HAS_RESOURCE.getValue())); .eq(SysRelation::getCategory, SysRelationCategoryEnum.SYS_ROLE_HAS_RESOURCE.getValue()));
// 执行删除 // 执行删除
this.removeBatchByIds(toDeleteMenuIdList); this.removeByIds(toDeleteMenuIdList);
} }
} }
} }

View File

@ -143,7 +143,7 @@ public class SysSpaServiceImpl extends ServiceImpl<SysSpaMapper, SysSpa> impleme
throw new CommonException("不可删除系统内置单页面"); throw new CommonException("不可删除系统内置单页面");
} }
// 删除 // 删除
this.removeBatchByIds(sysSpaIdList); this.removeByIds(sysSpaIdList);
} }
} }

View File

@ -183,7 +183,7 @@ public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> impl
sysRelationService.remove(new LambdaUpdateWrapper<SysRelation>().in(SysRelation::getObjectId, sysRoleIdList) sysRelationService.remove(new LambdaUpdateWrapper<SysRelation>().in(SysRelation::getObjectId, sysRoleIdList)
.eq(SysRelation::getCategory, SysRelationCategoryEnum.SYS_ROLE_HAS_PERMISSION.getValue())); .eq(SysRelation::getCategory, SysRelationCategoryEnum.SYS_ROLE_HAS_PERMISSION.getValue()));
// 执行删除 // 执行删除
this.removeBatchByIds(sysRoleIdList); this.removeByIds(sysRoleIdList);
} }
} }

View File

@ -321,7 +321,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
.set(SysUser::getPositionJson, JSONUtil.toJsonStr(handledJsonObjectList))); .set(SysUser::getPositionJson, JSONUtil.toJsonStr(handledJsonObjectList)));
}); });
// 执行删除 // 执行删除
this.removeBatchByIds(sysUserIdList); this.removeByIds(sysUserIdList);
// TODO 此处需要将这些用户踢下线并永久注销这些用户 // TODO 此处需要将这些用户踢下线并永久注销这些用户
} }