From 99a9d0a6bd0b9a1d6cbaf321c3b1e6df689ff051 Mon Sep 17 00:00:00 2001 From: WendyYang Date: Fri, 13 Jan 2023 14:05:32 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pmapi/pom.xml | 52 +------- .../ningdatech/pmapi/common/constant/BizConst.java | 88 +++++++++++++ .../pmapi/common/constants/BizConst.java | 98 -------------- .../com/ningdatech/pmapi/user/entity/RoleInfo.java | 53 +------- .../com/ningdatech/pmapi/user/entity/UserAuth.java | 68 +--------- .../com/ningdatech/pmapi/user/entity/UserInfo.java | 141 +-------------------- .../com/ningdatech/pmapi/user/entity/UserRole.java | 35 +---- .../user/security/auth/WebSecurityConfig.java | 2 +- 8 files changed, 109 insertions(+), 428 deletions(-) create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/common/constant/BizConst.java delete mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/common/constants/BizConst.java diff --git a/pmapi/pom.xml b/pmapi/pom.xml index 28565d8..cf1975a 100644 --- a/pmapi/pom.xml +++ b/pmapi/pom.xml @@ -67,27 +67,11 @@ spring-boot-starter-validation - nl.basjes.parse.useragent - yauaa - - - jakarta.persistence - jakarta.persistence-api - - - org.springframework.data - spring-data-jpa - - org.hibernate hibernate-core org.springframework.boot - spring-boot-starter-data-jpa - - - org.springframework.boot spring-boot-starter-web @@ -115,10 +99,6 @@ org.springframework.boot spring-boot-starter-aop - - org.springframework - spring-test - com.github.ben-manes.caffeine @@ -148,12 +128,10 @@ jjwt-jackson ${jjwt.version} - org.apache.poi poi - org.apache.poi poi-ooxml @@ -173,28 +151,6 @@ org.aspectj aspectjweaver - - - com.itextpdf - itextpdf - 5.5.13 - - - com.itextpdf - itext-asian - 5.2.0 - - - org.apache.pdfbox - pdfbox - 2.0.4 - - - - org.jxls - jxls-jexcel - 1.0.6 - org.springframework.boot @@ -202,18 +158,14 @@ test - org.springframework.boot - spring-boot-starter-freemarker - - org.mapstruct mapstruct - 1.4.2.Final + 1.5.3.Final org.mapstruct mapstruct-processor - 1.4.2.Final + 1.5.3.Final org.springframework.boot diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/constant/BizConst.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/constant/BizConst.java new file mode 100644 index 0000000..8fa1ba8 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/constant/BizConst.java @@ -0,0 +1,88 @@ +package com.ningdatech.pmapi.common.constant; + +import com.ningdatech.basic.model.ApiResponse; + +import java.math.BigDecimal; + +/** + *

+ * 业务常量 + *

+ * + * @author WendyYang + * @since 13:42 2022/12/1 + */ +public interface BizConst { + + /** + * SQL查询一条 + */ + String LIMIT_1 = "limit 1"; + + String COOKIE_KEY = "ND_CAR_RENTAL_JSESSION"; + + /** + * 一小时秒数 + **/ + BigDecimal SECONDS_BY_HOUR = new BigDecimal(60 * 60); + + /** + * 十分钟的毫秒数 + */ + long MILLS_10_MIN = 1000L * 60 * 10; + + /** + * 中国行政区划编码 + */ + long ROOT_REGION_CODE = 100000L; + + /** + * 一级行政区划数量 + */ + int NUM_PROVINCE = 34; + + /** + * 默认的父id + */ + long PARENT_ID = 0L; + + /** + * 默认树层级 + */ + int TREE_GRADE = 0; + + /** + * 默认的排序 + */ + int SORT_VALUE = 0; + + /** + * 浙江省的region_id + */ + long ZJ_REGION_CODE = 330000L; + + /** + * 省/直辖市 level + */ + int GOV_L1 = 1; + + /** + * 市 level + */ + int GOV_L2 = 2; + + /** + * 区/县 level + */ + int GOV_L3 = 3; + + /** + * 密码正则:长度8-20位且至少包含大写字母、小写字母、数字或特殊符号中的任意三种 + */ + String REGEX_PASS = "^(?![a-zA-Z]+$)(?![A-Z0-9]+$)(?![A-Z\\W_]+$)(?![a-z0-9]+$)(?![a-z\\W_]+$)(?![0-9\\W_]+$)[a-zA-Z0-9\\W_]{8,20}$"; + + ApiResponse UNAUTHENTICATED = ApiResponse.of(401, "用户未登录", null); + + int MAX_EXPORT_COUNT = 5000; + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/constants/BizConst.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/constants/BizConst.java deleted file mode 100644 index a4eb44c..0000000 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/constants/BizConst.java +++ /dev/null @@ -1,98 +0,0 @@ -package com.ningdatech.pmapi.common.constants; - -import com.ningdatech.basic.model.ApiResponse; - -import java.math.BigDecimal; - -/** - *

- * 业务常量 - *

- * - * @author WendyYang - * @since 13:42 2022/12/1 - */ -public interface BizConst { - - /** - * SQL查询一条 - */ - String LIMIT_1 = "limit 1"; - - String COOKIE_KEY = "ND_CAR_RENTAL_JSESSION"; - - /** - * 一小时秒数 - **/ - BigDecimal SECONDS_BY_HOUR = new BigDecimal(60 * 60); - - /** - * 十分钟的毫秒数 - */ - long MILLS_10_MIN = 1000L * 60 * 10; - - /** - * 中国行政区划编码 - */ - long ROOT_REGION_CODE = 100000L; - - /** - * 一级行政区划数量 - */ - int NUM_PROVINCE = 34; - - /** - * 默认的父id - */ - long PARENT_ID = 0L; - - /** - * 默认树层级 - */ - int TREE_GRADE = 0; - - /** - * 默认的排序 - */ - int SORT_VALUE = 0; - - /** - * 浙江省的region_id - */ - long ZJ_REGION_CODE = 330000L; - - /** - * 省/直辖市 level - */ - int GOV_L1 = 1; - - /** - * 市 level - */ - int GOV_L2 = 2; - - /** - * 区/县 level - */ - int GOV_L3 = 3; - - /** - * 密码正则:长度8-20位且至少包含大写字母、小写字母、数字或特殊符号中的任意三种 - */ - String REGEX_PASS = "^(?![a-zA-Z]+$)(?![A-Z0-9]+$)(?![A-Z\\W_]+$)(?![a-z0-9]+$)(?![a-z\\W_]+$)(?![0-9\\W_]+$)[a-zA-Z0-9\\W_]{8,20}$"; - - /** - * 租车费率 - */ - BigDecimal RATE_CAR_RENTAL = new BigDecimal("1.13"); - - /** - * 服务费率 - */ - BigDecimal RATE_SERVICE = new BigDecimal("0.0442"); - - ApiResponse UNAUTHENTICATED = ApiResponse.of(401, "用户未登录", null); - - int MAX_EXPORT_COUNT = 5000; - -} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/user/entity/RoleInfo.java b/pmapi/src/main/java/com/ningdatech/pmapi/user/entity/RoleInfo.java index 127a5c2..67d8aec 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/user/entity/RoleInfo.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/user/entity/RoleInfo.java @@ -3,10 +3,12 @@ package com.ningdatech.pmapi.user.entity; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; -import java.io.Serializable; -import java.time.LocalDateTime; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; +import java.time.LocalDateTime; /** *

@@ -16,6 +18,7 @@ import io.swagger.annotations.ApiModelProperty; * @author Liuxinxin * @since 2023-01-05 */ +@Data @TableName("nd_role_info") @ApiModel(value = "RoleInfo对象", description = "角色表") public class RoleInfo implements Serializable { @@ -35,50 +38,4 @@ public class RoleInfo implements Serializable { private LocalDateTime updateOn; - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - public LocalDateTime getCreateOn() { - return createOn; - } - - public void setCreateOn(LocalDateTime createOn) { - this.createOn = createOn; - } - public LocalDateTime getUpdateOn() { - return updateOn; - } - - public void setUpdateOn(LocalDateTime updateOn) { - this.updateOn = updateOn; - } - - @Override - public String toString() { - return "RoleInfo{" + - "id=" + id + - ", name=" + name + - ", description=" + description + - ", createOn=" + createOn + - ", updateOn=" + updateOn + - "}"; - } } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/user/entity/UserAuth.java b/pmapi/src/main/java/com/ningdatech/pmapi/user/entity/UserAuth.java index b799c2b..587dc45 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/user/entity/UserAuth.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/user/entity/UserAuth.java @@ -3,10 +3,11 @@ package com.ningdatech.pmapi.user.entity; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModel; +import lombok.Data; + import java.io.Serializable; import java.time.LocalDateTime; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; /** *

@@ -16,6 +17,7 @@ import io.swagger.annotations.ApiModelProperty; * @author Liuxinxin * @since 2023-01-04 */ +@Data @TableName("nd_user_auth") @ApiModel(value = "UserAuth对象", description = "用户鉴权表") public class UserAuth implements Serializable { @@ -37,66 +39,4 @@ public class UserAuth implements Serializable { private String credential; - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - public LocalDateTime getCreateOn() { - return createOn; - } - - public void setCreateOn(LocalDateTime createOn) { - this.createOn = createOn; - } - public LocalDateTime getUpdateOn() { - return updateOn; - } - - public void setUpdateOn(LocalDateTime updateOn) { - this.updateOn = updateOn; - } - public Long getUserId() { - return userId; - } - - public void setUserId(Long userId) { - this.userId = userId; - } - public String getAuthType() { - return authType; - } - - public void setAuthType(String authType) { - this.authType = authType; - } - public String getIdentifier() { - return identifier; - } - - public void setIdentifier(String identifier) { - this.identifier = identifier; - } - public String getCredential() { - return credential; - } - - public void setCredential(String credential) { - this.credential = credential; - } - - @Override - public String toString() { - return "UserAuth{" + - "id=" + id + - ", createOn=" + createOn + - ", updateOn=" + updateOn + - ", userId=" + userId + - ", authType=" + authType + - ", identifier=" + identifier + - ", credential=" + credential + - "}"; - } } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/user/entity/UserInfo.java b/pmapi/src/main/java/com/ningdatech/pmapi/user/entity/UserInfo.java index 22c5490..fad9d1d 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/user/entity/UserInfo.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/user/entity/UserInfo.java @@ -3,10 +3,12 @@ package com.ningdatech.pmapi.user.entity; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; -import java.io.Serializable; -import java.time.LocalDateTime; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; +import java.time.LocalDateTime; /** *

@@ -16,6 +18,7 @@ import io.swagger.annotations.ApiModelProperty; * @author Liuxinxin * @since 2023-01-04 */ +@Data @TableName("nd_user_info") @ApiModel(value = "UserInfo对象", description = "用户信息表") public class UserInfo implements Serializable { @@ -71,138 +74,4 @@ public class UserInfo implements Serializable { @ApiModelProperty("身份证号") private String idCard; - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - public LocalDateTime getCreateOn() { - return createOn; - } - - public void setCreateOn(LocalDateTime createOn) { - this.createOn = createOn; - } - public LocalDateTime getUpdateOn() { - return updateOn; - } - - public void setUpdateOn(LocalDateTime updateOn) { - this.updateOn = updateOn; - } - public Long getCreateBy() { - return createBy; - } - - public void setCreateBy(Long createBy) { - this.createBy = createBy; - } - public Long getUpdateBy() { - return updateBy; - } - - public void setUpdateBy(Long updateBy) { - this.updateBy = updateBy; - } - public String getUsername() { - return username; - } - - public void setUsername(String username) { - this.username = username; - } - public String getMobile() { - return mobile; - } - - public void setMobile(String mobile) { - this.mobile = mobile; - } - public String getRealName() { - return realName; - } - - public void setRealName(String realName) { - this.realName = realName; - } - public Long getCompanyId() { - return companyId; - } - - public void setCompanyId(Long companyId) { - this.companyId = companyId; - } - public String getCompanyName() { - return companyName; - } - - public void setCompanyName(String companyName) { - this.companyName = companyName; - } - public String getRole() { - return role; - } - - public void setRole(String role) { - this.role = role; - } - public Long getRegionCode() { - return regionCode; - } - - public void setRegionCode(Long regionCode) { - this.regionCode = regionCode; - } - public Long getAvatarFileId() { - return avatarFileId; - } - - public void setAvatarFileId(Long avatarFileId) { - this.avatarFileId = avatarFileId; - } - public String getManageCompanyIds() { - return manageCompanyIds; - } - - public void setManageCompanyIds(String manageCompanyIds) { - this.manageCompanyIds = manageCompanyIds; - } - public Boolean getDeleted() { - return deleted; - } - - public void setDeleted(Boolean deleted) { - this.deleted = deleted; - } - public String getIdCard() { - return idCard; - } - - public void setIdCard(String idCard) { - this.idCard = idCard; - } - - @Override - public String toString() { - return "UserInfo{" + - "id=" + id + - ", createOn=" + createOn + - ", updateOn=" + updateOn + - ", createBy=" + createBy + - ", updateBy=" + updateBy + - ", username=" + username + - ", mobile=" + mobile + - ", realName=" + realName + - ", companyId=" + companyId + - ", companyName=" + companyName + - ", role=" + role + - ", regionCode=" + regionCode + - ", avatarFileId=" + avatarFileId + - ", manageCompanyIds=" + manageCompanyIds + - ", deleted=" + deleted + - ", idCard=" + idCard + - "}"; - } } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/user/entity/UserRole.java b/pmapi/src/main/java/com/ningdatech/pmapi/user/entity/UserRole.java index 5fdb1f2..ac0f350 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/user/entity/UserRole.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/user/entity/UserRole.java @@ -3,9 +3,11 @@ package com.ningdatech.pmapi.user.entity; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; -import java.io.Serializable; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; /** *

@@ -15,6 +17,7 @@ import io.swagger.annotations.ApiModelProperty; * @author Liuxinxin * @since 2023-01-05 */ +@Data @TableName("nd_user_role") @ApiModel(value = "UserRole对象", description = "用户角色表") public class UserRole implements Serializable { @@ -30,34 +33,4 @@ public class UserRole implements Serializable { @ApiModelProperty("角色 ID") private Long roleId; - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - public Long getUserId() { - return userId; - } - - public void setUserId(Long userId) { - this.userId = userId; - } - public Long getRoleId() { - return roleId; - } - - public void setRoleId(Long roleId) { - this.roleId = roleId; - } - - @Override - public String toString() { - return "UserRole{" + - "id=" + id + - ", userId=" + userId + - ", roleId=" + roleId + - "}"; - } } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/user/security/auth/WebSecurityConfig.java b/pmapi/src/main/java/com/ningdatech/pmapi/user/security/auth/WebSecurityConfig.java index 58c2aa3..a676ee1 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/user/security/auth/WebSecurityConfig.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/user/security/auth/WebSecurityConfig.java @@ -2,7 +2,7 @@ package com.ningdatech.pmapi.user.security.auth; import com.ningdatech.basic.util.NdJsonUtil; import com.ningdatech.basic.util.StrPool; -import com.ningdatech.pmapi.common.constants.BizConst; +import com.ningdatech.pmapi.common.constant.BizConst; import com.ningdatech.pmapi.user.security.auth.config.AuthProperties; import com.ningdatech.pmapi.user.security.auth.handler.DefaultExpiredSessionStrategy; import com.ningdatech.pmapi.user.security.auth.password.UsernamePasswordAuthSecurityConfig; From 1ce040441751cee29efcb951a4670161e8f1feeb Mon Sep 17 00:00:00 2001 From: WendyYang Date: Fri, 13 Jan 2023 14:22:11 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=B3=BB=E7=BB=9F?= =?UTF-8?q?=E8=A7=92=E8=89=B2=E6=9E=9A=E4=B8=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pmapi/user/entity/enumeration/RoleEnum.java | 41 ++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/user/entity/enumeration/RoleEnum.java diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/user/entity/enumeration/RoleEnum.java b/pmapi/src/main/java/com/ningdatech/pmapi/user/entity/enumeration/RoleEnum.java new file mode 100644 index 0000000..c1ab775 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/user/entity/enumeration/RoleEnum.java @@ -0,0 +1,41 @@ +package com.ningdatech.pmapi.user.entity.enumeration; + +import lombok.Getter; + +/** + *

+ * 系统角色枚举 + *

+ * + * @author WendyYang + * @since 14:15 2023/1/13 + */ +@Getter +public enum RoleEnum { + + /** + * 系统角色枚举 + */ + ORDINARY_USER("普通用户"), + + EXPERT("专家"), + + ORG_ADMIN("单位管理员"), + + EXPERT_ADMIN("专家管理员"), + + REGION_ADMIN("区域管理员"), + + SUPER_ADMIN("超级管理员"); + + private final String desc; + + RoleEnum(String desc) { + this.desc = desc; + } + + public boolean eq(String name) { + return this.name().equals(name); + } + +} From fdd382e6edfc9df906db6c8366c49af842303eac Mon Sep 17 00:00:00 2001 From: Lierbao Date: Fri, 13 Jan 2023 14:57:56 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E7=BB=84=E7=BB=87=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pmapi/pom.xml | 1 + .../pmapi/organization/manage/OrganizationManage.java | 13 +++++++++++++ 2 files changed, 14 insertions(+) create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/organization/manage/OrganizationManage.java diff --git a/pmapi/pom.xml b/pmapi/pom.xml index cf1975a..0c6c86b 100644 --- a/pmapi/pom.xml +++ b/pmapi/pom.xml @@ -291,6 +291,7 @@ org.apache.maven.plugins maven-surefire-plugin + true diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/organization/manage/OrganizationManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/organization/manage/OrganizationManage.java new file mode 100644 index 0000000..a483337 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/organization/manage/OrganizationManage.java @@ -0,0 +1,13 @@ +package com.ningdatech.pmapi.organization.manage; + +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Component; + +/** + * @author liuxinxin + * @date 2023/1/13 下午2:55 + */ +@Component +@RequiredArgsConstructor +public class OrganizationManage { +}