diff --git a/waynboot-common/src/main/java/com/wayn/common/core/domain/system/RoleMenu.java b/waynboot-common/src/main/java/com/wayn/common/core/domain/system/RoleMenu.java index 8c58095..eeab236 100644 --- a/waynboot-common/src/main/java/com/wayn/common/core/domain/system/RoleMenu.java +++ b/waynboot-common/src/main/java/com/wayn/common/core/domain/system/RoleMenu.java @@ -14,7 +14,6 @@ public class RoleMenu { /** * 角色ID */ - @TableId(type = IdType.AUTO) private Long roleId; /** diff --git a/waynboot-common/src/main/java/com/wayn/common/core/domain/system/UserRole.java b/waynboot-common/src/main/java/com/wayn/common/core/domain/system/UserRole.java index ba33093..fb888bd 100644 --- a/waynboot-common/src/main/java/com/wayn/common/core/domain/system/UserRole.java +++ b/waynboot-common/src/main/java/com/wayn/common/core/domain/system/UserRole.java @@ -1,7 +1,5 @@ package com.wayn.common.core.domain.system; -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import lombok.Data; @@ -14,7 +12,6 @@ public class UserRole { /** * 用户ID */ - @TableId(type = IdType.AUTO) private Long userId; /** diff --git a/waynboot-common/src/main/java/com/wayn/common/core/service/system/impl/UserServiceImpl.java b/waynboot-common/src/main/java/com/wayn/common/core/service/system/impl/UserServiceImpl.java index 0394bac..4911c3a 100644 --- a/waynboot-common/src/main/java/com/wayn/common/core/service/system/impl/UserServiceImpl.java +++ b/waynboot-common/src/main/java/com/wayn/common/core/service/system/impl/UserServiceImpl.java @@ -16,6 +16,7 @@ import com.wayn.common.exception.BusinessException; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; import java.util.Arrays; import java.util.List; @@ -83,6 +84,7 @@ public class UserServiceImpl extends ServiceImpl implements IU } @Override + @Transactional(rollbackFor = Exception.class) public boolean updateUserAndRole(User user) { updateById(user); iUserRoleService.remove(new QueryWrapper().eq("user_id", user.getUserId()));