forked from rongchao/epmet-cloud-rizhao
				
			
				 61 changed files with 1780 additions and 226 deletions
			
			
		@ -0,0 +1,17 @@ | 
				
			|||
package com.epmet.commons.mybatis.constant; | 
				
			|||
 | 
				
			|||
public class OpeScopeConstant { | 
				
			|||
    //"同级组织的下级"
 | 
				
			|||
    public static final String ORG_EQUAL_SUB = "org_equal_sub"; | 
				
			|||
    //"同级组织及下级"
 | 
				
			|||
    public static final String ORG_EQUAL_AND_SUB = "org_equal_and_sub"; | 
				
			|||
    //"同级组织"
 | 
				
			|||
    public static final String ORG_EQUAL = "org_equal"; | 
				
			|||
    //"本组织的下级"
 | 
				
			|||
    public static final String ORG_CURR_SUB = "org_curr_sub"; | 
				
			|||
    //"本组织及下级"
 | 
				
			|||
    public static final String ORG_CURR_AND_SUB = "org_curr_and_sub"; | 
				
			|||
    //"本组织"
 | 
				
			|||
    public static final String ORG_CURR = "org_curr"; | 
				
			|||
 | 
				
			|||
} | 
				
			|||
@ -0,0 +1,92 @@ | 
				
			|||
/** | 
				
			|||
 * Copyright 2018 人人开源 https://www.renren.io
 | 
				
			|||
 * <p> | 
				
			|||
 * This program is free software: you can redistribute it and/or modify | 
				
			|||
 * it under the terms of the GNU General Public License as published by | 
				
			|||
 * the Free Software Foundation, either version 3 of the License, or | 
				
			|||
 * (at your option) any later version. | 
				
			|||
 * <p> | 
				
			|||
 * This program is distributed in the hope that it will be useful, | 
				
			|||
 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 
				
			|||
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
				
			|||
 * GNU General Public License for more details. | 
				
			|||
 * <p> | 
				
			|||
 * You should have received a copy of the GNU General Public License | 
				
			|||
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 | 
				
			|||
 */ | 
				
			|||
 | 
				
			|||
package com.epmet.commons.mybatis.dto.form; | 
				
			|||
 | 
				
			|||
import lombok.Data; | 
				
			|||
 | 
				
			|||
import java.io.Serializable; | 
				
			|||
import java.util.Date; | 
				
			|||
 | 
				
			|||
 | 
				
			|||
/** | 
				
			|||
 * 权限范围表 | 
				
			|||
 * | 
				
			|||
 * @author generator generator@elink-cn.com | 
				
			|||
 * @since v1.0.0 2020-04-24 | 
				
			|||
 */ | 
				
			|||
@Data | 
				
			|||
public class OperationScopeDTO implements Serializable { | 
				
			|||
 | 
				
			|||
    private static final long serialVersionUID = 1L; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * id | 
				
			|||
     */ | 
				
			|||
	private String id; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 角色id | 
				
			|||
     */ | 
				
			|||
    private String roleId; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 范围key | 
				
			|||
     */ | 
				
			|||
	private String scopeKey; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 范围名称 | 
				
			|||
     */ | 
				
			|||
	private String scopeName; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 范围序号 | 
				
			|||
     */ | 
				
			|||
	private String scopeIndex; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 是否删除,0:未删除,1:已删除 | 
				
			|||
     */ | 
				
			|||
	private Integer delFlag; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 乐观锁 | 
				
			|||
     */ | 
				
			|||
	private Integer revision; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 创建者id | 
				
			|||
     */ | 
				
			|||
	private String createdBy; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 创建时间 | 
				
			|||
     */ | 
				
			|||
	private Date createdTime; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 更新者id | 
				
			|||
     */ | 
				
			|||
	private String updatedBy; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 更新时间 | 
				
			|||
     */ | 
				
			|||
	private Date updatedTime; | 
				
			|||
 | 
				
			|||
} | 
				
			|||
@ -0,0 +1,18 @@ | 
				
			|||
package com.epmet.commons.mybatis.dto.form; | 
				
			|||
 | 
				
			|||
import lombok.Data; | 
				
			|||
 | 
				
			|||
import javax.validation.constraints.NotBlank; | 
				
			|||
 | 
				
			|||
@Data | 
				
			|||
public class OperationScopeFormDTO { | 
				
			|||
 | 
				
			|||
    public interface ListOperationScopeGroup {} | 
				
			|||
 | 
				
			|||
    @NotBlank(message = "角色ID不能为空", groups = {ListOperationScopeGroup.class}) | 
				
			|||
    private String roleId; | 
				
			|||
 | 
				
			|||
    @NotBlank(message = "操作的key不能为空", groups = {ListOperationScopeGroup.class}) | 
				
			|||
    private String operationKey; | 
				
			|||
 | 
				
			|||
} | 
				
			|||
@ -0,0 +1,30 @@ | 
				
			|||
package com.epmet.commons.mybatis.dto.form; | 
				
			|||
 | 
				
			|||
import lombok.Data; | 
				
			|||
 | 
				
			|||
import java.util.Set; | 
				
			|||
 | 
				
			|||
@Data | 
				
			|||
public class StaffPermCacheResultDTO { | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 权限列表 | 
				
			|||
     */ | 
				
			|||
    private Set<String> permissions; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 角色列表 | 
				
			|||
     */ | 
				
			|||
    private Set<String> roleIdList; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 机构Id | 
				
			|||
     */ | 
				
			|||
    private String orgIdPath; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 网格ID | 
				
			|||
     */ | 
				
			|||
    private String gridId; | 
				
			|||
 | 
				
			|||
} | 
				
			|||
@ -0,0 +1,81 @@ | 
				
			|||
/** | 
				
			|||
 * Copyright 2018 人人开源 https://www.renren.io
 | 
				
			|||
 * <p> | 
				
			|||
 * This program is free software: you can redistribute it and/or modify | 
				
			|||
 * it under the terms of the GNU General Public License as published by | 
				
			|||
 * the Free Software Foundation, either version 3 of the License, or | 
				
			|||
 * (at your option) any later version. | 
				
			|||
 * <p> | 
				
			|||
 * This program is distributed in the hope that it will be useful, | 
				
			|||
 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 
				
			|||
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
				
			|||
 * GNU General Public License for more details. | 
				
			|||
 * <p> | 
				
			|||
 * You should have received a copy of the GNU General Public License | 
				
			|||
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 | 
				
			|||
 */ | 
				
			|||
 | 
				
			|||
package com.epmet.dto; | 
				
			|||
 | 
				
			|||
import java.io.Serializable; | 
				
			|||
import java.util.Date; | 
				
			|||
import lombok.Data; | 
				
			|||
 | 
				
			|||
 | 
				
			|||
/** | 
				
			|||
 * 权限范围表 | 
				
			|||
 * | 
				
			|||
 * @author generator generator@elink-cn.com | 
				
			|||
 * @since v1.0.0 2020-04-24 | 
				
			|||
 */ | 
				
			|||
@Data | 
				
			|||
public class OperationScopeDTO implements Serializable { | 
				
			|||
 | 
				
			|||
    private static final long serialVersionUID = 1L; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * id | 
				
			|||
     */ | 
				
			|||
	private String id; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 范围key | 
				
			|||
     */ | 
				
			|||
	private String scopeKey; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 范围名称 | 
				
			|||
     */ | 
				
			|||
	private String scopeName; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 是否删除,0:未删除,1:已删除 | 
				
			|||
     */ | 
				
			|||
	private Integer delFlag; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 乐观锁 | 
				
			|||
     */ | 
				
			|||
	private Integer revision; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 创建者id | 
				
			|||
     */ | 
				
			|||
	private String createdBy; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 创建时间 | 
				
			|||
     */ | 
				
			|||
	private Date createdTime; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 更新者id | 
				
			|||
     */ | 
				
			|||
	private String updatedBy; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 更新时间 | 
				
			|||
     */ | 
				
			|||
	private Date updatedTime; | 
				
			|||
 | 
				
			|||
} | 
				
			|||
@ -0,0 +1,86 @@ | 
				
			|||
/** | 
				
			|||
 * Copyright 2018 人人开源 https://www.renren.io
 | 
				
			|||
 * <p> | 
				
			|||
 * This program is free software: you can redistribute it and/or modify | 
				
			|||
 * it under the terms of the GNU General Public License as published by | 
				
			|||
 * the Free Software Foundation, either version 3 of the License, or | 
				
			|||
 * (at your option) any later version. | 
				
			|||
 * <p> | 
				
			|||
 * This program is distributed in the hope that it will be useful, | 
				
			|||
 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 
				
			|||
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
				
			|||
 * GNU General Public License for more details. | 
				
			|||
 * <p> | 
				
			|||
 * You should have received a copy of the GNU General Public License | 
				
			|||
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 | 
				
			|||
 */ | 
				
			|||
 | 
				
			|||
package com.epmet.dto; | 
				
			|||
 | 
				
			|||
import java.io.Serializable; | 
				
			|||
import java.util.Date; | 
				
			|||
import lombok.Data; | 
				
			|||
 | 
				
			|||
 | 
				
			|||
/** | 
				
			|||
 * 角色能操作哪些范围 | 
				
			|||
 * | 
				
			|||
 * @author generator generator@elink-cn.com | 
				
			|||
 * @since v1.0.0 2020-04-24 | 
				
			|||
 */ | 
				
			|||
@Data | 
				
			|||
public class RoleScopeDTO implements Serializable { | 
				
			|||
 | 
				
			|||
    private static final long serialVersionUID = 1L; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     *  | 
				
			|||
     */ | 
				
			|||
	private String id; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 角色ID | 
				
			|||
     */ | 
				
			|||
	private String roleId; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 操作key | 
				
			|||
     */ | 
				
			|||
	private String operationKey; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 范围Key | 
				
			|||
     */ | 
				
			|||
	private String scopeKey; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 是否删除,0:未删除,1:已删除 | 
				
			|||
     */ | 
				
			|||
	private Integer delFlag; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 乐观锁 | 
				
			|||
     */ | 
				
			|||
	private Integer revision; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 创建者id | 
				
			|||
     */ | 
				
			|||
	private String createdBy; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 创建时间 | 
				
			|||
     */ | 
				
			|||
	private Date createdTime; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 更新者id | 
				
			|||
     */ | 
				
			|||
	private String updatedBy; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 更新时间 | 
				
			|||
     */ | 
				
			|||
	private Date updatedTime; | 
				
			|||
 | 
				
			|||
} | 
				
			|||
@ -0,0 +1,18 @@ | 
				
			|||
package com.epmet.dto.form; | 
				
			|||
 | 
				
			|||
import lombok.Data; | 
				
			|||
 | 
				
			|||
import javax.validation.constraints.NotBlank; | 
				
			|||
 | 
				
			|||
@Data | 
				
			|||
public class OperationScopeFormDTO { | 
				
			|||
 | 
				
			|||
    public interface ListOperationScopeGroup {} | 
				
			|||
 | 
				
			|||
    @NotBlank(message = "角色ID不能为空", groups = {ListOperationScopeGroup.class}) | 
				
			|||
    private String roleId; | 
				
			|||
 | 
				
			|||
    @NotBlank(message = "操作的key不能为空", groups = {ListOperationScopeGroup.class}) | 
				
			|||
    private String operationKey; | 
				
			|||
 | 
				
			|||
} | 
				
			|||
@ -0,0 +1,28 @@ | 
				
			|||
package com.epmet.dto.result; | 
				
			|||
 | 
				
			|||
import lombok.Data; | 
				
			|||
 | 
				
			|||
@Data | 
				
			|||
public class RoleOpeScopeResultDTO { | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 角色ID | 
				
			|||
     */ | 
				
			|||
    private String roleId; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 范围key | 
				
			|||
     */ | 
				
			|||
    private String scopeKey; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 范围名称 | 
				
			|||
     */ | 
				
			|||
    private String scopeName; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 范围序号 | 
				
			|||
     */ | 
				
			|||
    private String scopeIndex; | 
				
			|||
 | 
				
			|||
} | 
				
			|||
@ -0,0 +1,31 @@ | 
				
			|||
package com.epmet.dto.result; | 
				
			|||
 | 
				
			|||
import lombok.Data; | 
				
			|||
 | 
				
			|||
import javax.validation.constraints.NotBlank; | 
				
			|||
import java.util.Set; | 
				
			|||
 | 
				
			|||
@Data | 
				
			|||
public class StaffPermCacheResultDTO { | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 权限列表 | 
				
			|||
     */ | 
				
			|||
    private Set<String> permissions; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 角色列表 | 
				
			|||
     */ | 
				
			|||
    private Set<String> roleIdList; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 组织ID | 
				
			|||
     */ | 
				
			|||
    private String orgIdPath; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 网格ID | 
				
			|||
     */ | 
				
			|||
    private String gridId; | 
				
			|||
 | 
				
			|||
} | 
				
			|||
@ -0,0 +1,47 @@ | 
				
			|||
/** | 
				
			|||
 * Copyright 2018 人人开源 https://www.renren.io
 | 
				
			|||
 * <p> | 
				
			|||
 * This program is free software: you can redistribute it and/or modify | 
				
			|||
 * it under the terms of the GNU General Public License as published by | 
				
			|||
 * the Free Software Foundation, either version 3 of the License, or | 
				
			|||
 * (at your option) any later version. | 
				
			|||
 * <p> | 
				
			|||
 * This program is distributed in the hope that it will be useful, | 
				
			|||
 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 
				
			|||
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
				
			|||
 * GNU General Public License for more details. | 
				
			|||
 * <p> | 
				
			|||
 * You should have received a copy of the GNU General Public License | 
				
			|||
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 | 
				
			|||
 */ | 
				
			|||
 | 
				
			|||
package com.epmet.dao; | 
				
			|||
 | 
				
			|||
import com.epmet.commons.mybatis.dao.BaseDao; | 
				
			|||
import com.epmet.dto.result.RoleOpeScopeResultDTO; | 
				
			|||
import com.epmet.entity.OperationScopeEntity; | 
				
			|||
import org.apache.ibatis.annotations.Mapper; | 
				
			|||
import org.apache.ibatis.annotations.Param; | 
				
			|||
import org.springframework.context.annotation.Scope; | 
				
			|||
 | 
				
			|||
import java.util.List; | 
				
			|||
import java.util.Set; | 
				
			|||
 | 
				
			|||
/** | 
				
			|||
 * 权限范围表 | 
				
			|||
 * | 
				
			|||
 * @author generator generator@elink-cn.com | 
				
			|||
 * @since v1.0.0 2020-04-24 | 
				
			|||
 */ | 
				
			|||
@Mapper | 
				
			|||
public interface OperationScopeDao extends BaseDao<OperationScopeEntity> { | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 查询角色的操作key对应操作范围列表 | 
				
			|||
     * @param roleId 角色id | 
				
			|||
     * @param operationKey 操作key | 
				
			|||
     * @return | 
				
			|||
     */ | 
				
			|||
    Set<RoleOpeScopeResultDTO> listOperationScopesByRoleId(@Param("roleId") String roleId, | 
				
			|||
                                            @Param("operationKey") String operationKey); | 
				
			|||
} | 
				
			|||
@ -0,0 +1,51 @@ | 
				
			|||
/** | 
				
			|||
 * Copyright 2018 人人开源 https://www.renren.io
 | 
				
			|||
 * <p> | 
				
			|||
 * This program is free software: you can redistribute it and/or modify | 
				
			|||
 * it under the terms of the GNU General Public License as published by | 
				
			|||
 * the Free Software Foundation, either version 3 of the License, or | 
				
			|||
 * (at your option) any later version. | 
				
			|||
 * <p> | 
				
			|||
 * This program is distributed in the hope that it will be useful, | 
				
			|||
 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 
				
			|||
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
				
			|||
 * GNU General Public License for more details. | 
				
			|||
 * <p> | 
				
			|||
 * You should have received a copy of the GNU General Public License | 
				
			|||
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 | 
				
			|||
 */ | 
				
			|||
 | 
				
			|||
package com.epmet.entity; | 
				
			|||
 | 
				
			|||
import com.baomidou.mybatisplus.annotation.TableName; | 
				
			|||
 | 
				
			|||
import com.epmet.commons.mybatis.entity.BaseEpmetEntity; | 
				
			|||
import lombok.Data; | 
				
			|||
import lombok.EqualsAndHashCode; | 
				
			|||
 | 
				
			|||
import java.util.Date; | 
				
			|||
 | 
				
			|||
/** | 
				
			|||
 * 权限范围表 | 
				
			|||
 * | 
				
			|||
 * @author generator generator@elink-cn.com | 
				
			|||
 * @since v1.0.0 2020-04-24 | 
				
			|||
 */ | 
				
			|||
@Data | 
				
			|||
@EqualsAndHashCode(callSuper=false) | 
				
			|||
@TableName("operation_scope") | 
				
			|||
public class OperationScopeEntity extends BaseEpmetEntity { | 
				
			|||
 | 
				
			|||
	private static final long serialVersionUID = 1L; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 范围key | 
				
			|||
     */ | 
				
			|||
	private String scopeKey; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 范围名称 | 
				
			|||
     */ | 
				
			|||
	private String scopeName; | 
				
			|||
 | 
				
			|||
} | 
				
			|||
@ -0,0 +1,56 @@ | 
				
			|||
/** | 
				
			|||
 * Copyright 2018 人人开源 https://www.renren.io
 | 
				
			|||
 * <p> | 
				
			|||
 * This program is free software: you can redistribute it and/or modify | 
				
			|||
 * it under the terms of the GNU General Public License as published by | 
				
			|||
 * the Free Software Foundation, either version 3 of the License, or | 
				
			|||
 * (at your option) any later version. | 
				
			|||
 * <p> | 
				
			|||
 * This program is distributed in the hope that it will be useful, | 
				
			|||
 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 
				
			|||
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
				
			|||
 * GNU General Public License for more details. | 
				
			|||
 * <p> | 
				
			|||
 * You should have received a copy of the GNU General Public License | 
				
			|||
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 | 
				
			|||
 */ | 
				
			|||
 | 
				
			|||
package com.epmet.entity; | 
				
			|||
 | 
				
			|||
import com.baomidou.mybatisplus.annotation.TableName; | 
				
			|||
 | 
				
			|||
import com.epmet.commons.mybatis.entity.BaseEpmetEntity; | 
				
			|||
import lombok.Data; | 
				
			|||
import lombok.EqualsAndHashCode; | 
				
			|||
 | 
				
			|||
import java.util.Date; | 
				
			|||
 | 
				
			|||
/** | 
				
			|||
 * 角色能操作哪些范围 | 
				
			|||
 * | 
				
			|||
 * @author generator generator@elink-cn.com | 
				
			|||
 * @since v1.0.0 2020-04-24 | 
				
			|||
 */ | 
				
			|||
@Data | 
				
			|||
@EqualsAndHashCode(callSuper=false) | 
				
			|||
@TableName("role_scope") | 
				
			|||
public class RoleScopeEntity extends BaseEpmetEntity { | 
				
			|||
 | 
				
			|||
	private static final long serialVersionUID = 1L; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 角色ID | 
				
			|||
     */ | 
				
			|||
	private String roleId; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 操作key | 
				
			|||
     */ | 
				
			|||
	private String operationKey; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 范围Key | 
				
			|||
     */ | 
				
			|||
	private String scopeKey; | 
				
			|||
 | 
				
			|||
} | 
				
			|||
@ -0,0 +1,43 @@ | 
				
			|||
package com.epmet.redis; | 
				
			|||
 | 
				
			|||
import cn.hutool.core.bean.BeanUtil; | 
				
			|||
import com.epmet.commons.tools.redis.RedisKeys; | 
				
			|||
import com.epmet.commons.tools.redis.RedisUtils; | 
				
			|||
import com.epmet.dto.result.RoleOpeScopeResultDTO; | 
				
			|||
import org.springframework.beans.factory.annotation.Autowired; | 
				
			|||
import org.springframework.stereotype.Component; | 
				
			|||
 | 
				
			|||
import java.util.Set; | 
				
			|||
 | 
				
			|||
/** | 
				
			|||
 * 角色的操作权限对应的操作范围Redis | 
				
			|||
 */ | 
				
			|||
@Component | 
				
			|||
public class RoleOpeScopeRedis { | 
				
			|||
 | 
				
			|||
    @Autowired | 
				
			|||
    private RedisUtils redisUtils; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 缓存角色操作范围 | 
				
			|||
     * @param roleId | 
				
			|||
     * @param opeKey | 
				
			|||
     * @param scopes | 
				
			|||
     */ | 
				
			|||
    public void setRoleOpeScopes(String roleId, String opeKey, Set<RoleOpeScopeResultDTO> scopes) { | 
				
			|||
        String roleOpeScopesKey = RedisKeys.getRoleOpeScopesKey(roleId, opeKey); | 
				
			|||
        redisUtils.set(roleOpeScopesKey, scopes); | 
				
			|||
    } | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 查询角色操作范围 | 
				
			|||
     * @param roleId | 
				
			|||
     * @param opeKey | 
				
			|||
     * @return | 
				
			|||
     */ | 
				
			|||
    public Set<RoleOpeScopeResultDTO> getRoleOpeScopes(String roleId, String opeKey) { | 
				
			|||
        String roleOpeScopesKey = RedisKeys.getRoleOpeScopesKey(roleId, opeKey); | 
				
			|||
        return (Set<RoleOpeScopeResultDTO>)redisUtils.get(roleOpeScopesKey); | 
				
			|||
    } | 
				
			|||
 | 
				
			|||
} | 
				
			|||
@ -0,0 +1,95 @@ | 
				
			|||
/** | 
				
			|||
 * Copyright 2018 人人开源 https://www.renren.io
 | 
				
			|||
 * <p> | 
				
			|||
 * This program is free software: you can redistribute it and/or modify | 
				
			|||
 * it under the terms of the GNU General Public License as published by | 
				
			|||
 * the Free Software Foundation, either version 3 of the License, or | 
				
			|||
 * (at your option) any later version. | 
				
			|||
 * <p> | 
				
			|||
 * This program is distributed in the hope that it will be useful, | 
				
			|||
 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 
				
			|||
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
				
			|||
 * GNU General Public License for more details. | 
				
			|||
 * <p> | 
				
			|||
 * You should have received a copy of the GNU General Public License | 
				
			|||
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 | 
				
			|||
 */ | 
				
			|||
 | 
				
			|||
package com.epmet.service; | 
				
			|||
 | 
				
			|||
import com.epmet.commons.mybatis.service.BaseService; | 
				
			|||
import com.epmet.commons.tools.page.PageData; | 
				
			|||
import com.epmet.dto.OperationScopeDTO; | 
				
			|||
import com.epmet.entity.OperationScopeEntity; | 
				
			|||
 | 
				
			|||
import java.util.List; | 
				
			|||
import java.util.Map; | 
				
			|||
 | 
				
			|||
/** | 
				
			|||
 * 权限范围表 | 
				
			|||
 * | 
				
			|||
 * @author generator generator@elink-cn.com | 
				
			|||
 * @since v1.0.0 2020-04-24 | 
				
			|||
 */ | 
				
			|||
public interface OperationScopeService extends BaseService<OperationScopeEntity> { | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 默认分页 | 
				
			|||
     * | 
				
			|||
     * @param params | 
				
			|||
     * @return PageData<OperationScopeDTO> | 
				
			|||
     * @author generator | 
				
			|||
     * @date 2020-04-24 | 
				
			|||
     */ | 
				
			|||
    PageData<OperationScopeDTO> page(Map<String, Object> params); | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 默认查询 | 
				
			|||
     * | 
				
			|||
     * @param params | 
				
			|||
     * @return java.util.List<OperationScopeDTO> | 
				
			|||
     * @author generator | 
				
			|||
     * @date 2020-04-24 | 
				
			|||
     */ | 
				
			|||
    List<OperationScopeDTO> list(Map<String, Object> params); | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 单条查询 | 
				
			|||
     * | 
				
			|||
     * @param id | 
				
			|||
     * @return OperationScopeDTO | 
				
			|||
     * @author generator | 
				
			|||
     * @date 2020-04-24 | 
				
			|||
     */ | 
				
			|||
    OperationScopeDTO get(String id); | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 默认保存 | 
				
			|||
     * | 
				
			|||
     * @param dto | 
				
			|||
     * @return void | 
				
			|||
     * @author generator | 
				
			|||
     * @date 2020-04-24 | 
				
			|||
     */ | 
				
			|||
    void save(OperationScopeDTO dto); | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 默认更新 | 
				
			|||
     * | 
				
			|||
     * @param dto | 
				
			|||
     * @return void | 
				
			|||
     * @author generator | 
				
			|||
     * @date 2020-04-24 | 
				
			|||
     */ | 
				
			|||
    void update(OperationScopeDTO dto); | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 批量删除 | 
				
			|||
     * | 
				
			|||
     * @param ids | 
				
			|||
     * @return void | 
				
			|||
     * @author generator | 
				
			|||
     * @date 2020-04-24 | 
				
			|||
     */ | 
				
			|||
    void delete(String[] ids); | 
				
			|||
} | 
				
			|||
@ -0,0 +1,95 @@ | 
				
			|||
/** | 
				
			|||
 * Copyright 2018 人人开源 https://www.renren.io
 | 
				
			|||
 * <p> | 
				
			|||
 * This program is free software: you can redistribute it and/or modify | 
				
			|||
 * it under the terms of the GNU General Public License as published by | 
				
			|||
 * the Free Software Foundation, either version 3 of the License, or | 
				
			|||
 * (at your option) any later version. | 
				
			|||
 * <p> | 
				
			|||
 * This program is distributed in the hope that it will be useful, | 
				
			|||
 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 
				
			|||
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
				
			|||
 * GNU General Public License for more details. | 
				
			|||
 * <p> | 
				
			|||
 * You should have received a copy of the GNU General Public License | 
				
			|||
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 | 
				
			|||
 */ | 
				
			|||
 | 
				
			|||
package com.epmet.service; | 
				
			|||
 | 
				
			|||
import com.epmet.commons.mybatis.service.BaseService; | 
				
			|||
import com.epmet.commons.tools.page.PageData; | 
				
			|||
import com.epmet.dto.RoleScopeDTO; | 
				
			|||
import com.epmet.entity.RoleScopeEntity; | 
				
			|||
 | 
				
			|||
import java.util.List; | 
				
			|||
import java.util.Map; | 
				
			|||
 | 
				
			|||
/** | 
				
			|||
 * 角色能操作哪些范围 | 
				
			|||
 * | 
				
			|||
 * @author generator generator@elink-cn.com | 
				
			|||
 * @since v1.0.0 2020-04-24 | 
				
			|||
 */ | 
				
			|||
public interface RoleScopeService extends BaseService<RoleScopeEntity> { | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 默认分页 | 
				
			|||
     * | 
				
			|||
     * @param params | 
				
			|||
     * @return PageData<RoleScopeDTO> | 
				
			|||
     * @author generator | 
				
			|||
     * @date 2020-04-24 | 
				
			|||
     */ | 
				
			|||
    PageData<RoleScopeDTO> page(Map<String, Object> params); | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 默认查询 | 
				
			|||
     * | 
				
			|||
     * @param params | 
				
			|||
     * @return java.util.List<RoleScopeDTO> | 
				
			|||
     * @author generator | 
				
			|||
     * @date 2020-04-24 | 
				
			|||
     */ | 
				
			|||
    List<RoleScopeDTO> list(Map<String, Object> params); | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 单条查询 | 
				
			|||
     * | 
				
			|||
     * @param id | 
				
			|||
     * @return RoleScopeDTO | 
				
			|||
     * @author generator | 
				
			|||
     * @date 2020-04-24 | 
				
			|||
     */ | 
				
			|||
    RoleScopeDTO get(String id); | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 默认保存 | 
				
			|||
     * | 
				
			|||
     * @param dto | 
				
			|||
     * @return void | 
				
			|||
     * @author generator | 
				
			|||
     * @date 2020-04-24 | 
				
			|||
     */ | 
				
			|||
    void save(RoleScopeDTO dto); | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 默认更新 | 
				
			|||
     * | 
				
			|||
     * @param dto | 
				
			|||
     * @return void | 
				
			|||
     * @author generator | 
				
			|||
     * @date 2020-04-24 | 
				
			|||
     */ | 
				
			|||
    void update(RoleScopeDTO dto); | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 批量删除 | 
				
			|||
     * | 
				
			|||
     * @param ids | 
				
			|||
     * @return void | 
				
			|||
     * @author generator | 
				
			|||
     * @date 2020-04-24 | 
				
			|||
     */ | 
				
			|||
    void delete(String[] ids); | 
				
			|||
} | 
				
			|||
@ -0,0 +1,101 @@ | 
				
			|||
/** | 
				
			|||
 * Copyright 2018 人人开源 https://www.renren.io
 | 
				
			|||
 * <p> | 
				
			|||
 * This program is free software: you can redistribute it and/or modify | 
				
			|||
 * it under the terms of the GNU General Public License as published by | 
				
			|||
 * the Free Software Foundation, either version 3 of the License, or | 
				
			|||
 * (at your option) any later version. | 
				
			|||
 * <p> | 
				
			|||
 * This program is distributed in the hope that it will be useful, | 
				
			|||
 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 
				
			|||
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
				
			|||
 * GNU General Public License for more details. | 
				
			|||
 * <p> | 
				
			|||
 * You should have received a copy of the GNU General Public License | 
				
			|||
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 | 
				
			|||
 */ | 
				
			|||
 | 
				
			|||
package com.epmet.service.impl; | 
				
			|||
 | 
				
			|||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | 
				
			|||
import com.baomidou.mybatisplus.core.metadata.IPage; | 
				
			|||
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; | 
				
			|||
import com.epmet.commons.tools.page.PageData; | 
				
			|||
import com.epmet.commons.tools.utils.ConvertUtils; | 
				
			|||
import com.epmet.commons.tools.constant.FieldConstant; | 
				
			|||
import com.epmet.dao.OperationScopeDao; | 
				
			|||
import com.epmet.dto.OperationScopeDTO; | 
				
			|||
import com.epmet.entity.OperationScopeEntity; | 
				
			|||
import com.epmet.service.OperationScopeService; | 
				
			|||
import org.apache.commons.lang3.StringUtils; | 
				
			|||
import org.springframework.beans.factory.annotation.Autowired; | 
				
			|||
import org.springframework.stereotype.Service; | 
				
			|||
import org.springframework.transaction.annotation.Transactional; | 
				
			|||
 | 
				
			|||
import java.util.Arrays; | 
				
			|||
import java.util.List; | 
				
			|||
import java.util.Map; | 
				
			|||
 | 
				
			|||
/** | 
				
			|||
 * 权限范围表 | 
				
			|||
 * | 
				
			|||
 * @author generator generator@elink-cn.com | 
				
			|||
 * @since v1.0.0 2020-04-24 | 
				
			|||
 */ | 
				
			|||
@Service | 
				
			|||
public class OperationScopeServiceImpl extends BaseServiceImpl<OperationScopeDao, OperationScopeEntity> implements OperationScopeService { | 
				
			|||
 | 
				
			|||
 | 
				
			|||
    @Override | 
				
			|||
    public PageData<OperationScopeDTO> page(Map<String, Object> params) { | 
				
			|||
        IPage<OperationScopeEntity> page = baseDao.selectPage( | 
				
			|||
                getPage(params, FieldConstant.CREATED_TIME, false), | 
				
			|||
                getWrapper(params) | 
				
			|||
        ); | 
				
			|||
        return getPageData(page, OperationScopeDTO.class); | 
				
			|||
    } | 
				
			|||
 | 
				
			|||
    @Override | 
				
			|||
    public List<OperationScopeDTO> list(Map<String, Object> params) { | 
				
			|||
        List<OperationScopeEntity> entityList = baseDao.selectList(getWrapper(params)); | 
				
			|||
 | 
				
			|||
        return ConvertUtils.sourceToTarget(entityList, OperationScopeDTO.class); | 
				
			|||
    } | 
				
			|||
 | 
				
			|||
    private QueryWrapper<OperationScopeEntity> getWrapper(Map<String, Object> params){ | 
				
			|||
        String id = (String)params.get(FieldConstant.ID_HUMP); | 
				
			|||
 | 
				
			|||
        QueryWrapper<OperationScopeEntity> wrapper = new QueryWrapper<>(); | 
				
			|||
        wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); | 
				
			|||
 | 
				
			|||
        return wrapper; | 
				
			|||
    } | 
				
			|||
 | 
				
			|||
    @Override | 
				
			|||
    public OperationScopeDTO get(String id) { | 
				
			|||
        OperationScopeEntity entity = baseDao.selectById(id); | 
				
			|||
        return ConvertUtils.sourceToTarget(entity, OperationScopeDTO.class); | 
				
			|||
    } | 
				
			|||
 | 
				
			|||
    @Override | 
				
			|||
    @Transactional(rollbackFor = Exception.class) | 
				
			|||
    public void save(OperationScopeDTO dto) { | 
				
			|||
        OperationScopeEntity entity = ConvertUtils.sourceToTarget(dto, OperationScopeEntity.class); | 
				
			|||
        insert(entity); | 
				
			|||
    } | 
				
			|||
 | 
				
			|||
    @Override | 
				
			|||
    @Transactional(rollbackFor = Exception.class) | 
				
			|||
    public void update(OperationScopeDTO dto) { | 
				
			|||
        OperationScopeEntity entity = ConvertUtils.sourceToTarget(dto, OperationScopeEntity.class); | 
				
			|||
        updateById(entity); | 
				
			|||
    } | 
				
			|||
 | 
				
			|||
    @Override | 
				
			|||
    @Transactional(rollbackFor = Exception.class) | 
				
			|||
    public void delete(String[] ids) { | 
				
			|||
        // 逻辑删除(@TableLogic 注解)
 | 
				
			|||
        baseDao.deleteBatchIds(Arrays.asList(ids)); | 
				
			|||
    } | 
				
			|||
 | 
				
			|||
} | 
				
			|||
@ -0,0 +1,100 @@ | 
				
			|||
/** | 
				
			|||
 * Copyright 2018 人人开源 https://www.renren.io
 | 
				
			|||
 * <p> | 
				
			|||
 * This program is free software: you can redistribute it and/or modify | 
				
			|||
 * it under the terms of the GNU General Public License as published by | 
				
			|||
 * the Free Software Foundation, either version 3 of the License, or | 
				
			|||
 * (at your option) any later version. | 
				
			|||
 * <p> | 
				
			|||
 * This program is distributed in the hope that it will be useful, | 
				
			|||
 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 
				
			|||
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
				
			|||
 * GNU General Public License for more details. | 
				
			|||
 * <p> | 
				
			|||
 * You should have received a copy of the GNU General Public License | 
				
			|||
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 | 
				
			|||
 */ | 
				
			|||
 | 
				
			|||
package com.epmet.service.impl; | 
				
			|||
 | 
				
			|||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | 
				
			|||
import com.baomidou.mybatisplus.core.metadata.IPage; | 
				
			|||
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; | 
				
			|||
import com.epmet.commons.tools.page.PageData; | 
				
			|||
import com.epmet.commons.tools.utils.ConvertUtils; | 
				
			|||
import com.epmet.commons.tools.constant.FieldConstant; | 
				
			|||
import com.epmet.dao.RoleScopeDao; | 
				
			|||
import com.epmet.dto.RoleScopeDTO; | 
				
			|||
import com.epmet.entity.RoleScopeEntity; | 
				
			|||
import com.epmet.service.RoleScopeService; | 
				
			|||
import org.apache.commons.lang3.StringUtils; | 
				
			|||
import org.springframework.beans.factory.annotation.Autowired; | 
				
			|||
import org.springframework.stereotype.Service; | 
				
			|||
import org.springframework.transaction.annotation.Transactional; | 
				
			|||
 | 
				
			|||
import java.util.Arrays; | 
				
			|||
import java.util.List; | 
				
			|||
import java.util.Map; | 
				
			|||
 | 
				
			|||
/** | 
				
			|||
 * 角色能操作哪些范围 | 
				
			|||
 * | 
				
			|||
 * @author generator generator@elink-cn.com | 
				
			|||
 * @since v1.0.0 2020-04-24 | 
				
			|||
 */ | 
				
			|||
@Service | 
				
			|||
public class RoleScopeServiceImpl extends BaseServiceImpl<RoleScopeDao, RoleScopeEntity> implements RoleScopeService { | 
				
			|||
 | 
				
			|||
    @Override | 
				
			|||
    public PageData<RoleScopeDTO> page(Map<String, Object> params) { | 
				
			|||
        IPage<RoleScopeEntity> page = baseDao.selectPage( | 
				
			|||
                getPage(params, FieldConstant.CREATED_TIME, false), | 
				
			|||
                getWrapper(params) | 
				
			|||
        ); | 
				
			|||
        return getPageData(page, RoleScopeDTO.class); | 
				
			|||
    } | 
				
			|||
 | 
				
			|||
    @Override | 
				
			|||
    public List<RoleScopeDTO> list(Map<String, Object> params) { | 
				
			|||
        List<RoleScopeEntity> entityList = baseDao.selectList(getWrapper(params)); | 
				
			|||
 | 
				
			|||
        return ConvertUtils.sourceToTarget(entityList, RoleScopeDTO.class); | 
				
			|||
    } | 
				
			|||
 | 
				
			|||
    private QueryWrapper<RoleScopeEntity> getWrapper(Map<String, Object> params){ | 
				
			|||
        String id = (String)params.get(FieldConstant.ID_HUMP); | 
				
			|||
 | 
				
			|||
        QueryWrapper<RoleScopeEntity> wrapper = new QueryWrapper<>(); | 
				
			|||
        wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); | 
				
			|||
 | 
				
			|||
        return wrapper; | 
				
			|||
    } | 
				
			|||
 | 
				
			|||
    @Override | 
				
			|||
    public RoleScopeDTO get(String id) { | 
				
			|||
        RoleScopeEntity entity = baseDao.selectById(id); | 
				
			|||
        return ConvertUtils.sourceToTarget(entity, RoleScopeDTO.class); | 
				
			|||
    } | 
				
			|||
 | 
				
			|||
    @Override | 
				
			|||
    @Transactional(rollbackFor = Exception.class) | 
				
			|||
    public void save(RoleScopeDTO dto) { | 
				
			|||
        RoleScopeEntity entity = ConvertUtils.sourceToTarget(dto, RoleScopeEntity.class); | 
				
			|||
        insert(entity); | 
				
			|||
    } | 
				
			|||
 | 
				
			|||
    @Override | 
				
			|||
    @Transactional(rollbackFor = Exception.class) | 
				
			|||
    public void update(RoleScopeDTO dto) { | 
				
			|||
        RoleScopeEntity entity = ConvertUtils.sourceToTarget(dto, RoleScopeEntity.class); | 
				
			|||
        updateById(entity); | 
				
			|||
    } | 
				
			|||
 | 
				
			|||
    @Override | 
				
			|||
    @Transactional(rollbackFor = Exception.class) | 
				
			|||
    public void delete(String[] ids) { | 
				
			|||
        // 逻辑删除(@TableLogic 注解)
 | 
				
			|||
        baseDao.deleteBatchIds(Arrays.asList(ids)); | 
				
			|||
    } | 
				
			|||
 | 
				
			|||
} | 
				
			|||
@ -0,0 +1,29 @@ | 
				
			|||
<?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"> | 
				
			|||
 | 
				
			|||
<mapper namespace="com.epmet.dao.OperationScopeDao"> | 
				
			|||
 | 
				
			|||
    <resultMap type="com.epmet.entity.OperationScopeEntity" id="operationScopeMap"> | 
				
			|||
        <result property="id" column="ID"/> | 
				
			|||
        <result property="scopeKey" column="SCOPE_KEY"/> | 
				
			|||
        <result property="scopeName" column="SCOPE_NAME"/> | 
				
			|||
        <result property="delFlag" column="DEL_FLAG"/> | 
				
			|||
        <result property="revision" column="REVISION"/> | 
				
			|||
        <result property="createdBy" column="CREATED_BY"/> | 
				
			|||
        <result property="createdTime" column="CREATED_TIME"/> | 
				
			|||
        <result property="updatedBy" column="UPDATED_BY"/> | 
				
			|||
        <result property="updatedTime" column="UPDATED_TIME"/> | 
				
			|||
    </resultMap> | 
				
			|||
 | 
				
			|||
    <!--查询角色的操作key对应操作范围列表--> | 
				
			|||
    <select id="listOperationScopesByRoleId" resultType="com.epmet.dto.result.RoleOpeScopeResultDTO"> | 
				
			|||
        select os.SCOPE_KEY, os.SCOPE_NAME, rs.ROLE_ID, os.SCOPE_INDEX | 
				
			|||
        from role_scope rs | 
				
			|||
               inner join operation_scope os | 
				
			|||
                          on (rs.SCOPE_KEY = os.SCOPE_KEY) | 
				
			|||
        where rs.ROLE_ID = #{roleId} | 
				
			|||
          and rs.OPERATION_KEY = #{operationKey} | 
				
			|||
    </select> | 
				
			|||
 | 
				
			|||
 | 
				
			|||
</mapper> | 
				
			|||
@ -0,0 +1,20 @@ | 
				
			|||
<?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"> | 
				
			|||
 | 
				
			|||
<mapper namespace="com.epmet.dao.RoleScopeDao"> | 
				
			|||
 | 
				
			|||
    <resultMap type="com.epmet.entity.RoleScopeEntity" id="roleScopeMap"> | 
				
			|||
        <result property="id" column="ID"/> | 
				
			|||
        <result property="roleId" column="ROLE_ID"/> | 
				
			|||
        <result property="operationKey" column="OPERATION_KEY"/> | 
				
			|||
        <result property="scopeKey" column="SCOPE_KEY"/> | 
				
			|||
        <result property="delFlag" column="DEL_FLAG"/> | 
				
			|||
        <result property="revision" column="REVISION"/> | 
				
			|||
        <result property="createdBy" column="CREATED_BY"/> | 
				
			|||
        <result property="createdTime" column="CREATED_TIME"/> | 
				
			|||
        <result property="updatedBy" column="UPDATED_BY"/> | 
				
			|||
        <result property="updatedTime" column="UPDATED_TIME"/> | 
				
			|||
    </resultMap> | 
				
			|||
 | 
				
			|||
 | 
				
			|||
</mapper> | 
				
			|||
@ -0,0 +1,27 @@ | 
				
			|||
package com.epmet.dto; | 
				
			|||
 | 
				
			|||
import lombok.Data; | 
				
			|||
 | 
				
			|||
import java.io.Serializable; | 
				
			|||
 | 
				
			|||
/** | 
				
			|||
 * 根据userId查询customerId 的DTO | 
				
			|||
 * @Auther zxc | 
				
			|||
 * @Create 2020-04-24 15:57 | 
				
			|||
 */ | 
				
			|||
@Data | 
				
			|||
public class CustomerIdDTO implements Serializable { | 
				
			|||
 | 
				
			|||
    private static final long serialVersionUID = 1L; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * userId  用户id | 
				
			|||
     */ | 
				
			|||
    private String userId; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * customerId 客户id | 
				
			|||
     */ | 
				
			|||
    private String customerId; | 
				
			|||
 | 
				
			|||
} | 
				
			|||
@ -0,0 +1,31 @@ | 
				
			|||
package com.epmet.dto.form; | 
				
			|||
 | 
				
			|||
import lombok.Data; | 
				
			|||
 | 
				
			|||
import javax.validation.constraints.NotBlank; | 
				
			|||
import java.io.Serializable; | 
				
			|||
import java.util.List; | 
				
			|||
 | 
				
			|||
/** | 
				
			|||
 * 添加部门人员DTO | 
				
			|||
 * @Auther zxc | 
				
			|||
 * @Create 2020-04-24 14:51 | 
				
			|||
 */ | 
				
			|||
@Data | 
				
			|||
public class AddDepartmentStaffFormDTO implements Serializable { | 
				
			|||
 | 
				
			|||
    private static final long serialVersionUID = 1L; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     *部门id | 
				
			|||
     */ | 
				
			|||
    @NotBlank(message = "部门id不能为空") | 
				
			|||
    private String departmentId; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 选中人员id | 
				
			|||
     */ | 
				
			|||
    @NotBlank(message = "选中人员不能为空") | 
				
			|||
    private List selectedList; | 
				
			|||
 | 
				
			|||
} | 
				
			|||
					Loading…
					
					
				
		Reference in new issue