用户岗位校验修复

This commit is contained in:
SGK\17962 2025-09-11 16:49:00 +08:00
parent 8037a5566b
commit f345b0ffd2

View File

@ -518,10 +518,10 @@ public class SysUserServiceImpl implements ISysUserService, UserService {
*/
private void insertUserPost(SysUserBo user, boolean clear) {
Long[] posts = user.getPostIds();
if (posts.length >1) {
throw new ServiceException("用户" + user.getUserName() + "不能添加多个岗位");
}
if (ArrayUtil.isNotEmpty(posts)) {
if (posts.length >1) {
throw new ServiceException("用户" + user.getUserName() + "不能添加多个岗位");
}
if (clear) {
// 删除用户与岗位关联
userPostMapper.delete(new LambdaQueryWrapper<SysUserPost>().eq(SysUserPost::getUserId, user.getUserId()));