| | |
| | | package com.ruoyi.system.service.impl; |
| | | |
| | | import java.util.List; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import cn.hutool.core.lang.Validator; |
| | | import com.ruoyi.common.constant.UserConstants; |
| | | import com.ruoyi.common.exception.CustomException; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.system.domain.SysPost; |
| | | import com.ruoyi.system.mapper.SysPostMapper; |
| | | import com.ruoyi.system.mapper.SysUserPostMapper; |
| | | import com.ruoyi.system.service.ISysPostService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 岗位信息 服务层处理 |
| | |
| | | @Override |
| | | public String checkPostNameUnique(SysPost post) |
| | | { |
| | | Long postId = StringUtils.isNull(post.getPostId()) ? -1L : post.getPostId(); |
| | | Long postId = Validator.isNull(post.getPostId()) ? -1L : post.getPostId(); |
| | | SysPost info = postMapper.checkPostNameUnique(post.getPostName()); |
| | | if (StringUtils.isNotNull(info) && info.getPostId().longValue() != postId.longValue()) |
| | | if (Validator.isNotNull(info) && info.getPostId().longValue() != postId.longValue()) |
| | | { |
| | | return UserConstants.NOT_UNIQUE; |
| | | } |
| | |
| | | @Override |
| | | public String checkPostCodeUnique(SysPost post) |
| | | { |
| | | Long postId = StringUtils.isNull(post.getPostId()) ? -1L : post.getPostId(); |
| | | Long postId = Validator.isNull(post.getPostId()) ? -1L : post.getPostId(); |
| | | SysPost info = postMapper.checkPostCodeUnique(post.getPostCode()); |
| | | if (StringUtils.isNotNull(info) && info.getPostId().longValue() != postId.longValue()) |
| | | if (Validator.isNotNull(info) && info.getPostId().longValue() != postId.longValue()) |
| | | { |
| | | return UserConstants.NOT_UNIQUE; |
| | | } |