From 5d159cd6536977c19a957b9d609790ecf1ada51e Mon Sep 17 00:00:00 2001 From: xiandafu Date: Sat, 7 Apr 2018 19:10:04 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=9C=AC=E5=9C=B0=E5=8C=96=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=EF=BC=8C=E4=B8=BB=E8=A6=81=E6=98=AF=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E5=AF=B9=E7=83=AD=E5=8A=A0=E8=BD=BD=E7=9A=84=E8=BF=90=E8=A1=8C?= =?UTF-8?q?=20=E4=BF=AE=E6=94=B9=E6=95=B0=E6=8D=AE=E5=BA=93=E7=99=BB?= =?UTF-8?q?=E5=BD=95=E7=94=A8=E6=88=B7=E5=AF=86=E7=A0=81=20=E6=94=AF?= =?UTF-8?q?=E6=8C=81maven=E6=89=93=E5=8C=85=E5=8F=AF=E4=BE=9D=E8=B5=96?= =?UTF-8?q?=E5=8C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 合并大赋的4.7日提交的bug fix --- admin-console/pom.xml | 18 +++++++++++++-- .../src/main/resources/application.properties | 6 ++--- admin-core/pom.xml | 22 +++++++++++++++---- .../admin/core/service/CoreUserService.java | 16 +++++++++----- .../admin/core/web/SimulateController.java | 5 ++++- .../codeTemplate/maven/pomTemplate.xml | 19 +++++++++++++--- pom.xml | 6 ++--- 7 files changed, 70 insertions(+), 22 deletions(-) diff --git a/admin-console/pom.xml b/admin-console/pom.xml index c38c19f8..0b9fed99 100644 --- a/admin-console/pom.xml +++ b/admin-console/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.ibeetl admin-console - 1.1 + 1.1.1 jar com.ibeetl @@ -16,10 +16,24 @@ com.ibeetl admin-core - 1.1 + 1.1.1 + + + + org.springframework.boot + spring-boot-maven-plugin + + true + 1.8 + 1.8 + boot + + + + diff --git a/admin-console/src/main/resources/application.properties b/admin-console/src/main/resources/application.properties index 8fd5339b..7ddf417e 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 @@ -11,8 +11,8 @@ spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver # 1,1 是管理员密码,相当于启动后就登录,方便测试,系统需要取消这俩个配置 -user.id=1 -user.orgId=1 +#user.id=1 +#user.orgId=1 #打开审计功能,开发模式应该关闭 audit.enable=false spring.session.store-type=HASH_MAP diff --git a/admin-core/pom.xml b/admin-core/pom.xml index 3c2ca316..7c10a0b1 100644 --- a/admin-core/pom.xml +++ b/admin-core/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.ibeetl admin-core - 1.1 + 1.1.1 jar true @@ -57,13 +57,27 @@ poi-ooxml 3.17 - - + + + + + org.springframework.boot + spring-boot-maven-plugin + + true + 1.8 + 1.8 + boot + + + + + com.ibeetl admin - 1.1 + 1.1.1 diff --git a/admin-core/src/main/java/com/ibeetl/admin/core/service/CoreUserService.java b/admin-core/src/main/java/com/ibeetl/admin/core/service/CoreUserService.java index d0e781d8..052e4e2f 100644 --- a/admin-core/src/main/java/com/ibeetl/admin/core/service/CoreUserService.java +++ b/admin-core/src/main/java/com/ibeetl/admin/core/service/CoreUserService.java @@ -37,14 +37,18 @@ public class CoreUserService { query.setCode(userName); query.setPassword(passwordEncryptService.password(password)); query.setState(GeneralStateEnum.ENABLE.getValue()); - CoreUser user =userDao.getSQLManager().templateOne(query); -// SysUser user = userDao.templateOne(query); - if(user==null){ - return null; + CoreUser user =userDao.createLambdaQuery().andEq(CoreUser::getCode,userName). + andEq(CoreUser::getPassword, passwordEncryptService.password(password)).single(); + if(user==null) { + throw new PlatformException("用户"+userName+"不存在或者密码错误"); } - if(user.getDelFlag()==DelFlagEnum.DELETED.getValue()||user.getState()==GeneralStateEnum.DISABLE.getValue()){ - throw new PlatformException("用户"+userName+"已经删除或者失效"); + if(!user.getState().equals(GeneralStateEnum.ENABLE.getValue())){ + throw new PlatformException("用户"+userName+"已经失效"); } + if(user.getDelFlag()==DelFlagEnum.DELETED.getValue()) { + throw new PlatformException("用户"+userName+"已经删除"); + } + List orgs = getUserOrg(user.getId(),user.getOrgId()); UserLoginInfo loginInfo = new UserLoginInfo(); diff --git a/admin-core/src/main/java/com/ibeetl/admin/core/web/SimulateController.java b/admin-core/src/main/java/com/ibeetl/admin/core/web/SimulateController.java index 93dbbe90..a9cbbbbd 100644 --- a/admin-core/src/main/java/com/ibeetl/admin/core/web/SimulateController.java +++ b/admin-core/src/main/java/com/ibeetl/admin/core/web/SimulateController.java @@ -3,6 +3,8 @@ package com.ibeetl.admin.core.web; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import org.beetl.ext.simulate.WebSimulate; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; @@ -16,10 +18,11 @@ import org.springframework.web.bind.annotation.RequestMapping; public class SimulateController { @Autowired WebSimulate webSimulate; - + Log log = LogFactory.getLog(SimulateController.class); @RequestMapping("/**/*.do") public void simluateWeb(HttpServletRequest request, HttpServletResponse response) { response.setContentType("text/html;charset=UTF-8"); + log.info("没有配置 url "+request.getRequestURI()+",使用模拟MVC功能使用前后端分离"); webSimulate.execute(request, response); } diff --git a/admin-core/src/main/resources/codeTemplate/maven/pomTemplate.xml b/admin-core/src/main/resources/codeTemplate/maven/pomTemplate.xml index e9639706..9fb0e285 100644 --- a/admin-core/src/main/resources/codeTemplate/maven/pomTemplate.xml +++ b/admin-core/src/main/resources/codeTemplate/maven/pomTemplate.xml @@ -61,17 +61,30 @@ com.ibeetl admin-core - 1.0 + 1.1.1 com.ibeetl admin-console - 1.0 + 1.1.1 - + + + + org.springframework.boot + spring-boot-maven-plugin + + true + 1.8 + 1.8 + boot + + + + diff --git a/pom.xml b/pom.xml index 62166cb0..5bf8c859 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.ibeetl admin - 1.1 + 1.1.1 pom 1.8 @@ -17,7 +17,7 @@ org.springframework.boot spring-boot-starter-parent - 2.0.0.RELEASE + 2.0.1.RELEASE @@ -62,7 +62,7 @@ com.ibeetl beetl-framework-starter - 1.1.40.RELEASE + 1.1.45.RELEASE com.trigersoft -- Gitee From 0130a86fc49e2428ff39b752f6e8cb44875129c5 Mon Sep 17 00:00:00 2001 From: scwang18 Date: Wed, 11 Apr 2018 00:57:31 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E5=AE=8C=E5=96=84=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=E9=80=BB?= =?UTF-8?q?=E8=BE=91=E5=88=A0=E9=99=A4=E3=80=81=E4=B9=90=E8=A7=82=E9=94=81?= =?UTF-8?q?=20=E7=BA=A0=E6=AD=A3=E9=99=84=E4=BB=B6=E4=B8=8A=E4=BC=A0?= =?UTF-8?q?=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- admin-console/pom.xml | 2 +- .../admin/core/web/CoreCodeGenController.java | 2 +- .../main/resources/codeTemplate/html/add.html | 23 ++++++----- .../resources/codeTemplate/html/edit.html | 38 ++++++++++++------- .../resources/codeTemplate/java/pojo.java | 13 +++++-- .../main/resources/codeTemplate/js/index.js | 33 +++++++++------- .../main/resources/codeTemplate/md/entity.md | 2 +- .../templates/core/codeGen/edit.html | 6 +-- 8 files changed, 72 insertions(+), 47 deletions(-) diff --git a/admin-console/pom.xml b/admin-console/pom.xml index 0b9fed99..e7400fd8 100644 --- a/admin-console/pom.xml +++ b/admin-console/pom.xml @@ -8,7 +8,7 @@ com.ibeetl admin - 1.1 + 1.1.1 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/codeTemplate/html/add.html b/admin-core/src/main/resources/codeTemplate/html/add.html index 5adec5d1..bb9a5d39 100644 --- a/admin-core/src/main/resources/codeTemplate/html/add.html +++ b/admin-core/src/main/resources/codeTemplate/html/add.html @@ -12,17 +12,20 @@
@for(item in array){ @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 b1b98107..37c5ae62 100644 --- a/admin-core/src/main/resources/codeTemplate/html/edit.html +++ b/admin-core/src/main/resources/codeTemplate/html/edit.html @@ -4,24 +4,27 @@ @ var list = entity.generalList; @ var size = list.~size; /*一行显示俩个,生成后在根据显示要求调整*/ @ for(var i=0;i
@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{ + + @} +
@}
@@ -33,6 +36,13 @@
@} + + @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..db93ccef 100644 --- a/admin-core/src/main/resources/codeTemplate/java/pojo.java +++ b/admin-core/src/main/resources/codeTemplate/java/pojo.java @@ -6,8 +6,8 @@ import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotNull; import javax.validation.constraints.Null; -import org.beetl.sql.core.annotatoin.AutoID; -import org.beetl.sql.core.annotatoin.SeqID; +import com.ibeetl.admin.core.util.enums.DelFlagEnum; +import org.beetl.sql.core.annotatoin.*; import com.ibeetl.admin.core.util.ValidateConfig; @@ -32,10 +32,17 @@ public class ${className} extends BaseEntity{ \@SeqID(name = ORACLE_CORE_SEQ_NAME) \@AutoID @} - @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} ; @} diff --git a/admin-core/src/main/resources/codeTemplate/js/index.js b/admin-core/src/main/resources/codeTemplate/js/index.js index 18c9f15b..7dbb5e87 100644 --- a/admin-core/src/main/resources/codeTemplate/js/index.js +++ b/admin-core/src/main/resources/codeTemplate/js/index.js @@ -16,29 +16,34 @@ 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?","} @} ] ] diff --git a/admin-core/src/main/resources/codeTemplate/md/entity.md b/admin-core/src/main/resources/codeTemplate/md/entity.md index 252a897b..777a5aa4 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){ 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