初始化
This commit is contained in:
24
pqs-user/pom.xml
Normal file
24
pqs-user/pom.xml
Normal file
@@ -0,0 +1,24 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>pqs</artifactId>
|
||||
<groupId>com.njcn</groupId>
|
||||
<version>1.0.0</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>pqs-user</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<name>用户服务模块聚合</name>
|
||||
<modules>
|
||||
<module>user-api</module>
|
||||
<module>user-boot</module>
|
||||
</modules>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>8</maven.compiler.source>
|
||||
<maven.compiler.target>8</maven.compiler.target>
|
||||
</properties>
|
||||
|
||||
</project>
|
||||
42
pqs-user/user-api/pom.xml
Normal file
42
pqs-user/user-api/pom.xml
Normal file
@@ -0,0 +1,42 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>pqs-user</artifactId>
|
||||
<groupId>com.njcn</groupId>
|
||||
<version>1.0.0</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>user-api</artifactId>
|
||||
<name>用户模块对外接口</name>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>8</maven.compiler.source>
|
||||
<maven.compiler.target>8</maven.compiler.target>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.njcn</groupId>
|
||||
<artifactId>common-core</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.njcn</groupId>
|
||||
<artifactId>common-db</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.njcn</groupId>
|
||||
<artifactId>common-microservice</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.njcn</groupId>
|
||||
<artifactId>common-poi</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.njcn.user.api;
|
||||
|
||||
import com.njcn.common.pojo.constant.ServerInfo;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.user.api.fallback.AuthClientFeignClientFallbackFactory;
|
||||
import com.njcn.user.pojo.po.AuthClient;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
|
||||
|
||||
/**
|
||||
* @author hongawen
|
||||
* @version 1.0.0
|
||||
* @date 2021年12月15日 13:27
|
||||
*/
|
||||
@FeignClient(value = ServerInfo.USER, path = "/authClient", fallbackFactory = AuthClientFeignClientFallbackFactory.class)
|
||||
public interface AuthClientFeignClient {
|
||||
|
||||
|
||||
/**
|
||||
* 根据客户端名称获取客户端信息
|
||||
* @param clientName 客户端名称
|
||||
* @return 客户端信息
|
||||
*/
|
||||
@GetMapping("/getAuthClientByName/{clientName}")
|
||||
HttpResult<AuthClient> getAuthClientByName(@PathVariable("clientName") String clientName);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
package com.njcn.user.api;
|
||||
|
||||
import com.njcn.common.pojo.constant.ServerInfo;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.user.api.fallback.DeptFeignClientFallbackFactory;
|
||||
import com.njcn.user.pojo.dto.DeptDTO;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author denghuajun
|
||||
* @date 2022/1/11
|
||||
* 部门相关业务对外接口
|
||||
*/
|
||||
@FeignClient(value = ServerInfo.USER, path = "/dept", fallbackFactory = DeptFeignClientFallbackFactory.class)
|
||||
public interface DeptFeignClient {
|
||||
|
||||
/**
|
||||
* 根据条件获取后代部门索引
|
||||
* @param id 部门id
|
||||
* @param type 指定部门类型
|
||||
* @return 后代部门索引
|
||||
*/
|
||||
@PostMapping("/getDeptDescendantIndexes")
|
||||
HttpResult<List<DeptDTO>> getDeptDescendantIndexes(@RequestParam("id") String id, @RequestParam("type") List<Integer> type);
|
||||
|
||||
/**
|
||||
* 根据区域获取部门id
|
||||
* @param area
|
||||
* @author xy
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/getDeptIdByArea")
|
||||
HttpResult<String> getDeptIdByArea(@RequestParam("area") String area);
|
||||
|
||||
/**
|
||||
* 根据部门id获取区域id
|
||||
* @param deptId
|
||||
* @author denghuajun
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/getAreaIdByDeptId")
|
||||
HttpResult<String> getAreaIdByDeptId(@RequestParam("deptId") String deptId);
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
package com.njcn.user.api;
|
||||
|
||||
import com.njcn.common.pojo.constant.ServerInfo;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.user.api.fallback.UserFeignClientFallbackFactory;
|
||||
import com.njcn.user.pojo.dto.UserDTO;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
|
||||
/**
|
||||
* @author hongawen
|
||||
* @version 1.0.0
|
||||
* @date 2021年05月08日 15:11
|
||||
*/
|
||||
@FeignClient(value = ServerInfo.USER,path = "/user",fallbackFactory = UserFeignClientFallbackFactory.class)
|
||||
public interface UserFeignClient {
|
||||
|
||||
/**
|
||||
* 根据登录名查询用户信息
|
||||
*
|
||||
* @param loginName 登录名
|
||||
* @return 用户基本信息
|
||||
*/
|
||||
@GetMapping("/getUserByName/{loginName}")
|
||||
HttpResult<UserDTO> getUserByName(@PathVariable("loginName") String loginName);
|
||||
|
||||
/**
|
||||
* 认证后根据用户名判断用户状态
|
||||
* @param loginName 登录名
|
||||
* @return 校验结果
|
||||
*/
|
||||
@GetMapping("/judgeUserStatus/{loginName}")
|
||||
HttpResult<Boolean> judgeUserStatus(@PathVariable("loginName") String loginName);
|
||||
|
||||
/**
|
||||
* 更新用户登录认证密码错误次数
|
||||
*
|
||||
* @param loginName 登录名
|
||||
* @return null
|
||||
*/
|
||||
@PutMapping("/updateUserLoginErrorTimes/{loginName}")
|
||||
HttpResult<String> updateUserLoginErrorTimes(@PathVariable("loginName") String loginName);
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
package com.njcn.user.api.fallback;
|
||||
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.user.api.AuthClientFeignClient;
|
||||
import com.njcn.user.pojo.po.AuthClient;
|
||||
import com.njcn.user.utils.UserEnumUtil;
|
||||
import feign.hystrix.FallbackFactory;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* @author hongawen
|
||||
* @version 1.0.0
|
||||
* @date 2021年12月15日 13:28
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
public class AuthClientFeignClientFallbackFactory implements FallbackFactory<AuthClientFeignClient> {
|
||||
|
||||
/**
|
||||
* 输出远程请求接口异常日志
|
||||
* @param throwable RPC请求异常
|
||||
*/
|
||||
@Override
|
||||
public AuthClientFeignClient create(Throwable throwable) {
|
||||
//判断抛出异常是否为解码器抛出的业务异常
|
||||
Enum<?> exceptionEnum = CommonResponseEnum.SERVICE_FALLBACK;
|
||||
if(throwable.getCause() instanceof BusinessException){
|
||||
BusinessException businessException = (BusinessException) throwable.getCause();
|
||||
exceptionEnum = UserEnumUtil.getExceptionEnum(businessException.getResult());
|
||||
}
|
||||
Enum<?> finalExceptionEnum = exceptionEnum;
|
||||
return new AuthClientFeignClient() {
|
||||
@Override
|
||||
public HttpResult<AuthClient> getAuthClientByName(String clientName) {
|
||||
log.error("{}异常,降级处理,异常为:{}","根据客户端名称获取客户端信息",throwable.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
package com.njcn.user.api.fallback;
|
||||
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.user.api.DeptFeignClient;
|
||||
import com.njcn.user.pojo.dto.DeptDTO;
|
||||
import com.njcn.user.utils.UserEnumUtil;
|
||||
import feign.hystrix.FallbackFactory;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author denghuajun
|
||||
* @version 1.0.0
|
||||
* @date 2022年01月11日 10:21
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
public class DeptFeignClientFallbackFactory implements FallbackFactory<DeptFeignClient> {
|
||||
|
||||
|
||||
/**
|
||||
* 输出远程请求接口异常日志
|
||||
*
|
||||
* @param cause RPC请求异常
|
||||
*/
|
||||
@Override
|
||||
public DeptFeignClient create(Throwable cause) {
|
||||
//判断抛出异常是否为解码器抛出的业务异常
|
||||
Enum<?> exceptionEnum = CommonResponseEnum.SERVICE_FALLBACK;
|
||||
if (cause.getCause() instanceof BusinessException) {
|
||||
BusinessException businessException = (BusinessException) cause.getCause();
|
||||
exceptionEnum = UserEnumUtil.getExceptionEnum(businessException.getResult());
|
||||
}
|
||||
Enum<?> finalExceptionEnum = exceptionEnum;
|
||||
return new DeptFeignClient() {
|
||||
|
||||
@Override
|
||||
public HttpResult<List<DeptDTO>> getDeptDescendantIndexes(String id, List<Integer> type) {
|
||||
log.error("{}异常,降级处理,异常为:{}", "根据条件获取后代部门索引", cause.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResult<String> getDeptIdByArea(String area) {
|
||||
log.error("{}异常,降级处理,异常为:{}", "根据区域索引获取部门索引", cause.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResult<String> getAreaIdByDeptId(String deptId) {
|
||||
log.error("{}异常,降级处理,异常为:{}", "根据部门索引获取区域索引", cause.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
package com.njcn.user.api.fallback;
|
||||
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.user.api.UserFeignClient;
|
||||
import com.njcn.user.pojo.dto.UserDTO;
|
||||
import com.njcn.user.utils.UserEnumUtil;
|
||||
import feign.hystrix.FallbackFactory;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* @author hongawen
|
||||
* @version 1.0.0
|
||||
* @date 2021年08月24日 10:21
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
public class UserFeignClientFallbackFactory implements FallbackFactory<UserFeignClient> {
|
||||
|
||||
|
||||
/**
|
||||
* 输出远程请求接口异常日志
|
||||
* @param cause RPC请求异常
|
||||
*/
|
||||
@Override
|
||||
public UserFeignClient create(Throwable cause) {
|
||||
//判断抛出异常是否为解码器抛出的业务异常
|
||||
Enum<?> exceptionEnum = CommonResponseEnum.SERVICE_FALLBACK;
|
||||
if(cause.getCause() instanceof BusinessException){
|
||||
BusinessException businessException = (BusinessException) cause.getCause();
|
||||
exceptionEnum = UserEnumUtil.getExceptionEnum(businessException.getResult());
|
||||
}
|
||||
Enum<?> finalExceptionEnum = exceptionEnum;
|
||||
return new UserFeignClient() {
|
||||
@Override
|
||||
public HttpResult<UserDTO> getUserByName(String loginName) {
|
||||
log.error("{}异常,降级处理,异常为:{}","根据登录名查询用户信息",cause.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResult<Boolean> judgeUserStatus(String loginName) {
|
||||
log.error("{}异常,降级处理,异常为:{}","认证后根据用户名判断用户状态",cause.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResult<String> updateUserLoginErrorTimes(String loginName) {
|
||||
log.error("{}异常,降级处理,异常为:{}","更新用户登录认证密码错误次数",cause.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,96 @@
|
||||
package com.njcn.user.enums;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* @author hongawen
|
||||
* @version 1.0.0
|
||||
* @date 2021年04月13日 10:50
|
||||
*/
|
||||
@Getter
|
||||
public enum UserResponseEnum {
|
||||
|
||||
/**
|
||||
* A0100 ~ A0199 用于用户模块的枚举
|
||||
* <p>
|
||||
* 大致可以分为:
|
||||
* 登录失败状态码 A0101 + 各种登录失败的原因
|
||||
* 注册失败状态码 A0103 + 各种注册失败的原因
|
||||
* 用户权限升级失败(暂时用于app账号不同角色升级) A0103 + 各种升级app权限失败的原因
|
||||
* token校验失败 A0104 + 各种token失败的原因
|
||||
* client校验失败 A0105 + 各种客户端失败的原因
|
||||
*/
|
||||
LOGIN_USERNAME_NOT_FOUND("A0101", "用户不存在"),
|
||||
LOGIN_USERNAME_INVALID("A0101", "用户名非法"),
|
||||
LOGIN_PHONE_NOT_FOUND("A0101", "手机号不存在"),
|
||||
LOGIN_WRONG_PWD("A0101", "用户名密码错误"),
|
||||
LOGIN_WRONG_PHONE_CODE("A0101", "短信验证码错误"),
|
||||
LOGIN_WRONG_CODE("A0101", "验证码错误"),
|
||||
LOGIN_USER_DELETE("A0101", "账号已被注销"),
|
||||
LOGIN_USER_LOCKED("A0101", "账号已被锁定"),
|
||||
LOGIN_USER_UNAUDITED("A0101", "账号未审核"),
|
||||
NEED_MODIFY_PASSWORD("A0101", "密码需修改"),
|
||||
LOGIN_USER_SLEEP("A0101", "账号已休眠"),
|
||||
LOGIN_USER_PASSWORD_EXPIRED("A0101", "账号密码过期"),
|
||||
LOGIN_FIRST_LOGIN("A0101", "账号首次登录"),
|
||||
NEED_MODIFY_PWD("A0101", "密码失效,请重置"),
|
||||
LACK_USER_STRATEGY("A0101", "缺失用户策略配置"),
|
||||
UNSUPPORTED_GRANT_TYPE("A0101", "非法认证方式"),
|
||||
INVALID_IP("A0101", "非法IP访问系统"),
|
||||
INVALID_TIME("A0101", "用户当前时间段禁止访问"),
|
||||
PASSWORD_TRANSPORT_ERROR("A0101", "密码传输完整性被破坏"),
|
||||
SPECIAL_PASSWORD("A0101", "密码需要包含特殊字符字母数字,长度为8-16"),
|
||||
REPEAT_PASSWORD("A0101", "新密码与旧密码不能一致"),
|
||||
|
||||
REGISTER_PHONE_FAIL("A0102", "该号码已注册,请检查phone字段"),
|
||||
REGISTER_LOGIN_NAME_FAIL("A0102", "该账号已注册"),
|
||||
REGISTER_PHONE_WRONG("A0102", "手机号非法"),
|
||||
REGISTER_PASSWORD_WRONG("A0102", "账号密码非法"),
|
||||
REGISTER_LOGIN_NAME_EXIST("A0102", "该登录名已存在,请检查loginName字段"),
|
||||
REGISTER_HOMEPAGE_NAME_EXIST("A0102", "该驾驶舱名已存在,请检查name字段"),
|
||||
FUNCTION_PATH_EXIST("A0102", "菜单路径已存在,请检查path字段"),
|
||||
COMPONENT_NAME_EXIST("A0102", "组件名已存在,请检查name字段"),
|
||||
|
||||
|
||||
UPDATE_ROLE_REFERRAL_CODE_ERROR("A0103", "推荐码非法"),
|
||||
|
||||
PARSE_TOKEN_FORBIDDEN_JWT("A0104", "token已被禁止访问"),
|
||||
REFRESH_TOKEN_EXPIRE_JWT("A0104", "refresh_token已过期"),
|
||||
|
||||
CLIENT_AUTHENTICATION_FAILED("A0105", "客户端认证失败"),
|
||||
NOT_FOUND_CLIENT("A0105", "客户端不存在"),
|
||||
|
||||
DEPT_MISSING("A0106", "未找到此部门"),
|
||||
|
||||
DEPT_NODATA("A0107", "部门下暂无用户"),
|
||||
|
||||
BIND_USER_DATA("A0108", "已绑定用户,先解绑用户"),
|
||||
|
||||
CHILD_DEPT_DATA("A0109", "已绑定子部门,先解绑部门"),
|
||||
|
||||
BIND_MONITOR_DATA("A0110", "已绑定监测点,先解绑监测点"),
|
||||
|
||||
NO_MENU_DATA("A0111","未找到菜单"),
|
||||
|
||||
CHILD_DATA("A0112","数据已绑子节点"),
|
||||
|
||||
BIND_ROLE_DATA("A0113","已有角色绑定,请先解绑"),
|
||||
|
||||
NO_ROLE_DATA("A0114","未找到此角色"),
|
||||
|
||||
BIND_FUNCTION_DATA("A0115","已绑定资源,先解绑资源"),
|
||||
|
||||
DEPT_NAME_REPEAT("A0116","部门名称重复"),
|
||||
|
||||
ROLE_NAME_REPEAT("A0117","角色名称重复");
|
||||
|
||||
private final String code;
|
||||
|
||||
private final String message;
|
||||
|
||||
UserResponseEnum(String code, String message) {
|
||||
this.code = code;
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package com.njcn.user.enums;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* @author hongawen
|
||||
* @version 1.0.0
|
||||
* @createTime 2021年05月25日 15:40
|
||||
*/
|
||||
@Getter
|
||||
public enum UserStatusEnum {
|
||||
|
||||
/**
|
||||
* 用户状态0:删除;1:正常;2:锁定;3:待审核;4:休眠;5:密码过期
|
||||
*/
|
||||
DESTROY(0, "用户已注销"),
|
||||
NORMAL(1, "正常"),
|
||||
LOCKED(2, "用户已经被锁定"),
|
||||
UNCHECK(3, "用户未审核"),
|
||||
SLEEP(4, "用户已休眠"),
|
||||
OVERDUE(5, "用户密码已经过期");
|
||||
|
||||
private final int code;
|
||||
|
||||
private final String message;
|
||||
|
||||
UserStatusEnum(int code, String message) {
|
||||
this.code=code;
|
||||
this.message=message;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.njcn.user.pojo.constant;
|
||||
|
||||
/**
|
||||
* @author 徐扬
|
||||
*/
|
||||
public interface ComponentState {
|
||||
|
||||
/**
|
||||
* 状态 0-删除;1-正常;默认正常
|
||||
*/
|
||||
int DELETE = 0;
|
||||
|
||||
int ENABLE = 1;
|
||||
|
||||
/**
|
||||
* 顶层父类的pid
|
||||
*/
|
||||
String FATHER_PID = "0";
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.njcn.user.pojo.constant;
|
||||
|
||||
/**
|
||||
* @author denghuajun
|
||||
* @date 2021/12/28
|
||||
*
|
||||
*/
|
||||
public interface DeptState {
|
||||
|
||||
/**
|
||||
* 部门状态 0-删除;1-正常;默认正常
|
||||
*/
|
||||
int DELETE = 0;
|
||||
int ENABLE = 1;
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.njcn.user.pojo.constant;
|
||||
|
||||
/**
|
||||
* @author denghuajun
|
||||
* @date 2021/12/28
|
||||
*
|
||||
*/
|
||||
public interface DeptType {
|
||||
|
||||
/**
|
||||
* 部门类型 0-非自定义;1-web自定义;2-App自定义
|
||||
*/
|
||||
int UNCUSTOM = 0;
|
||||
int WEBCUSTOM = 1;
|
||||
int APPCUSTOM = 2;
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
package com.njcn.user.pojo.constant;
|
||||
|
||||
/**
|
||||
* @author 徐扬
|
||||
*/
|
||||
public interface FunctionState {
|
||||
|
||||
/**
|
||||
* 权限资源状态 0-删除;1-正常;默认正常
|
||||
*/
|
||||
int DELETE = 0;
|
||||
|
||||
int ENABLE = 1;
|
||||
|
||||
/**
|
||||
* 顶层父类的pid
|
||||
*/
|
||||
String FATHER_PID = "0";
|
||||
|
||||
/**
|
||||
* 驾驶舱父类名称
|
||||
*/
|
||||
String DRIVER_NAME = "/home";
|
||||
|
||||
/**
|
||||
* 权限资源类型 0-菜单、1-按钮、2-公共资源、3-服务间调用资源
|
||||
*/
|
||||
int MENU = 0;
|
||||
|
||||
int BUTTON = 1;
|
||||
|
||||
int PUBLIC = 2;
|
||||
|
||||
int IN_SERVICE = 3;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.njcn.user.pojo.constant;
|
||||
|
||||
/**
|
||||
* @author 徐扬
|
||||
*/
|
||||
public interface HomePageState {
|
||||
|
||||
/**
|
||||
* 状态 0-删除;1-正常;默认正常
|
||||
*/
|
||||
int DELETE = 0;
|
||||
|
||||
int ENABLE = 1;
|
||||
|
||||
/**
|
||||
* 默认首页 用户的id
|
||||
*/
|
||||
String DEFAULT_USER_ID = "0";
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.njcn.user.pojo.constant;
|
||||
|
||||
/**
|
||||
* @author 徐扬
|
||||
*/
|
||||
public interface RoleType {
|
||||
|
||||
/**
|
||||
* 角色类型 0:超级管理员;1:管理员;2:用户
|
||||
*/
|
||||
int SUPER_ADMINISTRATOR = 0;
|
||||
|
||||
int ADMINISTRATOR = 1;
|
||||
|
||||
int USER = 2;
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.njcn.user.pojo.constant;
|
||||
|
||||
/**
|
||||
* @author 徐扬
|
||||
*/
|
||||
public interface UserDefaultPassword {
|
||||
|
||||
/**
|
||||
* 新增用户初始密码
|
||||
*/
|
||||
String DEFAULT_PASSWORD = "123456";
|
||||
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
package com.njcn.user.pojo.constant;
|
||||
|
||||
/**
|
||||
* @author hongawen
|
||||
* @version 1.0.0
|
||||
* @date 2021年12月15日 15:00
|
||||
*/
|
||||
public interface UserState {
|
||||
|
||||
/**
|
||||
* 用户状态 0:删除;1:正常;2:锁定;3:待审核;4:休眠;5:密码过期
|
||||
*/
|
||||
int DELETE = 0;
|
||||
int ENABLE = 1;
|
||||
int LOCKED = 2;
|
||||
int UNCHECK = 3;
|
||||
int SLEEP = 4;
|
||||
int OVERDUE = 5;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 数据来源:0-外部推送 1-正常新增
|
||||
*/
|
||||
int OUT_ORIGIN = 0;
|
||||
int NORMAL_ORIGIN = 1;
|
||||
|
||||
|
||||
/**
|
||||
* 密码状态:0-不需要修改 1-需要修改
|
||||
*/
|
||||
int NEEDLESS = 0;
|
||||
int NEED = 1;
|
||||
|
||||
|
||||
/**
|
||||
* 初始密码错误次数
|
||||
*/
|
||||
int ERROR_PASSWORD_TIMES = 0;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.njcn.user.pojo.constant;
|
||||
|
||||
/**
|
||||
* @author hongawen
|
||||
* @version 1.0.0
|
||||
* @date 2021年12月15日 19:39
|
||||
*/
|
||||
public interface UserType {
|
||||
|
||||
/**
|
||||
* 用户类型 0:临时用户;1:正式用户
|
||||
*/
|
||||
int CASUAL = 0;
|
||||
|
||||
int OFFICIAL = 1;
|
||||
|
||||
/**
|
||||
* 用户权限类型 0:超级管理员;1:管理员;2:用户
|
||||
*/
|
||||
int SUPER_ADMINISTRATOR = 0;
|
||||
|
||||
int ADMINISTRATOR = 1;
|
||||
|
||||
int USER = 2;
|
||||
|
||||
String SUPER_ADMIN = "root";
|
||||
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
package com.njcn.user.pojo.constant;
|
||||
|
||||
/**
|
||||
* @author xy
|
||||
* @date 2021/12/29 15:10
|
||||
*/
|
||||
public interface UserValidMessage {
|
||||
|
||||
String ID_NOT_BLANK = "id不能为空,请检查id参数";
|
||||
|
||||
String USERNAME_NOT_BLANK = "名称不能为空,请检查name参数";
|
||||
|
||||
String USERNAME_FORMAT_ERROR = "用户名格式错误,需中英文1-16,请检查name参数";
|
||||
|
||||
String LOGIN_NAME_NOT_BLANK = "登录名不能为空,请检查loginName参数";
|
||||
|
||||
String LOGIN_NAME_FORMAT_ERROR = "登录名格式错误,需3-16位的英文字母和数字,请检查loginName参数";
|
||||
|
||||
String PASSWORD_NOT_BLANK = "密码不能为空,请检查password参数";
|
||||
|
||||
String PASSWORD_FORMAT_ERROR = "密码格式错误,需包含特殊字符字母数字,长度为8-16,请检查password参数";
|
||||
|
||||
String DEPT_NOT_BLANK = "部门不能为空,请检查deptId参数";
|
||||
|
||||
String PHONE_FORMAT_ERROR = "电话号码格式错误,请检查phone参数";
|
||||
|
||||
String EMAIL_FORMAT_ERROR = "邮箱格式错误,请检查email参数";
|
||||
|
||||
String LIMIT_IP_START_NOT_BLANK = "起始IP不能为空,请检查limitIpStart参数";
|
||||
|
||||
String LIMIT_IP_START_FORMAT_ERROR = "起始IP格式错误,请检查limitIpStart参数";
|
||||
|
||||
String LIMIT_IP_END_NOT_BLANK = "结束IP不能为空,请检查limitIpEnd参数";
|
||||
|
||||
String LIMIT_IP_END_FORMAT_ERROR = "结束IP格式错误,请检查limitIpEnd参数";
|
||||
|
||||
String LIMIT_TIME_NOT_BLANK = "时间段不能为空,请检查limitTime参数";
|
||||
|
||||
String CASUAL_USER_NOT_BLANK = "类型不能为空";
|
||||
|
||||
String SMS_NOTICE_NOT_BLANK = "短信通知不能为空,请检查smsNotice参数";
|
||||
|
||||
String EMAIL_NOTICE_NOT_BLANK = "邮件通知不能为空,请检查emailNotice参数";
|
||||
|
||||
String PARAM_FORMAT_ERROR = "参数值非法";
|
||||
|
||||
String ROLE_NOT_BLANK = "角色不能为空,请检查role参数";
|
||||
|
||||
String PID_NOT_BLANK = "父节点不能为空,请检查pid参数";
|
||||
|
||||
String CODE_NOT_BLANK = "资源标识不能为空,请检查code参数";
|
||||
|
||||
String PATH_NOT_BLANK = "资源路径不能为空,请检查path参数";
|
||||
|
||||
String PATH_FORMAT_ERROR = "路径格式错误,请检查path参数";
|
||||
|
||||
String SORT_NOT_BLANK = "排序不能为空,请检查sort参数";
|
||||
|
||||
String TYPE_NOT_BLANK = "资源类型不能为空,请检查type参数";
|
||||
|
||||
String LAYOUT_NOT_BLANK = "模板不能为空,请检查layout参数";
|
||||
|
||||
String FUNCTION_ID_NOT_BLANK = "资源id不能为空,请检查functionId参数";
|
||||
|
||||
String FUNCTION_ID_FORMAT_ERROR = "资源id格式错误,请检查functionId参数";
|
||||
|
||||
String FUNCTION_GROUP_NOT_BLANK = "功能数组不能为空,请检查functionGroup参数";
|
||||
|
||||
String FUNCTION_GROUP_FORMAT_ERROR = "功能数组格式错误,请检查functionGroup参数";
|
||||
|
||||
String COMPONENT_CODE_NOT_BLANK = "功能组件表示不能为空,请检查code参数";
|
||||
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
package com.njcn.user.pojo.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 类的介绍:
|
||||
*
|
||||
* @author xuyang
|
||||
* @version 1.0.0
|
||||
* @createTime 2022/1/19 14:56
|
||||
*/
|
||||
@Data
|
||||
public class ComponentDTO implements Serializable {
|
||||
|
||||
@ApiModelProperty("组件Id")
|
||||
private String id;
|
||||
|
||||
@ApiModelProperty("资源id")
|
||||
private String functionId;
|
||||
|
||||
@ApiModelProperty("节点")
|
||||
private String pid;
|
||||
|
||||
@ApiModelProperty("功能组件名称")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty("功能数组")
|
||||
private String functionGroup;
|
||||
|
||||
@ApiModelProperty("排序")
|
||||
private Integer sort;
|
||||
|
||||
@ApiModelProperty("功能组件表示")
|
||||
private String code;
|
||||
|
||||
@ApiModelProperty("路径")
|
||||
private String path;
|
||||
|
||||
@ApiModelProperty("子级")
|
||||
List<ComponentDTO> children;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.njcn.user.pojo.dto;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author hongawen
|
||||
* @version 1.0.0
|
||||
* @date 2022年02月11日 14:08
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class DeptDTO implements Serializable {
|
||||
|
||||
private String id;
|
||||
|
||||
private String pid;
|
||||
|
||||
private String pids;
|
||||
|
||||
private String name;
|
||||
|
||||
private String area;
|
||||
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 部门类型 0-非自定义;1-web自定义;2-App自定义;3-web测试
|
||||
*/
|
||||
private Integer type;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
package com.njcn.user.pojo.dto;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author hongawen
|
||||
* @version 1.0.0
|
||||
* @date 2021年05月08日 15:12
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class UserDTO {
|
||||
|
||||
private String userIndex;
|
||||
|
||||
private String username;
|
||||
|
||||
private String nickname;
|
||||
|
||||
private String password;
|
||||
|
||||
/**
|
||||
* 角色集合
|
||||
*/
|
||||
private List<String> roleName;
|
||||
|
||||
/**
|
||||
* sm4加密秘钥
|
||||
*/
|
||||
private String secretKey;
|
||||
|
||||
/**
|
||||
* sm4中间过程校验
|
||||
*/
|
||||
private String standBy;
|
||||
|
||||
private String deptIndex;
|
||||
|
||||
private Integer type;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
package com.njcn.user.pojo.dto.excel;
|
||||
|
||||
import cn.afterturn.easypoi.excel.annotation.Excel;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* @author hongawen
|
||||
* @version 1.0.0
|
||||
* @date 2022年04月06日 16:13
|
||||
*/
|
||||
@Data
|
||||
public class UserExcel implements Serializable {
|
||||
|
||||
private String id;
|
||||
|
||||
@Excel(name = "用户名", width = 20)
|
||||
private String name;
|
||||
|
||||
@Excel(name = "登录名", width = 20)
|
||||
private String loginName;
|
||||
|
||||
@Excel(name = "角色", width = 20)
|
||||
private String role;
|
||||
|
||||
@Excel(name = "部门", width = 20)
|
||||
private String deptName;
|
||||
|
||||
@Excel(name = "手机", width = 20)
|
||||
private String phone;
|
||||
|
||||
@Excel(name = "注册时间", format = "yyyy-MM-dd HH:mm:ss", width = 20)
|
||||
private LocalDateTime registerTime;
|
||||
|
||||
@Excel(name = "最后登录时间", format = "yyyy-MM-dd HH:mm:ss", width = 20)
|
||||
private LocalDateTime loginTime;
|
||||
|
||||
@Excel(name = "用户类型", replace = {"临时用户_0", "正式用户_1"}, width = 20)
|
||||
private Integer casualUser;
|
||||
|
||||
@Excel(name = "状态", replace = {"注销_0", "正常_1", "锁定_2", "待审核_3", "休眠_4", "密码过期_5"}, width = 20)
|
||||
private Integer state;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
package com.njcn.user.pojo.param;
|
||||
|
||||
import com.njcn.common.pojo.constant.PatternRegex;
|
||||
import com.njcn.user.pojo.constant.UserValidMessage;
|
||||
import com.njcn.web.constant.ValidMessage;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.hibernate.validator.constraints.Range;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Pattern;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 类的介绍:
|
||||
*
|
||||
* @author xuyang
|
||||
* @version 1.0.0
|
||||
* @createTime 2022/1/19 9:16
|
||||
*/
|
||||
@Data
|
||||
public class ComponentParam {
|
||||
|
||||
@ApiModelProperty("资源id")
|
||||
@NotBlank(message = UserValidMessage.FUNCTION_ID_NOT_BLANK)
|
||||
private String functionId;
|
||||
|
||||
@ApiModelProperty("节点")
|
||||
@NotBlank(message = UserValidMessage.PID_NOT_BLANK)
|
||||
private String pid;
|
||||
|
||||
@ApiModelProperty("功能组件名称")
|
||||
@NotBlank(message = UserValidMessage.USERNAME_NOT_BLANK)
|
||||
@Pattern(regexp = PatternRegex.FUNCTION_NAME, message = UserValidMessage.PATH_FORMAT_ERROR)
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty("功能数组")
|
||||
@NotEmpty(message = UserValidMessage.FUNCTION_GROUP_NOT_BLANK)
|
||||
private List<Integer> functionGroup;
|
||||
|
||||
@ApiModelProperty("排序")
|
||||
@NotNull(message = UserValidMessage.SORT_NOT_BLANK)
|
||||
@Range(min = 0, max = 999, message = UserValidMessage.PARAM_FORMAT_ERROR)
|
||||
private Integer sort;
|
||||
|
||||
@ApiModelProperty("功能组件表示")
|
||||
@NotBlank(message = UserValidMessage.COMPONENT_CODE_NOT_BLANK)
|
||||
private String code;
|
||||
|
||||
@ApiModelProperty("路径")
|
||||
private String path;
|
||||
|
||||
|
||||
/**
|
||||
* 组件更新操作实体
|
||||
* 需要填写的参数:组件的id
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public static class ComponentUpdateParam extends ComponentParam {
|
||||
|
||||
@ApiModelProperty("组件Id")
|
||||
@NotBlank(message = ValidMessage.ID_NOT_BLANK)
|
||||
@Pattern(regexp = PatternRegex.SYSTEM_ID, message = ValidMessage.ID_FORMAT_ERROR)
|
||||
private String id;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
package com.njcn.user.pojo.param;
|
||||
|
||||
import com.njcn.common.pojo.constant.PatternRegex;
|
||||
import com.njcn.web.constant.ValidMessage;
|
||||
import com.njcn.web.pojo.param.BaseParam;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* @author denghuajun
|
||||
* @date 2021/12/28 14:39
|
||||
* 部门
|
||||
*/
|
||||
@Data
|
||||
public class DeptParam {
|
||||
|
||||
@ApiModelProperty("父节点")
|
||||
@NotBlank(message = ValidMessage.PID_NOT_BLANK)
|
||||
private String pid;
|
||||
|
||||
@ApiModelProperty("行政区域id")
|
||||
@NotBlank(message = ValidMessage.AREA_NOT_BLANK)
|
||||
@Pattern(regexp = PatternRegex.SYSTEMS_ID, message = ValidMessage.AREA_FORMAT_ERROR)
|
||||
private String area;
|
||||
|
||||
|
||||
@ApiModelProperty("名称")
|
||||
@NotBlank(message = ValidMessage.NAME_NOT_BLANK)
|
||||
@Pattern(regexp = PatternRegex.DEPT_NAME_REGEX, message = ValidMessage.NAME_FORMAT_ERROR)
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty("排序")
|
||||
@NotNull(message = ValidMessage.SORT_NOT_NULL)
|
||||
@Min(value = 0, message = ValidMessage.SORT_FORMAT_ERROR)
|
||||
@Max(value = 999, message = ValidMessage.SORT_FORMAT_ERROR)
|
||||
private Integer sort;
|
||||
|
||||
@ApiModelProperty("部门类型 0-非自定义;1-web自定义;2-App自定义")
|
||||
private Integer type;
|
||||
|
||||
@ApiModelProperty("描述")
|
||||
private String remark;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 更新操作实体
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public static class DeptUpdateParam extends DeptParam {
|
||||
|
||||
/**
|
||||
* 表Id
|
||||
*/
|
||||
@ApiModelProperty("id")
|
||||
@NotBlank(message = ValidMessage.ID_NOT_BLANK)
|
||||
@Pattern(regexp = PatternRegex.SYSTEM_ID, message = ValidMessage.ID_FORMAT_ERROR)
|
||||
private String id;
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询实体
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public static class QueryParam extends BaseParam {
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
package com.njcn.user.pojo.param;
|
||||
|
||||
import com.njcn.common.pojo.constant.PatternRegex;
|
||||
import com.njcn.user.pojo.constant.UserValidMessage;
|
||||
import com.njcn.web.constant.ValidMessage;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.hibernate.validator.constraints.Range;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Pattern;
|
||||
|
||||
/**
|
||||
* 类的介绍:
|
||||
*
|
||||
* @author xuyang
|
||||
* @version 1.0.0
|
||||
* @createTime 2022/1/17 10:25
|
||||
*/
|
||||
@Data
|
||||
public class FunctionParam {
|
||||
|
||||
@ApiModelProperty("节点")
|
||||
@NotBlank(message = UserValidMessage.PID_NOT_BLANK)
|
||||
private String pid;
|
||||
|
||||
@ApiModelProperty("名称")
|
||||
@NotBlank(message = UserValidMessage.USERNAME_NOT_BLANK)
|
||||
@Pattern(regexp = PatternRegex.FUNCTION_NAME, message = ValidMessage.NAME_FORMAT_ERROR)
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty("资源标识")
|
||||
@NotBlank(message = UserValidMessage.CODE_NOT_BLANK)
|
||||
private String code;
|
||||
|
||||
@ApiModelProperty("路径")
|
||||
@NotBlank(message = UserValidMessage.PATH_NOT_BLANK)
|
||||
@Pattern(regexp = PatternRegex.FUNCTION_URL, message = UserValidMessage.PATH_FORMAT_ERROR)
|
||||
private String path;
|
||||
|
||||
@ApiModelProperty("图标")
|
||||
private String icon;
|
||||
|
||||
@ApiModelProperty("排序")
|
||||
@NotNull(message = UserValidMessage.SORT_NOT_BLANK)
|
||||
@Range(min = 0, max = 999, message = UserValidMessage.PARAM_FORMAT_ERROR)
|
||||
private Integer sort;
|
||||
|
||||
@ApiModelProperty("资源类型")
|
||||
@NotNull(message = UserValidMessage.TYPE_NOT_BLANK)
|
||||
@Range(min = 0, max = 3, message = UserValidMessage.PARAM_FORMAT_ERROR)
|
||||
private Integer type;
|
||||
|
||||
@ApiModelProperty("描述")
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 资源更新操作实体
|
||||
* 需要填写的参数:资源的id
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public static class FunctionUpdateParam extends FunctionParam {
|
||||
|
||||
@ApiModelProperty("资源Id")
|
||||
@NotBlank(message = UserValidMessage.FUNCTION_ID_NOT_BLANK)
|
||||
@Pattern(regexp = PatternRegex.SYSTEM_ID, message = UserValidMessage.FUNCTION_ID_FORMAT_ERROR)
|
||||
private String id;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
package com.njcn.user.pojo.param;
|
||||
|
||||
import com.njcn.common.pojo.constant.PatternRegex;
|
||||
import com.njcn.user.pojo.constant.UserValidMessage;
|
||||
import com.njcn.web.constant.ValidMessage;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.hibernate.validator.constraints.Range;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Pattern;
|
||||
|
||||
/**
|
||||
* 类的介绍:
|
||||
*
|
||||
* @author xuyang
|
||||
* @version 1.0.0
|
||||
* @createTime 2022/1/18 16:14
|
||||
*/
|
||||
@Data
|
||||
public class HomePageParam {
|
||||
|
||||
@ApiModelProperty("自定义页面名称")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty("布局模板")
|
||||
@NotBlank(message = UserValidMessage.LAYOUT_NOT_BLANK)
|
||||
private String layout;
|
||||
|
||||
@ApiModelProperty("路径")
|
||||
@NotBlank(message = UserValidMessage.PATH_NOT_BLANK)
|
||||
private String path;
|
||||
|
||||
@ApiModelProperty("排序")
|
||||
@NotNull(message = UserValidMessage.SORT_NOT_BLANK)
|
||||
@Range(min = 0, max = 999, message = UserValidMessage.PARAM_FORMAT_ERROR)
|
||||
private Integer sort;
|
||||
|
||||
@ApiModelProperty("图标")
|
||||
private String icon;
|
||||
|
||||
/**
|
||||
* 首页操作实体
|
||||
* 需要填写的参数:首页的id
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public static class HomePageUpdateParam extends HomePageParam {
|
||||
|
||||
@ApiModelProperty("首页Id")
|
||||
@NotBlank(message = UserValidMessage.ID_NOT_BLANK)
|
||||
@Pattern(regexp = PatternRegex.SYSTEM_ID, message = ValidMessage.ID_FORMAT_ERROR)
|
||||
private String id;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
package com.njcn.user.pojo.param;
|
||||
|
||||
import com.njcn.common.pojo.constant.PatternRegex;
|
||||
import com.njcn.web.constant.ValidMessage;
|
||||
import com.njcn.web.pojo.param.BaseParam;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author denghuajun
|
||||
* @date 2022/01/17 14:39
|
||||
* 角色
|
||||
*/
|
||||
@Data
|
||||
public class RoleParam {
|
||||
|
||||
|
||||
|
||||
@ApiModelProperty("名称")
|
||||
@NotBlank(message = ValidMessage.NAME_NOT_BLANK)
|
||||
@Pattern(regexp = PatternRegex.DEPT_NAME_REGEX, message = ValidMessage.NAME_FORMAT_ERROR)
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty("角色代码")
|
||||
@NotNull(message = ValidMessage.CODE_NOT_BLANK)
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 角色类型 0:超级管理员;1:管理员;2:普通用户
|
||||
*/
|
||||
@ApiModelProperty("角色类型")
|
||||
private Integer type;
|
||||
|
||||
@ApiModelProperty("角色描述")
|
||||
private String remark;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 更新操作实体
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public static class RoleUpdateParam extends RoleParam {
|
||||
|
||||
/**
|
||||
* 表Id
|
||||
*/
|
||||
@ApiModelProperty("id")
|
||||
@NotBlank(message = ValidMessage.ID_NOT_BLANK)
|
||||
@Pattern(regexp = PatternRegex.SYSTEM_ID, message = ValidMessage.ID_FORMAT_ERROR)
|
||||
private String id;
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询实体
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public static class QueryParam extends BaseParam {
|
||||
|
||||
/**
|
||||
* 权限类型
|
||||
*/
|
||||
private Integer type;
|
||||
}
|
||||
/**
|
||||
* 角色的相关关联
|
||||
*/
|
||||
@Data
|
||||
public static class RoleFunctionComponent {
|
||||
private String id;
|
||||
private List<String> idList;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,128 @@
|
||||
package com.njcn.user.pojo.param;
|
||||
|
||||
import com.njcn.common.pojo.constant.PatternRegex;
|
||||
import com.njcn.user.pojo.constant.UserValidMessage;
|
||||
import com.njcn.web.constant.ValidMessage;
|
||||
import com.njcn.web.pojo.param.BaseParam;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.hibernate.validator.constraints.Range;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Pattern;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 类的介绍:
|
||||
*
|
||||
* @author xuyang
|
||||
* @version 1.0.0
|
||||
* @createTime 2021/12/29 14:56
|
||||
*/
|
||||
@Data
|
||||
public class UserParam {
|
||||
|
||||
@ApiModelProperty("用户名")
|
||||
@NotBlank(message = UserValidMessage.USERNAME_NOT_BLANK)
|
||||
@Pattern(regexp = PatternRegex.USERNAME_REGEX, message = UserValidMessage.USERNAME_FORMAT_ERROR)
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty("部门id")
|
||||
private String deptId;
|
||||
|
||||
@ApiModelProperty("电话号码")
|
||||
@Pattern(regexp = PatternRegex.PHONE_REGEX_OR_NULL, message = UserValidMessage.PHONE_FORMAT_ERROR)
|
||||
private String phone;
|
||||
|
||||
@ApiModelProperty("邮箱")
|
||||
@Pattern(regexp = PatternRegex.EMAIL_REGEX_OR_NULL, message = UserValidMessage.EMAIL_FORMAT_ERROR)
|
||||
private String email;
|
||||
|
||||
@ApiModelProperty("起始IP")
|
||||
@NotBlank(message = UserValidMessage.LIMIT_IP_START_NOT_BLANK)
|
||||
@Pattern(regexp = PatternRegex.IP_REGEX, message = UserValidMessage.LIMIT_IP_START_FORMAT_ERROR)
|
||||
private String limitIpStart;
|
||||
|
||||
@ApiModelProperty("结束IP")
|
||||
@NotBlank(message = UserValidMessage.LIMIT_IP_END_NOT_BLANK)
|
||||
@Pattern(regexp = PatternRegex.IP_REGEX, message = UserValidMessage.LIMIT_IP_END_FORMAT_ERROR)
|
||||
private String limitIpEnd;
|
||||
|
||||
@ApiModelProperty("时间段")
|
||||
@NotBlank(message = UserValidMessage.LIMIT_TIME_NOT_BLANK)
|
||||
private String limitTime;
|
||||
|
||||
@ApiModelProperty("用户类型")
|
||||
@NotNull(message = UserValidMessage.CASUAL_USER_NOT_BLANK)
|
||||
@Range(min = 0, max = 1, message = UserValidMessage.PARAM_FORMAT_ERROR)
|
||||
private Integer casualUser;
|
||||
|
||||
@ApiModelProperty("用户权限类型")
|
||||
@NotNull(message = UserValidMessage.CASUAL_USER_NOT_BLANK)
|
||||
@Range(min = 0, max = 2, message = UserValidMessage.PARAM_FORMAT_ERROR)
|
||||
private Integer type;
|
||||
|
||||
@ApiModelProperty("短信通知")
|
||||
@NotNull(message = UserValidMessage.SMS_NOTICE_NOT_BLANK)
|
||||
@Range(min = 0, max = 1, message = UserValidMessage.PARAM_FORMAT_ERROR)
|
||||
private Integer smsNotice;
|
||||
|
||||
@ApiModelProperty("邮件通知")
|
||||
@NotNull(message = UserValidMessage.EMAIL_NOTICE_NOT_BLANK)
|
||||
@Range(min = 0, max = 1, message = UserValidMessage.PARAM_FORMAT_ERROR)
|
||||
private Integer emailNotice;
|
||||
|
||||
@ApiModelProperty("角色")
|
||||
@NotEmpty(message = UserValidMessage.ROLE_NOT_BLANK)
|
||||
private List<String> role;
|
||||
|
||||
/**
|
||||
* 用户新增操作实体
|
||||
*
|
||||
* 需要填写的参数:登录名、密码
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public static class UserAddParam extends UserParam {
|
||||
|
||||
@ApiModelProperty("登录名")
|
||||
@NotBlank(message = UserValidMessage.LOGIN_NAME_NOT_BLANK)
|
||||
@Pattern(regexp = PatternRegex.LOGIN_NAME_REGEX, message = UserValidMessage.LOGIN_NAME_FORMAT_ERROR)
|
||||
private String loginName;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 用户更新操作实体
|
||||
*
|
||||
* 需要填写的参数:用户的id
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public static class UserUpdateParam extends UserParam {
|
||||
|
||||
@ApiModelProperty("用户表Id")
|
||||
@NotBlank(message = UserValidMessage.ID_NOT_BLANK)
|
||||
@Pattern(regexp = PatternRegex.SYSTEM_ID, message = ValidMessage.ID_FORMAT_ERROR)
|
||||
private String id;
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询实体
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public static class UserQueryParam extends BaseParam {
|
||||
|
||||
@ApiModelProperty("用户类型")
|
||||
@NotNull(message = UserValidMessage.CASUAL_USER_NOT_BLANK)
|
||||
@Range(min = -1, max = 1, message = UserValidMessage.PARAM_FORMAT_ERROR)
|
||||
private Integer casualUser;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.njcn.user.pojo.param;
|
||||
|
||||
import com.njcn.user.pojo.constant.UserValidMessage;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
|
||||
/**
|
||||
* 类的介绍:
|
||||
*
|
||||
* @author xuyang
|
||||
* @version 1.0.0
|
||||
* @createTime 2022/3/22 13:31
|
||||
*/
|
||||
@Data
|
||||
public class UserPasswordParam {
|
||||
|
||||
@ApiModelProperty("用户名")
|
||||
@NotBlank(message = UserValidMessage.USERNAME_NOT_BLANK)
|
||||
private String name;
|
||||
|
||||
|
||||
@ApiModelProperty("密码")
|
||||
@NotBlank(message = UserValidMessage.PASSWORD_NOT_BLANK)
|
||||
private String password;
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
package com.njcn.user.pojo.po;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.njcn.db.bo.BaseEntity;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* @author hongawen
|
||||
* @since 2021-12-15
|
||||
*/
|
||||
@Data
|
||||
@TableName("sys_auth_client")
|
||||
public class AuthClient {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 认证客户端Id
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 客户端名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 资源Id列表
|
||||
*/
|
||||
private String resourceIds;
|
||||
|
||||
/**
|
||||
* 客户端秘钥
|
||||
*/
|
||||
private String clientSecret;
|
||||
|
||||
/**
|
||||
* 域
|
||||
*/
|
||||
private String scope;
|
||||
|
||||
/**
|
||||
* 授权方式
|
||||
*/
|
||||
private String authorizedGrantTypes;
|
||||
|
||||
/**
|
||||
* 回调地址
|
||||
*/
|
||||
private String webServerRedirectUri;
|
||||
|
||||
/**
|
||||
* 权限列表
|
||||
*/
|
||||
private String authorities;
|
||||
|
||||
/**
|
||||
* 认证令牌时效
|
||||
*/
|
||||
private Integer accessTokenValidity;
|
||||
|
||||
/**
|
||||
* 刷新令牌时效
|
||||
*/
|
||||
private Integer refreshTokenValidity;
|
||||
|
||||
/**
|
||||
* 扩展信息
|
||||
*/
|
||||
private String additionalInformation;
|
||||
|
||||
/**
|
||||
* 是否自动放行 0-不放行 1-放行
|
||||
*/
|
||||
private Boolean autoApprove;
|
||||
|
||||
/**
|
||||
* 状态:0-删除 1-正常
|
||||
*/
|
||||
private Integer state;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
package com.njcn.user.pojo.po;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.njcn.db.bo.BaseEntity;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author hongawen
|
||||
* @since 2021-12-13
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("sys_component")
|
||||
public class Component extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 组件Id
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 资源Id
|
||||
*/
|
||||
private String functionId;
|
||||
|
||||
/**
|
||||
* 父节点Id
|
||||
*/
|
||||
private String pid;
|
||||
|
||||
/**
|
||||
* 上层所有节点Id
|
||||
*/
|
||||
private String pids;
|
||||
|
||||
/**
|
||||
* 功能组件名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 功能组件表示
|
||||
*/
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 组件路径
|
||||
*/
|
||||
private String path;
|
||||
|
||||
/**
|
||||
* 功能数组
|
||||
*/
|
||||
private String functionGroup;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
private Integer sort;
|
||||
|
||||
/**
|
||||
* 状态:0-删除 1-正常
|
||||
*/
|
||||
private Integer state;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
package com.njcn.user.pojo.po;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.njcn.db.bo.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author hongawen
|
||||
* @since 2021-12-13
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("sys_dept")
|
||||
public class Dept extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 部门表Id
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 父节点Id(0为根节点)
|
||||
*/
|
||||
private String pid;
|
||||
|
||||
/**
|
||||
* 上层所有节点Id
|
||||
*/
|
||||
private String pids;
|
||||
|
||||
/**
|
||||
* 部门名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* (sys_Area)行政区域Id,自定义部门无需填写部门
|
||||
*/
|
||||
private String area;
|
||||
|
||||
/**
|
||||
* 部门类型 0-非自定义;1-web自定义;2-App自定义;3-web测试
|
||||
*/
|
||||
private Integer type;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
private Integer sort;
|
||||
|
||||
/**
|
||||
* 部门描述
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 部门状态 0-删除;1-正常;默认正常
|
||||
*/
|
||||
private Integer state;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
package com.njcn.user.pojo.po;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.njcn.db.bo.BaseEntity;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author hongawen
|
||||
* @since 2021-12-13
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("sys_function")
|
||||
public class Function extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 资源表Id
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 父节点(0为根节点)
|
||||
*/
|
||||
private String pid;
|
||||
|
||||
/**
|
||||
* 所有上层节点
|
||||
*/
|
||||
private String pids;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 资源标识
|
||||
*/
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 路径
|
||||
*/
|
||||
private String path;
|
||||
|
||||
/**
|
||||
* 图标(没有图标则默认为null)
|
||||
*/
|
||||
private String icon;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
private Integer sort;
|
||||
|
||||
/**
|
||||
* 资源类型:0-菜单、1-按钮、2-公共资源、3-服务间调用资源
|
||||
*/
|
||||
private Integer type;
|
||||
|
||||
/**
|
||||
* 资源描述
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 资源状态:0-删除 1-正常(默认为正常)
|
||||
*/
|
||||
private Integer state;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package com.njcn.user.pojo.po;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.njcn.db.bo.BaseEntity;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author hongawen
|
||||
* @since 2021-12-13
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("sys_home_page")
|
||||
public class HomePage extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主页面Id
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 用户Id
|
||||
*/
|
||||
private String userId;
|
||||
|
||||
/**
|
||||
* 自定义页面名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 布局魔板
|
||||
*/
|
||||
private String layout;
|
||||
|
||||
/**
|
||||
* 路径
|
||||
*/
|
||||
private String path;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
private Integer sort;
|
||||
|
||||
/**
|
||||
* 状态:0-删除 1-正常
|
||||
*/
|
||||
private Integer state;
|
||||
|
||||
/**
|
||||
* 图标
|
||||
*/
|
||||
private String icon;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
package com.njcn.user.pojo.po;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.njcn.db.bo.BaseEntity;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author hongawen
|
||||
* @since 2021-12-13
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("sys_role")
|
||||
public class Role extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 角色表Id
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 角色名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 角色代码,有需要用做匹配时候用(关联字典表id)
|
||||
*/
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 角色描述
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 角色状态0-删除;1-正常;默认正常
|
||||
*/
|
||||
private Integer state;
|
||||
|
||||
/**
|
||||
* 角色类型0-超级管理员 1-其他管理员 2-其他用户
|
||||
*/
|
||||
private Integer type;
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.njcn.user.pojo.po;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author hongawen
|
||||
* @since 2021-12-13
|
||||
*/
|
||||
@Data
|
||||
@TableName("sys_role_component")
|
||||
public class RoleComponent {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 角色Id
|
||||
*/
|
||||
private String roleId;
|
||||
|
||||
/**
|
||||
* 组件Id
|
||||
*/
|
||||
private String componentId;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.njcn.user.pojo.po;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author hongawen
|
||||
* @since 2021-12-13
|
||||
*/
|
||||
@Data
|
||||
@TableName("sys_role_function")
|
||||
public class RoleFunction {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 角色Id
|
||||
*/
|
||||
private String roleId;
|
||||
|
||||
/**
|
||||
* 资源Id
|
||||
*/
|
||||
private String functionId;
|
||||
|
||||
|
||||
}
|
||||
146
pqs-user/user-api/src/main/java/com/njcn/user/pojo/po/User.java
Normal file
146
pqs-user/user-api/src/main/java/com/njcn/user/pojo/po/User.java
Normal file
@@ -0,0 +1,146 @@
|
||||
package com.njcn.user.pojo.po;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.njcn.db.bo.BaseEntity;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* @author hongawen
|
||||
* @since 2021-12-13
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("sys_user")
|
||||
public class User extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 用户ID
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 用户名
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 登录名
|
||||
*/
|
||||
private String loginName;
|
||||
|
||||
/**
|
||||
* 密码
|
||||
*/
|
||||
private String password;
|
||||
|
||||
/**
|
||||
* 部门Id
|
||||
*/
|
||||
private String deptId;
|
||||
|
||||
/**
|
||||
* 电话号码
|
||||
*/
|
||||
private String phone;
|
||||
|
||||
/**
|
||||
* 邮箱
|
||||
*/
|
||||
private String email;
|
||||
|
||||
/**
|
||||
* 用户状态0-删除;1-正常;2-锁定;3-待审核;4-休眠;5-密码过期
|
||||
*/
|
||||
private Integer state;
|
||||
|
||||
/**
|
||||
* 用户类型 0:超级管理员;1:管理员;2:普通用户
|
||||
*/
|
||||
private Integer type;
|
||||
|
||||
/**
|
||||
* 数据来源:0-外部推送;1-正常新增;默认正常新增
|
||||
*/
|
||||
private Integer origin;
|
||||
|
||||
/**
|
||||
* 用户类型:0-临时用户 1-正式用户
|
||||
*/
|
||||
private Integer casualUser;
|
||||
|
||||
/**
|
||||
* 密码状态:0-不需要修改 1-需要修改
|
||||
*/
|
||||
private Integer pwdState;
|
||||
|
||||
/**
|
||||
* 短信通知(0-不通知;1-通知)默认不通知
|
||||
*/
|
||||
private Integer smsNotice;
|
||||
|
||||
/**
|
||||
* 邮件通知(0-不通知;1-通知)默认不通知
|
||||
*/
|
||||
private Integer emailNotice;
|
||||
|
||||
/**
|
||||
* 推荐码
|
||||
*/
|
||||
private String referralCode;
|
||||
|
||||
/**
|
||||
* 注册时间
|
||||
*/
|
||||
private LocalDateTime registerTime;
|
||||
|
||||
/**
|
||||
* 密码有效期字段(初始化的时候跟注册时间一样)
|
||||
*/
|
||||
private LocalDateTime pwdValidity;
|
||||
|
||||
/**
|
||||
* 最后一次登录时间
|
||||
*/
|
||||
private LocalDateTime loginTime;
|
||||
|
||||
/**
|
||||
* 限制登录起始IP
|
||||
*/
|
||||
private String limitIpStart;
|
||||
|
||||
/**
|
||||
* 限制登录结束IP
|
||||
*/
|
||||
private String limitIpEnd;
|
||||
|
||||
/**
|
||||
* 限制登录时间段(用'-'分割)
|
||||
*/
|
||||
private String limitTime;
|
||||
|
||||
/**
|
||||
* 密码错误次数
|
||||
*/
|
||||
private Integer loginErrorTimes;
|
||||
|
||||
/**
|
||||
* 首次密码错误时间(半个小时错误次数超过N次数则锁定,解锁后密码错误次数、首次密码错误时间重置)
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private LocalDateTime firstErrorTime;
|
||||
|
||||
/**
|
||||
* 用户密码错误锁定时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private LocalDateTime lockTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.njcn.user.pojo.po;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author hongawen
|
||||
* @since 2021-12-13
|
||||
*/
|
||||
@Data
|
||||
@TableName("sys_user_role")
|
||||
public class UserRole {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 用户Id
|
||||
*/
|
||||
private String userId;
|
||||
|
||||
/**
|
||||
* 角色Id
|
||||
*/
|
||||
private String roleId;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
package com.njcn.user.pojo.po;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author hongawen
|
||||
* @since 2021-12-13
|
||||
*/
|
||||
@Data
|
||||
@TableName("sys_user_set")
|
||||
public class UserSet {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 用户配置表Id
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 用户Id
|
||||
*/
|
||||
private String userId;
|
||||
|
||||
/**
|
||||
* 工作秘钥
|
||||
*/
|
||||
private String secretKey;
|
||||
|
||||
/**
|
||||
* SM4-1值
|
||||
*/
|
||||
private String standBy;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
package com.njcn.user.pojo.po;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.njcn.db.bo.BaseEntity;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author hongawen
|
||||
* @since 2021-12-13
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("sys_user_strategy")
|
||||
public class UserStrategy extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 用户策略Id
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 密码有效期(1-6月,默认3个月)
|
||||
*/
|
||||
private Integer limitPwdDate;
|
||||
|
||||
/**
|
||||
* 密码错误次数限定(3-20次,默认5次)
|
||||
*/
|
||||
private Integer limitPwdTimes;
|
||||
|
||||
/**
|
||||
* 验证密码错误次数时间范围(5-60分钟,默认30分钟)
|
||||
*/
|
||||
private Integer lockPwdCheck;
|
||||
|
||||
/**
|
||||
* 用户锁定时间(30-60分钟,默认30分钟)
|
||||
*/
|
||||
private Integer lockPwdTime;
|
||||
|
||||
/**
|
||||
* 用户休眠(1-180天,默认90天,临时用户默认3天)
|
||||
*/
|
||||
private Integer sleep;
|
||||
|
||||
/**
|
||||
* 用户注销(1-360天,正常用户默认180天,临时用户默认7天)
|
||||
*/
|
||||
private Integer logout;
|
||||
|
||||
/**
|
||||
* 最大并发数(10-99,默认50)
|
||||
*/
|
||||
private Integer maxNum;
|
||||
|
||||
/**
|
||||
* 类型:0-临时用户 1-正常用户
|
||||
*/
|
||||
private Integer type;
|
||||
|
||||
/**
|
||||
* 状态:0-删除 1-正常
|
||||
*/
|
||||
private Integer state;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
package com.njcn.user.pojo.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 类的介绍:
|
||||
*
|
||||
* @author xuyang
|
||||
* @version 1.0.0
|
||||
* @createTime 2022/1/19 14:56
|
||||
*/
|
||||
@Data
|
||||
public class ComponentVO implements Serializable {
|
||||
|
||||
@ApiModelProperty("组件Id")
|
||||
private String id;
|
||||
|
||||
@ApiModelProperty("资源id")
|
||||
private String functionId;
|
||||
|
||||
@ApiModelProperty("节点")
|
||||
private String pid;
|
||||
|
||||
@ApiModelProperty("功能组件名称")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty("功能数组")
|
||||
private List<Integer> functionGroup;
|
||||
|
||||
@ApiModelProperty("排序")
|
||||
private Integer sort;
|
||||
|
||||
@ApiModelProperty("功能组件表示")
|
||||
private String code;
|
||||
|
||||
@ApiModelProperty("路径")
|
||||
private String path;
|
||||
|
||||
@ApiModelProperty("子级")
|
||||
List<ComponentVO> children;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.njcn.user.pojo.vo;
|
||||
|
||||
import com.njcn.web.pojo.vo.BaseVO;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author denghuajun
|
||||
* @version 1.0.0
|
||||
* @date 2022年04月15日 11:28
|
||||
*/
|
||||
@Data
|
||||
public class DeptAllTreeVO extends BaseVO {
|
||||
|
||||
@ApiModelProperty("子节点详细信息")
|
||||
private List<DeptAllTreeVO> children;
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package com.njcn.user.pojo.vo;
|
||||
|
||||
import com.njcn.web.pojo.vo.BaseVO;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author denghuajun
|
||||
* @date 2022/1/4
|
||||
*
|
||||
*/
|
||||
@Data
|
||||
public class DeptTreeVO extends BaseVO {
|
||||
|
||||
@ApiModelProperty("行政区域id")
|
||||
private String area;
|
||||
|
||||
@ApiModelProperty("行政区域name")
|
||||
private String areaName;
|
||||
|
||||
@ApiModelProperty("状态")
|
||||
private Integer state;
|
||||
|
||||
@ApiModelProperty("部门类型")
|
||||
private Integer type;
|
||||
|
||||
@ApiModelProperty("部门描述")
|
||||
private String remark;
|
||||
|
||||
@ApiModelProperty("排序")
|
||||
private Integer sort;
|
||||
|
||||
@ApiModelProperty("子节点详细信息")
|
||||
private List<DeptTreeVO> children;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
package com.njcn.user.pojo.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author denghuajun
|
||||
* @date 2021/12/28 10:50
|
||||
* 部门管理VO
|
||||
*/
|
||||
@Data
|
||||
public class DeptVO implements Serializable {
|
||||
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 部门表Id
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 父节点Id(0为根节点)
|
||||
*/
|
||||
private String pid;
|
||||
|
||||
/**
|
||||
* 上层所有节点Id
|
||||
*/
|
||||
private String pids;
|
||||
|
||||
/**
|
||||
* 部门名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 行政区域name
|
||||
*/
|
||||
private String areaName;
|
||||
|
||||
/**
|
||||
* 部门类型 0-非自定义;1-web自定义;2-App自定义
|
||||
*/
|
||||
private Integer type;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
private Integer sort;
|
||||
|
||||
/**
|
||||
* 部门描述
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 部门状态 0-删除;1-正常;默认正常
|
||||
*/
|
||||
private Integer state;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
package com.njcn.user.pojo.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 类的介绍:
|
||||
*
|
||||
* @author xuyang
|
||||
* @version 1.0.0
|
||||
* @createTime 2022/1/17 17:02
|
||||
*/
|
||||
@Data
|
||||
public class FunctionVO implements Serializable {
|
||||
|
||||
@ApiModelProperty("资源Id")
|
||||
private String id;
|
||||
|
||||
@ApiModelProperty("节点")
|
||||
private String pid;
|
||||
|
||||
@ApiModelProperty("名称")
|
||||
private String title;
|
||||
|
||||
@ApiModelProperty("资源标识")
|
||||
private String code;
|
||||
|
||||
@ApiModelProperty("routeName")
|
||||
private String routeName;
|
||||
|
||||
@ApiModelProperty("路径")
|
||||
private String routePath;
|
||||
|
||||
@ApiModelProperty("图标")
|
||||
private String icon;
|
||||
|
||||
@ApiModelProperty("排序")
|
||||
private Integer sort;
|
||||
|
||||
@ApiModelProperty("资源类型")
|
||||
private Integer type;
|
||||
|
||||
@ApiModelProperty("描述")
|
||||
private String remark;
|
||||
|
||||
@ApiModelProperty("子级")
|
||||
List<FunctionVO> children;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
package com.njcn.user.pojo.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author denghuajun
|
||||
* @date 2022/1/17
|
||||
*
|
||||
*/
|
||||
@Data
|
||||
public class RoleVO {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 角色表Id
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 角色名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 角色代码,有需要用做匹配时候用(关联字典表id)
|
||||
*/
|
||||
private String code;
|
||||
|
||||
|
||||
/**
|
||||
* 角色描述
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 角色状态0-删除;1-正常;默认正常
|
||||
*/
|
||||
private Integer state;
|
||||
|
||||
/**
|
||||
* 角色类型0-超级管理员 1-其他管理员 2-其他用户
|
||||
*/
|
||||
private Integer type;
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
package com.njcn.user.pojo.vo;
|
||||
|
||||
import com.njcn.user.pojo.param.UserParam;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 类的介绍:
|
||||
*
|
||||
* @author xuyang
|
||||
* @version 1.0.0
|
||||
* @createTime 2021/12/29 14:31
|
||||
*/
|
||||
@Data
|
||||
public class UserVO extends UserParam implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("用户Id")
|
||||
private String id;
|
||||
|
||||
@ApiModelProperty("登录名")
|
||||
private String loginName;
|
||||
|
||||
@ApiModelProperty("状态")
|
||||
private Integer state;
|
||||
|
||||
@ApiModelProperty("注册时间")
|
||||
private String registerTime;
|
||||
|
||||
@ApiModelProperty("登录时间")
|
||||
private String loginTime;
|
||||
|
||||
@ApiModelProperty("部门名称")
|
||||
private String deptName;
|
||||
|
||||
@ApiModelProperty("角色id")
|
||||
private List<String> roleList;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
package com.njcn.user.utils;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.common.utils.EnumUtils;
|
||||
import com.njcn.user.enums.UserResponseEnum;
|
||||
import com.njcn.user.enums.UserStatusEnum;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @author hongawen
|
||||
* @version 1.0.0
|
||||
* @date 2021年05月26日 17:17
|
||||
*/
|
||||
public class UserEnumUtil {
|
||||
|
||||
/**
|
||||
* 获取UserResponseEnum实例
|
||||
*/
|
||||
public static UserResponseEnum getUserResponseEnumByMessage(@NotNull Object value) {
|
||||
UserResponseEnum userResponseEnum;
|
||||
try {
|
||||
String message = value.toString();
|
||||
if(message.indexOf(StrUtil.C_COMMA)>0){
|
||||
value = message.substring(message.indexOf(StrUtil.C_COMMA)+1);
|
||||
}
|
||||
userResponseEnum = EnumUtils.valueOf(UserResponseEnum.class, value, UserResponseEnum.class.getMethod(BusinessException.GET_MESSAGE_METHOD));
|
||||
return Objects.isNull(userResponseEnum) ? UserResponseEnum.LOGIN_WRONG_PWD : userResponseEnum;
|
||||
} catch (NoSuchMethodException e) {
|
||||
throw new BusinessException(CommonResponseEnum.INTERNAL_ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取UserStatusEnum实例
|
||||
*/
|
||||
public static UserStatusEnum getUserStatusEnumByCode(Object value) {
|
||||
UserStatusEnum userStatusEnum;
|
||||
try {
|
||||
userStatusEnum = EnumUtils.valueOf(UserStatusEnum.class, value, UserStatusEnum.class.getMethod(BusinessException.GET_CODE_METHOD));
|
||||
return Objects.isNull(userStatusEnum) ? UserStatusEnum.NORMAL : userStatusEnum;
|
||||
} catch (NoSuchMethodException e) {
|
||||
throw new BusinessException(CommonResponseEnum.INTERNAL_ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
public static Enum<?> getExceptionEnum(HttpResult<Object> result){
|
||||
//如果返回错误,且为内部错误,则直接抛出异常
|
||||
CommonResponseEnum commonResponseEnum = EnumUtils.getCommonResponseEnumByCode(result.getCode());
|
||||
if (commonResponseEnum == CommonResponseEnum.USER_RESPONSE_ENUM) {
|
||||
return getUserResponseEnumByMessage(result.getMessage());
|
||||
}
|
||||
return commonResponseEnum;
|
||||
}
|
||||
}
|
||||
6
pqs-user/user-boot/Dockerfile
Normal file
6
pqs-user/user-boot/Dockerfile
Normal file
@@ -0,0 +1,6 @@
|
||||
FROM openjdk:8-jdk-alpine
|
||||
ADD target/userboot.jar userboot.jar
|
||||
ENTRYPOINT ["java","-jar","/userboot.jar"]
|
||||
EXPOSE 10201
|
||||
RUN /bin/cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \&& echo 'Asia/Shanghai' >/etc/timezone
|
||||
|
||||
114
pqs-user/user-boot/pom.xml
Normal file
114
pqs-user/user-boot/pom.xml
Normal file
@@ -0,0 +1,114 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>pqs-user</artifactId>
|
||||
<groupId>com.njcn</groupId>
|
||||
<version>1.0.0</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>user-boot</artifactId>
|
||||
<name>用户服务模块</name>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>8</maven.compiler.source>
|
||||
<maven.compiler.target>8</maven.compiler.target>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.njcn</groupId>
|
||||
<artifactId>user-api</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.njcn</groupId>
|
||||
<artifactId>system-api</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.njcn</groupId>
|
||||
<artifactId>device-api</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.njcn</groupId>
|
||||
<artifactId>common-web</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.njcn</groupId>
|
||||
<artifactId>common-swagger</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<finalName>userboot</finalName>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.8.0</version>
|
||||
<configuration>
|
||||
<compilerArgument>-Xlint:unchecked</compilerArgument>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>repackage</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>com.spotify</groupId>
|
||||
<artifactId>docker-maven-plugin</artifactId>
|
||||
<version>1.0.0</version>
|
||||
<executions>
|
||||
<!--执行mvn package,即执行 mvn clean package docker:build-->
|
||||
<execution>
|
||||
<id>build-image</id>
|
||||
<phase>${docker.operate}</phase>
|
||||
<goals>
|
||||
<goal>build</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
<configuration>
|
||||
<!--<serverId>36dockerHarbor</serverId>-->
|
||||
<registryUrl>http://${docker.repostory}</registryUrl>
|
||||
<!-- 镜像名称 -->
|
||||
<imageName>${docker.repostory}/${docker.registry.name}/${project.artifactId}</imageName>
|
||||
<!-- 指定标签 -->
|
||||
<imageTags>
|
||||
<imageTag>latest</imageTag>
|
||||
</imageTags>
|
||||
<!-- 指定远程 Docker API地址 -->
|
||||
<dockerHost>${docker.url}</dockerHost>
|
||||
<dockerDirectory>${basedir}/</dockerDirectory>
|
||||
<!-- 复制 jar包到docker容器指定目录-->
|
||||
<resources>
|
||||
<resource>
|
||||
<targetPath>/ROOT</targetPath>
|
||||
<!-- 用于指定需要复制的根目录,${project.build.directory}表示target目录 -->
|
||||
<directory>${project.build.directory}</directory>
|
||||
<!-- 用于指定需要复制的文件,${project.build.finalName}.jar就是打包后的target目录下的jar包名称 -->
|
||||
<include>${project.build.finalName}.jar</include>
|
||||
</resource>
|
||||
</resources>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.njcn.user;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.mybatis.spring.annotation.MapperScan;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.cloud.openfeign.EnableFeignClients;
|
||||
|
||||
|
||||
/**
|
||||
* @author hongawen
|
||||
* @version 1.0.0
|
||||
* @date 2021年12月09日 20:59
|
||||
*/
|
||||
@Slf4j
|
||||
@MapperScan("com.njcn.**.mapper")
|
||||
@EnableFeignClients(basePackages = "com.njcn")
|
||||
@SpringBootApplication(scanBasePackages = "com.njcn")
|
||||
public class UserBootApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(UserBootApplication.class, args);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
package com.njcn.user.controller;
|
||||
|
||||
|
||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.common.utils.LogUtil;
|
||||
import com.njcn.user.enums.UserResponseEnum;
|
||||
import com.njcn.user.pojo.po.AuthClient;
|
||||
import com.njcn.user.service.IAuthClientService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author hongawen
|
||||
* @since 2021-12-15
|
||||
*/
|
||||
@Slf4j
|
||||
@Validated
|
||||
@Api(tags = "客户端信息管理")
|
||||
@AllArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/authClient")
|
||||
public class AuthClientController extends BaseController {
|
||||
|
||||
private final IAuthClientService authClientService;
|
||||
|
||||
|
||||
@OperateInfo
|
||||
@GetMapping("/getAuthClientByName/{clientName}")
|
||||
@ApiOperation("根据客户端名查询信息")
|
||||
@ApiImplicitParam(name = "clientName", value = "客户端名称", required = true)
|
||||
public HttpResult<AuthClient> getAuthClientByName(@PathVariable("clientName") String clientName) {
|
||||
String methodDescribe = getMethodDescribe("getAuthClientByName");
|
||||
LogUtil.njcnDebug(log, "{},客户端为:{}", methodDescribe, clientName);
|
||||
AuthClient authClient = authClientService.getAuthClientByName(clientName);
|
||||
if (Objects.isNull(authClient)) {
|
||||
throw new BusinessException(UserResponseEnum.NOT_FOUND_CLIENT);
|
||||
} else {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, authClient, methodDescribe);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,119 @@
|
||||
package com.njcn.user.controller;
|
||||
|
||||
|
||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||
import com.njcn.common.pojo.constant.OperateType;
|
||||
import com.njcn.common.pojo.enums.common.LogEnum;
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.common.utils.LogUtil;
|
||||
import com.njcn.user.pojo.param.ComponentParam;
|
||||
import com.njcn.user.pojo.vo.ComponentVO;
|
||||
import com.njcn.user.service.IComponentService;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author hongawen
|
||||
* @since 2021-12-13
|
||||
*/
|
||||
@Validated
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/component")
|
||||
@Api(tags = "组件信息管理")
|
||||
@AllArgsConstructor
|
||||
public class ComponentController extends BaseController {
|
||||
|
||||
private final IComponentService componentService;
|
||||
|
||||
/**
|
||||
* 新增组件
|
||||
* @param componentParam 组件数据
|
||||
*/
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON, operateType = OperateType.ADD)
|
||||
@PostMapping("/add")
|
||||
@ApiOperation("新增组件")
|
||||
@ApiImplicitParam(name = "componentParam", value = "组件数据", required = true)
|
||||
public HttpResult<Boolean> add(@RequestBody @Validated ComponentParam componentParam) {
|
||||
String methodDescribe = getMethodDescribe("add");
|
||||
LogUtil.njcnDebug(log, "{},用户数据为:{}", methodDescribe, componentParam);
|
||||
boolean result = componentService.addComponent(componentParam);
|
||||
if (result) {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, true, methodDescribe);
|
||||
} else {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, false, methodDescribe);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除组件
|
||||
* @param id 组件id
|
||||
*/
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON, operateType = OperateType.DELETE)
|
||||
@DeleteMapping("/delete")
|
||||
@ApiOperation("删除组件")
|
||||
@ApiImplicitParam(name = "id", value = "组件id", required = true)
|
||||
public HttpResult<Boolean> delete(@RequestParam @Validated String id) {
|
||||
String methodDescribe = getMethodDescribe("delete");
|
||||
LogUtil.njcnDebug(log, "{},组件id为:{}", methodDescribe, id);
|
||||
boolean result = componentService.deleteComponent(id);
|
||||
if (result) {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, true, methodDescribe);
|
||||
} else {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, false, methodDescribe);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改组件
|
||||
* @param componentParam 组件数据
|
||||
*/
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON, operateType = OperateType.UPDATE)
|
||||
@PutMapping("/update")
|
||||
@ApiOperation("修改组件")
|
||||
@ApiImplicitParam(name = "componentParam", value = "组件数据", required = true)
|
||||
public HttpResult<Boolean> update(@RequestBody @Validated ComponentParam.ComponentUpdateParam componentParam) {
|
||||
String methodDescribe = getMethodDescribe("update");
|
||||
LogUtil.njcnDebug(log, "{},更新的菜单信息为:{}", methodDescribe,componentParam);
|
||||
boolean result = componentService.updateComponent(componentParam);
|
||||
if (result){
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, true, methodDescribe);
|
||||
} else {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, false, methodDescribe);
|
||||
}
|
||||
}
|
||||
|
||||
@OperateInfo
|
||||
@GetMapping("/componentTree")
|
||||
@ApiOperation("组件树")
|
||||
public HttpResult<List<ComponentVO>> getComponentTree(){
|
||||
String methodDescribe = getMethodDescribe("getComponentTree");
|
||||
List<ComponentVO> list = componentService.getComponentTree();
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS,list,methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo
|
||||
@GetMapping("/userComponentTree")
|
||||
@ApiOperation("用户组件树")
|
||||
public HttpResult<List<ComponentVO>> getUserComponentTree(){
|
||||
String methodDescribe = getMethodDescribe("getUserComponentTree");
|
||||
List<ComponentVO> list = componentService.getUserComponentTree();
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS,list,methodDescribe);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,260 @@
|
||||
package com.njcn.user.controller;
|
||||
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||
import com.njcn.common.pojo.constant.OperateType;
|
||||
import com.njcn.common.pojo.enums.common.LogEnum;
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.common.utils.LogUtil;
|
||||
import com.njcn.system.pojo.dto.AreaTreeDTO;
|
||||
import com.njcn.user.pojo.dto.DeptDTO;
|
||||
import com.njcn.user.pojo.param.DeptParam;
|
||||
import com.njcn.user.pojo.vo.DeptAllTreeVO;
|
||||
import com.njcn.user.pojo.vo.DeptTreeVO;
|
||||
import com.njcn.user.pojo.vo.DeptVO;
|
||||
import com.njcn.user.service.IDeptService;
|
||||
import com.njcn.web.pojo.param.DeptLineParam;
|
||||
import com.njcn.web.utils.ControllerUtil;
|
||||
import io.swagger.annotations.*;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import springfox.documentation.annotations.ApiIgnore;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 前端控制器(部门信息)
|
||||
* </p>
|
||||
*
|
||||
* @author hongawen
|
||||
* @since 2021-12-13
|
||||
*/
|
||||
@Validated
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/dept")
|
||||
@Api(tags = "部门管理")
|
||||
@AllArgsConstructor
|
||||
public class DeptController extends BaseController {
|
||||
|
||||
private final IDeptService deptService;
|
||||
|
||||
/**
|
||||
* 分页查询部门信息
|
||||
*/
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/list")
|
||||
@ApiOperation("查询部门信息")
|
||||
@ApiImplicitParam(name = "queryParam", value = "查询参数", required = true)
|
||||
public HttpResult<Page<DeptVO>> list(@RequestBody @Validated DeptParam.QueryParam queryParam) {
|
||||
String methodDescribe = getMethodDescribe("list");
|
||||
LogUtil.njcnDebug(log, "{},查询数据为:{}", methodDescribe, queryParam);
|
||||
Page<DeptVO> result = deptService.listDept(queryParam);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||
@PostMapping("/getAreaTree")
|
||||
@ApiOperation("查询区域树")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "id",value = "区域id",required = false),
|
||||
@ApiImplicitParam(name = "type", value = "区域类型", required = true)
|
||||
})
|
||||
public HttpResult<Object> getAreaTree(@RequestParam(required = false)@ApiParam("id")String id , @RequestParam("type") Integer type) {
|
||||
String methodDescribe = getMethodDescribe("getAreaTree");
|
||||
List<AreaTreeDTO> result = deptService.getAreaTree(id,type);
|
||||
if (!result.isEmpty()) {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
} else {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增部门
|
||||
*
|
||||
* @param deptParam 部门信息
|
||||
*/
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON, operateType = OperateType.ADD)
|
||||
@PostMapping("/add")
|
||||
@ApiOperation("新增部门信息")
|
||||
@ApiImplicitParam(name = "deptParam", value = "部门信息数据", required = true)
|
||||
public HttpResult<Object> add(@RequestBody @Validated DeptParam deptParam) {
|
||||
String methodDescribe = getMethodDescribe("add");
|
||||
LogUtil.njcnDebug(log, "{},部门信息数据为:{}", methodDescribe, deptParam);
|
||||
boolean result = deptService.addDept(deptParam);
|
||||
if (result) {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
} else {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改部门信息
|
||||
*/
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON, operateType = OperateType.UPDATE)
|
||||
@PostMapping("/update")
|
||||
@ApiOperation("修改部门信息")
|
||||
@ApiImplicitParam(name = "updateParam", value = "部门信息", required = true)
|
||||
public HttpResult<Object> update(@RequestBody @Validated DeptParam.DeptUpdateParam updateParam) {
|
||||
String methodDescribe = getMethodDescribe("update");
|
||||
LogUtil.njcnDebug(log, "{},字典数据为:{}", methodDescribe, updateParam);
|
||||
boolean result = deptService.updateDept(updateParam);
|
||||
if (result) {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
} else {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除部门信息
|
||||
*/
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON, operateType = OperateType.DELETE)
|
||||
@PostMapping("/delete")
|
||||
@ApiOperation("删除部门信息")
|
||||
@ApiImplicitParam(name = "ids", value = "部门索引", required = true)
|
||||
public HttpResult<Object> delete(@RequestBody List<String> ids) {
|
||||
String methodDescribe = getMethodDescribe("delete");
|
||||
LogUtil.njcnDebug(log, "{},部门信息数据为:{}", methodDescribe, ids);
|
||||
boolean result = deptService.deleteDept(ids);
|
||||
if (result) {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
} else {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断是否有关联信息
|
||||
*/
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||
@PostMapping("/selectPid")
|
||||
@ApiOperation("是否有关联信息")
|
||||
@ApiImplicitParam(name = "ids", value = "部门索引", required = true)
|
||||
public HttpResult<Object> selectPid(@RequestBody List<String> ids) {
|
||||
String methodDescribe = getMethodDescribe("selectPid");
|
||||
LogUtil.njcnDebug(log, "{},查询数据为:{}", methodDescribe, ids);
|
||||
boolean result = deptService.selectPid(ids);
|
||||
if (result) {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.DELETE_PID_EXIST, null, methodDescribe);
|
||||
} else {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.DELETE_PID_UNEXIST, null, methodDescribe);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取部门树
|
||||
*/
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||
@PostMapping("/deptTree")
|
||||
@ApiOperation("部门信息树")
|
||||
public HttpResult<Object> deptTree() {
|
||||
String methodDescribe = getMethodDescribe("deptTree");
|
||||
List<DeptTreeVO> result = deptService.deptTree();
|
||||
if (!result.isEmpty()) {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
} else {
|
||||
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.NO_DATA, null, methodDescribe);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 根据条件获取后代部门索引
|
||||
*
|
||||
*/
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/getDeptDescendantIndexes")
|
||||
@ApiOperation("获取后代部门索引")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "id", value = "部门id", required = true),
|
||||
@ApiImplicitParam(name = "type", value = "部门类型", required = true)
|
||||
})
|
||||
public HttpResult<List<DeptDTO>> getDeptDescendantIndexes(@RequestParam("id") String id, @RequestParam("type") List<Integer> type) {
|
||||
String methodDescribe = getMethodDescribe("getDeptDescendantIndexes");
|
||||
List<DeptDTO> deptInfos = deptService.getDeptDescendantIndexes(id,type);
|
||||
if (CollectionUtil.isEmpty(deptInfos)) {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.NO_DATA, null, methodDescribe);
|
||||
} else {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, deptInfos, methodDescribe);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 功能描述: 根据区域索引获取部门索引
|
||||
*
|
||||
* @return
|
||||
* @author xy
|
||||
* @date 2022/2/14 15:04
|
||||
*/
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@GetMapping("/getDeptIdByArea")
|
||||
@ApiOperation("根据区域索引获取部门索引")
|
||||
@ApiIgnore
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "area", value = "区域id", required = true)
|
||||
})
|
||||
public HttpResult<String> getDeptIdByArea(@RequestParam("area") String area) {
|
||||
String methodDescribe = getMethodDescribe("getDeptIdByArea");
|
||||
String deptId = deptService.getDeptIdByArea(area);
|
||||
if (Objects.isNull(deptId)) {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.NO_DATA, null, methodDescribe);
|
||||
} else {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, deptId, methodDescribe);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 功能描述: 根据区域索引获取部门索引
|
||||
*
|
||||
* @return
|
||||
* @author denghuajun
|
||||
* @date 2022/2/24 15:04
|
||||
*/
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@GetMapping("/getAreaIdByDeptId")
|
||||
@ApiOperation("根据区域索引获取部门索引")
|
||||
@ApiImplicitParam(name = "deptId", value = "部门id", required = true)
|
||||
public HttpResult<String> getAreaIdByDeptId(@RequestParam("deptId") String deptId) {
|
||||
String methodDescribe = getMethodDescribe("getAreaIdByDeptId");
|
||||
String areaId = deptService.getAreaIdByDeptId(deptId);
|
||||
if (Objects.isNull(areaId)) {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.NO_DATA, null, methodDescribe);
|
||||
} else {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, areaId, methodDescribe);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 根据登录用户获取部门树
|
||||
*/
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||
@PostMapping("/loginDeptTree")
|
||||
@ApiOperation("根据登录用户获取部门树")
|
||||
public HttpResult<Object> loginDeptTree() {
|
||||
String methodDescribe = getMethodDescribe("loginDeptTree");
|
||||
List<DeptAllTreeVO> result = deptService.loginDeptTree();
|
||||
if (!result.isEmpty()) {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
} else {
|
||||
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.NO_DATA, null, methodDescribe);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,158 @@
|
||||
package com.njcn.user.controller;
|
||||
|
||||
|
||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||
import com.njcn.common.pojo.constant.OperateType;
|
||||
import com.njcn.common.pojo.enums.common.LogEnum;
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.common.utils.LogUtil;
|
||||
import com.njcn.user.pojo.param.FunctionParam;
|
||||
import com.njcn.user.pojo.param.RoleParam;
|
||||
import com.njcn.user.pojo.po.Function;
|
||||
import com.njcn.user.pojo.vo.FunctionVO;
|
||||
import com.njcn.user.service.IFunctionService;
|
||||
import com.njcn.user.service.IRoleFunctionService;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author hongawen
|
||||
* @since 2021-12-13
|
||||
*/
|
||||
@Validated
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/function")
|
||||
@Api(tags = "菜单信息管理")
|
||||
@AllArgsConstructor
|
||||
public class FunctionController extends BaseController {
|
||||
|
||||
private final IFunctionService functionService;
|
||||
|
||||
private final IRoleFunctionService roleFunctionService;
|
||||
|
||||
/**
|
||||
* 新增资源
|
||||
* @param functionParam 资源数据
|
||||
*/
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON, operateType = OperateType.ADD)
|
||||
@PostMapping("/add")
|
||||
@ApiOperation("新增菜单")
|
||||
@ApiImplicitParam(name = "functionParam", value = "菜单数据", required = true)
|
||||
public HttpResult<Boolean> add(@RequestBody @Validated FunctionParam functionParam) {
|
||||
String methodDescribe = getMethodDescribe("add");
|
||||
LogUtil.njcnDebug(log, "{},菜单数据为:{}", methodDescribe, functionParam);
|
||||
boolean result = functionService.addFunction(functionParam);
|
||||
if (result) {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, true, methodDescribe);
|
||||
} else {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, false, methodDescribe);
|
||||
}
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON, operateType = OperateType.UPDATE)
|
||||
@PutMapping("/update")
|
||||
@ApiOperation("修改菜单")
|
||||
@ApiImplicitParam(name = "functionParam", value = "菜单数据", required = true)
|
||||
public HttpResult<Boolean> update(@RequestBody @Validated FunctionParam.FunctionUpdateParam functionParam) {
|
||||
String methodDescribe = getMethodDescribe("update");
|
||||
LogUtil.njcnDebug(log, "{},更新的菜单信息为:{}", methodDescribe,functionParam);
|
||||
boolean result = functionService.updateFunction(functionParam);
|
||||
if (result){
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, true, methodDescribe);
|
||||
} else {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, false, methodDescribe);
|
||||
}
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON, operateType = OperateType.DELETE)
|
||||
@DeleteMapping("/delete")
|
||||
@ApiOperation("删除菜单")
|
||||
@ApiImplicitParam(name = "id", value = "菜单id", required = true)
|
||||
public HttpResult<Boolean> delete(@RequestParam @Validated String id) {
|
||||
String methodDescribe = getMethodDescribe("delete");
|
||||
LogUtil.njcnDebug(log, "{},删除的菜单id为:{}", methodDescribe,id);
|
||||
boolean result = functionService.deleteFunction(id);
|
||||
if (result){
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, true, methodDescribe);
|
||||
} else {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, false, methodDescribe);
|
||||
}
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||
@GetMapping("/functionTree")
|
||||
@ApiOperation("菜单树")
|
||||
public HttpResult<List<FunctionVO>> getFunctionTree() {
|
||||
String methodDescribe = getMethodDescribe("getFunctionTree");
|
||||
List<FunctionVO> list = functionService.getFunctionTree();
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS,list,methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||
@GetMapping("/getFunctionById")
|
||||
@ApiOperation("菜单详情")
|
||||
@ApiImplicitParam(name = "id", value = "菜单id", required = true)
|
||||
public HttpResult<Function> getFunctionById(String id){
|
||||
String methodDescribe = getMethodDescribe("getFunctionById");
|
||||
LogUtil.njcnDebug(log, "{},菜单id为:{}", methodDescribe,id);
|
||||
Function function = functionService.getFunctionById(id);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS,function,methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||
@GetMapping("/getButtonById")
|
||||
@ApiOperation("获取按钮")
|
||||
@ApiImplicitParam(name = "id", value = "菜单id", required = true)
|
||||
public HttpResult<List<Function>> getButtonById(String id){
|
||||
String methodDescribe = getMethodDescribe("getButtonById");
|
||||
LogUtil.njcnDebug(log, "{},菜单id为:{}", methodDescribe,id);
|
||||
List<Function> list = functionService.getButtonsById(id);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS,list,methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||
@GetMapping("/getRouteMenu")
|
||||
@ApiOperation("路由菜单")
|
||||
public HttpResult<List<FunctionVO>> getRouteMenu(){
|
||||
String methodDescribe = getMethodDescribe("getRouteMenu");
|
||||
List<FunctionVO> list = functionService.getRouteMenu();
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS,list,methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(operateType = OperateType.UPDATE)
|
||||
@PostMapping("/assignFunctionByRoleIndexes")
|
||||
@ApiOperation("角色分配菜单")
|
||||
@ApiImplicitParam(name = "roleFunctionComponent", value = "角色信息", required = true)
|
||||
public HttpResult<Boolean> assignFunctionByRoleIndexes(@RequestBody @Validated RoleParam.RoleFunctionComponent roleFunctionComponent) {
|
||||
String methodDescribe = getMethodDescribe("assignFunctionByRoleIndexes");
|
||||
LogUtil.njcnDebug(log, "{},传入的角色id和资源id集合为:{}", methodDescribe,roleFunctionComponent);
|
||||
boolean result = functionService.updateRoleComponent(roleFunctionComponent);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||
@GetMapping("/userFunctionTree")
|
||||
@ApiOperation("用户菜单树")
|
||||
public HttpResult<List<FunctionVO>> getUserFunctionTree() {
|
||||
String methodDescribe = getMethodDescribe("getUserFunctionTree");
|
||||
List<FunctionVO> list = functionService.getUserFunctionTree();
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS,list,methodDescribe);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,117 @@
|
||||
package com.njcn.user.controller;
|
||||
|
||||
|
||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||
import com.njcn.common.pojo.constant.OperateType;
|
||||
import com.njcn.common.pojo.enums.common.LogEnum;
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.common.utils.LogUtil;
|
||||
import com.njcn.user.pojo.param.HomePageParam;
|
||||
import com.njcn.user.pojo.po.HomePage;
|
||||
import com.njcn.user.service.IHomePageService;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import com.njcn.web.utils.RequestUtil;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author hongawen
|
||||
* @since 2021-12-13
|
||||
*/
|
||||
@Validated
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/homePage")
|
||||
@Api(tags = "驾驶舱配置管理")
|
||||
@AllArgsConstructor
|
||||
public class HomePageController extends BaseController {
|
||||
|
||||
private final IHomePageService homePageService;
|
||||
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||
@PostMapping("/add")
|
||||
@ApiOperation("新增驾驶舱")
|
||||
@ApiImplicitParam(name = "homePage", value = "驾驶舱实体", required = true)
|
||||
public HttpResult<Boolean> add(@RequestBody HomePageParam homePage){
|
||||
String methodDescribe = getMethodDescribe("add");
|
||||
LogUtil.njcnDebug(log, "{},驾驶舱实体为:{}", methodDescribe,homePage);
|
||||
boolean result = homePageService.add(homePage);
|
||||
if (result){
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, true,methodDescribe);
|
||||
} else {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, false,methodDescribe);
|
||||
}
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON,operateType = OperateType.DELETE)
|
||||
@DeleteMapping("/delete")
|
||||
@ApiOperation("删除驾驶舱")
|
||||
@ApiImplicitParam(name = "id", value = "驾驶舱id", required = true)
|
||||
public HttpResult<Boolean> delete(@RequestParam String id){
|
||||
String methodDescribe = getMethodDescribe("delete");
|
||||
LogUtil.njcnDebug(log, "{},驾驶舱实体为:{}", methodDescribe,id);
|
||||
boolean result = homePageService.delete(id);
|
||||
if (result){
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, true,methodDescribe);
|
||||
} else {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, false,methodDescribe);
|
||||
}
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON,operateType = OperateType.UPDATE)
|
||||
@PutMapping("/update")
|
||||
@ApiOperation("修改驾驶舱")
|
||||
@ApiImplicitParam(name = "homePageUpdate", value = "驾驶舱实体", required = true)
|
||||
public HttpResult<Boolean> update(@RequestBody @Validated HomePageParam.HomePageUpdateParam homePageUpdate){
|
||||
String methodDescribe = getMethodDescribe("update");
|
||||
LogUtil.njcnDebug(log, "{},修改的驾驶舱实体:{}", methodDescribe,homePageUpdate);
|
||||
boolean result = homePageService.update(homePageUpdate);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS,result,methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||
@GetMapping("/getHomePages")
|
||||
@ApiOperation("用户驾驶舱")
|
||||
public HttpResult<List<HomePage>> getHomePages(){
|
||||
String methodDescribe = getMethodDescribe("getHomePages");
|
||||
List<HomePage> list = homePageService.getHomePagesByUserId(RequestUtil.getUserIndex());
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS,list,methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||
@GetMapping("/getHomePageById")
|
||||
@ApiOperation("驾驶舱详情")
|
||||
@ApiImplicitParam(name = "id", value = "驾驶舱id", required = true)
|
||||
public HttpResult<HomePage> getHomePageById(String id){
|
||||
String methodDescribe = getMethodDescribe("getHomePageById");
|
||||
LogUtil.njcnDebug(log, "{},传入的ID为:{}", methodDescribe,id);
|
||||
HomePage homePage = homePageService.getHomePageById(id);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS,homePage,methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||
@GetMapping("/getUsedHomePage")
|
||||
@ApiOperation("已使用驾驶舱")
|
||||
@ApiImplicitParam(name = "path", value = "驾驶舱路径", required = true)
|
||||
public HttpResult<List<String>> getUsedHomePage(String path){
|
||||
String methodDescribe = getMethodDescribe("getUsedHomePage");
|
||||
LogUtil.njcnDebug(log, "{},传入的驾驶舱路径为:{}", methodDescribe,path);
|
||||
List<String> list = homePageService.getUsedHomePage(path);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS,list,methodDescribe);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,75 @@
|
||||
package com.njcn.user.controller;
|
||||
|
||||
|
||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||
import com.njcn.common.pojo.constant.OperateType;
|
||||
import com.njcn.common.pojo.enums.common.LogEnum;
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.common.utils.LogUtil;
|
||||
import com.njcn.user.pojo.param.RoleParam;
|
||||
import com.njcn.user.pojo.po.RoleComponent;
|
||||
import com.njcn.user.service.IRoleComponentService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import com.njcn.web.controller.BaseController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author hongawen
|
||||
* @since 2021-12-13
|
||||
*/
|
||||
@Validated
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/roleComponent")
|
||||
@Api(tags = "角色组件管理")
|
||||
@AllArgsConstructor
|
||||
public class RoleComponentController extends BaseController {
|
||||
|
||||
private final IRoleComponentService roleComponentService;
|
||||
|
||||
/**
|
||||
* 根据角色id查询相关联的组件
|
||||
*/
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||
@PostMapping("/selectRoleComponent")
|
||||
@ApiOperation("角色组件树")
|
||||
@ApiImplicitParam(name = "idList", value = "角色索引集合", required = true)
|
||||
public HttpResult<Object> selectRoleComponent(@RequestParam("idList") List<String> idList) {
|
||||
String methodDescribe = getMethodDescribe("selectRoleComponent");
|
||||
LogUtil.njcnDebug(log, "{},传入的角色id集合:{}", methodDescribe, idList);
|
||||
List<String> result = roleComponentService.selectRoleComponent(idList);
|
||||
if (result.isEmpty()) {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.NO_DATA, result, methodDescribe);
|
||||
} else {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
}
|
||||
|
||||
@OperateInfo(operateType = OperateType.UPDATE)
|
||||
@PostMapping("/assignComponentsByRoleIndex")
|
||||
@ApiOperation("角色分配组件")
|
||||
@ApiImplicitParam(name = "roleFunctionComponent", value = "角色信息", required = true)
|
||||
public HttpResult<Boolean> assignComponentsByRoleIndex(@RequestBody @Validated RoleParam.RoleFunctionComponent roleFunctionComponent) {
|
||||
String methodDescribe = getMethodDescribe("assignComponentsByRoleIndex");
|
||||
LogUtil.njcnDebug(log, "{},传入的角色Guid:{},传入的组件集合为:{}", methodDescribe,roleFunctionComponent);
|
||||
boolean result = roleComponentService.updateRoleComponent(roleFunctionComponent);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,149 @@
|
||||
package com.njcn.user.controller;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||
import com.njcn.common.pojo.constant.OperateType;
|
||||
import com.njcn.common.pojo.enums.common.LogEnum;
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.common.utils.LogUtil;
|
||||
import com.njcn.user.pojo.param.DeptParam;
|
||||
import com.njcn.user.pojo.param.RoleParam;
|
||||
import com.njcn.user.pojo.po.Role;
|
||||
import com.njcn.user.pojo.vo.RoleVO;
|
||||
import com.njcn.user.service.IRoleService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import com.njcn.web.controller.BaseController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author hongawen
|
||||
* @since 2021-12-13
|
||||
*/
|
||||
@Validated
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/role")
|
||||
@Api(tags = "角色管理")
|
||||
@AllArgsConstructor
|
||||
public class RoleController extends BaseController {
|
||||
|
||||
private final IRoleService roleService;
|
||||
|
||||
/**
|
||||
* 分页查询角色信息
|
||||
*/
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/list")
|
||||
@ApiOperation("查询角色信息")
|
||||
@ApiImplicitParam(name = "queryParam", value = "查询参数", required = true)
|
||||
public HttpResult<Page<RoleVO>> list(@RequestBody @Validated RoleParam.QueryParam queryParam) {
|
||||
String methodDescribe = getMethodDescribe("list");
|
||||
LogUtil.njcnDebug(log, "{},查询数据为:{}", methodDescribe, queryParam);
|
||||
Page<RoleVO> result = roleService.listRole(queryParam);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增角色
|
||||
*
|
||||
* @param roleParam 角色新增
|
||||
*/
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON, operateType = OperateType.ADD)
|
||||
@PostMapping("/add")
|
||||
@ApiOperation("新增角色信息")
|
||||
@ApiImplicitParam(name = "roleParam", value = "角色信息数据", required = true)
|
||||
public HttpResult<Object> add(@RequestBody @Validated RoleParam roleParam) {
|
||||
String methodDescribe = getMethodDescribe("add");
|
||||
LogUtil.njcnDebug(log, "{},角色信息数据为:{}", methodDescribe, roleParam);
|
||||
boolean result = roleService.addRole(roleParam);
|
||||
if (result) {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
} else {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改角色信息
|
||||
*/
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON, operateType = OperateType.UPDATE)
|
||||
@PostMapping("/update")
|
||||
@ApiOperation("修改角色信息")
|
||||
@ApiImplicitParam(name = "updateParam", value = "角色信息", required = true)
|
||||
public HttpResult<Object> update(@RequestBody @Validated RoleParam.RoleUpdateParam updateParam) {
|
||||
String methodDescribe = getMethodDescribe("update");
|
||||
LogUtil.njcnDebug(log, "{},角色信息数据为:{}", methodDescribe, updateParam);
|
||||
boolean result = roleService.updateRole(updateParam);
|
||||
if (result) {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
} else {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除角色信息
|
||||
*/
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON, operateType = OperateType.DELETE)
|
||||
@PostMapping("/delete")
|
||||
@ApiOperation("删除角色信息")
|
||||
@ApiImplicitParam(name = "ids", value = "角色索引", required = true)
|
||||
public HttpResult<Object> delete(@RequestBody List<String> ids) {
|
||||
String methodDescribe = getMethodDescribe("delete");
|
||||
LogUtil.njcnDebug(log, "{},角色信息数据为:{}", methodDescribe, ids);
|
||||
boolean result = roleService.deleteRole(ids);
|
||||
if (result) {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
} else {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据角色id查询相关联的资源和组件
|
||||
*/
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||
@PostMapping("/selectFunctionComponent")
|
||||
@ApiOperation("根据角色id查询相关联的资源和组件")
|
||||
@ApiImplicitParam(name = "ids", value = "角色索引", required = true)
|
||||
public HttpResult<Object> selectFunctionComponent(@RequestBody List<String> ids) {
|
||||
String methodDescribe = getMethodDescribe("selectFunctionComponent");
|
||||
LogUtil.njcnDebug(log, "{},查询数据为:{}", methodDescribe, ids);
|
||||
boolean result = roleService.selectRelevance(ids);
|
||||
if (result) {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.DELETE_PID_EXIST, null, methodDescribe);
|
||||
} else {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.DELETE_PID_UNEXIST, null, methodDescribe);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据权限类型查询相关角色
|
||||
*/
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||
@PostMapping("/selectRoleDetail")
|
||||
@ApiOperation("根据权限类型查询相关角色")
|
||||
@ApiImplicitParam(name = "id", value = "权限类型索引", required = true)
|
||||
public HttpResult<Object> selectRoleDetail(@RequestParam("id") Integer id) {
|
||||
String methodDescribe = getMethodDescribe("list");
|
||||
LogUtil.njcnDebug(log, "{},查询数据为:{}", methodDescribe, id);
|
||||
List<Role> result = roleService.selectRoleDetail(id);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
package com.njcn.user.controller;
|
||||
|
||||
|
||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.common.utils.LogUtil;
|
||||
import com.njcn.user.service.IRoleFunctionService;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author hongawen
|
||||
* @since 2021-12-13
|
||||
*/
|
||||
@Validated
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/roleFunction")
|
||||
@Api(tags = "角色资源管理")
|
||||
@AllArgsConstructor
|
||||
public class RoleFunctionController extends BaseController {
|
||||
private final IRoleFunctionService roleFunctionService;
|
||||
|
||||
@OperateInfo
|
||||
@PostMapping("/getFunctionsByRoleIndex")
|
||||
@ApiOperation("根据角色id查询相关联的资源")
|
||||
@ApiImplicitParam(name = "id", value = "角色id", required = true)
|
||||
public HttpResult<List<String>> getFunctionsByRoleIndex(@RequestParam("id") String id) {
|
||||
String methodDescribe = getMethodDescribe("getFunctionsByRoleIndex");
|
||||
LogUtil.njcnDebug(log, "{},传入的角色id:{}", methodDescribe,id);
|
||||
List<String> list = roleFunctionService.getFunctionsByRoleIndex(id);
|
||||
if(list.isEmpty()){
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.NO_DATA, list, methodDescribe);
|
||||
}else {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,337 @@
|
||||
package com.njcn.user.controller;
|
||||
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||
import com.njcn.common.pojo.constant.LogInfo;
|
||||
import com.njcn.common.pojo.constant.OperateType;
|
||||
import com.njcn.common.pojo.constant.SecurityConstants;
|
||||
import com.njcn.common.pojo.enums.common.LogEnum;
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.common.utils.LogUtil;
|
||||
import com.njcn.common.utils.sm.DesUtils;
|
||||
import com.njcn.common.utils.sm.Sm2;
|
||||
import com.njcn.poi.util.PoiUtil;
|
||||
import com.njcn.redis.utils.RedisUtil;
|
||||
import com.njcn.user.enums.UserResponseEnum;
|
||||
import com.njcn.user.pojo.dto.UserDTO;
|
||||
import com.njcn.user.pojo.param.UserParam;
|
||||
import com.njcn.user.pojo.param.UserPasswordParam;
|
||||
import com.njcn.user.pojo.vo.UserVO;
|
||||
import com.njcn.user.service.IUserService;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import com.njcn.web.utils.RequestUtil;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import springfox.documentation.annotations.ApiIgnore;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author hongawen
|
||||
* @since 2021-12-13
|
||||
*/
|
||||
@Validated
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/user")
|
||||
@Api(tags = "用户信息管理")
|
||||
@AllArgsConstructor
|
||||
public class UserController extends BaseController {
|
||||
|
||||
private final IUserService userService;
|
||||
|
||||
private final RedisUtil redisUtil;
|
||||
|
||||
@OperateInfo
|
||||
@GetMapping("/getUserByName/{loginName}")
|
||||
@ApiOperation("根据登录名查询用户信息")
|
||||
@ApiImplicitParam(name = "loginName", value = "登录名", required = true)
|
||||
public HttpResult<UserDTO> getUserByName(@PathVariable String loginName) {
|
||||
RequestUtil.saveLoginName(loginName);
|
||||
String methodDescribe = getMethodDescribe("getUserByName");
|
||||
LogUtil.njcnDebug(log, "{},登录名为:{}", methodDescribe, loginName);
|
||||
UserDTO user = userService.getUserByName(loginName);
|
||||
if (Objects.isNull(user)) {
|
||||
throw new BusinessException(UserResponseEnum.LOGIN_WRONG_PWD);
|
||||
} else {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, user, methodDescribe);
|
||||
}
|
||||
}
|
||||
|
||||
@OperateInfo
|
||||
@GetMapping("/judgeUserStatus/{loginName}")
|
||||
@ApiOperation("认证后根据用户名判断用户状态")
|
||||
@ApiImplicitParam(name = "loginName", value = "登录名", required = true)
|
||||
public HttpResult<Boolean> judgeUserStatus(@PathVariable String loginName) {
|
||||
RequestUtil.saveLoginName(loginName);
|
||||
String methodDescribe = getMethodDescribe("judgeUserStatus");
|
||||
LogUtil.njcnDebug(log, "{},登录名为:{}", methodDescribe, loginName);
|
||||
userService.judgeUserStatus(loginName);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, true, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 新增用户
|
||||
*
|
||||
* @param addUserParam 用户数据
|
||||
*/
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON, operateType = OperateType.ADD)
|
||||
@PostMapping("/add")
|
||||
@ApiOperation("新增用户")
|
||||
@ApiImplicitParam(name = "addUserParam", value = "新增用户", required = true)
|
||||
public HttpResult<Boolean> add(@RequestBody @Validated UserParam.UserAddParam addUserParam) {
|
||||
String methodDescribe = getMethodDescribe("add");
|
||||
LogUtil.njcnDebug(log, "{},用户数据为:{}", methodDescribe, addUserParam);
|
||||
boolean result = userService.addUser(addUserParam);
|
||||
if (result) {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, true, methodDescribe);
|
||||
} else {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, false, methodDescribe);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除用户
|
||||
*
|
||||
* @param id 用户id
|
||||
*/
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON, operateType = OperateType.DELETE)
|
||||
@DeleteMapping("/delete")
|
||||
@ApiOperation("删除用户")
|
||||
@ApiImplicitParam(name = "id", value = "用户id", required = true)
|
||||
public HttpResult<Boolean> delete(@RequestParam @Validated String id) {
|
||||
String methodDescribe = getMethodDescribe("delete");
|
||||
LogUtil.njcnDebug(log, "{},用户id为:{}", methodDescribe, id);
|
||||
boolean result = userService.deleteUser(id);
|
||||
if (result) {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, true, methodDescribe);
|
||||
} else {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, false, methodDescribe);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改用户
|
||||
*
|
||||
* @param updateUserParam 用户数据
|
||||
*/
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON, operateType = OperateType.UPDATE)
|
||||
@PutMapping("/update")
|
||||
@ApiOperation("修改用户")
|
||||
@ApiImplicitParam(name = "updateUserParam", value = "修改用户", required = true)
|
||||
public HttpResult<Boolean> update(@RequestBody @Validated UserParam.UserUpdateParam updateUserParam) {
|
||||
String methodDescribe = getMethodDescribe("update");
|
||||
LogUtil.njcnDebug(log, "{},用户数据为:{}", methodDescribe, updateUserParam);
|
||||
boolean result = userService.updateUser(updateUserParam);
|
||||
if (result) {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, true, methodDescribe);
|
||||
} else {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, false, methodDescribe);
|
||||
}
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||
@PostMapping("/list")
|
||||
@ApiOperation("列表分页")
|
||||
@ApiImplicitParam(name = "queryParam", value = "查询参数", required = true)
|
||||
public HttpResult<Page<UserVO>> getUserList(@RequestBody @Validated UserParam.UserQueryParam queryParam) {
|
||||
String methodDescribe = getMethodDescribe("getUserList");
|
||||
LogUtil.njcnDebug(log, "{},查询数据为:{}", methodDescribe, queryParam);
|
||||
Page<UserVO> list = userService.userList(queryParam);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||
@PostMapping("/exportUser")
|
||||
@ApiOperation("用户数据")
|
||||
@ApiImplicitParam(name = "queryParam", value = "查询参数", required = true)
|
||||
public HttpResult<String> exportUser(@RequestBody @Validated UserParam.UserQueryParam queryParam) {
|
||||
String methodDescribe = getMethodDescribe("exportUser");
|
||||
LogUtil.njcnDebug(log, "{},查询数据为:{}", methodDescribe, queryParam);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, userService.exportUser(queryParam,methodDescribe), methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON,operateType = OperateType.DOWNLOAD)
|
||||
@GetMapping("/exportUserExcel")
|
||||
@ApiOperation("导出用户数据")
|
||||
@ApiImplicitParam(name = "filePath", value = "报表路径", required = true)
|
||||
public void exportUserExcel(String filePath, HttpServletResponse response) {
|
||||
PoiUtil.exportFileByAbsolutePath(filePath,response);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||
@PostMapping("/checkUserList")
|
||||
@ApiOperation("审核用户列表")
|
||||
@ApiImplicitParam(name = "queryParam", value = "查询参数", required = true)
|
||||
public HttpResult<Page<UserVO>> getCheckList(@RequestBody @Validated UserParam.UserQueryParam queryParam) {
|
||||
String methodDescribe = getMethodDescribe("getCheckList");
|
||||
LogUtil.njcnDebug(log, "{},查询数据为:{}", methodDescribe, queryParam);
|
||||
Page<UserVO> list = userService.checkUserList(queryParam);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据用户id获取用户详情
|
||||
*
|
||||
* @param id 用户id
|
||||
*/
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||
@GetMapping("/getUserById")
|
||||
@ApiOperation("用户详情")
|
||||
@ApiImplicitParam(name = "id", value = "用户id", required = true)
|
||||
public HttpResult<UserVO> getUserById(@RequestParam @Validated String id) {
|
||||
String methodDescribe = getMethodDescribe("getUserById");
|
||||
LogUtil.njcnDebug(log, "{},用户id为:{}", methodDescribe, id);
|
||||
UserVO userVO = userService.getUserById(id);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, userVO, methodDescribe);
|
||||
}
|
||||
|
||||
/**
|
||||
* 审核用户
|
||||
*
|
||||
* @param list 用户id集合
|
||||
*/
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON, operateType = OperateType.UPDATE)
|
||||
@PutMapping("/check")
|
||||
@ApiOperation("审核用户")
|
||||
@ApiImplicitParam(name = "list", value = "用户id集合", required = true)
|
||||
public HttpResult<Boolean> check(@RequestBody @Validated List<String> list) {
|
||||
String methodDescribe = getMethodDescribe("check");
|
||||
LogUtil.njcnDebug(log, "{},用户id集合为:{}", methodDescribe, list);
|
||||
boolean result = userService.checkUser(list);
|
||||
if (result) {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, true, methodDescribe);
|
||||
} else {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, false, methodDescribe);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改密码
|
||||
*
|
||||
* @param id 用户id
|
||||
* @param newPassword 用户新密码
|
||||
*/
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON, operateType = OperateType.UPDATE)
|
||||
@PutMapping("/updatePassword")
|
||||
@ApiOperation("修改密码")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "id", value = "用户id", required = true),
|
||||
@ApiImplicitParam(name = "newPassword", value = "用户新密码", required = true)
|
||||
})
|
||||
public HttpResult<Boolean> updatePassword(String id, String newPassword) {
|
||||
String methodDescribe = getMethodDescribe("updatePassword");
|
||||
LogUtil.njcnDebug(log, "{},用户id:{},修改的用户密码为:{}", methodDescribe, id, newPassword);
|
||||
boolean result = userService.updatePassword(id, newPassword);
|
||||
if (result) {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, true, methodDescribe);
|
||||
} else {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, false, methodDescribe);
|
||||
}
|
||||
}
|
||||
|
||||
@OperateInfo
|
||||
@GetMapping("/generateSm2Key")
|
||||
@ApiOperation("根据登录名获取公钥")
|
||||
@ApiImplicitParam(name = "loginName", value = "登录名", required = true)
|
||||
public HttpResult<String> generateSm2Key(String loginName, @ApiIgnore HttpServletRequest request) {
|
||||
if (StrUtil.isBlankIfStr(loginName)) {
|
||||
RequestUtil.saveLoginName(LogInfo.UNKNOWN_USER);
|
||||
throw new BusinessException(UserResponseEnum.LOGIN_USERNAME_INVALID);
|
||||
}
|
||||
String methodDescribe = getMethodDescribe("generateSm2Key");
|
||||
loginName = DesUtils.aesDecrypt(loginName);
|
||||
RequestUtil.saveLoginName(loginName);
|
||||
Map<String, String> keyMap;
|
||||
try {
|
||||
keyMap = Sm2.getSm2CipHer();
|
||||
} catch (NoSuchAlgorithmException e) {
|
||||
throw new BusinessException(CommonResponseEnum.SM2_CIPHER_ERROR);
|
||||
}
|
||||
String publicKey = keyMap.get("publicKey");
|
||||
String privateKey = keyMap.get("privateKey");
|
||||
String ip = request.getHeader(SecurityConstants.REQUEST_HEADER_KEY_CLIENT_REAL_IP);
|
||||
//秘钥先删除再添加
|
||||
redisUtil.delete(loginName + ip);
|
||||
// 保存私钥到 redis
|
||||
redisUtil.saveByKeyWithExpire(loginName + ip, privateKey, 5*60L);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, publicKey, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(operateType = OperateType.UPDATE)
|
||||
@PutMapping("/updateUserLoginErrorTimes/{loginName}")
|
||||
@ApiOperation("更新用户登录认证密码错误次数")
|
||||
@ApiImplicitParam(name = "loginName", value = "登录名", required = true)
|
||||
public HttpResult<String> updateUserLoginErrorTimes(@PathVariable String loginName) {
|
||||
RequestUtil.saveLoginName(loginName);
|
||||
String methodDescribe = getMethodDescribe("updateUserLoginErrorTimes");
|
||||
LogUtil.njcnDebug(log, "{},登录名为:{}", methodDescribe, loginName);
|
||||
String result = userService.updateUserLoginErrorTimes(loginName);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 密码二次确认
|
||||
* @param password 确认密码
|
||||
*/
|
||||
@OperateInfo
|
||||
@GetMapping("/passwordConfirm")
|
||||
@ApiOperation("密码二次确认")
|
||||
@ApiImplicitParam(name = "password", value = "确认密码")
|
||||
public HttpResult<Boolean> passwordConfirm(String password) {
|
||||
String methodDescribe = getMethodDescribe("passwordConfirm");
|
||||
LogUtil.njcnDebug(log, "{},用户输入的密码:{}", methodDescribe, password);
|
||||
boolean result = userService.passwordConfirm(password);
|
||||
if (result){
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, true, methodDescribe);
|
||||
} else {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, false, methodDescribe);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 首次登录修改密码
|
||||
*
|
||||
* @param userPasswordParam 用户信息
|
||||
*/
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON, operateType = OperateType.UPDATE)
|
||||
@PutMapping("/updateFirstPassword")
|
||||
@ApiOperation("首次登录修改密码")
|
||||
@ApiImplicitParam(name = "userPasswordParam", value = "加密用户信息", required = true)
|
||||
public HttpResult<Boolean> updateFirstPassword(@RequestBody @Validated UserPasswordParam userPasswordParam, @ApiIgnore HttpServletRequest request) {
|
||||
RequestUtil.saveLoginName(DesUtils.aesDecrypt(userPasswordParam.getName()));
|
||||
String methodDescribe = getMethodDescribe("updateFirstPassword");
|
||||
LogUtil.njcnDebug(log, "{},加密用户信息为:{}", methodDescribe, userPasswordParam);
|
||||
String ip = request.getHeader(SecurityConstants.REQUEST_HEADER_KEY_CLIENT_REAL_IP);
|
||||
boolean result = userService.updateFirstPassword(userPasswordParam.getName(), userPasswordParam.getPassword(), ip);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.njcn.user.controller;
|
||||
|
||||
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author hongawen
|
||||
* @since 2021-12-13
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/userRole")
|
||||
public class UserRoleController extends BaseController {
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.njcn.user.controller;
|
||||
|
||||
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author hongawen
|
||||
* @since 2021-12-13
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/userSet")
|
||||
public class UserSetController extends BaseController {
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.njcn.user.controller;
|
||||
|
||||
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author hongawen
|
||||
* @since 2021-12-13
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/userStrategy")
|
||||
public class UserStrategyController extends BaseController {
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.njcn.user.init;
|
||||
|
||||
import com.njcn.user.service.IFunctionService;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.boot.CommandLineRunner;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
|
||||
/**
|
||||
* @author hongawen
|
||||
*
|
||||
* 容器启动完成时加载角色权限规则至Redis缓存
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
@AllArgsConstructor
|
||||
public class InitPermissionRoles implements CommandLineRunner {
|
||||
|
||||
private final IFunctionService functionService;
|
||||
|
||||
@Override
|
||||
public void run(String... args) {
|
||||
functionService.refreshRolesFunctionsCache();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.njcn.user.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njcn.user.pojo.po.AuthClient;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author hongawen
|
||||
* @since 2021-12-15
|
||||
*/
|
||||
public interface AuthClientMapper extends BaseMapper<AuthClient> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.njcn.user.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njcn.user.pojo.dto.ComponentDTO;
|
||||
import com.njcn.user.pojo.po.Component;
|
||||
import com.njcn.user.pojo.vo.ComponentVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author hongawen
|
||||
* @since 2021-12-13
|
||||
*/
|
||||
public interface ComponentMapper extends BaseMapper<Component> {
|
||||
|
||||
List<ComponentDTO> getAllComponent();
|
||||
|
||||
List<ComponentDTO> getComponentByList(@Param("list")List<String> list);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,94 @@
|
||||
package com.njcn.user.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.njcn.user.pojo.dto.DeptDTO;
|
||||
import com.njcn.user.pojo.po.Dept;
|
||||
import com.njcn.user.pojo.vo.DeptAllTreeVO;
|
||||
import com.njcn.user.pojo.vo.DeptTreeVO;
|
||||
import com.njcn.user.pojo.vo.DeptVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author hongawen
|
||||
* @since 2021-12-13
|
||||
*/
|
||||
public interface DeptMapper extends BaseMapper<Dept> {
|
||||
|
||||
/**
|
||||
* 分页查询字典数据
|
||||
* @param page 分页数据
|
||||
* @param queryWrapper 查询条件
|
||||
* @return 字典数据
|
||||
*/
|
||||
Page<DeptVO> page(@Param("page")Page<DeptVO> page, @Param("ew") QueryWrapper<DeptVO> queryWrapper);
|
||||
|
||||
// /**
|
||||
// * 查询部门排序最后一位
|
||||
// * @return 排序最后一位
|
||||
// */
|
||||
// Integer getSortNum();
|
||||
|
||||
/**
|
||||
* 查询父节点的所有上层节点
|
||||
* @param id
|
||||
* @return 父节点的所有上层节点
|
||||
*/
|
||||
String getIdString(@Param("id")String id);
|
||||
|
||||
/**
|
||||
*
|
||||
* @return 部门树
|
||||
*/
|
||||
List<DeptTreeVO> getDeptTree(@Param("id")String id, @Param("type")List<Integer> type);
|
||||
|
||||
/**
|
||||
*
|
||||
* @return 部门树
|
||||
*/
|
||||
List<DeptAllTreeVO> getAllDeptTree(@Param("id")String id, @Param("type")List<Integer> type);
|
||||
|
||||
/**
|
||||
*
|
||||
* @param state 部门状态
|
||||
* @return 查询已经绑定的行政区域
|
||||
*/
|
||||
List<String> deptArea(@Param("state")Integer state);
|
||||
|
||||
/**
|
||||
*
|
||||
* @param ids 部门集合
|
||||
* @param state 状态
|
||||
* @return 查询
|
||||
*/
|
||||
List<Dept> selectPid(@Param("ids")List<String> ids,@Param("state")Integer state);
|
||||
|
||||
/**
|
||||
* 删除部门和监测点的绑定
|
||||
* @param ids 部门集合
|
||||
* @return
|
||||
*/
|
||||
Boolean deleteDeptLine(@Param("ids")List<String> ids);
|
||||
|
||||
/**
|
||||
* 删除部门和用户的绑定
|
||||
* @param ids 部门集合
|
||||
* @return
|
||||
*/
|
||||
Boolean deleteUserDept(@Param("ids")List<String> ids);
|
||||
|
||||
/**
|
||||
* 根据条件获取后代部门索引
|
||||
* @param id 部门id
|
||||
* @param type 指定部门类型
|
||||
* @return 后代部门索引
|
||||
*/
|
||||
List<DeptDTO> getDeptDescendantIndexes(@Param("id")String id, @Param("type")List<Integer> type);
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.njcn.user.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njcn.user.pojo.po.Function;
|
||||
import com.njcn.user.pojo.vo.FunctionVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author hongawen
|
||||
* @since 2021-12-13
|
||||
*/
|
||||
public interface FunctionMapper extends BaseMapper<Function> {
|
||||
|
||||
List<FunctionVO> getAllFunctions();
|
||||
|
||||
List<FunctionVO> getFunctionsByList(@Param("list")List<String> functionList);
|
||||
|
||||
List<FunctionVO> getUserFunctionsByList(@Param("list")List<String> functionList);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.njcn.user.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njcn.user.pojo.po.HomePage;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author hongawen
|
||||
* @since 2021-12-13
|
||||
*/
|
||||
public interface HomePageMapper extends BaseMapper<HomePage> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.njcn.user.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njcn.user.pojo.po.Component;
|
||||
import com.njcn.user.pojo.po.RoleComponent;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author hongawen
|
||||
* @since 2021-12-13
|
||||
*/
|
||||
public interface RoleComponentMapper extends BaseMapper<RoleComponent> {
|
||||
/**
|
||||
* 根据角色id集合查询是否绑定
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
List<RoleComponent> selectRoleComponet(@Param("ids")List<String> ids);
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.njcn.user.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njcn.user.pojo.po.Component;
|
||||
import com.njcn.user.pojo.po.RoleFunction;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author hongawen
|
||||
* @since 2021-12-13
|
||||
*/
|
||||
public interface RoleFunctionMapper extends BaseMapper<RoleFunction> {
|
||||
/**
|
||||
* 根据角色id集合查询是否绑定
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
List<RoleFunction> selectRoleFunction(@Param("ids")List<String> ids);
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
package com.njcn.user.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.njcn.user.pojo.po.Role;
|
||||
import com.njcn.user.pojo.vo.RoleVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author hongawen
|
||||
* @since 2021-12-13
|
||||
*/
|
||||
public interface RoleMapper extends BaseMapper<Role> {
|
||||
|
||||
|
||||
/**
|
||||
* 分页查询字典数据
|
||||
* @param page 分页数据
|
||||
* @param queryWrapper 查询条件
|
||||
* @return 字典数据
|
||||
*/
|
||||
Page<RoleVO> page(@Param("page")Page<RoleVO> page, @Param("ew") QueryWrapper<RoleVO> queryWrapper);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 删除角色和用户的绑定
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
Boolean deleteUserRole(@Param("ids")List<String> ids);
|
||||
|
||||
/**
|
||||
* 删除角色和资源的绑定
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
Boolean deleteFunctionRole(@Param("ids")List<String> ids);
|
||||
|
||||
/**
|
||||
* 删除角色和组件的绑定
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
Boolean deleteComponentRole(@Param("ids")List<String> ids);
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
package com.njcn.user.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.njcn.user.pojo.dto.excel.UserExcel;
|
||||
import com.njcn.user.pojo.po.User;
|
||||
import com.njcn.user.pojo.vo.UserVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author hongawen
|
||||
* @since 2021-12-13
|
||||
*/
|
||||
public interface UserMapper extends BaseMapper<User> {
|
||||
|
||||
/**
|
||||
* 根据部门ids集合查询是否有用户绑定
|
||||
*
|
||||
* @param ids 部门id集合
|
||||
* @param state 用户状态
|
||||
* @return 绑定的结果
|
||||
*/
|
||||
List<User> selectDeptsId(@Param("ids") List<String> ids, @Param("state") Integer state);
|
||||
|
||||
/**
|
||||
* 分页查询用户数据
|
||||
*
|
||||
* @param page 分页数据
|
||||
* @param queryWrapper 查询条件
|
||||
* @param state 用户状态
|
||||
* @param type 用户类型
|
||||
* @return 用户数据
|
||||
*/
|
||||
Page<UserVO> page(@Param("page") Page<UserVO> page, @Param("ew") QueryWrapper<UserVO> queryWrapper, @Param("state") Integer state, @Param("type") Integer type);
|
||||
|
||||
/**
|
||||
* 审核用户列表
|
||||
*
|
||||
* @param page 分页数据
|
||||
* @param queryWrapper 查询条件
|
||||
* @return 用户数据
|
||||
*/
|
||||
Page<UserVO> checkPage(@Param("page") Page<UserVO> page, @Param("ew") QueryWrapper<UserVO> queryWrapper);
|
||||
|
||||
/**
|
||||
* 查询需要导出的用户数据
|
||||
*
|
||||
* @param queryWrapper 查询条件
|
||||
* @return 查询出的用户数据
|
||||
*/
|
||||
List<UserExcel> queryExportUser(@Param("ew") QueryWrapper<UserExcel> queryWrapper);
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.njcn.user.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njcn.user.pojo.po.UserRole;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author hongawen
|
||||
* @since 2021-12-13
|
||||
*/
|
||||
public interface UserRoleMapper extends BaseMapper<UserRole> {
|
||||
/**
|
||||
* 根据角色id集合查询是否绑定
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
List<UserRole> selectUserRole(@Param("ids")List<String> ids);
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.njcn.user.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njcn.user.pojo.po.UserSet;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author hongawen
|
||||
* @since 2021-12-13
|
||||
*/
|
||||
public interface UserSetMapper extends BaseMapper<UserSet> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.njcn.user.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njcn.user.pojo.po.UserStrategy;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author hongawen
|
||||
* @since 2021-12-13
|
||||
*/
|
||||
public interface UserStrategyMapper extends BaseMapper<UserStrategy> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
<?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.njcn.user.mapper.AuthClientMapper">
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,16 @@
|
||||
<?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.njcn.user.mapper.ComponentMapper">
|
||||
|
||||
<select id="getAllComponent" resultType="ComponentDTO">
|
||||
SELECT * from sys_component WHERE State = 1
|
||||
</select>
|
||||
|
||||
<select id="getComponentByList" resultType="ComponentDTO">
|
||||
SELECT * from sys_component WHERE State = 1 and Id in
|
||||
<foreach item="item" index="index" collection="list" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,158 @@
|
||||
<?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.njcn.user.mapper.DeptMapper">
|
||||
|
||||
<!--获取部门分页列表-->
|
||||
<select id="page" resultType="DeptVO">
|
||||
SELECT sys_dept.*,
|
||||
sys_area.name areaName
|
||||
FROM sys_dept sys_dept
|
||||
,sys_area sys_area
|
||||
WHERE sys_dept.area = sys_area.id
|
||||
AND ${ew.sqlSegment}
|
||||
</select>
|
||||
|
||||
<!-- <!–查询排序–>-->
|
||||
<!-- <select id="getSortNum" resultType="int">-->
|
||||
<!-- SELECT MAX(sys_dept.sort) sort-->
|
||||
<!-- FROM sys_dept sys_dept-->
|
||||
<!-- WHERE sys_dept.state = 1-->
|
||||
<!-- </select>-->
|
||||
|
||||
<select id="getIdString" resultType="String">
|
||||
SELECT sys_dept.pids pids
|
||||
FROM sys_dept sys_dept
|
||||
WHERE sys_dept.id = #{id}
|
||||
</select>
|
||||
|
||||
<select id="getDeptTree" resultType="DeptTreeVO">
|
||||
SELECT
|
||||
T3.*,
|
||||
T5.id area,
|
||||
T5.name areaName
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
@codes AS _ids,
|
||||
(
|
||||
SELECT @codes := GROUP_CONCAT( id ) FROM sys_dept WHERE FIND_IN_SET( pid, @codes ) ) AS T1
|
||||
FROM
|
||||
sys_dept s,
|
||||
( SELECT @codes := #{id} ) T4
|
||||
WHERE
|
||||
@codes IS NOT NULL
|
||||
<if test="type != null">
|
||||
AND s.type in
|
||||
<foreach collection="type" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
) T2,
|
||||
sys_dept T3,
|
||||
sys_area T5
|
||||
WHERE
|
||||
FIND_IN_SET( T3.id, T2._ids )
|
||||
AND t3.area = t5.id
|
||||
AND t3.State = 1
|
||||
</select>
|
||||
|
||||
<select id="getAllDeptTree" resultType="DeptAllTreeVO">
|
||||
SELECT
|
||||
T3.*
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
@codes AS _ids,
|
||||
(
|
||||
SELECT @codes := GROUP_CONCAT( id ) FROM sys_dept WHERE FIND_IN_SET( pid, @codes ) ) AS T1
|
||||
FROM
|
||||
sys_dept s,
|
||||
( SELECT @codes := #{id} ) T4
|
||||
WHERE
|
||||
@codes IS NOT NULL
|
||||
<if test="type != null">
|
||||
AND s.type in
|
||||
<foreach collection="type" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
) T2,
|
||||
sys_dept T3,
|
||||
sys_area T5
|
||||
WHERE
|
||||
FIND_IN_SET( T3.id, T2._ids )
|
||||
AND t3.area = t5.id
|
||||
AND t3.State = 1
|
||||
</select>
|
||||
|
||||
<select id="deptArea" resultType="String">
|
||||
SELECT sys_dept.area
|
||||
FROM sys_dept sys_dept
|
||||
WHERE sys_dept.state = #{state}
|
||||
</select>
|
||||
|
||||
<select id="selectPid" resultType="Dept">
|
||||
SELECT sys_dept.*
|
||||
FROM sys_dept sys_dept
|
||||
WHERE sys_dept.pid in
|
||||
<foreach item="item" index="index" collection="ids" open="("
|
||||
separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
AND sys_dept.state = #{state}
|
||||
</select>
|
||||
|
||||
<delete id="deleteDeptLine">
|
||||
DELETE FROM pq_dept_line where id in
|
||||
<foreach item="item" index="index" collection="ids" open="("
|
||||
separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<update id="deleteUserDept">
|
||||
update sys_user set Dept_Id = "" where Dept_Id in
|
||||
<foreach item="item" index="index" collection="ids" open="("
|
||||
separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
<select id="getDeptDescendantIndexes" resultType="DeptDTO">
|
||||
SELECT
|
||||
T3.id,
|
||||
T3.pid,
|
||||
T3.pids,
|
||||
T3.NAME,
|
||||
T3.type,
|
||||
T5.NAME area ,
|
||||
T3.Remark
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
@codes AS _ids,
|
||||
(
|
||||
SELECT @codes := GROUP_CONCAT( id ) FROM sys_dept WHERE FIND_IN_SET( pid, @codes ) ) AS T1
|
||||
FROM
|
||||
sys_dept s,
|
||||
( SELECT @codes := #{id} ) T4
|
||||
WHERE
|
||||
@codes IS NOT NULL
|
||||
<if test="type != null">
|
||||
AND s.type in
|
||||
<foreach collection="type" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
) T2,
|
||||
sys_dept T3,
|
||||
sys_area T5
|
||||
WHERE
|
||||
FIND_IN_SET( T3.id, T2._ids )
|
||||
AND t3.area = t5.id
|
||||
AND t3.State = 1
|
||||
Order by T3.sort asc
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,60 @@
|
||||
<?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.njcn.user.mapper.FunctionMapper">
|
||||
|
||||
<select id="getAllFunctions" resultType="FunctionVO">
|
||||
SELECT
|
||||
Id,Pid,
|
||||
`Name` title,
|
||||
`Code`,
|
||||
Path routePath,
|
||||
Icon,Sort,
|
||||
Type,
|
||||
Remark
|
||||
FROM
|
||||
sys_function
|
||||
WHERE
|
||||
STATE = 1 AND Type IN(0,1)
|
||||
</select>
|
||||
|
||||
<select id="getFunctionsByList" resultType="FunctionVO">
|
||||
SELECT
|
||||
Id,Pid,
|
||||
`Name` title,
|
||||
`Code`,
|
||||
Path routePath,
|
||||
Icon,Sort,
|
||||
Type,
|
||||
Remark
|
||||
FROM
|
||||
sys_function
|
||||
WHERE
|
||||
STATE = 1 AND Type = 0
|
||||
AND
|
||||
Id in
|
||||
<foreach item="item" index="index" collection="list" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
<select id="getUserFunctionsByList" resultType="FunctionVO">
|
||||
SELECT
|
||||
Id,Pid,
|
||||
`Name` title,
|
||||
`Code`,
|
||||
Path routePath,
|
||||
Icon,Sort,
|
||||
Type,
|
||||
Remark
|
||||
FROM
|
||||
sys_function
|
||||
WHERE
|
||||
STATE = 1 AND Type IN (0,1)
|
||||
AND
|
||||
Id in
|
||||
<foreach item="item" index="index" collection="list" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,5 @@
|
||||
<?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.njcn.user.mapper.HomePageMapper">
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,13 @@
|
||||
<?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.njcn.user.mapper.RoleComponentMapper">
|
||||
<select id="selectRoleComponet" resultType="RoleComponent">
|
||||
select sys_role_component.*
|
||||
from sys_role_component sys_role_component
|
||||
where sys_role_component.role_id in
|
||||
<foreach item="item" index="index" collection="ids" open="("
|
||||
separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,13 @@
|
||||
<?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.njcn.user.mapper.RoleFunctionMapper">
|
||||
<select id="selectRoleFunction" resultType="RoleFunction">
|
||||
select sys_role_function.*
|
||||
from sys_role_function sys_role_function
|
||||
where sys_role_function.role_id in
|
||||
<foreach item="item" index="index" collection="ids" open="("
|
||||
separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,35 @@
|
||||
<?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.njcn.user.mapper.RoleMapper">
|
||||
|
||||
<!--获取角色分页列表-->
|
||||
<select id="page" resultType="RoleVO">
|
||||
SELECT sys_role.*
|
||||
FROM sys_role sys_role
|
||||
WHERE ${ew.sqlSegment}
|
||||
</select>
|
||||
|
||||
<delete id="deleteUserRole">
|
||||
DELETE FROM sys_user_role where role_id in
|
||||
<foreach item="item" index="index" collection="ids" open="("
|
||||
separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<delete id="deleteFunctionRole">
|
||||
DELETE FROM sys_role_function where role_id in
|
||||
<foreach item="item" index="index" collection="ids" open="("
|
||||
separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<delete id="deleteComponentRole">
|
||||
DELETE FROM sys_role_component where role_id in
|
||||
<foreach item="item" index="index" collection="ids" open="("
|
||||
separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
@@ -0,0 +1,68 @@
|
||||
<?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.njcn.user.mapper.UserMapper">
|
||||
<select id="selectDeptsId" resultType="User">
|
||||
select sys_user.*
|
||||
from sys_user sys_user
|
||||
where sys_user.Dept_Id in
|
||||
<foreach item="item" index="index" collection="ids" open="("
|
||||
separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
and sys_user.state =#{state}
|
||||
</select>
|
||||
|
||||
<select id="page" resultType="UserVO">
|
||||
SELECT
|
||||
sys_user.* ,
|
||||
sys_dept.name deptName
|
||||
FROM
|
||||
sys_user sys_user LEFT JOIN
|
||||
sys_dept sys_dept
|
||||
ON sys_user.Dept_Id = sys_dept.Id
|
||||
<where>
|
||||
<if test="state != -1">
|
||||
sys_user.State = #{state}
|
||||
</if>
|
||||
<if test="type != -1">
|
||||
and sys_user.Casual_User = #{type}
|
||||
</if>
|
||||
and ${ew.sqlSegment}
|
||||
</where>
|
||||
|
||||
|
||||
</select>
|
||||
|
||||
<select id="checkPage" resultType="UserVO">
|
||||
SELECT
|
||||
sys_user.* ,
|
||||
sys_dept.name deptId
|
||||
FROM
|
||||
sys_user sys_user LEFT JOIN
|
||||
sys_dept sys_dept
|
||||
ON sys_user.Dept_Id = sys_dept.Id
|
||||
<where>
|
||||
and ${ew.sqlSegment}
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="queryExportUser" resultType="UserExcel">
|
||||
SELECT
|
||||
sys_user.id,
|
||||
sys_user.name,
|
||||
sys_user.login_name loginName,
|
||||
sys_user.phone,
|
||||
sys_user.Register_Time registerTime,
|
||||
sys_user.Login_Time loginTime,
|
||||
sys_user.Casual_User casualUser,
|
||||
sys_user.State state,
|
||||
sys_dept.name deptName
|
||||
FROM sys_user sys_user
|
||||
LEFT JOIN
|
||||
sys_dept sys_dept
|
||||
ON sys_user.Dept_Id = sys_dept.Id
|
||||
Where ${ew.sqlSegment}
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,13 @@
|
||||
<?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.njcn.user.mapper.UserRoleMapper">
|
||||
<select id="selectUserRole" resultType="UserRole">
|
||||
select sys_user_role.*
|
||||
from sys_user_role sys_user_role
|
||||
where sys_user_role.role_id in
|
||||
<foreach item="item" index="index" collection="ids" open="("
|
||||
separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,5 @@
|
||||
<?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.njcn.user.mapper.UserSetMapper">
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,5 @@
|
||||
<?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.njcn.user.mapper.UserStrategyMapper">
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.njcn.user.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njcn.user.pojo.po.AuthClient;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author hongawen
|
||||
* @since 2021-12-15
|
||||
*/
|
||||
public interface IAuthClientService extends IService<AuthClient> {
|
||||
|
||||
/**
|
||||
* 根据客户端名称获取客户端
|
||||
* @param clientName 客户端名称
|
||||
* @return .
|
||||
*/
|
||||
AuthClient getAuthClientByName(String clientName);
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
package com.njcn.user.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njcn.user.pojo.param.ComponentParam;
|
||||
import com.njcn.user.pojo.po.Component;
|
||||
import com.njcn.user.pojo.vo.ComponentVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author hongawen
|
||||
* @since 2021-12-13
|
||||
*/
|
||||
public interface IComponentService extends IService<Component> {
|
||||
|
||||
/**
|
||||
* 功能描述: 新增组件
|
||||
*
|
||||
* @param componentParam
|
||||
* @return boolean
|
||||
* @author xy
|
||||
* @date 2022/1/19 9:55
|
||||
*/
|
||||
boolean addComponent(ComponentParam componentParam);
|
||||
|
||||
/**
|
||||
* 功能描述: 删除组件
|
||||
*
|
||||
* @param id
|
||||
* @return boolean
|
||||
* @author xy
|
||||
* @date 2022/1/19 9:55
|
||||
*/
|
||||
boolean deleteComponent(String id);
|
||||
|
||||
/**
|
||||
* 功能描述: 修改组件
|
||||
*
|
||||
* @param componentParam
|
||||
* @return boolean
|
||||
* @author xy
|
||||
* @date 2022/1/19 9:55
|
||||
*/
|
||||
boolean updateComponent(ComponentParam.ComponentUpdateParam componentParam);
|
||||
|
||||
/**
|
||||
* 功能描述: 获取组件树
|
||||
*
|
||||
* @param
|
||||
* @return com.njcn.user.pojo.po.Component
|
||||
* @author xy
|
||||
* @date 2022/1/19 14:45
|
||||
*/
|
||||
List<ComponentVO> getComponentTree();
|
||||
|
||||
|
||||
/**
|
||||
* 功能描述: 获取用户组件树
|
||||
* @param
|
||||
* @return java.util.List<com.njcn.user.pojo.vo.ComponentVO>
|
||||
* @author xy
|
||||
* @date 2022/1/24 12:33
|
||||
*/
|
||||
List<ComponentVO> getUserComponentTree();
|
||||
}
|
||||
@@ -0,0 +1,134 @@
|
||||
package com.njcn.user.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njcn.system.pojo.dto.AreaTreeDTO;
|
||||
import com.njcn.user.pojo.dto.DeptDTO;
|
||||
import com.njcn.user.pojo.param.DeptParam;
|
||||
import com.njcn.user.pojo.po.Dept;
|
||||
import com.njcn.user.pojo.vo.DeptAllTreeVO;
|
||||
import com.njcn.user.pojo.vo.DeptTreeVO;
|
||||
import com.njcn.user.pojo.vo.DeptVO;
|
||||
import com.njcn.web.pojo.param.DeptLineParam;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author hongawen
|
||||
* @since 2021-12-13
|
||||
*/
|
||||
public interface IDeptService extends IService<Dept> {
|
||||
|
||||
/**
|
||||
* 根据前台传递参数,分页查询部门信息
|
||||
*
|
||||
* @param queryParam 查询参数
|
||||
* @return 部门列表
|
||||
*/
|
||||
Page<DeptVO> listDept(DeptParam.QueryParam queryParam);
|
||||
|
||||
/**
|
||||
* 新增部门
|
||||
*
|
||||
* @param deptParam 部门信息
|
||||
* @return 操作结果
|
||||
*/
|
||||
boolean addDept(DeptParam deptParam);
|
||||
|
||||
/**
|
||||
* 修改部门信息
|
||||
*
|
||||
* @param updateParam 部门数据
|
||||
* @return 操作结果
|
||||
*/
|
||||
boolean updateDept(DeptParam.DeptUpdateParam updateParam);
|
||||
|
||||
/**
|
||||
* 批量逻辑删除部门数据
|
||||
*
|
||||
* @param ids 字典id集合
|
||||
* @return 操作结果
|
||||
*/
|
||||
boolean deleteDept(List<String> ids);
|
||||
|
||||
|
||||
/**
|
||||
* 部门树
|
||||
* @return 结果
|
||||
*/
|
||||
List<DeptTreeVO> deptTree();
|
||||
|
||||
/**
|
||||
* 根据登录用户获取区域树
|
||||
* @return 结果
|
||||
*/
|
||||
List<DeptAllTreeVO> loginDeptTree();
|
||||
|
||||
/**
|
||||
* 已经绑定的区域
|
||||
* @return 已经绑定的区域
|
||||
*/
|
||||
List<String> deptArea();
|
||||
|
||||
/**
|
||||
* 行政树
|
||||
* @param id id
|
||||
* @param type type
|
||||
* @return 结果
|
||||
*/
|
||||
List<AreaTreeDTO> getAreaTree(String id, Integer type);
|
||||
|
||||
/**
|
||||
* 获取省份ids
|
||||
* @param ids ids
|
||||
* @return 结果
|
||||
*/
|
||||
boolean selectPid(List<String> ids);
|
||||
|
||||
/**
|
||||
* 根据部门id获取部门名称
|
||||
* @param id
|
||||
* @return java.lang.String
|
||||
* @author xy
|
||||
*/
|
||||
String getNameByDeptId(String id);
|
||||
|
||||
/**
|
||||
* 根据条件获取后代部门索引
|
||||
* @param id 部门id
|
||||
* @param type 指定部门类型
|
||||
* @return 后代部门索引
|
||||
*/
|
||||
List<DeptDTO> getDeptDescendantIndexes(String id, List<Integer> type);
|
||||
|
||||
/**
|
||||
* 根据区域索引获取部门索引
|
||||
* @param area
|
||||
* @return java.lang.String
|
||||
* @author xy
|
||||
* @date 2022/2/14 15:08
|
||||
*/
|
||||
String getDeptIdByArea(String area);
|
||||
|
||||
/**
|
||||
* 根据部门索引获取区域索引
|
||||
* @param deptId
|
||||
* @return java.lang.String
|
||||
* @author denghuajun
|
||||
* @date 2022/2/24 15:08
|
||||
*/
|
||||
String getAreaIdByDeptId(String deptId);
|
||||
|
||||
/**
|
||||
* 功能描述: 获取顶层部门的id
|
||||
* @param
|
||||
* @return java.lang.String
|
||||
* @author xy
|
||||
* @date 2022/3/28 9:32
|
||||
*/
|
||||
String getTopDeptId();
|
||||
}
|
||||
@@ -0,0 +1,116 @@
|
||||
package com.njcn.user.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njcn.user.pojo.param.FunctionParam;
|
||||
import com.njcn.user.pojo.param.RoleParam;
|
||||
import com.njcn.user.pojo.po.Function;
|
||||
import com.njcn.user.pojo.vo.FunctionVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author hongawen
|
||||
* @since 2021-12-13
|
||||
*/
|
||||
public interface IFunctionService extends IService<Function> {
|
||||
|
||||
/**
|
||||
* 刷新用户权限信息到缓存中
|
||||
*/
|
||||
void refreshRolesFunctionsCache();
|
||||
|
||||
/**
|
||||
* 功能描述:新增资源
|
||||
*
|
||||
* @param functionParam 资源参数
|
||||
* @return boolean
|
||||
* @author xy
|
||||
* @date 2022/1/17 11:19
|
||||
*/
|
||||
boolean addFunction(FunctionParam functionParam);
|
||||
|
||||
/**
|
||||
* 功能描述: 修改菜单
|
||||
*
|
||||
* @param functionParam
|
||||
* @return boolean
|
||||
* @author xy
|
||||
* @date 2022/1/17 14:23
|
||||
*/
|
||||
boolean updateFunction(FunctionParam.FunctionUpdateParam functionParam);
|
||||
|
||||
/**
|
||||
* 功能描述:删除菜单
|
||||
*
|
||||
* @param id
|
||||
* @return boolean
|
||||
* @author xy
|
||||
* @date 2022/1/17 16:53
|
||||
*/
|
||||
boolean deleteFunction(String id);
|
||||
|
||||
/**
|
||||
* 功能描述: 获取菜单树
|
||||
*
|
||||
* @param
|
||||
* @return java.util.List<com.njcn.user.pojo.vo.FunctionVO>
|
||||
* @author xy
|
||||
* @date 2022/1/17 17:04
|
||||
*/
|
||||
List<FunctionVO> getFunctionTree();
|
||||
|
||||
/**
|
||||
* 功能描述: 根据id获取菜单详情
|
||||
*
|
||||
* @param id
|
||||
* @return com.njcn.user.pojo.po.Function
|
||||
* @author xy
|
||||
* @date 2022/1/17 17:39
|
||||
*/
|
||||
Function getFunctionById(String id);
|
||||
|
||||
/**
|
||||
* 功能描述: 根据菜单id获取按钮
|
||||
*
|
||||
* @param id
|
||||
* @return java.util.List<com.njcn.user.pojo.po.Function>
|
||||
* @author xy
|
||||
* @date 2022/1/17 17:40
|
||||
*/
|
||||
List<Function> getButtonsById(String id);
|
||||
|
||||
/**
|
||||
* 功能描述: 获取路由菜单
|
||||
*
|
||||
* @param
|
||||
* @return java.util.List<com.njcn.user.pojo.vo.FunctionVO>
|
||||
* @author xy
|
||||
* @date 2022/1/18 13:47
|
||||
*/
|
||||
List<FunctionVO> getRouteMenu();
|
||||
|
||||
/**
|
||||
* 功能描述: 角色分配菜单
|
||||
*
|
||||
* @param roleFunctionComponent
|
||||
* @return java.util.List<com.njcn.user.pojo.vo.FunctionVO>
|
||||
* @author xy
|
||||
* @date 2022/2/17 17:00
|
||||
*/
|
||||
Boolean updateRoleComponent(RoleParam.RoleFunctionComponent roleFunctionComponent);
|
||||
|
||||
/**
|
||||
* 功能描述: 获取用户菜单树
|
||||
*
|
||||
* @param
|
||||
* @return java.util.List<com.njcn.user.pojo.vo.FunctionVO>
|
||||
* @author xy
|
||||
* @date 2022/2/21 11:29
|
||||
*/
|
||||
List<FunctionVO> getUserFunctionTree();
|
||||
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
package com.njcn.user.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njcn.user.pojo.param.HomePageParam;
|
||||
import com.njcn.user.pojo.po.HomePage;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author hongawen
|
||||
* @since 2021-12-13
|
||||
*/
|
||||
public interface IHomePageService extends IService<HomePage> {
|
||||
|
||||
/**
|
||||
* 功能描述: 新增驾驶舱
|
||||
*
|
||||
* @param homePageParam
|
||||
* @return boolean
|
||||
* @author xy
|
||||
* @date 2022/1/18 16:54
|
||||
*/
|
||||
boolean add(HomePageParam homePageParam);
|
||||
|
||||
/**
|
||||
* 功能描述: 删除驾驶舱
|
||||
*
|
||||
* @param id
|
||||
* @return boolean
|
||||
* @author xy
|
||||
* @date 2022/1/18 16:54
|
||||
*/
|
||||
boolean delete(String id);
|
||||
|
||||
/**
|
||||
* 功能描述: 修改驾驶舱
|
||||
*
|
||||
* @param homePageUpdate
|
||||
* @return boolean
|
||||
* @author xy
|
||||
* @date 2022/1/18 16:54
|
||||
*/
|
||||
boolean update(HomePageParam.HomePageUpdateParam homePageUpdate);
|
||||
|
||||
|
||||
/**
|
||||
* 功能描述: 获取用户的首页模式
|
||||
*
|
||||
* @param id
|
||||
* @return java.util.List<com.njcn.user.pojo.po.HomePage>
|
||||
* @author xy
|
||||
* @date 2022/1/18 15:33
|
||||
*/
|
||||
List<HomePage> getHomePagesByUserId(String id);
|
||||
|
||||
/**
|
||||
* 功能描述:根据驾驶舱id获取详情
|
||||
*
|
||||
* @param id
|
||||
* @return com.njcn.user.pojo.po.HomePage
|
||||
* @author xy
|
||||
* @date 2022/1/18 17:29
|
||||
*/
|
||||
HomePage getHomePageById(String id);
|
||||
|
||||
/**
|
||||
* 功能描述:查看已使用的驾驶舱路径
|
||||
*
|
||||
* @param path
|
||||
* @return java.util.List<java.lang.String>
|
||||
* @author xy
|
||||
* @date 2022/1/18 17:34
|
||||
*/
|
||||
List<String> getUsedHomePage(String path);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package com.njcn.user.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njcn.user.pojo.param.RoleParam;
|
||||
import com.njcn.user.pojo.po.RoleComponent;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author hongawen
|
||||
* @since 2021-12-13
|
||||
*/
|
||||
public interface IRoleComponentService extends IService<RoleComponent> {
|
||||
|
||||
/**
|
||||
* 功能描述: 根据角色id获取组件
|
||||
*
|
||||
* @param idList
|
||||
* @return java.util.List<java.lang.String>
|
||||
* @author xy
|
||||
* @date 2022/1/24 12:41
|
||||
*/
|
||||
List<String> selectRoleComponent(List<String> idList);
|
||||
|
||||
boolean updateRoleComponent(RoleParam.RoleFunctionComponent roleFunctionComponent);
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.njcn.user.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njcn.user.pojo.po.RoleFunction;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author hongawen
|
||||
* @since 2021-12-13
|
||||
*/
|
||||
public interface IRoleFunctionService extends IService<RoleFunction> {
|
||||
List<String> getFunctionsByRoleIndex(String id);
|
||||
|
||||
/**
|
||||
* 功能描述: 根据角色集合获取菜单方法
|
||||
*
|
||||
* @param roleList
|
||||
* @return java.util.List<java.lang.String>
|
||||
* @author xy
|
||||
* @date 2022/1/18 14:22
|
||||
*/
|
||||
List<String> getFunctionsByList(List<String> roleList);
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
package com.njcn.user.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njcn.user.pojo.param.RoleParam;
|
||||
import com.njcn.user.pojo.po.Role;
|
||||
import com.njcn.user.pojo.vo.RoleVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author hongawen
|
||||
* @since 2021-12-13
|
||||
*/
|
||||
public interface IRoleService extends IService<Role> {
|
||||
|
||||
/**
|
||||
* 根据用户id获取角色名
|
||||
* @param id 用户id
|
||||
* @return 角色名集合
|
||||
*/
|
||||
List<String> getRoleNameByUserId(String id);
|
||||
|
||||
/**
|
||||
* 根据用户id获取角色名称 name
|
||||
* @param id 用户id
|
||||
* @return 角色名集合
|
||||
*/
|
||||
List<String> getNameByUserId(String id);
|
||||
|
||||
/**
|
||||
* 根据用户id获取角色id
|
||||
* @param id 用户id
|
||||
* @return 角色名集合
|
||||
*/
|
||||
List<String> getIdByUserId(String id);
|
||||
|
||||
/**
|
||||
* 分页查询角色列表
|
||||
* @param queryParam
|
||||
* @return
|
||||
*/
|
||||
Page<RoleVO> listRole(RoleParam.QueryParam queryParam);
|
||||
|
||||
/**
|
||||
* 根据权限类型分页查询角色列表
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
List<Role> selectRoleDetail(Integer id);
|
||||
|
||||
/**
|
||||
* 新增部门
|
||||
*
|
||||
* @param deptParam 角色信息
|
||||
* @return 操作结果
|
||||
*/
|
||||
boolean addRole(RoleParam deptParam);
|
||||
|
||||
/**
|
||||
* 修改部门信息
|
||||
*
|
||||
* @param updateParam 角色数据
|
||||
* @return 操作结果
|
||||
*/
|
||||
boolean updateRole(RoleParam.RoleUpdateParam updateParam);
|
||||
|
||||
/**
|
||||
* 批量逻辑删除角色数据
|
||||
*
|
||||
* @param ids 角色id集合
|
||||
* @return 操作结果
|
||||
*/
|
||||
boolean deleteRole(List<String> ids);
|
||||
|
||||
Boolean selectRelevance(List<String> ids);
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
package com.njcn.user.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njcn.user.pojo.po.UserRole;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author hongawen
|
||||
* @since 2021-12-13
|
||||
*/
|
||||
public interface IUserRoleService extends IService<UserRole> {
|
||||
|
||||
/**
|
||||
* 根据用户索引获取 用户--角色关系数据
|
||||
* @param id 用户ID
|
||||
* @return 关系数据
|
||||
*/
|
||||
List<UserRole> getUserRoleByUserId(String id);
|
||||
|
||||
/**
|
||||
* 功能描述:新增用户和角色的关系
|
||||
* TODO
|
||||
*
|
||||
* @param id
|
||||
* @param roles
|
||||
* @return boolean
|
||||
* @author xy
|
||||
* @date 2021/12/30 16:24
|
||||
*/
|
||||
boolean addUserRole(String id,List<String> roles);
|
||||
|
||||
/**
|
||||
* 功能描述:修改用户和角色的关系
|
||||
* TODO
|
||||
*
|
||||
* @param id
|
||||
* @param roles
|
||||
* @return boolean
|
||||
* @author xy
|
||||
* @date 2022/1/13 14:14
|
||||
*/
|
||||
boolean updateUserRole(String id,List<String> roles);
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user