Commit 1c076006 authored by liwei's avatar liwei

修改了删除角色bug

parent ffa1d7ba
...@@ -128,10 +128,14 @@ public class PcRoleServiceImpl extends ServiceImpl<PcRoleRepository, PcRole> im ...@@ -128,10 +128,14 @@ public class PcRoleServiceImpl extends ServiceImpl<PcRoleRepository, PcRole> im
int line = baseMapper.deleteById(pcRole); int line = baseMapper.deleteById(pcRole);
//批量逻辑删除角色课程中间表 //批量逻辑删除角色课程中间表
List<PcRoleLesson> pcRoleLessonList = pcRoleLessonRepository.selectList(new QueryWrapper<PcRoleLesson>().eq("pc_role_id", pcRole.getBusinessId())); List<PcRoleLesson> pcRoleLessonList = pcRoleLessonRepository.selectList(new QueryWrapper<PcRoleLesson>().eq("pc_role_id", pcRole.getBusinessId()));
int deleteBatch1 = pcRoleLessonRepository.deleteBatch(pcRoleLessonList); if (pcRoleLessonList.size() > 0){
int deleteBatch1 = pcRoleLessonRepository.deleteBatch(pcRoleLessonList);
}
//逻辑删除角色用户中间表 //逻辑删除角色用户中间表
List<PcRoleUser> pcRoleUserList = pcRoleUserRepository.selectList(new QueryWrapper<PcRoleUser>().eq("pc_role_id", pcRole.getBusinessId())); List<PcRoleUser> pcRoleUserList = pcRoleUserRepository.selectList(new QueryWrapper<PcRoleUser>().eq("pc_role_id", pcRole.getBusinessId()));
int deleteBatch2 = pcRoleUserRepository.deleteBatch(pcRoleUserList); if (pcRoleUserList.size()>0){
int deleteBatch2 = pcRoleUserRepository.deleteBatch(pcRoleUserList);
}
log.debug(CyUserUtil.getAuthenUsername()+"逻辑删除了ID为"+ log.debug(CyUserUtil.getAuthenUsername()+"逻辑删除了ID为"+
pcRole.getBusinessId()+"的前台_角色管理信息"); pcRole.getBusinessId()+"的前台_角色管理信息");
return new CyPersistModel(line); return new CyPersistModel(line);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment