|
|
@@ -71,6 +71,30 @@ public class SysRoleMenuKztServiceImpl extends ServiceImpl<SysRoleMenuKztMapper,
|
|
|
public int findByUseId(String userId, String sysType) {
|
|
|
return sysRoleMenuKztMapper.findByUseId(userId,sysType);
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @version 批量添加菜单
|
|
|
+ * @author: whp
|
|
|
+ * @Date: 2024/9/28
|
|
|
+ * @Description:
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public void saveBatchRoleMenus(KZTRoleAndMenuDto kZTRoleAndMenuDto) {
|
|
|
+ List<Long> roleIdIds = kZTRoleAndMenuDto.getRoleIdIds();
|
|
|
+ for (Long roleId : roleIdIds) {
|
|
|
+ String sysType = kZTRoleAndMenuDto.getSysType();
|
|
|
+ List<Long> menuIds = kZTRoleAndMenuDto.getMenuIds();
|
|
|
+ List<SysRoleMenuKzt> list =new ArrayList<>();
|
|
|
+ sysRoleMenuKztMapper.deleteByRoleId(roleId);
|
|
|
+ if(menuIds!=null && menuIds.size()>0){
|
|
|
+ for(Long menuId: menuIds){
|
|
|
+ SysRoleMenuKzt sysRoleMenuKzt =new SysRoleMenuKzt(null, roleId, menuId, sysType, new BaseController().getUserId(), new Date(), new BaseController().getUserId(), new Date());
|
|
|
+ list.add(sysRoleMenuKzt);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.saveBatch(list);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
|