菜单重复添加修改
This commit is contained in:
@@ -8,6 +8,7 @@ import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 角色菜单关联 实体类。
|
||||
@@ -41,5 +42,21 @@ public class SysRolesMenus implements Serializable {
|
||||
* 0 管理端及小程序 1收银机
|
||||
*/
|
||||
private Integer type;
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (!(o instanceof SysRolesMenus that)) {
|
||||
return false;
|
||||
}
|
||||
return Objects.equals(menuId, that.menuId) &&
|
||||
Objects.equals(roleId, that.roleId) &&
|
||||
Objects.equals(type, that.type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(menuId, roleId, type);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -181,6 +181,7 @@ public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> imp
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Step 4: 批量保存(如有数据)
|
||||
return rolesMenus.isEmpty() || sysRolesMenusService.saveBatch(rolesMenus);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user