From 1af37770323282d80ef296fa0cb9237fca69c4b8 Mon Sep 17 00:00:00 2001 From: scwang18 Date: Sun, 22 Apr 2018 17:23:32 +0800 Subject: [PATCH 1/7] =?UTF-8?q?=E4=BF=AE=E6=94=B9appliation.properties?= =?UTF-8?q?=E9=87=8C=E7=9A=84=E6=95=B0=E6=8D=AE=E5=BA=93=E7=99=BB=E5=BD=95?= =?UTF-8?q?=E5=AF=86=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- admin-console/src/main/resources/application.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/admin-console/src/main/resources/application.properties b/admin-console/src/main/resources/application.properties index 32767a09..b4849b6a 100644 --- a/admin-console/src/main/resources/application.properties +++ b/admin-console/src/main/resources/application.properties @@ -1,6 +1,6 @@ spring.datasource.url=jdbc:mysql://127.0.0.1:3306/starter?useUnicode=true&characterEncoding=UTF-8&serverTimezone=GMT%2B8&useSSL=false spring.datasource.username=root -spring.datasource.password=123456 +spring.datasource.password=root spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver #spring.datasource.url=jdbc:oracle:thin:@127.0.0.1:1521:orcl -- Gitee From 8b318d91f570ab823d26d2f9bddb7596eabece27 Mon Sep 17 00:00:00 2001 From: scwang18 Date: Sun, 22 Apr 2018 17:29:13 +0800 Subject: [PATCH 2/7] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E7=94=9F=E6=88=90?= =?UTF-8?q?=E5=99=A8=EF=BC=8C=E4=BF=AE=E6=94=B9edit=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E6=A8=A1=E6=9D=BF=EF=BC=8C=E5=BD=93AttachmentID=E4=B8=BANull?= =?UTF-8?q?=E6=97=B6=EF=BC=8C=E8=87=AA=E5=8A=A8=E8=8E=B7=E5=8F=96=E6=96=B0?= =?UTF-8?q?=E7=9A=84uuid,=E9=81=BF=E5=85=8D=E9=80=9A=E8=BF=87=E5=AF=BC?= =?UTF-8?q?=E5=85=A5=E6=96=B9=E5=BC=8F=E5=B7=B2=E8=BF=9B=E5=85=A5=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E5=BA=93=E7=9A=84=E6=95=B0=E6=8D=AE=E6=97=A0=E6=B3=95?= =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E9=99=84=E4=BB=B6=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- admin-core/src/main/resources/codeTemplate/html/edit.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/admin-core/src/main/resources/codeTemplate/html/edit.html b/admin-core/src/main/resources/codeTemplate/html/edit.html index b1b98107..4dee9fea 100644 --- a/admin-core/src/main/resources/codeTemplate/html/edit.html +++ b/admin-core/src/main/resources/codeTemplate/html/edit.html @@ -30,7 +30,7 @@ @if(entity.attachment){
- +
@} -- Gitee From 59b2e1e3ab4a4ae5c68a17595de9663290a5ef03 Mon Sep 17 00:00:00 2001 From: scwang18 Date: Sun, 22 Apr 2018 19:12:01 +0800 Subject: [PATCH 3/7] =?UTF-8?q?=E4=BD=BFmaven=E6=89=93=E5=8C=85=E7=9A=84ja?= =?UTF-8?q?r=E6=96=87=E4=BB=B6=E5=8F=AF=E4=BE=9D=E8=B5=96=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 4321a062..f522a6ce 100644 --- a/pom.xml +++ b/pom.xml @@ -33,6 +33,20 @@ - + + + + + org.springframework.boot + spring-boot-maven-plugin + + true + 1.8 + 1.8 + boot + + + + -- Gitee From 398e59113fe19a2ac6f2e474ca87a9b244fed459 Mon Sep 17 00:00:00 2001 From: scwang18 Date: Sun, 22 Apr 2018 19:13:08 +0800 Subject: [PATCH 4/7] =?UTF-8?q?=E6=9C=AC=E5=9C=B0=E5=8C=96=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E4=BB=A3=E7=A0=81=E7=94=9F=E6=88=90=E5=99=A8=EF=BC=8C?= =?UTF-8?q?cn.wlyoa.dnjd?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- admin-console/src/main/resources/application.properties | 2 +- .../com/ibeetl/admin/core/web/CoreCodeGenController.java | 2 +- .../src/main/resources/templates/core/codeGen/edit.html | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/admin-console/src/main/resources/application.properties b/admin-console/src/main/resources/application.properties index b4849b6a..8830825f 100644 --- a/admin-console/src/main/resources/application.properties +++ b/admin-console/src/main/resources/application.properties @@ -26,7 +26,7 @@ server.port=8080 beetl.suffix=html beetlsql.dbStyle=org.beetl.sql.core.db.MySqlStyle #beetlsql.basePackage=com.ibeetl,com.xxx.yourpackage -beetlsql.basePackage=com +beetlsql.basePackage=com,cn.wlyoa app.name=SpringBoot-Plus logging.pattern.console=%-4relative [%thread] %-5level %logger{256} %M %L - %msg%n spring.devtools.restart.exclude=templates/** diff --git a/admin-core/src/main/java/com/ibeetl/admin/core/web/CoreCodeGenController.java b/admin-core/src/main/java/com/ibeetl/admin/core/web/CoreCodeGenController.java index 58448726..3463e06b 100644 --- a/admin-core/src/main/java/com/ibeetl/admin/core/web/CoreCodeGenController.java +++ b/admin-core/src/main/java/com/ibeetl/admin/core/web/CoreCodeGenController.java @@ -70,7 +70,7 @@ public class CoreCodeGenController { String root = file.getParent(); //设置生成项目为当前运行项目的上一级项目 view.addObject("path",root+File.separator+"sample"); - view.addObject("basePackage","com.corp.xxx"); + view.addObject("basePackage","cn.wlyoa.dnjd"); return view; } diff --git a/admin-core/src/main/resources/templates/core/codeGen/edit.html b/admin-core/src/main/resources/templates/core/codeGen/edit.html index d1ddaba8..25d4d577 100644 --- a/admin-core/src/main/resources/templates/core/codeGen/edit.html +++ b/admin-core/src/main/resources/templates/core/codeGen/edit.html @@ -72,7 +72,7 @@
+ value="cn.wlyoa.dnjd" class="layui-input">
@@ -102,14 +102,14 @@
- +
-
-- Gitee From 7b03a6de5954d446f7e708680969fa8db4e3985e Mon Sep 17 00:00:00 2001 From: scwang18 Date: Sun, 22 Apr 2018 19:15:05 +0800 Subject: [PATCH 5/7] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E7=94=9F=E6=88=90=E5=99=A8=EF=BC=8C=E6=94=AF=E6=8C=81=E4=B9=90?= =?UTF-8?q?=E8=A7=82=E9=94=81=E7=89=88=E6=9C=AC=E7=AE=A1=E7=90=86=E3=80=81?= =?UTF-8?q?=E9=80=BB=E8=BE=91=E5=88=A0=E9=99=A4=20=E4=BB=A5=E5=8F=8A?= =?UTF-8?q?=E8=A7=A3=E5=86=B3=EF=BC=9A=E5=A6=82=E6=9E=9C=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E4=BB=A5=E5=AF=BC=E5=85=A5=E6=96=B9=E5=BC=8F=E8=BF=9B=E8=A1=8C?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=BA=93=E8=A1=A8=E6=97=B6=EF=BC=8Cattachmen?= =?UTF-8?q?tid=E4=B8=BA=E7=A9=BA=EF=BC=8C=E6=97=A0=E6=B3=95=E5=86=8D?= =?UTF-8?q?=E7=BC=96=E8=BE=91=E4=B8=8A=E4=BC=A0=E9=99=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/resources/codeTemplate/html/add.html | 23 ++++--- .../resources/codeTemplate/html/edit.html | 23 +++++-- .../resources/codeTemplate/java/pojo.java | 37 +++++++--- .../main/resources/codeTemplate/js/index.js | 67 ++++++++++--------- .../main/resources/codeTemplate/md/entity.md | 2 +- 5 files changed, 91 insertions(+), 61 deletions(-) diff --git a/admin-core/src/main/resources/codeTemplate/html/add.html b/admin-core/src/main/resources/codeTemplate/html/add.html index 5adec5d1..90081df8 100644 --- a/admin-core/src/main/resources/codeTemplate/html/add.html +++ b/admin-core/src/main/resources/codeTemplate/html/add.html @@ -11,20 +11,21 @@
@for(item in array){ - @if(item==null){continue;} - + @if(item==null){continue;} + @if(item.name=="delFlag"){continue;} + @if(item.name=="version"){continue;} + @if(item.name=="attachmentId"){continue;}
-
- @if(isEmpty(item.dictType)){ - - @}else{ - - @} +
+ @if(isEmpty(item.dictType)){ + + @}else{ + + @} +
-
- @}
diff --git a/admin-core/src/main/resources/codeTemplate/html/edit.html b/admin-core/src/main/resources/codeTemplate/html/edit.html index 4dee9fea..d8ea6bf1 100644 --- a/admin-core/src/main/resources/codeTemplate/html/edit.html +++ b/admin-core/src/main/resources/codeTemplate/html/edit.html @@ -11,28 +11,37 @@
@for(item in array){ - @if(item==null){continue;} + @if(item==null){continue;} + @if(item.name=="delFlag"){continue;} + @if(item.name=="version"){continue;} + @if(item.name=="attachmentId"){continue;}
-
+
@if(isEmpty(item.dictType)){ - + @}else{ - + @} -
+
@}
@} - @if(entity.attachment){
@} + + @for(item in list){ + @if(item==null){continue;} + @if((item.name=="delFlag")||(item.name=="version")){ + + @} + @} diff --git a/admin-core/src/main/resources/codeTemplate/java/pojo.java b/admin-core/src/main/resources/codeTemplate/java/pojo.java index e7c51b82..2fa62f85 100644 --- a/admin-core/src/main/resources/codeTemplate/java/pojo.java +++ b/admin-core/src/main/resources/codeTemplate/java/pojo.java @@ -17,6 +17,11 @@ import java.math.*; import com.ibeetl.admin.core.annotation.Dict; import com.ibeetl.admin.core.entity.BaseEntity; +import org.beetl.sql.core.annotatoin.InsertIgnore; +import org.beetl.sql.core.annotatoin.Version; +import org.beetl.sql.core.annotatoin.LogicDelete; + + /* * ${comment} * gen by Spring Boot2 Admin ${date(),"yyyy-MM-dd"} @@ -24,18 +29,28 @@ import com.ibeetl.admin.core.entity.BaseEntity; public class ${className} extends BaseEntity{ @for(attr in attrs){ - @if(!isEmpty(attr.comment)){ + @if(!isEmpty(attr.comment)){ //${attr.comment} - @} - @if(attr.isId) { + @} + @if(attr.isId) { \@NotNull(message = "ID不能为空", groups =ValidateConfig.UPDATE.class) \@SeqID(name = ORACLE_CORE_SEQ_NAME) \@AutoID - @} - - @if(isNotEmpty(attr.dictType)) { + @} + @if(isNotEmpty(attr.dictType)) { \@Dict(type="${attr.dictType}") - @} + @} + /*逻辑删除标志*/ + @if(attr.name == "delFlag") { + \@InsertIgnore + \@LogicDelete(value = 1) + @} + /*乐观锁版本标志*/ + @if(attr.name == "version") { + \@InsertIgnore + \@Version + @} + private ${attr.type} ${attr.name} ; @} @@ -44,19 +59,19 @@ public class ${className} extends BaseEntity{ } @for(attr in attrs){ - @if(!isEmpty(attr.comment)){ + @if(!isEmpty(attr.comment)){ /**${attr.comment} *\@return */ - @} + @} public ${attr.type} get${attr.methodName}(){ return ${attr.name}; } - @if(!isEmpty(attr.comment)){ + @if(!isEmpty(attr.comment)){ /**${attr.comment} *\@param ${attr.name} */ - @} + @} public void set${attr.methodName}(${attr.type} ${attr.name}){ this.${attr.name} = ${attr.name}; } diff --git a/admin-core/src/main/resources/codeTemplate/js/index.js b/admin-core/src/main/resources/codeTemplate/js/index.js index 18c9f15b..786af02e 100644 --- a/admin-core/src/main/resources/codeTemplate/js/index.js +++ b/admin-core/src/main/resources/codeTemplate/js/index.js @@ -16,45 +16,50 @@ layui.define([ 'form', 'laydate', 'table' ], function(exports) { ${entity.code}Table = table.render({ elem : '#${entity.code}Table', height : Lib.getTableHeight(1), + cellMinWidth: 100, method : 'post', url : Common.ctxPath + '/${target.urlBase}/${entity.code}/list.json' // 数据接口 ,page : Lib.tablePage // 开启分页 ,limit : 10, cols : [ [ // 表头 - { - type : 'checkbox', - fixed:'left', - }, + { + type : 'checkbox', + fixed:'left', + }, @for(attr in entity.list){ + @if(attr.name=="delFlag"){continue;} + @if(attr.name=="version"){continue;} + @if(attr.name=="attachmentId"){continue;} { - field : '${isEmpty(attr.dictType)?attr.name:(attr.name+"Text")}', ${isNotEmpty(attr.dictType)?"//数据字典类型为 "+attr.dictType} - title : '${attr.displayName}', - @if(attrLP.first){ - fixed:'left', - @} - @if(attr.javaType=="date"){ - templet:function(d){ - return Common.getDate(d.${attr.name}); - }, - @} - width : 100 - }${!attrLP.last?","} - @} - - ] ] - - }); - + + field : '${isEmpty(attr.dictType)?attr.name:(attr.name+"Text")}', ${isNotEmpty(attr.dictType)?"//数据字典类型为 "+attr.dictType} + title : '${attr.displayName}', + @if(attrLP.first){ + fixed:'left', + width : 60, + @} + @if(attr.javaType=="date"){ + templet:function(d){ + return Common.getDate(d.${attr.name}); + } + @} + }${!attrLP.last?","} + @} + + ] ] + + }); + table.on('checkbox(${entity.code}Table)', function(obj){ var ${entity.code} = obj.data; if(obj.checked){ - //按钮逻辑Lib.buttonEnable() + //按钮逻辑Lib.buttonEnable() }else{ - + } - }) + }) }, - + initSearchForm:function(){ Lib.initSearchForm( $("#searchForm"),${entity.code}Table,form); }, @@ -72,14 +77,14 @@ layui.define([ 'form', 'laydate', 'table' ], function(exports) { var url = "/${target.urlBase}/${entity.code}/edit.do?${entity.idAttribute.name}="+data.${entity.idAttribute.name}; Common.openDlg(url,"${entity.displayName}管理>"+data.${entity.nameAttribute.name}+">编辑"); }, - del : function() { + del : function() { layui.use(['del'], function(){ var delView = layui.del delView.delBatch(); }); } @if(entity.includeExcel){ - , + , exportDocument : function() { layui.use([ '${entity.code}Api' ], function() { var ${entity.code}Api = layui.${entity.code}Api @@ -99,13 +104,13 @@ layui.define([ 'form', 'laydate', 'table' ], function(exports) { Common.openDlg(url, "${entity.displayName}管理>上传"); } @} - }; + }; $('.ext-toolbar').on('click', function() { var type = $(this).data('type'); toolbar[type] ? toolbar[type].call(this) : ''; }); } - } + } exports('index',view); - + }); \ No newline at end of file diff --git a/admin-core/src/main/resources/codeTemplate/md/entity.md b/admin-core/src/main/resources/codeTemplate/md/entity.md index 252a897b..d2cc745a 100644 --- a/admin-core/src/main/resources/codeTemplate/md/entity.md +++ b/admin-core/src/main/resources/codeTemplate/md/entity.md @@ -7,7 +7,7 @@ queryByCondition t.* \@} from ${entity.tableName} t - where 1=1 + where del_flag=0 \@//数据权限,该sql语句功能点 and #function("${entity.code}.query")# @for(attr in entity.list){ -- Gitee From f464aa2366ade9c65e48baf1f34262a51f330e29 Mon Sep 17 00:00:00 2001 From: scwang18 Date: Sun, 22 Apr 2018 19:15:30 +0800 Subject: [PATCH 6/7] =?UTF-8?q?=E7=94=9F=E6=88=90=E7=9A=84=E9=A1=B9?= =?UTF-8?q?=E7=9B=AE=E5=A2=9E=E5=8A=A0=E5=AF=B9admin-console=E7=9A=84?= =?UTF-8?q?=E4=BE=9D=E8=B5=96=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/codeTemplate/maven/pomTemplate.xml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/admin-core/src/main/resources/codeTemplate/maven/pomTemplate.xml b/admin-core/src/main/resources/codeTemplate/maven/pomTemplate.xml index 3d48c7a8..8f374c55 100644 --- a/admin-core/src/main/resources/codeTemplate/maven/pomTemplate.xml +++ b/admin-core/src/main/resources/codeTemplate/maven/pomTemplate.xml @@ -21,6 +21,12 @@ 1.1.2 + + com.ibeetl + admin-console + 1.1.2 + + org.springframework.cloud spring-cloud-starter-netflix-eureka-client -- Gitee From f0f4b0aca33edd30a83240c3c1861b20640ee973 Mon Sep 17 00:00:00 2001 From: scwang18 Date: Sun, 22 Apr 2018 19:15:56 +0800 Subject: [PATCH 7/7] =?UTF-8?q?workflow=E7=9A=84pom=20=E6=8D=A2?= =?UTF-8?q?=E8=A1=8C=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- admin-workflow/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/admin-workflow/pom.xml b/admin-workflow/pom.xml index ca13c0ae..2c2da5f1 100644 --- a/admin-workflow/pom.xml +++ b/admin-workflow/pom.xml @@ -20,7 +20,7 @@ com.ibeetl admin-cloud 1.1.2 - + org.flowable -- Gitee