diff --git a/.gitignore b/.gitignore
index 0ba064c..28f7412 100644
--- a/.gitignore
+++ b/.gitignore
@@ -22,7 +22,8 @@
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
-
+.vscode
+log
# ---> Maven
target/
pom.xml.tag
diff --git a/common/pom.xml b/common/pom.xml
new file mode 100644
index 0000000..da33fe6
--- /dev/null
+++ b/common/pom.xml
@@ -0,0 +1,101 @@
+
+
+ 4.0.0
+
+ com.jiagutech
+ ams-social
+ ${revision}
+
+
+ common
+
+
+ 17
+ 17
+ UTF-8
+
+
+
+ org.projectlombok
+ lombok
+
+
+ cn.hutool
+ hutool-core
+
+
+
+ cn.hutool
+ hutool-http
+
+
+
+ cn.hutool
+ hutool-extra
+
+
+ com.alibaba.fastjson2
+ fastjson2
+
+
+
+ ma.glasnost.orika
+ orika-core
+ 1.5.4
+
+
+ org.mapstruct
+ mapstruct
+ 1.5.5.Final
+
+
+ org.mapstruct
+ mapstruct-processor
+ 1.5.5.Final
+ compile
+
+
+ org.apache.commons
+ commons-pool2
+ 2.12.0
+
+
+ org.springframework.boot
+ spring-boot-starter-data-jdbc
+
+
+ com.baomidou
+ mybatis-plus-boot-starter
+
+
+ org.springframework.boot
+ spring-boot-starter-json
+
+
+ org.apache.poi
+ poi
+
+
+ org.apache.poi
+ poi-ooxml
+
+
+ com.alibaba
+ easyexcel
+
+
+ poi-ooxml-schemas
+ org.apache.poi
+
+
+
+
+
+ jakarta.servlet
+ jakarta.servlet-api
+
+
+
+
\ No newline at end of file
diff --git a/common/src/main/java/com/jiagutech/ams/annotation/RateLimiter.java b/common/src/main/java/com/jiagutech/ams/annotation/RateLimiter.java
new file mode 100644
index 0000000..ed4f8a4
--- /dev/null
+++ b/common/src/main/java/com/jiagutech/ams/annotation/RateLimiter.java
@@ -0,0 +1,43 @@
+package com.jiagutech.ams.annotation;
+
+
+
+import com.jiagutech.ams.enums.LimitType;
+
+import java.lang.annotation.*;
+
+/**
+ * 限流注解
+ *
+ * @author Lion Li
+ */
+@Target(ElementType.METHOD)
+@Retention(RetentionPolicy.RUNTIME)
+@Documented
+public @interface RateLimiter {
+ /**
+ * 限流key,支持使用Spring el表达式来动态获取方法上的参数值
+ * 格式类似于 #code.id #{#code}
+ */
+ String key() default "";
+
+ /**
+ * 限流时间,单位秒
+ */
+ int time() default 60;
+
+ /**
+ * 限流次数
+ */
+ int count() default 100;
+
+ /**
+ * 限流类型
+ */
+ LimitType limitType() default LimitType.DEFAULT;
+
+ /**
+ * 提示消息 支持国际化 格式为 {code}
+ */
+ String message() default "{rate.limiter.message}";
+}
diff --git a/common/src/main/java/com/jiagutech/ams/constant/Constants.java b/common/src/main/java/com/jiagutech/ams/constant/Constants.java
new file mode 100644
index 0000000..5452593
--- /dev/null
+++ b/common/src/main/java/com/jiagutech/ams/constant/Constants.java
@@ -0,0 +1,81 @@
+package com.jiagutech.ams.constant;
+
+/**
+ * 通用常量信息
+ *
+ * @author ruoyi
+ */
+public interface Constants {
+
+ /**
+ * UTF-8 字符集
+ */
+ String UTF8 = "UTF-8";
+
+ /**
+ * GBK 字符集
+ */
+ String GBK = "GBK";
+
+ /**
+ * www主域
+ */
+ String WWW = "www.";
+
+ /**
+ * http请求
+ */
+ String HTTP = "http://";
+
+ /**
+ * https请求
+ */
+ String HTTPS = "https://";
+
+ /**
+ * 通用成功标识
+ */
+ String SUCCESS = "0";
+
+ /**
+ * 通用失败标识
+ */
+ String FAIL = "1";
+
+ /**
+ * 登录成功
+ */
+ String LOGIN_SUCCESS = "Success";
+
+ /**
+ * 注销
+ */
+ String LOGOUT = "Logout";
+
+ /**
+ * 注册
+ */
+ String REGISTER = "Register";
+
+ /**
+ * 登录失败
+ */
+ String LOGIN_FAIL = "Error";
+
+ /**
+ * 验证码有效期(分钟)
+ */
+ Integer CAPTCHA_EXPIRATION = 2;
+
+ /**
+ * 令牌
+ */
+ String TOKEN = "token";
+
+ /**
+ * 顶级部门id
+ */
+ Long TOP_PARENT_ID = 0L;
+
+}
+
diff --git a/common/src/main/java/com/jiagutech/ams/constant/GlobalConstants.java b/common/src/main/java/com/jiagutech/ams/constant/GlobalConstants.java
new file mode 100644
index 0000000..45aa3fe
--- /dev/null
+++ b/common/src/main/java/com/jiagutech/ams/constant/GlobalConstants.java
@@ -0,0 +1,39 @@
+package com.jiagutech.ams.constant;
+
+/**
+ * 全局的key常量 (业务无关的key)
+ *
+ * @author Lion Li
+ */
+public interface GlobalConstants {
+
+ /**
+ * 全局 redis key (业务无关的key)
+ */
+ String GLOBAL_REDIS_KEY = "global:";
+
+ /**
+ * 验证码 redis key
+ */
+ String CAPTCHA_CODE_KEY = GLOBAL_REDIS_KEY + "captcha_codes:";
+
+ /**
+ * 防重提交 redis key
+ */
+ String REPEAT_SUBMIT_KEY = GLOBAL_REDIS_KEY + "repeat_submit:";
+
+ /**
+ * 限流 redis key
+ */
+ String RATE_LIMIT_KEY = GLOBAL_REDIS_KEY + "rate_limit:";
+
+ /**
+ * 登录账户密码错误次数 redis key
+ */
+ String PWD_ERR_CNT_KEY = GLOBAL_REDIS_KEY + "pwd_err_cnt:";
+
+ /**
+ * 三方认证 redis key
+ */
+ String SOCIAL_AUTH_CODE_KEY = GLOBAL_REDIS_KEY + "social_auth_codes:";
+}
diff --git a/common/src/main/java/com/jiagutech/ams/constant/HttpStatus.java b/common/src/main/java/com/jiagutech/ams/constant/HttpStatus.java
new file mode 100644
index 0000000..8da2d60
--- /dev/null
+++ b/common/src/main/java/com/jiagutech/ams/constant/HttpStatus.java
@@ -0,0 +1,93 @@
+package com.jiagutech.ams.constant;
+
+/**
+ * 返回状态码
+ *
+ * @author Lion Li
+ */
+public interface HttpStatus {
+ /**
+ * 操作成功
+ */
+ int SUCCESS = 200;
+
+ /**
+ * 对象创建成功
+ */
+ int CREATED = 201;
+
+ /**
+ * 请求已经被接受
+ */
+ int ACCEPTED = 202;
+
+ /**
+ * 操作已经执行成功,但是没有返回数据
+ */
+ int NO_CONTENT = 204;
+
+ /**
+ * 资源已被移除
+ */
+ int MOVED_PERM = 301;
+
+ /**
+ * 重定向
+ */
+ int SEE_OTHER = 303;
+
+ /**
+ * 资源没有被修改
+ */
+ int NOT_MODIFIED = 304;
+
+ /**
+ * 参数列表错误(缺少,格式不匹配)
+ */
+ int BAD_REQUEST = 400;
+
+ /**
+ * 未授权
+ */
+ int UNAUTHORIZED = 401;
+
+ /**
+ * 访问受限,授权过期
+ */
+ int FORBIDDEN = 403;
+
+ /**
+ * 资源,服务未找到
+ */
+ int NOT_FOUND = 404;
+
+ /**
+ * 不允许的http方法
+ */
+ int BAD_METHOD = 405;
+
+ /**
+ * 资源冲突,或者资源被锁
+ */
+ int CONFLICT = 409;
+
+ /**
+ * 不支持的数据,媒体类型
+ */
+ int UNSUPPORTED_TYPE = 415;
+
+ /**
+ * 系统内部错误
+ */
+ int ERROR = 500;
+
+ /**
+ * 接口未实现
+ */
+ int NOT_IMPLEMENTED = 501;
+
+ /**
+ * 系统警告消息
+ */
+ int WARN = 601;
+}
diff --git a/common/src/main/java/com/jiagutech/ams/constant/UserConstants.java b/common/src/main/java/com/jiagutech/ams/constant/UserConstants.java
new file mode 100644
index 0000000..0df6306
--- /dev/null
+++ b/common/src/main/java/com/jiagutech/ams/constant/UserConstants.java
@@ -0,0 +1,143 @@
+package com.jiagutech.ams.constant;
+
+/**
+ * 用户常量信息
+ *
+ * @author ruoyi
+ */
+public interface UserConstants {
+
+ /**
+ * 平台内系统用户的唯一标志
+ */
+ String SYS_SESSION = "CURRENT_USER";
+
+
+ /**
+ * 正常状态
+ */
+ String NORMAL = "0";
+
+ /**
+ * 异常状态
+ */
+ String EXCEPTION = "1";
+
+ /**
+ * 用户正常状态
+ */
+ String USER_NORMAL = "0";
+
+ /**
+ * 用户封禁状态
+ */
+ String USER_DISABLE = "1";
+
+ /**
+ * 角色正常状态
+ */
+ String ROLE_NORMAL = "0";
+
+ /**
+ * 角色封禁状态
+ */
+ String ROLE_DISABLE = "1";
+
+ /**
+ * 部门正常状态
+ */
+ String DEPT_NORMAL = "0";
+
+ /**
+ * 部门停用状态
+ */
+ String DEPT_DISABLE = "1";
+
+ /**
+ * 岗位正常状态
+ */
+ String POST_NORMAL = "0";
+
+ /**
+ * 岗位停用状态
+ */
+ String POST_DISABLE = "1";
+
+ /**
+ * 字典正常状态
+ */
+ String DICT_NORMAL = "0";
+
+ /**
+ * 是否为系统默认(是)
+ */
+ String YES = "Y";
+
+ /**
+ * 是否菜单外链(是)
+ */
+ String YES_FRAME = "0";
+
+ /**
+ * 是否菜单外链(否)
+ */
+ String NO_FRAME = "1";
+
+ /**
+ * 菜单正常状态
+ */
+ String MENU_NORMAL = "0";
+
+ /**
+ * 菜单停用状态
+ */
+ String MENU_DISABLE = "1";
+
+ /**
+ * 菜单类型(目录)
+ */
+ String TYPE_DIR = "M";
+
+ /**
+ * 菜单类型(菜单)
+ */
+ String TYPE_MENU = "C";
+
+ /**
+ * 菜单类型(按钮)
+ */
+ String TYPE_BUTTON = "F";
+
+ /**
+ * Layout组件标识
+ */
+ String LAYOUT = "Layout";
+
+ /**
+ * ParentView组件标识
+ */
+ String PARENT_VIEW = "ParentView";
+
+ /**
+ * InnerLink组件标识
+ */
+ String INNER_LINK = "InnerLink";
+
+ /**
+ * 用户名长度限制
+ */
+ int USERNAME_MIN_LENGTH = 2;
+ int USERNAME_MAX_LENGTH = 20;
+
+ /**
+ * 密码长度限制
+ */
+ int PASSWORD_MIN_LENGTH = 5;
+ int PASSWORD_MAX_LENGTH = 20;
+
+ /**
+ * 超级管理员ID
+ */
+ Long SUPER_ADMIN_ID = 1L;
+
+}
diff --git a/common/src/main/java/com/jiagutech/ams/enums/LimitType.java b/common/src/main/java/com/jiagutech/ams/enums/LimitType.java
new file mode 100644
index 0000000..56d3fb2
--- /dev/null
+++ b/common/src/main/java/com/jiagutech/ams/enums/LimitType.java
@@ -0,0 +1,24 @@
+package com.jiagutech.ams.enums;
+
+/**
+ * 限流类型
+ *
+ * @author ruoyi
+ */
+
+public enum LimitType {
+ /**
+ * 默认策略全局限流
+ */
+ DEFAULT,
+
+ /**
+ * 根据请求者IP进行限流
+ */
+ IP,
+
+ /**
+ * 实例限流(集群多后端实例)
+ */
+ CLUSTER
+}
diff --git a/common/src/main/java/com/jiagutech/ams/exception/BizCode.java b/common/src/main/java/com/jiagutech/ams/exception/BizCode.java
new file mode 100644
index 0000000..31e7cc8
--- /dev/null
+++ b/common/src/main/java/com/jiagutech/ams/exception/BizCode.java
@@ -0,0 +1,62 @@
+package com.jiagutech.ams.exception;
+
+import lombok.Getter;
+
+@Getter
+public enum BizCode implements CodeInterface {
+ General_Success(200, "接口调用成功"),
+ ServerError(10001, "服务器异常"),
+ General_Failure(10004, "接口调用失败"),
+ General_DBError(10005, "DB错误"),
+ General_ParameterInvalid(12001, "参数校验失败"),
+ /**
+ * 通用类
+ */
+ USER_UNREGISTERED(12001, "用户未注册"),
+ NOT_FOUND(12002, "数据不存在"),
+ LOGIN_TYPE_ERROR(12005, "登录类型错误"),
+
+ /**
+ * 文件服务
+ */
+ FILE_DOWNLOAD_ERROR(90001, "文件下载错误"),
+
+ FILE_UPLOAD_ERROR(90002, "文件上传失败"),
+
+
+
+ USER_NOT_FOUND(40004, "用户不存在"),
+
+ CAPTCHA_ERROR(40003, "验证码错误"),
+
+ PASSWORD_ERROR(40002, "密码错误"),
+
+ TOKEN_TIMEOUT_ERROR(40006, "token已过期"),
+
+ USER_STOP_FOUND(40008, "用户被禁用"),
+
+ USER_NOT_LOGIN(40011, "用户未登录,请登录后再操作"),
+
+ ACCESS_TOKEN_INVALID(40040, "用户token无效,请重新登录"),
+
+ ACCESS_NOT_ALLOWABLE(50001, "服务不允许直接访问"),
+
+ PERMISSION_NOT_FOUND(40001,"该用户无操作权限"),
+
+ USER_PHONE_EXIST(40012, "用户手机号已存在"),
+
+ NOT_ALLOWABLE(13001, "当前正在作业中无法创建新的作业,请先完成作业任务后再创建")
+
+ ;
+
+
+ private final Integer code;
+
+ private final String msg;
+
+ BizCode(Integer code, String msg) {
+ this.code = code;
+ this.msg = msg;
+ }
+
+}
diff --git a/common/src/main/java/com/jiagutech/ams/exception/BusinessException.java b/common/src/main/java/com/jiagutech/ams/exception/BusinessException.java
new file mode 100644
index 0000000..ecd1fab
--- /dev/null
+++ b/common/src/main/java/com/jiagutech/ams/exception/BusinessException.java
@@ -0,0 +1,53 @@
+package com.jiagutech.ams.exception;
+
+import lombok.Data;
+
+@Data
+public class BusinessException extends RuntimeException {
+
+ private int code;
+
+ private String message;
+
+ public BusinessException( int code,String message) {
+ super(message);
+ this.code = code;
+ this.message = message;
+ }
+
+ public BusinessException(String message, Throwable cause, int code, String message1) {
+ super(message, cause);
+ this.code = code;
+ this.message = message1;
+ }
+
+ public BusinessException(Throwable cause, int code, String message) {
+ super(cause);
+ this.code = code;
+ this.message = message;
+ }
+
+ public BusinessException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace, int code, String message1) {
+ super(message, cause, enableSuppression, writableStackTrace);
+ this.code = code;
+ this.message = message1;
+ }
+
+ public BusinessException(CodeInterface biz) {
+ super();
+ this.code = biz.getCode();
+ this.message = biz.getMsg();
+ }
+
+ public BusinessException(String message) {
+ super(message);
+ this.code= BizCode.General_ParameterInvalid.getCode();
+ this.message =message;
+ }
+
+ public BusinessException(BizCode biz, String msg) {
+ super();
+ this.code = biz.getCode();
+ this.message = msg;
+ }
+}
diff --git a/common/src/main/java/com/jiagutech/ams/exception/CodeInterface.java b/common/src/main/java/com/jiagutech/ams/exception/CodeInterface.java
new file mode 100644
index 0000000..77c615b
--- /dev/null
+++ b/common/src/main/java/com/jiagutech/ams/exception/CodeInterface.java
@@ -0,0 +1,22 @@
+package com.jiagutech.ams.exception;
+
+/**
+ * 业务异常接口
+ */
+public interface CodeInterface {
+
+ /**
+ * 消息
+ *
+ * @return String
+ */
+ String getMsg();
+
+ /**
+ * 业务代码
+ *
+ * @return int
+ */
+ Integer getCode();
+
+}
diff --git a/common/src/main/java/com/jiagutech/ams/mapper/RegionMapper.java b/common/src/main/java/com/jiagutech/ams/mapper/RegionMapper.java
new file mode 100644
index 0000000..96e0892
--- /dev/null
+++ b/common/src/main/java/com/jiagutech/ams/mapper/RegionMapper.java
@@ -0,0 +1,26 @@
+package com.jiagutech.ams.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.jiagutech.ams.model.LoginUser;
+import com.jiagutech.ams.model.RegionVO;
+import com.jiagutech.ams.model.UserDetail;
+import com.jiagutech.ams.model.dto.RegionDTO;
+import com.jiagutech.ams.model.dto.UserDTO;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * @ClassName UserMapper
+ * @author: zhangyeguang
+ * @create: 2024-08-30 15:50
+ * @Version 1.0
+ * @description:
+ **/
+public interface RegionMapper extends BaseMapper {
+
+ List getRegionsByParentCode(@Param("regionCode") long regionCode, @Param("level") int level);
+
+
+ RegionVO getCompleteRegionInfo(@Param("regionCode") long regionCode);
+}
diff --git a/common/src/main/java/com/jiagutech/ams/mapper/UserMapper.java b/common/src/main/java/com/jiagutech/ams/mapper/UserMapper.java
new file mode 100644
index 0000000..f25b709
--- /dev/null
+++ b/common/src/main/java/com/jiagutech/ams/mapper/UserMapper.java
@@ -0,0 +1,34 @@
+package com.jiagutech.ams.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.jiagutech.ams.model.LoginUser;
+import com.jiagutech.ams.model.dto.UserDTO;
+import com.jiagutech.ams.model.UserDetail;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * @ClassName UserMapper
+ * @author: zhangyeguang
+ * @create: 2024-08-30 15:50
+ * @Version 1.0
+ * @description:
+ **/
+public interface UserMapper extends BaseMapper {
+
+
+ LoginUser selectLoginUserByPhone(@Param("phone") String phone);
+
+ UserDetail selectUserDetail(@Param("userId") Long userId, @Param("phone") String phone);
+
+ List getUserIdsByRegionCodes(@Param("regionCodes") List regionCodes);
+
+ List getUsersByLikeRegionPath( @Param("regionPath") String regionPath);
+
+
+
+ Page userPage(Page page,@Param("ew") QueryWrapper queryWrapper);
+}
diff --git a/common/src/main/java/com/jiagutech/ams/model/DeptItem.java b/common/src/main/java/com/jiagutech/ams/model/DeptItem.java
new file mode 100644
index 0000000..cd10bd3
--- /dev/null
+++ b/common/src/main/java/com/jiagutech/ams/model/DeptItem.java
@@ -0,0 +1,22 @@
+package com.jiagutech.ams.model;
+
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
+import lombok.Data;
+
+/**
+ * @ClassName DeptItem
+ * @author: zhangyeguang
+ * @create: 2024-09-02 16:52
+ * @Version 1.0
+ * @description:
+ **/
+@Data
+public class DeptItem {
+ @JsonSerialize(using = ToStringSerializer.class)
+ private String deptId;
+ private String deptName;
+ private Long managerId;
+ private String managerName;
+ private String managerPhone;
+}
diff --git a/common/src/main/java/com/jiagutech/ams/model/LoginUser.java b/common/src/main/java/com/jiagutech/ams/model/LoginUser.java
new file mode 100644
index 0000000..528421d
--- /dev/null
+++ b/common/src/main/java/com/jiagutech/ams/model/LoginUser.java
@@ -0,0 +1,97 @@
+package com.jiagutech.ams.model;
+
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.jiagutech.ams.model.dto.DeptDTO;
+import com.jiagutech.ams.model.dto.RoleDTO;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.io.Serial;
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * @ClassName LoginUser
+ * @author: zhangyeguang
+ * @create: 2024-09-01 09:28
+ * @Version 1.0
+ * @description:
+ **/
+@Data
+@NoArgsConstructor
+public class LoginUser implements Serializable {
+
+ @Serial
+ private static final long serialVersionUID = 1L;
+
+
+ /**
+ * 用户ID
+ */
+ private Long userId;
+
+ /**
+ * 部门
+ */
+ private DeptDTO dept;
+
+ /**
+ * 用户唯一标识
+ */
+ private String token;
+
+
+ /**
+ * 登录时间
+ */
+ private Long loginTime;
+
+ /**
+ * 过期时间
+ */
+ private Long expireTime;
+
+ /**
+ * 登录IP地址
+ */
+ private String ipaddr;
+
+
+ /**
+ * 用户名
+ */
+ private String username;
+
+ /**
+ * 用户昵称
+ */
+ private String nickName;
+ /**
+ * 手机号
+ */
+ private String phone;
+ @JsonIgnore
+ private String password;
+
+ private String email;
+ /**
+ * 头像
+ */
+ private String avatar;
+
+ private Long createTime;
+
+ /**
+ * 角色对象
+ */
+ private List roles;
+
+ /**
+ * 区域编码
+ */
+ private Long regionCode;
+
+ private String regionPath;
+
+
+}
diff --git a/common/src/main/java/com/jiagutech/ams/model/RegionVO.java b/common/src/main/java/com/jiagutech/ams/model/RegionVO.java
new file mode 100644
index 0000000..7bc48e3
--- /dev/null
+++ b/common/src/main/java/com/jiagutech/ams/model/RegionVO.java
@@ -0,0 +1,12 @@
+package com.jiagutech.ams.model;
+
+import lombok.Data;
+import lombok.experimental.Accessors;
+
+@Data
+@Accessors(chain = true)
+public class RegionVO {
+ private String regionCode;
+ private String regionName;
+
+}
diff --git a/common/src/main/java/com/jiagutech/ams/model/UserDetail.java b/common/src/main/java/com/jiagutech/ams/model/UserDetail.java
new file mode 100644
index 0000000..bc0f71d
--- /dev/null
+++ b/common/src/main/java/com/jiagutech/ams/model/UserDetail.java
@@ -0,0 +1,30 @@
+package com.jiagutech.ams.model;
+
+/**
+ * @ClassName UserDetailVO
+ * @author: zhangyeguang
+ * @create: 2024-09-02 10:03
+ * @Version 1.0
+ * @description:
+ **/
+
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
+import com.jiagutech.ams.model.dto.DeptDTO;
+import lombok.Data;
+import lombok.experimental.Accessors;
+
+@Data
+@Accessors(chain = true)
+public class UserDetail {
+ @JsonSerialize(using = ToStringSerializer.class)
+ private Long userId;
+ private String userName;
+ private String email;
+ private String phone;
+ private String nickName;
+ private DeptDTO dept;
+ private Long regionCode;
+ private String regionName;
+ private String userIdStr;
+}
diff --git a/common/src/main/java/com/jiagutech/ams/model/common/PageRequest.java b/common/src/main/java/com/jiagutech/ams/model/common/PageRequest.java
new file mode 100644
index 0000000..30d8850
--- /dev/null
+++ b/common/src/main/java/com/jiagutech/ams/model/common/PageRequest.java
@@ -0,0 +1,22 @@
+package com.jiagutech.ams.model.common;
+
+import lombok.Data;
+
+/**
+ * @ClassName PageInfo
+ * @author: zhangyeguang
+ * @create: 2024-09-02 15:21
+ * @Version 1.0
+ * @description:
+ **/
+@Data
+public class PageRequest {
+
+ private int pageNum;
+ private int pageSize;
+ private String oderByColumn;
+
+ private T request;
+
+
+}
diff --git a/common/src/main/java/com/jiagutech/ams/model/common/PageResult.java b/common/src/main/java/com/jiagutech/ams/model/common/PageResult.java
new file mode 100644
index 0000000..699875e
--- /dev/null
+++ b/common/src/main/java/com/jiagutech/ams/model/common/PageResult.java
@@ -0,0 +1,33 @@
+package com.jiagutech.ams.model.common;
+
+import lombok.Data;
+import lombok.experimental.Accessors;
+
+import java.util.List;
+
+/**
+ * @ClassName PageResult
+ * @author: zhangyeguang
+ * @create: 2024-09-02 15:22
+ * @Version 1.0
+ * @description:
+ **/
+@Data
+@Accessors(chain = true)
+public class PageResult {
+ private int total;
+ private int pageSize;
+ private int pageNum;
+ private int pages;
+ private List records;
+
+ public static PageResult of(int total, int pageSize, int pageNum, List records) {
+ PageResult pageResult = new PageResult<>();
+ pageResult.setTotal(total);
+ pageResult.setPageSize(pageSize);
+ pageResult.setPageNum(pageNum);
+ pageResult.setPages(total % pageSize == 0 ? total / pageSize : total / pageSize + 1);
+ pageResult.setRecords(records);
+ return pageResult;
+ }
+}
diff --git a/common/src/main/java/com/jiagutech/ams/model/common/R.java b/common/src/main/java/com/jiagutech/ams/model/common/R.java
new file mode 100644
index 0000000..afa5a83
--- /dev/null
+++ b/common/src/main/java/com/jiagutech/ams/model/common/R.java
@@ -0,0 +1,111 @@
+package com.jiagutech.ams.model.common;
+
+
+import com.jiagutech.ams.constant.HttpStatus;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.io.Serial;
+import java.io.Serializable;
+
+/**
+ * 响应信息主体
+ *
+ * @author Lion Li
+ */
+@Data
+@NoArgsConstructor
+public class R implements Serializable {
+
+ @Serial
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * 成功
+ */
+ public static final int SUCCESS = 200;
+
+ /**
+ * 失败
+ */
+ public static final int FAIL = 500;
+
+ private int code;
+
+ private String msg;
+
+ private T data;
+
+ public static R ok() {
+ return restResult(null, SUCCESS, "操作成功");
+ }
+
+ public static R ok(T data) {
+ return restResult(data, SUCCESS, "操作成功");
+ }
+
+ public static R ok(String msg) {
+ return restResult(null, SUCCESS, msg);
+ }
+
+ public static R ok(String msg, T data) {
+ return restResult(data, SUCCESS, msg);
+ }
+
+ public static R fail() {
+ return restResult(null, FAIL, "操作失败");
+ }
+
+ public static R fail(String msg) {
+ return restResult(null, FAIL, msg);
+ }
+
+ public static R fail(T data) {
+ return restResult(data, FAIL, "操作失败");
+ }
+
+ public static R fail(String msg, T data) {
+ return restResult(data, FAIL, msg);
+ }
+
+ public static R fail(int code, String msg) {
+ return restResult(null, code, msg);
+ }
+
+ /**
+ * 返回警告消息
+ *
+ * @param msg 返回内容
+ * @return 警告消息
+ */
+ public static R warn(String msg) {
+ return restResult(null, HttpStatus.WARN, msg);
+ }
+
+ /**
+ * 返回警告消息
+ *
+ * @param msg 返回内容
+ * @param data 数据对象
+ * @return 警告消息
+ */
+ public static R warn(String msg, T data) {
+ return restResult(data, HttpStatus.WARN, msg);
+ }
+
+ private static R restResult(T data, int code, String msg) {
+ R r = new R<>();
+ r.setCode(code);
+ r.setData(data);
+ r.setMsg(msg);
+ return r;
+ }
+
+ public static Boolean isError(R ret) {
+ return !isSuccess(ret);
+ }
+
+ public static Boolean isSuccess(R ret) {
+ return R.SUCCESS == ret.getCode();
+ }
+}
diff --git a/common/src/main/java/com/jiagutech/ams/model/dto/DeptDTO.java b/common/src/main/java/com/jiagutech/ams/model/dto/DeptDTO.java
new file mode 100644
index 0000000..1401435
--- /dev/null
+++ b/common/src/main/java/com/jiagutech/ams/model/dto/DeptDTO.java
@@ -0,0 +1,22 @@
+package com.jiagutech.ams.model.dto;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * @ClassName DeptDTO
+ * @author: zhangyeguang
+ * @create: 2024-09-01 10:22
+ * @Version 1.0
+ * @description:
+ **/
+@Data
+@TableName("ams_dept")
+public class DeptDTO implements Serializable {
+ private static final long serialVersionUID = 1L;
+
+ private Long id;
+ private String name;
+}
diff --git a/common/src/main/java/com/jiagutech/ams/model/dto/RegionDTO.java b/common/src/main/java/com/jiagutech/ams/model/dto/RegionDTO.java
new file mode 100644
index 0000000..df7db70
--- /dev/null
+++ b/common/src/main/java/com/jiagutech/ams/model/dto/RegionDTO.java
@@ -0,0 +1,22 @@
+package com.jiagutech.ams.model.dto;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+/**
+ * @ClassName RegionDTO
+ * @author: zhangyeguang
+ * @create: 2024-09-02 17:59
+ * @Version 1.0
+ * @description:
+ **/
+@Data
+@TableName("region_info")
+public class RegionDTO {
+
+ private Long regionCode;
+
+ private String regionName;
+
+ private Integer level;
+}
diff --git a/common/src/main/java/com/jiagutech/ams/model/dto/RoleDTO.java b/common/src/main/java/com/jiagutech/ams/model/dto/RoleDTO.java
new file mode 100644
index 0000000..0d0a160
--- /dev/null
+++ b/common/src/main/java/com/jiagutech/ams/model/dto/RoleDTO.java
@@ -0,0 +1,26 @@
+package com.jiagutech.ams.model.dto;
+
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * @ClassName RoleDTO
+ * @author: zhangyeguang
+ * @create: 2024-09-01 09:29
+ * @Version 1.0
+ * @description:
+ **/
+@Data
+@TableName("ams_role")
+public class RoleDTO implements Serializable {
+ private static final long serialVersionUID = 1L;
+ @TableId
+ private Long id;
+
+ private String name;
+
+ private String key;
+}
diff --git a/common/src/main/java/com/jiagutech/ams/model/dto/UserDTO.java b/common/src/main/java/com/jiagutech/ams/model/dto/UserDTO.java
new file mode 100644
index 0000000..e6b7518
--- /dev/null
+++ b/common/src/main/java/com/jiagutech/ams/model/dto/UserDTO.java
@@ -0,0 +1,28 @@
+package com.jiagutech.ams.model.dto;
+
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+/**
+ * @ClassName UserDTO
+ * @author: zhangyeguang
+ * @create: 2024-08-30 15:47
+ * @Version 1.0
+ * @description:
+ **/
+@Data
+@TableName("ams_user")
+public class UserDTO {
+ @TableId
+ private Long id;
+ private String username;
+ private String password;
+ private String nickName;
+ private String email;
+ private String phone;
+ private Integer delFlag = 0;
+ private Long regionCode;
+ private String regionPath;
+
+}
\ No newline at end of file
diff --git a/common/src/main/java/com/jiagutech/ams/model/dto/UserDeptDTO.java b/common/src/main/java/com/jiagutech/ams/model/dto/UserDeptDTO.java
new file mode 100644
index 0000000..a47a2a5
--- /dev/null
+++ b/common/src/main/java/com/jiagutech/ams/model/dto/UserDeptDTO.java
@@ -0,0 +1,24 @@
+package com.jiagutech.ams.model.dto;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+import lombok.experimental.Accessors;
+
+/**
+ * @ClassName UserDeptDTO
+ * @author: zhangyeguang
+ * @create: 2024-09-01 09:58
+ * @Version 1.0
+ * @description:
+ **/
+@Data
+@Accessors(chain = true)
+@TableName("ams_user_dept")
+public class UserDeptDTO {
+
+ private Long userId;
+
+ private Long deptId;
+}
diff --git a/common/src/main/java/com/jiagutech/ams/model/dto/UserRoleDTO.java b/common/src/main/java/com/jiagutech/ams/model/dto/UserRoleDTO.java
new file mode 100644
index 0000000..1566e1f
--- /dev/null
+++ b/common/src/main/java/com/jiagutech/ams/model/dto/UserRoleDTO.java
@@ -0,0 +1,25 @@
+package com.jiagutech.ams.model.dto;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+import lombok.experimental.Accessors;
+
+/**
+ * @ClassName UserRoleDTO
+ * @author: zhangyeguang
+ * @create: 2024-09-01 09:58
+ * @Version 1.0
+ * @description:
+ **/
+@Data
+@Accessors(chain = true)
+@TableName("ams_user_role")
+public class UserRoleDTO {
+
+ private Long userId;
+
+ private Long roleId;
+
+}
diff --git a/common/src/main/java/com/jiagutech/ams/utils/ExcelBigNumberConvert.java b/common/src/main/java/com/jiagutech/ams/utils/ExcelBigNumberConvert.java
new file mode 100644
index 0000000..5bc125b
--- /dev/null
+++ b/common/src/main/java/com/jiagutech/ams/utils/ExcelBigNumberConvert.java
@@ -0,0 +1,52 @@
+package com.jiagutech.ams.utils;
+
+import cn.hutool.core.convert.Convert;
+import cn.hutool.core.util.ObjectUtil;
+import com.alibaba.excel.converters.Converter;
+import com.alibaba.excel.enums.CellDataTypeEnum;
+import com.alibaba.excel.metadata.GlobalConfiguration;
+import com.alibaba.excel.metadata.data.ReadCellData;
+import com.alibaba.excel.metadata.data.WriteCellData;
+import com.alibaba.excel.metadata.property.ExcelContentProperty;
+import lombok.extern.slf4j.Slf4j;
+
+import java.math.BigDecimal;
+
+/**
+ * 大数值转换
+ * Excel 数值长度位15位 大于15位的数值转换位字符串
+ *
+ * @author Lion Li
+ */
+@Slf4j
+public class ExcelBigNumberConvert implements Converter {
+
+ @Override
+ public Class supportJavaTypeKey() {
+ return Long.class;
+ }
+
+ @Override
+ public CellDataTypeEnum supportExcelTypeKey() {
+ return CellDataTypeEnum.STRING;
+ }
+
+ @Override
+ public Long convertToJavaData(ReadCellData> cellData, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) {
+ return Convert.toLong(cellData.getData());
+ }
+
+ @Override
+ public WriteCellData