workDayMap) {
+ return workDayMap.entrySet().stream()
+ // 瀵规瘡涓敤鎴峰垱寤轰竴涓猄taticsHourVo瀵硅薄
+ .map(entry -> createStaticsHourVo(entry.getKey(), entry.getValue(),null))
+ .collect(Collectors.toList());
+ }
+
+ // 鍒涘缓StaticsHourVo瀵硅薄锛岃绠楀伐鏃跺苟鏍煎紡鍖栦负瀛楃涓
+ private StaticsHourVo createStaticsHourVo(String name, BigDecimal workTime,Integer projectId) {
+ StaticsHourVo vo = new StaticsHourVo();
+ vo.setProjectId(projectId);
+ vo.setName(name);
+ // 灏嗘诲伐鏃堕櫎浠8锛岃〃绀轰负宸ヤ綔鏃ワ紝骞朵繚鐣欎袱浣嶅皬鏁
+ vo.setWorkTime(workTime);
+ return vo;
+ }
+
+}
diff --git a/pms-business/src/main/java/tech/unissense/pms/business/work/logger/vo/CalendarVo.java b/pms-business/src/main/java/tech/unissense/pms/business/work/logger/vo/CalendarVo.java
new file mode 100644
index 0000000..a31f7b0
--- /dev/null
+++ b/pms-business/src/main/java/tech/unissense/pms/business/work/logger/vo/CalendarVo.java
@@ -0,0 +1,25 @@
+package tech.unissense.pms.business.work.logger.vo;
+
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * @author : ch
+ * @version : 1.0
+ * @ClassName : CalendarVo
+ * @Description : 宸ヤ綔鏃ュ巻鏄剧ず
+ * @DATE : Created in 11:40 2024/10/9
+ * Copyright: Copyright(c)2024
+ * Company : 绱厜姹囨櫤淇℃伅鎶鏈湁闄愬叕鍙
+ * Modification History:
+ * Date Author Version Discription
+ * --------------------------------------------------------------------------
+ * 2024/10/9 ch 1.0 Why & What is modified: <淇敼鍘熷洜鎻忚堪> *
+ */
+@Data
+public class CalendarVo {
+ private Date date;
+
+ private String state;
+}
diff --git a/pms-business/src/main/java/tech/unissense/pms/business/work/logger/vo/StaticsHourVo.java b/pms-business/src/main/java/tech/unissense/pms/business/work/logger/vo/StaticsHourVo.java
new file mode 100644
index 0000000..d9b55e7
--- /dev/null
+++ b/pms-business/src/main/java/tech/unissense/pms/business/work/logger/vo/StaticsHourVo.java
@@ -0,0 +1,26 @@
+package tech.unissense.pms.business.work.logger.vo;
+
+import lombok.Data;
+
+import java.math.BigDecimal;
+
+/**
+ * @author : ch
+ * @version : 1.0
+ * @ClassName : CalendarVo
+ * @Description : 宸ユ椂缁熻
+ * @DATE : Created in 11:40 2024/10/9
+ * Copyright: Copyright(c)2024
+ * Company : 绱厜姹囨櫤淇℃伅鎶鏈湁闄愬叕鍙
+ * Modification History:
+ * Date Author Version Discription
+ * --------------------------------------------------------------------------
+ * 2024/10/9 ch 1.0 Why & What is modified: <淇敼鍘熷洜鎻忚堪> *
+ */
+@Data
+public class StaticsHourVo {
+ private Integer projectId;
+ private String name;
+
+ private BigDecimal workTime;
+}
diff --git a/pms-business/src/main/resources/mapper/business/Project/ProjectMapper.xml b/pms-business/src/main/resources/mapper/business/Project/ProjectMapper.xml
new file mode 100644
index 0000000..400aab5
--- /dev/null
+++ b/pms-business/src/main/resources/mapper/business/Project/ProjectMapper.xml
@@ -0,0 +1,312 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ select project_id,
+ tenant_id,
+ project_name,
+ project_code,
+ project_leader,
+ start_date,
+ end_date,
+ budget_date,
+ state,
+ project_state,
+ create_by,
+ update_by,
+ update_time,
+ create_time
+ from pms_project
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ insert into pms_project(tenant_id, project_name, project_code, project_leader, start_date, end_date,
+ budget_date, state, project_state, data_state, create_by, update_by,
+ update_time, create_time)
+ values (#{tenantId}, #{projectName}, #{projectCode}, #{projectLeader}, #{startDate}, #{endDate}, #{budgetDate},
+ #{state}, #{projectState},#{dataState}, #{createBy}, #{updateBy}, #{updateTime},
+ #{createTime})
+
+
+
+ insert into pms_project(tenant_id, project_name, project_code, project_leader, start_date, end_date,
+ budget_date, state, project_state, create_by, update_by, update_time,
+ create_time)
+ values
+
+ (#{entity.tenantId}, #{entity.projectName}, #{entity.projectCode}, #{entity.projectLeader},
+ #{entity.startDate}, #{entity.endDate}, #{entity.budgetDate}, #{entity.state}, #{entity.projectState},
+ #{entity.createBy}, #{entity.updateBy},
+ #{entity.updateTime}, #{entity.createTime})
+
+
+
+
+ insert into pms_project(tenant_id, project_name, project_code, project_leader, start_date, end_date,
+ budget_date, state, project_state, create_by, update_by, update_time,
+ create_time)
+ values
+
+ (#{entity.tenantId}, #{entity.projectName}, #{entity.projectCode}, #{entity.projectLeader},
+ #{entity.startDate}, #{entity.endDate}, #{entity.budgetDate}, #{entity.state}, #{entity.projectState},
+ #{entity.createBy}, #{entity.updateBy},
+ #{entity.updateTime}, #{entity.createTime})
+
+ on duplicate key update
+ tenant_id = values(tenant_id),
+ project_name = values(project_name),
+ project_code = values(project_code),
+ project_leader = values(project_leader),
+ start_date = values(start_date),
+ end_date = values(end_date),
+ budget_date = values(budget_date),
+ state = values(state),
+ project_state = values(project_state),
+ create_by = values(create_by),
+ update_by = values(update_by),
+
+ update_time = values(update_time),
+ create_time = values(create_time)
+
+
+
+
+ update pms_project
+
+
+ tenant_id = #{tenantId},
+
+
+ project_name = #{projectName},
+
+
+ project_code = #{projectCode},
+
+
+ project_leader = #{projectLeader},
+
+
+ start_date = #{startDate},
+
+
+ end_date = #{endDate},
+
+
+ budget_date = #{budgetDate},
+
+
+ state = #{state},
+
+
+ data_state = #{dataState},
+
+
+ project_state = #{projectState},
+
+
+ create_by = #{createBy},
+
+
+ update_by = #{updateBy},
+
+
+
+ update_time = #{updateTime},
+
+
+ create_time = #{createTime},
+
+
+ where project_id = #{projectId}
+
+
+ update pms_project
+ set state = 1
+ where project_id = #{projectId}
+
+
+
+
+ delete
+ from pms_project
+ where project_id = #{projectId}
+
+
+
+
diff --git a/pms-business/src/main/resources/mapper/business/ProjectTeam/ProjectTeamMapper.xml b/pms-business/src/main/resources/mapper/business/ProjectTeam/ProjectTeamMapper.xml
new file mode 100644
index 0000000..1808910
--- /dev/null
+++ b/pms-business/src/main/resources/mapper/business/ProjectTeam/ProjectTeamMapper.xml
@@ -0,0 +1,183 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ select project_id,
+ team_id,
+ user_id,
+ post_id,
+ create_by,
+ update_by,
+ update_time,
+ create_time
+ from pms_project_team
+
+
+
+
+
+
+
+
+
+
+
+
+ insert into pms_project_team(project_id, user_id, post_id, create_by, update_by, update_time, create_time)
+ values (#{projectId}, #{userId}, #{postId}, #{createBy}, #{updateBy}, #{updateTime}, #{createTime})
+
+
+
+ insert into pms_project_team(project_id, user_id, post_id, create_by, update_by, update_time, create_time)
+ values
+
+ (#{entity.projectId}, #{entity.userId}, #{entity.postId}, #{entity.createBy}, #{entity.updateBy},
+ #{entity.updateTime}, #{entity.createTime})
+
+
+
+
+ insert into pms_project_team(project_id, user_id, post_id, create_by, update_by, update_time, create_time)
+ values
+
+ (#{entity.projectId}, #{entity.userId}, #{entity.postId}, #{entity.createBy}, #{entity.updateBy},
+ #{entity.updateTime}, #{entity.createTime})
+
+ on duplicate key update
+ project_id = values(project_id),
+ user_id = values(user_id),
+ post_id = values(post_id),
+ update_by = values(update_by),
+ update_time = values(update_time),
+
+
+
+
+ update pms_project_team
+
+
+ project_id = #{projectId},
+
+
+ user_id = #{userId},
+
+
+ post_id = #{postId},
+
+
+ create_by = #{createBy},
+
+
+ update_by = #{updateBy},
+
+
+ update_time = #{updateTime},
+
+
+ create_time = #{createTime},
+
+
+ where team_id = #{teamId}
+
+
+
+
+ delete
+ from pms_project_team
+ where team_id = #{teamId}
+
+
+
+
diff --git a/pms-business/src/main/resources/mapper/business/WorkLogger/WorkLoggerMapper.xml b/pms-business/src/main/resources/mapper/business/WorkLogger/WorkLoggerMapper.xml
new file mode 100644
index 0000000..31293b5
--- /dev/null
+++ b/pms-business/src/main/resources/mapper/business/WorkLogger/WorkLoggerMapper.xml
@@ -0,0 +1,303 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ select logger_id,
+ logger_date,
+ project_id,
+ user_id,
+ work_time,
+ work_content,
+ state,
+ create_by,
+ update_by,
+ update_time,
+ create_time
+ from pms_work_logger
+
+
+
+
+
+
+
+
+
+
+
+
+ insert into pms_work_logger(logger_date, project_id, user_id, work_time, work_content, state, create_by,
+ update_by, update_time, create_time)
+ values (#{loggerDate}, #{projectId}, #{userId}, #{workTime}, #{workContent}, #{state}, #{createBy}, #{updateBy},
+ #{updateTime}, #{createTime})
+
+
+
+ insert into pms_work_logger(logger_date, project_id, user_id, work_time, work_content, state, create_by,
+ update_by, update_time, create_time)
+ values
+
+ (#{entity.loggerDate}, #{entity.projectId}, #{entity.userId}, #{entity.workTime}, #{entity.workContent},
+ #{entity.state}, #{entity.createBy}, #{entity.updateBy}, #{entity.updateTime}, #{entity.createTime})
+
+
+
+
+ insert into pms_work_logger(logger_date, project_id, user_id, work_time, work_content, state, create_by,
+ update_by, update_time, create_time)
+ values
+
+ (#{entity.loggerDate}, #{entity.projectId}, #{entity.userId}, #{entity.workTime}, #{entity.workContent},
+ #{entity.state}, #{entity.createBy}, #{entity.updateBy}, #{entity.updateTime}, #{entity.createTime})
+
+ on duplicate key update
+ logger_date = values(logger_date),
+ project_id = values(project_id),
+ user_id = values(user_id),
+ work_time = values(work_time),
+ work_content = values(work_content),
+ state = values(state),
+ create_by = values(create_by),
+ update_by = values(update_by),
+ update_time = values(update_time),
+ create_time = values(create_time)
+
+
+
+
+
+ update pms_work_logger
+
+
+ logger_date = #{loggerDate},
+
+
+ project_id = #{projectId},
+
+
+ user_id = #{userId},
+
+
+ work_time = #{workTime},
+
+
+ work_content = #{workContent},
+
+
+ state = #{state},
+
+
+ create_by = #{createBy},
+
+
+ update_by = #{updateBy},
+
+
+ update_time = #{updateTime},
+
+
+ create_time = #{createTime},
+
+
+ where logger_id = #{loggerId}
+
+
+
+
+ delete
+ from pms_work_logger
+ where logger_id = #{loggerId}
+
+
+
+
diff --git a/pms-common/pom.xml b/pms-common/pom.xml
new file mode 100644
index 0000000..fef9eb3
--- /dev/null
+++ b/pms-common/pom.xml
@@ -0,0 +1,124 @@
+
+
+
+ pms
+ tech.unissense
+ 3.8.8
+
+ 4.0.0
+
+ pms-common
+
+
+ common閫氱敤宸ュ叿
+
+
+
+
+
+
+ org.springframework
+ spring-context-support
+
+
+
+
+ org.springframework
+ spring-web
+
+
+
+
+ org.springframework.boot
+ spring-boot-starter-security
+
+
+
+
+ com.github.pagehelper
+ pagehelper-spring-boot-starter
+
+
+
+
+ org.springframework.boot
+ spring-boot-starter-validation
+
+
+
+
+ org.apache.commons
+ commons-lang3
+
+
+
+
+ com.fasterxml.jackson.core
+ jackson-databind
+
+
+
+
+ com.alibaba.fastjson2
+ fastjson2
+
+
+
+
+ commons-io
+ commons-io
+
+
+
+
+ org.apache.poi
+ poi-ooxml
+
+
+
+
+ org.yaml
+ snakeyaml
+
+
+
+
+ io.jsonwebtoken
+ jjwt
+
+
+
+
+ javax.xml.bind
+ jaxb-api
+
+
+
+
+ org.springframework.boot
+ spring-boot-starter-data-redis
+
+
+
+
+ org.apache.commons
+ commons-pool2
+
+
+
+
+ eu.bitwalker
+ UserAgentUtils
+
+
+
+
+ javax.servlet
+ javax.servlet-api
+
+
+
+
+
\ No newline at end of file
diff --git a/pms-common/src/main/java/tech/unissense/pms/common/annotation/Anonymous.java b/pms-common/src/main/java/tech/unissense/pms/common/annotation/Anonymous.java
new file mode 100644
index 0000000..d60445b
--- /dev/null
+++ b/pms-common/src/main/java/tech/unissense/pms/common/annotation/Anonymous.java
@@ -0,0 +1,19 @@
+package tech.unissense.pms.common.annotation;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * 鍖垮悕璁块棶涓嶉壌鏉冩敞瑙
+ *
+ * @author ruoyi
+ */
+@Target({ ElementType.METHOD, ElementType.TYPE })
+@Retention(RetentionPolicy.RUNTIME)
+@Documented
+public @interface Anonymous
+{
+}
diff --git a/pms-common/src/main/java/tech/unissense/pms/common/annotation/DataScope.java b/pms-common/src/main/java/tech/unissense/pms/common/annotation/DataScope.java
new file mode 100644
index 0000000..5fb98af
--- /dev/null
+++ b/pms-common/src/main/java/tech/unissense/pms/common/annotation/DataScope.java
@@ -0,0 +1,33 @@
+package tech.unissense.pms.common.annotation;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * 鏁版嵁鏉冮檺杩囨护娉ㄨВ
+ *
+ * @author ruoyi
+ */
+@Target(ElementType.METHOD)
+@Retention(RetentionPolicy.RUNTIME)
+@Documented
+public @interface DataScope
+{
+ /**
+ * 閮ㄩ棬琛ㄧ殑鍒悕
+ */
+ public String deptAlias() default "";
+
+ /**
+ * 鐢ㄦ埛琛ㄧ殑鍒悕
+ */
+ public String userAlias() default "";
+
+ /**
+ * 鏉冮檺瀛楃锛堢敤浜庡涓鑹插尮閰嶇鍚堣姹傜殑鏉冮檺锛夐粯璁ゆ牴鎹潈闄愭敞瑙ss鑾峰彇锛屽涓潈闄愮敤閫楀彿鍒嗛殧寮鏉
+ */
+ public String permission() default "";
+}
diff --git a/pms-common/src/main/java/tech/unissense/pms/common/annotation/DataSource.java b/pms-common/src/main/java/tech/unissense/pms/common/annotation/DataSource.java
new file mode 100644
index 0000000..e5090da
--- /dev/null
+++ b/pms-common/src/main/java/tech/unissense/pms/common/annotation/DataSource.java
@@ -0,0 +1,28 @@
+package tech.unissense.pms.common.annotation;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Inherited;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+import tech.unissense.pms.common.enums.DataSourceType;
+
+/**
+ * 鑷畾涔夊鏁版嵁婧愬垏鎹㈡敞瑙
+ *
+ * 浼樺厛绾э細鍏堟柟娉曪紝鍚庣被锛屽鏋滄柟娉曡鐩栦簡绫讳笂鐨勬暟鎹簮绫诲瀷锛屼互鏂规硶鐨勪负鍑嗭紝鍚﹀垯浠ョ被涓婄殑涓哄噯
+ *
+ * @author ruoyi
+ */
+@Target({ ElementType.METHOD, ElementType.TYPE })
+@Retention(RetentionPolicy.RUNTIME)
+@Documented
+@Inherited
+public @interface DataSource
+{
+ /**
+ * 鍒囨崲鏁版嵁婧愬悕绉
+ */
+ public DataSourceType value() default DataSourceType.MASTER;
+}
diff --git a/pms-common/src/main/java/tech/unissense/pms/common/annotation/Excel.java b/pms-common/src/main/java/tech/unissense/pms/common/annotation/Excel.java
new file mode 100644
index 0000000..2c35bd0
--- /dev/null
+++ b/pms-common/src/main/java/tech/unissense/pms/common/annotation/Excel.java
@@ -0,0 +1,192 @@
+package tech.unissense.pms.common.annotation;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+import java.math.BigDecimal;
+import org.apache.poi.ss.usermodel.HorizontalAlignment;
+import org.apache.poi.ss.usermodel.IndexedColors;
+import tech.unissense.pms.common.utils.poi.ExcelHandlerAdapter;
+
+/**
+ * 鑷畾涔夊鍑篍xcel鏁版嵁娉ㄨВ
+ *
+ * @author ruoyi
+ */
+@Retention(RetentionPolicy.RUNTIME)
+@Target(ElementType.FIELD)
+public @interface Excel
+{
+ /**
+ * 瀵煎嚭鏃跺湪excel涓帓搴
+ */
+ public int sort() default Integer.MAX_VALUE;
+
+ /**
+ * 瀵煎嚭鍒癊xcel涓殑鍚嶅瓧.
+ */
+ public String name() default "";
+
+ /**
+ * 鏃ユ湡鏍煎紡, 濡: yyyy-MM-dd
+ */
+ public String dateFormat() default "";
+
+ /**
+ * 濡傛灉鏄瓧鍏哥被鍨嬶紝璇疯缃瓧鍏哥殑type鍊 (濡: sys_user_sex)
+ */
+ public String dictType() default "";
+
+ /**
+ * 璇诲彇鍐呭杞〃杈惧紡 (濡: 0=鐢,1=濂,2=鏈煡)
+ */
+ public String readConverterExp() default "";
+
+ /**
+ * 鍒嗛殧绗︼紝璇诲彇瀛楃涓茬粍鍐呭
+ */
+ public String separator() default ",";
+
+ /**
+ * BigDecimal 绮惧害 榛樿:-1(榛樿涓嶅紑鍚疊igDecimal鏍煎紡鍖)
+ */
+ public int scale() default -1;
+
+ /**
+ * BigDecimal 鑸嶅叆瑙勫垯 榛樿:BigDecimal.ROUND_HALF_EVEN
+ */
+ public int roundingMode() default BigDecimal.ROUND_HALF_EVEN;
+
+ /**
+ * 瀵煎嚭鏃跺湪excel涓瘡涓垪鐨勯珮搴
+ */
+ public double height() default 14;
+
+ /**
+ * 瀵煎嚭鏃跺湪excel涓瘡涓垪鐨勫搴
+ */
+ public double width() default 16;
+
+ /**
+ * 鏂囧瓧鍚庣紑,濡% 90 鍙樻垚90%
+ */
+ public String suffix() default "";
+
+ /**
+ * 褰撳间负绌烘椂,瀛楁鐨勯粯璁ゅ
+ */
+ public String defaultValue() default "";
+
+ /**
+ * 鎻愮ず淇℃伅
+ */
+ public String prompt() default "";
+
+ /**
+ * 璁剧疆鍙兘閫夋嫨涓嶈兘杈撳叆鐨勫垪鍐呭.
+ */
+ public String[] combo() default {};
+
+ /**
+ * 鏄惁浠庡瓧鍏歌鏁版嵁鍒癱ombo,榛樿涓嶈鍙,濡傝鍙栭渶瑕佽缃甦ictType娉ㄨВ.
+ */
+ public boolean comboReadDict() default false;
+
+ /**
+ * 鏄惁闇瑕佺旱鍚戝悎骞跺崟鍏冩牸,搴斿闇姹:鍚湁list闆嗗悎鍗曞厓鏍)
+ */
+ public boolean needMerge() default false;
+
+ /**
+ * 鏄惁瀵煎嚭鏁版嵁,搴斿闇姹:鏈夋椂鎴戜滑闇瑕佸鍑轰竴浠芥ā鏉,杩欐槸鏍囬闇瑕佷絾鍐呭闇瑕佺敤鎴锋墜宸ュ~鍐.
+ */
+ public boolean isExport() default true;
+
+ /**
+ * 鍙︿竴涓被涓殑灞炴у悕绉,鏀寔澶氱骇鑾峰彇,浠ュ皬鏁扮偣闅斿紑
+ */
+ public String targetAttr() default "";
+
+ /**
+ * 鏄惁鑷姩缁熻鏁版嵁,鍦ㄦ渶鍚庤拷鍔犱竴琛岀粺璁℃暟鎹诲拰
+ */
+ public boolean isStatistics() default false;
+
+ /**
+ * 瀵煎嚭绫诲瀷锛0鏁板瓧 1瀛楃涓 2鍥剧墖锛
+ */
+ public ColumnType cellType() default ColumnType.STRING;
+
+ /**
+ * 瀵煎嚭鍒楀ご鑳屾櫙棰滆壊
+ */
+ public IndexedColors headerBackgroundColor() default IndexedColors.GREY_50_PERCENT;
+
+ /**
+ * 瀵煎嚭鍒楀ご瀛椾綋棰滆壊
+ */
+ public IndexedColors headerColor() default IndexedColors.WHITE;
+
+ /**
+ * 瀵煎嚭鍗曞厓鏍艰儗鏅鑹
+ */
+ public IndexedColors backgroundColor() default IndexedColors.WHITE;
+
+ /**
+ * 瀵煎嚭鍗曞厓鏍煎瓧浣撻鑹
+ */
+ public IndexedColors color() default IndexedColors.BLACK;
+
+ /**
+ * 瀵煎嚭瀛楁瀵归綈鏂瑰紡
+ */
+ public HorizontalAlignment align() default HorizontalAlignment.CENTER;
+
+ /**
+ * 鑷畾涔夋暟鎹鐞嗗櫒
+ */
+ public Class> handler() default ExcelHandlerAdapter.class;
+
+ /**
+ * 鑷畾涔夋暟鎹鐞嗗櫒鍙傛暟
+ */
+ public String[] args() default {};
+
+ /**
+ * 瀛楁绫诲瀷锛0锛氬鍑哄鍏ワ紱1锛氫粎瀵煎嚭锛2锛氫粎瀵煎叆锛
+ */
+ Type type() default Type.ALL;
+
+ public enum Type
+ {
+ ALL(0), EXPORT(1), IMPORT(2);
+ private final int value;
+
+ Type(int value)
+ {
+ this.value = value;
+ }
+
+ public int value()
+ {
+ return this.value;
+ }
+ }
+
+ public enum ColumnType
+ {
+ NUMERIC(0), STRING(1), IMAGE(2), TEXT(3);
+ private final int value;
+
+ ColumnType(int value)
+ {
+ this.value = value;
+ }
+
+ public int value()
+ {
+ return this.value;
+ }
+ }
+}
\ No newline at end of file
diff --git a/pms-common/src/main/java/tech/unissense/pms/common/annotation/Excels.java b/pms-common/src/main/java/tech/unissense/pms/common/annotation/Excels.java
new file mode 100644
index 0000000..291534a
--- /dev/null
+++ b/pms-common/src/main/java/tech/unissense/pms/common/annotation/Excels.java
@@ -0,0 +1,18 @@
+package tech.unissense.pms.common.annotation;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * Excel娉ㄨВ闆
+ *
+ * @author ruoyi
+ */
+@Target(ElementType.FIELD)
+@Retention(RetentionPolicy.RUNTIME)
+public @interface Excels
+{
+ public Excel[] value();
+}
diff --git a/pms-common/src/main/java/tech/unissense/pms/common/annotation/Log.java b/pms-common/src/main/java/tech/unissense/pms/common/annotation/Log.java
new file mode 100644
index 0000000..21f27f2
--- /dev/null
+++ b/pms-common/src/main/java/tech/unissense/pms/common/annotation/Log.java
@@ -0,0 +1,51 @@
+package tech.unissense.pms.common.annotation;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+import tech.unissense.pms.common.enums.BusinessType;
+import tech.unissense.pms.common.enums.OperatorType;
+
+/**
+ * 鑷畾涔夋搷浣滄棩蹇楄褰曟敞瑙
+ *
+ * @author ruoyi
+ *
+ */
+@Target({ ElementType.PARAMETER, ElementType.METHOD })
+@Retention(RetentionPolicy.RUNTIME)
+@Documented
+public @interface Log
+{
+ /**
+ * 妯″潡
+ */
+ public String title() default "";
+
+ /**
+ * 鍔熻兘
+ */
+ public BusinessType businessType() default BusinessType.OTHER;
+
+ /**
+ * 鎿嶄綔浜虹被鍒
+ */
+ public OperatorType operatorType() default OperatorType.MANAGE;
+
+ /**
+ * 鏄惁淇濆瓨璇锋眰鐨勫弬鏁
+ */
+ public boolean isSaveRequestData() default true;
+
+ /**
+ * 鏄惁淇濆瓨鍝嶅簲鐨勫弬鏁
+ */
+ public boolean isSaveResponseData() default true;
+
+ /**
+ * 鎺掗櫎鎸囧畾鐨勮姹傚弬鏁
+ */
+ public String[] excludeParamNames() default {};
+}
diff --git a/pms-common/src/main/java/tech/unissense/pms/common/annotation/RateLimiter.java b/pms-common/src/main/java/tech/unissense/pms/common/annotation/RateLimiter.java
new file mode 100644
index 0000000..0b22383
--- /dev/null
+++ b/pms-common/src/main/java/tech/unissense/pms/common/annotation/RateLimiter.java
@@ -0,0 +1,40 @@
+package tech.unissense.pms.common.annotation;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+import tech.unissense.pms.common.constant.CacheConstants;
+import tech.unissense.pms.common.enums.LimitType;
+
+/**
+ * 闄愭祦娉ㄨВ
+ *
+ * @author ruoyi
+ */
+@Target(ElementType.METHOD)
+@Retention(RetentionPolicy.RUNTIME)
+@Documented
+public @interface RateLimiter
+{
+ /**
+ * 闄愭祦key
+ */
+ public String key() default CacheConstants.RATE_LIMIT_KEY;
+
+ /**
+ * 闄愭祦鏃堕棿,鍗曚綅绉
+ */
+ public int time() default 60;
+
+ /**
+ * 闄愭祦娆℃暟
+ */
+ public int count() default 100;
+
+ /**
+ * 闄愭祦绫诲瀷
+ */
+ public LimitType limitType() default LimitType.DEFAULT;
+}
diff --git a/pms-common/src/main/java/tech/unissense/pms/common/annotation/RepeatSubmit.java b/pms-common/src/main/java/tech/unissense/pms/common/annotation/RepeatSubmit.java
new file mode 100644
index 0000000..2ff4634
--- /dev/null
+++ b/pms-common/src/main/java/tech/unissense/pms/common/annotation/RepeatSubmit.java
@@ -0,0 +1,31 @@
+package tech.unissense.pms.common.annotation;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Inherited;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * 鑷畾涔夋敞瑙i槻姝㈣〃鍗曢噸澶嶆彁浜
+ *
+ * @author ruoyi
+ *
+ */
+@Inherited
+@Target(ElementType.METHOD)
+@Retention(RetentionPolicy.RUNTIME)
+@Documented
+public @interface RepeatSubmit
+{
+ /**
+ * 闂撮殧鏃堕棿(ms)锛屽皬浜庢鏃堕棿瑙嗕负閲嶅鎻愪氦
+ */
+ public int interval() default 5000;
+
+ /**
+ * 鎻愮ず娑堟伅
+ */
+ public String message() default "涓嶅厑璁搁噸澶嶆彁浜わ紝璇风◢鍊欏啀璇";
+}
diff --git a/pms-common/src/main/java/tech/unissense/pms/common/annotation/Sensitive.java b/pms-common/src/main/java/tech/unissense/pms/common/annotation/Sensitive.java
new file mode 100644
index 0000000..88bbe59
--- /dev/null
+++ b/pms-common/src/main/java/tech/unissense/pms/common/annotation/Sensitive.java
@@ -0,0 +1,24 @@
+package tech.unissense.pms.common.annotation;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+import com.fasterxml.jackson.annotation.JacksonAnnotationsInside;
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import tech.unissense.pms.common.config.serializer.SensitiveJsonSerializer;
+import tech.unissense.pms.common.enums.DesensitizedType;
+
+/**
+ * 鏁版嵁鑴辨晱娉ㄨВ
+ *
+ * @author ruoyi
+ */
+@Retention(RetentionPolicy.RUNTIME)
+@Target(ElementType.FIELD)
+@JacksonAnnotationsInside
+@JsonSerialize(using = SensitiveJsonSerializer.class)
+public @interface Sensitive
+{
+ DesensitizedType desensitizedType();
+}
diff --git a/pms-common/src/main/java/tech/unissense/pms/common/config/RuoYiConfig.java b/pms-common/src/main/java/tech/unissense/pms/common/config/RuoYiConfig.java
new file mode 100644
index 0000000..edabab2
--- /dev/null
+++ b/pms-common/src/main/java/tech/unissense/pms/common/config/RuoYiConfig.java
@@ -0,0 +1,122 @@
+package tech.unissense.pms.common.config;
+
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.stereotype.Component;
+
+/**
+ * 璇诲彇椤圭洰鐩稿叧閰嶇疆
+ *
+ * @author ruoyi
+ */
+@Component
+@ConfigurationProperties(prefix = "ruoyi")
+public class RuoYiConfig
+{
+ /** 椤圭洰鍚嶇О */
+ private String name;
+
+ /** 鐗堟湰 */
+ private String version;
+
+ /** 鐗堟潈骞翠唤 */
+ private String copyrightYear;
+
+ /** 涓婁紶璺緞 */
+ private static String profile;
+
+ /** 鑾峰彇鍦板潃寮鍏 */
+ private static boolean addressEnabled;
+
+ /** 楠岃瘉鐮佺被鍨 */
+ private static String captchaType;
+
+ public String getName()
+ {
+ return name;
+ }
+
+ public void setName(String name)
+ {
+ this.name = name;
+ }
+
+ public String getVersion()
+ {
+ return version;
+ }
+
+ public void setVersion(String version)
+ {
+ this.version = version;
+ }
+
+ public String getCopyrightYear()
+ {
+ return copyrightYear;
+ }
+
+ public void setCopyrightYear(String copyrightYear)
+ {
+ this.copyrightYear = copyrightYear;
+ }
+
+ public static String getProfile()
+ {
+ return profile;
+ }
+
+ public void setProfile(String profile)
+ {
+ RuoYiConfig.profile = profile;
+ }
+
+ public static boolean isAddressEnabled()
+ {
+ return addressEnabled;
+ }
+
+ public void setAddressEnabled(boolean addressEnabled)
+ {
+ RuoYiConfig.addressEnabled = addressEnabled;
+ }
+
+ public static String getCaptchaType() {
+ return captchaType;
+ }
+
+ public void setCaptchaType(String captchaType) {
+ RuoYiConfig.captchaType = captchaType;
+ }
+
+ /**
+ * 鑾峰彇瀵煎叆涓婁紶璺緞
+ */
+ public static String getImportPath()
+ {
+ return getProfile() + "/import";
+ }
+
+ /**
+ * 鑾峰彇澶村儚涓婁紶璺緞
+ */
+ public static String getAvatarPath()
+ {
+ return getProfile() + "/avatar";
+ }
+
+ /**
+ * 鑾峰彇涓嬭浇璺緞
+ */
+ public static String getDownloadPath()
+ {
+ return getProfile() + "/download/";
+ }
+
+ /**
+ * 鑾峰彇涓婁紶璺緞
+ */
+ public static String getUploadPath()
+ {
+ return getProfile() + "/upload";
+ }
+}
diff --git a/pms-common/src/main/java/tech/unissense/pms/common/config/serializer/SensitiveJsonSerializer.java b/pms-common/src/main/java/tech/unissense/pms/common/config/serializer/SensitiveJsonSerializer.java
new file mode 100644
index 0000000..1a619e9
--- /dev/null
+++ b/pms-common/src/main/java/tech/unissense/pms/common/config/serializer/SensitiveJsonSerializer.java
@@ -0,0 +1,67 @@
+package tech.unissense.pms.common.config.serializer;
+
+import java.io.IOException;
+import java.util.Objects;
+import com.fasterxml.jackson.core.JsonGenerator;
+import com.fasterxml.jackson.databind.BeanProperty;
+import com.fasterxml.jackson.databind.JsonMappingException;
+import com.fasterxml.jackson.databind.JsonSerializer;
+import com.fasterxml.jackson.databind.SerializerProvider;
+import com.fasterxml.jackson.databind.ser.ContextualSerializer;
+import tech.unissense.pms.common.annotation.Sensitive;
+import tech.unissense.pms.common.core.domain.model.LoginUser;
+import tech.unissense.pms.common.enums.DesensitizedType;
+import tech.unissense.pms.common.utils.SecurityUtils;
+
+/**
+ * 鏁版嵁鑴辨晱搴忓垪鍖栬繃婊
+ *
+ * @author ruoyi
+ */
+public class SensitiveJsonSerializer extends JsonSerializer implements ContextualSerializer
+{
+ private DesensitizedType desensitizedType;
+
+ @Override
+ public void serialize(String value, JsonGenerator gen, SerializerProvider serializers) throws IOException
+ {
+ if (desensitization())
+ {
+ gen.writeString(desensitizedType.desensitizer().apply(value));
+ }
+ else
+ {
+ gen.writeString(value);
+ }
+ }
+
+ @Override
+ public JsonSerializer> createContextual(SerializerProvider prov, BeanProperty property)
+ throws JsonMappingException
+ {
+ Sensitive annotation = property.getAnnotation(Sensitive.class);
+ if (Objects.nonNull(annotation) && Objects.equals(String.class, property.getType().getRawClass()))
+ {
+ this.desensitizedType = annotation.desensitizedType();
+ return this;
+ }
+ return prov.findValueSerializer(property.getType(), property);
+ }
+
+ /**
+ * 鏄惁闇瑕佽劚鏁忓鐞
+ */
+ private boolean desensitization()
+ {
+ try
+ {
+ LoginUser securityUser = SecurityUtils.getLoginUser();
+ // 绠$悊鍛樹笉鑴辨晱
+ return !securityUser.getUser().isAdmin();
+ }
+ catch (Exception e)
+ {
+ return true;
+ }
+ }
+}
diff --git a/pms-common/src/main/java/tech/unissense/pms/common/constant/CacheConstants.java b/pms-common/src/main/java/tech/unissense/pms/common/constant/CacheConstants.java
new file mode 100644
index 0000000..6f6a6a0
--- /dev/null
+++ b/pms-common/src/main/java/tech/unissense/pms/common/constant/CacheConstants.java
@@ -0,0 +1,44 @@
+package tech.unissense.pms.common.constant;
+
+/**
+ * 缂撳瓨鐨刱ey 甯搁噺
+ *
+ * @author ruoyi
+ */
+public class CacheConstants
+{
+ /**
+ * 鐧诲綍鐢ㄦ埛 redis key
+ */
+ public static final String LOGIN_TOKEN_KEY = "login_tokens:";
+
+ /**
+ * 楠岃瘉鐮 redis key
+ */
+ public static final String CAPTCHA_CODE_KEY = "captcha_codes:";
+
+ /**
+ * 鍙傛暟绠$悊 cache key
+ */
+ public static final String SYS_CONFIG_KEY = "sys_config:";
+
+ /**
+ * 瀛楀吀绠$悊 cache key
+ */
+ public static final String SYS_DICT_KEY = "sys_dict:";
+
+ /**
+ * 闃查噸鎻愪氦 redis key
+ */
+ public static final String REPEAT_SUBMIT_KEY = "repeat_submit:";
+
+ /**
+ * 闄愭祦 redis key
+ */
+ public static final String RATE_LIMIT_KEY = "rate_limit:";
+
+ /**
+ * 鐧诲綍璐︽埛瀵嗙爜閿欒娆℃暟 redis key
+ */
+ public static final String PWD_ERR_CNT_KEY = "pwd_err_cnt:";
+}
diff --git a/pms-common/src/main/java/tech/unissense/pms/common/constant/Constants.java b/pms-common/src/main/java/tech/unissense/pms/common/constant/Constants.java
new file mode 100644
index 0000000..6756b11
--- /dev/null
+++ b/pms-common/src/main/java/tech/unissense/pms/common/constant/Constants.java
@@ -0,0 +1,176 @@
+package tech.unissense.pms.common.constant;
+
+import java.util.Locale;
+import io.jsonwebtoken.Claims;
+
+/**
+ * 閫氱敤甯搁噺淇℃伅
+ *
+ * @author ruoyi
+ */
+public class Constants
+{
+ /**
+ * UTF-8 瀛楃闆
+ */
+ public static final String UTF8 = "UTF-8";
+
+ /**
+ * GBK 瀛楃闆
+ */
+ public static final String GBK = "GBK";
+
+ /**
+ * 绯荤粺璇█
+ */
+ public static final Locale DEFAULT_LOCALE = Locale.SIMPLIFIED_CHINESE;
+
+ /**
+ * www涓诲煙
+ */
+ public static final String WWW = "www.";
+
+ /**
+ * http璇锋眰
+ */
+ public static final String HTTP = "http://";
+
+ /**
+ * https璇锋眰
+ */
+ public static final String HTTPS = "https://";
+
+ /**
+ * 閫氱敤鎴愬姛鏍囪瘑
+ */
+ public static final String SUCCESS = "0";
+
+ /**
+ * 閫氱敤澶辫触鏍囪瘑
+ */
+ public static final String FAIL = "1";
+
+ /**
+ * 鐧诲綍鎴愬姛
+ */
+ public static final String LOGIN_SUCCESS = "Success";
+
+ /**
+ * 娉ㄩ攢
+ */
+ public static final String LOGOUT = "Logout";
+
+ /**
+ * 娉ㄥ唽
+ */
+ public static final String REGISTER = "Register";
+
+ /**
+ * 鐧诲綍澶辫触
+ */
+ public static final String LOGIN_FAIL = "Error";
+
+ /**
+ * 鎵鏈夋潈闄愭爣璇
+ */
+ public static final String ALL_PERMISSION = "*:*:*";
+
+ /**
+ * 绠$悊鍛樿鑹叉潈闄愭爣璇
+ */
+ public static final String SUPER_ADMIN = "admin";
+
+ /**
+ * 瑙掕壊鏉冮檺鍒嗛殧绗
+ */
+ public static final String ROLE_DELIMETER = ",";
+
+ /**
+ * 鏉冮檺鏍囪瘑鍒嗛殧绗
+ */
+ public static final String PERMISSION_DELIMETER = ",";
+
+ /**
+ * 楠岃瘉鐮佹湁鏁堟湡锛堝垎閽燂級
+ */
+ public static final Integer CAPTCHA_EXPIRATION = 2;
+
+ /**
+ * 浠ょ墝
+ */
+ public static final String TOKEN = "token";
+
+ /**
+ * 浠ょ墝鍓嶇紑
+ */
+ public static final String TOKEN_PREFIX = "Bearer ";
+
+ /**
+ * 浠ょ墝鍓嶇紑
+ */
+ public static final String LOGIN_USER_KEY = "login_user_key";
+
+ /**
+ * 鐢ㄦ埛ID
+ */
+ public static final String JWT_USERID = "userid";
+
+ /**
+ * 鐢ㄦ埛鍚嶇О
+ */
+ public static final String JWT_USERNAME = Claims.SUBJECT;
+
+ /**
+ * 鐢ㄦ埛澶村儚
+ */
+ public static final String JWT_AVATAR = "avatar";
+
+ /**
+ * 鍒涘缓鏃堕棿
+ */
+ public static final String JWT_CREATED = "created";
+
+ /**
+ * 鐢ㄦ埛鏉冮檺
+ */
+ public static final String JWT_AUTHORITIES = "authorities";
+
+ /**
+ * 璧勬簮鏄犲皠璺緞 鍓嶇紑
+ */
+ public static final String RESOURCE_PREFIX = "/profile";
+
+ /**
+ * RMI 杩滅▼鏂规硶璋冪敤
+ */
+ public static final String LOOKUP_RMI = "rmi:";
+
+ /**
+ * LDAP 杩滅▼鏂规硶璋冪敤
+ */
+ public static final String LOOKUP_LDAP = "ldap:";
+
+ /**
+ * LDAPS 杩滅▼鏂规硶璋冪敤
+ */
+ public static final String LOOKUP_LDAPS = "ldaps:";
+
+ /**
+ * 鑷姩璇嗗埆json瀵硅薄鐧藉悕鍗曢厤缃紙浠呭厑璁歌В鏋愮殑鍖呭悕锛岃寖鍥磋秺灏忚秺瀹夊叏锛
+ */
+ public static final String[] JSON_WHITELIST_STR = { "org.springframework", "tech.unissense" };
+
+ /**
+ * 瀹氭椂浠诲姟鐧藉悕鍗曢厤缃紙浠呭厑璁歌闂殑鍖呭悕锛屽鍏朵粬闇瑕佸彲浠ヨ嚜琛屾坊鍔狅級
+ */
+ public static final String[] JOB_WHITELIST_STR = { "tech.unissense.quartz.task" };
+
+ /**
+ * 瀹氭椂浠诲姟杩濊鐨勫瓧绗
+ */
+ public static final String[] JOB_ERROR_STR = { "java.net.URL", "javax.naming.InitialContext", "org.yaml.snakeyaml",
+ "org.springframework", "org.apache", "tech.unissense.common.utils.file", "tech.unissense.common.config", "tech.unissense.generator" };
+
+
+ public static final String TENANT_ID="tenant_id";
+}
diff --git a/pms-common/src/main/java/tech/unissense/pms/common/constant/GenConstants.java b/pms-common/src/main/java/tech/unissense/pms/common/constant/GenConstants.java
new file mode 100644
index 0000000..54c5906
--- /dev/null
+++ b/pms-common/src/main/java/tech/unissense/pms/common/constant/GenConstants.java
@@ -0,0 +1,117 @@
+package tech.unissense.pms.common.constant;
+
+/**
+ * 浠g爜鐢熸垚閫氱敤甯搁噺
+ *
+ * @author ruoyi
+ */
+public class GenConstants
+{
+ /** 鍗曡〃锛堝鍒犳敼鏌ワ級 */
+ public static final String TPL_CRUD = "crud";
+
+ /** 鏍戣〃锛堝鍒犳敼鏌ワ級 */
+ public static final String TPL_TREE = "tree";
+
+ /** 涓诲瓙琛紙澧炲垹鏀规煡锛 */
+ public static final String TPL_SUB = "sub";
+
+ /** 鏍戠紪鐮佸瓧娈 */
+ public static final String TREE_CODE = "treeCode";
+
+ /** 鏍戠埗缂栫爜瀛楁 */
+ public static final String TREE_PARENT_CODE = "treeParentCode";
+
+ /** 鏍戝悕绉板瓧娈 */
+ public static final String TREE_NAME = "treeName";
+
+ /** 涓婄骇鑿滃崟ID瀛楁 */
+ public static final String PARENT_MENU_ID = "parentMenuId";
+
+ /** 涓婄骇鑿滃崟鍚嶇О瀛楁 */
+ public static final String PARENT_MENU_NAME = "parentMenuName";
+
+ /** 鏁版嵁搴撳瓧绗︿覆绫诲瀷 */
+ public static final String[] COLUMNTYPE_STR = { "char", "varchar", "nvarchar", "varchar2" };
+
+ /** 鏁版嵁搴撴枃鏈被鍨 */
+ public static final String[] COLUMNTYPE_TEXT = { "tinytext", "text", "mediumtext", "longtext" };
+
+ /** 鏁版嵁搴撴椂闂寸被鍨 */
+ public static final String[] COLUMNTYPE_TIME = { "datetime", "time", "date", "timestamp" };
+
+ /** 鏁版嵁搴撴暟瀛楃被鍨 */
+ public static final String[] COLUMNTYPE_NUMBER = { "tinyint", "smallint", "mediumint", "int", "number", "integer",
+ "bit", "bigint", "float", "double", "decimal" };
+
+ /** 椤甸潰涓嶉渶瑕佺紪杈戝瓧娈 */
+ public static final String[] COLUMNNAME_NOT_EDIT = { "id", "create_by", "create_time", "del_flag" };
+
+ /** 椤甸潰涓嶉渶瑕佹樉绀虹殑鍒楄〃瀛楁 */
+ public static final String[] COLUMNNAME_NOT_LIST = { "id", "create_by", "create_time", "del_flag", "update_by",
+ "update_time" };
+
+ /** 椤甸潰涓嶉渶瑕佹煡璇㈠瓧娈 */
+ public static final String[] COLUMNNAME_NOT_QUERY = { "id", "create_by", "create_time", "del_flag", "update_by",
+ "update_time", "remark" };
+
+ /** Entity鍩虹被瀛楁 */
+ public static final String[] BASE_ENTITY = { "createBy", "createTime", "updateBy", "updateTime", "remark" };
+
+ /** Tree鍩虹被瀛楁 */
+ public static final String[] TREE_ENTITY = { "parentName", "parentId", "orderNum", "ancestors", "children" };
+
+ /** 鏂囨湰妗 */
+ public static final String HTML_INPUT = "input";
+
+ /** 鏂囨湰鍩 */
+ public static final String HTML_TEXTAREA = "textarea";
+
+ /** 涓嬫媺妗 */
+ public static final String HTML_SELECT = "select";
+
+ /** 鍗曢夋 */
+ public static final String HTML_RADIO = "radio";
+
+ /** 澶嶉夋 */
+ public static final String HTML_CHECKBOX = "checkbox";
+
+ /** 鏃ユ湡鎺т欢 */
+ public static final String HTML_DATETIME = "datetime";
+
+ /** 鍥剧墖涓婁紶鎺т欢 */
+ public static final String HTML_IMAGE_UPLOAD = "imageUpload";
+
+ /** 鏂囦欢涓婁紶鎺т欢 */
+ public static final String HTML_FILE_UPLOAD = "fileUpload";
+
+ /** 瀵屾枃鏈帶浠 */
+ public static final String HTML_EDITOR = "editor";
+
+ /** 瀛楃涓茬被鍨 */
+ public static final String TYPE_STRING = "String";
+
+ /** 鏁村瀷 */
+ public static final String TYPE_INTEGER = "Integer";
+
+ /** 闀挎暣鍨 */
+ public static final String TYPE_LONG = "Long";
+
+ /** 娴偣鍨 */
+ public static final String TYPE_DOUBLE = "Double";
+
+ /** 楂樼簿搴﹁绠楃被鍨 */
+ public static final String TYPE_BIGDECIMAL = "BigDecimal";
+
+ /** 鏃堕棿绫诲瀷 */
+ public static final String TYPE_DATE = "Date";
+
+ /** 妯$硦鏌ヨ */
+ public static final String QUERY_LIKE = "LIKE";
+
+ /** 鐩哥瓑鏌ヨ */
+ public static final String QUERY_EQ = "EQ";
+
+ /** 闇瑕 */
+ public static final String REQUIRE = "1";
+}
diff --git a/pms-common/src/main/java/tech/unissense/pms/common/constant/HttpStatus.java b/pms-common/src/main/java/tech/unissense/pms/common/constant/HttpStatus.java
new file mode 100644
index 0000000..d10ea8d
--- /dev/null
+++ b/pms-common/src/main/java/tech/unissense/pms/common/constant/HttpStatus.java
@@ -0,0 +1,94 @@
+package tech.unissense.pms.common.constant;
+
+/**
+ * 杩斿洖鐘舵佺爜
+ *
+ * @author ruoyi
+ */
+public class HttpStatus
+{
+ /**
+ * 鎿嶄綔鎴愬姛
+ */
+ public static final int SUCCESS = 200;
+
+ /**
+ * 瀵硅薄鍒涘缓鎴愬姛
+ */
+ public static final int CREATED = 201;
+
+ /**
+ * 璇锋眰宸茬粡琚帴鍙
+ */
+ public static final int ACCEPTED = 202;
+
+ /**
+ * 鎿嶄綔宸茬粡鎵ц鎴愬姛锛屼絾鏄病鏈夎繑鍥炴暟鎹
+ */
+ public static final int NO_CONTENT = 204;
+
+ /**
+ * 璧勬簮宸茶绉婚櫎
+ */
+ public static final int MOVED_PERM = 301;
+
+ /**
+ * 閲嶅畾鍚
+ */
+ public static final int SEE_OTHER = 303;
+
+ /**
+ * 璧勬簮娌℃湁琚慨鏀
+ */
+ public static final int NOT_MODIFIED = 304;
+
+ /**
+ * 鍙傛暟鍒楄〃閿欒锛堢己灏戯紝鏍煎紡涓嶅尮閰嶏級
+ */
+ public static final int BAD_REQUEST = 400;
+
+ /**
+ * 鏈巿鏉
+ */
+ public static final int UNAUTHORIZED = 401;
+
+ /**
+ * 璁块棶鍙楅檺锛屾巿鏉冭繃鏈
+ */
+ public static final int FORBIDDEN = 403;
+
+ /**
+ * 璧勬簮锛屾湇鍔℃湭鎵惧埌
+ */
+ public static final int NOT_FOUND = 404;
+
+ /**
+ * 涓嶅厑璁哥殑http鏂规硶
+ */
+ public static final int BAD_METHOD = 405;
+
+ /**
+ * 璧勬簮鍐茬獊锛屾垨鑰呰祫婧愯閿
+ */
+ public static final int CONFLICT = 409;
+
+ /**
+ * 涓嶆敮鎸佺殑鏁版嵁锛屽獟浣撶被鍨
+ */
+ public static final int UNSUPPORTED_TYPE = 415;
+
+ /**
+ * 绯荤粺鍐呴儴閿欒
+ */
+ public static final int ERROR = 500;
+
+ /**
+ * 鎺ュ彛鏈疄鐜
+ */
+ public static final int NOT_IMPLEMENTED = 501;
+
+ /**
+ * 绯荤粺璀﹀憡娑堟伅
+ */
+ public static final int WARN = 601;
+}
diff --git a/pms-common/src/main/java/tech/unissense/pms/common/constant/ScheduleConstants.java b/pms-common/src/main/java/tech/unissense/pms/common/constant/ScheduleConstants.java
new file mode 100644
index 0000000..359fa01
--- /dev/null
+++ b/pms-common/src/main/java/tech/unissense/pms/common/constant/ScheduleConstants.java
@@ -0,0 +1,50 @@
+package tech.unissense.pms.common.constant;
+
+/**
+ * 浠诲姟璋冨害閫氱敤甯搁噺
+ *
+ * @author ruoyi
+ */
+public class ScheduleConstants
+{
+ public static final String TASK_CLASS_NAME = "TASK_CLASS_NAME";
+
+ /** 鎵ц鐩爣key */
+ public static final String TASK_PROPERTIES = "TASK_PROPERTIES";
+
+ /** 榛樿 */
+ public static final String MISFIRE_DEFAULT = "0";
+
+ /** 绔嬪嵆瑙﹀彂鎵ц */
+ public static final String MISFIRE_IGNORE_MISFIRES = "1";
+
+ /** 瑙﹀彂涓娆℃墽琛 */
+ public static final String MISFIRE_FIRE_AND_PROCEED = "2";
+
+ /** 涓嶈Е鍙戠珛鍗虫墽琛 */
+ public static final String MISFIRE_DO_NOTHING = "3";
+
+ public enum Status
+ {
+ /**
+ * 姝e父
+ */
+ NORMAL("0"),
+ /**
+ * 鏆傚仠
+ */
+ PAUSE("1");
+
+ private String value;
+
+ private Status(String value)
+ {
+ this.value = value;
+ }
+
+ public String getValue()
+ {
+ return value;
+ }
+ }
+}
diff --git a/pms-common/src/main/java/tech/unissense/pms/common/constant/UserConstants.java b/pms-common/src/main/java/tech/unissense/pms/common/constant/UserConstants.java
new file mode 100644
index 0000000..da38cd0
--- /dev/null
+++ b/pms-common/src/main/java/tech/unissense/pms/common/constant/UserConstants.java
@@ -0,0 +1,81 @@
+package tech.unissense.pms.common.constant;
+
+/**
+ * 鐢ㄦ埛甯搁噺淇℃伅
+ *
+ * @author ruoyi
+ */
+public class UserConstants
+{
+ /**
+ * 骞冲彴鍐呯郴缁熺敤鎴风殑鍞竴鏍囧織
+ */
+ public static final String SYS_USER = "SYS_USER";
+
+ /** 姝e父鐘舵 */
+ public static final String NORMAL = "0";
+
+ /** 寮傚父鐘舵 */
+ public static final String EXCEPTION = "1";
+
+ /** 鐢ㄦ埛灏佺鐘舵 */
+ public static final String USER_DISABLE = "1";
+
+ /** 瑙掕壊姝e父鐘舵 */
+ public static final String ROLE_NORMAL = "0";
+
+ /** 瑙掕壊灏佺鐘舵 */
+ public static final String ROLE_DISABLE = "1";
+
+ /** 閮ㄩ棬姝e父鐘舵 */
+ public static final String DEPT_NORMAL = "0";
+
+ /** 閮ㄩ棬鍋滅敤鐘舵 */
+ public static final String DEPT_DISABLE = "1";
+
+ /** 瀛楀吀姝e父鐘舵 */
+ public static final String DICT_NORMAL = "0";
+
+ /** 鏄惁涓虹郴缁熼粯璁わ紙鏄級 */
+ public static final String YES = "Y";
+
+ /** 鏄惁鑿滃崟澶栭摼锛堟槸锛 */
+ public static final String YES_FRAME = "0";
+
+ /** 鏄惁鑿滃崟澶栭摼锛堝惁锛 */
+ public static final String NO_FRAME = "1";
+
+ /** 鑿滃崟绫诲瀷锛堢洰褰曪級 */
+ public static final String TYPE_DIR = "M";
+
+ /** 鑿滃崟绫诲瀷锛堣彍鍗曪級 */
+ public static final String TYPE_MENU = "C";
+
+ /** 鑿滃崟绫诲瀷锛堟寜閽級 */
+ public static final String TYPE_BUTTON = "F";
+
+ /** Layout缁勪欢鏍囪瘑 */
+ public final static String LAYOUT = "Layout";
+
+ /** ParentView缁勪欢鏍囪瘑 */
+ public final static String PARENT_VIEW = "ParentView";
+
+ /** InnerLink缁勪欢鏍囪瘑 */
+ public final static String INNER_LINK = "InnerLink";
+
+ /** 鏍¢獙鏄惁鍞竴鐨勮繑鍥炴爣璇 */
+ public final static boolean UNIQUE = true;
+ public final static boolean NOT_UNIQUE = false;
+
+ /**
+ * 鐢ㄦ埛鍚嶉暱搴﹂檺鍒
+ */
+ public static final int USERNAME_MIN_LENGTH = 2;
+ public static final int USERNAME_MAX_LENGTH = 20;
+
+ /**
+ * 瀵嗙爜闀垮害闄愬埗
+ */
+ public static final int PASSWORD_MIN_LENGTH = 5;
+ public static final int PASSWORD_MAX_LENGTH = 20;
+}
diff --git a/pms-common/src/main/java/tech/unissense/pms/common/core/controller/BaseController.java b/pms-common/src/main/java/tech/unissense/pms/common/core/controller/BaseController.java
new file mode 100644
index 0000000..1787ac1
--- /dev/null
+++ b/pms-common/src/main/java/tech/unissense/pms/common/core/controller/BaseController.java
@@ -0,0 +1,202 @@
+package tech.unissense.pms.common.core.controller;
+
+import java.beans.PropertyEditorSupport;
+import java.util.Date;
+import java.util.List;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.web.bind.WebDataBinder;
+import org.springframework.web.bind.annotation.InitBinder;
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
+import tech.unissense.pms.common.constant.HttpStatus;
+import tech.unissense.pms.common.core.domain.AjaxResult;
+import tech.unissense.pms.common.core.domain.model.LoginUser;
+import tech.unissense.pms.common.core.page.PageDomain;
+import tech.unissense.pms.common.core.page.TableDataInfo;
+import tech.unissense.pms.common.core.page.TableSupport;
+import tech.unissense.pms.common.utils.DateUtils;
+import tech.unissense.pms.common.utils.PageUtils;
+import tech.unissense.pms.common.utils.SecurityUtils;
+import tech.unissense.pms.common.utils.StringUtils;
+import tech.unissense.pms.common.utils.sql.SqlUtil;
+
+/**
+ * web灞傞氱敤鏁版嵁澶勭悊
+ *
+ * @author ruoyi
+ */
+public class BaseController
+{
+ protected final Logger logger = LoggerFactory.getLogger(this.getClass());
+
+ /**
+ * 灏嗗墠鍙颁紶閫掕繃鏉ョ殑鏃ユ湡鏍煎紡鐨勫瓧绗︿覆锛岃嚜鍔ㄨ浆鍖栦负Date绫诲瀷
+ */
+ @InitBinder
+ public void initBinder(WebDataBinder binder)
+ {
+ // Date 绫诲瀷杞崲
+ binder.registerCustomEditor(Date.class, new PropertyEditorSupport()
+ {
+ @Override
+ public void setAsText(String text)
+ {
+ setValue(DateUtils.parseDate(text));
+ }
+ });
+ }
+
+ /**
+ * 璁剧疆璇锋眰鍒嗛〉鏁版嵁
+ */
+ protected void startPage()
+ {
+ PageUtils.startPage();
+ }
+
+ /**
+ * 璁剧疆璇锋眰鎺掑簭鏁版嵁
+ */
+ protected void startOrderBy()
+ {
+ PageDomain pageDomain = TableSupport.buildPageRequest();
+ if (StringUtils.isNotEmpty(pageDomain.getOrderBy()))
+ {
+ String orderBy = SqlUtil.escapeOrderBySql(pageDomain.getOrderBy());
+ PageHelper.orderBy(orderBy);
+ }
+ }
+
+ /**
+ * 娓呯悊鍒嗛〉鐨勭嚎绋嬪彉閲
+ */
+ protected void clearPage()
+ {
+ PageUtils.clearPage();
+ }
+
+ /**
+ * 鍝嶅簲璇锋眰鍒嗛〉鏁版嵁
+ */
+ @SuppressWarnings({ "rawtypes", "unchecked" })
+ protected TableDataInfo getDataTable(List> list)
+ {
+ TableDataInfo rspData = new TableDataInfo();
+ rspData.setCode(HttpStatus.SUCCESS);
+ rspData.setMsg("鏌ヨ鎴愬姛");
+ rspData.setRows(list);
+ rspData.setTotal(new PageInfo(list).getTotal());
+ return rspData;
+ }
+
+ /**
+ * 杩斿洖鎴愬姛
+ */
+ public AjaxResult success()
+ {
+ return AjaxResult.success();
+ }
+
+ /**
+ * 杩斿洖澶辫触娑堟伅
+ */
+ public AjaxResult error()
+ {
+ return AjaxResult.error();
+ }
+
+ /**
+ * 杩斿洖鎴愬姛娑堟伅
+ */
+ public AjaxResult success(String message)
+ {
+ return AjaxResult.success(message);
+ }
+
+ /**
+ * 杩斿洖鎴愬姛娑堟伅
+ */
+ public AjaxResult success(Object data)
+ {
+ return AjaxResult.success(data);
+ }
+
+ /**
+ * 杩斿洖澶辫触娑堟伅
+ */
+ public AjaxResult error(String message)
+ {
+ return AjaxResult.error(message);
+ }
+
+ /**
+ * 杩斿洖璀﹀憡娑堟伅
+ */
+ public AjaxResult warn(String message)
+ {
+ return AjaxResult.warn(message);
+ }
+
+ /**
+ * 鍝嶅簲杩斿洖缁撴灉
+ *
+ * @param rows 褰卞搷琛屾暟
+ * @return 鎿嶄綔缁撴灉
+ */
+ protected AjaxResult toAjax(int rows)
+ {
+ return rows > 0 ? AjaxResult.success() : AjaxResult.error();
+ }
+
+ /**
+ * 鍝嶅簲杩斿洖缁撴灉
+ *
+ * @param result 缁撴灉
+ * @return 鎿嶄綔缁撴灉
+ */
+ protected AjaxResult toAjax(boolean result)
+ {
+ return result ? success() : error();
+ }
+
+ /**
+ * 椤甸潰璺宠浆
+ */
+ public String redirect(String url)
+ {
+ return StringUtils.format("redirect:{}", url);
+ }
+
+ /**
+ * 鑾峰彇鐢ㄦ埛缂撳瓨淇℃伅
+ */
+ public LoginUser getLoginUser()
+ {
+ return SecurityUtils.getLoginUser();
+ }
+
+ /**
+ * 鑾峰彇鐧诲綍鐢ㄦ埛id
+ */
+ public Long getUserId()
+ {
+ return getLoginUser().getUserId();
+ }
+
+ /**
+ * 鑾峰彇鐧诲綍閮ㄩ棬id
+ */
+ public Long getDeptId()
+ {
+ return getLoginUser().getDeptId();
+ }
+
+ /**
+ * 鑾峰彇鐧诲綍鐢ㄦ埛鍚
+ */
+ public String getUsername()
+ {
+ return getLoginUser().getUsername();
+ }
+}
diff --git a/pms-common/src/main/java/tech/unissense/pms/common/core/domain/AjaxResult.java b/pms-common/src/main/java/tech/unissense/pms/common/core/domain/AjaxResult.java
new file mode 100644
index 0000000..b501739
--- /dev/null
+++ b/pms-common/src/main/java/tech/unissense/pms/common/core/domain/AjaxResult.java
@@ -0,0 +1,216 @@
+package tech.unissense.pms.common.core.domain;
+
+import java.util.HashMap;
+import java.util.Objects;
+import tech.unissense.pms.common.constant.HttpStatus;
+import tech.unissense.pms.common.utils.StringUtils;
+
+/**
+ * 鎿嶄綔娑堟伅鎻愰啋
+ *
+ * @author ruoyi
+ */
+public class AjaxResult extends HashMap
+{
+ private static final long serialVersionUID = 1L;
+
+ /** 鐘舵佺爜 */
+ public static final String CODE_TAG = "code";
+
+ /** 杩斿洖鍐呭 */
+ public static final String MSG_TAG = "msg";
+
+ /** 鏁版嵁瀵硅薄 */
+ public static final String DATA_TAG = "data";
+
+ /**
+ * 鍒濆鍖栦竴涓柊鍒涘缓鐨 AjaxResult 瀵硅薄锛屼娇鍏惰〃绀轰竴涓┖娑堟伅銆
+ */
+ public AjaxResult()
+ {
+ }
+
+ /**
+ * 鍒濆鍖栦竴涓柊鍒涘缓鐨 AjaxResult 瀵硅薄
+ *
+ * @param code 鐘舵佺爜
+ * @param msg 杩斿洖鍐呭
+ */
+ public AjaxResult(int code, String msg)
+ {
+ super.put(CODE_TAG, code);
+ super.put(MSG_TAG, msg);
+ }
+
+ /**
+ * 鍒濆鍖栦竴涓柊鍒涘缓鐨 AjaxResult 瀵硅薄
+ *
+ * @param code 鐘舵佺爜
+ * @param msg 杩斿洖鍐呭
+ * @param data 鏁版嵁瀵硅薄
+ */
+ public AjaxResult(int code, String msg, Object data)
+ {
+ super.put(CODE_TAG, code);
+ super.put(MSG_TAG, msg);
+ if (StringUtils.isNotNull(data))
+ {
+ super.put(DATA_TAG, data);
+ }
+ }
+
+ /**
+ * 杩斿洖鎴愬姛娑堟伅
+ *
+ * @return 鎴愬姛娑堟伅
+ */
+ public static AjaxResult success()
+ {
+ return AjaxResult.success("鎿嶄綔鎴愬姛");
+ }
+
+ /**
+ * 杩斿洖鎴愬姛鏁版嵁
+ *
+ * @return 鎴愬姛娑堟伅
+ */
+ public static AjaxResult success(Object data)
+ {
+ return AjaxResult.success("鎿嶄綔鎴愬姛", data);
+ }
+
+ /**
+ * 杩斿洖鎴愬姛娑堟伅
+ *
+ * @param msg 杩斿洖鍐呭
+ * @return 鎴愬姛娑堟伅
+ */
+ public static AjaxResult success(String msg)
+ {
+ return AjaxResult.success(msg, null);
+ }
+
+ /**
+ * 杩斿洖鎴愬姛娑堟伅
+ *
+ * @param msg 杩斿洖鍐呭
+ * @param data 鏁版嵁瀵硅薄
+ * @return 鎴愬姛娑堟伅
+ */
+ public static AjaxResult success(String msg, Object data)
+ {
+ return new AjaxResult(HttpStatus.SUCCESS, msg, data);
+ }
+
+ /**
+ * 杩斿洖璀﹀憡娑堟伅
+ *
+ * @param msg 杩斿洖鍐呭
+ * @return 璀﹀憡娑堟伅
+ */
+ public static AjaxResult warn(String msg)
+ {
+ return AjaxResult.warn(msg, null);
+ }
+
+ /**
+ * 杩斿洖璀﹀憡娑堟伅
+ *
+ * @param msg 杩斿洖鍐呭
+ * @param data 鏁版嵁瀵硅薄
+ * @return 璀﹀憡娑堟伅
+ */
+ public static AjaxResult warn(String msg, Object data)
+ {
+ return new AjaxResult(HttpStatus.WARN, msg, data);
+ }
+
+ /**
+ * 杩斿洖閿欒娑堟伅
+ *
+ * @return 閿欒娑堟伅
+ */
+ public static AjaxResult error()
+ {
+ return AjaxResult.error("鎿嶄綔澶辫触");
+ }
+
+ /**
+ * 杩斿洖閿欒娑堟伅
+ *
+ * @param msg 杩斿洖鍐呭
+ * @return 閿欒娑堟伅
+ */
+ public static AjaxResult error(String msg)
+ {
+ return AjaxResult.error(msg, null);
+ }
+
+ /**
+ * 杩斿洖閿欒娑堟伅
+ *
+ * @param msg 杩斿洖鍐呭
+ * @param data 鏁版嵁瀵硅薄
+ * @return 閿欒娑堟伅
+ */
+ public static AjaxResult error(String msg, Object data)
+ {
+ return new AjaxResult(HttpStatus.ERROR, msg, data);
+ }
+
+ /**
+ * 杩斿洖閿欒娑堟伅
+ *
+ * @param code 鐘舵佺爜
+ * @param msg 杩斿洖鍐呭
+ * @return 閿欒娑堟伅
+ */
+ public static AjaxResult error(int code, String msg)
+ {
+ return new AjaxResult(code, msg, null);
+ }
+
+ /**
+ * 鏄惁涓烘垚鍔熸秷鎭
+ *
+ * @return 缁撴灉
+ */
+ public boolean isSuccess()
+ {
+ return Objects.equals(HttpStatus.SUCCESS, this.get(CODE_TAG));
+ }
+
+ /**
+ * 鏄惁涓鸿鍛婃秷鎭
+ *
+ * @return 缁撴灉
+ */
+ public boolean isWarn()
+ {
+ return Objects.equals(HttpStatus.WARN, this.get(CODE_TAG));
+ }
+
+ /**
+ * 鏄惁涓洪敊璇秷鎭
+ *
+ * @return 缁撴灉
+ */
+ public boolean isError()
+ {
+ return Objects.equals(HttpStatus.ERROR, this.get(CODE_TAG));
+ }
+
+ /**
+ * 鏂逛究閾惧紡璋冪敤
+ *
+ * @param key 閿
+ * @param value 鍊
+ * @return 鏁版嵁瀵硅薄
+ */
+ @Override
+ public AjaxResult put(String key, Object value)
+ {
+ super.put(key, value);
+ return this;
+ }
+}
diff --git a/pms-common/src/main/java/tech/unissense/pms/common/core/domain/BaseEntity.java b/pms-common/src/main/java/tech/unissense/pms/common/core/domain/BaseEntity.java
new file mode 100644
index 0000000..004b178
--- /dev/null
+++ b/pms-common/src/main/java/tech/unissense/pms/common/core/domain/BaseEntity.java
@@ -0,0 +1,118 @@
+package tech.unissense.pms.common.core.domain;
+
+import java.io.Serializable;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Map;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonInclude;
+
+/**
+ * Entity鍩虹被
+ *
+ * @author ruoyi
+ */
+public class BaseEntity implements Serializable
+{
+ private static final long serialVersionUID = 1L;
+
+ /** 鎼滅储鍊 */
+ @JsonIgnore
+ private String searchValue;
+
+ /** 鍒涘缓鑰 */
+ private String createBy;
+
+ /** 鍒涘缓鏃堕棿 */
+ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+ private Date createTime;
+
+ /** 鏇存柊鑰 */
+ private String updateBy;
+
+ /** 鏇存柊鏃堕棿 */
+ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+ private Date updateTime;
+
+ /** 澶囨敞 */
+ private String remark;
+
+ /** 璇锋眰鍙傛暟 */
+ @JsonInclude(JsonInclude.Include.NON_EMPTY)
+ private Map params;
+
+ public String getSearchValue()
+ {
+ return searchValue;
+ }
+
+ public void setSearchValue(String searchValue)
+ {
+ this.searchValue = searchValue;
+ }
+
+ public String getCreateBy()
+ {
+ return createBy;
+ }
+
+ public void setCreateBy(String createBy)
+ {
+ this.createBy = createBy;
+ }
+
+ public Date getCreateTime()
+ {
+ return createTime;
+ }
+
+ public void setCreateTime(Date createTime)
+ {
+ this.createTime = createTime;
+ }
+
+ public String getUpdateBy()
+ {
+ return updateBy;
+ }
+
+ public void setUpdateBy(String updateBy)
+ {
+ this.updateBy = updateBy;
+ }
+
+ public Date getUpdateTime()
+ {
+ return updateTime;
+ }
+
+ public void setUpdateTime(Date updateTime)
+ {
+ this.updateTime = updateTime;
+ }
+
+ public String getRemark()
+ {
+ return remark;
+ }
+
+ public void setRemark(String remark)
+ {
+ this.remark = remark;
+ }
+
+ public Map getParams()
+ {
+ if (params == null)
+ {
+ params = new HashMap<>();
+ }
+ return params;
+ }
+
+ public void setParams(Map params)
+ {
+ this.params = params;
+ }
+}
diff --git a/pms-common/src/main/java/tech/unissense/pms/common/core/domain/R.java b/pms-common/src/main/java/tech/unissense/pms/common/core/domain/R.java
new file mode 100644
index 0000000..b7201f1
--- /dev/null
+++ b/pms-common/src/main/java/tech/unissense/pms/common/core/domain/R.java
@@ -0,0 +1,115 @@
+package tech.unissense.pms.common.core.domain;
+
+import java.io.Serializable;
+import tech.unissense.pms.common.constant.HttpStatus;
+
+/**
+ * 鍝嶅簲淇℃伅涓讳綋
+ *
+ * @author ruoyi
+ */
+public class R implements Serializable
+{
+ private static final long serialVersionUID = 1L;
+
+ /** 鎴愬姛 */
+ public static final int SUCCESS = HttpStatus.SUCCESS;
+
+ /** 澶辫触 */
+ public static final int FAIL = HttpStatus.ERROR;
+
+ 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(T data, String msg)
+ {
+ 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(T data, String msg)
+ {
+ return restResult(data, FAIL, msg);
+ }
+
+ public static R fail(int code, String msg)
+ {
+ return restResult(null, code, msg);
+ }
+
+ private static R restResult(T data, int code, String msg)
+ {
+ R apiResult = new R<>();
+ apiResult.setCode(code);
+ apiResult.setData(data);
+ apiResult.setMsg(msg);
+ return apiResult;
+ }
+
+ public int getCode()
+ {
+ return code;
+ }
+
+ public void setCode(int code)
+ {
+ this.code = code;
+ }
+
+ public String getMsg()
+ {
+ return msg;
+ }
+
+ public void setMsg(String msg)
+ {
+ this.msg = msg;
+ }
+
+ public T getData()
+ {
+ return data;
+ }
+
+ public void setData(T data)
+ {
+ this.data = data;
+ }
+
+ public static Boolean isError(R ret)
+ {
+ return !isSuccess(ret);
+ }
+
+ public static Boolean isSuccess(R ret)
+ {
+ return R.SUCCESS == ret.getCode();
+ }
+}
diff --git a/pms-common/src/main/java/tech/unissense/pms/common/core/domain/TreeEntity.java b/pms-common/src/main/java/tech/unissense/pms/common/core/domain/TreeEntity.java
new file mode 100644
index 0000000..fdc38bb
--- /dev/null
+++ b/pms-common/src/main/java/tech/unissense/pms/common/core/domain/TreeEntity.java
@@ -0,0 +1,79 @@
+package tech.unissense.pms.common.core.domain;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Tree鍩虹被
+ *
+ * @author ruoyi
+ */
+public class TreeEntity extends BaseEntity
+{
+ private static final long serialVersionUID = 1L;
+
+ /** 鐖惰彍鍗曞悕绉 */
+ private String parentName;
+
+ /** 鐖惰彍鍗旾D */
+ private Long parentId;
+
+ /** 鏄剧ず椤哄簭 */
+ private Integer orderNum;
+
+ /** 绁栫骇鍒楄〃 */
+ private String ancestors;
+
+ /** 瀛愰儴闂 */
+ private List> children = new ArrayList<>();
+
+ public String getParentName()
+ {
+ return parentName;
+ }
+
+ public void setParentName(String parentName)
+ {
+ this.parentName = parentName;
+ }
+
+ public Long getParentId()
+ {
+ return parentId;
+ }
+
+ public void setParentId(Long parentId)
+ {
+ this.parentId = parentId;
+ }
+
+ public Integer getOrderNum()
+ {
+ return orderNum;
+ }
+
+ public void setOrderNum(Integer orderNum)
+ {
+ this.orderNum = orderNum;
+ }
+
+ public String getAncestors()
+ {
+ return ancestors;
+ }
+
+ public void setAncestors(String ancestors)
+ {
+ this.ancestors = ancestors;
+ }
+
+ public List> getChildren()
+ {
+ return children;
+ }
+
+ public void setChildren(List> children)
+ {
+ this.children = children;
+ }
+}
diff --git a/pms-common/src/main/java/tech/unissense/pms/common/core/domain/TreeSelect.java b/pms-common/src/main/java/tech/unissense/pms/common/core/domain/TreeSelect.java
new file mode 100644
index 0000000..ea36196
--- /dev/null
+++ b/pms-common/src/main/java/tech/unissense/pms/common/core/domain/TreeSelect.java
@@ -0,0 +1,77 @@
+package tech.unissense.pms.common.core.domain;
+
+import java.io.Serializable;
+import java.util.List;
+import java.util.stream.Collectors;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import tech.unissense.pms.common.core.domain.entity.SysDept;
+import tech.unissense.pms.common.core.domain.entity.SysMenu;
+
+/**
+ * Treeselect鏍戠粨鏋勫疄浣撶被
+ *
+ * @author ruoyi
+ */
+public class TreeSelect implements Serializable
+{
+ private static final long serialVersionUID = 1L;
+
+ /** 鑺傜偣ID */
+ private Long id;
+
+ /** 鑺傜偣鍚嶇О */
+ private String label;
+
+ /** 瀛愯妭鐐 */
+ @JsonInclude(JsonInclude.Include.NON_EMPTY)
+ private List children;
+
+ public TreeSelect()
+ {
+
+ }
+
+ public TreeSelect(SysDept dept)
+ {
+ this.id = dept.getDeptId();
+ this.label = dept.getDeptName();
+ this.children = dept.getChildren().stream().map(TreeSelect::new).collect(Collectors.toList());
+ }
+
+ public TreeSelect(SysMenu menu)
+ {
+ this.id = menu.getMenuId();
+ this.label = menu.getMenuName();
+ this.children = menu.getChildren().stream().map(TreeSelect::new).collect(Collectors.toList());
+ }
+
+ public Long getId()
+ {
+ return id;
+ }
+
+ public void setId(Long id)
+ {
+ this.id = id;
+ }
+
+ public String getLabel()
+ {
+ return label;
+ }
+
+ public void setLabel(String label)
+ {
+ this.label = label;
+ }
+
+ public List getChildren()
+ {
+ return children;
+ }
+
+ public void setChildren(List children)
+ {
+ this.children = children;
+ }
+}
diff --git a/pms-common/src/main/java/tech/unissense/pms/common/core/domain/entity/SysDept.java b/pms-common/src/main/java/tech/unissense/pms/common/core/domain/entity/SysDept.java
new file mode 100644
index 0000000..9680926
--- /dev/null
+++ b/pms-common/src/main/java/tech/unissense/pms/common/core/domain/entity/SysDept.java
@@ -0,0 +1,203 @@
+package tech.unissense.pms.common.core.domain.entity;
+
+import java.util.ArrayList;
+import java.util.List;
+import javax.validation.constraints.Email;
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
+import javax.validation.constraints.Size;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import tech.unissense.pms.common.core.domain.BaseEntity;
+
+/**
+ * 閮ㄩ棬琛 sys_dept
+ *
+ * @author ruoyi
+ */
+public class SysDept extends BaseEntity
+{
+ private static final long serialVersionUID = 1L;
+
+ /** 閮ㄩ棬ID */
+ private Long deptId;
+
+ /** 鐖堕儴闂↖D */
+ private Long parentId;
+
+ /** 绁栫骇鍒楄〃 */
+ private String ancestors;
+
+ /** 閮ㄩ棬鍚嶇О */
+ private String deptName;
+
+ /** 鏄剧ず椤哄簭 */
+ private Integer orderNum;
+
+ /** 璐熻矗浜 */
+ private String leader;
+
+ /** 鑱旂郴鐢佃瘽 */
+ private String phone;
+
+ /** 閭 */
+ private String email;
+
+ /** 閮ㄩ棬鐘舵:0姝e父,1鍋滅敤 */
+ private String status;
+
+ /** 鍒犻櫎鏍囧織锛0浠h〃瀛樺湪 2浠h〃鍒犻櫎锛 */
+ private String delFlag;
+
+ /** 鐖堕儴闂ㄥ悕绉 */
+ private String parentName;
+
+ /** 瀛愰儴闂 */
+ private List children = new ArrayList();
+
+ public Long getDeptId()
+ {
+ return deptId;
+ }
+
+ public void setDeptId(Long deptId)
+ {
+ this.deptId = deptId;
+ }
+
+ public Long getParentId()
+ {
+ return parentId;
+ }
+
+ public void setParentId(Long parentId)
+ {
+ this.parentId = parentId;
+ }
+
+ public String getAncestors()
+ {
+ return ancestors;
+ }
+
+ public void setAncestors(String ancestors)
+ {
+ this.ancestors = ancestors;
+ }
+
+ @NotBlank(message = "閮ㄩ棬鍚嶇О涓嶈兘涓虹┖")
+ @Size(min = 0, max = 30, message = "閮ㄩ棬鍚嶇О闀垮害涓嶈兘瓒呰繃30涓瓧绗")
+ public String getDeptName()
+ {
+ return deptName;
+ }
+
+ public void setDeptName(String deptName)
+ {
+ this.deptName = deptName;
+ }
+
+ @NotNull(message = "鏄剧ず椤哄簭涓嶈兘涓虹┖")
+ public Integer getOrderNum()
+ {
+ return orderNum;
+ }
+
+ public void setOrderNum(Integer orderNum)
+ {
+ this.orderNum = orderNum;
+ }
+
+ public String getLeader()
+ {
+ return leader;
+ }
+
+ public void setLeader(String leader)
+ {
+ this.leader = leader;
+ }
+
+ @Size(min = 0, max = 11, message = "鑱旂郴鐢佃瘽闀垮害涓嶈兘瓒呰繃11涓瓧绗")
+ public String getPhone()
+ {
+ return phone;
+ }
+
+ public void setPhone(String phone)
+ {
+ this.phone = phone;
+ }
+
+ @Email(message = "閭鏍煎紡涓嶆纭")
+ @Size(min = 0, max = 50, message = "閭闀垮害涓嶈兘瓒呰繃50涓瓧绗")
+ public String getEmail()
+ {
+ return email;
+ }
+
+ public void setEmail(String email)
+ {
+ this.email = email;
+ }
+
+ public String getStatus()
+ {
+ return status;
+ }
+
+ public void setStatus(String status)
+ {
+ this.status = status;
+ }
+
+ public String getDelFlag()
+ {
+ return delFlag;
+ }
+
+ public void setDelFlag(String delFlag)
+ {
+ this.delFlag = delFlag;
+ }
+
+ public String getParentName()
+ {
+ return parentName;
+ }
+
+ public void setParentName(String parentName)
+ {
+ this.parentName = parentName;
+ }
+
+ public List getChildren()
+ {
+ return children;
+ }
+
+ public void setChildren(List children)
+ {
+ this.children = children;
+ }
+
+ @Override
+ public String toString() {
+ return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+ .append("deptId", getDeptId())
+ .append("parentId", getParentId())
+ .append("ancestors", getAncestors())
+ .append("deptName", getDeptName())
+ .append("orderNum", getOrderNum())
+ .append("leader", getLeader())
+ .append("phone", getPhone())
+ .append("email", getEmail())
+ .append("status", getStatus())
+ .append("delFlag", getDelFlag())
+ .append("createBy", getCreateBy())
+ .append("createTime", getCreateTime())
+ .append("updateBy", getUpdateBy())
+ .append("updateTime", getUpdateTime())
+ .toString();
+ }
+}
diff --git a/pms-common/src/main/java/tech/unissense/pms/common/core/domain/entity/SysDictData.java b/pms-common/src/main/java/tech/unissense/pms/common/core/domain/entity/SysDictData.java
new file mode 100644
index 0000000..66677ca
--- /dev/null
+++ b/pms-common/src/main/java/tech/unissense/pms/common/core/domain/entity/SysDictData.java
@@ -0,0 +1,176 @@
+package tech.unissense.pms.common.core.domain.entity;
+
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.Size;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import tech.unissense.pms.common.annotation.Excel;
+import tech.unissense.pms.common.annotation.Excel.ColumnType;
+import tech.unissense.pms.common.constant.UserConstants;
+import tech.unissense.pms.common.core.domain.BaseEntity;
+
+/**
+ * 瀛楀吀鏁版嵁琛 sys_dict_data
+ *
+ * @author ruoyi
+ */
+public class SysDictData extends BaseEntity
+{
+ private static final long serialVersionUID = 1L;
+
+ /** 瀛楀吀缂栫爜 */
+ @Excel(name = "瀛楀吀缂栫爜", cellType = ColumnType.NUMERIC)
+ private Long dictCode;
+
+ /** 瀛楀吀鎺掑簭 */
+ @Excel(name = "瀛楀吀鎺掑簭", cellType = ColumnType.NUMERIC)
+ private Long dictSort;
+
+ /** 瀛楀吀鏍囩 */
+ @Excel(name = "瀛楀吀鏍囩")
+ private String dictLabel;
+
+ /** 瀛楀吀閿 */
+ @Excel(name = "瀛楀吀閿")
+ private String dictValue;
+
+ /** 瀛楀吀绫诲瀷 */
+ @Excel(name = "瀛楀吀绫诲瀷")
+ private String dictType;
+
+ /** 鏍峰紡灞炴э紙鍏朵粬鏍峰紡鎵╁睍锛 */
+ private String cssClass;
+
+ /** 琛ㄦ牸瀛楀吀鏍峰紡 */
+ private String listClass;
+
+ /** 鏄惁榛樿锛圷鏄 N鍚︼級 */
+ @Excel(name = "鏄惁榛樿", readConverterExp = "Y=鏄,N=鍚")
+ private String isDefault;
+
+ /** 鐘舵侊紙0姝e父 1鍋滅敤锛 */
+ @Excel(name = "鐘舵", readConverterExp = "0=姝e父,1=鍋滅敤")
+ private String status;
+
+ public Long getDictCode()
+ {
+ return dictCode;
+ }
+
+ public void setDictCode(Long dictCode)
+ {
+ this.dictCode = dictCode;
+ }
+
+ public Long getDictSort()
+ {
+ return dictSort;
+ }
+
+ public void setDictSort(Long dictSort)
+ {
+ this.dictSort = dictSort;
+ }
+
+ @NotBlank(message = "瀛楀吀鏍囩涓嶈兘涓虹┖")
+ @Size(min = 0, max = 100, message = "瀛楀吀鏍囩闀垮害涓嶈兘瓒呰繃100涓瓧绗")
+ public String getDictLabel()
+ {
+ return dictLabel;
+ }
+
+ public void setDictLabel(String dictLabel)
+ {
+ this.dictLabel = dictLabel;
+ }
+
+ @NotBlank(message = "瀛楀吀閿间笉鑳戒负绌")
+ @Size(min = 0, max = 100, message = "瀛楀吀閿奸暱搴︿笉鑳借秴杩100涓瓧绗")
+ public String getDictValue()
+ {
+ return dictValue;
+ }
+
+ public void setDictValue(String dictValue)
+ {
+ this.dictValue = dictValue;
+ }
+
+ @NotBlank(message = "瀛楀吀绫诲瀷涓嶈兘涓虹┖")
+ @Size(min = 0, max = 100, message = "瀛楀吀绫诲瀷闀垮害涓嶈兘瓒呰繃100涓瓧绗")
+ public String getDictType()
+ {
+ return dictType;
+ }
+
+ public void setDictType(String dictType)
+ {
+ this.dictType = dictType;
+ }
+
+ @Size(min = 0, max = 100, message = "鏍峰紡灞炴ч暱搴︿笉鑳借秴杩100涓瓧绗")
+ public String getCssClass()
+ {
+ return cssClass;
+ }
+
+ public void setCssClass(String cssClass)
+ {
+ this.cssClass = cssClass;
+ }
+
+ public String getListClass()
+ {
+ return listClass;
+ }
+
+ public void setListClass(String listClass)
+ {
+ this.listClass = listClass;
+ }
+
+ public boolean getDefault()
+ {
+ return UserConstants.YES.equals(this.isDefault);
+ }
+
+ public String getIsDefault()
+ {
+ return isDefault;
+ }
+
+ public void setIsDefault(String isDefault)
+ {
+ this.isDefault = isDefault;
+ }
+
+ public String getStatus()
+ {
+ return status;
+ }
+
+ public void setStatus(String status)
+ {
+ this.status = status;
+ }
+
+ @Override
+ public String toString() {
+ return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+ .append("dictCode", getDictCode())
+ .append("dictSort", getDictSort())
+ .append("dictLabel", getDictLabel())
+ .append("dictValue", getDictValue())
+ .append("dictType", getDictType())
+ .append("cssClass", getCssClass())
+ .append("listClass", getListClass())
+ .append("isDefault", getIsDefault())
+ .append("status", getStatus())
+ .append("createBy", getCreateBy())
+ .append("createTime", getCreateTime())
+ .append("updateBy", getUpdateBy())
+ .append("updateTime", getUpdateTime())
+ .append("remark", getRemark())
+ .toString();
+ }
+}
diff --git a/pms-common/src/main/java/tech/unissense/pms/common/core/domain/entity/SysDictType.java b/pms-common/src/main/java/tech/unissense/pms/common/core/domain/entity/SysDictType.java
new file mode 100644
index 0000000..bc1de4d
--- /dev/null
+++ b/pms-common/src/main/java/tech/unissense/pms/common/core/domain/entity/SysDictType.java
@@ -0,0 +1,96 @@
+package tech.unissense.pms.common.core.domain.entity;
+
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.Pattern;
+import javax.validation.constraints.Size;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import tech.unissense.pms.common.annotation.Excel;
+import tech.unissense.pms.common.annotation.Excel.ColumnType;
+import tech.unissense.pms.common.core.domain.BaseEntity;
+
+/**
+ * 瀛楀吀绫诲瀷琛 sys_dict_type
+ *
+ * @author ruoyi
+ */
+public class SysDictType extends BaseEntity
+{
+ private static final long serialVersionUID = 1L;
+
+ /** 瀛楀吀涓婚敭 */
+ @Excel(name = "瀛楀吀涓婚敭", cellType = ColumnType.NUMERIC)
+ private Long dictId;
+
+ /** 瀛楀吀鍚嶇О */
+ @Excel(name = "瀛楀吀鍚嶇О")
+ private String dictName;
+
+ /** 瀛楀吀绫诲瀷 */
+ @Excel(name = "瀛楀吀绫诲瀷")
+ private String dictType;
+
+ /** 鐘舵侊紙0姝e父 1鍋滅敤锛 */
+ @Excel(name = "鐘舵", readConverterExp = "0=姝e父,1=鍋滅敤")
+ private String status;
+
+ public Long getDictId()
+ {
+ return dictId;
+ }
+
+ public void setDictId(Long dictId)
+ {
+ this.dictId = dictId;
+ }
+
+ @NotBlank(message = "瀛楀吀鍚嶇О涓嶈兘涓虹┖")
+ @Size(min = 0, max = 100, message = "瀛楀吀绫诲瀷鍚嶇О闀垮害涓嶈兘瓒呰繃100涓瓧绗")
+ public String getDictName()
+ {
+ return dictName;
+ }
+
+ public void setDictName(String dictName)
+ {
+ this.dictName = dictName;
+ }
+
+ @NotBlank(message = "瀛楀吀绫诲瀷涓嶈兘涓虹┖")
+ @Size(min = 0, max = 100, message = "瀛楀吀绫诲瀷绫诲瀷闀垮害涓嶈兘瓒呰繃100涓瓧绗")
+ @Pattern(regexp = "^[a-z][a-z0-9_]*$", message = "瀛楀吀绫诲瀷蹇呴』浠ュ瓧姣嶅紑澶达紝涓斿彧鑳戒负锛堝皬鍐欏瓧姣嶏紝鏁板瓧锛屼笅婊戠嚎锛")
+ public String getDictType()
+ {
+ return dictType;
+ }
+
+ public void setDictType(String dictType)
+ {
+ this.dictType = dictType;
+ }
+
+ public String getStatus()
+ {
+ return status;
+ }
+
+ public void setStatus(String status)
+ {
+ this.status = status;
+ }
+
+ @Override
+ public String toString() {
+ return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+ .append("dictId", getDictId())
+ .append("dictName", getDictName())
+ .append("dictType", getDictType())
+ .append("status", getStatus())
+ .append("createBy", getCreateBy())
+ .append("createTime", getCreateTime())
+ .append("updateBy", getUpdateBy())
+ .append("updateTime", getUpdateTime())
+ .append("remark", getRemark())
+ .toString();
+ }
+}
diff --git a/pms-common/src/main/java/tech/unissense/pms/common/core/domain/entity/SysMenu.java b/pms-common/src/main/java/tech/unissense/pms/common/core/domain/entity/SysMenu.java
new file mode 100644
index 0000000..7745c86
--- /dev/null
+++ b/pms-common/src/main/java/tech/unissense/pms/common/core/domain/entity/SysMenu.java
@@ -0,0 +1,274 @@
+package tech.unissense.pms.common.core.domain.entity;
+
+import java.util.ArrayList;
+import java.util.List;
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
+import javax.validation.constraints.Size;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import tech.unissense.pms.common.core.domain.BaseEntity;
+
+/**
+ * 鑿滃崟鏉冮檺琛 sys_menu
+ *
+ * @author ruoyi
+ */
+public class SysMenu extends BaseEntity
+{
+ private static final long serialVersionUID = 1L;
+
+ /** 鑿滃崟ID */
+ private Long menuId;
+
+ /** 鑿滃崟鍚嶇О */
+ private String menuName;
+
+ /** 鐖惰彍鍗曞悕绉 */
+ private String parentName;
+
+ /** 鐖惰彍鍗旾D */
+ private Long parentId;
+
+ /** 鏄剧ず椤哄簭 */
+ private Integer orderNum;
+
+ /** 璺敱鍦板潃 */
+ private String path;
+
+ /** 缁勪欢璺緞 */
+ private String component;
+
+ /** 璺敱鍙傛暟 */
+ private String query;
+
+ /** 璺敱鍚嶇О锛岄粯璁ゅ拰璺敱鍦板潃鐩稿悓鐨勯┘宄版牸寮忥紙娉ㄦ剰锛氬洜涓簐ue3鐗堟湰鐨剅outer浼氬垹闄ゅ悕绉扮浉鍚岃矾鐢憋紝涓洪伩鍏嶅悕瀛楃殑鍐茬獊锛岀壒娈婃儏鍐靛彲浠ヨ嚜瀹氫箟锛 */
+ private String routeName;
+
+ /** 鏄惁涓哄閾撅紙0鏄 1鍚︼級 */
+ private String isFrame;
+
+ /** 鏄惁缂撳瓨锛0缂撳瓨 1涓嶇紦瀛橈級 */
+ private String isCache;
+
+ /** 绫诲瀷锛圡鐩綍 C鑿滃崟 F鎸夐挳锛 */
+ private String menuType;
+
+ /** 鏄剧ず鐘舵侊紙0鏄剧ず 1闅愯棌锛 */
+ private String visible;
+
+ /** 鑿滃崟鐘舵侊紙0姝e父 1鍋滅敤锛 */
+ private String status;
+
+ /** 鏉冮檺瀛楃涓 */
+ private String perms;
+
+ /** 鑿滃崟鍥炬爣 */
+ private String icon;
+
+ /** 瀛愯彍鍗 */
+ private List children = new ArrayList();
+
+ public Long getMenuId()
+ {
+ return menuId;
+ }
+
+ public void setMenuId(Long menuId)
+ {
+ this.menuId = menuId;
+ }
+
+ @NotBlank(message = "鑿滃崟鍚嶇О涓嶈兘涓虹┖")
+ @Size(min = 0, max = 50, message = "鑿滃崟鍚嶇О闀垮害涓嶈兘瓒呰繃50涓瓧绗")
+ public String getMenuName()
+ {
+ return menuName;
+ }
+
+ public void setMenuName(String menuName)
+ {
+ this.menuName = menuName;
+ }
+
+ public String getParentName()
+ {
+ return parentName;
+ }
+
+ public void setParentName(String parentName)
+ {
+ this.parentName = parentName;
+ }
+
+ public Long getParentId()
+ {
+ return parentId;
+ }
+
+ public void setParentId(Long parentId)
+ {
+ this.parentId = parentId;
+ }
+
+ @NotNull(message = "鏄剧ず椤哄簭涓嶈兘涓虹┖")
+ public Integer getOrderNum()
+ {
+ return orderNum;
+ }
+
+ public void setOrderNum(Integer orderNum)
+ {
+ this.orderNum = orderNum;
+ }
+
+ @Size(min = 0, max = 200, message = "璺敱鍦板潃涓嶈兘瓒呰繃200涓瓧绗")
+ public String getPath()
+ {
+ return path;
+ }
+
+ public void setPath(String path)
+ {
+ this.path = path;
+ }
+
+ @Size(min = 0, max = 200, message = "缁勪欢璺緞涓嶈兘瓒呰繃255涓瓧绗")
+ public String getComponent()
+ {
+ return component;
+ }
+
+ public void setComponent(String component)
+ {
+ this.component = component;
+ }
+
+ public String getQuery()
+ {
+ return query;
+ }
+
+ public void setQuery(String query)
+ {
+ this.query = query;
+ }
+
+ public String getRouteName()
+ {
+ return routeName;
+ }
+
+ public void setRouteName(String routeName)
+ {
+ this.routeName = routeName;
+ }
+
+ public String getIsFrame()
+ {
+ return isFrame;
+ }
+
+ public void setIsFrame(String isFrame)
+ {
+ this.isFrame = isFrame;
+ }
+
+ public String getIsCache()
+ {
+ return isCache;
+ }
+
+ public void setIsCache(String isCache)
+ {
+ this.isCache = isCache;
+ }
+
+ @NotBlank(message = "鑿滃崟绫诲瀷涓嶈兘涓虹┖")
+ public String getMenuType()
+ {
+ return menuType;
+ }
+
+ public void setMenuType(String menuType)
+ {
+ this.menuType = menuType;
+ }
+
+ public String getVisible()
+ {
+ return visible;
+ }
+
+ public void setVisible(String visible)
+ {
+ this.visible = visible;
+ }
+
+ public String getStatus()
+ {
+ return status;
+ }
+
+ public void setStatus(String status)
+ {
+ this.status = status;
+ }
+
+ @Size(min = 0, max = 100, message = "鏉冮檺鏍囪瘑闀垮害涓嶈兘瓒呰繃100涓瓧绗")
+ public String getPerms()
+ {
+ return perms;
+ }
+
+ public void setPerms(String perms)
+ {
+ this.perms = perms;
+ }
+
+ public String getIcon()
+ {
+ return icon;
+ }
+
+ public void setIcon(String icon)
+ {
+ this.icon = icon;
+ }
+
+ public List getChildren()
+ {
+ return children;
+ }
+
+ public void setChildren(List children)
+ {
+ this.children = children;
+ }
+
+ @Override
+ public String toString() {
+ return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+ .append("menuId", getMenuId())
+ .append("menuName", getMenuName())
+ .append("parentId", getParentId())
+ .append("orderNum", getOrderNum())
+ .append("path", getPath())
+ .append("component", getComponent())
+ .append("query", getQuery())
+ .append("routeName", getRouteName())
+ .append("isFrame", getIsFrame())
+ .append("IsCache", getIsCache())
+ .append("menuType", getMenuType())
+ .append("visible", getVisible())
+ .append("status ", getStatus())
+ .append("perms", getPerms())
+ .append("icon", getIcon())
+ .append("createBy", getCreateBy())
+ .append("createTime", getCreateTime())
+ .append("updateBy", getUpdateBy())
+ .append("updateTime", getUpdateTime())
+ .append("remark", getRemark())
+ .toString();
+ }
+}
diff --git a/pms-common/src/main/java/tech/unissense/pms/common/core/domain/entity/SysRole.java b/pms-common/src/main/java/tech/unissense/pms/common/core/domain/entity/SysRole.java
new file mode 100644
index 0000000..1a8fec7
--- /dev/null
+++ b/pms-common/src/main/java/tech/unissense/pms/common/core/domain/entity/SysRole.java
@@ -0,0 +1,241 @@
+package tech.unissense.pms.common.core.domain.entity;
+
+import java.util.Set;
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
+import javax.validation.constraints.Size;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import tech.unissense.pms.common.annotation.Excel;
+import tech.unissense.pms.common.annotation.Excel.ColumnType;
+import tech.unissense.pms.common.core.domain.BaseEntity;
+
+/**
+ * 瑙掕壊琛 sys_role
+ *
+ * @author ruoyi
+ */
+public class SysRole extends BaseEntity
+{
+ private static final long serialVersionUID = 1L;
+
+ /** 瑙掕壊ID */
+ @Excel(name = "瑙掕壊搴忓彿", cellType = ColumnType.NUMERIC)
+ private Long roleId;
+
+ /** 瑙掕壊鍚嶇О */
+ @Excel(name = "瑙掕壊鍚嶇О")
+ private String roleName;
+
+ /** 瑙掕壊鏉冮檺 */
+ @Excel(name = "瑙掕壊鏉冮檺")
+ private String roleKey;
+
+ /** 瑙掕壊鎺掑簭 */
+ @Excel(name = "瑙掕壊鎺掑簭")
+ private Integer roleSort;
+
+ /** 鏁版嵁鑼冨洿锛1锛氭墍鏈夋暟鎹潈闄愶紱2锛氳嚜瀹氫箟鏁版嵁鏉冮檺锛3锛氭湰閮ㄩ棬鏁版嵁鏉冮檺锛4锛氭湰閮ㄩ棬鍙婁互涓嬫暟鎹潈闄愶紱5锛氫粎鏈汉鏁版嵁鏉冮檺锛 */
+ @Excel(name = "鏁版嵁鑼冨洿", readConverterExp = "1=鎵鏈夋暟鎹潈闄,2=鑷畾涔夋暟鎹潈闄,3=鏈儴闂ㄦ暟鎹潈闄,4=鏈儴闂ㄥ強浠ヤ笅鏁版嵁鏉冮檺,5=浠呮湰浜烘暟鎹潈闄")
+ private String dataScope;
+
+ /** 鑿滃崟鏍戦夋嫨椤规槸鍚﹀叧鑱旀樉绀猴紙 0锛氱埗瀛愪笉浜掔浉鍏宠仈鏄剧ず 1锛氱埗瀛愪簰鐩稿叧鑱旀樉绀猴級 */
+ private boolean menuCheckStrictly;
+
+ /** 閮ㄩ棬鏍戦夋嫨椤规槸鍚﹀叧鑱旀樉绀猴紙0锛氱埗瀛愪笉浜掔浉鍏宠仈鏄剧ず 1锛氱埗瀛愪簰鐩稿叧鑱旀樉绀 锛 */
+ private boolean deptCheckStrictly;
+
+ /** 瑙掕壊鐘舵侊紙0姝e父 1鍋滅敤锛 */
+ @Excel(name = "瑙掕壊鐘舵", readConverterExp = "0=姝e父,1=鍋滅敤")
+ private String status;
+
+ /** 鍒犻櫎鏍囧織锛0浠h〃瀛樺湪 2浠h〃鍒犻櫎锛 */
+ private String delFlag;
+
+ /** 鐢ㄦ埛鏄惁瀛樺湪姝よ鑹叉爣璇 榛樿涓嶅瓨鍦 */
+ private boolean flag = false;
+
+ /** 鑿滃崟缁 */
+ private Long[] menuIds;
+
+ /** 閮ㄩ棬缁勶紙鏁版嵁鏉冮檺锛 */
+ private Long[] deptIds;
+
+ /** 瑙掕壊鑿滃崟鏉冮檺 */
+ private Set permissions;
+
+ public SysRole()
+ {
+
+ }
+
+ public SysRole(Long roleId)
+ {
+ this.roleId = roleId;
+ }
+
+ public Long getRoleId()
+ {
+ return roleId;
+ }
+
+ public void setRoleId(Long roleId)
+ {
+ this.roleId = roleId;
+ }
+
+ public boolean isAdmin()
+ {
+ return isAdmin(this.roleId);
+ }
+
+ public static boolean isAdmin(Long roleId)
+ {
+ return roleId != null && 1L == roleId;
+ }
+
+ @NotBlank(message = "瑙掕壊鍚嶇О涓嶈兘涓虹┖")
+ @Size(min = 0, max = 30, message = "瑙掕壊鍚嶇О闀垮害涓嶈兘瓒呰繃30涓瓧绗")
+ public String getRoleName()
+ {
+ return roleName;
+ }
+
+ public void setRoleName(String roleName)
+ {
+ this.roleName = roleName;
+ }
+
+ @NotBlank(message = "鏉冮檺瀛楃涓嶈兘涓虹┖")
+ @Size(min = 0, max = 100, message = "鏉冮檺瀛楃闀垮害涓嶈兘瓒呰繃100涓瓧绗")
+ public String getRoleKey()
+ {
+ return roleKey;
+ }
+
+ public void setRoleKey(String roleKey)
+ {
+ this.roleKey = roleKey;
+ }
+
+ @NotNull(message = "鏄剧ず椤哄簭涓嶈兘涓虹┖")
+ public Integer getRoleSort()
+ {
+ return roleSort;
+ }
+
+ public void setRoleSort(Integer roleSort)
+ {
+ this.roleSort = roleSort;
+ }
+
+ public String getDataScope()
+ {
+ return dataScope;
+ }
+
+ public void setDataScope(String dataScope)
+ {
+ this.dataScope = dataScope;
+ }
+
+ public boolean isMenuCheckStrictly()
+ {
+ return menuCheckStrictly;
+ }
+
+ public void setMenuCheckStrictly(boolean menuCheckStrictly)
+ {
+ this.menuCheckStrictly = menuCheckStrictly;
+ }
+
+ public boolean isDeptCheckStrictly()
+ {
+ return deptCheckStrictly;
+ }
+
+ public void setDeptCheckStrictly(boolean deptCheckStrictly)
+ {
+ this.deptCheckStrictly = deptCheckStrictly;
+ }
+
+ public String getStatus()
+ {
+ return status;
+ }
+
+ public void setStatus(String status)
+ {
+ this.status = status;
+ }
+
+ public String getDelFlag()
+ {
+ return delFlag;
+ }
+
+ public void setDelFlag(String delFlag)
+ {
+ this.delFlag = delFlag;
+ }
+
+ public boolean isFlag()
+ {
+ return flag;
+ }
+
+ public void setFlag(boolean flag)
+ {
+ this.flag = flag;
+ }
+
+ public Long[] getMenuIds()
+ {
+ return menuIds;
+ }
+
+ public void setMenuIds(Long[] menuIds)
+ {
+ this.menuIds = menuIds;
+ }
+
+ public Long[] getDeptIds()
+ {
+ return deptIds;
+ }
+
+ public void setDeptIds(Long[] deptIds)
+ {
+ this.deptIds = deptIds;
+ }
+
+ public Set getPermissions()
+ {
+ return permissions;
+ }
+
+ public void setPermissions(Set permissions)
+ {
+ this.permissions = permissions;
+ }
+
+ @Override
+ public String toString() {
+ return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+ .append("roleId", getRoleId())
+ .append("roleName", getRoleName())
+ .append("roleKey", getRoleKey())
+ .append("roleSort", getRoleSort())
+ .append("dataScope", getDataScope())
+ .append("menuCheckStrictly", isMenuCheckStrictly())
+ .append("deptCheckStrictly", isDeptCheckStrictly())
+ .append("status", getStatus())
+ .append("delFlag", getDelFlag())
+ .append("createBy", getCreateBy())
+ .append("createTime", getCreateTime())
+ .append("updateBy", getUpdateBy())
+ .append("updateTime", getUpdateTime())
+ .append("remark", getRemark())
+ .toString();
+ }
+}
diff --git a/pms-common/src/main/java/tech/unissense/pms/common/core/domain/entity/SysUser.java b/pms-common/src/main/java/tech/unissense/pms/common/core/domain/entity/SysUser.java
new file mode 100644
index 0000000..d4398bb
--- /dev/null
+++ b/pms-common/src/main/java/tech/unissense/pms/common/core/domain/entity/SysUser.java
@@ -0,0 +1,333 @@
+package tech.unissense.pms.common.core.domain.entity;
+
+import java.util.Date;
+import java.util.List;
+import javax.validation.constraints.*;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import tech.unissense.pms.common.annotation.Excel;
+import tech.unissense.pms.common.annotation.Excel.ColumnType;
+import tech.unissense.pms.common.annotation.Excel.Type;
+import tech.unissense.pms.common.annotation.Excels;
+import tech.unissense.pms.common.core.domain.BaseEntity;
+import tech.unissense.pms.common.xss.Xss;
+
+/**
+ * 鐢ㄦ埛瀵硅薄 sys_user
+ *
+ * @author ruoyi
+ */
+public class SysUser extends BaseEntity
+{
+ private static final long serialVersionUID = 1L;
+
+ /** 鐢ㄦ埛ID */
+ @Excel(name = "鐢ㄦ埛搴忓彿", type = Type.EXPORT, cellType = ColumnType.NUMERIC, prompt = "鐢ㄦ埛缂栧彿")
+ private Long userId;
+
+ /** 閮ㄩ棬ID */
+ @Excel(name = "閮ㄩ棬缂栧彿", type = Type.IMPORT)
+ private Long deptId;
+
+ /** 鐢ㄦ埛璐﹀彿 */
+ @Excel(name = "鐧诲綍鍚嶇О")
+ private String userName;
+
+ /** 鐢ㄦ埛鏄电О */
+ @Excel(name = "鐢ㄦ埛鍚嶇О")
+ private String nickName;
+
+ /** 鐢ㄦ埛閭 */
+ @Excel(name = "鐢ㄦ埛閭")
+ private String email;
+
+ /** 鎵嬫満鍙风爜 */
+ @Excel(name = "鎵嬫満鍙风爜", cellType = ColumnType.TEXT)
+ private String phonenumber;
+
+ /** 鐢ㄦ埛鎬у埆 */
+ @Excel(name = "鐢ㄦ埛鎬у埆", readConverterExp = "0=鐢,1=濂,2=鏈煡")
+ private String sex;
+
+ /** 鐢ㄦ埛澶村儚 */
+ private String avatar;
+
+ /** 瀵嗙爜 */
+ private String password;
+
+ /** 甯愬彿鐘舵侊紙0姝e父 1鍋滅敤锛 */
+ @Excel(name = "甯愬彿鐘舵", readConverterExp = "0=姝e父,1=鍋滅敤")
+ private String status;
+
+ /** 鍒犻櫎鏍囧織锛0浠h〃瀛樺湪 2浠h〃鍒犻櫎锛 */
+ private String delFlag;
+
+ /** 鏈鍚庣櫥褰旾P */
+ @Excel(name = "鏈鍚庣櫥褰旾P", type = Type.EXPORT)
+ private String loginIp;
+
+ /** 鏈鍚庣櫥褰曟椂闂 */
+ @Excel(name = "鏈鍚庣櫥褰曟椂闂", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss", type = Type.EXPORT)
+ private Date loginDate;
+ private Integer tenantId;
+
+ /** 閮ㄩ棬瀵硅薄 */
+ @Excels({
+ @Excel(name = "閮ㄩ棬鍚嶇О", targetAttr = "deptName", type = Type.EXPORT),
+ @Excel(name = "閮ㄩ棬璐熻矗浜", targetAttr = "leader", type = Type.EXPORT)
+ })
+ private SysDept dept;
+
+ /** 瑙掕壊瀵硅薄 */
+ private List roles;
+
+ /** 瑙掕壊缁 */
+ private Long[] roleIds;
+
+ /** 宀椾綅缁 */
+ private Long[] postIds;
+
+ /** 瑙掕壊ID */
+ private Long roleId;
+
+ public SysUser()
+ {
+
+ }
+
+ public Integer getTenantId() {
+ return tenantId;
+ }
+
+ public void setTenantId(Integer tenantId) {
+ this.tenantId = tenantId;
+ }
+
+ public SysUser(Long userId)
+ {
+ this.userId = userId;
+ }
+
+ public Long getUserId()
+ {
+ return userId;
+ }
+
+ public void setUserId(Long userId)
+ {
+ this.userId = userId;
+ }
+
+ public boolean isAdmin()
+ {
+ return isAdmin(this.userId);
+ }
+
+ public static boolean isAdmin(Long userId)
+ {
+ return userId != null && 1L == userId;
+ }
+
+ public Long getDeptId()
+ {
+ return deptId;
+ }
+
+ public void setDeptId(Long deptId)
+ {
+ this.deptId = deptId;
+ }
+
+ @Xss(message = "鐢ㄦ埛鏄电О涓嶈兘鍖呭惈鑴氭湰瀛楃")
+ @Size(min = 0, max = 30, message = "鐢ㄦ埛鏄电О闀垮害涓嶈兘瓒呰繃30涓瓧绗")
+ public String getNickName()
+ {
+ return nickName;
+ }
+
+ public void setNickName(String nickName)
+ {
+ this.nickName = nickName;
+ }
+
+ @Xss(message = "鐢ㄦ埛璐﹀彿涓嶈兘鍖呭惈鑴氭湰瀛楃")
+ @NotBlank(message = "鐢ㄦ埛璐﹀彿涓嶈兘涓虹┖")
+ @Size(min = 0, max = 30, message = "鐢ㄦ埛璐﹀彿闀垮害涓嶈兘瓒呰繃30涓瓧绗")
+ public String getUserName()
+ {
+ return userName;
+ }
+
+ public void setUserName(String userName)
+ {
+ this.userName = userName;
+ }
+
+ @Email(message = "閭鏍煎紡涓嶆纭")
+ @Size(min = 0, max = 50, message = "閭闀垮害涓嶈兘瓒呰繃50涓瓧绗")
+ public String getEmail()
+ {
+ return email;
+ }
+
+ public void setEmail(String email)
+ {
+ this.email = email;
+ }
+
+ @Size(min = 0, max = 11, message = "鎵嬫満鍙风爜闀垮害涓嶈兘瓒呰繃11涓瓧绗")
+ public String getPhonenumber()
+ {
+ return phonenumber;
+ }
+
+ public void setPhonenumber(String phonenumber)
+ {
+ this.phonenumber = phonenumber;
+ }
+
+ public String getSex()
+ {
+ return sex;
+ }
+
+ public void setSex(String sex)
+ {
+ this.sex = sex;
+ }
+
+ public String getAvatar()
+ {
+ return avatar;
+ }
+
+ public void setAvatar(String avatar)
+ {
+ this.avatar = avatar;
+ }
+
+ public String getPassword()
+ {
+ return password;
+ }
+
+ public void setPassword(String password)
+ {
+ this.password = password;
+ }
+
+ public String getStatus()
+ {
+ return status;
+ }
+
+ public void setStatus(String status)
+ {
+ this.status = status;
+ }
+
+ public String getDelFlag()
+ {
+ return delFlag;
+ }
+
+ public void setDelFlag(String delFlag)
+ {
+ this.delFlag = delFlag;
+ }
+
+ public String getLoginIp()
+ {
+ return loginIp;
+ }
+
+ public void setLoginIp(String loginIp)
+ {
+ this.loginIp = loginIp;
+ }
+
+ public Date getLoginDate()
+ {
+ return loginDate;
+ }
+
+ public void setLoginDate(Date loginDate)
+ {
+ this.loginDate = loginDate;
+ }
+
+ public SysDept getDept()
+ {
+ return dept;
+ }
+
+ public void setDept(SysDept dept)
+ {
+ this.dept = dept;
+ }
+
+ public List getRoles()
+ {
+ return roles;
+ }
+
+ public void setRoles(List roles)
+ {
+ this.roles = roles;
+ }
+
+ public Long[] getRoleIds()
+ {
+ return roleIds;
+ }
+
+ public void setRoleIds(Long[] roleIds)
+ {
+ this.roleIds = roleIds;
+ }
+
+ public Long[] getPostIds()
+ {
+ return postIds;
+ }
+
+ public void setPostIds(Long[] postIds)
+ {
+ this.postIds = postIds;
+ }
+
+ public Long getRoleId()
+ {
+ return roleId;
+ }
+
+ public void setRoleId(Long roleId)
+ {
+ this.roleId = roleId;
+ }
+
+ @Override
+ public String toString() {
+ return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+ .append("userId", getUserId())
+ .append("deptId", getDeptId())
+ .append("userName", getUserName())
+ .append("nickName", getNickName())
+ .append("email", getEmail())
+ .append("phonenumber", getPhonenumber())
+ .append("sex", getSex())
+ .append("avatar", getAvatar())
+ .append("password", getPassword())
+ .append("status", getStatus())
+ .append("delFlag", getDelFlag())
+ .append("loginIp", getLoginIp())
+ .append("loginDate", getLoginDate())
+ .append("createBy", getCreateBy())
+ .append("createTime", getCreateTime())
+ .append("updateBy", getUpdateBy())
+ .append("updateTime", getUpdateTime())
+ .append("remark", getRemark())
+ .append("dept", getDept())
+ .toString();
+ }
+}
diff --git a/pms-common/src/main/java/tech/unissense/pms/common/core/domain/model/LoginBody.java b/pms-common/src/main/java/tech/unissense/pms/common/core/domain/model/LoginBody.java
new file mode 100644
index 0000000..afae127
--- /dev/null
+++ b/pms-common/src/main/java/tech/unissense/pms/common/core/domain/model/LoginBody.java
@@ -0,0 +1,69 @@
+package tech.unissense.pms.common.core.domain.model;
+
+/**
+ * 鐢ㄦ埛鐧诲綍瀵硅薄
+ *
+ * @author ruoyi
+ */
+public class LoginBody
+{
+ /**
+ * 鐢ㄦ埛鍚
+ */
+ private String username;
+
+ /**
+ * 鐢ㄦ埛瀵嗙爜
+ */
+ private String password;
+
+ /**
+ * 楠岃瘉鐮
+ */
+ private String code;
+
+ /**
+ * 鍞竴鏍囪瘑
+ */
+ private String uuid;
+
+ public String getUsername()
+ {
+ return username;
+ }
+
+ public void setUsername(String username)
+ {
+ this.username = username;
+ }
+
+ public String getPassword()
+ {
+ return password;
+ }
+
+ public void setPassword(String password)
+ {
+ this.password = password;
+ }
+
+ public String getCode()
+ {
+ return code;
+ }
+
+ public void setCode(String code)
+ {
+ this.code = code;
+ }
+
+ public String getUuid()
+ {
+ return uuid;
+ }
+
+ public void setUuid(String uuid)
+ {
+ this.uuid = uuid;
+ }
+}
diff --git a/pms-common/src/main/java/tech/unissense/pms/common/core/domain/model/LoginUser.java b/pms-common/src/main/java/tech/unissense/pms/common/core/domain/model/LoginUser.java
new file mode 100644
index 0000000..674ab0f
--- /dev/null
+++ b/pms-common/src/main/java/tech/unissense/pms/common/core/domain/model/LoginUser.java
@@ -0,0 +1,278 @@
+package tech.unissense.pms.common.core.domain.model;
+
+import com.alibaba.fastjson2.annotation.JSONField;
+import tech.unissense.pms.common.core.domain.entity.SysUser;
+import org.springframework.security.core.GrantedAuthority;
+import org.springframework.security.core.userdetails.UserDetails;
+import java.util.Collection;
+import java.util.Set;
+
+/**
+ * 鐧诲綍鐢ㄦ埛韬唤鏉冮檺
+ *
+ * @author ruoyi
+ */
+public class LoginUser implements UserDetails
+{
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * 鐢ㄦ埛ID
+ */
+ private Long userId;
+
+ /**
+ * 閮ㄩ棬ID
+ */
+ private Long deptId;
+ /**
+ * 閮ㄩ棬ID
+ */
+ private Long tenantId;
+
+ /**
+ * 鐢ㄦ埛鍞竴鏍囪瘑
+ */
+ private String token;
+
+ /**
+ * 鐧诲綍鏃堕棿
+ */
+ private Long loginTime;
+
+ /**
+ * 杩囨湡鏃堕棿
+ */
+ private Long expireTime;
+
+ /**
+ * 鐧诲綍IP鍦板潃
+ */
+ private String ipaddr;
+
+ /**
+ * 鐧诲綍鍦扮偣
+ */
+ private String loginLocation;
+
+ /**
+ * 娴忚鍣ㄧ被鍨
+ */
+ private String browser;
+
+ /**
+ * 鎿嶄綔绯荤粺
+ */
+ private String os;
+
+ /**
+ * 鏉冮檺鍒楄〃
+ */
+ private Set permissions;
+
+ /**
+ * 鐢ㄦ埛淇℃伅
+ */
+ private SysUser user;
+
+ public Long getTenantId() {
+ return tenantId;
+ }
+
+ public void setTenantId(Long tenantId) {
+ this.tenantId = tenantId;
+ }
+
+ public LoginUser()
+ {
+ }
+
+ public LoginUser(SysUser user, Set permissions)
+ {
+ this.user = user;
+ this.permissions = permissions;
+ }
+
+ public LoginUser(Long userId, Long deptId, SysUser user, Set permissions)
+ {
+ this.userId = userId;
+ this.deptId = deptId;
+ this.user = user;
+ this.permissions = permissions;
+ }
+
+ public Long getUserId()
+ {
+ return userId;
+ }
+
+ public void setUserId(Long userId)
+ {
+ this.userId = userId;
+ }
+
+ public Long getDeptId()
+ {
+ return deptId;
+ }
+
+ public void setDeptId(Long deptId)
+ {
+ this.deptId = deptId;
+ }
+
+ public String getToken()
+ {
+ return token;
+ }
+
+ public void setToken(String token)
+ {
+ this.token = token;
+ }
+
+ @JSONField(serialize = false)
+ @Override
+ public String getPassword()
+ {
+ return user.getPassword();
+ }
+
+ @Override
+ public String getUsername()
+ {
+ return user.getUserName();
+ }
+
+ /**
+ * 璐︽埛鏄惁鏈繃鏈,杩囨湡鏃犳硶楠岃瘉
+ */
+ @JSONField(serialize = false)
+ @Override
+ public boolean isAccountNonExpired()
+ {
+ return true;
+ }
+
+ /**
+ * 鎸囧畾鐢ㄦ埛鏄惁瑙i攣,閿佸畾鐨勭敤鎴锋棤娉曡繘琛岃韩浠介獙璇
+ *
+ * @return
+ */
+ @JSONField(serialize = false)
+ @Override
+ public boolean isAccountNonLocked()
+ {
+ return true;
+ }
+
+ /**
+ * 鎸囩ず鏄惁宸茶繃鏈熺殑鐢ㄦ埛鐨勫嚟鎹(瀵嗙爜),杩囨湡鐨勫嚟鎹槻姝㈣璇
+ *
+ * @return
+ */
+ @JSONField(serialize = false)
+ @Override
+ public boolean isCredentialsNonExpired()
+ {
+ return true;
+ }
+
+ /**
+ * 鏄惁鍙敤 ,绂佺敤鐨勭敤鎴蜂笉鑳借韩浠介獙璇
+ *
+ * @return
+ */
+ @JSONField(serialize = false)
+ @Override
+ public boolean isEnabled()
+ {
+ return true;
+ }
+
+ public Long getLoginTime()
+ {
+ return loginTime;
+ }
+
+ public void setLoginTime(Long loginTime)
+ {
+ this.loginTime = loginTime;
+ }
+
+ public String getIpaddr()
+ {
+ return ipaddr;
+ }
+
+ public void setIpaddr(String ipaddr)
+ {
+ this.ipaddr = ipaddr;
+ }
+
+ public String getLoginLocation()
+ {
+ return loginLocation;
+ }
+
+ public void setLoginLocation(String loginLocation)
+ {
+ this.loginLocation = loginLocation;
+ }
+
+ public String getBrowser()
+ {
+ return browser;
+ }
+
+ public void setBrowser(String browser)
+ {
+ this.browser = browser;
+ }
+
+ public String getOs()
+ {
+ return os;
+ }
+
+ public void setOs(String os)
+ {
+ this.os = os;
+ }
+
+ public Long getExpireTime()
+ {
+ return expireTime;
+ }
+
+ public void setExpireTime(Long expireTime)
+ {
+ this.expireTime = expireTime;
+ }
+
+ public Set getPermissions()
+ {
+ return permissions;
+ }
+
+ public void setPermissions(Set permissions)
+ {
+ this.permissions = permissions;
+ }
+
+ public SysUser getUser()
+ {
+ return user;
+ }
+
+ public void setUser(SysUser user)
+ {
+ this.user = user;
+ }
+
+ @Override
+ public Collection extends GrantedAuthority> getAuthorities()
+ {
+ return null;
+ }
+}
diff --git a/pms-common/src/main/java/tech/unissense/pms/common/core/domain/model/RegisterBody.java b/pms-common/src/main/java/tech/unissense/pms/common/core/domain/model/RegisterBody.java
new file mode 100644
index 0000000..dd17d87
--- /dev/null
+++ b/pms-common/src/main/java/tech/unissense/pms/common/core/domain/model/RegisterBody.java
@@ -0,0 +1,11 @@
+package tech.unissense.pms.common.core.domain.model;
+
+/**
+ * 鐢ㄦ埛娉ㄥ唽瀵硅薄
+ *
+ * @author ruoyi
+ */
+public class RegisterBody extends LoginBody
+{
+
+}
diff --git a/pms-common/src/main/java/tech/unissense/pms/common/core/page/PageDomain.java b/pms-common/src/main/java/tech/unissense/pms/common/core/page/PageDomain.java
new file mode 100644
index 0000000..a3ae5d5
--- /dev/null
+++ b/pms-common/src/main/java/tech/unissense/pms/common/core/page/PageDomain.java
@@ -0,0 +1,101 @@
+package tech.unissense.pms.common.core.page;
+
+import tech.unissense.pms.common.utils.StringUtils;
+
+/**
+ * 鍒嗛〉鏁版嵁
+ *
+ * @author ruoyi
+ */
+public class PageDomain
+{
+ /** 褰撳墠璁板綍璧峰绱㈠紩 */
+ private Integer pageNum;
+
+ /** 姣忛〉鏄剧ず璁板綍鏁 */
+ private Integer pageSize;
+
+ /** 鎺掑簭鍒 */
+ private String orderByColumn;
+
+ /** 鎺掑簭鐨勬柟鍚慸esc鎴栬卆sc */
+ private String isAsc = "asc";
+
+ /** 鍒嗛〉鍙傛暟鍚堢悊鍖 */
+ private Boolean reasonable = true;
+
+ public String getOrderBy()
+ {
+ if (StringUtils.isEmpty(orderByColumn))
+ {
+ return "";
+ }
+ return StringUtils.toUnderScoreCase(orderByColumn) + " " + isAsc;
+ }
+
+ public Integer getPageNum()
+ {
+ return pageNum;
+ }
+
+ public void setPageNum(Integer pageNum)
+ {
+ this.pageNum = pageNum;
+ }
+
+ public Integer getPageSize()
+ {
+ return pageSize;
+ }
+
+ public void setPageSize(Integer pageSize)
+ {
+ this.pageSize = pageSize;
+ }
+
+ public String getOrderByColumn()
+ {
+ return orderByColumn;
+ }
+
+ public void setOrderByColumn(String orderByColumn)
+ {
+ this.orderByColumn = orderByColumn;
+ }
+
+ public String getIsAsc()
+ {
+ return isAsc;
+ }
+
+ public void setIsAsc(String isAsc)
+ {
+ if (StringUtils.isNotEmpty(isAsc))
+ {
+ // 鍏煎鍓嶇鎺掑簭绫诲瀷
+ if ("ascending".equals(isAsc))
+ {
+ isAsc = "asc";
+ }
+ else if ("descending".equals(isAsc))
+ {
+ isAsc = "desc";
+ }
+ this.isAsc = isAsc;
+ }
+ }
+
+ public Boolean getReasonable()
+ {
+ if (StringUtils.isNull(reasonable))
+ {
+ return Boolean.TRUE;
+ }
+ return reasonable;
+ }
+
+ public void setReasonable(Boolean reasonable)
+ {
+ this.reasonable = reasonable;
+ }
+}
diff --git a/pms-common/src/main/java/tech/unissense/pms/common/core/page/TableDataInfo.java b/pms-common/src/main/java/tech/unissense/pms/common/core/page/TableDataInfo.java
new file mode 100644
index 0000000..a8077a3
--- /dev/null
+++ b/pms-common/src/main/java/tech/unissense/pms/common/core/page/TableDataInfo.java
@@ -0,0 +1,85 @@
+package tech.unissense.pms.common.core.page;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * 琛ㄦ牸鍒嗛〉鏁版嵁瀵硅薄
+ *
+ * @author ruoyi
+ */
+public class TableDataInfo implements Serializable
+{
+ private static final long serialVersionUID = 1L;
+
+ /** 鎬昏褰曟暟 */
+ private long total;
+
+ /** 鍒楄〃鏁版嵁 */
+ private List> rows;
+
+ /** 娑堟伅鐘舵佺爜 */
+ private int code;
+
+ /** 娑堟伅鍐呭 */
+ private String msg;
+
+ /**
+ * 琛ㄦ牸鏁版嵁瀵硅薄
+ */
+ public TableDataInfo()
+ {
+ }
+
+ /**
+ * 鍒嗛〉
+ *
+ * @param list 鍒楄〃鏁版嵁
+ * @param total 鎬昏褰曟暟
+ */
+ public TableDataInfo(List> list, int total)
+ {
+ this.rows = list;
+ this.total = total;
+ }
+
+ public long getTotal()
+ {
+ return total;
+ }
+
+ public void setTotal(long total)
+ {
+ this.total = total;
+ }
+
+ public List> getRows()
+ {
+ return rows;
+ }
+
+ public void setRows(List> rows)
+ {
+ this.rows = rows;
+ }
+
+ public int getCode()
+ {
+ return code;
+ }
+
+ public void setCode(int code)
+ {
+ this.code = code;
+ }
+
+ public String getMsg()
+ {
+ return msg;
+ }
+
+ public void setMsg(String msg)
+ {
+ this.msg = msg;
+ }
+}
diff --git a/pms-common/src/main/java/tech/unissense/pms/common/core/page/TableSupport.java b/pms-common/src/main/java/tech/unissense/pms/common/core/page/TableSupport.java
new file mode 100644
index 0000000..c2de8e8
--- /dev/null
+++ b/pms-common/src/main/java/tech/unissense/pms/common/core/page/TableSupport.java
@@ -0,0 +1,78 @@
+package tech.unissense.pms.common.core.page;
+
+import com.alibaba.fastjson2.JSONObject;
+import org.apache.commons.io.IOUtils;
+import tech.unissense.pms.common.core.text.Convert;
+import tech.unissense.pms.common.utils.ServletUtils;
+import tech.unissense.pms.common.utils.StringUtils;
+
+import java.io.IOException;
+
+/**
+ * 琛ㄦ牸鏁版嵁澶勭悊
+ *
+ * @author ruoyi
+ */
+public class TableSupport
+{
+ /**
+ * 褰撳墠璁板綍璧峰绱㈠紩
+ */
+ public static final String PAGE_NUM = "pageNum";
+
+ /**
+ * 姣忛〉鏄剧ず璁板綍鏁
+ */
+ public static final String PAGE_SIZE = "pageSize";
+
+ /**
+ * 鎺掑簭鍒
+ */
+ public static final String ORDER_BY_COLUMN = "orderByColumn";
+
+ /**
+ * 鎺掑簭鐨勬柟鍚 "desc" 鎴栬 "asc".
+ */
+ public static final String IS_ASC = "isAsc";
+
+ /**
+ * 鍒嗛〉鍙傛暟鍚堢悊鍖
+ */
+ public static final String REASONABLE = "reasonable";
+
+ /**
+ * 灏佽鍒嗛〉瀵硅薄
+ */
+ public static PageDomain getPageDomain()
+ {
+ String body = null;
+ try {
+ body = new String(IOUtils.toByteArray((ServletUtils.getRequest().getInputStream()))).replaceAll("\t|\n|\r", "");
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ JSONObject paramMap = StringUtils.isNotBlank(body)?JSONObject.parseObject(body):new JSONObject();
+
+ Integer pageSize = ServletUtils.getParameterToInt(PAGE_SIZE);
+ Integer pageNum = ServletUtils.getParameterToInt(PAGE_NUM);
+ if(paramMap.getIntValue(PAGE_NUM) > 0){
+ pageNum = paramMap.getIntValue(PAGE_NUM);
+ }
+ if(paramMap.getIntValue(PAGE_SIZE) > 0){
+ pageSize = paramMap.getIntValue(PAGE_SIZE);
+ }
+
+ PageDomain pageDomain = new PageDomain();
+ pageDomain.setPageNum(pageNum);
+ pageDomain.setPageSize(pageSize);
+ pageDomain.setOrderByColumn(StringUtils.isNotBlank(paramMap.getString(ORDER_BY_COLUMN))?paramMap.getString(ORDER_BY_COLUMN):ServletUtils.getParameter(ORDER_BY_COLUMN));
+ pageDomain.setIsAsc(StringUtils.isNotBlank(paramMap.getString(IS_ASC))?paramMap.getString(IS_ASC):ServletUtils.getParameter(IS_ASC));
+ pageDomain.setReasonable(ServletUtils.getParameterToBool(REASONABLE));
+ return pageDomain;
+ }
+
+ public static PageDomain buildPageRequest()
+ {
+ return getPageDomain();
+ }
+}
diff --git a/pms-common/src/main/java/tech/unissense/pms/common/core/redis/RedisCache.java b/pms-common/src/main/java/tech/unissense/pms/common/core/redis/RedisCache.java
new file mode 100644
index 0000000..bb5ba9e
--- /dev/null
+++ b/pms-common/src/main/java/tech/unissense/pms/common/core/redis/RedisCache.java
@@ -0,0 +1,268 @@
+package tech.unissense.pms.common.core.redis;
+
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.TimeUnit;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.redis.core.BoundSetOperations;
+import org.springframework.data.redis.core.HashOperations;
+import org.springframework.data.redis.core.RedisTemplate;
+import org.springframework.data.redis.core.ValueOperations;
+import org.springframework.stereotype.Component;
+
+/**
+ * spring redis 宸ュ叿绫
+ *
+ * @author ruoyi
+ **/
+@SuppressWarnings(value = { "unchecked", "rawtypes" })
+@Component
+public class RedisCache
+{
+ @Autowired
+ public RedisTemplate redisTemplate;
+
+ /**
+ * 缂撳瓨鍩烘湰鐨勫璞★紝Integer銆丼tring銆佸疄浣撶被绛
+ *
+ * @param key 缂撳瓨鐨勯敭鍊
+ * @param value 缂撳瓨鐨勫
+ */
+ public void setCacheObject(final String key, final T value)
+ {
+ redisTemplate.opsForValue().set(key, value);
+ }
+
+ /**
+ * 缂撳瓨鍩烘湰鐨勫璞★紝Integer銆丼tring銆佸疄浣撶被绛
+ *
+ * @param key 缂撳瓨鐨勯敭鍊
+ * @param value 缂撳瓨鐨勫
+ * @param timeout 鏃堕棿
+ * @param timeUnit 鏃堕棿棰楃矑搴
+ */
+ public void setCacheObject(final String key, final T value, final Integer timeout, final TimeUnit timeUnit)
+ {
+ redisTemplate.opsForValue().set(key, value, timeout, timeUnit);
+ }
+
+ /**
+ * 璁剧疆鏈夋晥鏃堕棿
+ *
+ * @param key Redis閿
+ * @param timeout 瓒呮椂鏃堕棿
+ * @return true=璁剧疆鎴愬姛锛沠alse=璁剧疆澶辫触
+ */
+ public boolean expire(final String key, final long timeout)
+ {
+ return expire(key, timeout, TimeUnit.SECONDS);
+ }
+
+ /**
+ * 璁剧疆鏈夋晥鏃堕棿
+ *
+ * @param key Redis閿
+ * @param timeout 瓒呮椂鏃堕棿
+ * @param unit 鏃堕棿鍗曚綅
+ * @return true=璁剧疆鎴愬姛锛沠alse=璁剧疆澶辫触
+ */
+ public boolean expire(final String key, final long timeout, final TimeUnit unit)
+ {
+ return redisTemplate.expire(key, timeout, unit);
+ }
+
+ /**
+ * 鑾峰彇鏈夋晥鏃堕棿
+ *
+ * @param key Redis閿
+ * @return 鏈夋晥鏃堕棿
+ */
+ public long getExpire(final String key)
+ {
+ return redisTemplate.getExpire(key);
+ }
+
+ /**
+ * 鍒ゆ柇 key鏄惁瀛樺湪
+ *
+ * @param key 閿
+ * @return true 瀛樺湪 false涓嶅瓨鍦
+ */
+ public Boolean hasKey(String key)
+ {
+ return redisTemplate.hasKey(key);
+ }
+
+ /**
+ * 鑾峰緱缂撳瓨鐨勫熀鏈璞°
+ *
+ * @param key 缂撳瓨閿
+ * @return 缂撳瓨閿煎搴旂殑鏁版嵁
+ */
+ public T getCacheObject(final String key)
+ {
+ ValueOperations operation = redisTemplate.opsForValue();
+ return operation.get(key);
+ }
+
+ /**
+ * 鍒犻櫎鍗曚釜瀵硅薄
+ *
+ * @param key
+ */
+ public boolean deleteObject(final String key)
+ {
+ return redisTemplate.delete(key);
+ }
+
+ /**
+ * 鍒犻櫎闆嗗悎瀵硅薄
+ *
+ * @param collection 澶氫釜瀵硅薄
+ * @return
+ */
+ public boolean deleteObject(final Collection collection)
+ {
+ return redisTemplate.delete(collection) > 0;
+ }
+
+ /**
+ * 缂撳瓨List鏁版嵁
+ *
+ * @param key 缂撳瓨鐨勯敭鍊
+ * @param dataList 寰呯紦瀛樼殑List鏁版嵁
+ * @return 缂撳瓨鐨勫璞
+ */
+ public long setCacheList(final String key, final List dataList)
+ {
+ Long count = redisTemplate.opsForList().rightPushAll(key, dataList);
+ return count == null ? 0 : count;
+ }
+
+ /**
+ * 鑾峰緱缂撳瓨鐨刲ist瀵硅薄
+ *
+ * @param key 缂撳瓨鐨勯敭鍊
+ * @return 缂撳瓨閿煎搴旂殑鏁版嵁
+ */
+ public List getCacheList(final String key)
+ {
+ return redisTemplate.opsForList().range(key, 0, -1);
+ }
+
+ /**
+ * 缂撳瓨Set
+ *
+ * @param key 缂撳瓨閿
+ * @param dataSet 缂撳瓨鐨勬暟鎹
+ * @return 缂撳瓨鏁版嵁鐨勫璞
+ */
+ public BoundSetOperations setCacheSet(final String key, final Set dataSet)
+ {
+ BoundSetOperations setOperation = redisTemplate.boundSetOps(key);
+ Iterator it = dataSet.iterator();
+ while (it.hasNext())
+ {
+ setOperation.add(it.next());
+ }
+ return setOperation;
+ }
+
+ /**
+ * 鑾峰緱缂撳瓨鐨剆et
+ *
+ * @param key
+ * @return
+ */
+ public Set getCacheSet(final String key)
+ {
+ return redisTemplate.opsForSet().members(key);
+ }
+
+ /**
+ * 缂撳瓨Map
+ *
+ * @param key
+ * @param dataMap
+ */
+ public void setCacheMap(final String key, final Map dataMap)
+ {
+ if (dataMap != null) {
+ redisTemplate.opsForHash().putAll(key, dataMap);
+ }
+ }
+
+ /**
+ * 鑾峰緱缂撳瓨鐨凪ap
+ *
+ * @param key
+ * @return
+ */
+ public Map getCacheMap(final String key)
+ {
+ return redisTemplate.opsForHash().entries(key);
+ }
+
+ /**
+ * 寰Hash涓瓨鍏ユ暟鎹
+ *
+ * @param key Redis閿
+ * @param hKey Hash閿
+ * @param value 鍊
+ */
+ public void setCacheMapValue(final String key, final String hKey, final T value)
+ {
+ redisTemplate.opsForHash().put(key, hKey, value);
+ }
+
+ /**
+ * 鑾峰彇Hash涓殑鏁版嵁
+ *
+ * @param key Redis閿
+ * @param hKey Hash閿
+ * @return Hash涓殑瀵硅薄
+ */
+ public T getCacheMapValue(final String key, final String hKey)
+ {
+ HashOperations opsForHash = redisTemplate.opsForHash();
+ return opsForHash.get(key, hKey);
+ }
+
+ /**
+ * 鑾峰彇澶氫釜Hash涓殑鏁版嵁
+ *
+ * @param key Redis閿
+ * @param hKeys Hash閿泦鍚
+ * @return Hash瀵硅薄闆嗗悎
+ */
+ public List getMultiCacheMapValue(final String key, final Collection