| | |
| | | package com.zhitan.system.service.impl; |
| | | |
| | | import java.util.List; |
| | | import javax.annotation.Resource; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | import com.zhitan.common.constant.UserConstants; |
| | | import com.zhitan.common.exception.ServiceException; |
| | | import com.zhitan.common.utils.StringUtils; |
| | |
| | | import com.zhitan.system.mapper.SysPostMapper; |
| | | import com.zhitan.system.mapper.SysUserPostMapper; |
| | | import com.zhitan.system.service.ISysPostService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 岗位信息 服务层处理 |
| | | * |
| | | * |
| | | * @author zhitan |
| | | */ |
| | | @Service |
| | |
| | | |
| | | /** |
| | | * 查询岗位信息集合 |
| | | * |
| | | * |
| | | * @param post 岗位信息 |
| | | * @return 岗位信息集合 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 查询所有岗位 |
| | | * |
| | | * |
| | | * @return 岗位列表 |
| | | */ |
| | | @Override |
| | |
| | | |
| | | /** |
| | | * 通过岗位ID查询岗位信息 |
| | | * |
| | | * |
| | | * @param postId 岗位ID |
| | | * @return 角色对象信息 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 根据用户ID获取岗位选择框列表 |
| | | * |
| | | * |
| | | * @param userId 用户ID |
| | | * @return 选中岗位ID列表 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 校验岗位名称是否唯一 |
| | | * |
| | | * |
| | | * @param post 岗位信息 |
| | | * @return 结果 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 校验岗位编码是否唯一 |
| | | * |
| | | * |
| | | * @param post 岗位信息 |
| | | * @return 结果 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 通过岗位ID查询岗位使用数量 |
| | | * |
| | | * |
| | | * @param postId 岗位ID |
| | | * @return 结果 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 删除岗位信息 |
| | | * |
| | | * |
| | | * @param postId 岗位ID |
| | | * @return 结果 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 批量删除岗位信息 |
| | | * |
| | | * |
| | | * @param postIds 需要删除的岗位ID |
| | | * @return 结果 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 新增保存岗位信息 |
| | | * |
| | | * |
| | | * @param post 岗位信息 |
| | | * @return 结果 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 修改保存岗位信息 |
| | | * |
| | | * |
| | | * @param post 岗位信息 |
| | | * @return 结果 |
| | | */ |
| | |
| | | { |
| | | return postMapper.updatePost(post); |
| | | } |
| | | @Override |
| | | public Page<SysPost> selectPostPage(SysPost post, Long pageNum, Long pageSize) { |
| | | LambdaQueryWrapper<SysPost> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.like(StringUtils.isNotEmpty(post.getPostName()),SysPost::getPostName,post.getPostName()); |
| | | queryWrapper.like(StringUtils.isNotEmpty(post.getPostCode()),SysPost::getPostCode,post.getPostCode()); |
| | | queryWrapper.eq(StringUtils.isNotEmpty(post.getStatus()),SysPost::getStatus,post.getStatus()); |
| | | |
| | | |
| | | return postMapper.selectPage(new Page<>(pageNum,pageSize),queryWrapper); |
| | | } |
| | | } |