From 01269d32602a6576bed2b4c6ed15ad92269a81a7 Mon Sep 17 00:00:00 2001 From: wangchengjun Date: Thu, 6 Jan 2022 23:37:51 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E5=8A=9F=E8=83=BD=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- jero-boot/README.md | 22 ++++++++ .../jero/common/aspect/ExcelImportAspect.java | 42 +++++++++++++++ .../common/aspect/annotation/ExcelImport.java | 44 ++++++++++++++++ jero-boot/jero-boot-modules/pom.xml | 52 +++++++++++++++++++ jero-boot/jero-boot-single-startup/pom.xml | 6 +++ .../src/main/resources/application.yml | 2 +- jero-boot/pom.xml | 33 ++++++------ jero-web/src/views/dashboard/Analysis.vue | 22 ++++---- 8 files changed, 195 insertions(+), 28 deletions(-) create mode 100644 jero-boot/jero-boot-base/jero-boot-base-core/src/main/java/com/jero/common/aspect/ExcelImportAspect.java create mode 100644 jero-boot/jero-boot-base/jero-boot-base-core/src/main/java/com/jero/common/aspect/annotation/ExcelImport.java create mode 100644 jero-boot/jero-boot-modules/pom.xml diff --git a/jero-boot/README.md b/jero-boot/README.md index ebc110e0b..29715dce8 100644 --- a/jero-boot/README.md +++ b/jero-boot/README.md @@ -34,6 +34,28 @@ jero-boot 低代码开发平台 - 缓存:Redis +## 数据库设计规范 + +- 数据库表名全部使用小写,多个单词之间使用 _ 隔开 +- 字段内容全部使用小写,多个单词之间使用 _ 隔开,并且每个字段需要有注释 +- 每个表中都需要有id,用varchar(36) +- 新建的表中必须要有创建人、创建时间、更新人、更新时间、所属部门五个字段 + +## 系统规范 + +- 日志记录 +方法中使用`@AutoLog` 记录日志 +- 异常处理 +所有异常使用`JeroBootException`抛出 +- 权限控制 +需要进行数据权限控制 +- 项目模块创建 +后续创建模块在`jero-boot-modules.com.jero.modules.laws` +和`jero-boot-modules.com.jero.modules.project`下创建 +- 系统导入 +系统导入使用注解`@ExcelImport`进行字段校验 +- 系统常量定义在`com.jero.common.constant.CommonConstant`下 + ## 技术文档 - 在线文档: [http://doc.xxx.com](http://doc.xxx.com) diff --git a/jero-boot/jero-boot-base/jero-boot-base-core/src/main/java/com/jero/common/aspect/ExcelImportAspect.java b/jero-boot/jero-boot-base/jero-boot-base-core/src/main/java/com/jero/common/aspect/ExcelImportAspect.java new file mode 100644 index 000000000..82e02bdfa --- /dev/null +++ b/jero-boot/jero-boot-base/jero-boot-base-core/src/main/java/com/jero/common/aspect/ExcelImportAspect.java @@ -0,0 +1,42 @@ +package com.jero.common.aspect; + +import com.jero.modules.base.service.BaseCommonService; +import org.aspectj.lang.ProceedingJoinPoint; +import org.aspectj.lang.annotation.Around; +import org.aspectj.lang.annotation.Aspect; +import org.aspectj.lang.annotation.Pointcut; +import org.springframework.stereotype.Component; + +import javax.annotation.Resource; + + +/** + * 导入校验,切面处理类 + * + * @Author wcj + * @Date 2022年1月6日 + */ +@Aspect +@Component +public class ExcelImportAspect { + + @Resource + private BaseCommonService baseCommonService; + + @Pointcut("@annotation(com.jero.common.aspect.annotation.ExcelImport)") + public void logPointCut() { + + } + + @Around("logPointCut()") + public Object around(ProceedingJoinPoint point) throws Throwable { + long beginTime = System.currentTimeMillis(); + //执行方法 + Object result = point.proceed(); + //执行时长(毫秒) + long time = System.currentTimeMillis() - beginTime; + + return result; + } + +} diff --git a/jero-boot/jero-boot-base/jero-boot-base-core/src/main/java/com/jero/common/aspect/annotation/ExcelImport.java b/jero-boot/jero-boot-base/jero-boot-base-core/src/main/java/com/jero/common/aspect/annotation/ExcelImport.java new file mode 100644 index 000000000..e869d65ec --- /dev/null +++ b/jero-boot/jero-boot-base/jero-boot-base-core/src/main/java/com/jero/common/aspect/annotation/ExcelImport.java @@ -0,0 +1,44 @@ +package com.jero.common.aspect.annotation; + +import com.jero.common.constant.enums.ModuleType; + +import java.lang.annotation.*; + +/** + * 日志导入校验 + * + * @Author wcj + * @Date 2022年1月6日 + */ +@Target(ElementType.METHOD) +@Retention(RetentionPolicy.RUNTIME) +@Documented +public @interface ExcelImport { + + /** + * 是否必填,false + * + * @return + */ + boolean required() default false; + + /** + * 正则表达式 + * + * @return 0:操作日志;1:登录日志;2:定时任务; + */ + String regular(); + + /** + * 字符长度 + * + * @return + */ + int length() default 0; + + /** + * 日期格式 默认yyyy-MM-dd HH:mm:ss + * @return + */ + String dateFormat() default "yyyy-MM-dd HH:mm:ss"; +} diff --git a/jero-boot/jero-boot-modules/pom.xml b/jero-boot/jero-boot-modules/pom.xml new file mode 100644 index 000000000..9f916aca8 --- /dev/null +++ b/jero-boot/jero-boot-modules/pom.xml @@ -0,0 +1,52 @@ + + + + jero-boot + com.jero.boot + 2.4.2 + + 4.0.0 + + jero-boot-modules + + + + + aliyun + aliyun Repository + http://maven.aliyun.com/nexus/content/groups/public + + false + + + + jeecg + jeecg Repository + http://maven.jeecg.org/nexus/content/repositories/jeecg + + false + + + + + + + com.jero.boot + jero-boot-module-system + ${jero.version} + + + com.jero.boot + jero-boot-module-demo + ${jero.version} + + + com.jero.boot + jero-boot-base-generater + ${jero.version} + + + + \ No newline at end of file diff --git a/jero-boot/jero-boot-single-startup/pom.xml b/jero-boot/jero-boot-single-startup/pom.xml index cf99b68ba..b8c6481cd 100644 --- a/jero-boot/jero-boot-single-startup/pom.xml +++ b/jero-boot/jero-boot-single-startup/pom.xml @@ -27,9 +27,15 @@ jero-boot-base-generater ${jero.version} + + com.jero.boot + jero-boot-modules + ${jero.version} + + laws-weilai org.springframework.boot diff --git a/jero-boot/jero-boot-single-startup/src/main/resources/application.yml b/jero-boot/jero-boot-single-startup/src/main/resources/application.yml index 2779e168e..7b86c331f 100644 --- a/jero-boot/jero-boot-single-startup/src/main/resources/application.yml +++ b/jero-boot/jero-boot-single-startup/src/main/resources/application.yml @@ -1,5 +1,5 @@ spring: application: - name: jero-system + name: weilai-system profiles: active: @profile.name@ \ No newline at end of file diff --git a/jero-boot/pom.xml b/jero-boot/pom.xml index a8be26a0b..5fc21ff45 100644 --- a/jero-boot/pom.xml +++ b/jero-boot/pom.xml @@ -53,6 +53,7 @@ jero-boot-starter jero-boot-single-startup + jero-boot-modules @@ -161,11 +162,11 @@ - - com.jero.boot - jero-cloud-feign-config - ${jero.version} - + + + + + @@ -196,17 +197,17 @@ - - com.qiniu - qiniu-java-sdk - ${qiniu-java-sdk.version} - - - okhttp - com.squareup.okhttp3 - - - + + + + + + + + + + + dom4j diff --git a/jero-web/src/views/dashboard/Analysis.vue b/jero-web/src/views/dashboard/Analysis.vue index 2e16b2250..955165f4e 100644 --- a/jero-web/src/views/dashboard/Analysis.vue +++ b/jero-web/src/views/dashboard/Analysis.vue @@ -1,16 +1,16 @@