mirror of
https://gitee.com/dromara/MaxKey.git
synced 2025-12-08 18:08:35 +08:00
调整
This commit is contained in:
parent
6d11ee4e9c
commit
b57707aaa4
@ -32,15 +32,6 @@ import jakarta.persistence.GeneratedValue;
|
|||||||
import jakarta.persistence.Id;
|
import jakarta.persistence.Id;
|
||||||
import jakarta.persistence.Table;
|
import jakarta.persistence.Table;
|
||||||
|
|
||||||
/*
|
|
||||||
ID varchar(40) not null,
|
|
||||||
UID varchar(40) null,
|
|
||||||
APPID varchar(40) null,
|
|
||||||
USERNAME varchar(60) null,
|
|
||||||
PASSWORD varchar(60) null,
|
|
||||||
STATUS char(1) null
|
|
||||||
constraint PK_ROLES primary key clustered (ID)
|
|
||||||
*/
|
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "MXK_ACCOUNTS")
|
@Table(name = "MXK_ACCOUNTS")
|
||||||
public class Accounts extends JpaEntity implements Serializable {
|
public class Accounts extends JpaEntity implements Serializable {
|
||||||
|
|||||||
@ -19,6 +19,8 @@ package org.dromara.maxkey.entity;
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
import org.dromara.mybatis.jpa.entity.JpaEntity;
|
import org.dromara.mybatis.jpa.entity.JpaEntity;
|
||||||
|
|
||||||
import jakarta.persistence.Column;
|
import jakarta.persistence.Column;
|
||||||
@ -29,7 +31,7 @@ import jakarta.persistence.Table;
|
|||||||
|
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "MXK_EMAIL_SENDERS")
|
@Table(name = "MXK_EMAIL_SENDERS")
|
||||||
public class EmailSenders extends JpaEntity{
|
public class EmailSenders extends JpaEntity implements Serializable {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
|||||||
@ -26,7 +26,7 @@ import org.slf4j.Logger;
|
|||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
public class ExtraAttrs {
|
public class ExtraAttrs {
|
||||||
final static Logger _logger = LoggerFactory.getLogger(ExtraAttrs.class);
|
static final Logger _logger = LoggerFactory.getLogger(ExtraAttrs.class);
|
||||||
|
|
||||||
ArrayList <ExtraAttr> extraAttrs ;
|
ArrayList <ExtraAttr> extraAttrs ;
|
||||||
|
|
||||||
@ -43,7 +43,7 @@ public class ExtraAttrs {
|
|||||||
*/
|
*/
|
||||||
public ExtraAttrs(String arrayJsonString) {
|
public ExtraAttrs(String arrayJsonString) {
|
||||||
String extraAttrsJsonString= "{\"extraAttrs\":"+arrayJsonString+"}";
|
String extraAttrsJsonString= "{\"extraAttrs\":"+arrayJsonString+"}";
|
||||||
_logger.debug("Extra Attrs Json String " +extraAttrsJsonString);
|
_logger.debug("Extra Attrs Json String {}" ,extraAttrsJsonString);
|
||||||
ExtraAttrs extraAttrs=JsonUtils.gsonStringToObject(extraAttrsJsonString, ExtraAttrs.class);
|
ExtraAttrs extraAttrs=JsonUtils.gsonStringToObject(extraAttrsJsonString, ExtraAttrs.class);
|
||||||
this.extraAttrs=extraAttrs.getExtraAttrs();
|
this.extraAttrs=extraAttrs.getExtraAttrs();
|
||||||
}
|
}
|
||||||
@ -52,21 +52,21 @@ public class ExtraAttrs {
|
|||||||
|
|
||||||
public void put(String attr,String value) {
|
public void put(String attr,String value) {
|
||||||
if(extraAttrs==null){
|
if(extraAttrs==null){
|
||||||
extraAttrs=new ArrayList<ExtraAttr>();
|
extraAttrs=new ArrayList<>();
|
||||||
}
|
}
|
||||||
this.extraAttrs.add(new ExtraAttr(attr,value));
|
this.extraAttrs.add(new ExtraAttr(attr,value));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void put(String attr,String type,String value) {
|
public void put(String attr,String type,String value) {
|
||||||
if(extraAttrs==null){
|
if(extraAttrs==null){
|
||||||
extraAttrs=new ArrayList<ExtraAttr>();
|
extraAttrs=new ArrayList<>();
|
||||||
}
|
}
|
||||||
this.extraAttrs.add(new ExtraAttr(attr,type,value));
|
this.extraAttrs.add(new ExtraAttr(attr,type,value));
|
||||||
}
|
}
|
||||||
|
|
||||||
public String get(String attr) {
|
public String get(String attr) {
|
||||||
String value=null;
|
String value=null;
|
||||||
if(extraAttrs!=null&& extraAttrs.size()!=0){
|
if(extraAttrs!=null&& !extraAttrs.isEmpty()){
|
||||||
for(ExtraAttr extraAttr :extraAttrs){
|
for(ExtraAttr extraAttr :extraAttrs){
|
||||||
if(extraAttr.getAttr().equals(attr)){
|
if(extraAttr.getAttr().equals(attr)){
|
||||||
value=extraAttr.getValue();
|
value=extraAttr.getValue();
|
||||||
@ -78,7 +78,7 @@ public class ExtraAttrs {
|
|||||||
|
|
||||||
public String toJsonString(){
|
public String toJsonString(){
|
||||||
String jsonString =JsonUtils.gsonToString(extraAttrs);
|
String jsonString =JsonUtils.gsonToString(extraAttrs);
|
||||||
_logger.debug("jsonString " +jsonString);
|
_logger.debug("jsonString {}" ,jsonString);
|
||||||
return jsonString;
|
return jsonString;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -87,7 +87,7 @@ public class ExtraAttrs {
|
|||||||
for(ExtraAttr extraAttr :extraAttrs){
|
for(ExtraAttr extraAttr :extraAttrs){
|
||||||
extraAttrsHashMap.put(extraAttr.getAttr(), extraAttr.getValue());
|
extraAttrsHashMap.put(extraAttr.getAttr(), extraAttr.getValue());
|
||||||
}
|
}
|
||||||
_logger.debug("extraAttrs HashMap " +extraAttrsHashMap);
|
_logger.debug("extraAttrs HashMap {}" , extraAttrsHashMap);
|
||||||
return extraAttrsHashMap;
|
return extraAttrsHashMap;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -96,7 +96,7 @@ public class ExtraAttrs {
|
|||||||
for(ExtraAttr extraAttr :extraAttrs){
|
for(ExtraAttr extraAttr :extraAttrs){
|
||||||
properties.put(extraAttr.getAttr(), extraAttr.getValue());
|
properties.put(extraAttr.getAttr(), extraAttr.getValue());
|
||||||
}
|
}
|
||||||
_logger.debug("extraAttrs HashMap " +properties);
|
_logger.debug("extraAttrs HashMap {}" , properties);
|
||||||
return properties;
|
return properties;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -0,0 +1,211 @@
|
|||||||
|
/*
|
||||||
|
* Copyright [2020] [MaxKey of copyright http://www.maxkey.top]
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
package org.dromara.maxkey.entity;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
import jakarta.persistence.Column;
|
||||||
|
import jakarta.persistence.Entity;
|
||||||
|
import jakarta.persistence.GeneratedValue;
|
||||||
|
import jakarta.persistence.Id;
|
||||||
|
import jakarta.persistence.Table;
|
||||||
|
|
||||||
|
@Entity
|
||||||
|
@Table(name = "MXK_ROLE_MEMBER")
|
||||||
|
public class GroupMember extends UserInfo implements Serializable{
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
private static final long serialVersionUID = -8059639972590554760L;
|
||||||
|
@Id
|
||||||
|
@Column
|
||||||
|
@GeneratedValue
|
||||||
|
String id;
|
||||||
|
@Column
|
||||||
|
private String groupId;
|
||||||
|
private String groupName;
|
||||||
|
private String category;
|
||||||
|
@Column
|
||||||
|
private String memberId;
|
||||||
|
private String memberName;
|
||||||
|
@Column
|
||||||
|
private String type;//User or Group
|
||||||
|
|
||||||
|
@Column
|
||||||
|
private String instId;
|
||||||
|
|
||||||
|
private String instName;
|
||||||
|
|
||||||
|
public GroupMember(){
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param groupId
|
||||||
|
* @param memberId
|
||||||
|
* @param type
|
||||||
|
*/
|
||||||
|
public GroupMember(String groupId, String memberId, String type , String instId) {
|
||||||
|
super();
|
||||||
|
this.groupId = groupId;
|
||||||
|
this.memberId = memberId;
|
||||||
|
this.type = type;
|
||||||
|
this.instId = instId;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public GroupMember(String groupId, String groupName, String memberId,
|
||||||
|
String memberName, String type , String instId) {
|
||||||
|
super();
|
||||||
|
this.groupId = groupId;
|
||||||
|
this.groupName = groupName;
|
||||||
|
this.memberId = memberId;
|
||||||
|
this.memberName = memberName;
|
||||||
|
this.type = type;
|
||||||
|
this.instId = instId;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public String getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void setId(String id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public String getGroupId() {
|
||||||
|
return groupId;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void setGroupId(String groupId) {
|
||||||
|
this.groupId = groupId;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public String getGroupName() {
|
||||||
|
return groupName;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void setGroupName(String groupName) {
|
||||||
|
this.groupName = groupName;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the memberId
|
||||||
|
*/
|
||||||
|
public String getMemberId() {
|
||||||
|
return memberId;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param memberId the memberId to set
|
||||||
|
*/
|
||||||
|
public void setMemberId(String memberId) {
|
||||||
|
this.memberId = memberId;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the type
|
||||||
|
*/
|
||||||
|
public String getType() {
|
||||||
|
return type;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param type the type to set
|
||||||
|
*/
|
||||||
|
public void setType(String type) {
|
||||||
|
this.type = type;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public String getMemberName() {
|
||||||
|
return memberName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMemberName(String memberName) {
|
||||||
|
this.memberName = memberName;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public String getCategory() {
|
||||||
|
return category;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void setCategory(String category) {
|
||||||
|
this.category = category;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public String getInstId() {
|
||||||
|
return instId;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void setInstId(String instId) {
|
||||||
|
this.instId = instId;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public String getInstName() {
|
||||||
|
return instName;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void setInstName(String instName) {
|
||||||
|
this.instName = instName;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
StringBuilder builder = new StringBuilder();
|
||||||
|
builder.append("GroupMember [id=");
|
||||||
|
builder.append(id);
|
||||||
|
builder.append(", groupId=");
|
||||||
|
builder.append(groupId);
|
||||||
|
builder.append(", groupName=");
|
||||||
|
builder.append(groupName);
|
||||||
|
builder.append(", category=");
|
||||||
|
builder.append(category);
|
||||||
|
builder.append(", memberId=");
|
||||||
|
builder.append(memberId);
|
||||||
|
builder.append(", memberName=");
|
||||||
|
builder.append(memberName);
|
||||||
|
builder.append(", type=");
|
||||||
|
builder.append(type);
|
||||||
|
builder.append(", instId=");
|
||||||
|
builder.append(instId);
|
||||||
|
builder.append(", instName=");
|
||||||
|
builder.append(instName);
|
||||||
|
builder.append("]");
|
||||||
|
return builder.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -29,16 +29,9 @@ import jakarta.persistence.Table;
|
|||||||
|
|
||||||
import org.dromara.maxkey.entity.apps.Apps;
|
import org.dromara.maxkey.entity.apps.Apps;
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
ID varchar(40) not null,
|
|
||||||
ROLEID varchar(40) null,
|
|
||||||
MENUID varchar(40) null
|
|
||||||
constraint PK_ROLES primary key clustered (ID)
|
|
||||||
*/
|
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "MXK_ROLE_PERMISSIONS")
|
@Table(name = "MXK_ROLE_PERMISSIONS")
|
||||||
public class RolePermissions extends Apps implements Serializable{
|
public class GroupPermissions extends Apps implements Serializable{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@ -49,9 +42,9 @@ public class RolePermissions extends Apps implements Serializable{
|
|||||||
@GeneratedValue
|
@GeneratedValue
|
||||||
String id;
|
String id;
|
||||||
@Column
|
@Column
|
||||||
private String roleId;
|
private String groupId;
|
||||||
|
|
||||||
private String roleName;
|
private String groupName;
|
||||||
|
|
||||||
@Column
|
@Column
|
||||||
private String appId;
|
private String appId;
|
||||||
@ -63,7 +56,7 @@ public class RolePermissions extends Apps implements Serializable{
|
|||||||
|
|
||||||
private String instName;
|
private String instName;
|
||||||
|
|
||||||
public RolePermissions(){
|
public GroupPermissions(){
|
||||||
super();
|
super();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -72,31 +65,32 @@ public class RolePermissions extends Apps implements Serializable{
|
|||||||
* @param groupId
|
* @param groupId
|
||||||
* @param appId
|
* @param appId
|
||||||
*/
|
*/
|
||||||
public RolePermissions(String roleId, String appId, String instId) {
|
public GroupPermissions(String groupId, String appId, String instId) {
|
||||||
super();
|
super();
|
||||||
this.roleId = roleId;
|
this.groupId = groupId;
|
||||||
this.appId = appId;
|
this.appId = appId;
|
||||||
this.instId = instId;
|
this.instId = instId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public String getRoleId() {
|
|
||||||
return roleId;
|
public String getGroupId() {
|
||||||
|
return groupId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void setRoleId(String roleId) {
|
public void setGroupId(String groupId) {
|
||||||
this.roleId = roleId;
|
this.groupId = groupId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public String getRoleName() {
|
public String getGroupName() {
|
||||||
return roleName;
|
return groupName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void setRoleName(String roleName) {
|
public void setGroupName(String groupName) {
|
||||||
this.roleName = roleName;
|
this.groupName = groupName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -158,12 +152,12 @@ public class RolePermissions extends Apps implements Serializable{
|
|||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
StringBuilder builder = new StringBuilder();
|
StringBuilder builder = new StringBuilder();
|
||||||
builder.append("RolePermissions [id=");
|
builder.append("GroupPermissions [id=");
|
||||||
builder.append(id);
|
builder.append(id);
|
||||||
builder.append(", roleId=");
|
builder.append(", groupId=");
|
||||||
builder.append(roleId);
|
builder.append(groupId);
|
||||||
builder.append(", roleName=");
|
builder.append(", groupName=");
|
||||||
builder.append(roleName);
|
builder.append(groupName);
|
||||||
builder.append(", appId=");
|
builder.append(", appId=");
|
||||||
builder.append(appId);
|
builder.append(appId);
|
||||||
builder.append(", appName=");
|
builder.append(", appName=");
|
||||||
@ -29,8 +29,8 @@ import org.dromara.maxkey.constants.ConstsStatus;
|
|||||||
import org.dromara.maxkey.web.WebContext;
|
import org.dromara.maxkey.web.WebContext;
|
||||||
|
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "MXK_ROLE_PRIVILEGES")
|
@Table(name = "MXK_GROUP_PRIVILEGES")
|
||||||
public class RolePrivileges extends JpaEntity implements Serializable {
|
public class GroupPrivileges extends JpaEntity implements Serializable {
|
||||||
private static final long serialVersionUID = -8783585691243853899L;
|
private static final long serialVersionUID = -8783585691243853899L;
|
||||||
|
|
||||||
@Id
|
@Id
|
||||||
@ -40,7 +40,7 @@ public class RolePrivileges extends JpaEntity implements Serializable {
|
|||||||
@Column
|
@Column
|
||||||
String appId;
|
String appId;
|
||||||
@Column
|
@Column
|
||||||
String roleId;
|
String groupId;
|
||||||
@Column
|
@Column
|
||||||
String resourceId;
|
String resourceId;
|
||||||
|
|
||||||
@ -50,25 +50,25 @@ public class RolePrivileges extends JpaEntity implements Serializable {
|
|||||||
|
|
||||||
private String instName;
|
private String instName;
|
||||||
|
|
||||||
public RolePrivileges() {
|
public GroupPrivileges() {
|
||||||
}
|
}
|
||||||
|
|
||||||
public RolePrivileges(String appId, String roleId, String instId) {
|
public GroupPrivileges(String appId, String groupId, String instId) {
|
||||||
this.appId = appId;
|
this.appId = appId;
|
||||||
this.roleId = roleId;
|
this.groupId = groupId;
|
||||||
this.instId = instId;
|
this.instId = instId;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* .
|
* .
|
||||||
* @param appId String
|
* @param appId String
|
||||||
* @param roleId String
|
* @param groupId String
|
||||||
* @param resourceId String
|
* @param resourceId String
|
||||||
*/
|
*/
|
||||||
public RolePrivileges(String appId, String roleId, String resourceId , String instId) {
|
public GroupPrivileges(String appId, String groupId, String resourceId , String instId) {
|
||||||
this.id = WebContext.genId();
|
this.id = WebContext.genId();
|
||||||
this.appId = appId;
|
this.appId = appId;
|
||||||
this.roleId = roleId;
|
this.groupId = groupId;
|
||||||
this.resourceId = resourceId;
|
this.resourceId = resourceId;
|
||||||
this.instId = instId;
|
this.instId = instId;
|
||||||
}
|
}
|
||||||
@ -89,12 +89,12 @@ public class RolePrivileges extends JpaEntity implements Serializable {
|
|||||||
this.appId = appId;
|
this.appId = appId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getRoleId() {
|
public String getGroupId() {
|
||||||
return roleId;
|
return groupId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setRoleId(String roleId) {
|
public void setGroupId(String groupId) {
|
||||||
this.roleId = roleId;
|
this.groupId = groupId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getResourceId() {
|
public String getResourceId() {
|
||||||
@ -114,7 +114,7 @@ public class RolePrivileges extends JpaEntity implements Serializable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public String getUniqueId() {
|
public String getUniqueId() {
|
||||||
return appId + "_" + roleId + "_" + resourceId;
|
return appId + "_" + groupId + "_" + resourceId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getInstId() {
|
public String getInstId() {
|
||||||
@ -140,8 +140,8 @@ public class RolePrivileges extends JpaEntity implements Serializable {
|
|||||||
builder.append(id);
|
builder.append(id);
|
||||||
builder.append(", appId=");
|
builder.append(", appId=");
|
||||||
builder.append(appId);
|
builder.append(appId);
|
||||||
builder.append(", roleId=");
|
builder.append(", groupId=");
|
||||||
builder.append(roleId);
|
builder.append(groupId);
|
||||||
builder.append(", resourceId=");
|
builder.append(", resourceId=");
|
||||||
builder.append(resourceId);
|
builder.append(resourceId);
|
||||||
builder.append(", status=");
|
builder.append(", status=");
|
||||||
302
maxkey-core/src/main/java/org/dromara/maxkey/entity/Groups.java
Normal file
302
maxkey-core/src/main/java/org/dromara/maxkey/entity/Groups.java
Normal file
@ -0,0 +1,302 @@
|
|||||||
|
/*
|
||||||
|
* Copyright [2022] [MaxKey of copyright http://www.maxkey.top]
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
package org.dromara.maxkey.entity;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import org.dromara.mybatis.jpa.entity.JpaEntity;
|
||||||
|
|
||||||
|
import jakarta.persistence.Column;
|
||||||
|
import jakarta.persistence.Entity;
|
||||||
|
import jakarta.persistence.GeneratedValue;
|
||||||
|
import jakarta.persistence.Id;
|
||||||
|
import jakarta.persistence.Table;
|
||||||
|
import org.hibernate.validator.constraints.Length;
|
||||||
|
|
||||||
|
@Entity
|
||||||
|
@Table(name = "MXK_GROUPS")
|
||||||
|
public class Groups extends JpaEntity implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 4660258495864814777L;
|
||||||
|
|
||||||
|
public class Category{
|
||||||
|
public static final String DYNAMIC = "dynamic";
|
||||||
|
|
||||||
|
public static final String STATIC = "static";
|
||||||
|
|
||||||
|
public static final String APP = "app";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Id
|
||||||
|
@Column
|
||||||
|
@GeneratedValue
|
||||||
|
String id;
|
||||||
|
|
||||||
|
@Length(max = 60)
|
||||||
|
@Column
|
||||||
|
String groupCode;
|
||||||
|
|
||||||
|
@Length(max = 60)
|
||||||
|
@Column
|
||||||
|
String groupName;
|
||||||
|
|
||||||
|
@Column
|
||||||
|
String category;
|
||||||
|
|
||||||
|
@Column
|
||||||
|
String filters ;
|
||||||
|
|
||||||
|
@Column
|
||||||
|
String orgIdsList;
|
||||||
|
@Column
|
||||||
|
String resumeTime;
|
||||||
|
@Column
|
||||||
|
String suspendTime;
|
||||||
|
|
||||||
|
@Column
|
||||||
|
int isdefault;
|
||||||
|
@Column
|
||||||
|
String description;
|
||||||
|
@Column
|
||||||
|
String createdBy;
|
||||||
|
@Column
|
||||||
|
String createdDate;
|
||||||
|
@Column
|
||||||
|
String modifiedBy;
|
||||||
|
@Column
|
||||||
|
String modifiedDate;
|
||||||
|
@Column
|
||||||
|
int status;
|
||||||
|
|
||||||
|
@Column
|
||||||
|
private String instId;
|
||||||
|
|
||||||
|
private String instName;
|
||||||
|
|
||||||
|
public Groups() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public Groups(String id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Groups.
|
||||||
|
* @param id String
|
||||||
|
* @param name String
|
||||||
|
* @param isdefault int
|
||||||
|
*/
|
||||||
|
public Groups(String id,String groupCode, String groupName, int isdefault) {
|
||||||
|
super();
|
||||||
|
this.id = id;
|
||||||
|
this.groupCode = groupCode;
|
||||||
|
this.groupName = groupName;
|
||||||
|
this.isdefault = isdefault;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(String id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public String getGroupCode() {
|
||||||
|
return groupCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setGroupCode(String groupCode) {
|
||||||
|
this.groupCode = groupCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getGroupName() {
|
||||||
|
return groupName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setGroupName(String groupName) {
|
||||||
|
this.groupName = groupName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getIsdefault() {
|
||||||
|
return isdefault;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIsdefault(int isdefault) {
|
||||||
|
this.isdefault = isdefault;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDescription() {
|
||||||
|
return description;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDescription(String description) {
|
||||||
|
this.description = description;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCreatedBy() {
|
||||||
|
return createdBy;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCreatedBy(String createdBy) {
|
||||||
|
this.createdBy = createdBy;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCreatedDate() {
|
||||||
|
return createdDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCreatedDate(String createdDate) {
|
||||||
|
this.createdDate = createdDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getModifiedBy() {
|
||||||
|
return modifiedBy;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setModifiedBy(String modifiedBy) {
|
||||||
|
this.modifiedBy = modifiedBy;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getModifiedDate() {
|
||||||
|
return modifiedDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setModifiedDate(String modifiedDate) {
|
||||||
|
this.modifiedDate = modifiedDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getStatus() {
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStatus(int status) {
|
||||||
|
this.status = status;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ROLE_ALL_USER must be
|
||||||
|
* 1, dynamic
|
||||||
|
* 2, all orgIdsList
|
||||||
|
* 3, not filters
|
||||||
|
*/
|
||||||
|
public void setDefaultAllUser() {
|
||||||
|
this.category = "dynamic";
|
||||||
|
this.orgIdsList ="";
|
||||||
|
this.filters ="";
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCategory() {
|
||||||
|
return category;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCategory(String category) {
|
||||||
|
this.category = category;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFilters() {
|
||||||
|
return filters;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFilters(String filters) {
|
||||||
|
this.filters = filters;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getOrgIdsList() {
|
||||||
|
return orgIdsList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOrgIdsList(String orgIdsList) {
|
||||||
|
this.orgIdsList = orgIdsList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getResumeTime() {
|
||||||
|
return resumeTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setResumeTime(String resumeTime) {
|
||||||
|
this.resumeTime = resumeTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSuspendTime() {
|
||||||
|
return suspendTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSuspendTime(String suspendTime) {
|
||||||
|
this.suspendTime = suspendTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getInstId() {
|
||||||
|
return instId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setInstId(String instId) {
|
||||||
|
this.instId = instId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getInstName() {
|
||||||
|
return instName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setInstName(String instName) {
|
||||||
|
this.instName = instName;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
StringBuilder builder = new StringBuilder();
|
||||||
|
builder.append("Groups [id=");
|
||||||
|
builder.append(id);
|
||||||
|
builder.append(", groupCode=");
|
||||||
|
builder.append(groupCode);
|
||||||
|
builder.append(", groupName=");
|
||||||
|
builder.append(groupName);
|
||||||
|
builder.append(", category=");
|
||||||
|
builder.append(category);
|
||||||
|
builder.append(", filters=");
|
||||||
|
builder.append(filters);
|
||||||
|
builder.append(", orgIdsList=");
|
||||||
|
builder.append(orgIdsList);
|
||||||
|
builder.append(", resumeTime=");
|
||||||
|
builder.append(resumeTime);
|
||||||
|
builder.append(", suspendTime=");
|
||||||
|
builder.append(suspendTime);
|
||||||
|
builder.append(", isdefault=");
|
||||||
|
builder.append(isdefault);
|
||||||
|
builder.append(", description=");
|
||||||
|
builder.append(description);
|
||||||
|
builder.append(", createdBy=");
|
||||||
|
builder.append(createdBy);
|
||||||
|
builder.append(", createdDate=");
|
||||||
|
builder.append(createdDate);
|
||||||
|
builder.append(", modifiedBy=");
|
||||||
|
builder.append(modifiedBy);
|
||||||
|
builder.append(", modifiedDate=");
|
||||||
|
builder.append(modifiedDate);
|
||||||
|
builder.append(", status=");
|
||||||
|
builder.append(status);
|
||||||
|
builder.append(", instId=");
|
||||||
|
builder.append(instId);
|
||||||
|
builder.append(", instName=");
|
||||||
|
builder.append(instName);
|
||||||
|
builder.append("]");
|
||||||
|
return builder.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -17,6 +17,8 @@
|
|||||||
|
|
||||||
package org.dromara.maxkey.entity;
|
package org.dromara.maxkey.entity;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
import org.dromara.mybatis.jpa.entity.JpaEntity;
|
import org.dromara.mybatis.jpa.entity.JpaEntity;
|
||||||
|
|
||||||
import jakarta.persistence.Column;
|
import jakarta.persistence.Column;
|
||||||
@ -31,7 +33,7 @@ import jakarta.persistence.Table;
|
|||||||
*/
|
*/
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "MXK_HISTORY_LOGIN_APPS")
|
@Table(name = "MXK_HISTORY_LOGIN_APPS")
|
||||||
public class HistoryLoginApps extends JpaEntity {
|
public class HistoryLoginApps extends JpaEntity implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = 5085201575292304749L;
|
private static final long serialVersionUID = 5085201575292304749L;
|
||||||
@Id
|
@Id
|
||||||
|
|||||||
@ -17,6 +17,8 @@
|
|||||||
|
|
||||||
package org.dromara.maxkey.entity;
|
package org.dromara.maxkey.entity;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
import org.dromara.mybatis.jpa.entity.JpaEntity;
|
import org.dromara.mybatis.jpa.entity.JpaEntity;
|
||||||
|
|
||||||
import jakarta.persistence.Column;
|
import jakarta.persistence.Column;
|
||||||
@ -27,7 +29,7 @@ import jakarta.persistence.Table;
|
|||||||
|
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "MXK_REGISTER")
|
@Table(name = "MXK_REGISTER")
|
||||||
public class Register extends JpaEntity{
|
public class Register extends JpaEntity implements Serializable {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
|||||||
@ -27,13 +27,6 @@ import jakarta.persistence.GeneratedValue;
|
|||||||
import jakarta.persistence.Id;
|
import jakarta.persistence.Id;
|
||||||
import jakarta.persistence.Table;
|
import jakarta.persistence.Table;
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
ID varchar(40) not null,
|
|
||||||
APPROLEID varchar(40) null,
|
|
||||||
USERID varchar(40) null
|
|
||||||
constraint PK_ROLES primary key clustered (ID)
|
|
||||||
*/
|
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "MXK_ROLE_MEMBER")
|
@Table(name = "MXK_ROLE_MEMBER")
|
||||||
public class RoleMember extends UserInfo implements Serializable{
|
public class RoleMember extends UserInfo implements Serializable{
|
||||||
|
|||||||
@ -17,6 +17,8 @@
|
|||||||
|
|
||||||
package org.dromara.maxkey.entity;
|
package org.dromara.maxkey.entity;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
import org.dromara.mybatis.jpa.entity.JpaEntity;
|
import org.dromara.mybatis.jpa.entity.JpaEntity;
|
||||||
|
|
||||||
import jakarta.persistence.Column;
|
import jakarta.persistence.Column;
|
||||||
@ -31,7 +33,7 @@ import jakarta.persistence.Table;
|
|||||||
*/
|
*/
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "MXK_SOCIALS_ASSOCIATE")
|
@Table(name = "MXK_SOCIALS_ASSOCIATE")
|
||||||
public class SocialsAssociate extends JpaEntity {
|
public class SocialsAssociate extends JpaEntity implements Serializable {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
|||||||
@ -17,6 +17,7 @@
|
|||||||
|
|
||||||
package org.dromara.maxkey.entity;
|
package org.dromara.maxkey.entity;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
import org.dromara.mybatis.jpa.entity.JpaEntity;
|
import org.dromara.mybatis.jpa.entity.JpaEntity;
|
||||||
@ -36,7 +37,7 @@ import org.dromara.maxkey.util.DateUtils;
|
|||||||
|
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "MXK_SYNCHRO_RELATED")
|
@Table(name = "MXK_SYNCHRO_RELATED")
|
||||||
public class SynchroRelated extends JpaEntity {
|
public class SynchroRelated extends JpaEntity implements Serializable {
|
||||||
private static final long serialVersionUID = 6993697309055585706L;
|
private static final long serialVersionUID = 6993697309055585706L;
|
||||||
|
|
||||||
@Id
|
@Id
|
||||||
|
|||||||
@ -18,6 +18,8 @@
|
|||||||
package org.dromara.maxkey.entity;
|
package org.dromara.maxkey.entity;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@ -39,7 +41,7 @@ import org.dromara.maxkey.util.StringUtils;
|
|||||||
|
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "MXK_USERINFO")
|
@Table(name = "MXK_USERINFO")
|
||||||
public class UserInfo extends JpaEntity {
|
public class UserInfo extends JpaEntity implements Serializable {
|
||||||
private static final long serialVersionUID = 6402443942083382236L;
|
private static final long serialVersionUID = 6402443942083382236L;
|
||||||
|
|
||||||
public static final String CLASS_TYPE = "UserInfo";
|
public static final String CLASS_TYPE = "UserInfo";
|
||||||
|
|||||||
@ -17,6 +17,8 @@
|
|||||||
|
|
||||||
package org.dromara.maxkey.entity;
|
package org.dromara.maxkey.entity;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
import org.dromara.mybatis.jpa.entity.JpaEntity;
|
import org.dromara.mybatis.jpa.entity.JpaEntity;
|
||||||
|
|
||||||
import jakarta.persistence.Column;
|
import jakarta.persistence.Column;
|
||||||
@ -27,7 +29,7 @@ import jakarta.persistence.Table;
|
|||||||
|
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "MXK_USERINFO_ADJUNCT")
|
@Table(name = "MXK_USERINFO_ADJUNCT")
|
||||||
public class UserInfoAdjoint extends JpaEntity {
|
public class UserInfoAdjoint extends JpaEntity implements Serializable {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
|||||||
@ -17,6 +17,8 @@
|
|||||||
|
|
||||||
package org.dromara.maxkey.entity.apps;
|
package org.dromara.maxkey.entity.apps;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
import org.dromara.mybatis.jpa.entity.JpaEntity;
|
import org.dromara.mybatis.jpa.entity.JpaEntity;
|
||||||
|
|
||||||
import jakarta.persistence.Column;
|
import jakarta.persistence.Column;
|
||||||
@ -27,7 +29,7 @@ import jakarta.persistence.Table;
|
|||||||
|
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "MXK_APPS_CAS_DETAILS")
|
@Table(name = "MXK_APPS_CAS_DETAILS")
|
||||||
public class AppsCasDetails extends Apps {
|
public class AppsCasDetails extends Apps implements Serializable {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
|||||||
@ -17,6 +17,8 @@
|
|||||||
|
|
||||||
package org.dromara.maxkey.entity.apps;
|
package org.dromara.maxkey.entity.apps;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
import org.dromara.mybatis.jpa.entity.JpaEntity;
|
import org.dromara.mybatis.jpa.entity.JpaEntity;
|
||||||
|
|
||||||
import jakarta.persistence.Column;
|
import jakarta.persistence.Column;
|
||||||
@ -27,7 +29,7 @@ import jakarta.persistence.Table;
|
|||||||
|
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "MXK_APPS_EXTENDAPI_DETAILS")
|
@Table(name = "MXK_APPS_EXTENDAPI_DETAILS")
|
||||||
public class AppsExtendApiDetails extends Apps {
|
public class AppsExtendApiDetails extends Apps implements Serializable {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
|||||||
@ -17,6 +17,8 @@
|
|||||||
|
|
||||||
package org.dromara.maxkey.entity.apps;
|
package org.dromara.maxkey.entity.apps;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
import org.dromara.mybatis.jpa.entity.JpaEntity;
|
import org.dromara.mybatis.jpa.entity.JpaEntity;
|
||||||
|
|
||||||
import jakarta.persistence.Column;
|
import jakarta.persistence.Column;
|
||||||
@ -31,7 +33,7 @@ import jakarta.persistence.Table;
|
|||||||
*/
|
*/
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "MXK_APPS_FORM_BASED_DETAILS")
|
@Table(name = "MXK_APPS_FORM_BASED_DETAILS")
|
||||||
public class AppsFormBasedDetails extends Apps {
|
public class AppsFormBasedDetails extends Apps implements Serializable {
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -20,6 +20,8 @@
|
|||||||
*/
|
*/
|
||||||
package org.dromara.maxkey.entity.apps;
|
package org.dromara.maxkey.entity.apps;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
import org.dromara.mybatis.jpa.entity.JpaEntity;
|
import org.dromara.mybatis.jpa.entity.JpaEntity;
|
||||||
|
|
||||||
import jakarta.persistence.Column;
|
import jakarta.persistence.Column;
|
||||||
@ -34,7 +36,7 @@ import jakarta.persistence.Table;
|
|||||||
*/
|
*/
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "MXK_APPS_JWT_DETAILS")
|
@Table(name = "MXK_APPS_JWT_DETAILS")
|
||||||
public class AppsJwtDetails extends Apps {
|
public class AppsJwtDetails extends Apps implements Serializable {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
|||||||
@ -25,12 +25,14 @@ import jakarta.persistence.GeneratedValue;
|
|||||||
import jakarta.persistence.Id;
|
import jakarta.persistence.Id;
|
||||||
import jakarta.persistence.Table;
|
import jakarta.persistence.Table;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
import org.dromara.maxkey.entity.apps.oauth2.provider.client.BaseClientDetails;
|
import org.dromara.maxkey.entity.apps.oauth2.provider.client.BaseClientDetails;
|
||||||
import org.springframework.util.StringUtils;
|
import org.springframework.util.StringUtils;
|
||||||
|
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "MXK_APPS_OAUTH_CLIENT_DETAILS")
|
@Table(name = "MXK_APPS_OAUTH_CLIENT_DETAILS")
|
||||||
public class AppsOAuth20Details extends Apps {
|
public class AppsOAuth20Details extends Apps implements Serializable {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
|||||||
@ -17,6 +17,7 @@
|
|||||||
|
|
||||||
package org.dromara.maxkey.entity.apps;
|
package org.dromara.maxkey.entity.apps;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
import java.security.cert.X509Certificate;
|
import java.security.cert.X509Certificate;
|
||||||
|
|
||||||
import org.dromara.mybatis.jpa.entity.JpaEntity;
|
import org.dromara.mybatis.jpa.entity.JpaEntity;
|
||||||
@ -33,7 +34,7 @@ import jakarta.persistence.Table;
|
|||||||
*/
|
*/
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "MXK_APPS_SAML_V20_DETAILS")
|
@Table(name = "MXK_APPS_SAML_V20_DETAILS")
|
||||||
public class AppsSAML20Details extends Apps {
|
public class AppsSAML20Details extends Apps implements Serializable {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
|||||||
@ -20,6 +20,8 @@
|
|||||||
*/
|
*/
|
||||||
package org.dromara.maxkey.entity.apps;
|
package org.dromara.maxkey.entity.apps;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
import org.dromara.mybatis.jpa.entity.JpaEntity;
|
import org.dromara.mybatis.jpa.entity.JpaEntity;
|
||||||
|
|
||||||
import jakarta.persistence.Column;
|
import jakarta.persistence.Column;
|
||||||
@ -34,7 +36,7 @@ import jakarta.persistence.Table;
|
|||||||
*/
|
*/
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "MXK_APPS_TOKEN_BASED_DETAILS")
|
@Table(name = "MXK_APPS_TOKEN_BASED_DETAILS")
|
||||||
public class AppsTokenBasedDetails extends Apps {
|
public class AppsTokenBasedDetails extends Apps implements Serializable {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
|||||||
@ -52,7 +52,7 @@ public class LoginRepository {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
private static final String ROLES_SELECT_STATEMENT = "select distinct r.id,r.rolecode,r.rolename from mxk_userinfo u,mxk_roles r,mxk_role_member rm where u.id = ? and u.id=rm.memberid and rm.roleid=r.id ";
|
private static final String ROLES_SELECT_STATEMENT = "select distinct g.id,g.groupcode,g.groupname from mxk_userinfo u,mxk_groups g,mxk_group_member gm where u.id = ? and u.id=gm.memberid and gm.groupid=g.id ";
|
||||||
|
|
||||||
private static final String DEFAULT_USERINFO_SELECT_STATEMENT = "select * from mxk_userinfo where username = ? ";
|
private static final String DEFAULT_USERINFO_SELECT_STATEMENT = "select * from mxk_userinfo where username = ? ";
|
||||||
|
|
||||||
@ -60,7 +60,7 @@ public class LoginRepository {
|
|||||||
|
|
||||||
private static final String DEFAULT_USERINFO_SELECT_STATEMENT_USERNAME_MOBILE_EMAIL = "select * from mxk_userinfo where (username = ? or mobile = ? or email = ?) ";
|
private static final String DEFAULT_USERINFO_SELECT_STATEMENT_USERNAME_MOBILE_EMAIL = "select * from mxk_userinfo where (username = ? or mobile = ? or email = ?) ";
|
||||||
|
|
||||||
private static final String DEFAULT_MYAPPS_SELECT_STATEMENT = "select distinct app.id,app.appname from mxk_apps app,mxk_role_permissions pm,mxk_roles r where app.id=pm.appid and app.status = 1 and pm.roleid=r.id and r.id in(%s)";
|
private static final String DEFAULT_MYAPPS_SELECT_STATEMENT = "select distinct app.id,app.appname from mxk_apps app,mxk_group_permissions gp,mxk_groups g where app.id=gp.appid and app.status = 1 and gp.groupid=g.id and g.id in(%s)";
|
||||||
|
|
||||||
protected JdbcTemplate jdbcTemplate;
|
protected JdbcTemplate jdbcTemplate;
|
||||||
|
|
||||||
@ -215,7 +215,7 @@ public class LoginRepository {
|
|||||||
public List<Roles> queryRoles(UserInfo userInfo) {
|
public List<Roles> queryRoles(UserInfo userInfo) {
|
||||||
List<Roles> listRoles = jdbcTemplate.query(ROLES_SELECT_STATEMENT, new RowMapper<Roles>() {
|
List<Roles> listRoles = jdbcTemplate.query(ROLES_SELECT_STATEMENT, new RowMapper<Roles>() {
|
||||||
public Roles mapRow(ResultSet rs, int rowNum) throws SQLException {
|
public Roles mapRow(ResultSet rs, int rowNum) throws SQLException {
|
||||||
Roles role = new Roles(rs.getString("id"), rs.getString("rolecode"),rs.getString("rolename"), 0);
|
Roles role = new Roles(rs.getString("id"), rs.getString("groupcode"),rs.getString("groupname"), 0);
|
||||||
|
|
||||||
return role;
|
return role;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -22,6 +22,8 @@ package org.dromara.maxkey.persistence.mapper;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.dromara.maxkey.entity.GroupMember;
|
||||||
|
import org.dromara.maxkey.entity.Groups;
|
||||||
import org.dromara.maxkey.entity.RoleMember;
|
import org.dromara.maxkey.entity.RoleMember;
|
||||||
import org.dromara.maxkey.entity.Roles;
|
import org.dromara.maxkey.entity.Roles;
|
||||||
import org.dromara.maxkey.entity.UserInfo;
|
import org.dromara.maxkey.entity.UserInfo;
|
||||||
@ -32,20 +34,20 @@ import org.dromara.mybatis.jpa.IJpaMapper;
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public interface RoleMemberMapper extends IJpaMapper<RoleMember> {
|
public interface GroupMemberMapper extends IJpaMapper<GroupMember> {
|
||||||
|
|
||||||
public List<RoleMember> memberInRole(RoleMember entity);
|
public List<GroupMember> memberIn(GroupMember entity);
|
||||||
public List<RoleMember> memberNotInRole(RoleMember entity);
|
public List<GroupMember> memberNotIn(GroupMember entity);
|
||||||
|
|
||||||
public List<Roles> rolesNoMember(RoleMember entity);
|
public List<Groups> noMember(GroupMember entity);
|
||||||
|
|
||||||
public int addDynamicRoleMember(Roles dynamicRole);
|
public int addDynamicMember(Groups dynamicRole);
|
||||||
|
|
||||||
public int deleteDynamicRoleMember(Roles dynamicRole);
|
public int deleteDynamicMember(Groups dynamicRole);
|
||||||
|
|
||||||
public int deleteByRoleId(String roleId);
|
public int deleteByGroupId(String groupId);
|
||||||
|
|
||||||
public List<UserInfo> queryMemberByRoleId(String roleId);
|
public List<UserInfo> queryMemberByGroupId(String groupId);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -22,7 +22,7 @@ package org.dromara.maxkey.persistence.mapper;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.dromara.maxkey.entity.RolePermissions;
|
import org.dromara.maxkey.entity.GroupPermissions;
|
||||||
import org.dromara.mybatis.jpa.IJpaMapper;
|
import org.dromara.mybatis.jpa.IJpaMapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -30,12 +30,12 @@ import org.dromara.mybatis.jpa.IJpaMapper;
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public interface RolePermissionsMapper extends IJpaMapper<RolePermissions> {
|
public interface GroupPermissionsMapper extends IJpaMapper<GroupPermissions> {
|
||||||
|
|
||||||
public List<RolePermissions>appsInRole(RolePermissions entity);
|
public List<GroupPermissions>appsInGroup(GroupPermissions entity);
|
||||||
|
|
||||||
|
|
||||||
public List<RolePermissions> appsNotInRole(RolePermissions entity);
|
public List<GroupPermissions> appsNotInGroup(GroupPermissions entity);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -22,7 +22,7 @@ package org.dromara.maxkey.persistence.mapper;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.dromara.maxkey.entity.RolePrivileges;
|
import org.dromara.maxkey.entity.GroupPrivileges;
|
||||||
import org.dromara.mybatis.jpa.IJpaMapper;
|
import org.dromara.mybatis.jpa.IJpaMapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -30,12 +30,12 @@ import org.dromara.mybatis.jpa.IJpaMapper;
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public interface RolePrivilegesMapper extends IJpaMapper<RolePrivileges> {
|
public interface GroupPrivilegesMapper extends IJpaMapper<GroupPrivileges> {
|
||||||
|
|
||||||
public int insertRolePrivileges(List<RolePrivileges> rolePermissionsList);
|
public int insertGroupPrivileges(List<GroupPrivileges> groupPrivilegesList);
|
||||||
|
|
||||||
public int deleteRolePrivileges(List<RolePrivileges> rolePermissionsList);
|
public int deleteGroupPrivileges(List<GroupPrivileges> groupPrivilegesList);
|
||||||
|
|
||||||
public List<RolePrivileges> queryRolePrivileges(RolePrivileges rolePermissions);
|
public List<GroupPrivileges> queryGroupPrivileges(GroupPrivileges groupPrivileges);
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -22,7 +22,7 @@ package org.dromara.maxkey.persistence.mapper;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.dromara.maxkey.entity.Roles;
|
import org.dromara.maxkey.entity.Groups;
|
||||||
import org.dromara.mybatis.jpa.IJpaMapper;
|
import org.dromara.mybatis.jpa.IJpaMapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -30,9 +30,9 @@ import org.dromara.mybatis.jpa.IJpaMapper;
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public interface RolesMapper extends IJpaMapper<Roles> {
|
public interface GroupsMapper extends IJpaMapper<Groups> {
|
||||||
|
|
||||||
public List<Roles> queryDynamicRoles(Roles groups);
|
public List<Groups> queryDynamic(Groups groups);
|
||||||
|
|
||||||
public List<Roles> queryRolesByUserId(String userId);
|
public List<Groups> queryByUserId(String userId);
|
||||||
}
|
}
|
||||||
@ -19,10 +19,10 @@ package org.dromara.maxkey.persistence.service;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.dromara.maxkey.entity.RoleMember;
|
import org.dromara.maxkey.entity.GroupMember;
|
||||||
import org.dromara.maxkey.entity.Roles;
|
import org.dromara.maxkey.entity.Groups;
|
||||||
import org.dromara.maxkey.entity.UserInfo;
|
import org.dromara.maxkey.entity.UserInfo;
|
||||||
import org.dromara.maxkey.persistence.mapper.RoleMemberMapper;
|
import org.dromara.maxkey.persistence.mapper.GroupMemberMapper;
|
||||||
import org.dromara.mybatis.jpa.JpaService;
|
import org.dromara.mybatis.jpa.JpaService;
|
||||||
import org.dromara.mybatis.jpa.entity.JpaPageResults;
|
import org.dromara.mybatis.jpa.entity.JpaPageResults;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
@ -30,46 +30,46 @@ import org.slf4j.LoggerFactory;
|
|||||||
import org.springframework.stereotype.Repository;
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
@Repository
|
@Repository
|
||||||
public class RoleMemberService extends JpaService<RoleMember>{
|
public class GroupMemberService extends JpaService<GroupMember>{
|
||||||
final static Logger _logger = LoggerFactory.getLogger(RoleMemberService.class);
|
final static Logger _logger = LoggerFactory.getLogger(GroupMemberService.class);
|
||||||
|
|
||||||
public RoleMemberService() {
|
public GroupMemberService() {
|
||||||
super(RoleMemberMapper.class);
|
super(GroupMemberMapper.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see com.connsec.db.service.BaseService#getMapper()
|
* @see com.connsec.db.service.BaseService#getMapper()
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public RoleMemberMapper getMapper() {
|
public GroupMemberMapper getMapper() {
|
||||||
return (RoleMemberMapper)super.getMapper();
|
return (GroupMemberMapper)super.getMapper();
|
||||||
}
|
}
|
||||||
|
|
||||||
public int addDynamicRoleMember(Roles dynamicGroup) {
|
public int addDynamicMember(Groups dynamicGroup) {
|
||||||
return getMapper().addDynamicRoleMember(dynamicGroup);
|
return getMapper().addDynamicMember(dynamicGroup);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int deleteDynamicRoleMember(Roles dynamicGroup) {
|
public int deleteDynamicMember(Groups dynamicGroup) {
|
||||||
return getMapper().deleteDynamicRoleMember(dynamicGroup);
|
return getMapper().deleteDynamicMember(dynamicGroup);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int deleteByRoleId(String groupId) {
|
public int deleteByGroupId(String groupId) {
|
||||||
return getMapper().deleteByRoleId(groupId);
|
return getMapper().deleteByGroupId(groupId);
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<UserInfo> queryMemberByRoleId(String groupId){
|
public List<UserInfo> queryMemberByGroupId(String groupId){
|
||||||
return getMapper().queryMemberByRoleId(groupId);
|
return getMapper().queryMemberByGroupId(groupId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public JpaPageResults<Roles> rolesNoMember(RoleMember entity) {
|
public JpaPageResults<Groups> noMember(GroupMember entity) {
|
||||||
entity.setPageResultSelectUUID(entity.generateId());
|
entity.setPageResultSelectUUID(entity.generateId());
|
||||||
entity.setStartRow(calculateStartRow(entity.getPageNumber() ,entity.getPageSize()));
|
entity.setStartRow(calculateStartRow(entity.getPageNumber() ,entity.getPageSize()));
|
||||||
|
|
||||||
entity.setPageable(true);
|
entity.setPageable(true);
|
||||||
List<Roles> resultslist = null;
|
List<Groups> resultslist = null;
|
||||||
try {
|
try {
|
||||||
resultslist = getMapper().rolesNoMember(entity);
|
resultslist = getMapper().noMember(entity);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
_logger.error("queryPageResults Exception " , e);
|
_logger.error("queryPageResults Exception " , e);
|
||||||
}
|
}
|
||||||
@ -83,7 +83,7 @@ public class RoleMemberService extends JpaService<RoleMember>{
|
|||||||
totalCount = parseCount(getMapper().fetchPageResults(entity));
|
totalCount = parseCount(getMapper().fetchPageResults(entity));
|
||||||
}
|
}
|
||||||
|
|
||||||
return new JpaPageResults<Roles>(entity.getPageNumber(),entity.getPageSize(),totalPage,totalCount,resultslist);
|
return new JpaPageResults<Groups>(entity.getPageNumber(),entity.getPageSize(),totalPage,totalCount,resultslist);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -17,16 +17,16 @@
|
|||||||
|
|
||||||
package org.dromara.maxkey.persistence.service;
|
package org.dromara.maxkey.persistence.service;
|
||||||
|
|
||||||
import org.dromara.maxkey.entity.RolePermissions;
|
import org.dromara.maxkey.entity.GroupPermissions;
|
||||||
import org.dromara.maxkey.persistence.mapper.RolePermissionsMapper;
|
import org.dromara.maxkey.persistence.mapper.GroupPermissionsMapper;
|
||||||
import org.dromara.mybatis.jpa.JpaService;
|
import org.dromara.mybatis.jpa.JpaService;
|
||||||
import org.springframework.stereotype.Repository;
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
@Repository
|
@Repository
|
||||||
public class RolePermissionssService extends JpaService<RolePermissions>{
|
public class GroupPermissionssService extends JpaService<GroupPermissions>{
|
||||||
|
|
||||||
public RolePermissionssService() {
|
public GroupPermissionssService() {
|
||||||
super(RolePermissionsMapper.class);
|
super(GroupPermissionsMapper.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -35,8 +35,8 @@ public class RolePermissionssService extends JpaService<RolePermissions>{
|
|||||||
* @see com.connsec.db.service.BaseService#getMapper()
|
* @see com.connsec.db.service.BaseService#getMapper()
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public RolePermissionsMapper getMapper() {
|
public GroupPermissionsMapper getMapper() {
|
||||||
return (RolePermissionsMapper)super.getMapper();
|
return (GroupPermissionsMapper)super.getMapper();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -19,40 +19,40 @@ package org.dromara.maxkey.persistence.service;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.dromara.maxkey.entity.RolePrivileges;
|
import org.dromara.maxkey.entity.GroupPrivileges;
|
||||||
import org.dromara.maxkey.persistence.mapper.RolePrivilegesMapper;
|
import org.dromara.maxkey.persistence.mapper.GroupPrivilegesMapper;
|
||||||
import org.dromara.mybatis.jpa.JpaService;
|
import org.dromara.mybatis.jpa.JpaService;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.stereotype.Repository;
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
@Repository
|
@Repository
|
||||||
public class RolePrivilegesService extends JpaService<RolePrivileges>{
|
public class GroupPrivilegesService extends JpaService<GroupPrivileges>{
|
||||||
final static Logger _logger = LoggerFactory.getLogger(RolePrivilegesService.class);
|
final static Logger _logger = LoggerFactory.getLogger(GroupPrivilegesService.class);
|
||||||
|
|
||||||
|
|
||||||
public RolePrivilegesService() {
|
public GroupPrivilegesService() {
|
||||||
super(RolePrivilegesMapper.class);
|
super(GroupPrivilegesMapper.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see com.connsec.db.service.BaseService#getMapper()
|
* @see com.connsec.db.service.BaseService#getMapper()
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public RolePrivilegesMapper getMapper() {
|
public GroupPrivilegesMapper getMapper() {
|
||||||
return (RolePrivilegesMapper)super.getMapper();
|
return (GroupPrivilegesMapper)super.getMapper();
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean insertRolePrivileges(List<RolePrivileges> rolePermissionsList) {
|
public boolean insertGroupPrivileges(List<GroupPrivileges> rolePermissionsList) {
|
||||||
return getMapper().insertRolePrivileges(rolePermissionsList)>0;
|
return getMapper().insertGroupPrivileges(rolePermissionsList)>0;
|
||||||
};
|
};
|
||||||
|
|
||||||
public boolean deleteRolePrivileges(List<RolePrivileges> rolePermissionsList) {
|
public boolean deleteGroupPrivileges(List<GroupPrivileges> rolePermissionsList) {
|
||||||
return getMapper().deleteRolePrivileges(rolePermissionsList)>=0;
|
return getMapper().deleteGroupPrivileges(rolePermissionsList)>=0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<RolePrivileges> queryRolePrivileges(RolePrivileges rolePermissions){
|
public List<GroupPrivileges> queryGroupPrivileges(GroupPrivileges rolePermissions){
|
||||||
return getMapper().queryRolePrivileges(rolePermissions);
|
return getMapper().queryGroupPrivileges(rolePermissions);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -24,9 +24,10 @@ import java.time.LocalTime;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.dromara.maxkey.constants.ConstsStatus;
|
import org.dromara.maxkey.constants.ConstsStatus;
|
||||||
|
import org.dromara.maxkey.entity.Groups;
|
||||||
import org.dromara.maxkey.entity.Institutions;
|
import org.dromara.maxkey.entity.Institutions;
|
||||||
import org.dromara.maxkey.entity.Roles;
|
import org.dromara.maxkey.entity.Roles;
|
||||||
import org.dromara.maxkey.persistence.mapper.RolesMapper;
|
import org.dromara.maxkey.persistence.mapper.GroupsMapper;
|
||||||
import org.dromara.maxkey.util.StringUtils;
|
import org.dromara.maxkey.util.StringUtils;
|
||||||
import org.dromara.mybatis.jpa.JpaService;
|
import org.dromara.mybatis.jpa.JpaService;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
@ -37,57 +38,57 @@ import org.springframework.stereotype.Repository;
|
|||||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||||
|
|
||||||
@Repository
|
@Repository
|
||||||
public class RolesService extends JpaService<Roles> implements Serializable {
|
public class GroupsService extends JpaService<Groups> implements Serializable {
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
private static final long serialVersionUID = -4156671926199393550L;
|
private static final long serialVersionUID = -4156671926199393550L;
|
||||||
|
|
||||||
final static Logger _logger = LoggerFactory.getLogger(RolesService.class);
|
final static Logger _logger = LoggerFactory.getLogger(GroupsService.class);
|
||||||
@JsonIgnore
|
@JsonIgnore
|
||||||
@Autowired
|
@Autowired
|
||||||
RoleMemberService roleMemberService;
|
GroupMemberService service;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
InstitutionsService institutionsService;
|
InstitutionsService institutionsService;
|
||||||
|
|
||||||
public RolesService() {
|
public GroupsService() {
|
||||||
super(RolesMapper.class);
|
super(GroupsMapper.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see com.connsec.db.service.BaseService#getMapper()
|
* @see com.connsec.db.service.BaseService#getMapper()
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public RolesMapper getMapper() {
|
public GroupsMapper getMapper() {
|
||||||
return (RolesMapper)super.getMapper();
|
return (GroupsMapper)super.getMapper();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public List<Roles> queryDynamicRoles(Roles groups){
|
public List<Groups> queryDynamicRoles(Groups groups){
|
||||||
return this.getMapper().queryDynamicRoles(groups);
|
return this.getMapper().queryDynamic(groups);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean deleteById(String groupId) {
|
public boolean deleteById(String groupId) {
|
||||||
this.remove(groupId);
|
this.remove(groupId);
|
||||||
roleMemberService.deleteByRoleId(groupId);
|
service.deleteByGroupId(groupId);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<Roles> queryRolesByUserId(String userId){
|
public List<Groups> queryByUserId(String userId){
|
||||||
return this.getMapper().queryRolesByUserId(userId);
|
return this.getMapper().queryByUserId(userId);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void refreshDynamicRoles(Roles dynamicRole){
|
public void refreshDynamicRoles(Groups dynamicGroup){
|
||||||
if(dynamicRole.getCategory().equals(Roles.Category.DYNAMIC)) {
|
if(dynamicGroup.getCategory().equals(Roles.Category.DYNAMIC)) {
|
||||||
boolean isDynamicTimeSupport = false;
|
boolean isDynamicTimeSupport = false;
|
||||||
boolean isBetweenEffectiveTime = false;
|
boolean isBetweenEffectiveTime = false;
|
||||||
if(StringUtils.isNotBlank(dynamicRole.getResumeTime())
|
if(StringUtils.isNotBlank(dynamicGroup.getResumeTime())
|
||||||
&&StringUtils.isNotBlank(dynamicRole.getSuspendTime())
|
&&StringUtils.isNotBlank(dynamicGroup.getSuspendTime())
|
||||||
&&!dynamicRole.getSuspendTime().equals("00:00")) {
|
&&!dynamicGroup.getSuspendTime().equals("00:00")) {
|
||||||
LocalTime currentTime = LocalDateTime.now().toLocalTime();
|
LocalTime currentTime = LocalDateTime.now().toLocalTime();
|
||||||
LocalTime resumeTime = LocalTime.parse(dynamicRole.getResumeTime());
|
LocalTime resumeTime = LocalTime.parse(dynamicGroup.getResumeTime());
|
||||||
LocalTime suspendTime = LocalTime.parse(dynamicRole.getSuspendTime());
|
LocalTime suspendTime = LocalTime.parse(dynamicGroup.getSuspendTime());
|
||||||
|
|
||||||
_logger.info("currentTime: " + currentTime
|
_logger.info("currentTime: " + currentTime
|
||||||
+ " , resumeTime : " + resumeTime
|
+ " , resumeTime : " + resumeTime
|
||||||
@ -100,8 +101,8 @@ public class RolesService extends JpaService<Roles> implements Serializable {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(StringUtils.isNotBlank(dynamicRole.getOrgIdsList())) {
|
if(StringUtils.isNotBlank(dynamicGroup.getOrgIdsList())) {
|
||||||
String []orgIds = dynamicRole.getOrgIdsList().split(",");
|
String []orgIds = dynamicGroup.getOrgIdsList().split(",");
|
||||||
StringBuffer orgIdFilters = new StringBuffer();
|
StringBuffer orgIdFilters = new StringBuffer();
|
||||||
for(String orgId : orgIds) {
|
for(String orgId : orgIds) {
|
||||||
if(StringUtils.isNotBlank(orgId)) {
|
if(StringUtils.isNotBlank(orgId)) {
|
||||||
@ -112,11 +113,11 @@ public class RolesService extends JpaService<Roles> implements Serializable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(orgIdFilters.length() > 0) {
|
if(orgIdFilters.length() > 0) {
|
||||||
dynamicRole.setOrgIdsList(orgIdFilters.toString());
|
dynamicGroup.setOrgIdsList(orgIdFilters.toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
String filters = dynamicRole.getFilters();
|
String filters = dynamicGroup.getFilters();
|
||||||
if(StringUtils.isNotBlank(filters)) {
|
if(StringUtils.isNotBlank(filters)) {
|
||||||
if(StringUtils.filtersSQLInjection(filters.toLowerCase())) {
|
if(StringUtils.filtersSQLInjection(filters.toLowerCase())) {
|
||||||
_logger.info("filters include SQL Injection Attack Risk.");
|
_logger.info("filters include SQL Injection Attack Risk.");
|
||||||
@ -125,19 +126,19 @@ public class RolesService extends JpaService<Roles> implements Serializable {
|
|||||||
filters = filters.replace("&", " AND ");
|
filters = filters.replace("&", " AND ");
|
||||||
filters = filters.replace("|", " OR ");
|
filters = filters.replace("|", " OR ");
|
||||||
|
|
||||||
dynamicRole.setFilters(filters);
|
dynamicGroup.setFilters(filters);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(isDynamicTimeSupport) {
|
if(isDynamicTimeSupport) {
|
||||||
if(isBetweenEffectiveTime) {
|
if(isBetweenEffectiveTime) {
|
||||||
roleMemberService.deleteDynamicRoleMember(dynamicRole);
|
service.deleteDynamicMember(dynamicGroup);
|
||||||
roleMemberService.addDynamicRoleMember(dynamicRole);
|
service.addDynamicMember(dynamicGroup);
|
||||||
}else {
|
}else {
|
||||||
roleMemberService.deleteDynamicRoleMember(dynamicRole);
|
service.deleteDynamicMember(dynamicGroup);
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
roleMemberService.deleteDynamicRoleMember(dynamicRole);
|
service.deleteDynamicMember(dynamicGroup);
|
||||||
roleMemberService.addDynamicRoleMember(dynamicRole);
|
service.addDynamicMember(dynamicGroup);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -146,12 +147,12 @@ public class RolesService extends JpaService<Roles> implements Serializable {
|
|||||||
List<Institutions> instList =
|
List<Institutions> instList =
|
||||||
institutionsService.find("where status = ? ", new Object[]{ConstsStatus.ACTIVE}, new int[]{Types.INTEGER});
|
institutionsService.find("where status = ? ", new Object[]{ConstsStatus.ACTIVE}, new int[]{Types.INTEGER});
|
||||||
for(Institutions inst : instList) {
|
for(Institutions inst : instList) {
|
||||||
Roles role = new Roles();
|
Groups group = new Groups();
|
||||||
role.setInstId(inst.getId());
|
group.setInstId(inst.getId());
|
||||||
List<Roles> rolesList = queryDynamicRoles(role);
|
List<Groups> groupsList = queryDynamicRoles(group);
|
||||||
for(Roles r : rolesList) {
|
for(Groups g : groupsList) {
|
||||||
_logger.debug("role " + rolesList);
|
_logger.debug("role {}" , g);
|
||||||
refreshDynamicRoles(r);
|
refreshDynamicRoles(g);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -23,8 +23,8 @@ import org.dromara.maxkey.entity.HistorySystemLogs;
|
|||||||
import org.dromara.maxkey.entity.Organizations;
|
import org.dromara.maxkey.entity.Organizations;
|
||||||
import org.dromara.maxkey.entity.Resources;
|
import org.dromara.maxkey.entity.Resources;
|
||||||
import org.dromara.maxkey.entity.RoleMember;
|
import org.dromara.maxkey.entity.RoleMember;
|
||||||
import org.dromara.maxkey.entity.RolePermissions;
|
import org.dromara.maxkey.entity.GroupPermissions;
|
||||||
import org.dromara.maxkey.entity.RolePrivileges;
|
import org.dromara.maxkey.entity.GroupPrivileges;
|
||||||
import org.dromara.maxkey.entity.Roles;
|
import org.dromara.maxkey.entity.Roles;
|
||||||
import org.dromara.maxkey.entity.SocialsProvider;
|
import org.dromara.maxkey.entity.SocialsProvider;
|
||||||
import org.dromara.maxkey.entity.Synchronizers;
|
import org.dromara.maxkey.entity.Synchronizers;
|
||||||
@ -68,16 +68,16 @@ public class HistorySystemLogsService extends JpaService<HistorySystemLogs>{
|
|||||||
message = buildMsg((Roles)entity);
|
message = buildMsg((Roles)entity);
|
||||||
}else if(entity instanceof RoleMember) {
|
}else if(entity instanceof RoleMember) {
|
||||||
message = buildMsg((RoleMember)entity);
|
message = buildMsg((RoleMember)entity);
|
||||||
}else if(entity instanceof RolePermissions) {
|
}else if(entity instanceof GroupPermissions) {
|
||||||
message = buildMsg((RolePermissions)entity);
|
message = buildMsg((GroupPermissions)entity);
|
||||||
}else if(entity instanceof Resources) {
|
}else if(entity instanceof Resources) {
|
||||||
message = buildMsg((Resources)entity);
|
message = buildMsg((Resources)entity);
|
||||||
}else if(entity instanceof Synchronizers) {
|
}else if(entity instanceof Synchronizers) {
|
||||||
message = buildMsg((Synchronizers)entity);
|
message = buildMsg((Synchronizers)entity);
|
||||||
}else if(entity instanceof SocialsProvider) {
|
}else if(entity instanceof SocialsProvider) {
|
||||||
message = buildMsg((SocialsProvider)entity);
|
message = buildMsg((SocialsProvider)entity);
|
||||||
}else if(entity instanceof RolePrivileges) {
|
}else if(entity instanceof GroupPrivileges) {
|
||||||
message = buildMsg((RolePrivileges)entity);
|
message = buildMsg((GroupPrivileges)entity);
|
||||||
}else if(entity instanceof String) {
|
}else if(entity instanceof String) {
|
||||||
message = entity.toString();
|
message = entity.toString();
|
||||||
}
|
}
|
||||||
@ -157,18 +157,18 @@ public class HistorySystemLogsService extends JpaService<HistorySystemLogs>{
|
|||||||
.toString();
|
.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
public String buildMsg(RolePermissions permission) {
|
public String buildMsg(GroupPermissions permission) {
|
||||||
return new StringBuilder()
|
return new StringBuilder()
|
||||||
.append(permission.getRoleName())
|
.append(permission.getGroupName())
|
||||||
.append("[")
|
.append("[")
|
||||||
.append(permission.getAppName())
|
.append(permission.getAppName())
|
||||||
.append("]")
|
.append("]")
|
||||||
.toString();
|
.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
public String buildMsg(RolePrivileges privilege) {
|
public String buildMsg(GroupPrivileges privilege) {
|
||||||
return new StringBuilder()
|
return new StringBuilder()
|
||||||
.append(privilege.getRoleId())
|
.append(privilege.getGroupId())
|
||||||
.append("[")
|
.append("[")
|
||||||
.append(privilege.getResourceId())
|
.append(privilege.getResourceId())
|
||||||
.append("]")
|
.append("]")
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="org.dromara.maxkey.persistence.mapper.RoleMemberMapper">
|
<mapper namespace="org.dromara.maxkey.persistence.mapper.GroupMemberMapper">
|
||||||
|
|
||||||
<sql id="where_statement">
|
<sql id="where_statement">
|
||||||
<if test="id != null and id != ''">
|
<if test="id != null and id != ''">
|
||||||
@ -11,12 +11,12 @@
|
|||||||
</if>
|
</if>
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<select id="memberInRole" parameterType="RoleMember" resultType="RoleMember">
|
<select id="memberIn" parameterType="GroupMember" resultType="GroupMember">
|
||||||
select distinct
|
select distinct
|
||||||
rm.id as id,
|
gm.id as id,
|
||||||
r.id as roleid,
|
g.id as groupid,
|
||||||
r.rolename,
|
g.groupname,
|
||||||
r.category category,
|
g.category category,
|
||||||
u.username,
|
u.username,
|
||||||
u.usertype,
|
u.usertype,
|
||||||
u.windowsaccount,
|
u.windowsaccount,
|
||||||
@ -46,22 +46,22 @@
|
|||||||
u.jobtitle,
|
u.jobtitle,
|
||||||
u.joblevel,
|
u.joblevel,
|
||||||
|
|
||||||
rm.createddate,
|
gm.createddate,
|
||||||
|
|
||||||
u.status
|
u.status
|
||||||
from
|
from
|
||||||
mxk_userinfo u,
|
mxk_userinfo u,
|
||||||
mxk_roles r,
|
mxk_groups g,
|
||||||
mxk_role_member rm
|
mxk_group_member gm
|
||||||
where u.instid = #{instId}
|
where u.instid = #{instId}
|
||||||
and r.instid = #{instId}
|
and g.instid = #{instId}
|
||||||
and rm.instid = #{instId}
|
and gm.instid = #{instId}
|
||||||
<if test="roleId != null and roleId != ''">
|
<if test="groupId != null and groupId != ''">
|
||||||
and rm.roleid = #{roleId}
|
and gm.groupid = #{groupId}
|
||||||
and r.id = #{roleId}
|
and g.id = #{groupId}
|
||||||
</if>
|
</if>
|
||||||
<if test="roleName != null and roleName != ''">
|
<if test="groupName != null and groupName != ''">
|
||||||
and r.rolename = #{roleName}
|
and g.groupname = #{groupName}
|
||||||
</if>
|
</if>
|
||||||
<if test="username != null and username != ''">
|
<if test="username != null and username != ''">
|
||||||
and u.username = #{username}
|
and u.username = #{username}
|
||||||
@ -69,13 +69,13 @@
|
|||||||
<if test="displayName != null and displayName != ''">
|
<if test="displayName != null and displayName != ''">
|
||||||
and u.displayname like '%${displayName}%'
|
and u.displayname like '%${displayName}%'
|
||||||
</if>
|
</if>
|
||||||
and rm.type in( 'USER','USER-DYNAMIC')
|
and gm.type in( 'USER','USER-DYNAMIC')
|
||||||
and rm.roleid = r.id
|
and gm.groupid = g.id
|
||||||
and rm.memberid = u.id
|
and gm.memberid = u.id
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
||||||
<select id="memberNotInRole" parameterType="RoleMember" resultType="RoleMember">
|
<select id="memberNotIn" parameterType="GroupMember" resultType="GroupMember">
|
||||||
select distinct
|
select distinct
|
||||||
u.id,
|
u.id,
|
||||||
u.username,
|
u.username,
|
||||||
@ -119,17 +119,17 @@
|
|||||||
where
|
where
|
||||||
u.id not in(
|
u.id not in(
|
||||||
select rm.memberid
|
select rm.memberid
|
||||||
from mxk_roles r,mxk_role_member rm
|
from mxk_groups g,mxk_group_member gm
|
||||||
where 1 = 1
|
where 1 = 1
|
||||||
<if test="roleId != null and roleId != ''">
|
<if test="groupId != null and groupId != ''">
|
||||||
and rm.roleid = #{roleId}
|
and gm.groupid = #{groupId}
|
||||||
and r.id = #{roleId}
|
and g.id = #{groupId}
|
||||||
</if>
|
</if>
|
||||||
<if test="roleName != null and roleName != ''">
|
<if test="groupName != null and groupName != ''">
|
||||||
and r.rolename = #{roleName}
|
and g.groupname = #{groupName}
|
||||||
</if>
|
</if>
|
||||||
and rm.type in( 'USER','USER-DYNAMIC')
|
and gm.type in( 'USER','USER-DYNAMIC')
|
||||||
and rm.roleid = r.id
|
and gm.groupid = g.id
|
||||||
)
|
)
|
||||||
<if test="username != null and username != ''">
|
<if test="username != null and username != ''">
|
||||||
and u.username = #{username}
|
and u.username = #{username}
|
||||||
@ -139,71 +139,71 @@
|
|||||||
</if>
|
</if>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="rolesNoMember" parameterType="RoleMember" resultType="Roles">
|
<select id="noMember" parameterType="GroupMember" resultType="Groups">
|
||||||
select distinct
|
select distinct
|
||||||
r.*
|
g.*
|
||||||
from
|
from
|
||||||
mxk_roles r
|
mxk_groups g
|
||||||
where
|
where
|
||||||
r.id not in(
|
g.id not in(
|
||||||
select
|
select
|
||||||
rm.roleid
|
gm.groupid
|
||||||
from mxk_role_member rm,mxk_userinfo u
|
from mxk_group_member gm,mxk_userinfo u
|
||||||
where rm.memberid = u.id
|
where gm.memberid = u.id
|
||||||
<if test="username != null and username != ''">
|
<if test="username != null and username != ''">
|
||||||
and u.username = #{username}
|
and u.username = #{username}
|
||||||
</if>
|
</if>
|
||||||
<if test="memberId != null and memberId != ''">
|
<if test="memberId != null and memberId != ''">
|
||||||
and rm.memberid = #{memberid}
|
and gm.memberid = #{memberid}
|
||||||
</if>
|
</if>
|
||||||
)
|
)
|
||||||
<if test="roleName != null and roleName != ''">
|
<if test="groupName != null and groupName != ''">
|
||||||
and r.rolename = #{roleName}
|
and g.groupname = #{groupName}
|
||||||
</if>
|
</if>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<!-- ROLE_MEMBER ROLE Member-->
|
<!-- ROLE_MEMBER ROLE Member-->
|
||||||
<select id="roleMemberInRole" parameterType="RoleMember" resultType="Roles">
|
<select id="groupMemberInGroup" parameterType="GroupMember" resultType="Groups">
|
||||||
select distinct
|
select distinct
|
||||||
ig.*
|
ig.*
|
||||||
from
|
from
|
||||||
mxk_roles ir,
|
mxk_groups ig,
|
||||||
mxk_roles r,
|
mxk_groups g,
|
||||||
mxk_role_member rm
|
mxk_group_member gm
|
||||||
where
|
where
|
||||||
1 = 1
|
1 = 1
|
||||||
and rm.roleid = g.id
|
and gm.groupid = g.id
|
||||||
and rm.memberid = ig.id
|
and gm.memberid = ig.id
|
||||||
and rm.type = 'ROLE'
|
and gm.type = 'ROLE'
|
||||||
<if test="roleId != null and roleId != ''">
|
<if test="groupId != null and groupId != ''">
|
||||||
and rm.roleid = #{roleId}
|
and gm.groupid = #{groupId}
|
||||||
and r.id = #{roleId}
|
and g.id = #{groupId}
|
||||||
</if>
|
</if>
|
||||||
<if test="roleName != null and roleName != ''">
|
<if test="groupName != null and groupName != ''">
|
||||||
and r.rolename = #{roleName}
|
and g.groupname = #{groupName}
|
||||||
</if>
|
</if>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<update id="addDynamicRoleMember" parameterType="Roles" >
|
<update id="addDynamicGroupMember" parameterType="Groups" >
|
||||||
insert into mxk_role_member(
|
insert into mxk_group_member(
|
||||||
id,
|
id,
|
||||||
roleid,
|
groupid,
|
||||||
memberid,
|
memberid,
|
||||||
type,
|
type,
|
||||||
instid
|
instid
|
||||||
)
|
)
|
||||||
select
|
select
|
||||||
concat('${id}_',u.id) id,
|
concat('${id}_',u.id) id,
|
||||||
'${id}' roleid,
|
'${id}' groupid,
|
||||||
u.id memberid,
|
u.id memberid,
|
||||||
'USER-DYNAMIC' type,
|
'USER-DYNAMIC' type,
|
||||||
'${instId}' instid
|
'${instId}' instid
|
||||||
from mxk_userinfo u
|
from mxk_userinfo u
|
||||||
where not exists(
|
where not exists(
|
||||||
select 1 from mxk_role_member rm
|
select 1 from mxk_group_member gm
|
||||||
where rm.roleid=#{id}
|
where gm.groupid=#{id}
|
||||||
and rm.memberid=u.id
|
and gm.memberid=u.id
|
||||||
and rm.type='USER-DYNAMIC'
|
and gm.type='USER-DYNAMIC'
|
||||||
)
|
)
|
||||||
<if test="filters != null and filters != ''">
|
<if test="filters != null and filters != ''">
|
||||||
and (${filters})
|
and (${filters})
|
||||||
@ -213,15 +213,15 @@
|
|||||||
</if>
|
</if>
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
<delete id="deleteDynamicRoleMember" parameterType="Roles" >
|
<delete id="deleteDynamicGroupMember" parameterType="Groups" >
|
||||||
delete from mxk_role_member rm
|
delete from mxk_group_member gm
|
||||||
where type = 'user-dynamic'
|
where type = 'user-dynamic'
|
||||||
and rm.roleid=#{id}
|
and gm.groupid=#{id}
|
||||||
and not exists(
|
and not exists(
|
||||||
select 1
|
select 1
|
||||||
from mxk_userinfo u
|
from mxk_userinfo u
|
||||||
where 1 = 1
|
where 1 = 1
|
||||||
and u.id=rm.memberid
|
and u.id=gm.memberid
|
||||||
<if test="filters != null and filters != ''">
|
<if test="filters != null and filters != ''">
|
||||||
and (${filters})
|
and (${filters})
|
||||||
</if>
|
</if>
|
||||||
@ -231,10 +231,10 @@
|
|||||||
)
|
)
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
<select id="queryMemberByRoleId" parameterType="string" resultType="UserInfo">
|
<select id="queryMemberByGroupId" parameterType="string" resultType="UserInfo">
|
||||||
select distinct
|
select distinct
|
||||||
r.roleId,
|
g.groupId,
|
||||||
r.roleName,
|
g.groupName,
|
||||||
u.id,
|
u.id,
|
||||||
u.username,
|
u.username,
|
||||||
u.usertype,
|
u.usertype,
|
||||||
@ -264,24 +264,24 @@
|
|||||||
u.department,
|
u.department,
|
||||||
u.jobtitle,
|
u.jobtitle,
|
||||||
u.joblevel,
|
u.joblevel,
|
||||||
rm.createddate,
|
gm.createddate,
|
||||||
u.status
|
u.status
|
||||||
from
|
from
|
||||||
mxk_userinfo u,
|
mxk_userinfo u,
|
||||||
mxk_roles r,
|
mxk_groups g,
|
||||||
mxk_role_member rm
|
mxk_group_member gm
|
||||||
where 1 = 1
|
where 1 = 1
|
||||||
and rm.roleid = #{value}
|
and gm.groupid = #{value}
|
||||||
and g.id = #{value}
|
and g.id = #{value}
|
||||||
and rm.type in( 'USER','USER-DYNAMIC')
|
and gm.type in( 'USER','USER-DYNAMIC')
|
||||||
and rm.roleid = r.id
|
and gm.groupid = g.id
|
||||||
and rm.memberid = u.id
|
and gm.memberid = u.id
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
||||||
<delete id="deleteByRoleId" parameterType="string" >
|
<delete id="deleteByGroupId" parameterType="string" >
|
||||||
delete from mxk_role_member rm
|
delete from mxk_group_member gm
|
||||||
where rm.roleid = #{value} and roleId != 'ROLE_ALL_USER'
|
where gm.groupid = #{value} and groupId != 'ROLE_ALL_USER'
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="org.dromara.maxkey.persistence.mapper.RolePermissionsMapper" >
|
<mapper namespace="org.dromara.maxkey.persistence.mapper.GroupPermissionsMapper" >
|
||||||
|
|
||||||
<sql id="where_statement">
|
<sql id="where_statement">
|
||||||
<if test="id != null and id != ''">
|
<if test="id != null and id != ''">
|
||||||
@ -18,11 +18,11 @@
|
|||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<!-- AppGroup -->
|
<!-- AppGroup -->
|
||||||
<select id="appsInRole" parameterType="RolePermissions" resultType="RolePermissions">
|
<select id="appsInGroup" parameterType="GroupPermissions" resultType="GroupPermissions">
|
||||||
select
|
select
|
||||||
p.id,
|
p.id,
|
||||||
p.roleid,
|
p.groupid,
|
||||||
r.rolename,
|
r.groupname,
|
||||||
apps.id appid,
|
apps.id appid,
|
||||||
apps.appname,
|
apps.appname,
|
||||||
apps.icon,
|
apps.icon,
|
||||||
@ -34,22 +34,22 @@
|
|||||||
apps.vendorurl
|
apps.vendorurl
|
||||||
from
|
from
|
||||||
mxk_apps apps,
|
mxk_apps apps,
|
||||||
mxk_role_permissions p,
|
mxk_group_permissions p,
|
||||||
mxk_roles r
|
mxk_groups r
|
||||||
where
|
where
|
||||||
apps.instid = #{instId}
|
apps.instid = #{instId}
|
||||||
and p.instid = #{instId}
|
and p.instid = #{instId}
|
||||||
and r.instid = #{instId}
|
and r.instid = #{instId}
|
||||||
and p.appid = apps.id
|
and p.appid = apps.id
|
||||||
and p.roleid = r.id
|
and p.groupid = r.id
|
||||||
<if test="roleId != null and roleId != ''">
|
<if test="groupId != null and groupId != ''">
|
||||||
and p.roleid = #{roleId}
|
and p.groupid = #{groupId}
|
||||||
and r.id = #{roleId}
|
and r.id = #{groupId}
|
||||||
</if>
|
</if>
|
||||||
<include refid="where_statement"/>
|
<include refid="where_statement"/>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="appsNotInRole" parameterType="RolePermissions" resultType="RolePermissions">
|
<select id="appsNotInGroup" parameterType="GroupPermissions" resultType="GroupPermissions">
|
||||||
select
|
select
|
||||||
*
|
*
|
||||||
from
|
from
|
||||||
@ -60,9 +60,9 @@
|
|||||||
select
|
select
|
||||||
appid
|
appid
|
||||||
from
|
from
|
||||||
mxk_role_permissions
|
mxk_group_permissions
|
||||||
where
|
where
|
||||||
roleid = #{roleId}
|
groupid = #{groupId}
|
||||||
)
|
)
|
||||||
<include refid="where_statement"/>
|
<include refid="where_statement"/>
|
||||||
</select>
|
</select>
|
||||||
@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="org.dromara.maxkey.persistence.mapper.RolePrivilegesMapper">
|
<mapper namespace="org.dromara.maxkey.persistence.mapper.GroupPrivilegesMapper">
|
||||||
|
|
||||||
<sql id="where_statement">
|
<sql id="where_statement">
|
||||||
<if test="id != null and id != ''">
|
<if test="id != null and id != ''">
|
||||||
@ -11,18 +11,18 @@
|
|||||||
</if>
|
</if>
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<select id="queryRolePrivileges" parameterType="RolePrivileges" resultType="RolePrivileges">
|
<select id="queryGroupPrivileges" parameterType="GroupPrivileges" resultType="GroupPrivileges">
|
||||||
select
|
select
|
||||||
*
|
*
|
||||||
from
|
from
|
||||||
mxk_role_privileges
|
mxk_group_privileges
|
||||||
where instid = #{instId}
|
where instid = #{instId}
|
||||||
and status = 1
|
and status = 1
|
||||||
<if test="id != null and id != ''">
|
<if test="id != null and id != ''">
|
||||||
and id = #{id}
|
and id = #{id}
|
||||||
</if>
|
</if>
|
||||||
<if test="roleId != null and roleId != ''">
|
<if test="groupId != null and groupId != ''">
|
||||||
and roleid = #{roleId}
|
and groupid = #{groupId}
|
||||||
</if>
|
</if>
|
||||||
<if test="appId != null and appId != ''">
|
<if test="appId != null and appId != ''">
|
||||||
and appid = #{appId}
|
and appid = #{appId}
|
||||||
@ -30,8 +30,8 @@
|
|||||||
|
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<update id="deleteRolePrivileges" parameterType="java.util.List">
|
<update id="deleteGroupPrivileges" parameterType="java.util.List">
|
||||||
update mxk_role_privileges
|
update mxk_group_privileges
|
||||||
set status = 9
|
set status = 9
|
||||||
where 1 = 1 and
|
where 1 = 1 and
|
||||||
<foreach item="item" collection="list" open="(" separator="or" close=")">
|
<foreach item="item" collection="list" open="(" separator="or" close=")">
|
||||||
@ -39,11 +39,11 @@
|
|||||||
</foreach>
|
</foreach>
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
<insert id="insertRolePrivileges" parameterType="java.util.List">
|
<insert id="insertGroupPrivileges" parameterType="java.util.List">
|
||||||
insert into mxk_role_privileges ( id,appid,roleid,resourceid,status,instid)
|
insert into mxk_role_privileges ( id,appid,groupid,resourceid,status,instid)
|
||||||
values
|
values
|
||||||
<foreach collection="list" item="item" index="index" separator=",">
|
<foreach collection="list" item="item" index="index" separator=",">
|
||||||
(#{item.id},#{item.appId},#{item.roleId},#{item.resourceId},#{item.status},#{item.instId})
|
(#{item.id},#{item.appId},#{item.groupId},#{item.resourceId},#{item.status},#{item.instId})
|
||||||
</foreach>
|
</foreach>
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
@ -1,53 +1,53 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="org.dromara.maxkey.persistence.mapper.RolesMapper">
|
<mapper namespace="org.dromara.maxkey.persistence.mapper.GroupsMapper">
|
||||||
|
|
||||||
<sql id="where_statement">
|
<sql id="where_statement">
|
||||||
<if test="id != null and id != ''">
|
<if test="id != null and id != ''">
|
||||||
and id = #{id}
|
and id = #{id}
|
||||||
</if>
|
</if>
|
||||||
<if test="roleName != null and roleName != ''">
|
<if test="groupName != null and groupName != ''">
|
||||||
and rolename like '%${roleName}%'
|
and groupname like '%${groupName}%'
|
||||||
</if>
|
</if>
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<select id="fetchPageResults" parameterType="Roles" resultType="Roles">
|
<select id="fetchPageResults" parameterType="Groups" resultType="Groups">
|
||||||
select
|
select
|
||||||
*
|
*
|
||||||
from
|
from
|
||||||
mxk_roles
|
mxk_groups
|
||||||
where instid = #{instId}
|
where instid = #{instId}
|
||||||
<include refid="where_statement"/>
|
<include refid="where_statement"/>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="queryDynamicRoles" parameterType="Roles" resultType="Roles">
|
<select id="queryDynamicRoles" parameterType="Groups" resultType="Groups">
|
||||||
select
|
select
|
||||||
*
|
*
|
||||||
from
|
from
|
||||||
mxk_roles
|
mxk_groups
|
||||||
where instid = #{instId}
|
where instid = #{instId}
|
||||||
and category = 'dynamic'
|
and category = 'dynamic'
|
||||||
<include refid="where_statement"/>
|
<include refid="where_statement"/>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
||||||
<update id="logisticDelete" parameterType="Roles" >
|
<update id="logisticDelete" parameterType="Groups" >
|
||||||
update mxk_roles set
|
update mxk_groups set
|
||||||
status = '2'
|
status = '2'
|
||||||
where instid = #{instId}
|
where instid = #{instId}
|
||||||
<if test="id != null">
|
<if test="id != null">
|
||||||
and id = #{id}
|
and id = #{id}
|
||||||
</if>
|
</if>
|
||||||
<if test="roleName != roleName">
|
<if test="groupName != groupName">
|
||||||
and rolename = #{roleName}
|
and groupname = #{groupName}
|
||||||
</if>
|
</if>
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
|
|
||||||
<update id="logisticBatchDelete" parameterType="java.util.List">
|
<update id="logisticBatchDelete" parameterType="java.util.List">
|
||||||
update mxk_roles
|
update mxk_groups
|
||||||
set status='2'
|
set status='2'
|
||||||
where instid = #{instId}
|
where instid = #{instId}
|
||||||
and id in
|
and id in
|
||||||
@ -59,19 +59,19 @@
|
|||||||
|
|
||||||
<select id="queryRolesByUserId" parameterType="string" resultType="Roles">
|
<select id="queryRolesByUserId" parameterType="string" resultType="Roles">
|
||||||
select distinct
|
select distinct
|
||||||
r.*
|
g.*
|
||||||
from
|
from
|
||||||
mxk_userinfo u,
|
mxk_userinfo u,
|
||||||
mxk_roles r,
|
mxk_groups g,
|
||||||
mxk_role_member rm
|
mxk_group_member gm
|
||||||
where u.instid = #{instId}
|
where u.instid = #{instId}
|
||||||
and r.instid = #{instId}
|
and g.instid = #{instId}
|
||||||
and rm.instid = #{instId}
|
and gm.instid = #{instId}
|
||||||
and rm.memberid = #{value}
|
and gm.memberid = #{value}
|
||||||
and u.id = #{value}
|
and u.id = #{value}
|
||||||
and rm.type in( 'USER','USER-DYNAMIC')
|
and gm.type in( 'USER','USER-DYNAMIC')
|
||||||
and rm.groupid = r.id
|
and gm.groupid = g.id
|
||||||
and rm.memberid = u.id
|
and gm.memberid = u.id
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
||||||
@ -23,10 +23,10 @@ import java.util.HashSet;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import org.dromara.maxkey.entity.Roles;
|
import org.dromara.maxkey.entity.Groups;
|
||||||
import org.dromara.maxkey.entity.UserInfo;
|
import org.dromara.maxkey.entity.UserInfo;
|
||||||
import org.dromara.maxkey.persistence.service.RoleMemberService;
|
import org.dromara.maxkey.persistence.service.GroupMemberService;
|
||||||
import org.dromara.maxkey.persistence.service.RolesService;
|
import org.dromara.maxkey.persistence.service.GroupsService;
|
||||||
import org.dromara.maxkey.util.DateUtils;
|
import org.dromara.maxkey.util.DateUtils;
|
||||||
import org.dromara.maxkey.util.StringUtils;
|
import org.dromara.maxkey.util.StringUtils;
|
||||||
import org.dromara.maxkey.web.apis.identity.scim.resources.ScimGroup;
|
import org.dromara.maxkey.web.apis.identity.scim.resources.ScimGroup;
|
||||||
@ -56,18 +56,18 @@ public class ScimGroupController {
|
|||||||
final static Logger _logger = LoggerFactory.getLogger(ScimGroupController.class);
|
final static Logger _logger = LoggerFactory.getLogger(ScimGroupController.class);
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
RolesService rolesService;
|
GroupsService groupsService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
RoleMemberService roleMemberService;
|
GroupMemberService groupMemberService;
|
||||||
|
|
||||||
@RequestMapping(value = "/{id}", method = RequestMethod.GET)
|
@RequestMapping(value = "/{id}", method = RequestMethod.GET)
|
||||||
public MappingJacksonValue get(@PathVariable String id,
|
public MappingJacksonValue get(@PathVariable String id,
|
||||||
@RequestParam(required = false) String attributes) {
|
@RequestParam(required = false) String attributes) {
|
||||||
_logger.debug("ScimGroup id {} , attributes {}", id , attributes);
|
_logger.debug("ScimGroup id {} , attributes {}", id , attributes);
|
||||||
Roles role = rolesService.get(id);
|
Groups group = groupsService.get(id);
|
||||||
ScimGroup scimGroup = role2ScimGroup(role);
|
ScimGroup scimGroup = group2ScimGroup(group);
|
||||||
List<UserInfo> userList = roleMemberService.queryMemberByRoleId(id);
|
List<UserInfo> userList = groupMemberService.queryMemberByGroupId(id);
|
||||||
if(userList != null && userList.size() > 0) {
|
if(userList != null && userList.size() > 0) {
|
||||||
Set<ScimMemberRef> members = new HashSet<ScimMemberRef>();
|
Set<ScimMemberRef> members = new HashSet<ScimMemberRef>();
|
||||||
for (UserInfo user : userList) {
|
for (UserInfo user : userList) {
|
||||||
@ -83,9 +83,9 @@ public class ScimGroupController {
|
|||||||
@RequestParam(required = false) String attributes,
|
@RequestParam(required = false) String attributes,
|
||||||
UriComponentsBuilder builder) throws IOException {
|
UriComponentsBuilder builder) throws IOException {
|
||||||
_logger.debug("ScimGroup content {} , attributes {}", scimGroup , attributes);
|
_logger.debug("ScimGroup content {} , attributes {}", scimGroup , attributes);
|
||||||
Roles role =scimGroup2Role(scimGroup);
|
Groups group =scimGroup2Role(scimGroup);
|
||||||
rolesService.insert(role);
|
groupsService.insert(group);
|
||||||
return get(role.getId(),attributes);
|
return get(group.getId(),attributes);
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = "/{id}", method = RequestMethod.PUT)
|
@RequestMapping(value = "/{id}", method = RequestMethod.PUT)
|
||||||
@ -94,16 +94,16 @@ public class ScimGroupController {
|
|||||||
@RequestParam(required = false) String attributes)
|
@RequestParam(required = false) String attributes)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
_logger.debug("ScimGroup content {} , attributes {}", scimGroup , attributes);
|
_logger.debug("ScimGroup content {} , attributes {}", scimGroup , attributes);
|
||||||
Roles role =scimGroup2Role(scimGroup);
|
Groups group =scimGroup2Role(scimGroup);
|
||||||
rolesService.update(role);
|
groupsService.update(group);
|
||||||
return get(role.getId(),attributes);
|
return get(group.getId(),attributes);
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = "/{id}", method = RequestMethod.DELETE)
|
@RequestMapping(value = "/{id}", method = RequestMethod.DELETE)
|
||||||
@ResponseStatus(HttpStatus.OK)
|
@ResponseStatus(HttpStatus.OK)
|
||||||
public void delete(@PathVariable final String id) {
|
public void delete(@PathVariable final String id) {
|
||||||
_logger.debug("ScimGroup id {} " , id);
|
_logger.debug("ScimGroup id {} " , id);
|
||||||
rolesService.remove(id);
|
groupsService.remove(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(method = RequestMethod.GET)
|
@RequestMapping(method = RequestMethod.GET)
|
||||||
@ -115,14 +115,14 @@ public class ScimGroupController {
|
|||||||
public MappingJacksonValue searchWithPost(@ModelAttribute ScimParameters requestParameters) {
|
public MappingJacksonValue searchWithPost(@ModelAttribute ScimParameters requestParameters) {
|
||||||
requestParameters.parse();
|
requestParameters.parse();
|
||||||
_logger.debug("requestParameters {} ",requestParameters);
|
_logger.debug("requestParameters {} ",requestParameters);
|
||||||
Roles queryModel = new Roles();
|
Groups queryModel = new Groups();
|
||||||
queryModel.setPageSize(requestParameters.getCount());
|
queryModel.setPageSize(requestParameters.getCount());
|
||||||
queryModel.calculate(requestParameters.getStartIndex());
|
queryModel.calculate(requestParameters.getStartIndex());
|
||||||
|
|
||||||
JpaPageResults<Roles> orgResults = rolesService.fetchPageResults(queryModel);
|
JpaPageResults<Groups> orgResults = groupsService.fetchPageResults(queryModel);
|
||||||
List<ScimGroup> resultList = new ArrayList<ScimGroup>();
|
List<ScimGroup> resultList = new ArrayList<ScimGroup>();
|
||||||
for(Roles group : orgResults.getRows()) {
|
for(Groups group : orgResults.getRows()) {
|
||||||
resultList.add(role2ScimGroup(group));
|
resultList.add(group2ScimGroup(group));
|
||||||
}
|
}
|
||||||
ScimSearchResult<ScimGroup> scimSearchResult =
|
ScimSearchResult<ScimGroup> scimSearchResult =
|
||||||
new ScimSearchResult<ScimGroup>(
|
new ScimSearchResult<ScimGroup>(
|
||||||
@ -133,11 +133,11 @@ public class ScimGroupController {
|
|||||||
return new MappingJacksonValue(scimSearchResult);
|
return new MappingJacksonValue(scimSearchResult);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ScimGroup role2ScimGroup(Roles group) {
|
public ScimGroup group2ScimGroup(Groups group) {
|
||||||
ScimGroup scimGroup = new ScimGroup();
|
ScimGroup scimGroup = new ScimGroup();
|
||||||
scimGroup.setId(group.getId());
|
scimGroup.setId(group.getId());
|
||||||
scimGroup.setExternalId(group.getId());
|
scimGroup.setExternalId(group.getId());
|
||||||
scimGroup.setDisplayName(group.getRoleName());
|
scimGroup.setDisplayName(group.getGroupName());
|
||||||
|
|
||||||
ScimMeta meta = new ScimMeta("Group");
|
ScimMeta meta = new ScimMeta("Group");
|
||||||
if(StringUtils.isNotBlank(group.getCreatedDate())){
|
if(StringUtils.isNotBlank(group.getCreatedDate())){
|
||||||
@ -153,10 +153,10 @@ public class ScimGroupController {
|
|||||||
return scimGroup;
|
return scimGroup;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Roles scimGroup2Role(ScimGroup scimGroup) {
|
public Groups scimGroup2Role(ScimGroup scimGroup) {
|
||||||
Roles role = new Roles();
|
Groups group = new Groups();
|
||||||
role.setId(scimGroup.getId());
|
group.setId(scimGroup.getId());
|
||||||
role.setRoleName(scimGroup.getDisplayName());
|
group.setGroupName(scimGroup.getDisplayName());
|
||||||
return role;
|
return group;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -21,9 +21,9 @@ import java.io.IOException;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import org.dromara.maxkey.constants.ConstsStatus;
|
import org.dromara.maxkey.constants.ConstsStatus;
|
||||||
import org.dromara.maxkey.entity.Roles;
|
import org.dromara.maxkey.entity.Groups;
|
||||||
import org.dromara.maxkey.entity.UserInfo;
|
import org.dromara.maxkey.entity.UserInfo;
|
||||||
import org.dromara.maxkey.persistence.service.RolesService;
|
import org.dromara.maxkey.persistence.service.GroupsService;
|
||||||
import org.dromara.maxkey.persistence.service.UserInfoService;
|
import org.dromara.maxkey.persistence.service.UserInfoService;
|
||||||
import org.dromara.maxkey.util.DateUtils;
|
import org.dromara.maxkey.util.DateUtils;
|
||||||
import org.dromara.maxkey.util.StringUtils;
|
import org.dromara.maxkey.util.StringUtils;
|
||||||
@ -72,7 +72,7 @@ public class ScimUserController {
|
|||||||
private UserInfoService userInfoService;
|
private UserInfoService userInfoService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
RolesService rolesService;
|
GroupsService groupsService;
|
||||||
|
|
||||||
@RequestMapping(value = "/{id}", method = RequestMethod.GET)
|
@RequestMapping(value = "/{id}", method = RequestMethod.GET)
|
||||||
public MappingJacksonValue get(@PathVariable String id,
|
public MappingJacksonValue get(@PathVariable String id,
|
||||||
@ -172,9 +172,9 @@ public class ScimUserController {
|
|||||||
|
|
||||||
List<String> groupsList=new ArrayList<String>();
|
List<String> groupsList=new ArrayList<String>();
|
||||||
List<ScimGroupRef> groups = new ArrayList<ScimGroupRef>();
|
List<ScimGroupRef> groups = new ArrayList<ScimGroupRef>();
|
||||||
for(Roles role : rolesService.queryRolesByUserId(userInfo.getId())){
|
for(Groups group : groupsService.queryByUserId(userInfo.getId())){
|
||||||
groupsList.add(role.getId());
|
groupsList.add(group.getId());
|
||||||
groups.add(new ScimGroupRef(role.getId(),role.getRoleName()));
|
groups.add(new ScimGroupRef(group.getId(),group.getGroupName()));
|
||||||
|
|
||||||
}
|
}
|
||||||
scimUser.setGroup(groupsList);
|
scimUser.setGroup(groupsList);
|
||||||
|
|||||||
@ -16,4 +16,4 @@
|
|||||||
|
|
||||||
import { BaseEntity } from './BaseEntity';
|
import { BaseEntity } from './BaseEntity';
|
||||||
|
|
||||||
export class RoleMembers extends BaseEntity {}
|
export class GroupMembers extends BaseEntity {}
|
||||||
@ -18,7 +18,7 @@ import format from 'date-fns/format';
|
|||||||
|
|
||||||
import { BaseEntity } from './BaseEntity';
|
import { BaseEntity } from './BaseEntity';
|
||||||
|
|
||||||
export class Roles extends BaseEntity {
|
export class Groups extends BaseEntity {
|
||||||
roleCode!: String;
|
roleCode!: String;
|
||||||
roleName!: String;
|
roleName!: String;
|
||||||
category!: String;
|
category!: String;
|
||||||
@ -22,12 +22,6 @@ import { NzIconModule } from 'ng-zorro-antd/icon';
|
|||||||
|
|
||||||
import { PermissionsEditerComponent } from './permissions/permissions-editer/permissions-editer.component';
|
import { PermissionsEditerComponent } from './permissions/permissions-editer/permissions-editer.component';
|
||||||
import { PermissionsComponent } from './permissions/permissions.component';
|
import { PermissionsComponent } from './permissions/permissions.component';
|
||||||
import { MemberRolesEditerComponent } from './role-members/member-roles-editer/member-roles-editer.component';
|
|
||||||
import { RoleMembersEditerComponent } from './role-members/role-members-editer/role-members-editer.component';
|
|
||||||
import { RoleMembersComponent } from './role-members/role-members.component';
|
|
||||||
import { RoleEditerComponent } from './roles/role-editer/role-editer.component';
|
|
||||||
import { RolesComponent } from './roles/roles.component';
|
|
||||||
import { SelectRolesComponent } from './roles/select-roles/select-roles.component';
|
|
||||||
import { SessionsComponent } from './sessions/sessions.component';
|
import { SessionsComponent } from './sessions/sessions.component';
|
||||||
|
|
||||||
const routes: Routes = [
|
const routes: Routes = [
|
||||||
@ -35,31 +29,13 @@ const routes: Routes = [
|
|||||||
path: 'sessions',
|
path: 'sessions',
|
||||||
component: SessionsComponent
|
component: SessionsComponent
|
||||||
},
|
},
|
||||||
{
|
|
||||||
path: 'roles',
|
|
||||||
component: RolesComponent
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: 'rolemembers',
|
|
||||||
component: RoleMembersComponent
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
path: 'permissions',
|
path: 'permissions',
|
||||||
component: PermissionsComponent
|
component: PermissionsComponent
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
const COMPONENTS = [
|
const COMPONENTS = [PermissionsComponent, SessionsComponent, PermissionsEditerComponent];
|
||||||
RolesComponent,
|
|
||||||
RoleMembersComponent,
|
|
||||||
PermissionsComponent,
|
|
||||||
RoleEditerComponent,
|
|
||||||
SessionsComponent,
|
|
||||||
SelectRolesComponent,
|
|
||||||
RoleMembersEditerComponent,
|
|
||||||
PermissionsEditerComponent,
|
|
||||||
MemberRolesEditerComponent
|
|
||||||
];
|
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
declarations: [...COMPONENTS],
|
declarations: [...COMPONENTS],
|
||||||
|
|||||||
@ -24,14 +24,14 @@ import { NzMessageService } from 'ng-zorro-antd/message';
|
|||||||
import { NzModalRef, NzModalService } from 'ng-zorro-antd/modal';
|
import { NzModalRef, NzModalService } from 'ng-zorro-antd/modal';
|
||||||
import { NzTableQueryParams } from 'ng-zorro-antd/table';
|
import { NzTableQueryParams } from 'ng-zorro-antd/table';
|
||||||
|
|
||||||
import { RolePermissionsService } from '../../../../service/role-permissions.service';
|
import { GroupPermissionsService } from '../../../../service/group-permissions.service';
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-permissions-editer',
|
selector: 'app-permissions-editer',
|
||||||
templateUrl: './permissions-editer.component.html',
|
templateUrl: './permissions-editer.component.html',
|
||||||
styleUrls: ['./permissions-editer.component.less']
|
styleUrls: ['./permissions-editer.component.less']
|
||||||
})
|
})
|
||||||
export class PermissionsEditerComponent implements OnInit {
|
export class PermissionsEditerComponent implements OnInit {
|
||||||
@Input() roleId?: String;
|
@Input() groupId?: String;
|
||||||
@Input() isEdit?: boolean;
|
@Input() isEdit?: boolean;
|
||||||
|
|
||||||
query: {
|
query: {
|
||||||
@ -39,7 +39,7 @@ export class PermissionsEditerComponent implements OnInit {
|
|||||||
appName: String;
|
appName: String;
|
||||||
displayName: String;
|
displayName: String;
|
||||||
username: String;
|
username: String;
|
||||||
roleId: String;
|
groupId: String;
|
||||||
startDate: String;
|
startDate: String;
|
||||||
endDate: String;
|
endDate: String;
|
||||||
startDatePicker: Date;
|
startDatePicker: Date;
|
||||||
@ -63,7 +63,7 @@ export class PermissionsEditerComponent implements OnInit {
|
|||||||
appName: '',
|
appName: '',
|
||||||
displayName: '',
|
displayName: '',
|
||||||
username: '',
|
username: '',
|
||||||
roleId: '',
|
groupId: '',
|
||||||
startDate: '',
|
startDate: '',
|
||||||
endDate: '',
|
endDate: '',
|
||||||
startDatePicker: addDays(new Date(), -30),
|
startDatePicker: addDays(new Date(), -30),
|
||||||
@ -86,7 +86,7 @@ export class PermissionsEditerComponent implements OnInit {
|
|||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private modalRef: NzModalRef,
|
private modalRef: NzModalRef,
|
||||||
private rolePermissionsService: RolePermissionsService,
|
private groupPermissionsService: GroupPermissionsService,
|
||||||
private viewContainerRef: ViewContainerRef,
|
private viewContainerRef: ViewContainerRef,
|
||||||
private fb: FormBuilder,
|
private fb: FormBuilder,
|
||||||
private msg: NzMessageService,
|
private msg: NzMessageService,
|
||||||
@ -95,8 +95,8 @@ export class PermissionsEditerComponent implements OnInit {
|
|||||||
) {}
|
) {}
|
||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
if (this.roleId) {
|
if (this.groupId) {
|
||||||
this.query.params.roleId = this.roleId;
|
this.query.params.groupId = this.groupId;
|
||||||
this.fetch();
|
this.fetch();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -126,7 +126,7 @@ export class PermissionsEditerComponent implements OnInit {
|
|||||||
this.query.params.endDate = '';
|
this.query.params.endDate = '';
|
||||||
this.query.params.startDate = '';
|
this.query.params.startDate = '';
|
||||||
}
|
}
|
||||||
this.rolePermissionsService.memberOut(this.query.params).subscribe(res => {
|
this.groupPermissionsService.memberOut(this.query.params).subscribe(res => {
|
||||||
this.query.results = res.data;
|
this.query.results = res.data;
|
||||||
this.query.submitLoading = false;
|
this.query.submitLoading = false;
|
||||||
this.query.tableLoading = false;
|
this.query.tableLoading = false;
|
||||||
@ -171,7 +171,7 @@ export class PermissionsEditerComponent implements OnInit {
|
|||||||
memberIds = `${memberIds},${selectedData[i].id}`;
|
memberIds = `${memberIds},${selectedData[i].id}`;
|
||||||
memberNames = `${memberNames},${selectedData[i].username}`;
|
memberNames = `${memberNames},${selectedData[i].username}`;
|
||||||
}
|
}
|
||||||
this.rolePermissionsService.add({ roleId: this.roleId, appId: memberIds, appName: memberNames }).subscribe(res => {
|
this.groupPermissionsService.add({ groupId: this.groupId, appId: memberIds, appName: memberNames }).subscribe(res => {
|
||||||
this.query.results = res.data;
|
this.query.results = res.data;
|
||||||
this.query.submitLoading = false;
|
this.query.submitLoading = false;
|
||||||
this.query.tableLoading = false;
|
this.query.tableLoading = false;
|
||||||
|
|||||||
@ -48,10 +48,11 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div nz-col nzMd="24" nzSm="24">
|
<div nz-col nzMd="24" nzSm="24">
|
||||||
<nz-table #dynamicTable nzTableLayout="auto" nzSize="small" nzBordered nzShowSizeChanger [nzData]="query.results.rows"
|
<nz-table #dynamicTable nzTableLayout="auto" nzSize="small" nzBordered nzShowSizeChanger
|
||||||
[nzFrontPagination]="false" [nzTotal]="query.results.records" [nzPageSizeOptions]="query.params.pageSizeOptions"
|
[nzData]="query.results.rows" [nzFrontPagination]="false" [nzTotal]="query.results.records"
|
||||||
[nzPageSize]="query.params.pageSize" [nzPageIndex]="query.params.pageNumber"
|
[nzPageSizeOptions]="query.params.pageSizeOptions" [nzPageSize]="query.params.pageSize"
|
||||||
[nzLoading]="this.query.tableLoading" (nzQueryParams)="onQueryParamsChange($event)">
|
[nzPageIndex]="query.params.pageNumber" [nzLoading]="this.query.tableLoading"
|
||||||
|
(nzQueryParams)="onQueryParamsChange($event)">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th [nzChecked]="query.checked" [nzIndeterminate]="query.indeterminate"
|
<th [nzChecked]="query.checked" [nzIndeterminate]="query.indeterminate"
|
||||||
@ -68,7 +69,7 @@
|
|||||||
<tr *ngFor="let data of query.results.rows">
|
<tr *ngFor="let data of query.results.rows">
|
||||||
<td [nzChecked]="query.tableCheckedId.has(data.id)" [nzDisabled]="data.disabled"
|
<td [nzChecked]="query.tableCheckedId.has(data.id)" [nzDisabled]="data.disabled"
|
||||||
(nzCheckedChange)="onTableItemChecked(data.id, $event)"></td>
|
(nzCheckedChange)="onTableItemChecked(data.id, $event)"></td>
|
||||||
<td nzAlign="left"> {{ data.roleName }}</td>
|
<td nzAlign="left"> {{ data.groupName }}</td>
|
||||||
<td nzAlign="center"><img height="30" border="0px" src="{{ data.iconBase64 }}" /></td>
|
<td nzAlign="center"><img height="30" border="0px" src="{{ data.iconBase64 }}" /></td>
|
||||||
<td nzAlign="left"> {{ data.appName }}</td>
|
<td nzAlign="left"> {{ data.appName }}</td>
|
||||||
<td nzAlign="left">
|
<td nzAlign="left">
|
||||||
|
|||||||
@ -27,9 +27,9 @@ import { NzModalRef, NzModalService } from 'ng-zorro-antd/modal';
|
|||||||
import { NzTableQueryParams } from 'ng-zorro-antd/table';
|
import { NzTableQueryParams } from 'ng-zorro-antd/table';
|
||||||
import { NzFormatEmitEvent, NzTreeNode, NzTreeNodeOptions } from 'ng-zorro-antd/tree';
|
import { NzFormatEmitEvent, NzTreeNode, NzTreeNodeOptions } from 'ng-zorro-antd/tree';
|
||||||
|
|
||||||
import { RolePermissionsService } from '../../../service/role-permissions.service';
|
import { GroupPermissionsService } from '../../../service/group-permissions.service';
|
||||||
import { set2String } from '../../../shared/index';
|
import { set2String } from '../../../shared/index';
|
||||||
import { SelectRolesComponent } from '../roles/select-roles/select-roles.component';
|
import { SelectGroupsComponent } from '../../idm/groups/select-groups/select-groups.component';
|
||||||
import { PermissionsEditerComponent } from './permissions-editer/permissions-editer.component';
|
import { PermissionsEditerComponent } from './permissions-editer/permissions-editer.component';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
@ -42,8 +42,8 @@ export class PermissionsComponent implements OnInit {
|
|||||||
params: {
|
params: {
|
||||||
displayName: String;
|
displayName: String;
|
||||||
username: String;
|
username: String;
|
||||||
roleId: String;
|
groupId: String;
|
||||||
roleName: String;
|
groupName: String;
|
||||||
appName: String;
|
appName: String;
|
||||||
appId: String;
|
appId: String;
|
||||||
startDate: String;
|
startDate: String;
|
||||||
@ -69,8 +69,8 @@ export class PermissionsComponent implements OnInit {
|
|||||||
params: {
|
params: {
|
||||||
displayName: '',
|
displayName: '',
|
||||||
username: '',
|
username: '',
|
||||||
roleId: '',
|
groupId: '',
|
||||||
roleName: '',
|
groupName: '',
|
||||||
appName: '',
|
appName: '',
|
||||||
appId: '',
|
appId: '',
|
||||||
startDate: '',
|
startDate: '',
|
||||||
@ -96,7 +96,7 @@ export class PermissionsComponent implements OnInit {
|
|||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private modalService: NzModalService,
|
private modalService: NzModalService,
|
||||||
private rolePermissionsService: RolePermissionsService,
|
private groupPermissionsService: GroupPermissionsService,
|
||||||
private viewContainerRef: ViewContainerRef,
|
private viewContainerRef: ViewContainerRef,
|
||||||
private fb: FormBuilder,
|
private fb: FormBuilder,
|
||||||
private msg: NzMessageService,
|
private msg: NzMessageService,
|
||||||
@ -107,9 +107,9 @@ export class PermissionsComponent implements OnInit {
|
|||||||
) {}
|
) {}
|
||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
if (this.route.snapshot.queryParams['roleId']) {
|
if (this.route.snapshot.queryParams['groupId']) {
|
||||||
this.query.params.roleId = this.route.snapshot.queryParams['roleId'];
|
this.query.params.groupId = this.route.snapshot.queryParams['groupId'];
|
||||||
this.query.params.roleName = this.route.snapshot.queryParams['roleName'];
|
this.query.params.groupName = this.route.snapshot.queryParams['groupName'];
|
||||||
}
|
}
|
||||||
this.query.tableInitialize = false;
|
this.query.tableInitialize = false;
|
||||||
}
|
}
|
||||||
@ -130,7 +130,7 @@ export class PermissionsComponent implements OnInit {
|
|||||||
|
|
||||||
onBatchDelete(e: MouseEvent): void {
|
onBatchDelete(e: MouseEvent): void {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
this.rolePermissionsService.delete(set2String(this.query.tableCheckedId)).subscribe(res => {
|
this.groupPermissionsService.delete(set2String(this.query.tableCheckedId)).subscribe(res => {
|
||||||
if (res.code == 0) {
|
if (res.code == 0) {
|
||||||
this.msg.success(this.i18n.fanyi('mxk.alert.delete.success'));
|
this.msg.success(this.i18n.fanyi('mxk.alert.delete.success'));
|
||||||
this.fetch();
|
this.fetch();
|
||||||
@ -148,7 +148,7 @@ export class PermissionsComponent implements OnInit {
|
|||||||
nzViewContainerRef: this.viewContainerRef,
|
nzViewContainerRef: this.viewContainerRef,
|
||||||
nzComponentParams: {
|
nzComponentParams: {
|
||||||
isEdit: false,
|
isEdit: false,
|
||||||
roleId: this.query.params.roleId
|
groupId: this.query.params.groupId
|
||||||
},
|
},
|
||||||
nzWidth: 700,
|
nzWidth: 700,
|
||||||
nzOnOk: () => new Promise(resolve => setTimeout(resolve, 1000))
|
nzOnOk: () => new Promise(resolve => setTimeout(resolve, 1000))
|
||||||
@ -164,7 +164,7 @@ export class PermissionsComponent implements OnInit {
|
|||||||
onSelect(e: MouseEvent): void {
|
onSelect(e: MouseEvent): void {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
const modal = this.modalService.create({
|
const modal = this.modalService.create({
|
||||||
nzContent: SelectRolesComponent,
|
nzContent: SelectGroupsComponent,
|
||||||
nzViewContainerRef: this.viewContainerRef,
|
nzViewContainerRef: this.viewContainerRef,
|
||||||
nzComponentParams: {},
|
nzComponentParams: {},
|
||||||
nzWidth: 700,
|
nzWidth: 700,
|
||||||
@ -173,8 +173,8 @@ export class PermissionsComponent implements OnInit {
|
|||||||
// Return a result when closed
|
// Return a result when closed
|
||||||
modal.afterClose.subscribe(result => {
|
modal.afterClose.subscribe(result => {
|
||||||
if (result.refresh) {
|
if (result.refresh) {
|
||||||
this.query.params.roleName = result.data.roleName;
|
this.query.params.groupName = result.data.groupName;
|
||||||
this.query.params.roleId = result.data.id;
|
this.query.params.groupId = result.data.id;
|
||||||
console.log(result);
|
console.log(result);
|
||||||
this.fetch();
|
this.fetch();
|
||||||
}
|
}
|
||||||
@ -183,7 +183,7 @@ export class PermissionsComponent implements OnInit {
|
|||||||
|
|
||||||
onDelete(e: MouseEvent, deleteId: String): void {
|
onDelete(e: MouseEvent, deleteId: String): void {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
this.rolePermissionsService.delete(deleteId).subscribe(res => {
|
this.groupPermissionsService.delete(deleteId).subscribe(res => {
|
||||||
if (res.code == 0) {
|
if (res.code == 0) {
|
||||||
this.msg.success(this.i18n.fanyi('mxk.alert.delete.success'));
|
this.msg.success(this.i18n.fanyi('mxk.alert.delete.success'));
|
||||||
this.fetch();
|
this.fetch();
|
||||||
@ -207,7 +207,7 @@ export class PermissionsComponent implements OnInit {
|
|||||||
this.query.params.endDate = '';
|
this.query.params.endDate = '';
|
||||||
this.query.params.startDate = '';
|
this.query.params.startDate = '';
|
||||||
}
|
}
|
||||||
this.rolePermissionsService.member(this.query.params).subscribe(res => {
|
this.groupPermissionsService.member(this.query.params).subscribe(res => {
|
||||||
this.query.results = res.data;
|
this.query.results = res.data;
|
||||||
this.query.submitLoading = false;
|
this.query.submitLoading = false;
|
||||||
this.query.tableLoading = false;
|
this.query.tableLoading = false;
|
||||||
|
|||||||
@ -1,106 +0,0 @@
|
|||||||
<page-header> </page-header>
|
|
||||||
|
|
||||||
<nz-card [nzBordered]="false">
|
|
||||||
<form nz-form [nzLayout]="'inline'" (ngSubmit)="onSearch()" class="search__form">
|
|
||||||
<div nz-row [nzGutter]="{ xs: 8, sm: 8, md: 8, lg: 24, xl: 48, xxl: 48 }">
|
|
||||||
<div nz-col nzMd="16" nzSm="24">
|
|
||||||
<nz-form-item>
|
|
||||||
<nz-form-label nzFor="name">{{ 'mxk.roles.name' | i18n }}</nz-form-label>
|
|
||||||
<nz-form-control>
|
|
||||||
<input
|
|
||||||
nz-input
|
|
||||||
[(ngModel)]="query.params.roleName"
|
|
||||||
[ngModelOptions]="{ standalone: true }"
|
|
||||||
name="roleName"
|
|
||||||
placeholder=""
|
|
||||||
id="roleName"
|
|
||||||
/>
|
|
||||||
</nz-form-control>
|
|
||||||
</nz-form-item>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div nz-col [nzSpan]="query.expandForm ? 24 : 8" [class.text-right]="query.expandForm">
|
|
||||||
<button nz-button type="submit" [nzType]="'primary'" [nzLoading]="query.submitLoading">{{ 'mxk.text.query' | i18n }}</button>
|
|
||||||
<button nz-button type="reset" (click)="onReset()" class="mx-sm" style="display: none">{{ 'mxk.text.reset' | i18n }}</button>
|
|
||||||
<button nz-button (click)="query.expandForm = !query.expandForm" class="mx-sm" style="display: none">
|
|
||||||
{{ query.expandForm ? ('mxk.text.collapse' | i18n) : ('mxk.text.expand' | i18n) }}</button
|
|
||||||
>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
</nz-card>
|
|
||||||
<nz-card>
|
|
||||||
<div nz-col [nzSpan]="24" class="table-list-toolbar">
|
|
||||||
<button nz-button type="button" [nzType]="'primary'" (click)="onAdd($event)">{{ 'mxk.text.add' | i18n }}</button>
|
|
||||||
<button nz-button type="button" (click)="onBatchDelete($event)" [nzType]="'primary'" nzDanger class="mx-sm">{{
|
|
||||||
'mxk.text.delete' | i18n
|
|
||||||
}}</button>
|
|
||||||
</div>
|
|
||||||
<nz-table
|
|
||||||
#dynamicTable
|
|
||||||
nzTableLayout="auto"
|
|
||||||
nzSize="small"
|
|
||||||
nzBordered
|
|
||||||
nzShowSizeChanger
|
|
||||||
[nzData]="query.results.rows"
|
|
||||||
[nzFrontPagination]="false"
|
|
||||||
[nzTotal]="query.results.records"
|
|
||||||
[nzPageSizeOptions]="query.params.pageSizeOptions"
|
|
||||||
[nzPageSize]="query.params.pageSize"
|
|
||||||
[nzPageIndex]="query.params.pageNumber"
|
|
||||||
[nzLoading]="this.query.tableLoading"
|
|
||||||
(nzQueryParams)="onQueryParamsChange($event)"
|
|
||||||
nzWidth="100%"
|
|
||||||
>
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th [nzChecked]="query.checked" [nzIndeterminate]="query.indeterminate" (nzCheckedChange)="onTableAllChecked($event)"></th>
|
|
||||||
<th nzAlign="center" style="display: none">Id</th>
|
|
||||||
<th nzAlign="center">{{ 'mxk.roles.name' | i18n }}</th>
|
|
||||||
<th nzAlign="center">{{ 'mxk.roles.category' | i18n }}</th>
|
|
||||||
<th nzAlign="center">{{ 'mxk.text.description' | i18n }}</th>
|
|
||||||
<th nzAlign="center" class="table_cell_action_2">{{ 'mxk.text.action' | i18n }}</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
<tr *ngFor="let data of query.results.rows">
|
|
||||||
<td
|
|
||||||
[nzChecked]="query.tableCheckedId.has(data.id)"
|
|
||||||
[nzDisabled]="data.disabled"
|
|
||||||
(nzCheckedChange)="onTableItemChecked(data.id, $event)"
|
|
||||||
></td>
|
|
||||||
<td nzAlign="left" style="display: none">
|
|
||||||
<span>{{ data.id }}</span>
|
|
||||||
</td>
|
|
||||||
<td nzAlign="left" nzBreakWord="false">{{ data.roleName }}</td>
|
|
||||||
<td nzAlign="center" *ngIf="data.category == 'dynamic'"> {{ 'mxk.roles.category.dynamic' | i18n }}</td>
|
|
||||||
<td nzAlign="center" *ngIf="data.category == 'static'"> {{ 'mxk.roles.category.static' | i18n }}</td>
|
|
||||||
<td nzAlign="center" *ngIf="data.category == 'app'"> {{ 'mxk.roles.category.app' | i18n }}</td>
|
|
||||||
<td nzAlign="left">{{ data.description }}</td>
|
|
||||||
<td nzAlign="center" nzBreakWord="false">
|
|
||||||
<div nz-col>
|
|
||||||
<button nz-button type="button" (click)="onEdit($event, data.id)">{{ 'mxk.text.edit' | i18n }}</button>
|
|
||||||
<button nz-button nz-dropdown [nzDropdownMenu]="menuMoreAction">
|
|
||||||
{{ 'mxk.text.moreaction' | i18n }}
|
|
||||||
<i nz-icon nzType="down"></i>
|
|
||||||
</button>
|
|
||||||
|
|
||||||
<nz-dropdown-menu #menuMoreAction="nzDropdownMenu">
|
|
||||||
<ul nz-menu>
|
|
||||||
<li nz-menu-item (click)="onMembers($event, data.id, data.roleName)">{{ 'mxk.roles.member' | i18n }}</li>
|
|
||||||
<li nz-menu-item (click)="onPermissions($event, data.id, data.roleName)">{{ 'mxk.roles.permissions' | i18n }}</li>
|
|
||||||
<li
|
|
||||||
nz-menu-item
|
|
||||||
*ngIf="data.roleCode != 'ROLE_ADMINISTRATORS' && data.roleCode != 'ROLE_ALL_USER' && data.roleCode != 'ROLE_MANAGERS'"
|
|
||||||
(click)="onDelete($event, data.id)"
|
|
||||||
nzDanger
|
|
||||||
>{{ 'mxk.text.delete' | i18n }}</li
|
|
||||||
>
|
|
||||||
</ul>
|
|
||||||
</nz-dropdown-menu>
|
|
||||||
</div>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</tbody>
|
|
||||||
</nz-table>
|
|
||||||
</nz-card>
|
|
||||||
@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
import { RoleMembersEditerComponent } from './role-members-editer.component';
|
import { RoleMembersEditerComponent } from './group-members-editer.component';
|
||||||
|
|
||||||
describe('GroupMembersEditerComponent', () => {
|
describe('GroupMembersEditerComponent', () => {
|
||||||
let component: GroupMembersEditerComponent;
|
let component: GroupMembersEditerComponent;
|
||||||
@ -24,15 +24,15 @@ import { NzMessageService } from 'ng-zorro-antd/message';
|
|||||||
import { NzModalRef, NzModalService } from 'ng-zorro-antd/modal';
|
import { NzModalRef, NzModalService } from 'ng-zorro-antd/modal';
|
||||||
import { NzTableQueryParams } from 'ng-zorro-antd/table';
|
import { NzTableQueryParams } from 'ng-zorro-antd/table';
|
||||||
|
|
||||||
import { Roles } from '../../../../entity/Roles';
|
import { Groups } from '../../../../entity/Groups';
|
||||||
import { RoleMembersService } from '../../../../service/role-members.service';
|
import { GroupMembersService } from '../../../../service/group-members.service';
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-role-members-editer',
|
selector: 'app-group-members-editer',
|
||||||
templateUrl: './role-members-editer.component.html',
|
templateUrl: './group-members-editer.component.html',
|
||||||
styleUrls: ['./role-members-editer.component.less']
|
styleUrls: ['./group-members-editer.component.less']
|
||||||
})
|
})
|
||||||
export class RoleMembersEditerComponent implements OnInit {
|
export class GroupMembersEditerComponent implements OnInit {
|
||||||
@Input() roleId?: String;
|
@Input() groupId?: String;
|
||||||
@Input() isEdit?: boolean;
|
@Input() isEdit?: boolean;
|
||||||
|
|
||||||
query: {
|
query: {
|
||||||
@ -40,7 +40,7 @@ export class RoleMembersEditerComponent implements OnInit {
|
|||||||
name: String;
|
name: String;
|
||||||
displayName: String;
|
displayName: String;
|
||||||
username: String;
|
username: String;
|
||||||
roleId: String;
|
groupId: String;
|
||||||
startDate: String;
|
startDate: String;
|
||||||
endDate: String;
|
endDate: String;
|
||||||
startDatePicker: Date;
|
startDatePicker: Date;
|
||||||
@ -64,7 +64,7 @@ export class RoleMembersEditerComponent implements OnInit {
|
|||||||
name: '',
|
name: '',
|
||||||
displayName: '',
|
displayName: '',
|
||||||
username: '',
|
username: '',
|
||||||
roleId: '',
|
groupId: '',
|
||||||
startDate: '',
|
startDate: '',
|
||||||
endDate: '',
|
endDate: '',
|
||||||
startDatePicker: addDays(new Date(), -30),
|
startDatePicker: addDays(new Date(), -30),
|
||||||
@ -87,7 +87,7 @@ export class RoleMembersEditerComponent implements OnInit {
|
|||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private modalRef: NzModalRef,
|
private modalRef: NzModalRef,
|
||||||
private roleMembersService: RoleMembersService,
|
private groupMembersService: GroupMembersService,
|
||||||
private viewContainerRef: ViewContainerRef,
|
private viewContainerRef: ViewContainerRef,
|
||||||
private fb: FormBuilder,
|
private fb: FormBuilder,
|
||||||
private msg: NzMessageService,
|
private msg: NzMessageService,
|
||||||
@ -96,8 +96,8 @@ export class RoleMembersEditerComponent implements OnInit {
|
|||||||
) {}
|
) {}
|
||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
if (this.roleId) {
|
if (this.groupId) {
|
||||||
this.query.params.roleId = this.roleId;
|
this.query.params.groupId = this.groupId;
|
||||||
this.fetch();
|
this.fetch();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -127,7 +127,7 @@ export class RoleMembersEditerComponent implements OnInit {
|
|||||||
this.query.params.endDate = '';
|
this.query.params.endDate = '';
|
||||||
this.query.params.startDate = '';
|
this.query.params.startDate = '';
|
||||||
}
|
}
|
||||||
this.roleMembersService.memberOut(this.query.params).subscribe(res => {
|
this.groupMembersService.memberOut(this.query.params).subscribe(res => {
|
||||||
this.query.results = res.data;
|
this.query.results = res.data;
|
||||||
this.query.submitLoading = false;
|
this.query.submitLoading = false;
|
||||||
this.query.tableLoading = false;
|
this.query.tableLoading = false;
|
||||||
@ -172,7 +172,7 @@ export class RoleMembersEditerComponent implements OnInit {
|
|||||||
memberIds = `${memberIds},${selectedData[i].id}`;
|
memberIds = `${memberIds},${selectedData[i].id}`;
|
||||||
memberNames = `${memberNames},${selectedData[i].username}`;
|
memberNames = `${memberNames},${selectedData[i].username}`;
|
||||||
}
|
}
|
||||||
this.roleMembersService.add({ type: 'USER', roleId: this.roleId, memberId: memberIds, memberName: memberNames }).subscribe(res => {
|
this.groupMembersService.add({ type: 'USER', groupId: this.groupId, memberId: memberIds, memberName: memberNames }).subscribe(res => {
|
||||||
this.query.results = res.data;
|
this.query.results = res.data;
|
||||||
this.query.submitLoading = false;
|
this.query.submitLoading = false;
|
||||||
this.query.tableLoading = false;
|
this.query.tableLoading = false;
|
||||||
@ -5,11 +5,11 @@
|
|||||||
<div nz-row [nzGutter]="{ xs: 8, sm: 8, md: 24, lg: 24, xl: 48, xxl: 48 }">
|
<div nz-row [nzGutter]="{ xs: 8, sm: 8, md: 24, lg: 24, xl: 48, xxl: 48 }">
|
||||||
<div nz-col nzMd="8" nzSm="24">
|
<div nz-col nzMd="8" nzSm="24">
|
||||||
<nz-form-item>
|
<nz-form-item>
|
||||||
<nz-form-label nzFor="roleName">{{ 'mxk.roles.name' | i18n }}</nz-form-label>
|
<nz-form-label nzFor="groupName">{{ 'mxk.roles.name' | i18n }}</nz-form-label>
|
||||||
<nz-form-control>
|
<nz-form-control>
|
||||||
<nz-input-group nzSearch [nzAddOnAfter]="suffixButton">
|
<nz-input-group nzSearch [nzAddOnAfter]="suffixButton">
|
||||||
<input nz-input [(ngModel)]="query.params.roleName" [ngModelOptions]="{ standalone: true }"
|
<input nz-input [(ngModel)]="query.params.groupName" [ngModelOptions]="{ standalone: true }"
|
||||||
name="roleName" readonly placeholder="" id="roleName" />
|
name="groupName" readonly placeholder="" id="groupName" />
|
||||||
</nz-input-group>
|
</nz-input-group>
|
||||||
<ng-template #suffixButton>
|
<ng-template #suffixButton>
|
||||||
<button nz-button nzType="primary" (click)="onSelect($event)" nzSearch>{{ 'mxk.text.select' | i18n
|
<button nz-button nzType="primary" (click)="onSelect($event)" nzSearch>{{ 'mxk.text.select' | i18n
|
||||||
@ -47,10 +47,11 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div nz-col nzMd="24" nzSm="24">
|
<div nz-col nzMd="24" nzSm="24">
|
||||||
<nz-table #dynamicTable nzTableLayout="auto" nzSize="small" nzBordered nzShowSizeChanger [nzData]="query.results.rows"
|
<nz-table #dynamicTable nzTableLayout="auto" nzSize="small" nzBordered nzShowSizeChanger
|
||||||
[nzFrontPagination]="false" [nzTotal]="query.results.records" [nzPageSizeOptions]="query.params.pageSizeOptions"
|
[nzData]="query.results.rows" [nzFrontPagination]="false" [nzTotal]="query.results.records"
|
||||||
[nzPageSize]="query.params.pageSize" [nzPageIndex]="query.params.pageNumber"
|
[nzPageSizeOptions]="query.params.pageSizeOptions" [nzPageSize]="query.params.pageSize"
|
||||||
[nzLoading]="this.query.tableLoading" (nzQueryParams)="onQueryParamsChange($event)">
|
[nzPageIndex]="query.params.pageNumber" [nzLoading]="this.query.tableLoading"
|
||||||
|
(nzQueryParams)="onQueryParamsChange($event)">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th [nzChecked]="query.checked" [nzIndeterminate]="query.indeterminate"
|
<th [nzChecked]="query.checked" [nzIndeterminate]="query.indeterminate"
|
||||||
@ -68,7 +69,7 @@
|
|||||||
<tr *ngFor="let data of query.results.rows">
|
<tr *ngFor="let data of query.results.rows">
|
||||||
<td [nzChecked]="query.tableCheckedId.has(data.id)" [nzDisabled]="data.disabled"
|
<td [nzChecked]="query.tableCheckedId.has(data.id)" [nzDisabled]="data.disabled"
|
||||||
(nzCheckedChange)="onTableItemChecked(data.id, $event)"></td>
|
(nzCheckedChange)="onTableItemChecked(data.id, $event)"></td>
|
||||||
<td nzAlign="left"> {{ data.roleName }}</td>
|
<td nzAlign="left"> {{ data.groupName }}</td>
|
||||||
<td nzAlign="left"> {{ data.username }}</td>
|
<td nzAlign="left"> {{ data.username }}</td>
|
||||||
<td nzAlign="left"> {{ data.displayName }}</td>
|
<td nzAlign="left"> {{ data.displayName }}</td>
|
||||||
<td nzAlign="left"> {{ data.department }}</td>
|
<td nzAlign="left"> {{ data.department }}</td>
|
||||||
@ -27,24 +27,24 @@ import { NzModalRef, NzModalService } from 'ng-zorro-antd/modal';
|
|||||||
import { NzTableQueryParams } from 'ng-zorro-antd/table';
|
import { NzTableQueryParams } from 'ng-zorro-antd/table';
|
||||||
import { NzFormatEmitEvent, NzTreeNode, NzTreeNodeOptions } from 'ng-zorro-antd/tree';
|
import { NzFormatEmitEvent, NzTreeNode, NzTreeNodeOptions } from 'ng-zorro-antd/tree';
|
||||||
|
|
||||||
import { RoleMembersService } from '../../../service/role-members.service';
|
import { GroupMembersService } from '../../../service/group-members.service';
|
||||||
import { set2String } from '../../../shared/index';
|
import { set2String } from '../../../shared/index';
|
||||||
import { SelectRolesComponent } from '../roles/select-roles/select-roles.component';
|
import { SelectGroupsComponent } from '../groups/select-groups/select-groups.component';
|
||||||
import { MemberRolesEditerComponent } from './member-roles-editer/member-roles-editer.component';
|
import { GroupMembersEditerComponent } from './group-members-editer/group-members-editer.component';
|
||||||
import { RoleMembersEditerComponent } from './role-members-editer/role-members-editer.component';
|
import { MemberGroupsEditerComponent } from './member-groups-editer/member-groups-editer.component';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-role-members',
|
selector: 'app-group-members',
|
||||||
templateUrl: './role-members.component.html',
|
templateUrl: './group-members.component.html',
|
||||||
styleUrls: ['./role-members.component.less']
|
styleUrls: ['./group-members.component.less']
|
||||||
})
|
})
|
||||||
export class RoleMembersComponent implements OnInit {
|
export class GroupMembersComponent implements OnInit {
|
||||||
query: {
|
query: {
|
||||||
params: {
|
params: {
|
||||||
roleName: String;
|
groupName: String;
|
||||||
displayName: String;
|
displayName: String;
|
||||||
username: String;
|
username: String;
|
||||||
roleId: String;
|
groupId: String;
|
||||||
appName: String;
|
appName: String;
|
||||||
appId: String;
|
appId: String;
|
||||||
startDate: String;
|
startDate: String;
|
||||||
@ -68,10 +68,10 @@ export class RoleMembersComponent implements OnInit {
|
|||||||
checked: boolean;
|
checked: boolean;
|
||||||
} = {
|
} = {
|
||||||
params: {
|
params: {
|
||||||
roleName: '',
|
groupName: '',
|
||||||
displayName: '',
|
displayName: '',
|
||||||
username: '',
|
username: '',
|
||||||
roleId: '',
|
groupId: '',
|
||||||
appName: '',
|
appName: '',
|
||||||
appId: '',
|
appId: '',
|
||||||
startDate: '',
|
startDate: '',
|
||||||
@ -97,7 +97,7 @@ export class RoleMembersComponent implements OnInit {
|
|||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private modalService: NzModalService,
|
private modalService: NzModalService,
|
||||||
private roleMembersService: RoleMembersService,
|
private groupMembersService: GroupMembersService,
|
||||||
private viewContainerRef: ViewContainerRef,
|
private viewContainerRef: ViewContainerRef,
|
||||||
private fb: FormBuilder,
|
private fb: FormBuilder,
|
||||||
private msg: NzMessageService,
|
private msg: NzMessageService,
|
||||||
@ -110,9 +110,9 @@ export class RoleMembersComponent implements OnInit {
|
|||||||
if (this.route.snapshot.queryParams['username']) {
|
if (this.route.snapshot.queryParams['username']) {
|
||||||
this.query.params.username = this.route.snapshot.queryParams['username'];
|
this.query.params.username = this.route.snapshot.queryParams['username'];
|
||||||
}
|
}
|
||||||
if (this.route.snapshot.queryParams['roleId']) {
|
if (this.route.snapshot.queryParams['groupId']) {
|
||||||
this.query.params.roleId = this.route.snapshot.queryParams['roleId'];
|
this.query.params.groupId = this.route.snapshot.queryParams['groupId'];
|
||||||
this.query.params.roleName = this.route.snapshot.queryParams['roleName'];
|
this.query.params.groupName = this.route.snapshot.queryParams['groupName'];
|
||||||
}
|
}
|
||||||
this.query.tableInitialize = false;
|
this.query.tableInitialize = false;
|
||||||
}
|
}
|
||||||
@ -131,14 +131,14 @@ export class RoleMembersComponent implements OnInit {
|
|||||||
|
|
||||||
onReset(): void {
|
onReset(): void {
|
||||||
this.query.params.username = '';
|
this.query.params.username = '';
|
||||||
this.query.params.roleId = '';
|
this.query.params.groupId = '';
|
||||||
this.query.params.roleName = '';
|
this.query.params.groupName = '';
|
||||||
this.fetch();
|
this.fetch();
|
||||||
}
|
}
|
||||||
|
|
||||||
onBatchDelete(e: MouseEvent): void {
|
onBatchDelete(e: MouseEvent): void {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
this.roleMembersService.delete(set2String(this.query.tableCheckedId)).subscribe(res => {
|
this.groupMembersService.delete(set2String(this.query.tableCheckedId)).subscribe(res => {
|
||||||
if (res.code == 0) {
|
if (res.code == 0) {
|
||||||
this.msg.success(this.i18n.fanyi('mxk.alert.delete.success'));
|
this.msg.success(this.i18n.fanyi('mxk.alert.delete.success'));
|
||||||
this.fetch();
|
this.fetch();
|
||||||
@ -153,7 +153,7 @@ export class RoleMembersComponent implements OnInit {
|
|||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
if (this.query.params.username != '') {
|
if (this.query.params.username != '') {
|
||||||
const modal = this.modalService.create({
|
const modal = this.modalService.create({
|
||||||
nzContent: MemberRolesEditerComponent,
|
nzContent: MemberGroupsEditerComponent,
|
||||||
nzViewContainerRef: this.viewContainerRef,
|
nzViewContainerRef: this.viewContainerRef,
|
||||||
nzComponentParams: {
|
nzComponentParams: {
|
||||||
username: this.query.params.username
|
username: this.query.params.username
|
||||||
@ -167,13 +167,13 @@ export class RoleMembersComponent implements OnInit {
|
|||||||
this.fetch();
|
this.fetch();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else if (this.query.params.roleId != '') {
|
} else if (this.query.params.groupId != '') {
|
||||||
const modal = this.modalService.create({
|
const modal = this.modalService.create({
|
||||||
nzContent: RoleMembersEditerComponent,
|
nzContent: GroupMembersEditerComponent,
|
||||||
nzViewContainerRef: this.viewContainerRef,
|
nzViewContainerRef: this.viewContainerRef,
|
||||||
nzComponentParams: {
|
nzComponentParams: {
|
||||||
isEdit: false,
|
isEdit: false,
|
||||||
roleId: this.query.params.roleId
|
groupId: this.query.params.groupId
|
||||||
},
|
},
|
||||||
nzWidth: 700,
|
nzWidth: 700,
|
||||||
nzOnOk: () => new Promise(resolve => setTimeout(resolve, 1000))
|
nzOnOk: () => new Promise(resolve => setTimeout(resolve, 1000))
|
||||||
@ -191,7 +191,7 @@ export class RoleMembersComponent implements OnInit {
|
|||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
||||||
const modal = this.modalService.create({
|
const modal = this.modalService.create({
|
||||||
nzContent: SelectRolesComponent,
|
nzContent: SelectGroupsComponent,
|
||||||
nzViewContainerRef: this.viewContainerRef,
|
nzViewContainerRef: this.viewContainerRef,
|
||||||
nzComponentParams: {},
|
nzComponentParams: {},
|
||||||
nzWidth: 700,
|
nzWidth: 700,
|
||||||
@ -200,8 +200,8 @@ export class RoleMembersComponent implements OnInit {
|
|||||||
// Return a result when closed
|
// Return a result when closed
|
||||||
modal.afterClose.subscribe(result => {
|
modal.afterClose.subscribe(result => {
|
||||||
if (result.refresh) {
|
if (result.refresh) {
|
||||||
this.query.params.roleName = result.data.roleName;
|
this.query.params.groupName = result.data.groupName;
|
||||||
this.query.params.roleId = result.data.id;
|
this.query.params.groupId = result.data.id;
|
||||||
console.log(result);
|
console.log(result);
|
||||||
this.fetch();
|
this.fetch();
|
||||||
}
|
}
|
||||||
@ -210,7 +210,7 @@ export class RoleMembersComponent implements OnInit {
|
|||||||
|
|
||||||
onDelete(e: MouseEvent, deleteId: String): void {
|
onDelete(e: MouseEvent, deleteId: String): void {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
this.roleMembersService.delete(deleteId).subscribe(res => {
|
this.groupMembersService.delete(deleteId).subscribe(res => {
|
||||||
if (res.code == 0) {
|
if (res.code == 0) {
|
||||||
this.msg.success(this.i18n.fanyi('mxk.alert.delete.success'));
|
this.msg.success(this.i18n.fanyi('mxk.alert.delete.success'));
|
||||||
this.fetch();
|
this.fetch();
|
||||||
@ -234,7 +234,7 @@ export class RoleMembersComponent implements OnInit {
|
|||||||
this.query.params.endDate = '';
|
this.query.params.endDate = '';
|
||||||
this.query.params.startDate = '';
|
this.query.params.startDate = '';
|
||||||
}
|
}
|
||||||
this.roleMembersService.member(this.query.params).subscribe(res => {
|
this.groupMembersService.member(this.query.params).subscribe(res => {
|
||||||
this.query.results = res.data;
|
this.query.results = res.data;
|
||||||
this.query.submitLoading = false;
|
this.query.submitLoading = false;
|
||||||
this.query.tableLoading = false;
|
this.query.tableLoading = false;
|
||||||
@ -5,17 +5,17 @@
|
|||||||
<nz-form-item>
|
<nz-form-item>
|
||||||
<nz-form-label nzFor="name">{{ 'mxk.roles.name' | i18n }}</nz-form-label>
|
<nz-form-label nzFor="name">{{ 'mxk.roles.name' | i18n }}</nz-form-label>
|
||||||
<nz-form-control>
|
<nz-form-control>
|
||||||
<input nz-input [(ngModel)]="query.params.roleName" [ngModelOptions]="{ standalone: true }"
|
<input nz-input [(ngModel)]="query.params.groupName" [ngModelOptions]="{ standalone: true }" name="groupName"
|
||||||
name="roleName" placeholder="" id="roleName" />
|
placeholder="" id="groupName" />
|
||||||
</nz-form-control>
|
</nz-form-control>
|
||||||
</nz-form-item>
|
</nz-form-item>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div nz-col [nzSpan]="query.expandForm ? 24 : 10" [class.text-right]="query.expandForm">
|
<div nz-col [nzSpan]="query.expandForm ? 24 : 10" [class.text-right]="query.expandForm">
|
||||||
<button nz-button type="submit" [nzType]="'primary'" [nzLoading]="query.submitLoading">{{
|
<button nz-button type="submit" [nzType]="'primary'" [nzLoading]="query.submitLoading">{{ 'mxk.text.query' | i18n
|
||||||
'mxk.text.query' | i18n }}</button>
|
}}</button>
|
||||||
<button nz-button type="reset" (click)="onReset()" class="mx-sm" style="display: none">{{
|
<button nz-button type="reset" (click)="onReset()" class="mx-sm" style="display: none">{{ 'mxk.text.reset' | i18n
|
||||||
'mxk.text.reset' | i18n }}</button>
|
}}</button>
|
||||||
<button nz-button (click)="query.expandForm = !query.expandForm" class="mx-sm" style="display: none">
|
<button nz-button (click)="query.expandForm = !query.expandForm" class="mx-sm" style="display: none">
|
||||||
{{ query.expandForm ? ('mxk.text.collapse' | i18n) : ('mxk.text.expand' | i18n) }}</button>
|
{{ query.expandForm ? ('mxk.text.collapse' | i18n) : ('mxk.text.expand' | i18n) }}</button>
|
||||||
<button nz-button nzType="primary" (click)="onSubmit($event)">{{ 'mxk.text.confirm' | i18n }}</button>
|
<button nz-button nzType="primary" (click)="onSubmit($event)">{{ 'mxk.text.confirm' | i18n }}</button>
|
||||||
@ -24,8 +24,8 @@
|
|||||||
</form>
|
</form>
|
||||||
<nz-table #dynamicTable nzTableLayout="auto" nzSize="small" nzBordered nzShowSizeChanger [nzData]="query.results.rows"
|
<nz-table #dynamicTable nzTableLayout="auto" nzSize="small" nzBordered nzShowSizeChanger [nzData]="query.results.rows"
|
||||||
[nzFrontPagination]="false" [nzTotal]="query.results.records" [nzPageSizeOptions]="query.params.pageSizeOptions"
|
[nzFrontPagination]="false" [nzTotal]="query.results.records" [nzPageSizeOptions]="query.params.pageSizeOptions"
|
||||||
[nzPageSize]="query.params.pageSize" [nzPageIndex]="query.params.pageNumber"
|
[nzPageSize]="query.params.pageSize" [nzPageIndex]="query.params.pageNumber" [nzLoading]="this.query.tableLoading"
|
||||||
[nzLoading]="this.query.tableLoading" (nzQueryParams)="onQueryParamsChange($event)" nzWidth="100%">
|
(nzQueryParams)="onQueryParamsChange($event)" nzWidth="100%">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th></th>
|
<th></th>
|
||||||
@ -24,18 +24,18 @@ import { NzMessageService } from 'ng-zorro-antd/message';
|
|||||||
import { NzModalRef, NzModalService } from 'ng-zorro-antd/modal';
|
import { NzModalRef, NzModalService } from 'ng-zorro-antd/modal';
|
||||||
import { NzTableQueryParams } from 'ng-zorro-antd/table';
|
import { NzTableQueryParams } from 'ng-zorro-antd/table';
|
||||||
|
|
||||||
import { RoleMembersService } from '../../../../service/role-members.service';
|
import { GroupMembersService } from '../../../../service/group-members.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-member-roles-editer',
|
selector: 'app-member-groups-editer',
|
||||||
templateUrl: './member-roles-editer.component.html',
|
templateUrl: './member-groups-editer.component.html',
|
||||||
styleUrls: ['./member-roles-editer.component.less']
|
styleUrls: ['./member-groups-editer.component.less']
|
||||||
})
|
})
|
||||||
export class MemberRolesEditerComponent implements OnInit {
|
export class MemberGroupsEditerComponent implements OnInit {
|
||||||
@Input() username?: String;
|
@Input() username?: String;
|
||||||
query: {
|
query: {
|
||||||
params: {
|
params: {
|
||||||
roleName: String;
|
groupName: String;
|
||||||
username: String;
|
username: String;
|
||||||
protocol: String;
|
protocol: String;
|
||||||
startDate: String;
|
startDate: String;
|
||||||
@ -58,7 +58,7 @@ export class MemberRolesEditerComponent implements OnInit {
|
|||||||
checked: boolean;
|
checked: boolean;
|
||||||
} = {
|
} = {
|
||||||
params: {
|
params: {
|
||||||
roleName: '',
|
groupName: '',
|
||||||
username: '',
|
username: '',
|
||||||
protocol: '',
|
protocol: '',
|
||||||
startDate: '',
|
startDate: '',
|
||||||
@ -83,7 +83,7 @@ export class MemberRolesEditerComponent implements OnInit {
|
|||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private modalRef: NzModalRef,
|
private modalRef: NzModalRef,
|
||||||
private roleMembersService: RoleMembersService,
|
private groupMembersService: GroupMembersService,
|
||||||
private viewContainerRef: ViewContainerRef,
|
private viewContainerRef: ViewContainerRef,
|
||||||
private fb: FormBuilder,
|
private fb: FormBuilder,
|
||||||
private msg: NzMessageService,
|
private msg: NzMessageService,
|
||||||
@ -123,7 +123,7 @@ export class MemberRolesEditerComponent implements OnInit {
|
|||||||
this.query.params.endDate = '';
|
this.query.params.endDate = '';
|
||||||
this.query.params.startDate = '';
|
this.query.params.startDate = '';
|
||||||
}
|
}
|
||||||
this.roleMembersService.rolesNoMember(this.query.params).subscribe(res => {
|
this.groupMembersService.noMember(this.query.params).subscribe(res => {
|
||||||
this.query.results = res.data;
|
this.query.results = res.data;
|
||||||
this.query.submitLoading = false;
|
this.query.submitLoading = false;
|
||||||
this.query.tableLoading = false;
|
this.query.tableLoading = false;
|
||||||
@ -168,7 +168,7 @@ export class MemberRolesEditerComponent implements OnInit {
|
|||||||
roleIds = `${roleIds},${selectedData[i].id}`;
|
roleIds = `${roleIds},${selectedData[i].id}`;
|
||||||
roleNames = `${roleNames},${selectedData[i].name}`;
|
roleNames = `${roleNames},${selectedData[i].name}`;
|
||||||
}
|
}
|
||||||
this.roleMembersService.addMember2Roles({ username: this.username, roleId: roleIds, roleName: roleNames }).subscribe(res => {
|
this.groupMembersService.addMember2Roles({ username: this.username, roleId: roleIds, roleName: roleNames }).subscribe(res => {
|
||||||
this.query.results = res.data;
|
this.query.results = res.data;
|
||||||
this.query.submitLoading = false;
|
this.query.submitLoading = false;
|
||||||
this.query.tableLoading = false;
|
this.query.tableLoading = false;
|
||||||
@ -22,14 +22,14 @@ import format from 'date-fns/format';
|
|||||||
import { NzMessageService } from 'ng-zorro-antd/message';
|
import { NzMessageService } from 'ng-zorro-antd/message';
|
||||||
import { NzModalRef, NzModalService } from 'ng-zorro-antd/modal';
|
import { NzModalRef, NzModalService } from 'ng-zorro-antd/modal';
|
||||||
|
|
||||||
import { Roles } from '../../../../entity/Roles';
|
import { Groups } from '../../../../entity/Groups';
|
||||||
import { TreeNodes } from '../../../../entity/TreeNodes';
|
import { TreeNodes } from '../../../../entity/TreeNodes';
|
||||||
|
import { GroupsService } from '../../../../service/Groups.service';
|
||||||
import { OrganizationsService } from '../../../../service/organizations.service';
|
import { OrganizationsService } from '../../../../service/organizations.service';
|
||||||
import { RolesService } from '../../../../service/roles.service';
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-role-editer',
|
selector: 'app-group-editer',
|
||||||
templateUrl: './role-editer.component.html',
|
templateUrl: './group-editer.component.html',
|
||||||
styles: [
|
styles: [
|
||||||
`
|
`
|
||||||
nz-form-item {
|
nz-form-item {
|
||||||
@ -37,18 +37,18 @@ import { RolesService } from '../../../../service/roles.service';
|
|||||||
}
|
}
|
||||||
`
|
`
|
||||||
],
|
],
|
||||||
styleUrls: ['./role-editer.component.less']
|
styleUrls: ['./group-editer.component.less']
|
||||||
})
|
})
|
||||||
export class RoleEditerComponent implements OnInit {
|
export class GroupEditerComponent implements OnInit {
|
||||||
@Input() id?: String;
|
@Input() id?: String;
|
||||||
@Input() isEdit?: boolean;
|
@Input() isEdit?: boolean;
|
||||||
|
|
||||||
form: {
|
form: {
|
||||||
submitting: boolean;
|
submitting: boolean;
|
||||||
model: Roles;
|
model: Groups;
|
||||||
} = {
|
} = {
|
||||||
submitting: false,
|
submitting: false,
|
||||||
model: new Roles()
|
model: new Groups()
|
||||||
};
|
};
|
||||||
|
|
||||||
// TreeNodes
|
// TreeNodes
|
||||||
@ -60,7 +60,7 @@ export class RoleEditerComponent implements OnInit {
|
|||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private modalRef: NzModalRef,
|
private modalRef: NzModalRef,
|
||||||
private rolesService: RolesService,
|
private groupsService: GroupsService,
|
||||||
private orgsService: OrganizationsService,
|
private orgsService: OrganizationsService,
|
||||||
private fb: FormBuilder,
|
private fb: FormBuilder,
|
||||||
private msg: NzMessageService,
|
private msg: NzMessageService,
|
||||||
@ -71,7 +71,7 @@ export class RoleEditerComponent implements OnInit {
|
|||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
this.tree();
|
this.tree();
|
||||||
if (this.isEdit) {
|
if (this.isEdit) {
|
||||||
this.rolesService.get(`${this.id}`).subscribe(res => {
|
this.groupsService.get(`${this.id}`).subscribe(res => {
|
||||||
this.form.model.init(res.data);
|
this.form.model.init(res.data);
|
||||||
this.selectValues = this.form.model.orgIdsList.split(',');
|
this.selectValues = this.form.model.orgIdsList.split(',');
|
||||||
this.cdr.detectChanges();
|
this.cdr.detectChanges();
|
||||||
@ -103,7 +103,7 @@ export class RoleEditerComponent implements OnInit {
|
|||||||
this.form.model.orgIdsList = `${this.form.model.orgIdsList + value},`;
|
this.form.model.orgIdsList = `${this.form.model.orgIdsList + value},`;
|
||||||
});
|
});
|
||||||
|
|
||||||
(this.isEdit ? this.rolesService.update(this.form.model) : this.rolesService.add(this.form.model)).subscribe(res => {
|
(this.isEdit ? this.groupsService.update(this.form.model) : this.groupsService.add(this.form.model)).subscribe(res => {
|
||||||
if (res.code == 0) {
|
if (res.code == 0) {
|
||||||
this.msg.success(this.i18n.fanyi(this.isEdit ? 'mxk.alert.update.success' : 'mxk.alert.add.success'));
|
this.msg.success(this.i18n.fanyi(this.isEdit ? 'mxk.alert.update.success' : 'mxk.alert.add.success'));
|
||||||
} else {
|
} else {
|
||||||
@ -0,0 +1,85 @@
|
|||||||
|
<page-header> </page-header>
|
||||||
|
|
||||||
|
<nz-card [nzBordered]="false">
|
||||||
|
<form nz-form [nzLayout]="'inline'" (ngSubmit)="onSearch()" class="search__form">
|
||||||
|
<div nz-row [nzGutter]="{ xs: 8, sm: 8, md: 8, lg: 24, xl: 48, xxl: 48 }">
|
||||||
|
<div nz-col nzMd="16" nzSm="24">
|
||||||
|
<nz-form-item>
|
||||||
|
<nz-form-label nzFor="name">{{ 'mxk.roles.name' | i18n }}</nz-form-label>
|
||||||
|
<nz-form-control>
|
||||||
|
<input nz-input [(ngModel)]="query.params.groupName" [ngModelOptions]="{ standalone: true }"
|
||||||
|
name="groupName" placeholder="" id="groupName" />
|
||||||
|
</nz-form-control>
|
||||||
|
</nz-form-item>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div nz-col [nzSpan]="query.expandForm ? 24 : 8" [class.text-right]="query.expandForm">
|
||||||
|
<button nz-button type="submit" [nzType]="'primary'" [nzLoading]="query.submitLoading">{{ 'mxk.text.query' |
|
||||||
|
i18n }}</button>
|
||||||
|
<button nz-button type="reset" (click)="onReset()" class="mx-sm" style="display: none">{{ 'mxk.text.reset' |
|
||||||
|
i18n }}</button>
|
||||||
|
<button nz-button (click)="query.expandForm = !query.expandForm" class="mx-sm" style="display: none">
|
||||||
|
{{ query.expandForm ? ('mxk.text.collapse' | i18n) : ('mxk.text.expand' | i18n) }}</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</nz-card>
|
||||||
|
<nz-card>
|
||||||
|
<div nz-col [nzSpan]="24" class="table-list-toolbar">
|
||||||
|
<button nz-button type="button" [nzType]="'primary'" (click)="onAdd($event)">{{ 'mxk.text.add' | i18n }}</button>
|
||||||
|
<button nz-button type="button" (click)="onBatchDelete($event)" [nzType]="'primary'" nzDanger class="mx-sm">{{
|
||||||
|
'mxk.text.delete' | i18n
|
||||||
|
}}</button>
|
||||||
|
</div>
|
||||||
|
<nz-table #dynamicTable nzTableLayout="auto" nzSize="small" nzBordered nzShowSizeChanger [nzData]="query.results.rows"
|
||||||
|
[nzFrontPagination]="false" [nzTotal]="query.results.records" [nzPageSizeOptions]="query.params.pageSizeOptions"
|
||||||
|
[nzPageSize]="query.params.pageSize" [nzPageIndex]="query.params.pageNumber" [nzLoading]="this.query.tableLoading"
|
||||||
|
(nzQueryParams)="onQueryParamsChange($event)" nzWidth="100%">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th [nzChecked]="query.checked" [nzIndeterminate]="query.indeterminate"
|
||||||
|
(nzCheckedChange)="onTableAllChecked($event)"></th>
|
||||||
|
<th nzAlign="center" style="display: none">Id</th>
|
||||||
|
<th nzAlign="center">{{ 'mxk.roles.name' | i18n }}</th>
|
||||||
|
<th nzAlign="center">{{ 'mxk.roles.category' | i18n }}</th>
|
||||||
|
<th nzAlign="center">{{ 'mxk.text.description' | i18n }}</th>
|
||||||
|
<th nzAlign="center" class="table_cell_action_2">{{ 'mxk.text.action' | i18n }}</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr *ngFor="let data of query.results.rows">
|
||||||
|
<td [nzChecked]="query.tableCheckedId.has(data.id)" [nzDisabled]="data.disabled"
|
||||||
|
(nzCheckedChange)="onTableItemChecked(data.id, $event)"></td>
|
||||||
|
<td nzAlign="left" style="display: none">
|
||||||
|
<span>{{ data.id }}</span>
|
||||||
|
</td>
|
||||||
|
<td nzAlign="left" nzBreakWord="false">{{ data.groupName }}</td>
|
||||||
|
<td nzAlign="center" *ngIf="data.category == 'dynamic'"> {{ 'mxk.roles.category.dynamic' | i18n }}</td>
|
||||||
|
<td nzAlign="center" *ngIf="data.category == 'static'"> {{ 'mxk.roles.category.static' | i18n }}</td>
|
||||||
|
<td nzAlign="center" *ngIf="data.category == 'app'"> {{ 'mxk.roles.category.app' | i18n }}</td>
|
||||||
|
<td nzAlign="left">{{ data.description }}</td>
|
||||||
|
<td nzAlign="center" nzBreakWord="false">
|
||||||
|
<div nz-col>
|
||||||
|
<button nz-button type="button" (click)="onEdit($event, data.id)">{{ 'mxk.text.edit' | i18n }}</button>
|
||||||
|
<button nz-button nz-dropdown [nzDropdownMenu]="menuMoreAction">
|
||||||
|
{{ 'mxk.text.moreaction' | i18n }}
|
||||||
|
<i nz-icon nzType="down"></i>
|
||||||
|
</button>
|
||||||
|
|
||||||
|
<nz-dropdown-menu #menuMoreAction="nzDropdownMenu">
|
||||||
|
<ul nz-menu>
|
||||||
|
<li nz-menu-item (click)="onMembers($event, data.id, data.groupName)">{{ 'mxk.roles.member' | i18n }}
|
||||||
|
</li>
|
||||||
|
<li nz-menu-item (click)="onPermissions($event, data.id, data.groupName)">{{ 'mxk.roles.permissions' |
|
||||||
|
i18n }}</li>
|
||||||
|
<li nz-menu-item
|
||||||
|
*ngIf="data.roleCode != 'ROLE_ADMINISTRATORS' && data.roleCode != 'ROLE_ALL_USER' && data.roleCode != 'ROLE_MANAGERS'"
|
||||||
|
(click)="onDelete($event, data.id)" nzDanger>{{ 'mxk.text.delete' | i18n }}</li>
|
||||||
|
</ul>
|
||||||
|
</nz-dropdown-menu>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</nz-table>
|
||||||
|
</nz-card>
|
||||||
@ -25,19 +25,19 @@ import { NzMessageService } from 'ng-zorro-antd/message';
|
|||||||
import { NzModalRef, NzModalService } from 'ng-zorro-antd/modal';
|
import { NzModalRef, NzModalService } from 'ng-zorro-antd/modal';
|
||||||
import { NzTableQueryParams } from 'ng-zorro-antd/table';
|
import { NzTableQueryParams } from 'ng-zorro-antd/table';
|
||||||
|
|
||||||
import { RolesService } from '../../../service/roles.service';
|
import { GroupsService } from '../../../service/Groups.service';
|
||||||
import { set2String } from '../../../shared/index';
|
import { set2String } from '../../../shared/index';
|
||||||
import { RoleEditerComponent } from './role-editer/role-editer.component';
|
import { GroupEditerComponent } from './group-editer/group-editer.component';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-roles',
|
selector: 'app-groups',
|
||||||
templateUrl: './roles.component.html',
|
templateUrl: './groups.component.html',
|
||||||
styleUrls: ['./roles.component.less']
|
styleUrls: ['./groups.component.less']
|
||||||
})
|
})
|
||||||
export class RolesComponent implements OnInit {
|
export class GroupsComponent implements OnInit {
|
||||||
query: {
|
query: {
|
||||||
params: {
|
params: {
|
||||||
roleName: String;
|
groupName: String;
|
||||||
displayName: String;
|
displayName: String;
|
||||||
employeeNumber: String;
|
employeeNumber: String;
|
||||||
startDate: String;
|
startDate: String;
|
||||||
@ -60,7 +60,7 @@ export class RolesComponent implements OnInit {
|
|||||||
checked: boolean;
|
checked: boolean;
|
||||||
} = {
|
} = {
|
||||||
params: {
|
params: {
|
||||||
roleName: '',
|
groupName: '',
|
||||||
displayName: '',
|
displayName: '',
|
||||||
employeeNumber: '',
|
employeeNumber: '',
|
||||||
startDate: '',
|
startDate: '',
|
||||||
@ -86,7 +86,7 @@ export class RolesComponent implements OnInit {
|
|||||||
constructor(
|
constructor(
|
||||||
private modalService: NzModalService,
|
private modalService: NzModalService,
|
||||||
private viewContainerRef: ViewContainerRef,
|
private viewContainerRef: ViewContainerRef,
|
||||||
private rolesService: RolesService,
|
private groupsService: GroupsService,
|
||||||
private fb: FormBuilder,
|
private fb: FormBuilder,
|
||||||
private msg: NzMessageService,
|
private msg: NzMessageService,
|
||||||
private router: Router,
|
private router: Router,
|
||||||
@ -112,7 +112,7 @@ export class RolesComponent implements OnInit {
|
|||||||
|
|
||||||
onBatchDelete(e: MouseEvent): void {
|
onBatchDelete(e: MouseEvent): void {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
this.rolesService.delete(set2String(this.query.tableCheckedId)).subscribe(res => {
|
this.groupsService.delete(set2String(this.query.tableCheckedId)).subscribe(res => {
|
||||||
if (res.code == 0) {
|
if (res.code == 0) {
|
||||||
this.msg.success(this.i18n.fanyi('mxk.alert.delete.success'));
|
this.msg.success(this.i18n.fanyi('mxk.alert.delete.success'));
|
||||||
this.fetch();
|
this.fetch();
|
||||||
@ -126,7 +126,7 @@ export class RolesComponent implements OnInit {
|
|||||||
onAdd(e: MouseEvent): void {
|
onAdd(e: MouseEvent): void {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
const modal = this.modalService.create({
|
const modal = this.modalService.create({
|
||||||
nzContent: RoleEditerComponent,
|
nzContent: GroupEditerComponent,
|
||||||
nzViewContainerRef: this.viewContainerRef,
|
nzViewContainerRef: this.viewContainerRef,
|
||||||
nzComponentParams: {
|
nzComponentParams: {
|
||||||
isEdit: false,
|
isEdit: false,
|
||||||
@ -146,7 +146,7 @@ export class RolesComponent implements OnInit {
|
|||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
||||||
const modal = this.modalService.create({
|
const modal = this.modalService.create({
|
||||||
nzContent: RoleEditerComponent,
|
nzContent: GroupEditerComponent,
|
||||||
nzViewContainerRef: this.viewContainerRef,
|
nzViewContainerRef: this.viewContainerRef,
|
||||||
nzComponentParams: {
|
nzComponentParams: {
|
||||||
isEdit: true,
|
isEdit: true,
|
||||||
@ -164,7 +164,7 @@ export class RolesComponent implements OnInit {
|
|||||||
|
|
||||||
onDelete(e: MouseEvent, deleteId: String): void {
|
onDelete(e: MouseEvent, deleteId: String): void {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
this.rolesService.delete(deleteId).subscribe(res => {
|
this.groupsService.delete(deleteId).subscribe(res => {
|
||||||
if (res.code == 0) {
|
if (res.code == 0) {
|
||||||
this.msg.success(this.i18n.fanyi('mxk.alert.delete.success'));
|
this.msg.success(this.i18n.fanyi('mxk.alert.delete.success'));
|
||||||
this.fetch();
|
this.fetch();
|
||||||
@ -196,7 +196,7 @@ export class RolesComponent implements OnInit {
|
|||||||
this.query.params.endDate = '';
|
this.query.params.endDate = '';
|
||||||
this.query.params.startDate = '';
|
this.query.params.startDate = '';
|
||||||
}
|
}
|
||||||
this.rolesService.fetch(this.query.params).subscribe(res => {
|
this.groupsService.fetch(this.query.params).subscribe(res => {
|
||||||
this.query.results = res.data;
|
this.query.results = res.data;
|
||||||
this.query.submitLoading = false;
|
this.query.submitLoading = false;
|
||||||
this.query.tableLoading = false;
|
this.query.tableLoading = false;
|
||||||
@ -4,19 +4,19 @@
|
|||||||
<div nz-row [nzGutter]="{ xs: 8, sm: 8, md: 8, lg: 24, xl: 48, xxl: 48 }">
|
<div nz-row [nzGutter]="{ xs: 8, sm: 8, md: 8, lg: 24, xl: 48, xxl: 48 }">
|
||||||
<div nz-col nzMd="14" nzSm="24">
|
<div nz-col nzMd="14" nzSm="24">
|
||||||
<nz-form-item>
|
<nz-form-item>
|
||||||
<nz-form-label nzFor="roleName">{{ 'mxk.roles.name' | i18n }}</nz-form-label>
|
<nz-form-label nzFor="groupName">{{ 'mxk.roles.name' | i18n }}</nz-form-label>
|
||||||
<nz-form-control>
|
<nz-form-control>
|
||||||
<input nz-input [(ngModel)]="query.params.roleName" [ngModelOptions]="{ standalone: true }" name="roleName"
|
<input nz-input [(ngModel)]="query.params.groupName" [ngModelOptions]="{ standalone: true }" name="groupName"
|
||||||
placeholder="" id="roleName" />
|
placeholder="" id="groupName" />
|
||||||
</nz-form-control>
|
</nz-form-control>
|
||||||
</nz-form-item>
|
</nz-form-item>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div nz-col [nzSpan]="query.expandForm ? 24 : 10" [class.text-right]="query.expandForm">
|
<div nz-col [nzSpan]="query.expandForm ? 24 : 10" [class.text-right]="query.expandForm">
|
||||||
<button nz-button type="submit" [nzType]="'primary'" [nzLoading]="query.submitLoading">{{ 'mxk.text.query' |
|
<button nz-button type="submit" [nzType]="'primary'" [nzLoading]="query.submitLoading">{{ 'mxk.text.query' | i18n
|
||||||
i18n }}</button>
|
}}</button>
|
||||||
<button nz-button type="reset" (click)="onReset()" class="mx-sm" style="display: none">{{ 'mxk.text.reset' |
|
<button nz-button type="reset" (click)="onReset()" class="mx-sm" style="display: none">{{ 'mxk.text.reset' | i18n
|
||||||
i18n }}</button>
|
}}</button>
|
||||||
<button nz-button (click)="query.expandForm = !query.expandForm" class="mx-sm" style="display: none">
|
<button nz-button (click)="query.expandForm = !query.expandForm" class="mx-sm" style="display: none">
|
||||||
{{ query.expandForm ? ('mxk.text.collapse' | i18n) : ('mxk.text.expand' | i18n) }}</button>
|
{{ query.expandForm ? ('mxk.text.collapse' | i18n) : ('mxk.text.expand' | i18n) }}</button>
|
||||||
<button nz-button nzType="primary" (click)="onSubmit($event)">{{ 'mxk.text.confirm' | i18n }}</button>
|
<button nz-button nzType="primary" (click)="onSubmit($event)">{{ 'mxk.text.confirm' | i18n }}</button>
|
||||||
@ -43,7 +43,7 @@
|
|||||||
<td nzAlign="left" style="display: none">
|
<td nzAlign="left" style="display: none">
|
||||||
<span>{{ data.id }}</span>
|
<span>{{ data.id }}</span>
|
||||||
</td>
|
</td>
|
||||||
<td nzAlign="left"> {{ data.roleName }}</td>
|
<td nzAlign="left"> {{ data.groupName }}</td>
|
||||||
<td nzAlign="center" *ngIf="data.category == 'dynamic'"> {{ 'mxk.roles.category.dynamic' | i18n }}</td>
|
<td nzAlign="center" *ngIf="data.category == 'dynamic'"> {{ 'mxk.roles.category.dynamic' | i18n }}</td>
|
||||||
<td nzAlign="center" *ngIf="data.category == 'static'"> {{ 'mxk.roles.category.static' | i18n }}</td>
|
<td nzAlign="center" *ngIf="data.category == 'static'"> {{ 'mxk.roles.category.static' | i18n }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
@ -23,17 +23,17 @@ import { NzMessageService } from 'ng-zorro-antd/message';
|
|||||||
import { NzModalRef, NzModalService } from 'ng-zorro-antd/modal';
|
import { NzModalRef, NzModalService } from 'ng-zorro-antd/modal';
|
||||||
import { NzTableQueryParams } from 'ng-zorro-antd/table';
|
import { NzTableQueryParams } from 'ng-zorro-antd/table';
|
||||||
|
|
||||||
import { RolesService } from '../../../../service/roles.service';
|
import { GroupsService } from '../../../../service/Groups.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-select-roles',
|
selector: 'app-select-groups',
|
||||||
templateUrl: './select-roles.component.html',
|
templateUrl: './select-groups.component.html',
|
||||||
styleUrls: ['./select-roles.component.less']
|
styleUrls: ['./select-groups.component.less']
|
||||||
})
|
})
|
||||||
export class SelectRolesComponent implements OnInit {
|
export class SelectGroupsComponent implements OnInit {
|
||||||
query: {
|
query: {
|
||||||
params: {
|
params: {
|
||||||
roleName: String;
|
groupName: String;
|
||||||
displayName: String;
|
displayName: String;
|
||||||
protocol: String;
|
protocol: String;
|
||||||
startDate: String;
|
startDate: String;
|
||||||
@ -56,7 +56,7 @@ export class SelectRolesComponent implements OnInit {
|
|||||||
checked: boolean;
|
checked: boolean;
|
||||||
} = {
|
} = {
|
||||||
params: {
|
params: {
|
||||||
roleName: '',
|
groupName: '',
|
||||||
displayName: '',
|
displayName: '',
|
||||||
protocol: '',
|
protocol: '',
|
||||||
startDate: '',
|
startDate: '',
|
||||||
@ -81,7 +81,7 @@ export class SelectRolesComponent implements OnInit {
|
|||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private modalRef: NzModalRef,
|
private modalRef: NzModalRef,
|
||||||
private rolesService: RolesService,
|
private groupsService: GroupsService,
|
||||||
private viewContainerRef: ViewContainerRef,
|
private viewContainerRef: ViewContainerRef,
|
||||||
private fb: FormBuilder,
|
private fb: FormBuilder,
|
||||||
private msg: NzMessageService,
|
private msg: NzMessageService,
|
||||||
@ -117,7 +117,7 @@ export class SelectRolesComponent implements OnInit {
|
|||||||
this.query.params.endDate = '';
|
this.query.params.endDate = '';
|
||||||
this.query.params.startDate = '';
|
this.query.params.startDate = '';
|
||||||
}
|
}
|
||||||
this.rolesService.fetch(this.query.params).subscribe(res => {
|
this.groupsService.fetch(this.query.params).subscribe(res => {
|
||||||
this.query.results = res.data;
|
this.query.results = res.data;
|
||||||
this.query.submitLoading = false;
|
this.query.submitLoading = false;
|
||||||
this.query.tableLoading = false;
|
this.query.tableLoading = false;
|
||||||
@ -0,0 +1,56 @@
|
|||||||
|
/*
|
||||||
|
* Copyright [2022] [MaxKey of copyright http://www.maxkey.top]
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import { CommonModule } from '@angular/common';
|
||||||
|
import { NgModule } from '@angular/core';
|
||||||
|
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
||||||
|
import { RouterModule, Routes } from '@angular/router';
|
||||||
|
import { SharedModule } from '@shared';
|
||||||
|
import { NzIconModule } from 'ng-zorro-antd/icon';
|
||||||
|
|
||||||
|
import { GroupMembersEditerComponent } from './group-members/group-members-editer/group-members-editer.component';
|
||||||
|
import { GroupMembersComponent } from './group-members/group-members.component';
|
||||||
|
import { MemberGroupsEditerComponent } from './group-members/member-groups-editer/member-groups-editer.component';
|
||||||
|
import { GroupEditerComponent } from './groups/group-editer/group-editer.component';
|
||||||
|
import { GroupsComponent } from './groups/groups.component';
|
||||||
|
import { SelectGroupsComponent } from './groups/select-groups/select-groups.component';
|
||||||
|
import { OrganizationsComponent } from './organizations/organizations.component';
|
||||||
|
import { UsersComponent } from './users/users.component';
|
||||||
|
|
||||||
|
const routes: Routes = [
|
||||||
|
{ path: 'organizations', component: OrganizationsComponent },
|
||||||
|
{ path: 'users', component: UsersComponent },
|
||||||
|
{ path: 'groups', component: GroupsComponent },
|
||||||
|
{ path: 'groupmembers', component: GroupMembersComponent }
|
||||||
|
];
|
||||||
|
|
||||||
|
const COMPONENTS = [
|
||||||
|
//UsersComponent,
|
||||||
|
OrganizationsComponent,
|
||||||
|
GroupsComponent,
|
||||||
|
GroupMembersComponent,
|
||||||
|
SelectGroupsComponent,
|
||||||
|
GroupMembersEditerComponent,
|
||||||
|
MemberGroupsEditerComponent,
|
||||||
|
GroupEditerComponent
|
||||||
|
];
|
||||||
|
|
||||||
|
@NgModule({
|
||||||
|
declarations: [...COMPONENTS],
|
||||||
|
imports: [FormsModule, NzIconModule, SharedModule, CommonModule, RouterModule.forChild(routes)],
|
||||||
|
exports: [RouterModule]
|
||||||
|
})
|
||||||
|
export class IdmModule {}
|
||||||
@ -26,8 +26,8 @@ import { NzModalRef, NzModalService } from 'ng-zorro-antd/modal';
|
|||||||
import { NzFormatEmitEvent, NzTreeNode, NzTreeNodeOptions } from 'ng-zorro-antd/tree';
|
import { NzFormatEmitEvent, NzTreeNode, NzTreeNodeOptions } from 'ng-zorro-antd/tree';
|
||||||
import { NzTreeSelectComponent } from 'ng-zorro-antd/tree-select';
|
import { NzTreeSelectComponent } from 'ng-zorro-antd/tree-select';
|
||||||
|
|
||||||
import { Organizations } from '../../../entity/Organizations';
|
import { Organizations } from '../../../../entity/Organizations';
|
||||||
import { OrganizationsService } from '../../../service/organizations.service';
|
import { OrganizationsService } from '../../../../service/organizations.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-organization-editer',
|
selector: 'app-organization-editer',
|
||||||
@ -26,10 +26,10 @@ import { NzModalRef, NzModalService } from 'ng-zorro-antd/modal';
|
|||||||
import { NzTableQueryParams } from 'ng-zorro-antd/table';
|
import { NzTableQueryParams } from 'ng-zorro-antd/table';
|
||||||
import { NzFormatEmitEvent, NzTreeNode, NzTreeNodeOptions } from 'ng-zorro-antd/tree';
|
import { NzFormatEmitEvent, NzTreeNode, NzTreeNodeOptions } from 'ng-zorro-antd/tree';
|
||||||
|
|
||||||
import { PageResults } from '../../entity/PageResults';
|
import { PageResults } from '../../../entity/PageResults';
|
||||||
import { TreeNodes } from '../../entity/TreeNodes';
|
import { TreeNodes } from '../../../entity/TreeNodes';
|
||||||
import { OrganizationsService } from '../../service/organizations.service';
|
import { OrganizationsService } from '../../../service/organizations.service';
|
||||||
import { set2String } from '../../shared/index';
|
import { set2String } from '../../../shared/index';
|
||||||
import { OrganizationEditerComponent } from './organization-editer/organization-editer.component';
|
import { OrganizationEditerComponent } from './organization-editer/organization-editer.component';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
@ -21,9 +21,9 @@ import { ALAIN_I18N_TOKEN, SettingsService } from '@delon/theme';
|
|||||||
import { NzMessageService } from 'ng-zorro-antd/message';
|
import { NzMessageService } from 'ng-zorro-antd/message';
|
||||||
import { NzModalRef, NzModalService } from 'ng-zorro-antd/modal';
|
import { NzModalRef, NzModalService } from 'ng-zorro-antd/modal';
|
||||||
|
|
||||||
import { ChangePassword } from '../../../entity/ChangePassword';
|
import { ChangePassword } from '../../../../entity/ChangePassword';
|
||||||
import { PasswordService } from '../../../service/password.service';
|
import { PasswordService } from '../../../../service/password.service';
|
||||||
import { UsersService } from '../../../service/users.service';
|
import { UsersService } from '../../../../service/users.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-password',
|
selector: 'app-password',
|
||||||
@ -12,10 +12,10 @@
|
|||||||
</nz-form-item>
|
</nz-form-item>
|
||||||
</div>
|
</div>
|
||||||
<div nz-col [nzSpan]="query.expandForm ? 24 : 10" [class.text-right]="query.expandForm">
|
<div nz-col [nzSpan]="query.expandForm ? 24 : 10" [class.text-right]="query.expandForm">
|
||||||
<button nz-button type="submit" [nzType]="'primary'" [nzLoading]="query.submitLoading">{{ 'mxk.text.query' |
|
<button nz-button type="submit" [nzType]="'primary'" [nzLoading]="query.submitLoading">{{ 'mxk.text.query' | i18n
|
||||||
i18n }}</button>
|
}}</button>
|
||||||
<button nz-button type="reset" (click)="onReset()" class="mx-sm" style="display: none">{{ 'mxk.text.reset' |
|
<button nz-button type="reset" (click)="onReset()" class="mx-sm" style="display: none">{{ 'mxk.text.reset' | i18n
|
||||||
i18n }}</button>
|
}}</button>
|
||||||
<button nz-button (click)="query.expandForm = !query.expandForm" class="mx-sm" style="display: none">
|
<button nz-button (click)="query.expandForm = !query.expandForm" class="mx-sm" style="display: none">
|
||||||
{{ query.expandForm ? ('mxk.text.collapse' | i18n) : ('mxk.text.expand' | i18n) }}</button>
|
{{ query.expandForm ? ('mxk.text.collapse' | i18n) : ('mxk.text.expand' | i18n) }}</button>
|
||||||
<button nz-button nzType="primary" (click)="onSubmit($event)">{{ 'mxk.text.confirm' | i18n }}</button>
|
<button nz-button nzType="primary" (click)="onSubmit($event)">{{ 'mxk.text.confirm' | i18n }}</button>
|
||||||
@ -24,10 +24,10 @@ import { NzModalRef, NzModalService } from 'ng-zorro-antd/modal';
|
|||||||
import { NzTableQueryParams } from 'ng-zorro-antd/table';
|
import { NzTableQueryParams } from 'ng-zorro-antd/table';
|
||||||
import { NzFormatEmitEvent, NzTreeNode, NzTreeNodeOptions } from 'ng-zorro-antd/tree';
|
import { NzFormatEmitEvent, NzTreeNode, NzTreeNodeOptions } from 'ng-zorro-antd/tree';
|
||||||
|
|
||||||
import { TreeNodes } from '../../../entity/TreeNodes';
|
import { TreeNodes } from '../../../../entity/TreeNodes';
|
||||||
import { OrganizationsService } from '../../../service/organizations.service';
|
import { OrganizationsService } from '../../../../service/organizations.service';
|
||||||
import { UsersService } from '../../../service/users.service';
|
import { UsersService } from '../../../../service/users.service';
|
||||||
import { set2String } from '../../../shared/index';
|
import { set2String } from '../../../../shared/index';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-select-user',
|
selector: 'app-select-user',
|
||||||
@ -26,8 +26,8 @@ import { NzFormatEmitEvent, NzTreeNode, NzTreeNodeOptions } from 'ng-zorro-antd/
|
|||||||
import { NzTreeSelectComponent } from 'ng-zorro-antd/tree-select';
|
import { NzTreeSelectComponent } from 'ng-zorro-antd/tree-select';
|
||||||
import { NzUploadFile, NzUploadChangeParam } from 'ng-zorro-antd/upload';
|
import { NzUploadFile, NzUploadChangeParam } from 'ng-zorro-antd/upload';
|
||||||
|
|
||||||
import { Users } from '../../../entity/Users';
|
import { Users } from '../../../../entity/Users';
|
||||||
import { UsersService } from '../../../service/users.service';
|
import { UsersService } from '../../../../service/users.service';
|
||||||
|
|
||||||
const getBase64 = (file: File): Promise<string | ArrayBuffer | null> =>
|
const getBase64 = (file: File): Promise<string | ArrayBuffer | null> =>
|
||||||
new Promise((resolve, reject) => {
|
new Promise((resolve, reject) => {
|
||||||
@ -0,0 +1,159 @@
|
|||||||
|
<page-header> </page-header>
|
||||||
|
|
||||||
|
<nz-card [nzBordered]="false">
|
||||||
|
<form nz-form [nzLayout]="'inline'" (ngSubmit)="onSearch()" class="search__form">
|
||||||
|
<div nz-row [nzGutter]="{ xs: 8, sm: 8, md: 24, lg: 24, xl: 48, xxl: 48 }">
|
||||||
|
<div nz-col nzMd="16" nzSm="24">
|
||||||
|
<nz-form-item>
|
||||||
|
<nz-form-label nzFor="name">{{ 'mxk.users.username' | i18n }}</nz-form-label>
|
||||||
|
<nz-form-control>
|
||||||
|
<input nz-input [(ngModel)]="query.params.username" [ngModelOptions]="{ standalone: true }" name="username"
|
||||||
|
placeholder="" id="username" />
|
||||||
|
</nz-form-control>
|
||||||
|
</nz-form-item>
|
||||||
|
</div>
|
||||||
|
<div nz-col [nzSpan]="query.expandForm ? 24 : 8" [class.text-right]="query.expandForm">
|
||||||
|
<button nz-button type="submit" [nzType]="'primary'" [nzLoading]="query.submitLoading">{{ 'mxk.text.query' |
|
||||||
|
i18n }}</button>
|
||||||
|
<button nz-button type="reset" (click)="onReset()" class="mx-sm" style="display: none">{{ 'mxk.text.reset' |
|
||||||
|
i18n }}</button>
|
||||||
|
<button nz-button (click)="query.expandForm = !query.expandForm" class="mx-sm" style="display: none">
|
||||||
|
{{ query.expandForm ? ('mxk.text.collapse' | i18n) : ('mxk.text.expand' | i18n) }}</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</nz-card>
|
||||||
|
<nz-card [nzBordered]="false">
|
||||||
|
<div nz-row>
|
||||||
|
<div nz-col [nzSpan]="24" class="table-list-toolbar">
|
||||||
|
<button nz-button type="button" [nzType]="'primary'" (click)="onAdd($event)">
|
||||||
|
{{ 'mxk.text.add' | i18n }}
|
||||||
|
</button>
|
||||||
|
<button nz-button type="button" [nzType]="'primary'" (click)="changePassword($event)">
|
||||||
|
{{ 'mxk.text.changepassword' | i18n }}
|
||||||
|
</button>
|
||||||
|
<button nz-button type="button" (click)="onBatchDelete($event)" [nzType]="'primary'" nzDanger class="mx-sm">
|
||||||
|
{{ 'mxk.text.delete' | i18n }}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<div nz-col [nzSpan]="6" class="grid-border">
|
||||||
|
<nz-tree nzShowLine="false" [nzCheckable]="treeNodes.checkable" nzBlockNode [nzData]="treeNodes.nodes"
|
||||||
|
(nzClick)="activeNode($event)" (nzDblClick)="openFolder($event)" [nzTreeTemplate]="nzTreeTemplate"></nz-tree>
|
||||||
|
<ng-template #nzTreeTemplate let-node let-origin="origin">
|
||||||
|
<span class="custom-node">
|
||||||
|
<span *ngIf="!node.isLeaf" (contextmenu)="contextMenu($event, menu)">
|
||||||
|
<i nz-icon [nzType]="node.isExpanded ? 'folder-open' : 'folder'" (click)="openFolder(node)"></i>
|
||||||
|
<span class="folder-name">{{ node.title + (origin.type == 'virtual' ? '_v' : '') }}</span>
|
||||||
|
</span>
|
||||||
|
<span *ngIf="node.isLeaf" (contextmenu)="contextMenu($event, menu)">
|
||||||
|
<i nz-icon nzType="file"></i>
|
||||||
|
<span class="file-name">{{ node.title + (origin.type == 'virtual' ? '_v' : '') }}</span>
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
</ng-template>
|
||||||
|
<nz-dropdown-menu #menu="nzDropdownMenu">
|
||||||
|
<ul nz-menu>
|
||||||
|
<li nz-menu-item (click)="selectDropdown()">Action 1</li>
|
||||||
|
<li nz-menu-item (click)="selectDropdown()">Action 2</li>
|
||||||
|
</ul>
|
||||||
|
</nz-dropdown-menu>
|
||||||
|
</div>
|
||||||
|
<div nz-col nzMd="18" nzSm="24" class="grid-border">
|
||||||
|
<nz-table #dynamicTable nzTableLayout="auto" nzSize="small" nzBordered sizeChanger="true" nzShowSizeChanger
|
||||||
|
[nzData]="query.results.rows" [nzFrontPagination]="false" [nzTotal]="query.results.records"
|
||||||
|
[nzPageSizeOptions]="query.params.pageSizeOptions" [nzPageSize]="query.params.pageSize"
|
||||||
|
[nzPageIndex]="query.params.pageNumber" [nzLoading]="this.query.tableLoading"
|
||||||
|
(nzQueryParams)="onQueryParamsChange($event)" nzWidth="100%">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th [nzChecked]="query.checked" [nzIndeterminate]="query.indeterminate"
|
||||||
|
(nzCheckedChange)="onTableAllChecked($event)"></th>
|
||||||
|
<th nzAlign="center" style="display: none">{{ 'mxk.text.id' | i18n }}</th>
|
||||||
|
<th nzAlign="center">{{ 'mxk.users.username' | i18n }}</th>
|
||||||
|
<th nzAlign="center">{{ 'mxk.users.displayName' | i18n }}</th>
|
||||||
|
<th nzAlign="center">{{ 'mxk.users.employeeNumber' | i18n }}</th>
|
||||||
|
<th nzAlign="center">{{ 'mxk.users.department' | i18n }}</th>
|
||||||
|
<th nzAlign="center">{{ 'mxk.users.jobTitle' | i18n }}</th>
|
||||||
|
<th nzAlign="center">{{ 'mxk.users.gender' | i18n }}</th>
|
||||||
|
<th nzAlign="center">{{ 'mxk.text.status' | i18n }}</th>
|
||||||
|
<th nzAlign="center" class="table_cell_action_2">{{ 'mxk.text.action' | i18n }}</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr *ngFor="let data of query.results.rows">
|
||||||
|
<td [nzChecked]="query.tableCheckedId.has(data.id)" [nzDisabled]="data.disabled"
|
||||||
|
(nzCheckedChange)="onTableItemChecked(data.id, $event)"></td>
|
||||||
|
<td nzAlign="left" style="display: none">
|
||||||
|
<span>{{ data.id }}</span>
|
||||||
|
</td>
|
||||||
|
<td nzAlign="left"> {{ data.username }}</td>
|
||||||
|
<td nzAlign="left"> {{ data.displayName }}</td>
|
||||||
|
<td nzAlign="left"> {{ data.employeeNumber }}</td>
|
||||||
|
<td nzAlign="left"> {{ data.department }}</td>
|
||||||
|
<td nzAlign="left"> {{ data.jobTitle }}</td>
|
||||||
|
<td nzAlign="center"> {{ data.gender == 1 ? ('mxk.users.gender.female' | i18n) : ('mxk.users.gender.male' |
|
||||||
|
i18n) }}</td>
|
||||||
|
<td nzAlign="center">
|
||||||
|
<a title="{{ 'mxk.users.status.active' | i18n }}" *ngIf="data.status == 1">
|
||||||
|
<i nz-icon nzType="check-circle" nzTheme="fill" style="color: green"> </i>
|
||||||
|
</a>
|
||||||
|
<a title="{{ 'mxk.users.status.inactive' | i18n }}" *ngIf="data.status == 2">
|
||||||
|
<i nz-icon nzType="warning" nzTheme="fill" style="color: gray"></i>
|
||||||
|
</a>
|
||||||
|
<a title="{{ 'mxk.users.status.forbidden' | i18n }}" *ngIf="data.status == 4">
|
||||||
|
<i nz-icon nzType="stop" nzTheme="fill" style="color: gray"></i>
|
||||||
|
</a>
|
||||||
|
<a title="{{ 'mxk.users.status.lock' | i18n }}" *ngIf="data.status == 5">
|
||||||
|
<i nz-icon nzType="lock" nzTheme="fill" style="color: orange"></i>
|
||||||
|
</a>
|
||||||
|
<a title="{{ 'mxk.users.status.delete' | i18n }}" *ngIf="data.status == 9">
|
||||||
|
<i nz-icon nzType="close-circle" nzTheme="fill" style="color: red"></i>
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
<td nzAlign="center" nzBreakWord="false">
|
||||||
|
<div nz-col>
|
||||||
|
<button nz-button type="button" (click)="onEdit($event, data.id)">
|
||||||
|
{{ 'mxk.text.edit' | i18n }}
|
||||||
|
</button>
|
||||||
|
<button *ngIf="data.status == 9" nz-button nz-dropdown>
|
||||||
|
{{ 'mxk.text.moreaction' | i18n }}
|
||||||
|
<i nz-icon nzType="down"></i>
|
||||||
|
</button>
|
||||||
|
<button *ngIf="data.status !== 9" nz-button nz-dropdown [nzDropdownMenu]="menuMoreAction">
|
||||||
|
{{ 'mxk.text.moreaction' | i18n }}
|
||||||
|
<i nz-icon nzType="down"></i>
|
||||||
|
</button>
|
||||||
|
<nz-dropdown-menu #menuMoreAction="nzDropdownMenu">
|
||||||
|
<ul nz-menu>
|
||||||
|
<li nz-menu-item *ngIf="data.status == 1"
|
||||||
|
(click)="onNavToUrl($event, data.id, data.username, 'roles')">{{
|
||||||
|
'mxk.text.roles' | i18n
|
||||||
|
}}</li>
|
||||||
|
<li nz-menu-item *ngIf="data.status == 1" (click)="changePasswordById($event, data.id)">{{
|
||||||
|
'mxk.text.changepassword' | i18n
|
||||||
|
}}</li>
|
||||||
|
<li nz-menu-item *ngIf="data.status == 1" (click)="onUpdateStatus($event, data.id, 5)">{{
|
||||||
|
'mxk.text.lock' | i18n }}</li>
|
||||||
|
<li nz-menu-item *ngIf="data.status == 1" (click)="onUpdateStatus($event, data.id, 4)">{{
|
||||||
|
'mxk.text.disable' | i18n
|
||||||
|
}}</li>
|
||||||
|
<li nz-menu-item *ngIf="data.status == 2" (click)="onUpdateStatus($event, data.id, 1)">{{
|
||||||
|
'mxk.text.enable' | i18n
|
||||||
|
}}</li>
|
||||||
|
<li nz-menu-item *ngIf="data.status == 4" (click)="onUpdateStatus($event, data.id, 1)">{{
|
||||||
|
'mxk.text.enable' | i18n
|
||||||
|
}}</li>
|
||||||
|
<li nz-menu-item *ngIf="data.status == 5" (click)="onUpdateStatus($event, data.id, 1)">{{
|
||||||
|
'mxk.text.unlock' | i18n
|
||||||
|
}}</li>
|
||||||
|
<li nz-menu-item (click)="onDelete($event, data.id)" nzDanger>{{ 'mxk.text.delete' | i18n }}</li>
|
||||||
|
</ul>
|
||||||
|
</nz-dropdown-menu>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</nz-table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</nz-card>
|
||||||
@ -28,11 +28,11 @@ import { NzTableQueryParams } from 'ng-zorro-antd/table';
|
|||||||
import { NzFormatEmitEvent, NzTreeNode, NzTreeNodeOptions } from 'ng-zorro-antd/tree';
|
import { NzFormatEmitEvent, NzTreeNode, NzTreeNodeOptions } from 'ng-zorro-antd/tree';
|
||||||
import { Users } from 'src/app/entity/Users';
|
import { Users } from 'src/app/entity/Users';
|
||||||
|
|
||||||
import { PageResults } from '../../entity/PageResults';
|
import { PageResults } from '../../../entity/PageResults';
|
||||||
import { TreeNodes } from '../../entity/TreeNodes';
|
import { TreeNodes } from '../../../entity/TreeNodes';
|
||||||
import { OrganizationsService } from '../../service/organizations.service';
|
import { OrganizationsService } from '../../../service/organizations.service';
|
||||||
import { UsersService } from '../../service/users.service';
|
import { UsersService } from '../../../service/users.service';
|
||||||
import { set2String } from '../../shared/index';
|
import { set2String } from '../../../shared/index';
|
||||||
import { PasswordComponent } from './password/password.component';
|
import { PasswordComponent } from './password/password.component';
|
||||||
import { UserEditerComponent } from './user-editer/user-editer.component';
|
import { UserEditerComponent } from './user-editer/user-editer.component';
|
||||||
|
|
||||||
@ -20,8 +20,6 @@ import { RouterModule, Routes } from '@angular/router';
|
|||||||
import { SharedModule } from '@shared';
|
import { SharedModule } from '@shared';
|
||||||
import { NzIconModule } from 'ng-zorro-antd/icon';
|
import { NzIconModule } from 'ng-zorro-antd/icon';
|
||||||
|
|
||||||
import { RolesComponent } from '../access/roles/roles.component';
|
|
||||||
import { SelectRolesComponent } from '../access/roles/select-roles/select-roles.component';
|
|
||||||
import { PrivilegesComponent } from './privileges/privileges.component';
|
import { PrivilegesComponent } from './privileges/privileges.component';
|
||||||
import { ResourceEditerComponent } from './resources/resource-editer/resource-editer.component';
|
import { ResourceEditerComponent } from './resources/resource-editer/resource-editer.component';
|
||||||
import { ResourcesComponent } from './resources/resources.component';
|
import { ResourcesComponent } from './resources/resources.component';
|
||||||
|
|||||||
@ -5,16 +5,10 @@
|
|||||||
<div nz-row [nzGutter]="{ xs: 8, sm: 8, md: 8, lg: 24, xl: 48, xxl: 48 }">
|
<div nz-row [nzGutter]="{ xs: 8, sm: 8, md: 8, lg: 24, xl: 48, xxl: 48 }">
|
||||||
<div nz-col nzMd="10" nzSm="24">
|
<div nz-col nzMd="10" nzSm="24">
|
||||||
<nz-form-item>
|
<nz-form-item>
|
||||||
<nz-form-label nzFor="roleName">{{ 'mxk.roles.name' | i18n }}</nz-form-label>
|
<nz-form-label nzFor="groupName">{{ 'mxk.roles.name' | i18n }}</nz-form-label>
|
||||||
<nz-form-control>
|
<nz-form-control>
|
||||||
<input
|
<input nz-input [(ngModel)]="query.params.groupName" [ngModelOptions]="{ standalone: true }"
|
||||||
nz-input
|
name="groupName" placeholder="" id="groupName" />
|
||||||
[(ngModel)]="query.params.roleName"
|
|
||||||
[ngModelOptions]="{ standalone: true }"
|
|
||||||
name="roleName"
|
|
||||||
placeholder=""
|
|
||||||
id="roleName"
|
|
||||||
/>
|
|
||||||
</nz-form-control>
|
</nz-form-control>
|
||||||
</nz-form-item>
|
</nz-form-item>
|
||||||
</div>
|
</div>
|
||||||
@ -23,28 +17,23 @@
|
|||||||
<nz-form-label nzFor="name">{{ 'mxk.resources.appName' | i18n }}</nz-form-label>
|
<nz-form-label nzFor="name">{{ 'mxk.resources.appName' | i18n }}</nz-form-label>
|
||||||
<nz-form-control>
|
<nz-form-control>
|
||||||
<nz-input-group nzSearch [nzAddOnAfter]="suffixButton">
|
<nz-input-group nzSearch [nzAddOnAfter]="suffixButton">
|
||||||
<input
|
<input nz-input [(ngModel)]="query.params.appName" [ngModelOptions]="{ standalone: true }" name="appName"
|
||||||
nz-input
|
readonly placeholder="" id="appName" />
|
||||||
[(ngModel)]="query.params.appName"
|
|
||||||
[ngModelOptions]="{ standalone: true }"
|
|
||||||
name="appName"
|
|
||||||
readonly
|
|
||||||
placeholder=""
|
|
||||||
id="appName"
|
|
||||||
/>
|
|
||||||
</nz-input-group>
|
</nz-input-group>
|
||||||
<ng-template #suffixButton>
|
<ng-template #suffixButton>
|
||||||
<button nz-button nzType="primary" (click)="onSelect($event)" nzSearch>{{ 'mxk.text.select' | i18n }}</button>
|
<button nz-button nzType="primary" (click)="onSelect($event)" nzSearch>{{ 'mxk.text.select' | i18n
|
||||||
|
}}</button>
|
||||||
</ng-template>
|
</ng-template>
|
||||||
</nz-form-control>
|
</nz-form-control>
|
||||||
</nz-form-item>
|
</nz-form-item>
|
||||||
</div>
|
</div>
|
||||||
<div nz-col [nzSpan]="query.expandForm ? 24 : 4" [class.text-right]="query.expandForm">
|
<div nz-col [nzSpan]="query.expandForm ? 24 : 4" [class.text-right]="query.expandForm">
|
||||||
<button nz-button type="submit" [nzType]="'primary'" [nzLoading]="query.submitLoading">{{ 'mxk.text.query' | i18n }}</button>
|
<button nz-button type="submit" [nzType]="'primary'" [nzLoading]="query.submitLoading">{{ 'mxk.text.query' |
|
||||||
<button nz-button type="reset" (click)="onReset()" class="mx-sm" style="display: none">{{ 'mxk.text.reset' | i18n }}</button>
|
i18n }}</button>
|
||||||
|
<button nz-button type="reset" (click)="onReset()" class="mx-sm" style="display: none">{{ 'mxk.text.reset' |
|
||||||
|
i18n }}</button>
|
||||||
<button nz-button (click)="query.expandForm = !query.expandForm" class="mx-sm" style="display: none">
|
<button nz-button (click)="query.expandForm = !query.expandForm" class="mx-sm" style="display: none">
|
||||||
{{ query.expandForm ? ('mxk.text.collapse' | i18n) : ('mxk.text.expand' | i18n) }}</button
|
{{ query.expandForm ? ('mxk.text.collapse' | i18n) : ('mxk.text.expand' | i18n) }}</button>
|
||||||
>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
@ -55,21 +44,11 @@
|
|||||||
</div>
|
</div>
|
||||||
<div nz-row [nzGutter]="{ xs: 8, sm: 8, md: 8, lg: 24, xl: 48, xxl: 48 }">
|
<div nz-row [nzGutter]="{ xs: 8, sm: 8, md: 8, lg: 24, xl: 48, xxl: 48 }">
|
||||||
<div nz-col [nzSpan]="10" class="grid-border">
|
<div nz-col [nzSpan]="10" class="grid-border">
|
||||||
<nz-table
|
<nz-table #dynamicTable nzTableLayout="auto" nzSize="small" nzBordered nzShowSizeChanger
|
||||||
#dynamicTable
|
[nzData]="query.results.rows" [nzFrontPagination]="false" [nzTotal]="query.results.records"
|
||||||
nzTableLayout="auto"
|
[nzPageSizeOptions]="query.params.pageSizeOptions" [nzPageSize]="query.params.pageSize"
|
||||||
nzSize="small"
|
[nzPageIndex]="query.params.pageNumber" [nzLoading]="this.query.tableLoading"
|
||||||
nzBordered
|
(nzQueryParams)="onQueryParamsChange($event)">
|
||||||
nzShowSizeChanger
|
|
||||||
[nzData]="query.results.rows"
|
|
||||||
[nzFrontPagination]="false"
|
|
||||||
[nzTotal]="query.results.records"
|
|
||||||
[nzPageSizeOptions]="query.params.pageSizeOptions"
|
|
||||||
[nzPageSize]="query.params.pageSize"
|
|
||||||
[nzPageIndex]="query.params.pageNumber"
|
|
||||||
[nzLoading]="this.query.tableLoading"
|
|
||||||
(nzQueryParams)="onQueryParamsChange($event)"
|
|
||||||
>
|
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<!--<th [nzChecked]="query.checked" [nzIndeterminate]="query.indeterminate" (nzCheckedChange)="onTableAllChecked($event)"></th>
|
<!--<th [nzChecked]="query.checked" [nzIndeterminate]="query.indeterminate" (nzCheckedChange)="onTableAllChecked($event)"></th>
|
||||||
@ -82,15 +61,12 @@
|
|||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr *ngFor="let data of query.results.rows">
|
<tr *ngFor="let data of query.results.rows">
|
||||||
<td
|
<td [nzChecked]="query.tableCheckedId.has(data.id)" [nzDisabled]="data.disabled"
|
||||||
[nzChecked]="query.tableCheckedId.has(data.id)"
|
(nzCheckedChange)="onTableItemChecked(data.id, $event)"></td>
|
||||||
[nzDisabled]="data.disabled"
|
|
||||||
(nzCheckedChange)="onTableItemChecked(data.id, $event)"
|
|
||||||
></td>
|
|
||||||
<td nzAlign="left" style="display: none">
|
<td nzAlign="left" style="display: none">
|
||||||
<span>{{ data.id }}</span>
|
<span>{{ data.id }}</span>
|
||||||
</td>
|
</td>
|
||||||
<td nzAlign="left" nzBreakWord="false">{{ data.roleName }}</td>
|
<td nzAlign="left" nzBreakWord="false">{{ data.groupName }}</td>
|
||||||
<td nzAlign="center" *ngIf="data.category == 'dynamic'"> {{ 'mxk.roles.category.dynamic' | i18n }}</td>
|
<td nzAlign="center" *ngIf="data.category == 'dynamic'"> {{ 'mxk.roles.category.dynamic' | i18n }}</td>
|
||||||
<td nzAlign="center" *ngIf="data.category == 'static'"> {{ 'mxk.roles.category.static' | i18n }}</td>
|
<td nzAlign="center" *ngIf="data.category == 'static'"> {{ 'mxk.roles.category.static' | i18n }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
@ -98,16 +74,9 @@
|
|||||||
</nz-table>
|
</nz-table>
|
||||||
</div>
|
</div>
|
||||||
<div nz-col [nzSpan]="14" class="grid-border">
|
<div nz-col [nzSpan]="14" class="grid-border">
|
||||||
<nz-tree
|
<nz-tree #nzTreeComponent nzShowLine="false" [nzCheckable]="treeNodes.checkable"
|
||||||
#nzTreeComponent
|
[nzCheckedKeys]="treeNodes.checkedKeys" nzBlockNode [nzData]="treeNodes.nodes" (nzDblClick)="openFolder($event)"
|
||||||
nzShowLine="false"
|
[nzTreeTemplate]="nzTreeTemplate"></nz-tree>
|
||||||
[nzCheckable]="treeNodes.checkable"
|
|
||||||
[nzCheckedKeys]="treeNodes.checkedKeys"
|
|
||||||
nzBlockNode
|
|
||||||
[nzData]="treeNodes.nodes"
|
|
||||||
(nzDblClick)="openFolder($event)"
|
|
||||||
[nzTreeTemplate]="nzTreeTemplate"
|
|
||||||
></nz-tree>
|
|
||||||
<ng-template #nzTreeTemplate let-node let-origin="origin">
|
<ng-template #nzTreeTemplate let-node let-origin="origin">
|
||||||
<span class="custom-node">
|
<span class="custom-node">
|
||||||
<span *ngIf="!node.isLeaf">
|
<span *ngIf="!node.isLeaf">
|
||||||
|
|||||||
@ -36,9 +36,9 @@ import { NzTableQueryParams } from 'ng-zorro-antd/table';
|
|||||||
import { NzFormatEmitEvent, NzTreeNode, NzTreeNodeOptions, NzTreeComponent } from 'ng-zorro-antd/tree';
|
import { NzFormatEmitEvent, NzTreeNode, NzTreeNodeOptions, NzTreeComponent } from 'ng-zorro-antd/tree';
|
||||||
|
|
||||||
import { TreeNodes } from '../../../entity/TreeNodes';
|
import { TreeNodes } from '../../../entity/TreeNodes';
|
||||||
|
import { GroupsService } from '../../../service/Groups.service';
|
||||||
|
import { GroupPrivilegesService } from '../../../service/group-privileges.service';
|
||||||
import { ResourcesService } from '../../../service/resources.service';
|
import { ResourcesService } from '../../../service/resources.service';
|
||||||
import { RolePrivilegesService } from '../../../service/role-privileges.service';
|
|
||||||
import { RolesService } from '../../../service/roles.service';
|
|
||||||
import { set2String } from '../../../shared/index';
|
import { set2String } from '../../../shared/index';
|
||||||
import { SelectAppsComponent } from '../../apps/select-apps/select-apps.component';
|
import { SelectAppsComponent } from '../../apps/select-apps/select-apps.component';
|
||||||
|
|
||||||
@ -51,7 +51,7 @@ export class PrivilegesComponent implements OnInit {
|
|||||||
@ViewChild('nzTreeComponent', { static: false }) nzTreeComponent!: NzTreeComponent;
|
@ViewChild('nzTreeComponent', { static: false }) nzTreeComponent!: NzTreeComponent;
|
||||||
query: {
|
query: {
|
||||||
params: {
|
params: {
|
||||||
roleName: String;
|
groupName: String;
|
||||||
displayName: String;
|
displayName: String;
|
||||||
employeeNumber: String;
|
employeeNumber: String;
|
||||||
appId: String;
|
appId: String;
|
||||||
@ -76,7 +76,7 @@ export class PrivilegesComponent implements OnInit {
|
|||||||
checked: boolean;
|
checked: boolean;
|
||||||
} = {
|
} = {
|
||||||
params: {
|
params: {
|
||||||
roleName: '',
|
groupName: '',
|
||||||
displayName: '',
|
displayName: '',
|
||||||
employeeNumber: '',
|
employeeNumber: '',
|
||||||
appId: '',
|
appId: '',
|
||||||
@ -105,9 +105,9 @@ export class PrivilegesComponent implements OnInit {
|
|||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private modalService: NzModalService,
|
private modalService: NzModalService,
|
||||||
private rolePrivilegesService: RolePrivilegesService,
|
private groupPrivilegesService: GroupPrivilegesService,
|
||||||
private resourcesService: ResourcesService,
|
private resourcesService: ResourcesService,
|
||||||
private rolesService: RolesService,
|
private groupsService: GroupsService,
|
||||||
private viewContainerRef: ViewContainerRef,
|
private viewContainerRef: ViewContainerRef,
|
||||||
private fb: FormBuilder,
|
private fb: FormBuilder,
|
||||||
private msg: NzMessageService,
|
private msg: NzMessageService,
|
||||||
@ -155,7 +155,7 @@ export class PrivilegesComponent implements OnInit {
|
|||||||
if (this.query.params.appId == '' || _roleId == '' || _resourceId == '') {
|
if (this.query.params.appId == '' || _roleId == '' || _resourceId == '') {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.rolePrivilegesService.update({ appId: this.query.params.appId, roleId: _roleId, resourceId: _resourceId }).subscribe(res => {
|
this.groupPrivilegesService.update({ appId: this.query.params.appId, roleId: _roleId, resourceId: _resourceId }).subscribe(res => {
|
||||||
this.query.submitLoading = false;
|
this.query.submitLoading = false;
|
||||||
this.query.tableLoading = false;
|
this.query.tableLoading = false;
|
||||||
if (res.code == 0) {
|
if (res.code == 0) {
|
||||||
@ -181,7 +181,7 @@ export class PrivilegesComponent implements OnInit {
|
|||||||
this.query.params.endDate = '';
|
this.query.params.endDate = '';
|
||||||
this.query.params.startDate = '';
|
this.query.params.startDate = '';
|
||||||
}
|
}
|
||||||
this.rolesService.fetch(this.query.params).subscribe(res => {
|
this.groupsService.fetch(this.query.params).subscribe(res => {
|
||||||
this.query.results = res.data;
|
this.query.results = res.data;
|
||||||
this.query.submitLoading = false;
|
this.query.submitLoading = false;
|
||||||
this.query.tableLoading = false;
|
this.query.tableLoading = false;
|
||||||
@ -236,7 +236,7 @@ export class PrivilegesComponent implements OnInit {
|
|||||||
this.onTableAllChecked(false);
|
this.onTableAllChecked(false);
|
||||||
this.updateTableCheckedSet(id, checked);
|
this.updateTableCheckedSet(id, checked);
|
||||||
this.refreshTableCheckedStatus();
|
this.refreshTableCheckedStatus();
|
||||||
this.rolePrivilegesService.getByParams({ appId: this.query.params.appId, roleId: id }).subscribe(res => {
|
this.groupPrivilegesService.getByParams({ appId: this.query.params.appId, roleId: id }).subscribe(res => {
|
||||||
this.treeNodes.checkedKeys = [];
|
this.treeNodes.checkedKeys = [];
|
||||||
for (let i = 0; i < res.data.length; i++) {
|
for (let i = 0; i < res.data.length; i++) {
|
||||||
this.treeNodes.checkedKeys.push(res.data[i].resourceId);
|
this.treeNodes.checkedKeys.push(res.data[i].resourceId);
|
||||||
|
|||||||
@ -25,8 +25,6 @@ import { LayoutBasicComponent } from '../layout/basic/basic.component';
|
|||||||
import { LayoutBlankComponent } from '../layout/blank/blank.component';
|
import { LayoutBlankComponent } from '../layout/blank/blank.component';
|
||||||
import { AccountsComponent } from './accounts/accounts.component';
|
import { AccountsComponent } from './accounts/accounts.component';
|
||||||
import { AppsComponent } from './apps/apps.component';
|
import { AppsComponent } from './apps/apps.component';
|
||||||
import { OrganizationsComponent } from './organizations/organizations.component';
|
|
||||||
import { UsersComponent } from './users/users.component';
|
|
||||||
|
|
||||||
const routes: Routes = [
|
const routes: Routes = [
|
||||||
{
|
{
|
||||||
@ -43,8 +41,7 @@ const routes: Routes = [
|
|||||||
loadChildren: () => import('./dashboard/dashboard.module').then(m => m.DashboardModule),
|
loadChildren: () => import('./dashboard/dashboard.module').then(m => m.DashboardModule),
|
||||||
data: { preload: true }
|
data: { preload: true }
|
||||||
},
|
},
|
||||||
{ path: 'organizations', component: OrganizationsComponent },
|
{ path: 'idm', loadChildren: () => import('./idm/idm.module').then(m => m.IdmModule) },
|
||||||
{ path: 'users', component: UsersComponent },
|
|
||||||
{ path: 'accounts', component: AccountsComponent },
|
{ path: 'accounts', component: AccountsComponent },
|
||||||
{ path: 'apps', component: AppsComponent },
|
{ path: 'apps', component: AppsComponent },
|
||||||
{ path: 'access', loadChildren: () => import('./access/access.module').then(m => m.AccessModule) },
|
{ path: 'access', loadChildren: () => import('./access/access.module').then(m => m.AccessModule) },
|
||||||
|
|||||||
@ -30,13 +30,7 @@ import { AppTokenBasedDetailsEditerComponent } from './apps/app-token-based-deta
|
|||||||
import { AppsComponent } from './apps/apps.component';
|
import { AppsComponent } from './apps/apps.component';
|
||||||
import { SelectAppsComponent } from './apps/select-apps/select-apps.component';
|
import { SelectAppsComponent } from './apps/select-apps/select-apps.component';
|
||||||
import { SelectProtocolComponent } from './apps/select-protocol/select-protocol.component';
|
import { SelectProtocolComponent } from './apps/select-protocol/select-protocol.component';
|
||||||
import { OrganizationEditerComponent } from './organizations/organization-editer/organization-editer.component';
|
|
||||||
import { OrganizationsComponent } from './organizations/organizations.component';
|
|
||||||
import { RouteRoutingModule } from './routes-routing.module';
|
import { RouteRoutingModule } from './routes-routing.module';
|
||||||
import { PasswordComponent } from './users/password/password.component';
|
|
||||||
import { SelectUserComponent } from './users/select-user/select-user.component';
|
|
||||||
import { UserEditerComponent } from './users/user-editer/user-editer.component';
|
|
||||||
import { UsersComponent } from './users/users.component';
|
|
||||||
|
|
||||||
const COMPONENTS: Array<Type<null>> = [];
|
const COMPONENTS: Array<Type<null>> = [];
|
||||||
|
|
||||||
@ -44,15 +38,10 @@ const COMPONENTS: Array<Type<null>> = [];
|
|||||||
imports: [SharedModule, RouteRoutingModule],
|
imports: [SharedModule, RouteRoutingModule],
|
||||||
declarations: [
|
declarations: [
|
||||||
...COMPONENTS,
|
...COMPONENTS,
|
||||||
UsersComponent,
|
|
||||||
AppsComponent,
|
AppsComponent,
|
||||||
AccountsComponent,
|
AccountsComponent,
|
||||||
OrganizationsComponent,
|
|
||||||
SelectAppsComponent,
|
SelectAppsComponent,
|
||||||
OrganizationEditerComponent,
|
|
||||||
UserEditerComponent,
|
|
||||||
AccountEditerComponent,
|
AccountEditerComponent,
|
||||||
SelectUserComponent,
|
|
||||||
SelectProtocolComponent,
|
SelectProtocolComponent,
|
||||||
AppCasDetailsEditerComponent,
|
AppCasDetailsEditerComponent,
|
||||||
AppFormBasedDetailsEditerComponent,
|
AppFormBasedDetailsEditerComponent,
|
||||||
@ -61,8 +50,7 @@ const COMPONENTS: Array<Type<null>> = [];
|
|||||||
AppSaml20DetailsEditerComponent,
|
AppSaml20DetailsEditerComponent,
|
||||||
AppTokenBasedDetailsEditerComponent,
|
AppTokenBasedDetailsEditerComponent,
|
||||||
AppExtendApiDetailsEditerComponent,
|
AppExtendApiDetailsEditerComponent,
|
||||||
AppBasicDetailsEditerComponent,
|
AppBasicDetailsEditerComponent
|
||||||
PasswordComponent
|
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
export class RoutesModule {}
|
export class RoutesModule {}
|
||||||
|
|||||||
@ -1,159 +0,0 @@
|
|||||||
<page-header> </page-header>
|
|
||||||
|
|
||||||
<nz-card [nzBordered]="false">
|
|
||||||
<form nz-form [nzLayout]="'inline'" (ngSubmit)="onSearch()" class="search__form">
|
|
||||||
<div nz-row [nzGutter]="{ xs: 8, sm: 8, md: 24, lg: 24, xl: 48, xxl: 48 }">
|
|
||||||
<div nz-col nzMd="16" nzSm="24">
|
|
||||||
<nz-form-item>
|
|
||||||
<nz-form-label nzFor="name">{{ 'mxk.users.username' | i18n }}</nz-form-label>
|
|
||||||
<nz-form-control>
|
|
||||||
<input nz-input [(ngModel)]="query.params.username" [ngModelOptions]="{ standalone: true }" name="username"
|
|
||||||
placeholder="" id="username" />
|
|
||||||
</nz-form-control>
|
|
||||||
</nz-form-item>
|
|
||||||
</div>
|
|
||||||
<div nz-col [nzSpan]="query.expandForm ? 24 : 8" [class.text-right]="query.expandForm">
|
|
||||||
<button nz-button type="submit" [nzType]="'primary'" [nzLoading]="query.submitLoading">{{ 'mxk.text.query' |
|
|
||||||
i18n }}</button>
|
|
||||||
<button nz-button type="reset" (click)="onReset()" class="mx-sm" style="display: none">{{ 'mxk.text.reset' |
|
|
||||||
i18n }}</button>
|
|
||||||
<button nz-button (click)="query.expandForm = !query.expandForm" class="mx-sm" style="display: none">
|
|
||||||
{{ query.expandForm ? ('mxk.text.collapse' | i18n) : ('mxk.text.expand' | i18n) }}</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
</nz-card>
|
|
||||||
<nz-card [nzBordered]="false">
|
|
||||||
<div nz-row>
|
|
||||||
<div nz-col [nzSpan]="24" class="table-list-toolbar">
|
|
||||||
<button nz-button type="button" [nzType]="'primary'" (click)="onAdd($event)">
|
|
||||||
{{ 'mxk.text.add' | i18n }}
|
|
||||||
</button>
|
|
||||||
<button nz-button type="button" [nzType]="'primary'" (click)="changePassword($event)">
|
|
||||||
{{ 'mxk.text.changepassword' | i18n }}
|
|
||||||
</button>
|
|
||||||
<button nz-button type="button" (click)="onBatchDelete($event)" [nzType]="'primary'" nzDanger class="mx-sm">
|
|
||||||
{{ 'mxk.text.delete' | i18n }}
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
<div nz-col [nzSpan]="6" class="grid-border">
|
|
||||||
<nz-tree nzShowLine="false" [nzCheckable]="treeNodes.checkable" nzBlockNode [nzData]="treeNodes.nodes"
|
|
||||||
(nzClick)="activeNode($event)" (nzDblClick)="openFolder($event)" [nzTreeTemplate]="nzTreeTemplate"></nz-tree>
|
|
||||||
<ng-template #nzTreeTemplate let-node let-origin="origin">
|
|
||||||
<span class="custom-node">
|
|
||||||
<span *ngIf="!node.isLeaf" (contextmenu)="contextMenu($event, menu)">
|
|
||||||
<i nz-icon [nzType]="node.isExpanded ? 'folder-open' : 'folder'" (click)="openFolder(node)"></i>
|
|
||||||
<span class="folder-name">{{ node.title + (origin.type == 'virtual' ? '_v' : '') }}</span>
|
|
||||||
</span>
|
|
||||||
<span *ngIf="node.isLeaf" (contextmenu)="contextMenu($event, menu)">
|
|
||||||
<i nz-icon nzType="file"></i>
|
|
||||||
<span class="file-name">{{ node.title + (origin.type == 'virtual' ? '_v' : '') }}</span>
|
|
||||||
</span>
|
|
||||||
</span>
|
|
||||||
</ng-template>
|
|
||||||
<nz-dropdown-menu #menu="nzDropdownMenu">
|
|
||||||
<ul nz-menu>
|
|
||||||
<li nz-menu-item (click)="selectDropdown()">Action 1</li>
|
|
||||||
<li nz-menu-item (click)="selectDropdown()">Action 2</li>
|
|
||||||
</ul>
|
|
||||||
</nz-dropdown-menu>
|
|
||||||
</div>
|
|
||||||
<div nz-col nzMd="18" nzSm="24" class="grid-border">
|
|
||||||
<nz-table #dynamicTable nzTableLayout="auto" nzSize="small" nzBordered sizeChanger="true" nzShowSizeChanger
|
|
||||||
[nzData]="query.results.rows" [nzFrontPagination]="false" [nzTotal]="query.results.records"
|
|
||||||
[nzPageSizeOptions]="query.params.pageSizeOptions" [nzPageSize]="query.params.pageSize"
|
|
||||||
[nzPageIndex]="query.params.pageNumber" [nzLoading]="this.query.tableLoading"
|
|
||||||
(nzQueryParams)="onQueryParamsChange($event)" nzWidth="100%">
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th [nzChecked]="query.checked" [nzIndeterminate]="query.indeterminate"
|
|
||||||
(nzCheckedChange)="onTableAllChecked($event)"></th>
|
|
||||||
<th nzAlign="center" style="display: none">{{ 'mxk.text.id' | i18n }}</th>
|
|
||||||
<th nzAlign="center">{{ 'mxk.users.username' | i18n }}</th>
|
|
||||||
<th nzAlign="center">{{ 'mxk.users.displayName' | i18n }}</th>
|
|
||||||
<th nzAlign="center">{{ 'mxk.users.employeeNumber' | i18n }}</th>
|
|
||||||
<th nzAlign="center">{{ 'mxk.users.department' | i18n }}</th>
|
|
||||||
<th nzAlign="center">{{ 'mxk.users.jobTitle' | i18n }}</th>
|
|
||||||
<th nzAlign="center">{{ 'mxk.users.gender' | i18n }}</th>
|
|
||||||
<th nzAlign="center">{{ 'mxk.text.status' | i18n }}</th>
|
|
||||||
<th nzAlign="center" class="table_cell_action_2">{{ 'mxk.text.action' | i18n }}</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
<tr *ngFor="let data of query.results.rows">
|
|
||||||
<td [nzChecked]="query.tableCheckedId.has(data.id)" [nzDisabled]="data.disabled"
|
|
||||||
(nzCheckedChange)="onTableItemChecked(data.id, $event)"></td>
|
|
||||||
<td nzAlign="left" style="display: none">
|
|
||||||
<span>{{ data.id }}</span>
|
|
||||||
</td>
|
|
||||||
<td nzAlign="left"> {{ data.username }}</td>
|
|
||||||
<td nzAlign="left"> {{ data.displayName }}</td>
|
|
||||||
<td nzAlign="left"> {{ data.employeeNumber }}</td>
|
|
||||||
<td nzAlign="left"> {{ data.department }}</td>
|
|
||||||
<td nzAlign="left"> {{ data.jobTitle }}</td>
|
|
||||||
<td nzAlign="center"> {{ data.gender == 1 ? ('mxk.users.gender.female' | i18n) : ('mxk.users.gender.male' |
|
|
||||||
i18n) }}</td>
|
|
||||||
<td nzAlign="center">
|
|
||||||
<a title="{{ 'mxk.users.status.active' | i18n }}" *ngIf="data.status == 1">
|
|
||||||
<i nz-icon nzType="check-circle" nzTheme="fill" style="color: green"> </i>
|
|
||||||
</a>
|
|
||||||
<a title="{{ 'mxk.users.status.inactive' | i18n }}" *ngIf="data.status == 2">
|
|
||||||
<i nz-icon nzType="warning" nzTheme="fill" style="color: gray"></i>
|
|
||||||
</a>
|
|
||||||
<a title="{{ 'mxk.users.status.forbidden' | i18n }}" *ngIf="data.status == 4">
|
|
||||||
<i nz-icon nzType="stop" nzTheme="fill" style="color: gray"></i>
|
|
||||||
</a>
|
|
||||||
<a title="{{ 'mxk.users.status.lock' | i18n }}" *ngIf="data.status == 5">
|
|
||||||
<i nz-icon nzType="lock" nzTheme="fill" style="color: orange"></i>
|
|
||||||
</a>
|
|
||||||
<a title="{{ 'mxk.users.status.delete' | i18n }}" *ngIf="data.status == 9">
|
|
||||||
<i nz-icon nzType="close-circle" nzTheme="fill" style="color: red"></i>
|
|
||||||
</a>
|
|
||||||
</td>
|
|
||||||
<td nzAlign="center" nzBreakWord="false">
|
|
||||||
<div nz-col>
|
|
||||||
<button nz-button type="button" (click)="onEdit($event, data.id)">
|
|
||||||
{{ 'mxk.text.edit' | i18n }}
|
|
||||||
</button>
|
|
||||||
<button *ngIf="data.status == 9" nz-button nz-dropdown>
|
|
||||||
{{ 'mxk.text.moreaction' | i18n }}
|
|
||||||
<i nz-icon nzType="down"></i>
|
|
||||||
</button>
|
|
||||||
<button *ngIf="data.status !== 9" nz-button nz-dropdown [nzDropdownMenu]="menuMoreAction">
|
|
||||||
{{ 'mxk.text.moreaction' | i18n }}
|
|
||||||
<i nz-icon nzType="down"></i>
|
|
||||||
</button>
|
|
||||||
<nz-dropdown-menu #menuMoreAction="nzDropdownMenu">
|
|
||||||
<ul nz-menu>
|
|
||||||
<li nz-menu-item *ngIf="data.status == 1"
|
|
||||||
(click)="onNavToUrl($event, data.id, data.username, 'roles')">{{
|
|
||||||
'mxk.text.roles' | i18n
|
|
||||||
}}</li>
|
|
||||||
<li nz-menu-item *ngIf="data.status == 1" (click)="changePasswordById($event, data.id)">{{
|
|
||||||
'mxk.text.changepassword' | i18n
|
|
||||||
}}</li>
|
|
||||||
<li nz-menu-item *ngIf="data.status == 1" (click)="onUpdateStatus($event, data.id, 5)">{{
|
|
||||||
'mxk.text.lock' | i18n }}</li>
|
|
||||||
<li nz-menu-item *ngIf="data.status == 1" (click)="onUpdateStatus($event, data.id, 4)">{{
|
|
||||||
'mxk.text.disable' | i18n
|
|
||||||
}}</li>
|
|
||||||
<li nz-menu-item *ngIf="data.status == 2" (click)="onUpdateStatus($event, data.id, 1)">{{
|
|
||||||
'mxk.text.enable' | i18n
|
|
||||||
}}</li>
|
|
||||||
<li nz-menu-item *ngIf="data.status == 4" (click)="onUpdateStatus($event, data.id, 1)">{{
|
|
||||||
'mxk.text.enable' | i18n
|
|
||||||
}}</li>
|
|
||||||
<li nz-menu-item *ngIf="data.status == 5" (click)="onUpdateStatus($event, data.id, 1)">{{
|
|
||||||
'mxk.text.unlock' | i18n
|
|
||||||
}}</li>
|
|
||||||
<li nz-menu-item (click)="onDelete($event, data.id)" nzDanger>{{ 'mxk.text.delete' | i18n }}</li>
|
|
||||||
</ul>
|
|
||||||
</nz-dropdown-menu>
|
|
||||||
</div>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</tbody>
|
|
||||||
</nz-table>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</nz-card>
|
|
||||||
@ -17,14 +17,14 @@
|
|||||||
import { HttpClient } from '@angular/common/http';
|
import { HttpClient } from '@angular/common/http';
|
||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
|
|
||||||
import { Roles } from '../entity/Roles';
|
import { Groups } from '../entity/Groups';
|
||||||
import { BaseService } from './base.service';
|
import { BaseService } from './base.service';
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root'
|
providedIn: 'root'
|
||||||
})
|
})
|
||||||
export class RolesService extends BaseService<Roles> {
|
export class GroupsService extends BaseService<Groups> {
|
||||||
constructor(private _httpClient: HttpClient) {
|
constructor(private _httpClient: HttpClient) {
|
||||||
super(_httpClient, '/access/roles');
|
super(_httpClient, '/access/groups');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -19,28 +19,28 @@ import { Injectable } from '@angular/core';
|
|||||||
import { NzSafeAny } from 'ng-zorro-antd/core/types';
|
import { NzSafeAny } from 'ng-zorro-antd/core/types';
|
||||||
import { Observable } from 'rxjs';
|
import { Observable } from 'rxjs';
|
||||||
|
|
||||||
|
import { GroupMembers } from '../entity/GroupMembers';
|
||||||
import { Message } from '../entity/Message';
|
import { Message } from '../entity/Message';
|
||||||
import { PageResults } from '../entity/PageResults';
|
import { PageResults } from '../entity/PageResults';
|
||||||
import { RoleMembers } from '../entity/RoleMembers';
|
|
||||||
import { BaseService } from './base.service';
|
import { BaseService } from './base.service';
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root'
|
providedIn: 'root'
|
||||||
})
|
})
|
||||||
export class RoleMembersService extends BaseService<RoleMembers> {
|
export class GroupMembersService extends BaseService<GroupMembers> {
|
||||||
constructor(private _httpClient: HttpClient) {
|
constructor(private _httpClient: HttpClient) {
|
||||||
super(_httpClient, '/access/rolemembers');
|
super(_httpClient, '/access/groupmembers');
|
||||||
this.server.urls.member = '/memberInRole';
|
this.server.urls.member = '/memberIn';
|
||||||
this.server.urls.memberOut = '/memberNotInRole';
|
this.server.urls.memberOut = '/memberNotIn';
|
||||||
}
|
}
|
||||||
|
|
||||||
rolesNoMember(params: NzSafeAny): Observable<Message<PageResults>> {
|
noMember(params: NzSafeAny): Observable<Message<PageResults>> {
|
||||||
return this.http.get<Message<PageResults>>(`${this.server.urls.base}/rolesNoMember`, {
|
return this.http.get<Message<PageResults>>(`${this.server.urls.base}/noMember`, {
|
||||||
params: this.parseParams(params)
|
params: this.parseParams(params)
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
addMember2Roles(body: any): Observable<Message<PageResults>> {
|
addMember2Roles(body: any): Observable<Message<PageResults>> {
|
||||||
return this.http.post<Message<PageResults>>(`${`${this.server.urls.base}/addMember2Roles`}`, body);
|
return this.http.post<Message<PageResults>>(`${`${this.server.urls.base}/addMember2Groups`}`, body);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -19,17 +19,17 @@ import { Injectable } from '@angular/core';
|
|||||||
import { NzSafeAny } from 'ng-zorro-antd/core/types';
|
import { NzSafeAny } from 'ng-zorro-antd/core/types';
|
||||||
import { Observable } from 'rxjs';
|
import { Observable } from 'rxjs';
|
||||||
|
|
||||||
|
import { GroupMembers } from '../entity/GroupMembers';
|
||||||
import { Message } from '../entity/Message';
|
import { Message } from '../entity/Message';
|
||||||
import { RoleMembers } from '../entity/RoleMembers';
|
|
||||||
import { BaseService } from './base.service';
|
import { BaseService } from './base.service';
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root'
|
providedIn: 'root'
|
||||||
})
|
})
|
||||||
export class RolePermissionsService extends BaseService<RoleMembers> {
|
export class GroupPermissionsService extends BaseService<GroupMembers> {
|
||||||
constructor(private _httpClient: HttpClient) {
|
constructor(private _httpClient: HttpClient) {
|
||||||
super(_httpClient, '/access/permissions');
|
super(_httpClient, '/access/permissions');
|
||||||
this.server.urls.member = '/appsInRole';
|
this.server.urls.member = '/appsInGroup';
|
||||||
this.server.urls.memberOut = '/appsNotInRole';
|
this.server.urls.memberOut = '/appsNotInGroup';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -19,14 +19,14 @@ import { Injectable } from '@angular/core';
|
|||||||
import { NzSafeAny } from 'ng-zorro-antd/core/types';
|
import { NzSafeAny } from 'ng-zorro-antd/core/types';
|
||||||
import { Observable } from 'rxjs';
|
import { Observable } from 'rxjs';
|
||||||
|
|
||||||
|
import { GroupMembers } from '../entity/GroupMembers';
|
||||||
import { Message } from '../entity/Message';
|
import { Message } from '../entity/Message';
|
||||||
import { RoleMembers } from '../entity/RoleMembers';
|
|
||||||
import { BaseService } from './base.service';
|
import { BaseService } from './base.service';
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root'
|
providedIn: 'root'
|
||||||
})
|
})
|
||||||
export class RolePrivilegesService extends BaseService<RoleMembers> {
|
export class GroupPrivilegesService extends BaseService<GroupMembers> {
|
||||||
constructor(private _httpClient: HttpClient) {
|
constructor(private _httpClient: HttpClient) {
|
||||||
super(_httpClient, '/permissions/privileges');
|
super(_httpClient, '/permissions/privileges');
|
||||||
this.server.urls.load = '/get';
|
this.server.urls.load = '/get';
|
||||||
@ -19,5 +19,5 @@ export const CONSTS = {
|
|||||||
INST: 'inst',
|
INST: 'inst',
|
||||||
REDIRECT_URI: 'redirect_uri',
|
REDIRECT_URI: 'redirect_uri',
|
||||||
REMEMBER: 'remember',
|
REMEMBER: 'remember',
|
||||||
VERSION: 'v3.5.19 GA'
|
VERSION: 'v4.0.0 RC1'
|
||||||
};
|
};
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user