From e6bb5eb0a13650cf20bc6503adcbbc93ca59d423 Mon Sep 17 00:00:00 2001 From: zhangdaiscott Date: Sat, 11 Jul 2020 12:59:31 +0800 Subject: [PATCH] =?UTF-8?q?Jeecg=20Boot=202.2.1=20=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E5=8F=91=E5=B8=83=EF=BC=8C=E4=BD=8E=E4=BB=A3=E7=A0=81=E5=B9=B3?= =?UTF-8?q?=E5=8F=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- ant-design-vue-jeecg/README.md | 2 +- jeecg-boot/.gitattributes | 4 + jeecg-boot/.gitignore | 5 + jeecg-boot/LICENSE | 21 ++++ jeecg-boot/README.md | 182 ++++++++++++++++++++++++++++----- 6 files changed, 188 insertions(+), 28 deletions(-) create mode 100644 jeecg-boot/.gitattributes create mode 100644 jeecg-boot/.gitignore create mode 100644 jeecg-boot/LICENSE diff --git a/README.md b/README.md index 3915730..6f55795 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ JEECG BOOT 低代码开发平台(前后端分离版本) =============== -当前最新版本: 2.2.1(发布日期:2020-07-11) +当前最新版本: 2.2.1(发布日期:2020-07-13) [![AUR](https://img.shields.io/badge/license-Apache%20License%202.0-blue.svg)](https://github.com/zhangdaiscott/jeecg-boot/blob/master/LICENSE) diff --git a/ant-design-vue-jeecg/README.md b/ant-design-vue-jeecg/README.md index b1618d8..0882c1f 100644 --- a/ant-design-vue-jeecg/README.md +++ b/ant-design-vue-jeecg/README.md @@ -1,7 +1,7 @@ Ant Design Jeecg Vue ==== -当前最新版本: 2.2.1(发布日期:20200711) +当前最新版本: 2.2.1(发布日期:20200713) Overview ---- diff --git a/jeecg-boot/.gitattributes b/jeecg-boot/.gitattributes new file mode 100644 index 0000000..d479839 --- /dev/null +++ b/jeecg-boot/.gitattributes @@ -0,0 +1,4 @@ +*.js linguist-language=Java +*.css linguist-language=Java +*.html linguist-language=Java +*.vue linguist-language=Java diff --git a/jeecg-boot/.gitignore b/jeecg-boot/.gitignore new file mode 100644 index 0000000..6dafbd5 --- /dev/null +++ b/jeecg-boot/.gitignore @@ -0,0 +1,5 @@ +/target/ +/.idea/ +*.iml +jeecg-boot-module-demo +rebel.xml \ No newline at end of file diff --git a/jeecg-boot/LICENSE b/jeecg-boot/LICENSE new file mode 100644 index 0000000..03c5fe3 --- /dev/null +++ b/jeecg-boot/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2019 jeecg-boot + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/jeecg-boot/README.md b/jeecg-boot/README.md index a26da4c..e6ee77a 100644 --- a/jeecg-boot/README.md +++ b/jeecg-boot/README.md @@ -1,17 +1,17 @@ -Jeecg-Boot 低代码开发平台 +Jeecg-Boot 快速开发平台 =============== -当前最新版本: 2.2.0(发布日期:20200506) +当前最新版本: 2.2.1(发布日期:20200713) ## 后端技术架构 - 基础框架:Spring Boot 2.1.3.RELEASE -- 持久层框架:Mybatis-plus_3.1.2 +- 持久层框架:Mybatis-plus_3.1.1 - 安全框架:Apache Shiro 1.4.0,Jwt_3.7.0 -- 数据库连接池:阿里巴巴Druid 1.1.10 +- 数据库连接池:阿里巴巴Druid 1.1.17 - 缓存框架:redis @@ -33,22 +33,10 @@ Jeecg-Boot 低代码开发平台 - 缓存:Redis + +## 开发文档 -## 技术文档 - - -- 在线演示 : [http://boot.jeecg.com](http://boot.jeecg.com) - -- 在线文档: [http://doc.jeecg.com/1273753](http://doc.jeecg.com/1273753) - -- 常见问题: [入门常见问题大全](http://bbs.jeecg.com/forum.php?mod=viewthread&tid=7816&extra=page%3D1) - -- QQ交流群 : ①284271917、②769925425 - - -## 专项文档 - -#### 一、查询过滤器用法 +- 查询过滤器用法 ``` QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(?, req.getParameterMap()); @@ -89,22 +77,133 @@ QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(?, req.getParamet | 多选字段模糊查询 | 上述4 有一个特例,若某一查询字段前后都带逗号 则会将其视为走这种查询方式 ,该查询方式是将查询条件以逗号分割再遍历数组 将每个元素作like查询 用or拼接,例如 现在name传入值 ,a,b,c, 那么结果sql就是 name like '%a%' or name like '%b%' or name like '%c%' | | -#### 二、AutoPoi(EXCEL工具类-EasyPOI衍变升级重构版本) +- Autopoi使用文档(EXCEL工具类 - EasyPOI衍变升级重构版本) [在线文档](https://github.com/zhangdaiscott/autopoi) -#### 三、代码生成器 -> 功能说明: 一键生成的代码(包括:controller、service、dao、mapper、entity、vue) +- **代码生成器** + +** 功能说明**: 一键生成的代码(包括:controller、service、dao、mapper、entity、vue) - - 模板位置: src/main/resources/jeecg/code-template - - 技术文档: http://doc.jeecg.com + **模板位置**: src/main/resources/jeecg/code-template +**使用方法**: + + 【**一对一模板**】 + +**1.**先找到**jeecg-boot/src/resources/jeecg**下的 +**jeecg_config.properties**和**jeecg_database.properties**两个文件。 +**jeecg_config.properties:** 用来配置文件生成的路径, + +**jeecg_database.properties:** 用来配置数据库相关配置. + + +**2.**配置好这些配置之后,我们需要找到**jeecg-boot/src/main/java/org/jeecg/JeecgOneGUI.java**类,也就是启动一对一代码生成器的入口; + + +**3.**右键运行该类,紧接着会弹出一个窗口,如下图: + ![](https://static.oschina.net/uploads/img/201904/14222638_Svth.png) + + +**4.**然后根据窗口左侧的提示,在右侧填写对应的信息即可. + + 【**一对多模板**】 + + +**1.**先找到**jeecg-boot/src/resources/jeecg**下的 + +**jeecg_config.properties**和**jeecg_database.properties**两个文件。 + +**jeecg_config.properties:** 是配置文件生成路径的, + + +**jeecg_database.properties:** 是配置数据库相关配置的文件。 + + +**2.**接着我们需要找到**jeecg-boot/src/main/java/org/jeecg/JeecgOneToMainUtil.java**这个类。 + 该类是生成一对多模板的启动入口。 + + +**3.**该类中需要三个步骤来配置一对多表的信息。 + + + (1) 第一步: 配置主表信息,代码如下: + +``` + //第一步:设置主表配置 + MainTableVo mainTable = new MainTableVo(); + mainTable.setTableName("jeecg_order_main");//表名 + mainTable.setEntityName("TestOrderMain"); //实体名 + mainTable.setEntityPackage("test2"); //包名 + mainTable.setFtlDescription("订单"); //描述 + +``` + (2) 第二步: 配置子表信息,**有多个则配置多个**, 代码如下: + + ①比如: 配置子表 1: + + ``` + //第二步:设置子表集合配置 + List subTables = new ArrayList(); + //[1].子表一 + SubTableVo po = new SubTableVo(); + po.setTableName("jeecg_order_customer");//表名 + po.setEntityName("TestOrderCustom"); //实体名 + po.setEntityPackage("test2"); //包名 + po.setFtlDescription("客户明细"); //描述 + //子表外键参数配置 + /*说明: + * a) 子表引用主表主键ID作为外键,外键字段必须以_ID结尾; + * b) 主表和子表的外键字段名字,必须相同(除主键ID外); + * c) 多个外键字段,采用逗号分隔; + */ + po.setForeignKeys(new String[]{"order_id"}); + subTables.add(po); + ``` + ②比如: 配置子表 2: + +``` + //[2].子表二 + SubTableVo po2 = new SubTableVo(); + po2.setTableName("jeecg_order_ticket"); //表名 + po2.setEntityName("TestOrderTicket"); //实体名 + po2.setEntityPackage("test2"); //包名 + po2.setFtlDescription("产品明细"); //描述 + //子表外键参数配置 + /*说明: + * a) 子表引用主表主键ID作为外键,外键字段必须以_ID结尾; + * b) 主表和子表的外键字段名字,必须相同(除主键ID外); + * c) 多个外键字段,采用逗号分隔; + */ + po2.setForeignKeys(new String[]{"order_id"}); + subTables.add(po2); + ``` + ③将整合了子表VO的subTables添加到主表对象当中去: +``` + mainTable.setSubTables(subTables); + ``` + ④需要注意如下代码,该代码的作用是,为子表设置主外键关联,当添加数据时, +主表的主键将会添加到子表的"order_id"中: + +``` + po2.setForeignKeys(new String[]{"order_id"}); + ``` + + (3) 第三步: 启动(run)程序,生成代码, 代码如下: + + ``` + //第三步:一对多(父子表)数据模型,代码生成 + new CodeGenerateOneToMany(mainTable,subTables).generateCodeFile(); + ``` + +[在线文档](https://github.com/zhangdaiscott/autopoi) + -#### 四、编码排重使用示例 +- **编码排重使用示例** 重复校验效果: ![输入图片说明](https://static.oschina.net/uploads/img/201904/19191836_eGkQ.png "在这里输入图片标题") @@ -155,4 +254,35 @@ code: { }) } }, -``` \ No newline at end of file +``` + + +## docker镜像用法 + ``` +注意: 如果本地安装了mysql和redis,启动容器前先停掉本地服务,不然会端口冲突。 + net stop redis + net stop mysql + +# 1.修改项目配置文件 application.yml + active: docker + +# 2.先进JAVA项目根路径 maven打包 + mvn clean package + + +# 3.构建镜像__容器组(当你改变本地代码,也可重新构建镜像) + docker-compose build + +# 4.配置host + + # jeecgboot + 127.0.0.1 jeecg-boot-redis + 127.0.0.1 jeecg-boot-mysql + 127.0.0.1 jeecg-boot-system + +# 5.启动镜像__容器组(也可取代运行中的镜像) + docker-compose up -d + +# 6.访问后台项目(注意要开启swagger) + http://localhost:8080/jeecg-boot/doc.html +``` \ No newline at end of file -- GitLab