| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import org.dromara.common.core.exception.ServiceException; |
| | | import org.dromara.common.core.utils.MapstructUtils; |
| | | import org.dromara.common.core.utils.StreamUtils; |
| | | import org.dromara.common.core.utils.StringUtils; |
| | | import org.dromara.common.mybatis.core.page.PageQuery; |
| | | import org.dromara.common.mybatis.core.page.TableDataInfo; |
| | |
| | | */ |
| | | @Override |
| | | public List<Long> selectPostListByUserId(Long userId) { |
| | | return baseMapper.selectPostListByUserId(userId); |
| | | List<SysPostVo> list = baseMapper.selectPostsByUserId(userId); |
| | | return StreamUtils.toList(list, SysPostVo::getPostId); |
| | | } |
| | | |
| | | /** |
| | |
| | | for (Long postId : postIds) { |
| | | SysPost post = baseMapper.selectById(postId); |
| | | if (countUserPostById(postId) > 0) { |
| | | throw new ServiceException(String.format("%1$s已分配,不能删除", post.getPostName())); |
| | | throw new ServiceException(String.format("%1$s已分配,不能删除!", post.getPostName())); |
| | | } |
| | | } |
| | | return baseMapper.deleteBatchIds(Arrays.asList(postIds)); |