From 13777cbd4c2aa2c75c085705193ef1573b43316a Mon Sep 17 00:00:00 2001 From: zhangdaihao Date: Thu, 7 Jun 2018 11:43:33 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=BA=E9=AB=98=E8=80=83=E5=AD=A6=E5=AD=90?= =?UTF-8?q?=E5=8A=A0=E6=B2=B9=EF=BC=8CJEECG=203.7.6=20=E9=AB=98=E8=80=83?= =?UTF-8?q?=E6=80=A7=E8=83=BD=E5=8A=A0=E5=BC=BA=E7=89=88=E6=9C=AC=E5=8F=91?= =?UTF-8?q?=E5=B8=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 7 +- ...5_beta_mysql.sql => jeecg_3.7.6_mysql.sql} | 49 +- jeecg-framework/docs/入门必读.txt | 2 +- jeecg-framework/docs/数据库说明.txt | 8 +- .../jeecg_mysql-3.7.3_beta-update-3.7.5.sql | 35 - .../jeecg_mysql-3.7.5_beta-update-3.7.6.sql | 16 + jeecg-framework/pom.xml | 260 +-- .../controller/JeecgFormDemoController.java | 143 +- .../controller/JeecgListDemoController.java | 37 +- .../controller/JformOrderMain2Controller.java | 2 +- .../demo/controller/JfromOrderController.java | 24 +- .../com/jeecg/demo/dao/JeecgMinidaoDao.java | 32 +- .../jeecg/demo/entity/JeecgDemoEntity.java | 6 +- .../core/annotation/Ehcache.java | 3 +- .../jeecgframework/core/annotation/JAuth.java | 2 +- .../core/aop/EhcacheAspect.java | 53 +- .../core/aop/RedisCacheAspect.java | 17 +- .../common/dao/impl/GenericBaseCommonDao.java | 9 +- .../common/hibernate/qbc/AliasToBean.java | 134 +- .../common/hibernate/qbc/CriteriaQuery.java | 10 +- .../hibernate/qbc/DetachedCriteriaUtil.java | 506 +++--- .../core/common/service/CommonService.java | 2 +- .../service/impl/CommonServiceImpl.java | 2 +- .../common/service/impl/RedisService.java | 67 + .../jeecgframework/core/constant/Globals.java | 4 +- .../core/enums/MenuButtonsEnum.java | 19 +- .../core/enums/OnlineGenerateEnum.java | 5 +- .../core/enums/StoreUploadFilePathEnum.java | 6 +- .../extend/hqlsearch/HqlGenerateUtil.java | 1 - .../core/interceptors/AuthInterceptor.java | 345 ++-- .../core/interceptors/SignInterceptor.java | 6 +- .../interceptors/SqlInjectInterceptor.java | 138 ++ .../online/util/CgReportQueryParamUtil.java | 75 +- .../core/online/util/FreemarkerHelper.java | 5 + .../core/timer/DataBaseCronTriggerBean.java | 43 - .../timer/DataBaseSchedulerFactoryBean.java | 12 +- .../core/timer/DynamicTask.java | 125 +- .../core/util/DynamicDBUtil.java | 31 +- .../jeecgframework/core/util/EhcacheUtil.java | 10 + .../jeecgframework/core/util/JSONHelper.java | 3 - .../jeecgframework/core/util/PinyinUtil.java | 5 +- .../core/util/RedisCacheUtil.java | 2 - .../jeecgframework/core/util/RedisUtil.java | 317 ---- .../core/util/ReflectHelper.java | 11 +- .../core/util/ResourceUtil.java | 38 +- .../core/util/SqlInjectionUtil.java | 42 + .../core/util/SysThemesUtil.java | 63 +- .../jwt/service/RedisTokenManager.java | 14 +- .../jeecgframework/jwt/util/JwtHttpUtil.java | 11 +- .../tag/core/easyui/BaseTag.java | 128 +- .../tag/core/easyui/DataGridColumnTag.java | 21 +- .../tag/core/easyui/DataGridFunOptTag.java | 14 +- .../tag/core/easyui/DataGridOpenOptTag.java | 11 +- .../tag/core/easyui/DataGridTag.java | 277 ++- .../tag/core/easyui/FormValidationTag.java | 19 + .../tag/core/easyui/MenuButtonsTag.java | 9 +- .../tag/core/easyui/MenuTag.java | 4 +- .../tag/core/easyui/TagUtil.java | 122 +- .../tag/core/easyui/WebUploaderTag.java | 14 +- .../factory/ftl/component/bootstrapTable.ftl | 6 +- .../tag/core/factory/util/ComponentTools.java | 31 +- .../tag/core/util/GzipUtilities.java | 24 + .../tag/vo/easyui/DataGridColumn.java | 19 +- .../tag/vo/easyui/DataGridUrl.java | 10 + .../controller/TsBlackListController.java | 25 +- .../web}/black/entity/TsBlackListEntity.java | 2 +- .../black/service/TsBlackListServiceI.java | 4 +- .../service/impl/TsBlackListServiceImpl.java | 6 +- .../CgDynamGraphConfigHeadController.java | 36 +- .../controller/CgDynamGraphController.java | 170 +- .../engine/core/cgDynamGraphDesign.ftl | 2 +- ...CgDynamGraphDao_queryCgDynamGraphItems.sql | 2 +- ...amGraphDao_queryCgDynamGraphMainConfig.sql | 2 +- .../web/cgform/common/CgAutoListConstant.java | 6 + .../web/cgform/common/spring-mvc-cgform.xml | 4 + .../autolist/CgAutoListController.java | 19 +- .../build/CgFormBuildController.java | 114 +- .../controller/build/CgformSqlController.java | 4 + .../config/CgFormHeadController.java | 8 +- .../template/CgformTemplateController.java | 2 + .../controller/upload/CgUploadController.java | 7 +- .../web/cgform/engine/autolist/autolist.ftl | 2 +- .../web/cgform/engine/tag/ExpTag.java | 91 + .../CgFormVersionInterceptor.java | 2 +- .../impl/build/DataBaseServiceImpl.java | 36 +- .../impl/button/CgformButtonServiceImpl.java | 13 +- .../button/CgformButtonSqlServiceImpl.java | 13 +- .../impl/config/CgFormFieldServiceImpl.java | 3 + .../impl/config/DbTableServiceMysqlImpl.java | 6 +- .../service/impl/config/util/ColumnMeta.java | 4 +- .../impl/config/util/ExtendJsonConvert.java | 4 +- .../enhance/CgformEnhanceJavaServiceImpl.java | 21 +- .../enhance/CgformEnhanceJsServiceImpl.java | 8 +- .../impl/generate/TempletContextWord.java | 1 + .../CgFormVersionDao_getCgFormVersionById.sql | 2 +- ...VersionDao_getCgFormVersionByTableName.sql | 2 +- .../config/CgFormVersionDao_updateVersion.sql | 2 +- .../CgFormUploadDao_updateBackFileInfo.sql | 2 +- .../controller/core/CgReportController.java | 174 +- .../web/cgreport/engine/core/cgreportlist.ftl | 2 +- .../engine/core/cgreportlistpopup.ftl | 2 +- .../service/core/CgReportServiceI.java | 22 + .../impl/core/CgReportServiceImpl.java | 204 ++- .../core/CgReportDao_queryCgReportItems.sql | 2 +- .../CgReportDao_queryCgReportMainConfig.sql | 2 +- .../controller/GraphReportController.java | 128 +- .../engine/core/graphreportlist.ftl | 2 +- .../impl/core/GraphReportServiceImpl.java | 2 +- .../core/JformGraphreportHeadServiceImpl.java | 8 +- .../controller/SuperQueryMainController.java | 54 +- .../entity/SuperQueryFieldEntity.java | 2 +- .../entity/SuperQueryHistoryEntity.java | 2 +- .../entity/SuperQueryMainEntity.java | 2 +- .../entity/SuperQueryTableEntity.java | 2 +- .../superquery/page/SuperQueryMainPage.java | 6 +- .../service/SuperQueryMainServiceI.java | 8 +- .../impl/SuperQueryMainServiceImpl.java | 10 +- .../web}/superquery/util/SuperQueryUtil.java | 2 +- .../controller/core/CommonController.java | 6 +- .../core/DepartAuthGroupController.java | 42 +- .../controller/core/DepartController.java | 10 +- .../controller/core/FunctionController.java | 21 +- .../controller/core/IconController.java | 26 + .../controller/core/InterroleController.java | 5 +- .../controller/core/LoginController.java | 699 ++------ .../core/NoticeAuthorityRoleController.java | 20 +- .../core/NoticeAuthorityUserController.java | 12 +- .../controller/core/NoticeController.java | 36 +- .../core/OrganzationController.java | 40 +- .../controller/core/RoleController.java | 34 +- .../controller/core/SystemController.java | 38 +- .../core/TSInterfaceController.java | 62 +- .../controller/core/TimeTaskController.java | 20 +- .../controller/core/UserController.java | 88 +- .../web/system/service/SystemService.java | 71 +- .../web/system/service/UserService.java | 39 + .../service/impl/DeclareServiceImpl.java | 6 +- .../service/impl/SystemServiceImpl.java | 297 ++-- .../system/service/impl/UserServiceImpl.java | 301 +++- .../sql/JeecgDictDao_querySystemDict.sql | 2 +- .../src/main/resources/dbconfig.properties | 14 +- .../src/main/resources/ehcache.xml | 3 + .../resources/export/mail/password_reset.ftl | 36 + ...ler.java => ${entityName}Controller.javai} | 11 - .../entity/${entityName}Entity.javai} | 32 + .../${entityPackage}/entity/[1-n]Entity.javai | 1 + ...Name}Page.java => ${entityName}Page.javai} | 0 ...viceI.java => ${entityName}ServiceI.javai} | 0 ...pl.java => ${entityName}ServiceImpl.javai} | 0 .../element/onetomany/java/subEntity.ftl | 10 +- ...irst}.jsp => ${entityNameUncapFirst}.jspi} | 204 ++- ...t.jsp => ${entityNameUncapFirst}List.jspi} | 66 +- ...ler.java => ${entityName}Controller.javai} | 17 - .../entity/${entityName}Entity.javai} | 54 +- ...viceI.java => ${entityName}ServiceI.javai} | 0 .../impl/${entityName}ServiceImpl.javai} | 18 +- ...t.jsp => ${entityNameUncapFirst}List.jspi} | 350 ++-- ...ler.java => ${entityName}Controller.javai} | 177 +- ...]Controller.java => [1-n]Controller.javai} | 0 .../entity/${entityName}Entity.javai} | 0 .../{[1-n]Entity.java => [1-n]Entity.javai} | 0 ...Name}Page.java => ${entityName}Page.javai} | 18 +- ...viceI.java => ${entityName}ServiceI.javai} | 0 ...pl.java => ${entityName}ServiceImpl.javai} | 0 .../onetomany/java/subController.ftl | 181 +- .../multitable/onetomany/java/subEntity.ftl | 2 - ...d.jsp => ${entityNameUncapFirst}-add.jspi} | 194 +- ...jsp => ${entityNameUncapFirst}-index.jspi} | 40 +- .../${entityNameUncapFirst}-list.jsp | 49 - .../${entityNameUncapFirst}-list.jspi | 96 + ...sp => ${entityNameUncapFirst}-update.jspi} | 173 +- .../{[1-n]sub-add.jsp => [1-n]sub-add.jspi} | 0 .../{[1-n]sub-list.jsp => [1-n]sub-list.jspi} | 0 ...-page-list.jsp => [1-n]sub-page-list.jspi} | 0 ...-n]sub-update.jsp => [1-n]sub-update.jspi} | 0 ....jsp => page-${entityNameUncapFirst}.jspi} | 18 +- .../onetomany/webapp/webpage/sub_add.ftl | 59 +- .../onetomany/webapp/webpage/sub_list.ftl | 52 +- .../webapp/webpage/sub_page_list_one2many.ftl | 24 +- .../webapp/webpage/sub_page_list_one2one.ftl | 1 + .../onetomany/webapp/webpage/sub_update.ftl | 59 +- ...ler.java => ${entityName}Controller.javai} | 14 - .../entity/${entityName}Entity.javai} | 0 .../${entityPackage}/entity/[1-n]Entity.java | 1 - .../${entityPackage}/entity/[1-n]Entity.javai | 1 + ...Name}Page.java => ${entityName}Page.javai} | 0 ...viceI.java => ${entityName}ServiceI.javai} | 0 ...pl.java => ${entityName}ServiceImpl.javai} | 0 .../naturebt/onetomany/java/subEntity.ftl | 10 +- ...d.jsp => ${entityNameUncapFirst}-add.jspi} | 69 +- ...sp => ${entityNameUncapFirst}-update.jspi} | 93 +- ...t.jsp => ${entityNameUncapFirst}List.jspi} | 29 +- ...ler.java => ${entityName}Controller.javai} | 13 - .../entity/${entityName}Entity.javai} | 0 ...viceI.java => ${entityName}ServiceI.javai} | 0 .../impl/${entityName}ServiceImpl.javai} | 18 +- ...d.jsp => ${entityNameUncapFirst}-add.jspi} | 34 +- ...sp => ${entityNameUncapFirst}-update.jspi} | 34 +- ...t.jsp => ${entityNameUncapFirst}List.jspi} | 21 +- ...ler.java => ${entityName}Controller.javai} | 5 - .../entity/${entityName}Entity.javai} | 0 .../${entityPackage}/entity/[1-n]Entity.java | 1 - .../entity/[1-n]Entity.javai} | 0 ...Name}Page.java => ${entityName}Page.javai} | 0 ...viceI.java => ${entityName}ServiceI.javai} | 0 ...pl.java => ${entityName}ServiceImpl.javai} | 0 .../table/onetomany/java/subEntity.ftl | 14 +- ...d.jsp => ${entityNameUncapFirst}-add.jspi} | 0 ...sp => ${entityNameUncapFirst}-update.jspi} | 0 ...pFirst}.js => ${entityNameUncapFirst}.jsi} | 0 ...ist.js => ${entityNameUncapFirst}List.jsi} | 0 ...t.jsp => ${entityNameUncapFirst}List.jspi} | 0 .../{[1-n]sub.jsp => [1-n]sub.jspi} | 0 ...ler.java => ${entityName}Controller.javai} | 8 - .../entity/${entityName}Entity.javai} | 0 ...viceI.java => ${entityName}ServiceI.javai} | 0 ...pl.java => ${entityName}ServiceImpl.javai} | 18 +- ...d.jsp => ${entityNameUncapFirst}-add.jspi} | 0 ...sp => ${entityNameUncapFirst}-update.jspi} | 0 ...pFirst}.js => ${entityNameUncapFirst}.jsi} | 0 ...ist.js => ${entityNameUncapFirst}List.jsi} | 0 ...t.jsp => ${entityNameUncapFirst}List.jspi} | 0 .../jeecg/ext-common-template/ui/element.ftl | 4 + .../ext-common-template/ui/formControl.ftl | 4 +- .../jeecg/ext-common-template/ui/tag.ftl | 4 +- .../jeecg/ext-common-template/ui/tdgColcb.ftl | 48 + .../onetomany/cgform_jspTemplate_update.ftl | 2 +- .../single/cgform_jspTemplate_update.ftl | 19 +- .../tab/onetomany/cgform_jspTemplate_add.ftl | 48 +- .../single/cgform_jspTemplate_update.ftl | 2 +- .../template/boostrap01/html/autolist.ftl | 12 +- .../template/boostrap01/html/autolist2.ftl | 2 +- .../online/template/default/html/autolist.ftl | 12 +- .../template/default/html/jformhead.ftl | 2 +- .../template/employeeCost/html/autolist.ftl | 12 +- .../template/jform00001/html/autolist.ftl | 12 +- .../template/jform00002/html/autolist.ftl | 12 +- .../leaveApplicationForm/html/autolist.ftl | 12 +- .../template/ledefault/html/autolist.ftl | 12 +- .../template/ledefault/html/jformhead.ftl | 2 +- .../template/ledefault2/html/autolist.ftl | 12 +- .../template/ledefault2/html/jformhead.ftl | 2 +- .../moblieCommon001/html/autolist.ftl | 12 +- .../moblieCommon002/html/autolist.ftl | 12 +- .../template/nopopform/html/autolist.ftl | 12 +- .../template/o2mTableStyle/html/autolist.ftl | 12 +- .../template/o2mTableStyle/html/jformhead.ftl | 2 +- .../o2mTableStyle/html/jformonetomany.ftl | 8 +- .../o2mTableStyle/html/jformunion.ftl | 39 +- .../template/olstyle00001/html/autolist.ftl | 12 +- .../template/olstyle00002/html/autolist.ftl | 12 +- .../online/template/resume/html/autolist.ftl | 12 +- .../template/rowsEdit/html/autolist.ftl | 12 +- .../online/template/subgrid/html/autolist.ftl | 12 +- .../template/subgrid/html/jformhead.ftl | 2 +- .../main/resources/online/template/ui/tag.ftl | 4 +- .../src/main/resources/redis.properties | 32 +- jeecg-framework/src/main/resources/redis.xml | 88 +- .../main/resources/spring-mvc-hibernate.xml | 34 +- .../src/main/resources/spring-mvc.xml | 93 +- .../src/main/resources/sysConfig.properties | 2 +- .../WEB-INF/lib/batik-all-1.6-20170917.jar | Bin 2623953 -> 0 bytes .../lib/codegenerate-3.6.3-20180503.jar | Bin 111118 -> 0 bytes .../lib/codegenerate-3.6.3-20180606.jar | Bin 0 -> 115303 bytes .../webapp/WEB-INF/lib/fop-1.0-20170917.jar | Bin 1519742 -> 0 bytes .../lib/freemarker-null-2.3.19-20170917.jar | Bin 931995 -> 0 bytes .../WEB-INF/lib/jacob-1.0.0-20170917.jar | Bin 47833 -> 0 bytes .../webapp/WEB-INF/lib/json-1.0-20170917.jar | Bin 46252 -> 0 bytes .../WEB-INF/lib/org.quartz-1.6.2-20170917.jar | Bin 450640 -> 0 bytes .../WEB-INF/lib/pinyin4j-2.5.0-20170917.jar | Bin 188920 -> 0 bytes .../WEB-INF/lib/ueditor-1.1.1-20170917.jar | Bin 30409 -> 0 bytes .../src/main/webapp/WEB-INF/tld/easyui.tld | 35 +- .../src/main/webapp/WEB-INF/web.xml | 51 +- .../plug-in/Flexpaper/FlexPaperViewer.swf | Bin 136827 -> 412092 bytes .../webapp/plug-in/Flexpaper/swfobject.js | 4 + .../Validform/css/metrole/tablefrom.css | 4 + .../Validform/js/Validform_v5.3.1_min_en.js | 6 + .../js/Validform_v5.3.1_min_zh-cn.js | 6 + .../plug-in/accordion/css/accordion.css | 7 +- .../webapp/plug-in/accordion/js/leftmenu.js | 57 +- .../webapp/plug-in/element-ui/css/alert.css | 1 + .../webapp/plug-in/element-ui/css/aside.css | 1 + .../plug-in/element-ui/css/autocomplete.css | 1 + .../webapp/plug-in/element-ui/css/badge.css | 1 + .../webapp/plug-in/element-ui/css/base.css | 1 + .../element-ui/css/breadcrumb-item.css} | 0 .../plug-in/element-ui/css/breadcrumb.css | 1 + .../element-ui/css/button-group.css} | 0 .../webapp/plug-in/element-ui/css/button.css | 1 + .../webapp/plug-in/element-ui/css/card.css | 1 + .../plug-in/element-ui/css/carousel-item.css | 1 + .../plug-in/element-ui/css/carousel.css | 1 + .../plug-in/element-ui/css/cascader.css | 1 + .../element-ui/css/checkbox-button.css} | 0 .../plug-in/element-ui/css/checkbox-group.css | 0 .../plug-in/element-ui/css/checkbox.css | 1 + .../webapp/plug-in/element-ui/css/col.css | 1 + .../plug-in/element-ui/css/collapse-item.css | 0 .../plug-in/element-ui/css/collapse.css | 1 + .../plug-in/element-ui/css/color-picker.css | 1 + .../plug-in/element-ui/css/container.css | 1 + .../plug-in/element-ui/css/date-picker.css | 1 + .../webapp/plug-in/element-ui/css/dialog.css | 1 + .../webapp/plug-in/element-ui/css/display.css | 1 + .../plug-in/element-ui/css/dropdown-item.css | 0 .../plug-in/element-ui/css/dropdown-menu.css | 0 .../plug-in/element-ui/css/dropdown.css | 1 + .../element-ui/css/fonts/element-icons.ttf | Bin 0 -> 11040 bytes .../element-ui/css/fonts/element-icons.woff | Bin 0 -> 6164 bytes .../webapp/plug-in/element-ui/css/footer.css | 1 + .../plug-in/element-ui/css/form-item.css | 0 .../webapp/plug-in/element-ui/css/form.css | 1 + .../webapp/plug-in/element-ui/css/header.css | 1 + .../webapp/plug-in/element-ui/css/icon.css | 1 + .../webapp/plug-in/element-ui/css/index.css | 1 + .../plug-in/element-ui/css/input-number.css | 1 + .../webapp/plug-in/element-ui/css/input.css | 1 + .../webapp/plug-in/element-ui/css/loading.css | 1 + .../webapp/plug-in/element-ui/css/main.css | 1 + .../element-ui/css/menu-item-group.css | 0 .../plug-in/element-ui/css/menu-item.css | 0 .../webapp/plug-in/element-ui/css/menu.css | 1 + .../plug-in/element-ui/css/message-box.css | 1 + .../webapp/plug-in/element-ui/css/message.css | 1 + .../plug-in/element-ui/css/notification.css | 1 + .../plug-in/element-ui/css/option-group.css | 1 + .../webapp/plug-in/element-ui/css/option.css | 1 + .../plug-in/element-ui/css/pagination.css | 1 + .../webapp/plug-in/element-ui/css/popover.css | 1 + .../webapp/plug-in/element-ui/css/popper.css | 1 + .../plug-in/element-ui/css/progress.css | 1 + .../plug-in/element-ui/css/radio-button.css | 1 + .../plug-in/element-ui/css/radio-group.css | 1 + .../webapp/plug-in/element-ui/css/radio.css | 1 + .../webapp/plug-in/element-ui/css/rate.css | 1 + .../webapp/plug-in/element-ui/css/reset.css | 1 + .../webapp/plug-in/element-ui/css/row.css | 1 + .../plug-in/element-ui/css/scrollbar.css | 1 + .../element-ui/css/select-dropdown.css | 1 + .../webapp/plug-in/element-ui/css/select.css | 1 + .../webapp/plug-in/element-ui/css/slider.css | 1 + .../webapp/plug-in/element-ui/css/spinner.css | 1 + .../webapp/plug-in/element-ui/css/step.css | 1 + .../webapp/plug-in/element-ui/css/steps.css | 1 + .../webapp/plug-in/element-ui/css/submenu.css | 0 .../webapp/plug-in/element-ui/css/switch.css | 1 + .../plug-in/element-ui/css/tab-pane.css | 0 .../plug-in/element-ui/css/table-column.css | 1 + .../webapp/plug-in/element-ui/css/table.css | 1 + .../webapp/plug-in/element-ui/css/tabs.css | 1 + .../webapp/plug-in/element-ui/css/tag.css | 1 + .../plug-in/element-ui/css/time-picker.css | 1 + .../plug-in/element-ui/css/time-select.css | 1 + .../webapp/plug-in/element-ui/css/tooltip.css | 1 + .../plug-in/element-ui/css/transfer.css | 1 + .../webapp/plug-in/element-ui/css/tree.css | 1 + .../webapp/plug-in/element-ui/css/upload.css | 1 + .../main/webapp/plug-in/element-ui/index.js | 1 + .../src/main/webapp/plug-in/hplus/contabs.js | 17 + .../plug-in/mutitables/datagrid-filter.js | 691 ++++++++ .../plug-in/mutitables/datagrid.menu.css | 188 ++ .../plug-in/mutitables/jquery.resize.y.js | 51 + .../mutitables/mutitables.curdInIframe.js | 60 +- .../mutitables/mutitables.mainpage.css | 21 + .../plug-in/mutitables/mutitables.mainpage.js | 28 +- .../plug-in/mutitables/mutitables.urd.js | 44 +- .../webapp/plug-in/printthis/printThis.js | 286 +++ .../plug-in/themes/fineui/common/js/sccl.js | 17 + .../themes/naturebt/css/search-form.css | 7 +- .../plug-in/tools/css/metrole/common.css | 9 + .../main/webapp/plug-in/tools/curdtools_en.js | 2 +- .../webapp/plug-in/tools/curdtools_zh-cn.js | 2 +- .../main/webapp/plug-in/vue/vue-resource.js | 1563 +++++++++++++++++ .../src/main/webapp/plug-in/vue/vue.js | 6 + .../webapp/plug-in/webuploader/custom.css | 2 + .../webpage/com/jeecg/black/tsBlackList.js | 32 - .../demo/echartsDemo/bootstrap-echarts.jsp | 677 +++++++ .../com/jeecg/demo/form_webuploader.jsp | 204 +++ .../webpage/com/jeecg/demo/jeecgDemo-add.jsp | 8 +- .../jeecg/demo/jeecgDemo-bootstrap-add.jsp | 4 +- .../jeecg/demo/jeecgDemo-bootstrap-add2.jsp | 2 +- .../jeecg/demo/jeecgDemo-bootstrap-list.jsp | 2 +- .../jeecg/demo/jeecgDemo-bootstrap-update.jsp | 2 +- .../demo/jeecgDemo-bootstrap-update2.jsp | 2 +- .../jeecg/demo/jeecgDemo-nature-ace-add.jsp | 13 +- .../demo/jeecgDemo-nature-ace-update.jsp | 14 +- .../com/jeecg/demo/jeecgDemo-print.jsp | 17 +- .../com/jeecg/demo/jeecgDemo-update.jsp | 10 +- .../jeecg/demo/jeecgDemoList-multihead.jsp | 95 +- .../com/jeecg/demo/jfromOrderGridViewList.jsp | 110 ++ .../common/upload/mutitables_excel_upload.jsp | 69 + .../webapp/webpage/common/upload/swfView.jsp | 151 +- .../{com => }/jeecg/black/tsBlackList-add.jsp | 2 +- .../jeecg/black/tsBlackList-update.jsp | 2 +- .../{com => }/jeecg/black/tsBlackListList.jsp | 5 - .../core/cgDynamGraphConfigHead-add.jsp | 4 +- .../core/cgDynamGraphConfigHead-update.jsp | 4 +- .../core/cgDynamGraphConfigItemList.jsp | 4 +- .../jeecg/cgform/config/cgFormHead.jsp | 29 +- .../cgform/config/cgFormHeadConfigList.jsp | 4 +- .../jeecg/cgform/config/cgFormHeadList.jsp | 2 +- .../jeecg/cgform/fillrule/tSFillRule-add.jsp | 2 - .../cgform/fillrule/tSFillRule-update.jsp | 1 - .../jeecg/cgform/fillrule/tSFillRule.js | 28 - .../jeecg/cgform/fillrule/tSFillRuleList.jsp | 1 - .../cgreport/core/cgreportConfigHead-add.jsp | 2 +- .../core/cgreportConfigHead-update.jsp | 2 +- .../cgreport/core/cgreportConfigItemList.jsp | 4 +- .../graphreport/jformGraphreportHead-add.jsp | 6 +- .../jformGraphreportHead-update.jsp | 2 +- .../graphreport/jformGraphreportItemList.jsp | 6 +- .../webpage/jeecg/superquery/dialog.jsp | 988 +++++++++++ .../jeecg/superquery/superQueryFieldList.jsp | 6 +- .../jeecg/superquery/superQueryMain-add.jsp | 4 +- .../superquery/superQueryMain-update.jsp | 4 +- .../jeecg/superquery/superQueryMain.js | 0 .../jeecg/superquery/superQueryMainList.js | 0 .../jeecg/superquery/superQueryMainList.jsp | 2 +- .../jeecg/superquery/superQueryTableList.jsp | 2 +- .../main/webapp/webpage/login/login-ace.js | 186 ++ .../src/main/webapp/webpage/login/login.jsp | 216 +-- .../src/main/webapp/webpage/main/acehome.jsp | 2 +- .../main/webapp/webpage/main/fineui_home.jsp | 76 +- .../main/webapp/webpage/main/fineui_main.jsp | 7 + .../src/main/webapp/webpage/main/home.jsp | 2 +- .../main/webapp/webpage/main/hplushome.jsp | 76 +- .../webpage/system/dataLog/dataDiff.jsp | 5 +- .../webpage/system/dataLog/dataLogList.jsp | 10 + .../webpage/system/dbsource/dbSource.jsp | 2 +- .../main/webapp/webpage/system/icon/icons.jsp | 34 +- .../system/interrole/interroleUserList.jsp | 4 +- .../system/organzation/myDepartList.jsp | 11 +- .../webapp/webpage/system/role/roleList.jsp | 22 + .../webpage/system/timetask/timeTask.jsp | 8 +- .../main/webapp/webpage/system/type/type.jsp | 2 +- .../webpage/system/user/interfaceUser.jsp | 222 +-- .../webpage/system/user/interfaceUserList.jsp | 17 + .../test/demo/DynamicDBTest.java | 62 + .../test/demo/JwtRestfulClientDemo.java | 2 +- .../test/demo/RedisUtilTest.java | 127 -- jeecg-plugin-ui/README.md | 2 +- 入门必读.txt | 2 +- 442 files changed, 11482 insertions(+), 4962 deletions(-) rename jeecg-framework/docs/{jeecg_3.7.5_beta_mysql.sql => jeecg_3.7.6_mysql.sql} (99%) delete mode 100644 jeecg-framework/docs/老版本增量升级/jeecg_mysql-3.7.3_beta-update-3.7.5.sql create mode 100644 jeecg-framework/docs/老版本增量升级/jeecg_mysql-3.7.5_beta-update-3.7.6.sql create mode 100644 jeecg-framework/src/main/java/org/jeecgframework/core/common/service/impl/RedisService.java create mode 100644 jeecg-framework/src/main/java/org/jeecgframework/core/interceptors/SqlInjectInterceptor.java delete mode 100644 jeecg-framework/src/main/java/org/jeecgframework/core/timer/DataBaseCronTriggerBean.java delete mode 100644 jeecg-framework/src/main/java/org/jeecgframework/core/util/RedisUtil.java create mode 100644 jeecg-framework/src/main/java/org/jeecgframework/core/util/SqlInjectionUtil.java create mode 100644 jeecg-framework/src/main/java/org/jeecgframework/tag/core/util/GzipUtilities.java rename jeecg-framework/src/main/java/{com/jeecg => org/jeecgframework/web}/black/controller/TsBlackListController.java (95%) rename jeecg-framework/src/main/java/{com/jeecg => org/jeecgframework/web}/black/entity/TsBlackListEntity.java (99%) rename jeecg-framework/src/main/java/{com/jeecg => org/jeecgframework/web}/black/service/TsBlackListServiceI.java (77%) rename jeecg-framework/src/main/java/{com/jeecg => org/jeecgframework/web}/black/service/impl/TsBlackListServiceImpl.java (96%) create mode 100644 jeecg-framework/src/main/java/org/jeecgframework/web/cgform/engine/tag/ExpTag.java rename jeecg-framework/src/main/java/{com/jeecg => org/jeecgframework/web}/superquery/controller/SuperQueryMainController.java (95%) rename jeecg-framework/src/main/java/{com/jeecg => org/jeecgframework/web}/superquery/entity/SuperQueryFieldEntity.java (99%) rename jeecg-framework/src/main/java/{com/jeecg => org/jeecgframework/web}/superquery/entity/SuperQueryHistoryEntity.java (99%) rename jeecg-framework/src/main/java/{com/jeecg => org/jeecgframework/web}/superquery/entity/SuperQueryMainEntity.java (99%) rename jeecg-framework/src/main/java/{com/jeecg => org/jeecgframework/web}/superquery/entity/SuperQueryTableEntity.java (99%) rename jeecg-framework/src/main/java/{com/jeecg => org/jeecgframework/web}/superquery/page/SuperQueryMainPage.java (97%) rename jeecg-framework/src/main/java/{com/jeecg => org/jeecgframework/web}/superquery/service/SuperQueryMainServiceI.java (79%) rename jeecg-framework/src/main/java/{com/jeecg => org/jeecgframework/web}/superquery/service/impl/SuperQueryMainServiceImpl.java (95%) rename jeecg-framework/src/main/java/{com/jeecg => org/jeecgframework/web}/superquery/util/SuperQueryUtil.java (98%) create mode 100644 jeecg-framework/src/main/resources/export/mail/password_reset.ftl rename jeecg-framework/src/main/resources/jeecg/ext-common-template/element/onetomany/java/${bussiPackage}/${entityPackage}/controller/{${entityName}Controller.java => ${entityName}Controller.javai} (98%) rename jeecg-framework/src/main/resources/jeecg/ext-common-template/{table/single/java/${bussiPackage}/${entityPackage}/entity/${entityName}Entity.java => element/onetomany/java/${bussiPackage}/${entityPackage}/entity/${entityName}Entity.javai} (82%) create mode 100644 jeecg-framework/src/main/resources/jeecg/ext-common-template/element/onetomany/java/${bussiPackage}/${entityPackage}/entity/[1-n]Entity.javai rename jeecg-framework/src/main/resources/jeecg/ext-common-template/element/onetomany/java/${bussiPackage}/${entityPackage}/page/{${entityName}Page.java => ${entityName}Page.javai} (100%) rename jeecg-framework/src/main/resources/jeecg/ext-common-template/element/onetomany/java/${bussiPackage}/${entityPackage}/service/{${entityName}ServiceI.java => ${entityName}ServiceI.javai} (100%) rename jeecg-framework/src/main/resources/jeecg/ext-common-template/element/onetomany/java/${bussiPackage}/${entityPackage}/service/impl/{${entityName}ServiceImpl.java => ${entityName}ServiceImpl.javai} (100%) rename jeecg-framework/src/main/resources/jeecg/ext-common-template/element/onetomany/webapp/webpage/${bussiPackage}/${entityPackage}/{${entityNameUncapFirst}.jsp => ${entityNameUncapFirst}.jspi} (72%) rename jeecg-framework/src/main/resources/jeecg/ext-common-template/element/onetomany/webapp/webpage/${bussiPackage}/${entityPackage}/{${entityNameUncapFirst}List.jsp => ${entityNameUncapFirst}List.jspi} (82%) rename jeecg-framework/src/main/resources/jeecg/ext-common-template/element/single/java/${bussiPackage}/${entityPackage}/controller/{${entityName}Controller.java => ${entityName}Controller.javai} (95%) rename jeecg-framework/src/main/resources/jeecg/ext-common-template/{table/onetomany/java/${bussiPackage}/${entityPackage}/entity/${entityName}Entity.java => element/single/java/${bussiPackage}/${entityPackage}/entity/${entityName}Entity.javai} (75%) rename jeecg-framework/src/main/resources/jeecg/ext-common-template/element/single/java/${bussiPackage}/${entityPackage}/service/{${entityName}ServiceI.java => ${entityName}ServiceI.javai} (100%) rename jeecg-framework/src/main/resources/jeecg/ext-common-template/{naturebt/single/java/${bussiPackage}/${entityPackage}/service/impl/${entityName}ServiceImpl.java => element/single/java/${bussiPackage}/${entityPackage}/service/impl/${entityName}ServiceImpl.javai} (94%) rename jeecg-framework/src/main/resources/jeecg/ext-common-template/element/single/webapp/webpage/${bussiPackage}/${entityPackage}/{${entityNameUncapFirst}List.jsp => ${entityNameUncapFirst}List.jspi} (66%) rename jeecg-framework/src/main/resources/jeecg/ext-common-template/multitable/onetomany/java/${bussiPackage}/${entityPackage}/controller/{${entityName}Controller.java => ${entityName}Controller.javai} (86%) rename jeecg-framework/src/main/resources/jeecg/ext-common-template/multitable/onetomany/java/${bussiPackage}/${entityPackage}/controller/{[1-n]Controller.java => [1-n]Controller.javai} (100%) rename jeecg-framework/src/main/resources/jeecg/ext-common-template/{element/onetomany/java/${bussiPackage}/${entityPackage}/entity/${entityName}Entity.java => multitable/onetomany/java/${bussiPackage}/${entityPackage}/entity/${entityName}Entity.javai} (100%) rename jeecg-framework/src/main/resources/jeecg/ext-common-template/multitable/onetomany/java/${bussiPackage}/${entityPackage}/entity/{[1-n]Entity.java => [1-n]Entity.javai} (100%) rename jeecg-framework/src/main/resources/jeecg/ext-common-template/multitable/onetomany/java/${bussiPackage}/${entityPackage}/page/{${entityName}Page.java => ${entityName}Page.javai} (75%) rename jeecg-framework/src/main/resources/jeecg/ext-common-template/multitable/onetomany/java/${bussiPackage}/${entityPackage}/service/{${entityName}ServiceI.java => ${entityName}ServiceI.javai} (100%) rename jeecg-framework/src/main/resources/jeecg/ext-common-template/multitable/onetomany/java/${bussiPackage}/${entityPackage}/service/impl/{${entityName}ServiceImpl.java => ${entityName}ServiceImpl.javai} (100%) rename jeecg-framework/src/main/resources/jeecg/ext-common-template/multitable/onetomany/webapp/webpage/${bussiPackage}/${entityPackage}/{${entityNameUncapFirst}-add.jsp => ${entityNameUncapFirst}-add.jspi} (52%) rename jeecg-framework/src/main/resources/jeecg/ext-common-template/multitable/onetomany/webapp/webpage/${bussiPackage}/${entityPackage}/{${entityNameUncapFirst}-index.jsp => ${entityNameUncapFirst}-index.jspi} (76%) delete mode 100644 jeecg-framework/src/main/resources/jeecg/ext-common-template/multitable/onetomany/webapp/webpage/${bussiPackage}/${entityPackage}/${entityNameUncapFirst}-list.jsp create mode 100644 jeecg-framework/src/main/resources/jeecg/ext-common-template/multitable/onetomany/webapp/webpage/${bussiPackage}/${entityPackage}/${entityNameUncapFirst}-list.jspi rename jeecg-framework/src/main/resources/jeecg/ext-common-template/multitable/onetomany/webapp/webpage/${bussiPackage}/${entityPackage}/{${entityNameUncapFirst}-update.jsp => ${entityNameUncapFirst}-update.jspi} (55%) rename jeecg-framework/src/main/resources/jeecg/ext-common-template/multitable/onetomany/webapp/webpage/${bussiPackage}/${entityPackage}/{[1-n]sub-add.jsp => [1-n]sub-add.jspi} (100%) rename jeecg-framework/src/main/resources/jeecg/ext-common-template/multitable/onetomany/webapp/webpage/${bussiPackage}/${entityPackage}/{[1-n]sub-list.jsp => [1-n]sub-list.jspi} (100%) rename jeecg-framework/src/main/resources/jeecg/ext-common-template/multitable/onetomany/webapp/webpage/${bussiPackage}/${entityPackage}/{[1-n]sub-page-list.jsp => [1-n]sub-page-list.jspi} (100%) rename jeecg-framework/src/main/resources/jeecg/ext-common-template/multitable/onetomany/webapp/webpage/${bussiPackage}/${entityPackage}/{[1-n]sub-update.jsp => [1-n]sub-update.jspi} (100%) rename jeecg-framework/src/main/resources/jeecg/ext-common-template/multitable/onetomany/webapp/webpage/${bussiPackage}/${entityPackage}/{page-${entityNameUncapFirst}.jsp => page-${entityNameUncapFirst}.jspi} (88%) rename jeecg-framework/src/main/resources/jeecg/ext-common-template/naturebt/onetomany/java/${bussiPackage}/${entityPackage}/controller/{${entityName}Controller.java => ${entityName}Controller.javai} (97%) rename jeecg-framework/src/main/resources/jeecg/ext-common-template/{multitable/onetomany/java/${bussiPackage}/${entityPackage}/entity/${entityName}Entity.java => naturebt/onetomany/java/${bussiPackage}/${entityPackage}/entity/${entityName}Entity.javai} (100%) delete mode 100644 jeecg-framework/src/main/resources/jeecg/ext-common-template/naturebt/onetomany/java/${bussiPackage}/${entityPackage}/entity/[1-n]Entity.java create mode 100644 jeecg-framework/src/main/resources/jeecg/ext-common-template/naturebt/onetomany/java/${bussiPackage}/${entityPackage}/entity/[1-n]Entity.javai rename jeecg-framework/src/main/resources/jeecg/ext-common-template/naturebt/onetomany/java/${bussiPackage}/${entityPackage}/page/{${entityName}Page.java => ${entityName}Page.javai} (100%) rename jeecg-framework/src/main/resources/jeecg/ext-common-template/naturebt/onetomany/java/${bussiPackage}/${entityPackage}/service/{${entityName}ServiceI.java => ${entityName}ServiceI.javai} (100%) rename jeecg-framework/src/main/resources/jeecg/ext-common-template/naturebt/onetomany/java/${bussiPackage}/${entityPackage}/service/impl/{${entityName}ServiceImpl.java => ${entityName}ServiceImpl.javai} (100%) rename jeecg-framework/src/main/resources/jeecg/ext-common-template/naturebt/onetomany/webapp/webpage/${bussiPackage}/${entityPackage}/{${entityNameUncapFirst}-add.jsp => ${entityNameUncapFirst}-add.jspi} (81%) rename jeecg-framework/src/main/resources/jeecg/ext-common-template/naturebt/onetomany/webapp/webpage/${bussiPackage}/${entityPackage}/{${entityNameUncapFirst}-update.jsp => ${entityNameUncapFirst}-update.jspi} (76%) rename jeecg-framework/src/main/resources/jeecg/ext-common-template/naturebt/onetomany/webapp/webpage/${bussiPackage}/${entityPackage}/{${entityNameUncapFirst}List.jsp => ${entityNameUncapFirst}List.jspi} (91%) rename jeecg-framework/src/main/resources/jeecg/ext-common-template/naturebt/single/java/${bussiPackage}/${entityPackage}/controller/{${entityName}Controller.java => ${entityName}Controller.javai} (96%) rename jeecg-framework/src/main/resources/jeecg/ext-common-template/{element/single/java/${bussiPackage}/${entityPackage}/entity/${entityName}Entity.java => naturebt/single/java/${bussiPackage}/${entityPackage}/entity/${entityName}Entity.javai} (100%) rename jeecg-framework/src/main/resources/jeecg/ext-common-template/naturebt/single/java/${bussiPackage}/${entityPackage}/service/{${entityName}ServiceI.java => ${entityName}ServiceI.javai} (100%) rename jeecg-framework/src/main/resources/jeecg/ext-common-template/{element/single/java/${bussiPackage}/${entityPackage}/service/impl/${entityName}ServiceImpl.java => naturebt/single/java/${bussiPackage}/${entityPackage}/service/impl/${entityName}ServiceImpl.javai} (94%) rename jeecg-framework/src/main/resources/jeecg/ext-common-template/naturebt/single/webapp/webpage/${bussiPackage}/${entityPackage}/{${entityNameUncapFirst}-add.jsp => ${entityNameUncapFirst}-add.jspi} (81%) rename jeecg-framework/src/main/resources/jeecg/ext-common-template/naturebt/single/webapp/webpage/${bussiPackage}/${entityPackage}/{${entityNameUncapFirst}-update.jsp => ${entityNameUncapFirst}-update.jspi} (84%) rename jeecg-framework/src/main/resources/jeecg/ext-common-template/naturebt/single/webapp/webpage/${bussiPackage}/${entityPackage}/{${entityNameUncapFirst}List.jsp => ${entityNameUncapFirst}List.jspi} (96%) rename jeecg-framework/src/main/resources/jeecg/ext-common-template/table/onetomany/java/${bussiPackage}/${entityPackage}/controller/{${entityName}Controller.java => ${entityName}Controller.javai} (99%) rename jeecg-framework/src/main/resources/jeecg/ext-common-template/{naturebt/onetomany/java/${bussiPackage}/${entityPackage}/entity/${entityName}Entity.java => table/onetomany/java/${bussiPackage}/${entityPackage}/entity/${entityName}Entity.javai} (100%) delete mode 100644 jeecg-framework/src/main/resources/jeecg/ext-common-template/table/onetomany/java/${bussiPackage}/${entityPackage}/entity/[1-n]Entity.java rename jeecg-framework/src/main/resources/jeecg/ext-common-template/{element/onetomany/java/${bussiPackage}/${entityPackage}/entity/[1-n]Entity.java => table/onetomany/java/${bussiPackage}/${entityPackage}/entity/[1-n]Entity.javai} (100%) rename jeecg-framework/src/main/resources/jeecg/ext-common-template/table/onetomany/java/${bussiPackage}/${entityPackage}/page/{${entityName}Page.java => ${entityName}Page.javai} (100%) rename jeecg-framework/src/main/resources/jeecg/ext-common-template/table/onetomany/java/${bussiPackage}/${entityPackage}/service/{${entityName}ServiceI.java => ${entityName}ServiceI.javai} (100%) rename jeecg-framework/src/main/resources/jeecg/ext-common-template/table/onetomany/java/${bussiPackage}/${entityPackage}/service/impl/{${entityName}ServiceImpl.java => ${entityName}ServiceImpl.javai} (100%) rename jeecg-framework/src/main/resources/jeecg/ext-common-template/table/onetomany/webapp/webpage/${bussiPackage}/${entityPackage}/{${entityNameUncapFirst}-add.jsp => ${entityNameUncapFirst}-add.jspi} (100%) rename jeecg-framework/src/main/resources/jeecg/ext-common-template/table/onetomany/webapp/webpage/${bussiPackage}/${entityPackage}/{${entityNameUncapFirst}-update.jsp => ${entityNameUncapFirst}-update.jspi} (100%) rename jeecg-framework/src/main/resources/jeecg/ext-common-template/table/onetomany/webapp/webpage/${bussiPackage}/${entityPackage}/{${entityNameUncapFirst}.js => ${entityNameUncapFirst}.jsi} (100%) rename jeecg-framework/src/main/resources/jeecg/ext-common-template/table/onetomany/webapp/webpage/${bussiPackage}/${entityPackage}/{${entityNameUncapFirst}List.js => ${entityNameUncapFirst}List.jsi} (100%) rename jeecg-framework/src/main/resources/jeecg/ext-common-template/table/onetomany/webapp/webpage/${bussiPackage}/${entityPackage}/{${entityNameUncapFirst}List.jsp => ${entityNameUncapFirst}List.jspi} (100%) rename jeecg-framework/src/main/resources/jeecg/ext-common-template/table/onetomany/webapp/webpage/${bussiPackage}/${entityPackage}/{[1-n]sub.jsp => [1-n]sub.jspi} (100%) rename jeecg-framework/src/main/resources/jeecg/ext-common-template/table/single/java/${bussiPackage}/${entityPackage}/controller/{${entityName}Controller.java => ${entityName}Controller.javai} (98%) rename jeecg-framework/src/main/resources/jeecg/ext-common-template/{naturebt/single/java/${bussiPackage}/${entityPackage}/entity/${entityName}Entity.java => table/single/java/${bussiPackage}/${entityPackage}/entity/${entityName}Entity.javai} (100%) rename jeecg-framework/src/main/resources/jeecg/ext-common-template/table/single/java/${bussiPackage}/${entityPackage}/service/{${entityName}ServiceI.java => ${entityName}ServiceI.javai} (100%) rename jeecg-framework/src/main/resources/jeecg/ext-common-template/table/single/java/${bussiPackage}/${entityPackage}/service/impl/{${entityName}ServiceImpl.java => ${entityName}ServiceImpl.javai} (94%) rename jeecg-framework/src/main/resources/jeecg/ext-common-template/table/single/webapp/webpage/${bussiPackage}/${entityPackage}/{${entityNameUncapFirst}-add.jsp => ${entityNameUncapFirst}-add.jspi} (100%) rename jeecg-framework/src/main/resources/jeecg/ext-common-template/table/single/webapp/webpage/${bussiPackage}/${entityPackage}/{${entityNameUncapFirst}-update.jsp => ${entityNameUncapFirst}-update.jspi} (100%) rename jeecg-framework/src/main/resources/jeecg/ext-common-template/table/single/webapp/webpage/${bussiPackage}/${entityPackage}/{${entityNameUncapFirst}.js => ${entityNameUncapFirst}.jsi} (100%) rename jeecg-framework/src/main/resources/jeecg/ext-common-template/table/single/webapp/webpage/${bussiPackage}/${entityPackage}/{${entityNameUncapFirst}List.js => ${entityNameUncapFirst}List.jsi} (100%) rename jeecg-framework/src/main/resources/jeecg/ext-common-template/table/single/webapp/webpage/${bussiPackage}/${entityPackage}/{${entityNameUncapFirst}List.jsp => ${entityNameUncapFirst}List.jspi} (100%) create mode 100644 jeecg-framework/src/main/resources/jeecg/ext-common-template/ui/tdgColcb.ftl delete mode 100644 jeecg-framework/src/main/webapp/WEB-INF/lib/batik-all-1.6-20170917.jar delete mode 100644 jeecg-framework/src/main/webapp/WEB-INF/lib/codegenerate-3.6.3-20180503.jar create mode 100644 jeecg-framework/src/main/webapp/WEB-INF/lib/codegenerate-3.6.3-20180606.jar delete mode 100644 jeecg-framework/src/main/webapp/WEB-INF/lib/fop-1.0-20170917.jar delete mode 100644 jeecg-framework/src/main/webapp/WEB-INF/lib/freemarker-null-2.3.19-20170917.jar delete mode 100644 jeecg-framework/src/main/webapp/WEB-INF/lib/jacob-1.0.0-20170917.jar delete mode 100644 jeecg-framework/src/main/webapp/WEB-INF/lib/json-1.0-20170917.jar delete mode 100644 jeecg-framework/src/main/webapp/WEB-INF/lib/org.quartz-1.6.2-20170917.jar delete mode 100644 jeecg-framework/src/main/webapp/WEB-INF/lib/pinyin4j-2.5.0-20170917.jar delete mode 100644 jeecg-framework/src/main/webapp/WEB-INF/lib/ueditor-1.1.1-20170917.jar create mode 100644 jeecg-framework/src/main/webapp/plug-in/Flexpaper/swfobject.js create mode 100644 jeecg-framework/src/main/webapp/plug-in/element-ui/css/alert.css create mode 100644 jeecg-framework/src/main/webapp/plug-in/element-ui/css/aside.css create mode 100644 jeecg-framework/src/main/webapp/plug-in/element-ui/css/autocomplete.css create mode 100644 jeecg-framework/src/main/webapp/plug-in/element-ui/css/badge.css create mode 100644 jeecg-framework/src/main/webapp/plug-in/element-ui/css/base.css rename jeecg-framework/src/main/webapp/{webpage/com/jeecg/black/tsBlackListList.js => plug-in/element-ui/css/breadcrumb-item.css} (100%) create mode 100644 jeecg-framework/src/main/webapp/plug-in/element-ui/css/breadcrumb.css rename jeecg-framework/src/main/webapp/{webpage/com/jeecg/superquery/superQueryMainList.js => plug-in/element-ui/css/button-group.css} (100%) create mode 100644 jeecg-framework/src/main/webapp/plug-in/element-ui/css/button.css create mode 100644 jeecg-framework/src/main/webapp/plug-in/element-ui/css/card.css create mode 100644 jeecg-framework/src/main/webapp/plug-in/element-ui/css/carousel-item.css create mode 100644 jeecg-framework/src/main/webapp/plug-in/element-ui/css/carousel.css create mode 100644 jeecg-framework/src/main/webapp/plug-in/element-ui/css/cascader.css rename jeecg-framework/src/main/webapp/{webpage/jeecg/cgform/fillrule/tSFillRuleList.js => plug-in/element-ui/css/checkbox-button.css} (100%) create mode 100644 jeecg-framework/src/main/webapp/plug-in/element-ui/css/checkbox-group.css create mode 100644 jeecg-framework/src/main/webapp/plug-in/element-ui/css/checkbox.css create mode 100644 jeecg-framework/src/main/webapp/plug-in/element-ui/css/col.css create mode 100644 jeecg-framework/src/main/webapp/plug-in/element-ui/css/collapse-item.css create mode 100644 jeecg-framework/src/main/webapp/plug-in/element-ui/css/collapse.css create mode 100644 jeecg-framework/src/main/webapp/plug-in/element-ui/css/color-picker.css create mode 100644 jeecg-framework/src/main/webapp/plug-in/element-ui/css/container.css create mode 100644 jeecg-framework/src/main/webapp/plug-in/element-ui/css/date-picker.css create mode 100644 jeecg-framework/src/main/webapp/plug-in/element-ui/css/dialog.css create mode 100644 jeecg-framework/src/main/webapp/plug-in/element-ui/css/display.css create mode 100644 jeecg-framework/src/main/webapp/plug-in/element-ui/css/dropdown-item.css create mode 100644 jeecg-framework/src/main/webapp/plug-in/element-ui/css/dropdown-menu.css create mode 100644 jeecg-framework/src/main/webapp/plug-in/element-ui/css/dropdown.css create mode 100644 jeecg-framework/src/main/webapp/plug-in/element-ui/css/fonts/element-icons.ttf create mode 100644 jeecg-framework/src/main/webapp/plug-in/element-ui/css/fonts/element-icons.woff create mode 100644 jeecg-framework/src/main/webapp/plug-in/element-ui/css/footer.css create mode 100644 jeecg-framework/src/main/webapp/plug-in/element-ui/css/form-item.css create mode 100644 jeecg-framework/src/main/webapp/plug-in/element-ui/css/form.css create mode 100644 jeecg-framework/src/main/webapp/plug-in/element-ui/css/header.css create mode 100644 jeecg-framework/src/main/webapp/plug-in/element-ui/css/icon.css create mode 100644 jeecg-framework/src/main/webapp/plug-in/element-ui/css/index.css create mode 100644 jeecg-framework/src/main/webapp/plug-in/element-ui/css/input-number.css create mode 100644 jeecg-framework/src/main/webapp/plug-in/element-ui/css/input.css create mode 100644 jeecg-framework/src/main/webapp/plug-in/element-ui/css/loading.css create mode 100644 jeecg-framework/src/main/webapp/plug-in/element-ui/css/main.css create mode 100644 jeecg-framework/src/main/webapp/plug-in/element-ui/css/menu-item-group.css create mode 100644 jeecg-framework/src/main/webapp/plug-in/element-ui/css/menu-item.css create mode 100644 jeecg-framework/src/main/webapp/plug-in/element-ui/css/menu.css create mode 100644 jeecg-framework/src/main/webapp/plug-in/element-ui/css/message-box.css create mode 100644 jeecg-framework/src/main/webapp/plug-in/element-ui/css/message.css create mode 100644 jeecg-framework/src/main/webapp/plug-in/element-ui/css/notification.css create mode 100644 jeecg-framework/src/main/webapp/plug-in/element-ui/css/option-group.css create mode 100644 jeecg-framework/src/main/webapp/plug-in/element-ui/css/option.css create mode 100644 jeecg-framework/src/main/webapp/plug-in/element-ui/css/pagination.css create mode 100644 jeecg-framework/src/main/webapp/plug-in/element-ui/css/popover.css create mode 100644 jeecg-framework/src/main/webapp/plug-in/element-ui/css/popper.css create mode 100644 jeecg-framework/src/main/webapp/plug-in/element-ui/css/progress.css create mode 100644 jeecg-framework/src/main/webapp/plug-in/element-ui/css/radio-button.css create mode 100644 jeecg-framework/src/main/webapp/plug-in/element-ui/css/radio-group.css create mode 100644 jeecg-framework/src/main/webapp/plug-in/element-ui/css/radio.css create mode 100644 jeecg-framework/src/main/webapp/plug-in/element-ui/css/rate.css create mode 100644 jeecg-framework/src/main/webapp/plug-in/element-ui/css/reset.css create mode 100644 jeecg-framework/src/main/webapp/plug-in/element-ui/css/row.css create mode 100644 jeecg-framework/src/main/webapp/plug-in/element-ui/css/scrollbar.css create mode 100644 jeecg-framework/src/main/webapp/plug-in/element-ui/css/select-dropdown.css create mode 100644 jeecg-framework/src/main/webapp/plug-in/element-ui/css/select.css create mode 100644 jeecg-framework/src/main/webapp/plug-in/element-ui/css/slider.css create mode 100644 jeecg-framework/src/main/webapp/plug-in/element-ui/css/spinner.css create mode 100644 jeecg-framework/src/main/webapp/plug-in/element-ui/css/step.css create mode 100644 jeecg-framework/src/main/webapp/plug-in/element-ui/css/steps.css create mode 100644 jeecg-framework/src/main/webapp/plug-in/element-ui/css/submenu.css create mode 100644 jeecg-framework/src/main/webapp/plug-in/element-ui/css/switch.css create mode 100644 jeecg-framework/src/main/webapp/plug-in/element-ui/css/tab-pane.css create mode 100644 jeecg-framework/src/main/webapp/plug-in/element-ui/css/table-column.css create mode 100644 jeecg-framework/src/main/webapp/plug-in/element-ui/css/table.css create mode 100644 jeecg-framework/src/main/webapp/plug-in/element-ui/css/tabs.css create mode 100644 jeecg-framework/src/main/webapp/plug-in/element-ui/css/tag.css create mode 100644 jeecg-framework/src/main/webapp/plug-in/element-ui/css/time-picker.css create mode 100644 jeecg-framework/src/main/webapp/plug-in/element-ui/css/time-select.css create mode 100644 jeecg-framework/src/main/webapp/plug-in/element-ui/css/tooltip.css create mode 100644 jeecg-framework/src/main/webapp/plug-in/element-ui/css/transfer.css create mode 100644 jeecg-framework/src/main/webapp/plug-in/element-ui/css/tree.css create mode 100644 jeecg-framework/src/main/webapp/plug-in/element-ui/css/upload.css create mode 100644 jeecg-framework/src/main/webapp/plug-in/element-ui/index.js create mode 100644 jeecg-framework/src/main/webapp/plug-in/mutitables/datagrid-filter.js create mode 100644 jeecg-framework/src/main/webapp/plug-in/mutitables/datagrid.menu.css create mode 100644 jeecg-framework/src/main/webapp/plug-in/mutitables/jquery.resize.y.js create mode 100644 jeecg-framework/src/main/webapp/plug-in/printthis/printThis.js create mode 100644 jeecg-framework/src/main/webapp/plug-in/vue/vue-resource.js create mode 100644 jeecg-framework/src/main/webapp/plug-in/vue/vue.js delete mode 100644 jeecg-framework/src/main/webapp/webpage/com/jeecg/black/tsBlackList.js create mode 100644 jeecg-framework/src/main/webapp/webpage/com/jeecg/demo/echartsDemo/bootstrap-echarts.jsp create mode 100644 jeecg-framework/src/main/webapp/webpage/com/jeecg/demo/form_webuploader.jsp create mode 100644 jeecg-framework/src/main/webapp/webpage/com/jeecg/demo/jfromOrderGridViewList.jsp create mode 100644 jeecg-framework/src/main/webapp/webpage/common/upload/mutitables_excel_upload.jsp rename jeecg-framework/src/main/webapp/webpage/{com => }/jeecg/black/tsBlackList-add.jsp (96%) rename jeecg-framework/src/main/webapp/webpage/{com => }/jeecg/black/tsBlackList-update.jsp (96%) rename jeecg-framework/src/main/webapp/webpage/{com => }/jeecg/black/tsBlackListList.jsp (96%) delete mode 100644 jeecg-framework/src/main/webapp/webpage/jeecg/cgform/fillrule/tSFillRule.js create mode 100644 jeecg-framework/src/main/webapp/webpage/jeecg/superquery/dialog.jsp rename jeecg-framework/src/main/webapp/webpage/{com => }/jeecg/superquery/superQueryFieldList.jsp (98%) rename jeecg-framework/src/main/webapp/webpage/{com => }/jeecg/superquery/superQueryMain-add.jsp (98%) rename jeecg-framework/src/main/webapp/webpage/{com => }/jeecg/superquery/superQueryMain-update.jsp (98%) rename jeecg-framework/src/main/webapp/webpage/{com => }/jeecg/superquery/superQueryMain.js (100%) create mode 100644 jeecg-framework/src/main/webapp/webpage/jeecg/superquery/superQueryMainList.js rename jeecg-framework/src/main/webapp/webpage/{com => }/jeecg/superquery/superQueryMainList.jsp (96%) rename jeecg-framework/src/main/webapp/webpage/{com => }/jeecg/superquery/superQueryTableList.jsp (99%) create mode 100644 jeecg-framework/src/main/webapp/webpage/login/login-ace.js create mode 100644 jeecg-framework/src/main/webapp/webpage/system/user/interfaceUserList.jsp create mode 100644 jeecg-framework/src/test/java/org/jeecgframework/test/demo/DynamicDBTest.java delete mode 100644 jeecg-framework/src/test/java/org/jeecgframework/test/demo/RedisUtilTest.java diff --git a/README.md b/README.md index d7d590b9..24dfefda 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ JEECG ΢ƿٿƽ̨ =============== -ǰ°汾 3.7.5 betaڣ20180519 +ǰ°汾 3.7.6ڣ20180607 ǰԣ ----------------------------------- @@ -27,8 +27,7 @@ JEECG * 4.װƵûȨޡǿȨޡֵȻܣֱʹ޸ * 5.ùͨװֹ(ʱ,Žӿ,ʼ,Excel),80%Ŀ * 6.ɼױߣͼ񱨱ݵdz㣬ɼ䷽pdfexcelwordȱ -* 7.ɹactivitiʵ߻̡ñ̴룬ǿOAԶļbpmĿͨչӿڱдҵ񣬷ҵչ -* 7.ʵ֣ʵ˸йĹܣתⲵءίɵȵȣ̽ڵ֧øԻͬʱwebƶͬУһ˫ +* 7.ɹactivitiʵֻҳת򣬿ɼļjbpmĿjbpmһˣֻдjava룻 * 8.UIǩ⣬WEB UIб׼ʽװҳͳһԶǩʵֹܣбչ֡ҳУ,ǩʹüұά * 9.ƣÿԴActiviti棬ʵ߻,Զ,ҿ,ҵת * 10.ѯѯԶɣ̨̬ƴSQL׷Ӳѯֶ֧ƥ䷽ʽȫƥ/ģѯ/ѯ/ƥѯ @@ -79,7 +78,7 @@ JEECG * ʮ壺ֶ֧ԱȨϸ
* ʮ֧resutfulӿ
-* JEECG V3.7.5 beta, רҵѹ,ܲԣ̨֤ݵ׼ȷԺҳٶ
+* JEECG V3.7.6, רҵѹ,ܲԣ̨֤ݵ׼ȷԺҳٶ
* ֶ֧: IE, , Google
* ֧ݿ: Mysql,Oracle,Postgre,SqlServer
* Ȩ: ûɫ˵ȨޣťȨޣȨ
diff --git a/jeecg-framework/docs/jeecg_3.7.5_beta_mysql.sql b/jeecg-framework/docs/jeecg_3.7.6_mysql.sql similarity index 99% rename from jeecg-framework/docs/jeecg_3.7.5_beta_mysql.sql rename to jeecg-framework/docs/jeecg_3.7.6_mysql.sql index eea10549..c879c327 100644 --- a/jeecg-framework/docs/jeecg_3.7.5_beta_mysql.sql +++ b/jeecg-framework/docs/jeecg_3.7.6_mysql.sql @@ -4,13 +4,13 @@ Navicat MySQL Data Transfer Source Server : mysql Source Server Version : 50037 Source Host : 127.0.0.1:3306 -Source Database : jeecg_3_7_5 +Source Database : jeecg_3_7_6 Target Server Type : MYSQL Target Server Version : 50037 File Encoding : 65001 -Date: 2018-05-19 16:40:58 +Date: 2018-06-06 20:37:32 */ SET FOREIGN_KEY_CHECKS=0; @@ -1021,7 +1021,7 @@ CREATE TABLE `jeecg_demo` ( `name` varchar(255) NOT NULL COMMENT '名称', `age` int(10) default NULL COMMENT '年龄', `birthday` datetime default NULL COMMENT '生日', - `content` varchar(255) default NULL COMMENT '个人介绍', + `content` text COMMENT '个人介绍', `dep_id` varchar(255) default NULL COMMENT '部门', `email` varchar(255) default NULL COMMENT '邮箱', `phone` varchar(255) default NULL COMMENT '电话', @@ -1705,7 +1705,7 @@ CREATE TABLE `jform_graphreport_head` ( `update_by` varchar(50) default NULL, `update_name` varchar(100) default NULL, PRIMARY KEY (`id`), - KEY `index_code` (`code`) + UNIQUE KEY `index_code` (`code`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- ---------------------------- @@ -3059,21 +3059,14 @@ CREATE TABLE `t_s_black_list` ( `sys_company_code` varchar(50) default NULL COMMENT '所属公司', `bpm_status` varchar(32) default '1' COMMENT '流程状态', `ip` varchar(32) default NULL COMMENT 'ip地址', - PRIMARY KEY (`id`) + PRIMARY KEY (`id`), + UNIQUE KEY `unique_key_ip` (`ip`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- ---------------------------- -- Records of t_s_black_list -- ---------------------------- INSERT INTO `t_s_black_list` VALUES ('402881e75f91017e015f91023f7c0001', '管理员', 'admin', '2017-11-06 19:06:04', null, null, null, 'A03', 'A03', '1', '192.1562.1.1'); -INSERT INTO `t_s_black_list` VALUES ('402881e75f947fc7015f9481be250004', '管理员', 'admin', '2017-11-06 14:53:22', '管理员', 'admin', '2018-05-19 14:03:18', 'A03', 'A03', '1', '1.0.0.1'); -INSERT INTO `t_s_black_list` VALUES ('402881e75f948375015f94842cc30001', '管理员', 'admin', '2017-11-06 14:53:22', null, null, null, 'A03', 'A03', '1', '1.0.0.1'); -INSERT INTO `t_s_black_list` VALUES ('402881e75f94878e015f948921d30001', '管理员', 'admin', '2017-11-06 18:53:22', null, null, null, 'A03', 'A03', '1', '1.0.0.1'); -INSERT INTO `t_s_black_list` VALUES ('402881e75f94878e015f94896bb80002', '管理员', 'admin', '2017-11-06 00:00:00', null, null, null, 'A03', 'A03', '1', '1.0.0.1'); -INSERT INTO `t_s_black_list` VALUES ('402881e75f949b19015f949cde920001', '管理员', 'admin', '2017-11-11 14:53:22', null, null, null, 'A03', 'A03', '1', '1.0.0.1'); -INSERT INTO `t_s_black_list` VALUES ('402881e75f949b19015f949d07ad0002', '管理员', 'admin', '2017-11-11 00:00:00', null, null, null, 'A03', 'A03', '1', '1.0.0.1'); -INSERT INTO `t_s_black_list` VALUES ('402881e75f94a099015f94a1c66e0001', '管理员', 'admin', '2017-11-11 14:53:22', null, null, null, 'A03', 'A03', '1', '1.0.0.1'); -INSERT INTO `t_s_black_list` VALUES ('402881e75f94a099015f94a1dd040002', '管理员', 'admin', '2017-11-11 00:00:00', null, null, null, 'A03', 'A03', '1', '1.0.0.1'); INSERT INTO `t_s_black_list` VALUES ('402881e75f94a099015f94afe9700003', '管理员', 'admin', '2017-11-07 12:14:37', null, null, '2017-11-11 08:00:00', 'A03', 'A03', '1', '1.0.0.1'); INSERT INTO `t_s_black_list` VALUES ('402881e75fa48e5b015fa494806a0002', '管理员', 'admin', '2017-11-12 06:14:12', null, null, null, 'A03', 'A03', '1', '2.2.2.2'); INSERT INTO `t_s_black_list` VALUES ('402881e75fa48e5b015fa49494680003', '管理员', 'admin', '2017-11-12 06:14:12', null, null, null, 'A03', 'A03', '1', '2.2.2.3'); @@ -3232,7 +3225,6 @@ INSERT INTO `t_s_data_rule` VALUES ('4028ab775dca0d1b015dca4183530018', '表名 INSERT INTO `t_s_data_rule` VALUES ('402880ec5ddec439015ddf9225060038', '复杂关系', '', 'USE_SQL_RULES', 'name like \'%张%\' or age > 10', null, null, null, '2017-08-14 15:10:25', 'demo', 'demo', '40288088481d019401481d2fcebf000d'); INSERT INTO `t_s_data_rule` VALUES ('402880ec5ddfdd26015ddfe3e0570011', '复杂sql配置', '', 'USE_SQL_RULES', 'table_name like \'%test%\' or is_tree = \'Y\'', null, null, null, '2017-08-14 16:38:55', 'demo', 'demo', '4028ab775dca0d1b015dca3fccb60016'); INSERT INTO `t_s_data_rule` VALUES ('40283181614231d401614234fe670003', 'createBy', 'createBy', '=', '#{sys_user_code}', '2018-01-29 21:57:04', 'admin', '管理员', null, null, null, '40283181614231d401614232cd1c0001'); -INSERT INTO `t_s_data_rule` VALUES ('4028318161424e730161424fca6f0004', 'createBy', 'createBy', '=', '#{sys_user_code}', '2018-01-29 22:26:20', 'admin', '管理员', null, null, null, '4028318161424e730161424f61510002'); INSERT INTO `t_s_data_rule` VALUES ('402881e56266f43101626727aff60067', '销售自己看自己的数据', 'createBy', '=', '#{sys_user_code}', '2018-03-27 19:11:16', 'admin', '管理员', null, null, null, '402881e56266f43101626724eb730065'); INSERT INTO `t_s_data_rule` VALUES ('402881e56266f4310162672fb1a70082', '销售经理看所有下级数据', 'sysOrgCode', 'LIKE', '#{sys_org_code}', '2018-03-27 19:20:01', 'admin', '管理员', null, null, null, '402881e56266f43101626724eb730065'); INSERT INTO `t_s_data_rule` VALUES ('402881e56266f431016267387c9f0088', '只看金额大于1000的数据', 'money', '>=', '1000', '2018-03-27 19:29:37', 'admin', '管理员', null, null, null, '402881e56266f43101626724eb730065'); @@ -3496,7 +3488,6 @@ INSERT INTO `t_s_function` VALUES ('297e7ae162b925a20162b9271b300001', null, '1' INSERT INTO `t_s_function` VALUES ('297edb626033bbcb016033fd0a190001', null, '1', 'Online组合查询配置', '6', 'superQueryMainController.do?list', '8a8ab0b246dc81120146dc8180ce0019', '8a8ab0b246dc81120146dc8180460000', '8a8ab0b246dc81120146dc8180dd001e', '0', '', 'admin', '管理员', 'admin', '2018-05-06 14:53:26', '2017-12-08 10:38:29', '管理员'); INSERT INTO `t_s_function` VALUES ('2c90ac564c9d1734014c9d6f4e370024', null, '1', 'menu.graph.configuration', '4', 'jformGraphreportHeadController.do?jformGraphreportHead', '8a8ab0b246dc81120146dc8180ce0019', '8a8ab0b246dc81120146dc8180460000', '8a8ab0b246dc81120146dc8180dd001e', '0', null, null, null, null, null, null, null); INSERT INTO `t_s_function` VALUES ('40283181614231d401614232cd1c0001', null, '1', '移动报表数据权限', '9', 'cgDynamGraphConfigHeadController.do?datagrid', '402889fb486e848101486e8de3d60005', '8a8ab0b246dc81120146dc8180460000', '8a8ab0b246dc81120146dc8180dd001e', '0', '', 'admin', '管理员', 'admin', '2018-01-29 22:25:34', '2018-01-29 21:54:41', '管理员'); -INSERT INTO `t_s_function` VALUES ('4028318161424e730161424f61510002', null, '1', '在线报表权限', '10', 'jformGraphreportHeadController.do?datagrid', '402889fb486e848101486e8de3d60005', '8a8ab0b246dc81120146dc8180460000', '8a8ab0b246dc81120146dc8180dd001e', '0', '', 'admin', '管理员', null, null, '2018-01-29 22:25:54', null); INSERT INTO `t_s_function` VALUES ('40284a815b48b411015b48b56fd80001', null, '1', '动态tab设计', '24', 'jeecgFormDemoController.do?ueditor', '4028f6815af3ce54015af3d1ad610001', '8a8ab0b246dc81120146dc8180460000', '8a8ab0b246dc81120146dc8180dd001e', '0', 'icon-bug', null, null, 'admin', '2017-11-14 11:32:23', null, '管理员'); INSERT INTO `t_s_function` VALUES ('40284a815bb75d7b015bb7607ba00001', null, '1', '电子签章', '25', 'jeecgFormDemoController.do?eSign', '4028f6815af3ce54015af3d1ad610001', '8a8ab0b246dc81120146dc8180460000', '8a8ab0b246dc81120146dc8180dd001e', '0', 'fa-empire', 'admin', '管理员', 'admin', '2017-11-14 11:32:52', '2017-04-29 09:43:25', '管理员'); INSERT INTO `t_s_function` VALUES ('40284a815c1bac76015c1bc02abe0003', null, '1', '黑名单管理', '9', 'tsBlackListController.do?list', '8a8ab0b246dc81120146dc8180d9001d', '8a8ab0b246dc81120146dc8180460000', '8a8ab0b246dc81120146dc8180dd001e', '0', '', null, null, 'admin', '2018-05-06 17:02:49', null, '管理员'); @@ -3570,6 +3561,9 @@ INSERT INTO `t_s_function` VALUES ('402881f4606cc3d501606cd07a520005', null, '1' INSERT INTO `t_s_function` VALUES ('402881f4609299ad0160929ab2e00001', null, '1', '二级管理员', '6', '', '8a8ab0b246dc81120146dc8180d2001a', '8a8ab0b246dc81120146dc8180460000', '8a8ab0b246dc81120146dc8180dd001e', '0', 'fa-group', 'admin', '管理员', 'admin', '2018-01-16 17:20:57', '2017-12-26 19:35:00', '管理员'); INSERT INTO `t_s_function` VALUES ('402881f462bcd9fe0162bcdd0e4c0001', null, '1', 'vue列表', '32', 'jeecgListDemoController.do?vueList', '4028f6815af3ce54015af3d1ad610001', '8a8ab0b246dc81120146dc8180460000', '8a8ab0b246dc81120146dc8180dd001e', '0', 'fa-vimeo-square', 'admin', '管理员', 'admin', '2018-05-06 14:56:17', '2018-04-13 10:37:07', '管理员'); INSERT INTO `t_s_function` VALUES ('402881f462fa6ee90162fa78deba0001', null, '1', 'vueBootstrap', '33', 'jeecgListDemoController.do?vueBootstrapTableList', '4028f6815af3ce54015af3d1ad610001', '8a8ab0b246dc81120146dc8180460000', '8a8ab0b246dc81120146dc8180dd001e', '0', 'fa-vimeo-square', 'admin', '管理员', 'admin', '2018-05-06 14:56:04', '2018-04-25 09:44:08', '管理员'); +INSERT INTO `t_s_function` VALUES ('402881f463a591710163a5e59a830010', null, '2', '接口用户管理', '3', 'userController.do?interfaceUser', '402881fc60a07a350160a07cf68e0001', '8a8ab0b246dc81120146dc8180460000', '8a8ab0b246dc81120146dc8180dd001e', '0', '', 'admin', '管理员', null, null, '2018-05-28 16:37:58', null); +INSERT INTO `t_s_function` VALUES ('402881f463b4e5d20163b4f9a81b0001', null, '1', 'Bootstrap布局报表', '34', 'jeecgListDemoController.do?bootStrapEchartsDemo', '8a8ab0b246dc81120146dc8180d4001b', '8a8ab0b246dc81120146dc8180460000', '8a8ab0b246dc81120146dc8180dd001e', '0', '', 'admin', '管理员', 'admin', '2018-05-31 19:48:06', '2018-05-31 14:54:10', '管理员'); +INSERT INTO `t_s_function` VALUES ('402881f463b56b950163b5aefcdb0002', null, '1', '自定义嵌套子表列表', '35', 'jfromOrderController.do?gridViewlist', '4028f6815af3ce54015af3d1ad610001', '8a8ab0b246dc81120146dc8180460000', '8a8ab0b246dc81120146dc8180dd001e', '0', '', 'admin', '管理员', null, null, '2018-05-31 18:12:14', null); INSERT INTO `t_s_function` VALUES ('402881f66260fc8e016260ffdde70001', null, '1', '上下布局表单二', '21', 'jformOrderMain2Controller.do?index', '4028f6815af3ce54015af3d1ad610001', '8a8ab0b246dc81120146dc8180460000', '8a8ab0b246dc81120146dc8180dd001e', '0', 'fa-facebook-official', 'admin', '管理员', 'admin', '2018-05-06 15:39:26', '2018-03-26 14:30:04', '管理员'); INSERT INTO `t_s_function` VALUES ('402881fc60a07a350160a07cf68e0001', null, '1', '接口权限', '6', '', '8a8ab0b246dc81120146dc8180d2001a', '8a8ab0b246dc81120146dc8180460000', '8a8ab0b246dc81120146dc8180dd001e', '0', 'fa-share-alt', 'admin', '管理员', 'admin', '2018-01-16 17:20:36', '2017-12-29 12:17:12', '管理员'); INSERT INTO `t_s_function` VALUES ('402881fc60a07a350160a07d4f860003', null, '2', '接口权限管理', '1', 'interfaceController.do?interface', '402881fc60a07a350160a07cf68e0001', '8a8ab0b246dc81120146dc8180460000', '8a8ab0b246dc81120146dc8180dd001e', '0', '', 'admin', '管理员', null, null, '2017-12-29 12:17:35', null); @@ -3614,6 +3608,7 @@ INSERT INTO `t_s_function` VALUES ('4028f6815af9fb56015af9fc51d30001', null, '1' INSERT INTO `t_s_function` VALUES ('4028f6815afa8964015afa8a63e20001', null, '1', '行编辑列表', '4', 'jeecgListDemoController.do?rowListDemo', '4028f6815af3ce54015af3d1ad610001', '8a8ab0b246dc81120146dc8180460000', '8a8ab0b246dc81120146dc8180dd001e', '0', 'icon-frown', 'admin', '管理员', 'admin', '2018-05-06 15:00:17', '2017-03-23 17:40:57', '管理员'); INSERT INTO `t_s_function` VALUES ('4028f6815b0b1017015b0b1265cf0002', null, '2', '日志报表', '25', 'jeecgListDemoController.do?log', '4028810061f41d790161f4e293140015', '8a8ab0b246dc81120146dc8180460000', '8a8ab0b246dc81120146dc8180dd001e', '0', 'fa-pencil-square', null, null, 'admin', '2018-05-06 16:57:13', null, '管理员'); INSERT INTO `t_s_function` VALUES ('4028f681630b600701630bc1eee30030', null, '1', 'Easyui原生列表', '5', 'jeecgListDemoController.do?natureAceTableDemo', '4028f6815af3ce54015af3d1ad610001', '8a8ab0b246dc81120146dc8180460000', '8a8ab0b246dc81120146dc8180dd001e', '0', 'fa-code', 'admin', '管理员', 'admin', '2018-05-06 15:29:42', '2018-04-28 18:17:29', '管理员'); +INSERT INTO `t_s_function` VALUES ('4028f68163b5547e0163b55616930001', null, '1', '上传重构demo', '34', 'jeecgFormDemoController.do?webuploader', '4028f6815af3ce54015af3d1ad610001', '8a8ab0b246dc81120146dc8180460000', '8a8ab0b246dc81120146dc8180dd001e', '0', '', 'admin', '管理员', null, null, '2018-05-31 16:35:08', null); INSERT INTO `t_s_function` VALUES ('4028fbc65c3ab6e3015c3ab7ba690003', null, '1', '文件上传一', '14', 'commonController.do?listTurn&turn=system/document/filesList', '4028f6815af3ce54015af3d1ad610001', '8a8ab0b246dc81120146dc8180460000', '8a8ab0b246dc81120146dc8180dd001e', '0', 'fa-files-o', null, null, 'admin', '2018-05-06 15:07:01', null, '管理员'); INSERT INTO `t_s_function` VALUES ('4028fbc65c56ece6015c56f508300002', null, '1', '树形列表', '4', 'jeecgFormDemoController.do?function', '4028f6815af3ce54015af3d1ad610001', '8a8ab0b246dc81120146dc8180460000', '8a8ab0b246dc81120146dc8180dd001e', '0', 'fa-tree', null, null, 'admin', '2017-11-14 11:35:33', null, '管理员'); INSERT INTO `t_s_function` VALUES ('8a8ab0b246dc81120146dc8180ce0019', null, '0', 'online.develop', '5', '', null, '8a8ab0b246dc81120146dc8180890008', '8a8ab0b246dc81120146dc8180dd001e', '0', 'fa-cloud', null, null, 'admin', '2016-04-08 22:28:17', null, '管理员'); @@ -14513,6 +14508,13 @@ INSERT INTO `t_s_log` VALUES ('4028608163773dd40163776268610012', 'Chrome', '错 INSERT INTO `t_s_log` VALUES ('4028608163773dd401637762890d0013', 'Chrome', '错误异常: ObjectNotFoundException,错误描述:No row with the given identifier exists: [org.jeecgframework.web.system.pojo.base.TSFunction#4028838d5f351a87015f351fc33d0002]', '6', '本地', '2018-05-19 15:52:16', '3', '8a8ab0b246dc81120146dc8181950052', 'admin', '管理员'); INSERT INTO `t_s_log` VALUES ('4028608163773dd401637762e7190014', 'Chrome', '错误异常: ObjectNotFoundException,错误描述:No row with the given identifier exists: [org.jeecgframework.web.system.pojo.base.TSFunction#4028838d5f351a87015f351fc33d0002]', '6', '本地', '2018-05-19 15:52:40', '3', '8a8ab0b246dc81120146dc8181950052', 'admin', '管理员'); INSERT INTO `t_s_log` VALUES ('4028608163773dd401637767f5c60015', 'Chrome', '错误异常: ObjectNotFoundException,错误描述:No row with the given identifier exists: [org.jeecgframework.web.system.pojo.base.TSFunction#4028911b5c0bf9b9015c0c034d8e0013]', '6', '本地', '2018-05-19 15:58:11', '3', '8a8ab0b246dc81120146dc8181950052', 'admin', '管理员'); +INSERT INTO `t_s_log` VALUES ('4028608163d50e5d0163d50eb6bd0000', 'Chrome', '用户: admin[JEECG开源社区]common.login.success', '1', '192.168.224.1', '2018-06-06 20:25:01', '1', '8a8ab0b246dc81120146dc8181950052', 'admin', '管理员'); +INSERT INTO `t_s_log` VALUES ('4028608163d50e5d0163d50fc4310001', 'Chrome', '操作删除成功', '4', '本地', '2018-06-06 20:26:10', '1', '8a8ab0b246dc81120146dc8181950052', 'admin', '管理员'); +INSERT INTO `t_s_log` VALUES ('4028608163d50e5d0163d50fd51f0002', 'Chrome', '菜单删除成功', '4', '本地', '2018-06-06 20:26:14', '1', '8a8ab0b246dc81120146dc8181950052', 'admin', '管理员'); +INSERT INTO `t_s_log` VALUES ('4028608163d50e5d0163d50fe9ce0003', 'Chrome', 'admin', '2', '本地', '2018-06-06 20:26:19', '1', '8a8ab0b246dc81120146dc8181950052', 'admin', '管理员'); +INSERT INTO `t_s_log` VALUES ('4028608163d50e5d0163d51004580004', 'Chrome', '用户: admin[JEECG开源社区]common.login.success', '1', '192.168.224.1', '2018-06-06 20:26:26', '1', '8a8ab0b246dc81120146dc8181950052', 'admin', '管理员'); +INSERT INTO `t_s_log` VALUES ('4028608163d50e5d0163d510c7e40005', 'Chrome', 'admin', '2', '本地', '2018-06-06 20:27:16', '1', '8a8ab0b246dc81120146dc8181950052', 'admin', '管理员'); +INSERT INTO `t_s_log` VALUES ('4028608163d50e5d0163d510dd7b0006', 'Chrome', '用户: admin[JEECG开源社区]common.login.success', '1', '192.168.224.1', '2018-06-06 20:27:22', '1', '8a8ab0b246dc81120146dc8181950052', 'admin', '管理员'); -- ---------------------------- -- Table structure for t_s_muti_lang @@ -15209,8 +15211,8 @@ INSERT INTO `t_s_muti_lang` VALUES ('4028ef81533051360153305c60c90008', 'form.te INSERT INTO `t_s_muti_lang` VALUES ('4028ef815335c1da015335c8647d0003', 'self.defined.form', 'use defined form', 'en', '2016-03-02 13:23:58', 'admin', '管理员', null, null, null); INSERT INTO `t_s_muti_lang` VALUES ('4028ef81533a788e01533a7a53180005', 'form.tb.db.table.name', 'table', 'en', '2016-03-03 11:16:48', 'admin', '管理员', '2016-03-03 11:17:56', 'admin', '管理员'); INSERT INTO `t_s_muti_lang` VALUES ('4028ef81533a788e01533a7ba98c0008', 'form.tb.db.key', 'db source', 'en', '2016-03-03 11:18:16', 'admin', '管理员', null, null, null); -INSERT INTO `t_s_muti_lang` VALUES ('4028ef81533c078201533c08b1ca0001', 'system.version.number', '3.7.5-beta', 'zh-cn', '2016-03-03 18:31:56', 'admin', '管理员', '2016-06-29 11:50:18', 'admin', '管理员'); -INSERT INTO `t_s_muti_lang` VALUES ('4028ef81533c078201533c08e2370003', 'system.version.number', '3.7.5-beta', 'en', '2016-03-03 18:32:08', 'admin', '管理员', '2016-06-29 11:50:12', 'admin', '管理员'); +INSERT INTO `t_s_muti_lang` VALUES ('4028ef81533c078201533c08b1ca0001', 'system.version.number', '3.7.6', 'zh-cn', '2016-03-03 18:31:56', 'admin', '管理员', '2016-06-29 11:50:18', 'admin', '管理员'); +INSERT INTO `t_s_muti_lang` VALUES ('4028ef81533c078201533c08e2370003', 'system.version.number', '3.7.6', 'en', '2016-03-03 18:32:08', 'admin', '管理员', '2016-06-29 11:50:12', 'admin', '管理员'); INSERT INTO `t_s_muti_lang` VALUES ('4028ef8154753f26015475436db30001', 'common.returntxttype', 'return type', 'en', '2016-05-03 14:17:13', 'admin', '管理员', '2016-05-03 14:41:57', 'admin', '管理员'); INSERT INTO `t_s_muti_lang` VALUES ('4028ef8154753f26015475438dd00003', 'common.returntxttype', '返回类型', 'zh-cn', '2016-05-03 14:17:22', 'admin', '管理员', '2016-05-03 14:42:06', 'admin', '管理员'); INSERT INTO `t_s_muti_lang` VALUES ('4028efa2523a030601523a55381d0004', 'self.defined.form', '自定义表单', 'zh-cn', '2016-01-13 17:33:29', 'admin', '管理员', null, null, null); @@ -15221,8 +15223,8 @@ INSERT INTO `t_s_muti_lang` VALUES ('4028fc4d46c481da0146c4a15aa60003', 'common. INSERT INTO `t_s_muti_lang` VALUES ('4028fc4d46c481da0146c4a190580005', 'common.calendar', 'Calendar', 'en', '2014-06-23 01:31:01', 'admin', '管理员', '2014-06-23 01:31:01', 'admin', '管理员'); INSERT INTO `t_s_muti_lang` VALUES ('4028fc4d46c481da0146c4a2dc220007', 'common.map', '地图', 'zh-cn', '2014-06-23 01:32:26', 'admin', '管理员', '2014-06-23 01:32:26', 'admin', '管理员'); INSERT INTO `t_s_muti_lang` VALUES ('4028fc4d46c481da0146c4a2f24e0009', 'common.map', 'Map', 'en', '2014-06-23 01:32:31', 'admin', '管理员', '2014-06-23 01:32:31', 'admin', '管理员'); -INSERT INTO `t_s_muti_lang` VALUES ('4028fc4d46c481da0146c4aff7ea000b', 'common.please.select', '-- 请选择 --', 'zh-cn', '2014-06-23 01:46:45', 'admin', '管理员', '2017-11-06 10:37:16', 'admin', '管理员'); -INSERT INTO `t_s_muti_lang` VALUES ('4028fc4d46c481da0146c4b03310000d', 'common.please.select', 'Please Select', 'en', '2014-06-23 01:47:00', 'admin', '管理员', '2014-06-23 02:01:20', 'admin', '管理员'); +INSERT INTO `t_s_muti_lang` VALUES ('4028fc4d46c481da0146c4aff7ea000b', 'common.please.select', ' ', 'zh-cn', '2014-06-23 01:46:45', 'admin', '管理员', '2017-11-06 10:37:16', 'admin', '管理员'); +INSERT INTO `t_s_muti_lang` VALUES ('4028fc4d46c481da0146c4b03310000d', 'common.please.select', ' ', 'en', '2014-06-23 01:47:00', 'admin', '管理员', '2014-06-23 02:01:20', 'admin', '管理员'); INSERT INTO `t_s_muti_lang` VALUES ('4028fc4d46c481da0146c4b8af79000f', 'common.please.input.keyword', '请输入关键字', 'zh-cn', '2014-06-23 01:56:16', 'admin', '管理员', '2014-06-23 01:56:16', 'admin', '管理员'); INSERT INTO `t_s_muti_lang` VALUES ('4028fc4d46c481da0146c4b8f7aa0011', 'common.please.input.keyword', 'Keyword', 'en', '2014-06-23 01:56:34', 'admin', '管理员', '2014-06-23 01:56:34', 'admin', '管理员'); INSERT INTO `t_s_muti_lang` VALUES ('4028fc4d46c481da0146c4ba979a0013', 'common.please.input.query.keyword', '请输入查询关键字', 'zh-cn', '2014-06-23 01:58:21', 'admin', '管理员', '2014-06-23 01:58:21', 'admin', '管理员'); @@ -19460,10 +19462,10 @@ CREATE TABLE `t_s_role` ( -- Records of t_s_role -- ---------------------------- INSERT INTO `t_s_role` VALUES ('4028608163773dd4016377623cf2000f', '11', '11', '402881f4609299ad0160929bd4ac000c', '1', null, null, null, '管理员', '2018-05-19 15:51:56', 'admin'); -INSERT INTO `t_s_role` VALUES ('402880e74d75c4dd014d75d3c5f40001', 'demo', 'demo', null, null, '管理员', '2017-03-01 21:54:06', 'admin', null, null, null); -INSERT INTO `t_s_role` VALUES ('402881875b19f141015b19fb1d490019', 'dep_jingli', '经理角色', null, null, null, null, null, '管理员', '2017-03-29 20:12:19', 'admin'); -INSERT INTO `t_s_role` VALUES ('8a8ab0b246dc81120146dc8181870050', 'admin', '管理员', null, null, '管理员', '2018-05-19 14:25:06', 'admin', null, null, null); -INSERT INTO `t_s_role` VALUES ('8a8ab0b246dc81120146dc81818b0051', 'manager', '普通用户', null, null, '管理员', '2016-05-29 17:42:19', 'admin', null, null, null); +INSERT INTO `t_s_role` VALUES ('402880e74d75c4dd014d75d3c5f40001', 'demo', 'demo', null, '0', '管理员', '2017-03-01 21:54:06', 'admin', null, null, null); +INSERT INTO `t_s_role` VALUES ('402881875b19f141015b19fb1d490019', 'dep_jingli', '经理角色', null, '0', null, null, null, '管理员', '2017-03-29 20:12:19', 'admin'); +INSERT INTO `t_s_role` VALUES ('8a8ab0b246dc81120146dc8181870050', 'admin', '管理员', null, '0', '管理员', '2018-05-19 14:25:06', 'admin', null, null, null); +INSERT INTO `t_s_role` VALUES ('8a8ab0b246dc81120146dc81818b0051', 'manager', '普通用户', null, '0', '管理员', '2016-05-29 17:42:19', 'admin', null, null, null); -- ---------------------------- -- Table structure for t_s_role_function @@ -19489,7 +19491,6 @@ INSERT INTO `t_s_role_function` VALUES ('40283181614231d40161423538320006', null INSERT INTO `t_s_role_function` VALUES ('40283181614231d40161423561340007', null, '8a8ab0b246dc81120146dc818109002e', '402880e74d75c4dd014d75d3c5f40001', null); INSERT INTO `t_s_role_function` VALUES ('40283181614231d40161423561370008', null, '2c90ac564c9d1734014c9d6f4e370024', '402880e74d75c4dd014d75d3c5f40001', null); INSERT INTO `t_s_role_function` VALUES ('40283181614231d40161424756b0001e', null, '40287d81522a428401522a44aafb0002', '402880e74d75c4dd014d75d3c5f40001', null); -INSERT INTO `t_s_role_function` VALUES ('4028318161424e73016142501c930006', null, '4028318161424e730161424f61510002', '402880e74d75c4dd014d75d3c5f40001', '4028318161424e730161424fca6f0004,'); INSERT INTO `t_s_role_function` VALUES ('4028318163342ab60163342ce743000a', null, '4028ef8155fd32e40155fd33c6670001', '8a8ab0b246dc81120146dc8181870050', null); INSERT INTO `t_s_role_function` VALUES ('40284a815bb75d7b015bb760d9130003', null, '40284a815bb75d7b015bb7607ba00001', '8a8ab0b246dc81120146dc8181870050', null); INSERT INTO `t_s_role_function` VALUES ('402860816367e48e016367ea19a50002', null, '402860816361f06a016361f1be0d0001', '8a8ab0b246dc81120146dc8181870050', null); diff --git a/jeecg-framework/docs/入门必读.txt b/jeecg-framework/docs/入门必读.txt index fd4aae1e..77de0d39 100644 --- a/jeecg-framework/docs/入门必读.txt +++ b/jeecg-framework/docs/入门必读.txt @@ -4,7 +4,7 @@ eclipse + maven + jdk7 + tomcat7 + mysql 2. ִֹгʼSQLű - docs/db/jeecg_3.7.5_beta_mysql.sql + docs/db/jeecg_3.7.6_mysql.sql ע⣺ ִֹdoc\dbµݿű 3. ſ diff --git a/jeecg-framework/docs/数据库说明.txt b/jeecg-framework/docs/数据库说明.txt index f2632119..561443c8 100644 --- a/jeecg-framework/docs/数据库说明.txt +++ b/jeecg-framework/docs/数据库说明.txt @@ -5,9 +5,9 @@ 1.oracle ˵ jeecgűûscott - imp scott/tiger@orcl file=jeecg_3.7.5_beta_oracle11g.dmp + imp scott/tiger@orcl file=jeecg_3.7.6_oracle11g.dmp ûı - imp jeecgos/jeecgos@orcl file=/opt/datatmp/jeecg_3.7.5_oracle11g.dmp fromuser=scott touser=jeecgos ignore=y commit=y buffer=300000000 feedback=10000 + imp jeecgos/jeecgos@orcl file=/opt/datatmp/jeecg_3.7.6_oracle11g.dmp fromuser=scott touser=jeecgos ignore=y commit=y buffer=300000000 feedback=10000 2. oracleSqlServerŲвֶʧΪϵͳܣв @@ -16,6 +16,6 @@ 4.ϰ汾ݿ ִϰ汾SQLű - 3.7.33.7.5_beta - docs/ϰ汾/jeecg_mysql-3.7.3_beta-update-3.7.5.sql + 3.7.5_beta3.7.6 + docs/ϰ汾/jeecg_mysql-3.7.5_beta-update-3.7.6.sql \ No newline at end of file diff --git a/jeecg-framework/docs/老版本增量升级/jeecg_mysql-3.7.3_beta-update-3.7.5.sql b/jeecg-framework/docs/老版本增量升级/jeecg_mysql-3.7.3_beta-update-3.7.5.sql deleted file mode 100644 index 83bbf099..00000000 --- a/jeecg-framework/docs/老版本增量升级/jeecg_mysql-3.7.3_beta-update-3.7.5.sql +++ /dev/null @@ -1,35 +0,0 @@ -INSERT INTO `t_s_interface` (`id`, `create_name`, `create_by`, `create_date`, `update_name`, `update_by`, `update_date`, `sys_org_code`, `sys_company_code`, `interface_name`, `interface_order`, `interface_level`, `interface_url`, `interface_code`, `interface_method`, `parent_interface_id`) VALUES ('402881ef624bd23701624bda83d80008', '管理员', 'admin', '2018-03-22 11:57:15', NULL, NULL, NULL, 'A03', 'A03', 'jeecgDemo接口', '1', '0', '', 'jeecgDemo', 'GET', NULL); -INSERT INTO `t_s_interface` (`id`, `create_name`, `create_by`, `create_date`, `update_name`, `update_by`, `update_date`, `sys_org_code`, `sys_company_code`, `interface_name`, `interface_order`, `interface_level`, `interface_url`, `interface_code`, `interface_method`, `parent_interface_id`) VALUES ('402881ef624bd23701624bdaea80000a', '管理员', 'admin', '2018-03-22 11:57:41', NULL, NULL, NULL, 'A03', 'A03', 'jeecgDemo列表查询', '1', '1', '/rest/jeecgListDemoController/list', 'jeecgdemo_list', 'GET', '402881ef624bd23701624bda83d80008'); -INSERT INTO `t_s_interface` (`id`, `create_name`, `create_by`, `create_date`, `update_name`, `update_by`, `update_date`, `sys_org_code`, `sys_company_code`, `interface_name`, `interface_order`, `interface_level`, `interface_url`, `interface_code`, `interface_method`, `parent_interface_id`) VALUES ('402881ef624bd23701624bdb477e000c', '管理员', 'admin', '2018-03-22 11:58:05', NULL, NULL, NULL, 'A03', 'A03', 'jeecgDemo单条数据查询', '2', '1', '/rest/jeecgListDemoController/{id}', 'jeecgdemo_get', 'GET', '402881ef624bd23701624bda83d80008'); -INSERT INTO `t_s_interface` (`id`, `create_name`, `create_by`, `create_date`, `update_name`, `update_by`, `update_date`, `sys_org_code`, `sys_company_code`, `interface_name`, `interface_order`, `interface_level`, `interface_url`, `interface_code`, `interface_method`, `parent_interface_id`) VALUES ('402881ef624bd23701624bdba184000e', '管理员', 'admin', '2018-03-22 11:58:28', NULL, NULL, NULL, 'A03', 'A03', 'jeecgDemo添加', '3', '1', '/rest/jeecgListDemoController', 'jeecgdemo_add', 'POST', '402881ef624bd23701624bda83d80008'); -INSERT INTO `t_s_interface` (`id`, `create_name`, `create_by`, `create_date`, `update_name`, `update_by`, `update_date`, `sys_org_code`, `sys_company_code`, `interface_name`, `interface_order`, `interface_level`, `interface_url`, `interface_code`, `interface_method`, `parent_interface_id`) VALUES ('402881ef624bd23701624bdbfcec0010', '管理员', 'admin', '2018-03-22 11:58:51', NULL, NULL, NULL, 'A03', 'A03', 'jeecgDemo编辑', '4', '1', '/rest/jeecgListDemoController', 'jeecgdemo_edit', 'PUT', '402881ef624bd23701624bda83d80008'); -INSERT INTO `t_s_interface` (`id`, `create_name`, `create_by`, `create_date`, `update_name`, `update_by`, `update_date`, `sys_org_code`, `sys_company_code`, `interface_name`, `interface_order`, `interface_level`, `interface_url`, `interface_code`, `interface_method`, `parent_interface_id`) VALUES ('402881ef624bd23701624bdc56f30012', '管理员', 'admin', '2018-03-22 11:59:14', NULL, NULL, NULL, 'A03', 'A03', 'jeecgDemo删除', '5', '1', '/rest/jeecgListDemoController/{id}', 'jeecgdemo_delete', 'DELETE', '402881ef624bd23701624bda83d80008'); -update cgform_template set template_code = 'rowsEdit' where id = '40288af454ff777c0154ffad599e0003'; -INSERT INTO `t_s_function` (`ID`, `functioniframe`, `functionlevel`, `functionname`, `functionorder`, `functionurl`, `parentfunctionid`, `iconid`, `desk_iconid`, `functiontype`, `function_icon_style`, `create_by`, `create_name`, `update_by`, `update_date`, `create_date`, `update_name`) VALUES ('402881ff6265de9b016266eb26380035', NULL, '1', '接口测试', '28', 'jeecgFormDemoController.do?interfaceTestDemo', '4028f6815af3ce54015af3d1ad610001', '8a8ab0b246dc81120146dc8180460000', '8a8ab0b246dc81120146dc8180f00026', '0', 'fa-check-circle-o', 'admin', '管理员', NULL, NULL, '2018-03-27 18:05:09', NULL); -INSERT INTO `t_s_function` (`ID`, `functioniframe`, `functionlevel`, `functionname`, `functionorder`, `functionurl`, `parentfunctionid`, `iconid`, `desk_iconid`, `functiontype`, `function_icon_style`, `create_by`, `create_name`, `update_by`, `update_date`, `create_date`, `update_name`) VALUES ('402881f66260fc8e016260ffdde70001', NULL, '1', '一对多表单二', '99', 'jformOrderMain2Controller.do?index', '4028f6815af3ce54015af3d1ad610001', '8a8ab0b246dc81120146dc8180460000', '8a8ab0b246dc81120146dc8180dd001e', '0', 'fa-list-ul', 'admin', '管理员', 'admin', '2018-03-27 16:14:26', '2018-03-26 14:30:04', '管理员'); -INSERT INTO `super_query_main` (`id`, `create_name`, `create_by`, `create_date`, `update_name`, `update_by`, `update_date`, `sys_org_code`, `sys_company_code`, `query_name`, `query_code`, `query_type`, `content`) VALUES ('402881f66265f83b016266197dcf0005', '管理员', 'admin', '2018-03-27 14:16:09', '管理员', 'admin', '2018-03-27 17:42:28', 'A03', 'A03', '一对多表单测试高级查询', 'jformOrderMain2', 'M', '一对多表单测试高级查询'); -INSERT INTO `super_query_table` (`id`, `create_name`, `create_by`, `create_date`, `update_name`, `update_by`, `update_date`, `sys_org_code`, `sys_company_code`, `seq`, `table_name`, `instruction`, `is_main`, `fk_field`, `main_id`) VALUES ('402881f66265f83b016266197dcf0006', '管理员', 'admin', '2018-03-27 14:16:09', '管理员', 'admin', '2018-03-27 17:42:28', 'A03', 'A03', '1', 'jform_order_main', '合同测试表', 'Y', NULL, '402881f66265f83b016266197dcf0005'); -INSERT INTO `t_s_function` (`ID`, `functioniframe`, `functionlevel`, `functionname`, `functionorder`, `functionurl`, `parentfunctionid`, `iconid`, `desk_iconid`, `functiontype`, `function_icon_style`, `create_by`, `create_name`, `update_by`, `update_date`, `create_date`, `update_name`) VALUES ('402881f462bcd9fe0162bcdd0e4c0001', NULL, '1', 'vue列表', '1', 'jeecgListDemoController.do?vueList', '4028f6815af3ce54015af3d1ad610001', '8a8ab0b246dc81120146dc8180460000', '8a8ab0b246dc81120146dc8180dd001e', '0', 'fa-vimeo-square', 'admin', '管理员', 'admin', '2018-04-13 11:49:34', '2018-04-13 10:37:07', '管理员'); -INSERT INTO `t_s_function` (`ID`, `functioniframe`, `functionlevel`, `functionname`, `functionorder`, `functionurl`, `parentfunctionid`, `iconid`, `desk_iconid`, `functiontype`, `function_icon_style`, `create_by`, `create_name`, `update_by`, `update_date`, `create_date`, `update_name`) VALUES ('297e7ae162b925a20162b9271b300001', NULL, '1', 'BootstrapTable', '30', 'jeecgListDemoController.do?bootTableDemo', '4028f6815af3ce54015af3d1ad610001', '8a8ab0b246dc81120146dc8180460000', '8a8ab0b246dc81120146dc8180dd001e', '0', 'fa-life-ring', 'admin', '管理员', 'admin', '2018-04-19 10:32:54', '2018-04-12 17:19:31', '管理员'); -INSERT INTO `t_s_function` (`ID`, `functioniframe`, `functionlevel`, `functionname`, `functionorder`, `functionurl`, `parentfunctionid`, `iconid`, `desk_iconid`, `functiontype`, `function_icon_style`, `create_by`, `create_name`, `update_by`, `update_date`, `create_date`, `update_name`) VALUES ('402881f462fa6ee90162fa78deba0001', NULL, '1', 'vueBootstrapTable', '1', 'jeecgListDemoController.do?vueBootstrapTableList', '4028f6815af3ce54015af3d1ad610001', '8a8ab0b246dc81120146dc8180460000', '8a8ab0b246dc81120146dc8180dd001e', '0', 'fa-vimeo-square', 'admin', '管理员', 'admin', '2018-04-26 10:24:34', '2018-04-25 09:44:08', '管理员'); -INSERT INTO `t_s_muti_lang` (`id`, `lang_key`, `lang_context`, `lang_code`, `create_date`, `create_by`, `create_name`, `update_date`, `update_by`, `update_name`) VALUES ('402881fc6305bc640163061f9a79000f', 'confirm.online.delete.record', '确认删除该记录吗?(同时删除表)', 'zh-cn', '2018-04-27 16:02:04', 'admin', '管理员', NULL, NULL, NULL); -INSERT INTO `t_s_muti_lang` (`id`, `lang_key`, `lang_context`, `lang_code`, `create_date`, `create_by`, `create_name`, `update_date`, `update_by`, `update_name`) VALUES ('402881fc6305bc640163061fd1dc0011', 'confirm.online.delete.record', 'Confirm delete record?(Drop table)', 'en', '2018-04-27 16:02:18', 'admin', '管理员', NULL, NULL, NULL); -INSERT INTO `t_s_function` (`ID`, `functioniframe`, `functionlevel`, `functionname`, `functionorder`, `functionurl`, `parentfunctionid`, `iconid`, `desk_iconid`, `functiontype`, `function_icon_style`, `create_by`, `create_name`, `update_by`, `update_date`, `create_date`, `update_name`) VALUES ('4028f681630b600701630bc1eee30030', NULL, '1', 'easyui原生态', '30', 'jeecgListDemoController.do?aceTableDemo', '4028f6815af3ce54015af3d1ad610001', '8a8ab0b246dc81120146dc8180460000', '8a8ab0b246dc81120146dc8180dd001e', '0', '', 'admin', '管理员', NULL, NULL, '2018-04-28 18:17:29', NULL); -delete from t_s_role_function where functionid = '402881ef5f5c650e015f5c67ddd20001'; -delete from t_s_function where id = '402881ef5f5c650e015f5c67ddd20001'; -update t_s_function set functionname = '一对多表单' where id = '402881f66260fc8e016260ffdde70001'; -update t_s_function set functionurl='jeecgListDemoController.do?natureAceTableDemo' where id='4028f681630b600701630bc1eee30030'; -INSERT INTO `t_s_function` (`ID`, `functioniframe`, `functionlevel`, `functionname`, `functionorder`, `functionurl`, `parentfunctionid`, `iconid`, `desk_iconid`, `functiontype`, `function_icon_style`, `create_by`, `create_name`, `update_by`, `update_date`, `create_date`, `update_name`) VALUES ('402860816329336901632a527c4d0028', NULL, '1', 'BootstrapTable(标签版)', '31', 'jeecgListDemoController.do?bootstrapTableTagDemo', '4028f6815af3ce54015af3d1ad610001', '8a8ab0b246dc81120146dc8180460000', '8a8ab0b246dc81120146dc8180dd001e', '0', 'fa-life-ring', 'admin', '管理员', 'admin', '2018-05-04 16:44:42', '2018-05-04 16:43:58', '管理员'); -ALTER TABLE `t_s_base_user` -MODIFY COLUMN `username` varchar(50) NOT NULL COMMENT '用户账号' AFTER `userkey`; -INSERT INTO `t_s_muti_lang` (`id`, `lang_key`, `lang_context`, `lang_code`, `create_date`, `create_by`, `create_name`, `update_date`, `update_by`, `update_name`) VALUES ('402881f2635d5b6e01635d773ab20001', 'username.rang2to50', '用户账号范围在2~50位字符', 'zh-cn', '2018-05-14 15:04:44', 'admin', '管理员', NULL, NULL, NULL); -INSERT INTO `t_s_muti_lang` (`id`, `lang_key`, `lang_context`, `lang_code`, `create_date`, `create_by`, `create_name`, `update_date`, `update_by`, `update_name`) VALUES ('402881f2635d5b6e01635d77bb650003', 'username.rang2to50', 'User account need 2~50 bits', 'en', '2018-05-14 15:05:17', 'admin', '管理员', NULL, NULL, NULL); -INSERT INTO `t_s_function` (`ID`, `functioniframe`, `functionlevel`, `functionname`, `functionorder`, `functionurl`, `parentfunctionid`, `iconid`, `desk_iconid`, `functiontype`, `function_icon_style`, `create_by`, `create_name`, `update_by`, `update_date`, `create_date`, `update_name`) VALUES ('402860816361f06a016361f1be0d0001', NULL, '1', 'BootstrapTable(标签版2)', '32', 'jeecgListDemoController.do?bootstrapTableTagDemo2', '4028f6815af3ce54015af3d1ad610001', '8a8ab0b246dc81120146dc8180460000', '8a8ab0b246dc81120146dc8180dd001e', '0', 'fa-life-ring', 'admin', '管理员', 'admin', '2018-05-15 19:27:32', '2018-05-15 11:57:02', '管理员'); -ALTER TABLE `jform_graphreport_head` -MODIFY COLUMN `create_name` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL AFTER `create_by`, -MODIFY COLUMN `update_name` varchar(100) NULL DEFAULT NULL AFTER `update_by`; -INSERT INTO `t_s_muti_lang` (`id`, `lang_key`, `lang_context`, `lang_code`, `create_date`, `create_by`, `create_name`, `update_date`, `update_by`, `update_name`) VALUES ('40286081637677e601637724773f0037', 'common.please.select.two.item', '请选择两条数据', 'zh-cn', '2018-05-19 14:44:28', 'admin', '管理员', NULL, NULL, NULL); -INSERT INTO `t_s_muti_lang` (`id`, `lang_key`, `lang_context`, `lang_code`, `create_date`, `create_by`, `create_name`, `update_date`, `update_by`, `update_name`) VALUES ('40286081637677e601637725f4a50039', 'common.please.select.two.item', 'Please select two data', 'en', '2018-05-19 14:46:06', 'admin', '管理员', NULL, NULL, NULL); -delete FROM t_s_depart_authg_function_rel where auth_id = '4028838d5f351a87015f351fc33d0002'; -delete FROM t_s_depart_authg_function_rel where auth_id = '4028911b5c0bf9b9015c0c034d8e0013'; -update t_s_muti_lang set lang_context = '3.7.5-beta' where lang_key ='system.version.number'; diff --git a/jeecg-framework/docs/老版本增量升级/jeecg_mysql-3.7.5_beta-update-3.7.6.sql b/jeecg-framework/docs/老版本增量升级/jeecg_mysql-3.7.5_beta-update-3.7.6.sql new file mode 100644 index 00000000..81fcb399 --- /dev/null +++ b/jeecg-framework/docs/老版本增量升级/jeecg_mysql-3.7.5_beta-update-3.7.6.sql @@ -0,0 +1,16 @@ +update t_s_role set role_type=0 where role_type is null; +ALTER TABLE `jeecg_demo` +MODIFY COLUMN `content` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '个人介绍' AFTER `birthday`; +INSERT INTO `t_s_function` (`ID`, `functioniframe`, `functionlevel`, `functionname`, `functionorder`, `functionurl`, `parentfunctionid`, `iconid`, `desk_iconid`, `functiontype`, `function_icon_style`, `create_by`, `create_name`, `update_by`, `update_date`, `create_date`, `update_name`) VALUES ('402881f463a591710163a5e59a830010', NULL, '2', '接口用户管理', '3', 'userController.do?interfaceUser', '402881fc60a07a350160a07cf68e0001', '8a8ab0b246dc81120146dc8180460000', '8a8ab0b246dc81120146dc8180dd001e', '0', '', 'admin', '管理员', NULL, NULL, '2018-05-28 16:37:58', NULL); +delete from t_s_black_list where ip in (select a.ip from (select ip from t_s_black_list GROUP BY ip HAVING COUNT(1) > 1) a ) +and id not in (select b.md from (select max(id) md from t_s_black_list GROUP BY ip HAVING COUNT(1) > 1) b ); +ALTER TABLE `t_s_black_list` +ADD UNIQUE INDEX `unique_key_ip` (`ip`) ; +INSERT INTO `t_s_function` (`ID`, `functioniframe`, `functionlevel`, `functionname`, `functionorder`, `functionurl`, `parentfunctionid`, `iconid`, `desk_iconid`, `functiontype`, `function_icon_style`, `create_by`, `create_name`, `update_by`, `update_date`, `create_date`, `update_name`) VALUES ('4028f68163b5547e0163b55616930001', NULL, '1', '上传重构demo', '34', 'jeecgFormDemoController.do?webuploader', '4028f6815af3ce54015af3d1ad610001', '8a8ab0b246dc81120146dc8180460000', '8a8ab0b246dc81120146dc8180dd001e', '0', '', 'admin', '管理员', NULL, NULL, '2018-05-31 16:35:08', NULL); +INSERT INTO `t_s_function` (`ID`, `functioniframe`, `functionlevel`, `functionname`, `functionorder`, `functionurl`, `parentfunctionid`, `iconid`, `desk_iconid`, `functiontype`, `function_icon_style`, `create_by`, `create_name`, `update_by`, `update_date`, `create_date`, `update_name`) VALUES ('402881f463b56b950163b5aefcdb0002', NULL, '1', '自定义嵌套子表列表', '35', 'jfromOrderController.do?gridViewlist', '4028f6815af3ce54015af3d1ad610001', '8a8ab0b246dc81120146dc8180460000', '8a8ab0b246dc81120146dc8180dd001e', '0', '', 'admin', '管理员', NULL, NULL, '2018-05-31 18:12:14', NULL); +INSERT INTO `t_s_function` (`ID`, `functioniframe`, `functionlevel`, `functionname`, `functionorder`, `functionurl`, `parentfunctionid`, `iconid`, `desk_iconid`, `functiontype`, `function_icon_style`, `create_by`, `create_name`, `update_by`, `update_date`, `create_date`, `update_name`) VALUES ('402881f463b4e5d20163b4f9a81b0001', NULL, '1', 'Bootstrap布局报表', '34', 'jeecgListDemoController.do?bootStrapEchartsDemo', '8a8ab0b246dc81120146dc8180d4001b', '8a8ab0b246dc81120146dc8180460000', '8a8ab0b246dc81120146dc8180dd001e', '0', '', 'admin', '管理员', 'admin', '2018-05-31 19:48:06', '2018-05-31 14:54:10', '管理员'); +update t_s_muti_lang set lang_context = ' ' where lang_key ='common.please.select'; +ALTER TABLE `jform_graphreport_head` +DROP INDEX `index_code`, +ADD UNIQUE INDEX `index_code`(`code`); +update t_s_muti_lang set lang_context = '3.7.6' where lang_key ='system.version.number'; diff --git a/jeecg-framework/pom.xml b/jeecg-framework/pom.xml index 7d5a77db..83a09209 100644 --- a/jeecg-framework/pom.xml +++ b/jeecg-framework/pom.xml @@ -1,14 +1,14 @@ - 4.0.0 org.jeecgframework jeecg - 3.7.5-beta + 3.7.6 war + - UTF-8 3.6.3 - 1.6.2 + 1.6.4 16.0.1 4.0.9.RELEASE @@ -45,7 +45,7 @@ 2.6 3.1 1.2 - 1.0.4 + 1.1.3 1.1 1.3.1 2.4.3 @@ -61,7 +61,7 @@ 0.9.1 1.6 1.4 - 0.2.9 + 1.1.9 5.1.27 4.0 @@ -81,8 +81,8 @@ 0.4.6 - 2.5.0 - 1.6.2 + 2.5.1 + 2.3.0 1.1.1 1.0 1.4.4 @@ -96,6 +96,13 @@ 2.9.0 8080 UTF-8 + + + 1.0.0 + + 1.0.2 + 1.0.4 + 1.0.0 @@ -146,22 +153,12 @@ codegenerate ${codegenerate.version} system - ${project.basedir}/src/main/webapp/WEB-INF/lib/codegenerate-3.6.3-20180503.jar + ${project.basedir}/src/main/webapp/WEB-INF/lib/codegenerate-3.6.3-20180606.jar org.jeecgframework minidao-pe ${minidao.version} - - - org.springframework - spring-asm - - - org.junit - com.springsource.org.junit - - @@ -169,26 +166,37 @@ thumbnailator ${thumbnailator.version} + - + + com.belerweb + pinyin4j + ${pinyin4j.version} + + + + + org.quartz-scheduler + quartz + ${org.quartz.version} @@ -245,11 +253,13 @@ hibernate-ehcache ${hibernate.version} + org.hibernate.common hibernate-commons-annotations @@ -274,7 +284,7 @@ - + + + commons-pool commons-pool @@ -307,6 +319,7 @@ ${commons-dbcp.version} compile + com.alibaba druid @@ -320,12 +333,13 @@ ${mysql.version} runtime - + @@ -480,23 +495,12 @@ - - - org.slf4j - slf4j-api - ${slf4j.version} - + org.slf4j slf4j-log4j12 ${slf4j.version} - - - log4j - log4j - ${log4j.version} - - + @@ -534,24 +538,24 @@ commons-collections ${commons-collections.version} - + commons-codec commons-codec ${commons-codec.version} - + commons-io @@ -594,30 +598,35 @@ - + + --> + net.sf.ehcache ehcache-core ${ehcache.version} - + + + org.freemarker + freemarker + ${freemarker.version} @@ -704,11 +713,13 @@ ${project.basedir}/src/main/webapp/WEB-INF/lib/jodconverter-3.0-beta-4-20170917.jar + + @@ -723,86 +734,69 @@ hamcrest-all ${hamcrest.version} - + org.springframework spring-test ${spring.version} - + + --> - org.jeecgframework - batik-all - 1.6 - system - ${project.basedir}/src/main/webapp/WEB-INF/lib/batik-all-1.6-20170917.jar - + com.hynnet + jacob + 1.18 + + + - org.jeecgframework - fop - 1.0 - system - ${project.basedir}/src/main/webapp/WEB-INF/lib/fop-1.0-20170917.jar + org.apache.xmlgraphics + batik-codec + 1.7 xerces xercesImpl 2.7.1 - - xml-apis - xml-apis-ext - 1.3.04 - - - xml-apis - xml-apis - 1.3.04 - - - org.apache.xmlgraphics - xmlgraphics-commons - 1.4 - - - xalan - xalan - 2.7.0 - - com.thoughtworks.xstream xstream ${xstream.version} + commons-httpclient commons-httpclient 3.0.1 + + - + @@ -833,7 +827,7 @@ jsoup 1.8.3 - + com.google.guava guava @@ -848,7 +842,7 @@ - + - org.p3framework + org.jeecgframework.p3 jeecg-p3-core - 1.1.1 + ${jeecg-p3-core.version} - org.p3framework - jeecg-p3-ui - 1.1.3 - jar + org.jeecgframework.p3 + jeecg-p3-core-api + ${jeecg-p3-core.version} + + + org.jeecgframework.p3 + jeecg-p3-core + + - org.p3framework - jeecg-p3-bizcore - 1.0-SNAPSHOT - jar + org.jeecgframework.p3 + jeecg-p3-core-ui + ${jeecg-p3-core.version} + + + org.jeecgframework.p3 + jeecg-p3-core + + - + - org.p3framework + org.jeecgframework.p3 jeecg-p3-biz-demo - 1.0.2 + ${jeecg-p3-biz-demo.version} + + + org.jeecgframework.p3 + jeecg-p3-start-quick + + - + - org.p3framework - jeecg-p3-biz-mail - 1.0.0 - jar + org.jeecgframework.p3 + jeecg-p3-biz-chat + ${jeecg-p3-biz-chat.version} + + + org.jeecgframework.p3 + jeecg-p3-start-quick + + - + - org.p3framework - jeecg-p3-biz-chat - 1.0.3 + org.jeecgframework.p3 + jeecg-p3-biz-mail + ${jeecg-p3-biz-mail.version} + + + org.jeecgframework.p3 + jeecg-p3-start-quick + + @@ -986,9 +1008,9 @@ tomcat-maven-plugin 1.1 - /jeecg - 8080 - UTF-8 + /${project.artifactId} + ${webserver.port} + ${project.build.sourceEncoding} http://localhost:8080/manager/html tomcat6 diff --git a/jeecg-framework/src/main/java/com/jeecg/demo/controller/JeecgFormDemoController.java b/jeecg-framework/src/main/java/com/jeecg/demo/controller/JeecgFormDemoController.java index 403d62d4..1f0d6e1f 100644 --- a/jeecg-framework/src/main/java/com/jeecg/demo/controller/JeecgFormDemoController.java +++ b/jeecg-framework/src/main/java/com/jeecg/demo/controller/JeecgFormDemoController.java @@ -1,11 +1,20 @@ package com.jeecg.demo.controller; +import java.io.BufferedInputStream; +import java.io.File; +import java.io.FileInputStream; import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.net.URLEncoder; +import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Collections; +import java.util.Date; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.UUID; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; @@ -21,6 +30,7 @@ import org.jeecgframework.core.common.model.json.ComboTree; import org.jeecgframework.core.common.model.json.DataGrid; import org.jeecgframework.core.common.model.json.TreeGrid; import org.jeecgframework.core.constant.Globals; +import org.jeecgframework.core.enums.StoreUploadFilePathEnum; import org.jeecgframework.core.extend.hqlsearch.HqlGenerateUtil; import org.jeecgframework.core.util.DateUtils; import org.jeecgframework.core.util.HttpRequest; @@ -28,12 +38,14 @@ import org.jeecgframework.core.util.JSONHelper; import org.jeecgframework.core.util.MutiLangUtil; import org.jeecgframework.core.util.MyClassLoader; import org.jeecgframework.core.util.NumberComparator; +import org.jeecgframework.core.util.ResourceUtil; import org.jeecgframework.core.util.StringUtil; import org.jeecgframework.core.util.oConvertUtils; import org.jeecgframework.tag.core.easyui.TagUtil; import org.jeecgframework.tag.vo.datatable.SortDirection; import org.jeecgframework.tag.vo.easyui.ComboTreeModel; import org.jeecgframework.tag.vo.easyui.TreeGridModel; +import org.jeecgframework.web.cgform.exception.BusinessException; import org.jeecgframework.web.system.pojo.base.TSAttachment; import org.jeecgframework.web.system.pojo.base.TSDepart; import org.jeecgframework.web.system.pojo.base.TSFunction; @@ -44,9 +56,12 @@ import org.jeecgframework.web.system.service.SystemService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.ModelMap; +import org.springframework.util.FileCopyUtils; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.multipart.MultipartFile; +import org.springframework.web.multipart.MultipartHttpServletRequest; import org.springframework.web.servlet.ModelAndView; import com.alibaba.fastjson.JSONObject; @@ -582,7 +597,9 @@ public class JeecgFormDemoController extends BaseController { public AjaxJson del(TSDepart depart, HttpServletRequest request) { AjaxJson j = new AjaxJson(); depart = systemService.getEntity(TSDepart.class, depart.getId()); - Long childCount = systemService.getCountForJdbc("select count(1) from t_s_depart where parentdepartid ='" + depart.getId() + "'"); + + Long childCount = systemService.getCountForJdbcParam("select count(1) from t_s_depart where parentdepartid = ?", depart.getId()); + if(childCount>0){ j.setSuccess(false); j.setMsg("有下级,不能删除"); @@ -660,4 +677,128 @@ public class JeecgFormDemoController extends BaseController { return j; } + + @RequestMapping(params = "webuploader") + public ModelAndView webuploader(HttpServletRequest request) { + logger.info("----webuploaderdemo-----"); + return new ModelAndView("com/jeecg/demo/form_webuploader"); + } + + /** + * WebUploader + * 文件上传处理 + */ + @RequestMapping("/filedeal") + @ResponseBody + public AjaxJson filedeal(HttpServletRequest request, HttpServletResponse response) { + AjaxJson j = new AjaxJson(); + String msg=""; + String ctxPath=ResourceUtil.getConfigByName("webUploadpath");//demo中设置为D://upFiles,实际项目应因事制宜 + try { + String fileName = null; + String bizType=request.getParameter("bizType");//上传业务名称 + String bizPath=StoreUploadFilePathEnum.getPath(bizType);//根据业务名称判断上传路径 + String nowday=new SimpleDateFormat("yyyyMMdd").format(new Date()); + File file = new File(ctxPath+"/"+bizPath+"/"+nowday); + if (!file.exists()) { + file.mkdirs();// 创建文件根目录 + } + MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request; + MultipartFile mf=multipartRequest.getFile("file");// 获取上传文件对象 + String orgName = mf.getOriginalFilename();// 获取文件名 + fileName = String.valueOf(UUID.randomUUID().getMostSignificantBits()).replace("-", "")+ orgName.substring(orgName.lastIndexOf(".")); + String savePath = file.getPath() + "/" + fileName; + File savefile = new File(savePath); + FileCopyUtils.copy(mf.getBytes(), savefile); + msg="上传成功"; + j.setMsg(msg); + String dbpath=bizPath+"/"+nowday+"/"+fileName; + Map info = new HashMap(); + info.put("filename", orgName.substring(0,orgName.lastIndexOf("."))); + info.put("filesize", mf.getSize()); + info.put("filetype", orgName.substring(orgName.lastIndexOf("."))); + info.put("filepath", dbpath); + j.setAttributes(info); + } catch (IOException e) { + j.setSuccess(false); + logger.info(e.getMessage()); + } + j.setMsg(msg); + return j; + } + /** + * 删除处理 + * @param request + * @param response + * @return + */ + @RequestMapping("/filedelete") + @ResponseBody + public AjaxJson filedelete(HttpServletRequest request, HttpServletResponse response) { + AjaxJson j = new AjaxJson(); + String msg=""; + String ctxPath=ResourceUtil.getConfigByName("webUploadpath");//demo中设置为D://upFiles,实际项目应因事制宜 + String path=request.getParameter("filepath"); + String delpath=ctxPath+"/"+path; + File fileDelete = new File(delpath); + if (!fileDelete.exists() || !fileDelete.isFile()) { + msg="警告: " + delpath + "不存在!"; + logger.info(msg); + j.setSuccess(true);//不存在前台也给他删除 + }else{ + if(fileDelete.delete()){ + msg="--------成功删除文件---------"+delpath; + logger.info(msg); + }else{ + j.setSuccess(false); + msg="没删除成功--jdk的问题还是你文件的问题请重新试试"; + logger.info(msg); + } + } + j.setMsg(msg); + return j; + } + + @RequestMapping("/filedown") + public void getImgByurl(HttpServletResponse response,HttpServletRequest request) throws Exception{ + String dbpath = request.getParameter("filepath"); + if(oConvertUtils.isNotEmpty(dbpath)&&dbpath.endsWith(",")){ + dbpath = dbpath.substring(0, dbpath.length()-1); + } + response.setContentType("application/x-msdownload;charset=utf-8"); + String fileType = dbpath.substring(dbpath.lastIndexOf(".")); + String fileName=request.getParameter("filename")+fileType; + String userAgent = request.getHeader("user-agent").toLowerCase(); + if (userAgent.contains("msie") || userAgent.contains("like gecko") ) { + fileName = URLEncoder.encode(fileName, "UTF-8"); + }else { + fileName = new String(fileName.getBytes("UTF-8"), "iso-8859-1"); + } + response.setHeader("Content-disposition", "attachment; filename="+ fileName); + + InputStream inputStream = null; + OutputStream outputStream=null; + try { + String localPath=ResourceUtil.getConfigByName("webUploadpath"); + String imgurl = localPath+"/"+dbpath; + inputStream = new BufferedInputStream(new FileInputStream(imgurl)); + outputStream = response.getOutputStream(); + byte[] buf = new byte[1024]; + int len; + while ((len = inputStream.read(buf)) > 0) { + outputStream.write(buf, 0, len); + } + response.flushBuffer(); + } catch (Exception e) { + logger.info("--通过流的方式获取文件异常--"+e.getMessage()); + }finally{ + if(inputStream!=null){ + inputStream.close(); + } + if(outputStream!=null){ + outputStream.close(); + } + } + } + } diff --git a/jeecg-framework/src/main/java/com/jeecg/demo/controller/JeecgListDemoController.java b/jeecg-framework/src/main/java/com/jeecg/demo/controller/JeecgListDemoController.java index 31007f1b..249a5e92 100644 --- a/jeecg-framework/src/main/java/com/jeecg/demo/controller/JeecgListDemoController.java +++ b/jeecg-framework/src/main/java/com/jeecg/demo/controller/JeecgListDemoController.java @@ -1,4 +1,8 @@ package com.jeecg.demo.controller; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; + import java.io.IOException; import java.io.OutputStreamWriter; import java.io.StringReader; @@ -61,7 +65,6 @@ import org.jeecgframework.web.system.service.MutiLangServiceI; import org.jeecgframework.web.system.service.SystemService; import org.jeecgframework.web.system.util.InterfaceUtil; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.stereotype.Controller; import org.springframework.ui.ModelMap; @@ -71,7 +74,6 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; -import org.springframework.web.bind.annotation.ResponseStatus; import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartHttpServletRequest; import org.springframework.web.servlet.ModelAndView; @@ -84,10 +86,6 @@ import com.jeecg.demo.entity.JeecgDemoPage; import com.jeecg.demo.entity.JeecgLogReport; import com.jeecg.demo.service.JeecgDemoServiceI; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; - /** * @Title: Controller * @Description: jeecg_demo @@ -605,28 +603,26 @@ public class JeecgListDemoController extends BaseController { } } } - - @RequestMapping(params = "minidaoDatagrid") public void minidaoDatagrid(JeecgDemoEntity jeecgDemo,HttpServletRequest request, HttpServletResponse response, DataGrid dataGrid) { /** * 注意:minidao会遵循springjdbc规则,会自动把数据库以下划线的字段,转化为驼峰写法 - * 例如数据库表字段:{USER_NAME} + * 例如数据库表字段:{user_name} * 转化实体对应字段:{userName} */ - + + //step.1 获取数据权限SQL片段 String authSql = JeecgDataAutorUtils.loadDataSearchConditonSQLString(); + + //step.2 将权限SQL片段注入到业务SQL中 MiniDaoPage list = jeecgMinidaoDao.getAllEntities(jeecgDemo, dataGrid.getPage(), dataGrid.getRows(),authSql); - dataGrid.setTotal(list.getTotal()); dataGrid.setResults(list.getResults()); - + + //step.3 合计,格式为 字段名:值(可选,不写该值时为分页数据的合计) 多个合计 以 , 分割 String total_salary = String.valueOf(jeecgMinidaoDao.getSumSalary()); - /* - * 说明:格式为 字段名:值(可选,不写该值时为分页数据的合计) 多个合计 以 , 分割 - */ dataGrid.setFooter("salary:"+(total_salary.equalsIgnoreCase("null")?"0.0":total_salary)+",age,email:合计"); TagUtil.datagrid(response, dataGrid); } @@ -671,8 +667,8 @@ public class JeecgListDemoController extends BaseController { m.put("extField",this.jeecgMinidaoDao.getOrgCode(temp.getDepId())); extMap.put(temp.getId(), m); } - //dataGrid.setFooter("extField,salary,age,name:合计"); - dataGrid.setFooter("salary,age,name:合计"); +// dataGrid.setFooter("salary,age,name:合计"); + dataGrid.setFooter("[{'salary':'','age':'','name':'合计'}]"); TagUtil.datagrid(response, dataGrid, extMap); } @@ -995,6 +991,7 @@ public class JeecgListDemoController extends BaseController { jeecgDemoService.saveOrUpdate(t); systemService.addLog(message, Globals.Log_Type_UPDATE, Globals.Log_Leavel_INFO); } catch (Exception e) { + message = "JeecgDemo例子: " + jeecgDemo.getName() + "更新失败!!"; e.printStackTrace(); } } else { @@ -1004,6 +1001,7 @@ public class JeecgListDemoController extends BaseController { jeecgDemoService.save(jeecgDemo); systemService.addLog(message, Globals.Log_Type_INSERT, Globals.Log_Leavel_INFO); } catch (Exception e) { + message = "JeecgDemo例子: " + jeecgDemo.getName() + "添加失败!!"; e.printStackTrace(); } @@ -1364,5 +1362,10 @@ public class JeecgListDemoController extends BaseController { return new ModelAndView("com/jeecg/demo/jeecgDemo-bootstrap-add2"); } + @RequestMapping(params = "bootStrapEchartsDemo") + public ModelAndView bootStrapEchartsDemo(HttpServletRequest request) { + return new ModelAndView("com/jeecg/demo/echartsDemo/bootstrap-echarts"); + } + } diff --git a/jeecg-framework/src/main/java/com/jeecg/demo/controller/JformOrderMain2Controller.java b/jeecg-framework/src/main/java/com/jeecg/demo/controller/JformOrderMain2Controller.java index af6c8f9b..67e3b49b 100644 --- a/jeecg-framework/src/main/java/com/jeecg/demo/controller/JformOrderMain2Controller.java +++ b/jeecg-framework/src/main/java/com/jeecg/demo/controller/JformOrderMain2Controller.java @@ -55,7 +55,7 @@ import com.jeecg.demo.entity.JformOrderMain2Entity; import com.jeecg.demo.entity.JformOrderTicket2Entity; import com.jeecg.demo.page.JformOrderMain2Page; import com.jeecg.demo.service.JformOrderMain2ServiceI; -import com.jeecg.superquery.util.SuperQueryUtil; +import org.jeecgframework.web.superquery.util.SuperQueryUtil; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; diff --git a/jeecg-framework/src/main/java/com/jeecg/demo/controller/JfromOrderController.java b/jeecg-framework/src/main/java/com/jeecg/demo/controller/JfromOrderController.java index a0912626..86526889 100644 --- a/jeecg-framework/src/main/java/com/jeecg/demo/controller/JfromOrderController.java +++ b/jeecg-framework/src/main/java/com/jeecg/demo/controller/JfromOrderController.java @@ -58,7 +58,7 @@ import com.jeecg.demo.entity.JfromOrderEntity; import com.jeecg.demo.entity.JfromOrderLineEntity; import com.jeecg.demo.page.JfromOrderPage; import com.jeecg.demo.service.JfromOrderServiceI; -import com.jeecg.superquery.util.SuperQueryUtil; +import org.jeecgframework.web.superquery.util.SuperQueryUtil; /** * @Title: Controller @@ -92,8 +92,19 @@ public class JfromOrderController extends BaseController { @RequestMapping(params = "list") public ModelAndView list(HttpServletRequest request) { return new ModelAndView("com/jeecg/demo/jfromOrderList"); + } + + /** + * 订单列表列表 页面跳转 (自定义子表显示demo) + * + * @return + */ + @RequestMapping(params = "gridViewlist") + public ModelAndView gridViewlist(HttpServletRequest request) { + return new ModelAndView("com/jeecg/demo/jfromOrderGridViewList"); } + /** * easyui AJAX请求数据 * @@ -274,6 +285,17 @@ public class JfromOrderController extends BaseController { return new ModelAndView("com/jeecg/demo/jfromOrderLineList"); } + @RequestMapping(params = "jfromOrderLineDatagrid") + public void jfromOrderLineDatagrid(JfromOrderLineEntity jfromOrderLineEntity,HttpServletRequest request, HttpServletResponse response, DataGrid dataGrid) { + CriteriaQuery cq = new CriteriaQuery(JfromOrderLineEntity.class, dataGrid); + //查询条件组装器 + org.jeecgframework.core.extend.hqlsearch.HqlGenerateUtil.installHql(cq, jfromOrderLineEntity); + cq.add(); + this.jfromOrderService.getDataGridReturn(cq, true); + TagUtil.datagrid(response, dataGrid); + } + + /** * 导出excel * diff --git a/jeecg-framework/src/main/java/com/jeecg/demo/dao/JeecgMinidaoDao.java b/jeecg-framework/src/main/java/com/jeecg/demo/dao/JeecgMinidaoDao.java index 1a96b602..d0372b94 100644 --- a/jeecg-framework/src/main/java/com/jeecg/demo/dao/JeecgMinidaoDao.java +++ b/jeecg-framework/src/main/java/com/jeecg/demo/dao/JeecgMinidaoDao.java @@ -16,48 +16,26 @@ import org.jeecgframework.minidao.pojo.MiniDaoPage; public interface JeecgMinidaoDao { @Arguments("pid") - @Sql("select ID,NAME,PID from t_s_region where pid=:pid order by name_en") + @Sql("select id,name,pid from t_s_region where pid=:pid order by name_en") List> getProCity(String pid); - @Sql("select ID,NAME,PID from t_s_region order by name_en") + @Sql("select id,name,pid from t_s_region order by name_en") List> getAllRegions(); @ResultType(JeecgDemoEntity.class) public MiniDaoPage getAllEntities(@Param("jeecgDemo") JeecgDemoEntity jeecgDemo, @Param("page") int page, @Param("rows") int rows,@Param("authSql") String authSql); - @Sql("SELECT count(*) FROM jeecg_demo") + @Sql("select count(*) from jeecg_demo") Integer getCount(); - @Sql("SELECT SUM(salary) FROM jeecg_demo") + @Sql("select sum(salary) from jeecg_demo") Integer getSumSalary(); @Arguments("id") @ResultType(String.class) - @Sql("SELECT org_code FROM t_s_depart where id=:id") + @Sql("select org_code from t_s_depart where id=:id") public java.lang.String getOrgCode(String id); - /*@Arguments({"jeecgMinidao", "page", "rows"}) - public List getAllEntities(JeecgMinidaoEntity jeecgMinidao, int page, int rows); - - @Arguments({"jeecgMinidao", "page", "rows"}) - @ResultType(JeecgMinidaoEntity.class) - public List getAllEntities2(JeecgMinidaoEntity jeecgMinidao, int page, int rows);*/ - - //@Arguments("id") - //JeecgMinidaoEntity getJeecgMinidao(String id); - -/* -*/ - - /*@Arguments("jeecgMinidao") - int update(JeecgMinidaoEntity jeecgMinidao); - - @Arguments("jeecgMinidao") - void insert(JeecgMinidaoEntity jeecgMinidao); - - @Arguments("jeecgMinidao") - void delete(JeecgMinidaoEntity jeecgMinidao);*/ - @Arguments("log") @ResultType(JeecgLogReport.class) List getLogReportData(JeecgLogReport log); diff --git a/jeecg-framework/src/main/java/com/jeecg/demo/entity/JeecgDemoEntity.java b/jeecg-framework/src/main/java/com/jeecg/demo/entity/JeecgDemoEntity.java index e3a96506..abe63553 100644 --- a/jeecg-framework/src/main/java/com/jeecg/demo/entity/JeecgDemoEntity.java +++ b/jeecg-framework/src/main/java/com/jeecg/demo/entity/JeecgDemoEntity.java @@ -48,7 +48,7 @@ public class JeecgDemoEntity implements java.io.Serializable { private java.lang.String phone; /**工资*/ @Excel(name="工资") - private java.lang.String salary; + private Double salary; /**性别*/ @Excel(name="性别",dicCode="sex") private java.lang.String sex; @@ -214,7 +214,7 @@ public class JeecgDemoEntity implements java.io.Serializable { *@return: java.lang.String 工资 */ @Column(name ="SALARY",nullable=true,scale=2,length=19) - public java.lang.String getSalary(){ + public Double getSalary(){ return this.salary; } @@ -222,7 +222,7 @@ public class JeecgDemoEntity implements java.io.Serializable { *方法: 设置java.lang.String *@param: java.lang.String 工资 */ - public void setSalary(java.lang.String salary){ + public void setSalary(Double salary){ this.salary = salary; } /** diff --git a/jeecg-framework/src/main/java/org/jeecgframework/core/annotation/Ehcache.java b/jeecg-framework/src/main/java/org/jeecgframework/core/annotation/Ehcache.java index 6f389dfc..04df05a5 100644 --- a/jeecg-framework/src/main/java/org/jeecgframework/core/annotation/Ehcache.java +++ b/jeecg-framework/src/main/java/org/jeecgframework/core/annotation/Ehcache.java @@ -21,6 +21,7 @@ public @interface Ehcache { // 增加缓存还是删除缓存,默认为增加缓存 boolean addOrdel() default true; - //临时缓存还是永久缓存,默认为永久缓存 + //临时缓存还是永久缓存,默认为缓存缓存 + //TODO 暂时只支持临时缓存,未实现永久缓存 boolean eternal() default true; } diff --git a/jeecg-framework/src/main/java/org/jeecgframework/core/annotation/JAuth.java b/jeecg-framework/src/main/java/org/jeecgframework/core/annotation/JAuth.java index 487215d6..4fa378e6 100644 --- a/jeecg-framework/src/main/java/org/jeecgframework/core/annotation/JAuth.java +++ b/jeecg-framework/src/main/java/org/jeecgframework/core/annotation/JAuth.java @@ -16,5 +16,5 @@ import org.jeecgframework.core.enums.Permission; @Documented public @interface JAuth { String value() default ""; - Permission auth() default Permission.NORMAL; + Permission auth() default Permission.SKIP_AUTH; } \ No newline at end of file diff --git a/jeecg-framework/src/main/java/org/jeecgframework/core/aop/EhcacheAspect.java b/jeecg-framework/src/main/java/org/jeecgframework/core/aop/EhcacheAspect.java index 341d933d..f80cfabd 100644 --- a/jeecg-framework/src/main/java/org/jeecgframework/core/aop/EhcacheAspect.java +++ b/jeecg-framework/src/main/java/org/jeecgframework/core/aop/EhcacheAspect.java @@ -7,12 +7,14 @@ import net.sf.ehcache.Cache; import net.sf.ehcache.CacheManager; import net.sf.ehcache.Element; +import org.apache.log4j.Logger; import org.aspectj.lang.ProceedingJoinPoint; import org.aspectj.lang.annotation.AfterReturning; import org.aspectj.lang.annotation.Around; import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.Pointcut; import org.jeecgframework.core.annotation.Ehcache; +import org.jeecgframework.core.util.oConvertUtils; import org.springframework.stereotype.Component; import com.alibaba.fastjson.JSON; @@ -20,23 +22,14 @@ import com.alibaba.fastjson.JSON; /** * * @author 张代浩 + * @ * */ @Component @Aspect public class EhcacheAspect { -// private static Cache dictCache; -// private static Cache eternalCache; -// -// static { -// if (eternalCache == null) { -// eternalCache = CacheManager.getInstance().getCache("eternalCache"); -// } -// if (dictCache == null) { -// dictCache = CacheManager.getInstance().getCache("dictCache"); -// } -// } - + private static final Logger logger = Logger.getLogger(EhcacheAspect.class); + @Pointcut("@annotation(org.jeecgframework.core.annotation.Ehcache)") public void simplePointcut() { } @@ -46,40 +39,42 @@ public class EhcacheAspect { } @Around("simplePointcut()") - public Object aroundLogCalls(ProceedingJoinPoint joinPoint) - throws Throwable { - - Cache eternalCache = CacheManager.getInstance().getCache("eternalCache"); - Cache dictCache = CacheManager.getInstance().getCache("eternalCache"); - + public Object aroundLogCalls(ProceedingJoinPoint joinPoint)throws Throwable { String targetName = joinPoint.getTarget().getClass().toString(); String methodName = joinPoint.getSignature().getName(); - Object[] arguments = joinPoint.getArgs(); + Object[] arguments = joinPoint.getArgs(); + + logger.debug("-------ehcache------aspect-----targetclass: "+ targetName); //试图得到标注的Ehcache类 @SuppressWarnings("unused") Method[] methods = joinPoint.getTarget().getClass().getMethods(); Ehcache flag = null; - for(Method m:methods){ - if(m.getName().equals(methodName)){ - Class[] tmpCs = m.getParameterTypes(); - if(tmpCs.length==arguments.length){ - flag = m.getAnnotation(Ehcache.class); - break; - } + for (Method m : methods) { + if (m.getName().equals(methodName)) { + Class[] tmpCs = m.getParameterTypes(); + if (tmpCs.length == arguments.length) { + flag = m.getAnnotation(Ehcache.class); + break; + } } } if(flag==null){ return null; } - //Ehcache flag =joinPoint.getTarget().getClass().getMethod(methodName).getAnnotation(Ehcache.class); Object result; String cacheKey = getCacheKey(targetName, methodName, arguments); Element element = null; + + Cache eternalCache = CacheManager.getInstance().getCache("eternalCache"); + //自定义缓存名字 + if(oConvertUtils.isNotEmpty(flag.cacheName())){ + eternalCache = CacheManager.getInstance().getCache(flag.cacheName()); + } if(flag.eternal()){ //永久缓存 - element = dictCache.get(cacheKey); + element = eternalCache.get(cacheKey); }else{ //临时缓存 element = eternalCache.get(cacheKey); @@ -96,7 +91,7 @@ public class EhcacheAspect { element = new Element(cacheKey, (Serializable) result); if(flag.eternal()){ //永久缓存 - dictCache.put(element); + eternalCache.put(element); }else{ //临时缓存 eternalCache.put(element); diff --git a/jeecg-framework/src/main/java/org/jeecgframework/core/aop/RedisCacheAspect.java b/jeecg-framework/src/main/java/org/jeecgframework/core/aop/RedisCacheAspect.java index 8453fa4e..b85cf525 100644 --- a/jeecg-framework/src/main/java/org/jeecgframework/core/aop/RedisCacheAspect.java +++ b/jeecg-framework/src/main/java/org/jeecgframework/core/aop/RedisCacheAspect.java @@ -3,17 +3,15 @@ package org.jeecgframework.core.aop; import java.lang.reflect.Method; import java.util.concurrent.TimeUnit; +import javax.annotation.Resource; + import org.apache.commons.lang.StringUtils; 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.jeecgframework.core.annotation.Ehcache; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.redis.core.BoundValueOperations; import org.springframework.data.redis.core.RedisTemplate; -import org.springframework.data.redis.serializer.JdkSerializationRedisSerializer; -import org.springframework.stereotype.Component; import com.alibaba.fastjson.JSON; @@ -24,15 +22,10 @@ import com.alibaba.fastjson.JSON; //@Component //@Aspect public class RedisCacheAspect { - - private RedisTemplate redisTemplate; - @Autowired - public void setRedis(RedisTemplate redisTemplate) { - this.redisTemplate = redisTemplate; - //泛型设置成Long后必须更改对应的序列化方案 - redisTemplate.setValueSerializer(new JdkSerializationRedisSerializer()); - } + //TODO ? + @Resource + private RedisTemplate redisTemplate; @Pointcut("@annotation(org.jeecgframework.core.annotation.Ehcache)") public void simplePointcut() {} diff --git a/jeecg-framework/src/main/java/org/jeecgframework/core/common/dao/impl/GenericBaseCommonDao.java b/jeecg-framework/src/main/java/org/jeecgframework/core/common/dao/impl/GenericBaseCommonDao.java index c7d1dbac..b4476fd8 100644 --- a/jeecg-framework/src/main/java/org/jeecgframework/core/common/dao/impl/GenericBaseCommonDao.java +++ b/jeecg-framework/src/main/java/org/jeecgframework/core/common/dao/impl/GenericBaseCommonDao.java @@ -10,8 +10,6 @@ import java.util.List; import java.util.Map; import java.util.Set; -import javax.lang.model.util.ElementScanner6; - import org.apache.commons.lang.StringUtils; import org.apache.log4j.Logger; import org.hibernate.Criteria; @@ -36,12 +34,10 @@ import org.jeecgframework.core.common.dao.IGenericBaseCommonDao; import org.jeecgframework.core.common.dao.jdbc.JdbcDao; import org.jeecgframework.core.common.exception.BusinessException; import org.jeecgframework.core.common.hibernate.qbc.CriteriaQuery; -import org.jeecgframework.core.common.hibernate.qbc.DetachedCriteriaUtil; import org.jeecgframework.core.common.hibernate.qbc.HqlQuery; import org.jeecgframework.core.common.hibernate.qbc.PageList; import org.jeecgframework.core.common.hibernate.qbc.PagerUtil; import org.jeecgframework.core.common.model.common.DBTable; -import org.jeecgframework.core.common.model.json.DataGridReturn; import org.jeecgframework.core.util.MyBeanUtils; import org.jeecgframework.core.util.StringUtil; import org.jeecgframework.core.util.ToEntityUtil; @@ -685,7 +681,10 @@ public abstract class GenericBaseCommonDao } else { pageSize = allCounts; } - DetachedCriteriaUtil.selectColumn(cq.getDetachedCriteria(), cq.getField().split(","), cq.getEntityClass(), false); + + //DetachedCriteriaUtil.selectColumn(cq.getDetachedCriteria(), cq.getField().split(","), cq.getEntityClass(), false); + + return new DataTableReturn(allCounts, allCounts, cq.getDataTables().getEcho(), criteria.list()); } diff --git a/jeecg-framework/src/main/java/org/jeecgframework/core/common/hibernate/qbc/AliasToBean.java b/jeecg-framework/src/main/java/org/jeecgframework/core/common/hibernate/qbc/AliasToBean.java index e00fc8b4..daf7e896 100644 --- a/jeecg-framework/src/main/java/org/jeecgframework/core/common/hibernate/qbc/AliasToBean.java +++ b/jeecg-framework/src/main/java/org/jeecgframework/core/common/hibernate/qbc/AliasToBean.java @@ -1,67 +1,67 @@ -package org.jeecgframework.core.common.hibernate.qbc; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import ognl.Ognl; - -import org.hibernate.HibernateException; -import org.hibernate.transform.ResultTransformer; - -import com.opensymphony.xwork2.ognl.OgnlUtil; -import com.opensymphony.xwork2.util.reflection.ReflectionContextState; - -/** - * 此版本运行在xwork-core-2.1.6.jar - * 支持属性为自定义对象的结果集转换的部份属性查询 - * 2009-3-30 - * @author 苍鹰 - */ -public class AliasToBean implements ResultTransformer { - private static final long serialVersionUID = 1L; - private static final OgnlUtil ognlUntil = new OgnlUtil(); - private static final Map context = new HashMap(1); - static{ - context.put(ReflectionContextState.CREATE_NULL_OBJECTS, true); - } - - /** POJO的class */ - private final Class resultClass; - - public AliasToBean(Class pojoClass) { - if(pojoClass==null) throw new IllegalArgumentException("resultClass cannot be null"); - this.resultClass = pojoClass; - } - - @SuppressWarnings("unchecked") - - public List transformList(List collection) { - return collection; - } - - /** - * 结果集转换 - * 2009-4-7 - * @author 苍鹰 - * @param tuple 属性值集合 - * @param aliases 属性名集合 - * @return 单个POJO实例--查询结果 - */ - - public Object transformTuple(Object[] tuple, String[] aliases) { - try { - Object root = resultClass.newInstance(); - for (int i = 0; i < aliases.length; i++) { - if(aliases[i]!=null && !aliases[i].equals("")) - { - Ognl.setValue(ognlUntil.compile(aliases[i]), context, root, tuple[i]); - } - } - return root; - } catch (Exception e) { - throw new HibernateException(e.getMessage(),e); - } - } - -} +//package org.jeecgframework.core.common.hibernate.qbc; +// +//import java.util.HashMap; +//import java.util.List; +//import java.util.Map; +// +//import ognl.Ognl; +// +//import org.hibernate.HibernateException; +//import org.hibernate.transform.ResultTransformer; +// +//import com.opensymphony.xwork2.ognl.OgnlUtil; +//import com.opensymphony.xwork2.util.reflection.ReflectionContextState; +// +///** +// * 此版本运行在xwork-core-2.1.6.jar +// * 支持属性为自定义对象的结果集转换的部份属性查询 +// * 2009-3-30 +// * @author 苍鹰 +// */ +//public class AliasToBean implements ResultTransformer { +// private static final long serialVersionUID = 1L; +// private static final OgnlUtil ognlUntil = new OgnlUtil(); +// private static final Map context = new HashMap(1); +// static{ +// context.put(ReflectionContextState.CREATE_NULL_OBJECTS, true); +// } +// +// /** POJO的class */ +// private final Class resultClass; +// +// public AliasToBean(Class pojoClass) { +// if(pojoClass==null) throw new IllegalArgumentException("resultClass cannot be null"); +// this.resultClass = pojoClass; +// } +// +// @SuppressWarnings("unchecked") +// +// public List transformList(List collection) { +// return collection; +// } +// +// /** +// * 结果集转换 +// * 2009-4-7 +// * @author 苍鹰 +// * @param tuple 属性值集合 +// * @param aliases 属性名集合 +// * @return 单个POJO实例--查询结果 +// */ +// +// public Object transformTuple(Object[] tuple, String[] aliases) { +// try { +// Object root = resultClass.newInstance(); +// for (int i = 0; i < aliases.length; i++) { +// if(aliases[i]!=null && !aliases[i].equals("")) +// { +// Ognl.setValue(ognlUntil.compile(aliases[i]), context, root, tuple[i]); +// } +// } +// return root; +// } catch (Exception e) { +// throw new HibernateException(e.getMessage(),e); +// } +// } +// +//} diff --git a/jeecg-framework/src/main/java/org/jeecgframework/core/common/hibernate/qbc/CriteriaQuery.java b/jeecg-framework/src/main/java/org/jeecgframework/core/common/hibernate/qbc/CriteriaQuery.java index 30a375e6..432d3864 100644 --- a/jeecg-framework/src/main/java/org/jeecgframework/core/common/hibernate/qbc/CriteriaQuery.java +++ b/jeecg-framework/src/main/java/org/jeecgframework/core/common/hibernate/qbc/CriteriaQuery.java @@ -145,12 +145,16 @@ public class CriteriaQuery { this.ordermap = new LinkedHashMap(); } + +// 【scott 20180526 删除无用代码|xwork-core】 public CriteriaQuery(Class entityClass,DataTables dataTables) { this.curPage = dataTables.getDisplayStart(); String[] fieldstring=dataTables.getsColumns().split(","); - this.detachedCriteria = DetachedCriteriaUtil - .createDetachedCriteria(entityClass, "start", "_table",fieldstring); - //this.detachedCriteria = DetachedCriteria.forClass(c); + + this.detachedCriteria = DetachedCriteria.forClass(entityClass); + //this.detachedCriteria = DetachedCriteriaUtil.createDetachedCriteria(entityClass, "start", "_table",fieldstring); + + this.field=dataTables.getsColumns(); this.entityClass=entityClass; this.dataTables=dataTables; diff --git a/jeecg-framework/src/main/java/org/jeecgframework/core/common/hibernate/qbc/DetachedCriteriaUtil.java b/jeecg-framework/src/main/java/org/jeecgframework/core/common/hibernate/qbc/DetachedCriteriaUtil.java index 9a409949..5c85209e 100644 --- a/jeecg-framework/src/main/java/org/jeecgframework/core/common/hibernate/qbc/DetachedCriteriaUtil.java +++ b/jeecg-framework/src/main/java/org/jeecgframework/core/common/hibernate/qbc/DetachedCriteriaUtil.java @@ -1,253 +1,253 @@ -package org.jeecgframework.core.common.hibernate.qbc; - -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Set; - -import javax.servlet.http.HttpServletRequest; - -import org.hibernate.FetchMode; -import org.hibernate.criterion.DetachedCriteria; -import org.hibernate.criterion.Projection; -import org.hibernate.criterion.ProjectionList; -import org.hibernate.criterion.Projections; -import org.hibernate.transform.Transformers; -import org.jeecgframework.core.util.ContextHolderUtils; -import org.jeecgframework.core.util.ResourceUtil; -import org.jeecgframework.core.util.StringUtil; - - - -/** - * 拼装Hibernate条件 - */ -public class DetachedCriteriaUtil { - - /** 小写字母X */ - public static final String MIDDLE_SEPRATOR_CHAR = "x"; - /** 两个空格 */ - public static final String SEPARATOR_TWO_SPACE = " ";// 两个空格,避免和"日期 时间"中的空格混淆 - /** 此字符串内容为" <= x <= ",不包括引号 */ - static public ProjectionList projectionList; - - - public static ProjectionList getProjectionList() { - return projectionList; - } - - private DetachedCriteriaUtil(){ - //do not allow to create Object - } - - /** - * 自动拼装条件 2008-11-3 - * - * @author 苍鹰 - * @param pojoClazz - * 实体类名 - * @param startChar - * 参数统一的开始字符 - * @param alias - * 别名 - * @return DetachedCriteria 组装好的查询条件 - */ - public static DetachedCriteria createDetachedCriteria(Class pojoClazz, - String startChar,String alias) { - return createDetachedCriteria(pojoClazz, startChar, alias,null); - } - - /** - * 自动拼装条件 2008-11-3 - * - * @author 苍鹰 - * @param pojoClazz - * 实体类名 - * @param startChar - * 参数统一的开始字符 - * @param alias - * 别名 - * @param columnNames - * 作为select子句的属性名集合 - * @return DetachedCriteria 组装好的查询条件 - */ - public static DetachedCriteria createDetachedCriteria(Class pojoClazz, - String startChar,String alias,String[] columnNames) { - return createDetachedCriteria(pojoClazz, startChar, alias, columnNames, null); - } - - /** - * 自动拼装条件 2008-11-3 - * - * @author 苍鹰 - * @param pojoClazz - * 实体类名 - * @param startChar - * 参数统一的开始字符 - * @param columnNames - * 作为select子句的属性名集合 - * @param excludeParameters - * 不作为查询条件的参数 - * @param alias - * 别名 - * @return DetachedCriteria 组装好的查询条件 - */ - public static DetachedCriteria createDetachedCriteria(Class pojoClazz, - String startChar,String alias,String[] columnNames,String[] excludeParameters) { - DetachedCriteria criteria = DetachedCriteria.forClass(pojoClazz,alias); - if(columnNames!=null && columnNames.length>0){ - //selectColumn(criteria, columnNames, pojoClazz, false); - } - return criteria; - } - - private static final String ALIAS_KEY_IN_REQUEST = "ALIAS_KEY_IN_REQUEST"; - private static final String HAS_JOIN_TABLE_KEY_IN_REQUEST = "HAS_JOIN_TABLE_KEY_IN_REQUEST"; - - private static void setAliasToRequest(HttpServletRequest request,Set aliases) { - request.setAttribute(ALIAS_KEY_IN_REQUEST, aliases); - } - - @SuppressWarnings("unchecked") - private static Set getAliasesFromRequest(){ - Set aliases = (Set) ContextHolderUtils.getRequest().getAttribute(ALIAS_KEY_IN_REQUEST); - if(aliases==null){ - aliases = new HashSet(5); - setAliasToRequest(ContextHolderUtils.getRequest(), aliases); - } - return aliases; - } - - private static boolean getHasJoinTatleFromRequest(){ - Boolean hasJoin = (Boolean) ContextHolderUtils.getRequest().getAttribute(HAS_JOIN_TABLE_KEY_IN_REQUEST); - return hasJoin==null?false:hasJoin; - } - - - - - /** - * 该方法提供DetachedCriteria对查询字段的封装, 2008-9-29 - * 2009.9.9修改后,可支持无限级联取部分字段,如取如下字段 - * user.organization.parentOrganization.parentOrganization.orgName - * 但请注意1点 ,连接采用内联,级联越多,结果集可能就越少; - * @author - * @param columnNames - * 字符串数组,以数据的形式接收要查询的字段属性,如String[] column={"属性1","属性2","属性3"}; - * @param pojoClass - * 实体类的Class,如Mobile.class; - * @param aials - * 为要查询的POJO对象指定一个别名 - * @return DetachedCriteria 的一个对象,如果需要查询条件,在些对象后追加查询条件。 - * - * @param forJoinTable 是否多表连接查询 - */ - public static void selectColumn(DetachedCriteria criteria, String[] columnNames, - Class pojoClass,boolean forJoinTable) { - if (null == columnNames) { - return; - } - - //使用这个临时变量集合,是因为dinstinct关键字要放在最前面,而distinct关键字要在下面才决定放不放, - List tempProjectionList = new ArrayList(); - - Set aliases = getAliasesFromRequest(); - boolean hasJoniTable = false; - String rootAlias = criteria.getAlias(); - for (String property : columnNames) { - if(property.contains("_")){ - String[] propertyChain = property.split("_"); - createAlias(criteria,rootAlias,aliases,propertyChain,0); - tempProjectionList.add(Projections.property(StringUtil.getProperty(property)).as(StringUtil.getProperty(property))); - hasJoniTable = true; - }else{ - tempProjectionList.add(Projections.property(rootAlias + POINT + property).as(property)); - } - } - - projectionList = Projections.projectionList(); - if(hasJoniTable || forJoinTable || getHasJoinTatleFromRequest()){//这个一定要放在tempProjectionList的前面,因为distinct要在最前面 - projectionList.add(Projections.distinct(Projections.id())); - } - - for (Projection proj : tempProjectionList) { - projectionList.add(proj); - } - - criteria.setProjection(projectionList); - - - if(!hasJoniTable){ - criteria.setResultTransformer(Transformers.aliasToBean(pojoClass)); - }else{//下面这个是自定义的结果转换器 - criteria.setResultTransformer(new AliasToBean(pojoClass)); - } - } - - private static final String POINT = "."; - - /** - * 创建别名 - * @author 苍鹰 - * 2009-9-9 - * @param criteria - * @param rootAlais - * @param aliases - * @param columns - * @param currentStep - */ - private static void createAlias(DetachedCriteria criteria, String rootAlais, Set aliases,String[] columns,int currentStep){ - if(currentStep0){ - criteria.createAlias(converArrayToAlias(columns, currentStep-1) + POINT +columns[currentStep], converArrayToAlias(columns, currentStep)).setFetchMode(columns[currentStep], FetchMode.JOIN); - }else{ - criteria.createAlias(rootAlais + POINT +columns[currentStep], converArrayToAlias(columns, currentStep)).setFetchMode(columns[currentStep], FetchMode.JOIN); - } - aliases.add(converArrayToAlias(columns, currentStep)); - } - currentStep++; - createAlias(criteria, rootAlais, aliases, columns, currentStep); - } - } - - - /** - * 从"organization.parentOrganization.parentOrganization.parentOrganization.id" 得到 - * "organization_parentOrganization_parentOrganization_parentOrganization.id" - * @author 苍鹰 - * 2009-9-20 - * @param property - * @return - */ - public static String getAliasFromPropertyChainString(String property){ - if(property.contains(".")){ - return property.substring(0, property.lastIndexOf(POINT)).replaceAll("\\.", "_") + property.substring(property.lastIndexOf(POINT)); - - } - return property; - } - - /** - * 从数组中创建ALIAS - * @author 苍鹰 - * 2009-9-10 - * @param columns - * @param currentStep - * @return - */ - private static String converArrayToAlias(String[] columns,int currentStep){ - StringBuilder alias = new StringBuilder(); - for (int i = 0; i <= currentStep; i++) { - if(alias.length()>0){ - alias.append("_"); - } - alias.append(columns[i]); - } - return alias.toString(); - } - - - - -} +//package org.jeecgframework.core.common.hibernate.qbc; +// +//import java.util.ArrayList; +//import java.util.HashSet; +//import java.util.List; +//import java.util.Set; +// +//import javax.servlet.http.HttpServletRequest; +// +//import org.hibernate.FetchMode; +//import org.hibernate.criterion.DetachedCriteria; +//import org.hibernate.criterion.Projection; +//import org.hibernate.criterion.ProjectionList; +//import org.hibernate.criterion.Projections; +//import org.hibernate.transform.Transformers; +//import org.jeecgframework.core.util.ContextHolderUtils; +//import org.jeecgframework.core.util.ResourceUtil; +//import org.jeecgframework.core.util.StringUtil; +// +// +// +///** +// * 拼装Hibernate条件 +// */ +//public class DetachedCriteriaUtil { +// +// /** 小写字母X */ +// public static final String MIDDLE_SEPRATOR_CHAR = "x"; +// /** 两个空格 */ +// public static final String SEPARATOR_TWO_SPACE = " ";// 两个空格,避免和"日期 时间"中的空格混淆 +// /** 此字符串内容为" <= x <= ",不包括引号 */ +// static public ProjectionList projectionList; +// +// +// public static ProjectionList getProjectionList() { +// return projectionList; +// } +// +// private DetachedCriteriaUtil(){ +// //do not allow to create Object +// } +// +// /** +// * 自动拼装条件 2008-11-3 +// * +// * @author 苍鹰 +// * @param pojoClazz +// * 实体类名 +// * @param startChar +// * 参数统一的开始字符 +// * @param alias +// * 别名 +// * @return DetachedCriteria 组装好的查询条件 +// */ +// public static DetachedCriteria createDetachedCriteria(Class pojoClazz, +// String startChar,String alias) { +// return createDetachedCriteria(pojoClazz, startChar, alias,null); +// } +// +// /** +// * 自动拼装条件 2008-11-3 +// * +// * @author 苍鹰 +// * @param pojoClazz +// * 实体类名 +// * @param startChar +// * 参数统一的开始字符 +// * @param alias +// * 别名 +// * @param columnNames +// * 作为select子句的属性名集合 +// * @return DetachedCriteria 组装好的查询条件 +// */ +// public static DetachedCriteria createDetachedCriteria(Class pojoClazz, +// String startChar,String alias,String[] columnNames) { +// return createDetachedCriteria(pojoClazz, startChar, alias, columnNames, null); +// } +// +// /** +// * 自动拼装条件 2008-11-3 +// * +// * @author 苍鹰 +// * @param pojoClazz +// * 实体类名 +// * @param startChar +// * 参数统一的开始字符 +// * @param columnNames +// * 作为select子句的属性名集合 +// * @param excludeParameters +// * 不作为查询条件的参数 +// * @param alias +// * 别名 +// * @return DetachedCriteria 组装好的查询条件 +// */ +// public static DetachedCriteria createDetachedCriteria(Class pojoClazz, +// String startChar,String alias,String[] columnNames,String[] excludeParameters) { +// DetachedCriteria criteria = DetachedCriteria.forClass(pojoClazz,alias); +// if(columnNames!=null && columnNames.length>0){ +// //selectColumn(criteria, columnNames, pojoClazz, false); +// } +// return criteria; +// } +// +// private static final String ALIAS_KEY_IN_REQUEST = "ALIAS_KEY_IN_REQUEST"; +// private static final String HAS_JOIN_TABLE_KEY_IN_REQUEST = "HAS_JOIN_TABLE_KEY_IN_REQUEST"; +// +// private static void setAliasToRequest(HttpServletRequest request,Set aliases) { +// request.setAttribute(ALIAS_KEY_IN_REQUEST, aliases); +// } +// +// @SuppressWarnings("unchecked") +// private static Set getAliasesFromRequest(){ +// Set aliases = (Set) ContextHolderUtils.getRequest().getAttribute(ALIAS_KEY_IN_REQUEST); +// if(aliases==null){ +// aliases = new HashSet(5); +// setAliasToRequest(ContextHolderUtils.getRequest(), aliases); +// } +// return aliases; +// } +// +// private static boolean getHasJoinTatleFromRequest(){ +// Boolean hasJoin = (Boolean) ContextHolderUtils.getRequest().getAttribute(HAS_JOIN_TABLE_KEY_IN_REQUEST); +// return hasJoin==null?false:hasJoin; +// } +// +// +// +// +// /** +// * 该方法提供DetachedCriteria对查询字段的封装, 2008-9-29 +// * 2009.9.9修改后,可支持无限级联取部分字段,如取如下字段 +// * user.organization.parentOrganization.parentOrganization.orgName +// * 但请注意1点 ,连接采用内联,级联越多,结果集可能就越少; +// * @author +// * @param columnNames +// * 字符串数组,以数据的形式接收要查询的字段属性,如String[] column={"属性1","属性2","属性3"}; +// * @param pojoClass +// * 实体类的Class,如Mobile.class; +// * @param aials +// * 为要查询的POJO对象指定一个别名 +// * @return DetachedCriteria 的一个对象,如果需要查询条件,在些对象后追加查询条件。 +// * +// * @param forJoinTable 是否多表连接查询 +// */ +// public static void selectColumn(DetachedCriteria criteria, String[] columnNames, +// Class pojoClass,boolean forJoinTable) { +// if (null == columnNames) { +// return; +// } +// +// //使用这个临时变量集合,是因为dinstinct关键字要放在最前面,而distinct关键字要在下面才决定放不放, +// List tempProjectionList = new ArrayList(); +// +// Set aliases = getAliasesFromRequest(); +// boolean hasJoniTable = false; +// String rootAlias = criteria.getAlias(); +// for (String property : columnNames) { +// if(property.contains("_")){ +// String[] propertyChain = property.split("_"); +// createAlias(criteria,rootAlias,aliases,propertyChain,0); +// tempProjectionList.add(Projections.property(StringUtil.getProperty(property)).as(StringUtil.getProperty(property))); +// hasJoniTable = true; +// }else{ +// tempProjectionList.add(Projections.property(rootAlias + POINT + property).as(property)); +// } +// } +// +// projectionList = Projections.projectionList(); +// if(hasJoniTable || forJoinTable || getHasJoinTatleFromRequest()){//这个一定要放在tempProjectionList的前面,因为distinct要在最前面 +// projectionList.add(Projections.distinct(Projections.id())); +// } +// +// for (Projection proj : tempProjectionList) { +// projectionList.add(proj); +// } +// +// criteria.setProjection(projectionList); +// +// +// if(!hasJoniTable){ +// criteria.setResultTransformer(Transformers.aliasToBean(pojoClass)); +// }else{//下面这个是自定义的结果转换器 +// criteria.setResultTransformer(new AliasToBean(pojoClass)); +// } +// } +// +// private static final String POINT = "."; +// +// /** +// * 创建别名 +// * @author 苍鹰 +// * 2009-9-9 +// * @param criteria +// * @param rootAlais +// * @param aliases +// * @param columns +// * @param currentStep +// */ +// private static void createAlias(DetachedCriteria criteria, String rootAlais, Set aliases,String[] columns,int currentStep){ +// if(currentStep0){ +// criteria.createAlias(converArrayToAlias(columns, currentStep-1) + POINT +columns[currentStep], converArrayToAlias(columns, currentStep)).setFetchMode(columns[currentStep], FetchMode.JOIN); +// }else{ +// criteria.createAlias(rootAlais + POINT +columns[currentStep], converArrayToAlias(columns, currentStep)).setFetchMode(columns[currentStep], FetchMode.JOIN); +// } +// aliases.add(converArrayToAlias(columns, currentStep)); +// } +// currentStep++; +// createAlias(criteria, rootAlais, aliases, columns, currentStep); +// } +// } +// +// +// /** +// * 从"organization.parentOrganization.parentOrganization.parentOrganization.id" 得到 +// * "organization_parentOrganization_parentOrganization_parentOrganization.id" +// * @author 苍鹰 +// * 2009-9-20 +// * @param property +// * @return +// */ +// public static String getAliasFromPropertyChainString(String property){ +// if(property.contains(".")){ +// return property.substring(0, property.lastIndexOf(POINT)).replaceAll("\\.", "_") + property.substring(property.lastIndexOf(POINT)); +// +// } +// return property; +// } +// +// /** +// * 从数组中创建ALIAS +// * @author 苍鹰 +// * 2009-9-10 +// * @param columns +// * @param currentStep +// * @return +// */ +// private static String converArrayToAlias(String[] columns,int currentStep){ +// StringBuilder alias = new StringBuilder(); +// for (int i = 0; i <= currentStep; i++) { +// if(alias.length()>0){ +// alias.append("_"); +// } +// alias.append(columns[i]); +// } +// return alias.toString(); +// } +// +// +// +// +//} diff --git a/jeecg-framework/src/main/java/org/jeecgframework/core/common/service/CommonService.java b/jeecg-framework/src/main/java/org/jeecgframework/core/common/service/CommonService.java index 7c151b1f..b5497a58 100644 --- a/jeecg-framework/src/main/java/org/jeecgframework/core/common/service/CommonService.java +++ b/jeecg-framework/src/main/java/org/jeecgframework/core/common/service/CommonService.java @@ -338,7 +338,7 @@ public interface CommonService { * 使用指定的检索标准检索数据并分页返回数据For JDBC-采用预处理方式 * */ - public Long getCountForJdbcParam(String sql, Object[] objs); + public Long getCountForJdbcParam(String sql, Object... objs); /** * 通过hql 查询语句查找对象 diff --git a/jeecg-framework/src/main/java/org/jeecgframework/core/common/service/impl/CommonServiceImpl.java b/jeecg-framework/src/main/java/org/jeecgframework/core/common/service/impl/CommonServiceImpl.java index 03596a64..2571b6ee 100644 --- a/jeecg-framework/src/main/java/org/jeecgframework/core/common/service/impl/CommonServiceImpl.java +++ b/jeecg-framework/src/main/java/org/jeecgframework/core/common/service/impl/CommonServiceImpl.java @@ -437,7 +437,7 @@ public class CommonServiceImpl implements CommonService { } @Transactional(readOnly = true) - public Long getCountForJdbcParam(String sql, Object[] objs) { + public Long getCountForJdbcParam(String sql, Object... objs) { return commonDao.getCountForJdbcParam(sql,objs); } diff --git a/jeecg-framework/src/main/java/org/jeecgframework/core/common/service/impl/RedisService.java b/jeecg-framework/src/main/java/org/jeecgframework/core/common/service/impl/RedisService.java new file mode 100644 index 00000000..47c61e42 --- /dev/null +++ b/jeecg-framework/src/main/java/org/jeecgframework/core/common/service/impl/RedisService.java @@ -0,0 +1,67 @@ +package org.jeecgframework.core.common.service.impl; + + +import java.util.Map; +import java.util.concurrent.TimeUnit; + +import javax.annotation.Resource; + +import org.springframework.data.redis.core.HashOperations; +import org.springframework.data.redis.core.StringRedisTemplate; +import org.springframework.stereotype.Service; + +/** + * RedisService工具类 + */ +@Service +public class RedisService { + + @Resource + private StringRedisTemplate redisTemplate; + + /** + * 删除key和value + */ + public void delete(String key){ + redisTemplate.delete(key); + } + + /** + * 根据key获取value + */ + public String get(String key){ + String value = redisTemplate.opsForValue().get(key); + return value; + } + + /** + * 将key和value存入redis,并设置有效时间,单位:天 + */ + public void set(String key, String value, long timeout){ + redisTemplate.opsForValue().set(key, value, timeout, TimeUnit.DAYS); + } + + /** + * 将key和value存入redis + */ + public void set(String key, String value){ + redisTemplate.opsForValue().set(key, value); + } + + /** + * 从redis中获取map + */ + public Map getMap(String key){ + HashOperations hash = redisTemplate.opsForHash(); + Map map = hash.entries(key); + return map; + } + + /** + * 将map存入redis,并设置时效 + */ + public void set(String key, Map map, long timeout){ + redisTemplate.opsForHash().putAll(key, map); + redisTemplate.expire(key, timeout, TimeUnit.DAYS); + } +} diff --git a/jeecg-framework/src/main/java/org/jeecgframework/core/constant/Globals.java b/jeecg-framework/src/main/java/org/jeecgframework/core/constant/Globals.java index 888446db..117ea24c 100644 --- a/jeecg-framework/src/main/java/org/jeecgframework/core/constant/Globals.java +++ b/jeecg-framework/src/main/java/org/jeecgframework/core/constant/Globals.java @@ -84,8 +84,8 @@ public final class Globals { /** * 权限类型 */ - public static final Short Function_TYPE_PAGE=0;//页面(菜单:菜单类型) - public static final Short Function_TYPE_FROM=1;//表单/或者弹出(菜单:访问类型) + public static final Short Function_TYPE_PAGE=0;//菜单:菜单类型 + public static final Short Function_TYPE_FROM=1;//菜单:权限类型(权限使用,不作为菜单首页加载) /** * 没有勾选的操作code */ diff --git a/jeecg-framework/src/main/java/org/jeecgframework/core/enums/MenuButtonsEnum.java b/jeecg-framework/src/main/java/org/jeecgframework/core/enums/MenuButtonsEnum.java index 4a5f5a54..173bb239 100644 --- a/jeecg-framework/src/main/java/org/jeecgframework/core/enums/MenuButtonsEnum.java +++ b/jeecg-framework/src/main/java/org/jeecgframework/core/enums/MenuButtonsEnum.java @@ -4,6 +4,7 @@ import org.jeecgframework.core.util.oConvertUtils; /** * 主从页面 菜单配置 ,code字符串不要有包含的情况 (例如:有了add 就不能有addOne) + * 【船舶专用】 * @author taoYan * @since 2017年12月25日 */ @@ -11,6 +12,13 @@ public enum MenuButtonsEnum { addgroup("addgroup","表单新增&word模式","iframeGoAdd&tempNoDo","fa fa-file-text-o&fa fa-file-word-o&fa fa-plus") ,editgroup("editgroup","表单编辑&word模式","iframeGoUpdate&tempNoDo","fa fa-file-text-o&fa fa-file-word-o&fa fa-pencil-square-o") ,batchDel("batchDel","批量删除","iframeDeleteAll","fa fa-trash-o") + ,save("save","保存","iframeGoSaveRow","fa fa-floppy-o") + ,reject("reject","取消编辑","iframeRejectUpdate","fa fa-reply") + ,template("template","模板下载","iframeExportXlsByT","fa fa-upload") + ,importe("import","数据导入","iframeImportExcel","fa fa-download") + ,export("export","数据导出","iframeExportXls","fa fa-share-square-o") + ,filter("filter","过滤","iframeFilter","fa fa-filter") + ,superQuery("superQuery","高级查询","superQuery","fa fa-search-plus") ; String code; @@ -92,15 +100,4 @@ public enum MenuButtonsEnum { this.icon = icon; } - /*,addone("addone","新增一行","iframeAddRow","iconfont icon-xinzengyihang") - /*,save("save","提交修改","iframeGoSaveRow","fa fa-share") - ,save("save","保存","iframeGoSaveRow","fa fa-floppy-o") - ,reject("reject","取消编辑","iframeRejectUpdate","fa fa-reply") - /*,addform("addform","表单新增","iframeGoAdd","fa fa-plus") - ,template("template","模板下载","iframeExportXlsByT","fa fa-upload") - ,importe("import","数据导入","iframeImportExcel","fa fa-download") - ,export("export","数据导出","iframeExportXls","fa fa-share-square-o") - ,filter("filter","过滤","iframeFilter","fa fa-filter") - ,superQuery("superQuery","高级查询","superQuery","fa fa-search-plus")*/ - } diff --git a/jeecg-framework/src/main/java/org/jeecgframework/core/enums/OnlineGenerateEnum.java b/jeecg-framework/src/main/java/org/jeecgframework/core/enums/OnlineGenerateEnum.java index ea615f32..7c667b74 100644 --- a/jeecg-framework/src/main/java/org/jeecgframework/core/enums/OnlineGenerateEnum.java +++ b/jeecg-framework/src/main/java/org/jeecgframework/core/enums/OnlineGenerateEnum.java @@ -41,9 +41,10 @@ public enum OnlineGenerateEnum { ONLINE_DIV_SINGLE("div.single","DIV风格表单","single","ext"), ONLINE_NOPOP_SINGLE("nopop.single","NOPOP风格表单","single","ext"), ONLINE_ROW_SINGLE("rowedit.single","行编辑风格表单","single","ext"), - ONLINE_TAB_ONETOMANY("tab.onetomany","TAB风格表单","onetomany","ext"), + ONLINE_TAB_ONETOMANY("tab.onetomany","TAB风格表单","onetomany","ext"); - ONLINE_VUEBT_SINGLE("vuebt.single","Bootstrap表单+VUE-Bootstrap-Table列表风格","single","ext"); + //TODO 暂时不推荐这个版本代码生成器 +// ONLINE_VUEBT_SINGLE("vuebt.single","Bootstrap表单+VUE-Bootstrap-Table列表风格","single","ext"); // ONLINE_DEFAULT_SINGLE("default.single","用户扩展风格示例","single","ext"), // ONLINE_DEFAULT_ONETOMANY("default.onetomany","用户扩展风格示例","onetomany","ext"); diff --git a/jeecg-framework/src/main/java/org/jeecgframework/core/enums/StoreUploadFilePathEnum.java b/jeecg-framework/src/main/java/org/jeecgframework/core/enums/StoreUploadFilePathEnum.java index 06a62e6d..97f52657 100644 --- a/jeecg-framework/src/main/java/org/jeecgframework/core/enums/StoreUploadFilePathEnum.java +++ b/jeecg-framework/src/main/java/org/jeecgframework/core/enums/StoreUploadFilePathEnum.java @@ -1,5 +1,7 @@ package org.jeecgframework.core.enums; +import java.io.File; + import org.jeecgframework.core.util.oConvertUtils; /** @@ -8,8 +10,8 @@ import org.jeecgframework.core.util.oConvertUtils; * */ public enum StoreUploadFilePathEnum { - PHOTOSUCAI("photosucai", "upload/img/photosucai"), - DEFAULT("default", "upload/files"); + PHOTOSUCAI("photosucai", "upload"+File.separator+"img"+File.separator+"photosucai"), + DEFAULT("default", "upload"+File.separator+"files"); private String name; private String path; diff --git a/jeecg-framework/src/main/java/org/jeecgframework/core/extend/hqlsearch/HqlGenerateUtil.java b/jeecg-framework/src/main/java/org/jeecgframework/core/extend/hqlsearch/HqlGenerateUtil.java index c7fe1425..8232b0ed 100644 --- a/jeecg-framework/src/main/java/org/jeecgframework/core/extend/hqlsearch/HqlGenerateUtil.java +++ b/jeecg-framework/src/main/java/org/jeecgframework/core/extend/hqlsearch/HqlGenerateUtil.java @@ -473,7 +473,6 @@ public class HqlGenerateUtil { } return sb.toString(); } -// --author:陈璞 ------begin---date:20150612--------for:sql组装 /** * 根据字段名称,获取字段的类型字符串 * return: java.lang.Integer diff --git a/jeecg-framework/src/main/java/org/jeecgframework/core/interceptors/AuthInterceptor.java b/jeecg-framework/src/main/java/org/jeecgframework/core/interceptors/AuthInterceptor.java index f9104d4f..50ed4be9 100644 --- a/jeecg-framework/src/main/java/org/jeecgframework/core/interceptors/AuthInterceptor.java +++ b/jeecg-framework/src/main/java/org/jeecgframework/core/interceptors/AuthInterceptor.java @@ -10,21 +10,21 @@ import java.util.Set; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpSession; -import com.alibaba.fastjson.JSONObject; import org.apache.log4j.Logger; import org.jeecgframework.core.annotation.JAuth; -import org.jeecgframework.core.common.exception.GlobalExceptionResolver; import org.jeecgframework.core.common.model.json.AjaxJson; import org.jeecgframework.core.constant.Globals; import org.jeecgframework.core.enums.Permission; import org.jeecgframework.core.extend.hqlsearch.SysContextSqlConvert; -import org.jeecgframework.core.util.*; +import org.jeecgframework.core.util.ContextHolderUtils; +import org.jeecgframework.core.util.JSONHelper; +import org.jeecgframework.core.util.JeecgDataAutorUtils; +import org.jeecgframework.core.util.ResourceUtil; +import org.jeecgframework.core.util.oConvertUtils; import org.jeecgframework.web.system.manager.ClientManager; import org.jeecgframework.web.system.pojo.base.Client; import org.jeecgframework.web.system.pojo.base.TSDataRule; -import org.jeecgframework.web.system.pojo.base.TSFunction; import org.jeecgframework.web.system.pojo.base.TSOperation; import org.jeecgframework.web.system.pojo.base.TSUser; import org.jeecgframework.web.system.service.SystemService; @@ -38,283 +38,157 @@ import org.springframework.web.servlet.view.RedirectView; /** * 权限拦截器 - * - * @author 张代浩 + * @Date 20180523 (重构) + * @Author 张代浩 + * @Description: [权限拦截器: 菜单访问权限、数据权限、按钮权限、页面表单权限] * */ public class AuthInterceptor implements HandlerInterceptor { private static final Logger logger = Logger.getLogger(AuthInterceptor.class); + @Autowired private SystemService systemService; + //精确匹配排除URLS private List excludeUrls; - /** - * 包含匹配(请求链接包含该配置链接,就进行过滤处理) - */ + //模糊匹配排除URLS private List excludeContainUrls; - - public List getExcludeUrls() { - return excludeUrls; - } - - public void setExcludeUrls(List excludeUrls) { - this.excludeUrls = excludeUrls; - } - - public List getExcludeContainUrls() { - return excludeContainUrls; - } - - public void setExcludeContainUrls(List excludeContainUrls) { - this.excludeContainUrls = excludeContainUrls; - } - - public SystemService getSystemService() { - return systemService; - } - - @Autowired - public void setSystemService(SystemService systemService) { - this.systemService = systemService; - } - - /** - * 在controller后拦截 - */ - public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object object, Exception exception) throws Exception { - } - - public void postHandle(HttpServletRequest request, HttpServletResponse response, Object object, ModelAndView modelAndView) throws Exception { - - } + + /** * 在controller前拦截 */ public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object object) throws Exception { - - //判断是否被注解跳过权限认证 先判断类注解然后方法注解 都没有则走原来逻辑 + //-----------------------注解排除权限拦截机制--------------------------------------- HandlerMethod handlerMethod=(HandlerMethod)object; JAuth jauthType =handlerMethod.getBean().getClass().getAnnotation(JAuth.class); - if(jauthType!=null){ - if(jauthType.auth()==Permission.SKIP_AUTH){ - return true; - } + if(jauthType!=null && jauthType.auth()==Permission.SKIP_AUTH){ + return true; }else{ - //JAuthority jauthMethod =handlerMethod.getMethodAnnotation(JAuthority.class); JAuth jauthMethod =handlerMethod.getMethod().getAnnotation(JAuth.class); - if(jauthMethod!=null){ - Permission permission=jauthMethod.auth(); - if(permission==Permission.SKIP_AUTH){ - return true; - } + if(jauthMethod!=null && jauthMethod.auth()==Permission.SKIP_AUTH){ + return true; } } - - Boolean isAjax=isAjax(request,response); - - String requestPath = ResourceUtil.getRequestPath(request);// 用户访问的资源地址 - //logger.info("-----authInterceptor----requestPath------"+requestPath); - //步骤一: 判断是否是排除拦截请求,直接返回TRUE - + //-----------------------注解排除权限拦截机制--------------------------------------- + + + //通过转换,获取用户的请求URL地址 + String requestPath = ResourceUtil.getJgAuthRequsetPath(request); + //API接口,不做登陆验证 if (requestPath.length()>3&&"api/".equals(requestPath.substring(0,4))) { return true; } - + + //针对拦截器排除URLS,进行排除 if (excludeUrls.contains(requestPath)) { return true; - } else if(moHuContain(excludeContainUrls, requestPath)){ return true; - } else { - //步骤二: 权限控制,优先重组请求URL(考虑online请求前缀一致问题) - String clickFunctionId = request.getParameter("clickFunctionId"); Client client = ClientManager.getInstance().getClient(ContextHolderUtils.getSession().getId()); TSUser currLoginUser = client!=null?client.getUser():null; - if (client != null && currLoginUser!=null ) { - //onlinecoding的访问地址有规律可循,数据权限链接篡改 + if (currLoginUser!=null ) { + String loginUserName = currLoginUser.getUserName(); + String loginUserId = currLoginUser.getId(); + String orgId = currLoginUser.getDepartid(); + //点击菜单ID + String functionId = request.getParameter("clickFunctionId"); + + //-----------------OnlineCoding-------------------------------------------------------------- + //步骤二: Online功能请求URL特殊规则,根据规则重组URL,支持多个参数 if(requestPath.equals("cgAutoListController.do?datagrid")) { requestPath += "&configId=" + request.getParameter("configId"); - } - if(requestPath.equals("cgAutoListController.do?list")) { + }else if(requestPath.equals("cgAutoListController.do?list")) { requestPath += "&id=" + request.getParameter("id"); } - if(requestPath.endsWith("?olstylecode=")) { requestPath = requestPath.replace("?olstylecode=", ""); } + //------------------------OnlineCoding------------------------------------------------------- + logger.debug("-----authInterceptor----requestPath------"+requestPath); - //步骤三: 根据重组请求URL,进行权限授权判断 - if((!(hasMenuAuth(requestPath,clickFunctionId,currLoginUser)) && !currLoginUser.getUserName().equals("admin"))){ - + + //步骤三: 判断请求URL,是否有菜单访问权限 + if(!systemService.loginUserIsHasMenuAuth(requestPath,functionId,loginUserId,orgId)){ + Boolean isAjax=isAjax(request); if(isAjax){ - processAjax(response); + processAjax(response); }else { response.sendRedirect(request.getSession().getServletContext().getContextPath()+"/loginController.do?noAuth"); } - return false; - } - - - //解决rest风格下 权限失效问题 - String functionId=""; - String uri= request.getRequestURI().substring(request.getContextPath().length() + 1); - String realRequestPath = null; - if(uri.endsWith(".do")||uri.endsWith(".action")){ - realRequestPath=requestPath; - }else { - realRequestPath=uri; } - -// if(!oConvertUtils.isEmpty(clickFunctionId)){ -// functionId = clickFunctionId; -// }else{ - - if(realRequestPath.indexOf("autoFormController/af/")>-1 && realRequestPath.indexOf("?")!=-1){ - realRequestPath = realRequestPath.substring(0, realRequestPath.indexOf("?")); - } - - List functions = systemService.findByProperty(TSFunction.class, "functionUrl", realRequestPath); - if (functions.size()>0){ - functionId = functions.get(0).getId(); - } -// } - - //Step.1 第一部分处理页面表单和列表的页面控件权限(页面表单字段+页面按钮等控件) - if(!oConvertUtils.isEmpty(functionId)){ - - if(!currLoginUser.getUserName().equals("admin")){ - //获取菜单对应的页面控制权限(包括表单字段和操作按钮) - - List operations = systemService.getOperationsByUserIdAndFunctionId(currLoginUser, functionId); - request.setAttribute(Globals.NOAUTO_OPERATIONCODES, operations); - if(operations==null){ - request.setAttribute(Globals.OPERATIONCODES, null); - }else{ - Set operationCodes = new HashSet(); - for (TSOperation operation : operations) { - operationCodes.add(operation.getId()); - } - request.setAttribute(Globals.OPERATIONCODES, operationCodes); + + + //Admin拥有特权,数据权限、页面表单权限、按钮权限不做控制 + if(!"admin".equals(loginUserName)){ + //----------------------------------------------------------------------------------------------------------------- + if(oConvertUtils.isEmpty(functionId)){ + //查询请求URL对应的菜单ID(因为数据权限、页面控件权限是基于菜单ID配置的数据) + String url = request.getRequestURI().substring(request.getContextPath().length() + 1); + functionId = systemService.getFunctionIdByUrl(url,requestPath); + //如果通过请求URL,无法匹配出数据库中菜单ID,则不进行数据权限、页面控件权限的逻辑处理 + if(oConvertUtils.isEmpty(functionId)){ + return true; } } - + //----------------------------------------------------------------------------------------------------------------- - //Set operationCodes = systemService.getOperationCodesByUserIdAndFunctionId(currLoginUser.getId(), functionId); - //request.setAttribute(Globals.OPERATIONCODES, operationCodes); - //} - //if(!oConvertUtils.isEmpty(functionId)){ + //Step.1 【页面控件权限】第一部分处理页面表单和列表的页面控件权限(页面表单字段+页面按钮等控件) + //获取菜单对应的页面控制权限(包括表单字段和操作按钮) + //多个角色权限(并集问题),因为是反的控制,导致有admin的最大权限反而受小权限控制 - -// List allOperation=this.systemService.findByProperty(TSOperation.class, "TSFunction.id", functionId); -// List newall = new ArrayList(); -// if(allOperation.size()>0){ -// for(TSOperation s:allOperation){ -// //s=s.replaceAll(" ", ""); -// newall.add(s); -// } - -// String hasOperSql="SELECT operation FROM t_s_role_function fun, t_s_role_user role WHERE " + -// "fun.functionid='"+functionId+"' AND fun.operation is not null AND fun.roleid=role.roleid AND role.userid='"+currLoginUser.getId()+"' "; -// List hasOperList = this.systemService.findListbySql(hasOperSql); -// for(String operationIds:hasOperList){ -// for(String operationId:operationIds.split(",")){ -// operationId=operationId.replaceAll(" ", ""); -// TSOperation operation = new TSOperation(); -// operation.setId(operationId); -// newall.remove(operation); -// } -// } -// } - /*List newall = new ArrayList(); - String hasOperSql="SELECT operation FROM t_s_role_function fun, t_s_role_user role WHERE " + - "fun.functionid='"+functionId+"' AND fun.operation is not null AND fun.roleid=role.roleid AND role.userid='"+currLoginUser.getId()+"' "; - List hasOperList = this.systemService.findListbySql(hasOperSql); - for(String operationIds:hasOperList){ - for(String operationId:operationIds.split(",")){ - operationId=operationId.replaceAll(" ", ""); - TSOperation operation = systemService.get(TSOperation.class, operationId); - if(operation!=null && operation.getOperationcode()!=null && - (operation.getOperationcode().startsWith("#")|| operation.getOperationcode().startsWith("."))){ - newall.add(operation); - } - } - } - request.setAttribute(Globals.NOAUTO_OPERATIONCODES, newall);*/ + List operations = systemService.getLoginOperationsByUserId(loginUserId, functionId, orgId); + request.setAttribute(Globals.NOAUTO_OPERATIONCODES, operations); + if(operations!=null){ + Set operationCodes = new HashSet(); + for (TSOperation operation : operations) { + operationCodes.add(operation.getId()); + } + request.setAttribute(Globals.OPERATIONCODES, operationCodes); + } - //Step.2 第二部分处理列表数据级权限 (菜单数据规则集合) + //Step.2 【数据权限】第二部分处理列表数据级权限 (菜单数据规则集合) List MENU_DATA_AUTHOR_RULES = new ArrayList(); String MENU_DATA_AUTHOR_RULE_SQL=""; - //数据权限规则的查询 - //查询所有的当前这个用户所对应的角色和菜单的datarule的数据规则id - - if(!currLoginUser.getUserName().equals("admin")){ - //Globals.BUTTON_AUTHORITY_CHECK - Set dataruleCodes = systemService.getOperationCodesByUserIdAndDataId(currLoginUser, functionId); - request.setAttribute("dataRulecodes", dataruleCodes); - for (String dataRuleId : dataruleCodes) { - TSDataRule dataRule = systemService.getEntity(TSDataRule.class, dataRuleId); - MENU_DATA_AUTHOR_RULES.add(dataRule); - MENU_DATA_AUTHOR_RULE_SQL += SysContextSqlConvert.setSqlModel(dataRule); - } - } + //查询当前用户授权的数据规则IDS - JeecgDataAutorUtils.installDataSearchConditon(request, MENU_DATA_AUTHOR_RULES);//菜单数据规则集合 - JeecgDataAutorUtils.installDataSearchConditon(request, MENU_DATA_AUTHOR_RULE_SQL);//菜单数据规则sql + Set dataRuleIds = systemService.getLoginDataRuleIdsByUserId(loginUserId, functionId, orgId); + request.setAttribute("dataRulecodes", dataRuleIds); + for (String dataRuleId : dataRuleIds) { + TSDataRule dataRule = systemService.getEntity(TSDataRule.class, dataRuleId); + MENU_DATA_AUTHOR_RULES.add(dataRule); + MENU_DATA_AUTHOR_RULE_SQL += SysContextSqlConvert.setSqlModel(dataRule); + } + //【加载数据权限】数据权限规则,Hibernate字段方式 + JeecgDataAutorUtils.installDataSearchConditon(request, MENU_DATA_AUTHOR_RULES); + //【加载数据权限】数据权限规则,Sql方式 + JeecgDataAutorUtils.installDataSearchConditon(request, MENU_DATA_AUTHOR_RULE_SQL); } return true; } else { - //forword(request); - forward(request, response); + //登录用户信息为空,跳转到用户登录超时页面 + forwardTimeOut(request, response); return false; } - } } - + /** - * 判断用户是否有菜单访问权限 - * @param requestPath - * @param clickFunctionId - * @param currLoginUser - * @return + * 在controller后拦截 */ - private boolean hasMenuAuth(String requestPath,String clickFunctionId,TSUser currLoginUser){ - String userid = currLoginUser.getId(); + public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object object, Exception exception) throws Exception { + } - //step.1 先判断请求是否配置菜单,没有配置菜单默认不作权限控制[注意:这里不限制权限类型菜单] - String hasMenuSql = "select count(*) from t_s_function where functiontype = 0 and functionurl = '"+requestPath+"'"; - Long hasMenuCount = systemService.getCountForJdbc(hasMenuSql); - if(hasMenuCount<=0){ - return true; - } - - //step.2 判断菜单是否有角色权限 - Long authSize = Long.valueOf(0); - String sql = "SELECT count(*) FROM t_s_function f,t_s_role_function rf,t_s_role_user ru " + - " WHERE f.id=rf.functionid AND rf.roleid=ru.roleid AND " + - "ru.userid='"+userid+"' AND f.functionurl = '"+requestPath+"'"; - authSize = this.systemService.getCountForJdbc(sql); - if(authSize <=0){ - //step.3 判断菜单是否有组织机构角色权限 - String orgId = currLoginUser.getCurrentDepart().getId(); - Long orgAuthSize = Long.valueOf(0); - String functionOfOrgSql = "SELECT count(*) from t_s_function f, t_s_role_function rf, t_s_role_org ro " + - "WHERE f.ID=rf.functionid AND rf.roleid=ro.role_id " + - "AND ro.org_id='" +orgId+ "' AND f.functionurl = '"+requestPath+"'"; - orgAuthSize = this.systemService.getCountForJdbc(functionOfOrgSql); - return orgAuthSize > 0; - }else{ - return true; - } + public void postHandle(HttpServletRequest request, HttpServletResponse response, Object object, ModelAndView modelAndView) throws Exception { } - + /** * 转发 @@ -328,15 +202,15 @@ public class AuthInterceptor implements HandlerInterceptor { return new ModelAndView(new RedirectView("loginController.do?login")); } - private void forward(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { - - //超时,未登陆页面跳转 - //response.sendRedirect(request.getServletContext().getContextPath()+"/loginController.do?login"); - + /** + * 跳转: 登录超时页面 + * @param request + * @param response + * @throws ServletException + * @throws IOException + */ + private void forwardTimeOut(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.sendRedirect(request.getSession().getServletContext().getContextPath()+"/webpage/login/timeout.jsp"); - - //request.getRequestDispatcher("loginController.do?login").forward(request, response); - } /** @@ -357,11 +231,14 @@ public class AuthInterceptor implements HandlerInterceptor { /** * 判断当前请求是否为异步请求. */ - @SuppressWarnings("unused") - private boolean isAjax(HttpServletRequest request, HttpServletResponse response){ + private boolean isAjax(HttpServletRequest request){ return oConvertUtils.isNotEmpty(request.getHeader("X-Requested-With")); } - + + /** + * 返回Ajax格式的权限提醒消息 + * @param response + */ private void processAjax(HttpServletResponse response){ AjaxJson json = new AjaxJson(); json.setSuccess(false); @@ -377,5 +254,21 @@ public class AuthInterceptor implements HandlerInterceptor { pw.close(); } } + + + public List getExcludeUrls() { + return excludeUrls; + } + + public void setExcludeUrls(List excludeUrls) { + this.excludeUrls = excludeUrls; + } + public List getExcludeContainUrls() { + return excludeContainUrls; + } + + public void setExcludeContainUrls(List excludeContainUrls) { + this.excludeContainUrls = excludeContainUrls; + } } diff --git a/jeecg-framework/src/main/java/org/jeecgframework/core/interceptors/SignInterceptor.java b/jeecg-framework/src/main/java/org/jeecgframework/core/interceptors/SignInterceptor.java index cac44a4f..50297bf7 100644 --- a/jeecg-framework/src/main/java/org/jeecgframework/core/interceptors/SignInterceptor.java +++ b/jeecg-framework/src/main/java/org/jeecgframework/core/interceptors/SignInterceptor.java @@ -13,7 +13,11 @@ import java.util.HashMap; import java.util.Map; /** - * Created by dangzhenghui on 2017-4-1. + * API接口签名校验机制
+ * 描述:{ 拦截 /api/**的请求,匹配请求header中的参数X-JEECG-SIGN,是否与服务器签名一致 } + * date: 2017-4-1
+ * @author dangzhenghui + * */ public class SignInterceptor implements HandlerInterceptor { private static final String SIGN_KEY = "26F72780372E84B6CFAED6F7B19139CC47B1912B6CAED753"; diff --git a/jeecg-framework/src/main/java/org/jeecgframework/core/interceptors/SqlInjectInterceptor.java b/jeecg-framework/src/main/java/org/jeecgframework/core/interceptors/SqlInjectInterceptor.java new file mode 100644 index 00000000..7abd25e6 --- /dev/null +++ b/jeecg-framework/src/main/java/org/jeecgframework/core/interceptors/SqlInjectInterceptor.java @@ -0,0 +1,138 @@ +package org.jeecgframework.core.interceptors; + + +import java.util.Enumeration; +import java.util.List; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import org.apache.log4j.Logger; +import org.jeecgframework.core.common.model.json.AjaxJson; +import org.jeecgframework.core.util.IpUtil; +import org.jeecgframework.core.util.JSONHelper; +import org.jeecgframework.core.util.ResourceUtil; +import org.jeecgframework.web.cgform.common.CgAutoListConstant; +import org.jeecgframework.web.system.pojo.base.TSUser; +import org.springframework.web.servlet.HandlerInterceptor; +import org.springframework.web.servlet.ModelAndView; + +/** + * 防止SQL注入的拦截器 + * + * @author scott + * @time 2018-05-21 + */ +public class SqlInjectInterceptor implements HandlerInterceptor { + private static final Logger logger = Logger.getLogger(SqlInjectInterceptor.class); + + /** + * 在线开发特殊URL(需要录入SQL片段),进行特殊处理 + */ + private List onlineOptUrls; + + @Override + public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object arg2, Exception arg3) + throws Exception { + // TODO Auto-generated method stub + + } + + @Override + public void postHandle(HttpServletRequest request, HttpServletResponse response, Object arg2, ModelAndView arg3) + throws Exception { + // TODO Auto-generated method stub + + } + + @Override + public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object arg2) throws Exception { + + //1.在线开发功能(有SQL值情况),针对数据库SQL操作,进行开发者权限控制,防止SQL注入 + String requestPath = ResourceUtil.getJgAuthRequsetPath(request); + if (onlineOptUrls.contains(requestPath)) { + TSUser currentUser = ResourceUtil.getSessionUser(); + if(CgAutoListConstant.SYS_DEV_FLAG_0.equals(currentUser.getDevFlag())){ + logger.info(" ---操作失败,当前用户未授权开发权限-------- 请求IP ---------+"+IpUtil.getIpAddr(request)); + + AjaxJson json = new AjaxJson(); + json.setSuccess(false); + json.setMsg("操作失败,当前用户未授权开发权限!!"); + response.setHeader("Cache-Control", "no-store"); + response.getWriter().print(JSONHelper.bean2json(json)); + return false; + } + return true; + } + + //2,常规业务操作(无SQL值情况), 针对数据库SQL操作,进行开发者权限控制,防止SQL注入 + Enumeration names = request.getParameterNames(); + while(names.hasMoreElements()){ + String name = names.nextElement(); + String[] values = request.getParameterValues(name); + for(String value: values){ + //sql注入直接拦截 + if(judgeSQLInject(value.toLowerCase())){ + logger.info("-----------Sql注入拦截-----------name: "+name+" -------------value:"+ value); + response.setContentType("text/html;charset=UTF-8"); + response.getWriter().print("参数含有非法攻击字符,已禁止继续访问!"); + return false; + } + //跨站xss清理 + clearXss(value); + } + } + return true; + } + + /** + * 判断参数是否含有攻击串 + * @param value + * @return + */ + public boolean judgeSQLInject(String value){ + if(value == null || "".equals(value)){ + return false; + } + String xssStr = "and |or |select |update |delete |drop |truncate |%20|=|--|!="; + String[] xssArr = xssStr.split("\\|"); + for(int i=0;i-1){ + return true; + } + } + return false; + } + + /** + * 处理跨站xss字符转义 + * + * @param value + * @return + */ + private String clearXss(String value) { + logger.debug("----before--------处理跨站xss字符转义----------"+ value); + if (value == null || "".equals(value)) { + return value; + } + value = value.replaceAll("<", "<").replaceAll(">", ">"); + value = value.replaceAll("\\(", "(").replace("\\)", ")"); + value = value.replaceAll("'", "'"); + value = value.replaceAll("eval\\((.*)\\)", ""); + value = value.replaceAll("[\\\"\\\'][\\s]*javascript:(.*)[\\\"\\\']", + "\"\""); + value = value.replace("script", ""); + + //为了用户密码安全,禁止列表查询展示用户密码---------- + value = value.replace(",password","").replace("password",""); + logger.debug("----end--------处理跨站xss字符转义----------"+ value); + return value; + } + + public List getOnlineOptUrls() { + return onlineOptUrls; + } + + public void setOnlineOptUrls(List onlineOptUrls) { + this.onlineOptUrls = onlineOptUrls; + } + +} \ No newline at end of file diff --git a/jeecg-framework/src/main/java/org/jeecgframework/core/online/util/CgReportQueryParamUtil.java b/jeecg-framework/src/main/java/org/jeecgframework/core/online/util/CgReportQueryParamUtil.java index 53c823fd..735020db 100644 --- a/jeecg-framework/src/main/java/org/jeecgframework/core/online/util/CgReportQueryParamUtil.java +++ b/jeecg-framework/src/main/java/org/jeecgframework/core/online/util/CgReportQueryParamUtil.java @@ -12,6 +12,7 @@ import net.sf.json.JSONObject; import org.jeecgframework.core.online.def.CgReportConstant; import org.jeecgframework.core.util.DBTypeUtil; +import org.jeecgframework.core.util.SqlInjectionUtil; import org.jeecgframework.core.util.StringUtil; /** @@ -54,7 +55,10 @@ public class CgReportQueryParamUtil e.printStackTrace(); return; } - sql_inj_throw(value); + +// sql_inj_throw(value); + SqlInjectionUtil.filterContent(value); + value = applyType(filedType,value); if(!StringUtil.isEmpty(value)){ if(value.contains("*")){ @@ -68,10 +72,16 @@ public class CgReportQueryParamUtil }else if("group".equals(queryMode)){ //范围查询组装 String begin = request.getParameter(filedName+"_begin"); - sql_inj_throw(begin); + +// sql_inj_throw(begin); + SqlInjectionUtil.filterContent(begin); + begin= applyType(filedType,begin); String end = request.getParameter(filedName+"_end"); - sql_inj_throw(end); + +// sql_inj_throw(end); + SqlInjectionUtil.filterContent(end); + end= applyType(filedType,end); if(!StringUtil.isEmpty(begin)){ String re = CgReportConstant.OP_RQ+begin; @@ -155,35 +165,36 @@ public class CgReportQueryParamUtil return datetime; } } - - /** - * 防止sql注入 - * @param str 输入sql - * @return 是否存在注入关键字 - */ - public static boolean sql_inj(String str) { - if(StringUtil.isEmpty(str)){ - return false; - } - String inj_str = "'|and|exec|insert|select|delete|update|count|chr|mid|master|truncate|char|declare|;|or|+|,"; -// String inj_str = "'|and|exec|insert|select|delete|update|count|chr|mid|master|truncate|char|declare|;|or|-|+|,"; - String inj_stra[] = inj_str.split("\\|"); - for (int i = 0; i < inj_stra.length; i++) { - if (str.indexOf(" "+inj_stra[i]+" ") >= 0) { - return true; - } - } - return false; - } - /** - * 当存在sql注入时抛异常 - * @param str 输入sql - */ - public static void sql_inj_throw(String str){ - if(sql_inj(str)){ - throw new RuntimeException("请注意,填入的参数可能存在SQL注入!"); - } - } + +// /** +// * 防止sql注入 +// * @param str 输入sql +// * @return 是否存在注入关键字 +// */ +// public static boolean sql_inj(String str) { +// if(StringUtil.isEmpty(str)){ +// return false; +// } +// String inj_str = "'|and|exec|insert|select|delete|update|count|chr|mid|master|truncate|char|declare|;|or|+|,"; +//// String inj_str = "'|and|exec|insert|select|delete|update|count|chr|mid|master|truncate|char|declare|;|or|-|+|,"; +// String inj_stra[] = inj_str.split("\\|"); +// for (int i = 0; i < inj_stra.length; i++) { +// if (str.indexOf(" "+inj_stra[i]+" ") >= 0) { +// return true; +// } +// } +// return false; +// } +// /** +// * 当存在sql注入时抛异常 +// * @param str 输入sql +// */ +// public static void sql_inj_throw(String str){ +// if(sql_inj(str)){ +// throw new RuntimeException("请注意,填入的参数可能存在SQL注入!"); +// } +// } + /** * 根据字段类型 进行处理 diff --git a/jeecg-framework/src/main/java/org/jeecgframework/core/online/util/FreemarkerHelper.java b/jeecg-framework/src/main/java/org/jeecgframework/core/online/util/FreemarkerHelper.java index 55ef3d42..c719210d 100644 --- a/jeecg-framework/src/main/java/org/jeecgframework/core/online/util/FreemarkerHelper.java +++ b/jeecg-framework/src/main/java/org/jeecgframework/core/online/util/FreemarkerHelper.java @@ -21,10 +21,15 @@ public class FreemarkerHelper { static{ _tplConfig.setSharedVariable("DictData", (TemplateDirectiveModel)ApplicationContextUtil.getContext().getBean("dictDataTag")); _tplConfig.setSharedVariable("mutiLang", (TemplateDirectiveModel)ApplicationContextUtil.getContext().getBean("mutiLangTag")); + + _tplConfig.setSharedVariable("exp", (TemplateDirectiveModel)ApplicationContextUtil.getContext().getBean("expTag")); + _tplConfig.setClassForTemplateLoading(FreemarkerHelper.class, "/"); _tplConfig.setDateTimeFormat("yyyy-MM-dd HH:mm:ss"); _tplConfig.setDateFormat("yyyy-MM-dd"); _tplConfig.setTimeFormat("HH:mm:ss"); + //classic_compatible设置,解决报空指针错误 + _tplConfig.setClassicCompatible(true); } /** diff --git a/jeecg-framework/src/main/java/org/jeecgframework/core/timer/DataBaseCronTriggerBean.java b/jeecg-framework/src/main/java/org/jeecgframework/core/timer/DataBaseCronTriggerBean.java deleted file mode 100644 index fd507afd..00000000 --- a/jeecg-framework/src/main/java/org/jeecgframework/core/timer/DataBaseCronTriggerBean.java +++ /dev/null @@ -1,43 +0,0 @@ -package org.jeecgframework.core.timer; - -import java.text.ParseException; - -import org.jeecgframework.web.system.pojo.base.TSTimeTaskEntity; -import org.jeecgframework.web.system.service.TimeTaskServiceI; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.scheduling.quartz.CronTriggerBean; -/** - * 在原有功能的基础上面增加数据库的读取 - * @author JueYue - * @date 2013-9-22 - * @version 1.0 - */ -public class DataBaseCronTriggerBean extends CronTriggerBean{ - - private static final long serialVersionUID = 1L; - - @Autowired - private TimeTaskServiceI timeTaskService; - /** - * 读取数据库更新文件 - */ - public void afterPropertiesSet() { - super.afterPropertiesSet(); - TSTimeTaskEntity task = timeTaskService.findUniqueByProperty - (TSTimeTaskEntity.class,"taskId",this.getName()); - if(task!=null&&task.getIsEffect().equals("1") - &&!task.getCronExpression().equals(this.getCronExpression())){ - - try { - this.setCronExpression(task.getCronExpression()); - } catch (ParseException e) { - // TODO 异常必须被处理 - e.printStackTrace(); - } - - //DynamicTask.updateSpringMvcTaskXML(this,task.getCronExpression()); - - } - } - -} diff --git a/jeecg-framework/src/main/java/org/jeecgframework/core/timer/DataBaseSchedulerFactoryBean.java b/jeecg-framework/src/main/java/org/jeecgframework/core/timer/DataBaseSchedulerFactoryBean.java index 4b0b1c68..541be3dc 100644 --- a/jeecg-framework/src/main/java/org/jeecgframework/core/timer/DataBaseSchedulerFactoryBean.java +++ b/jeecg-framework/src/main/java/org/jeecgframework/core/timer/DataBaseSchedulerFactoryBean.java @@ -1,9 +1,12 @@ package org.jeecgframework.core.timer; +import java.util.List; + import org.jeecgframework.web.system.pojo.base.TSTimeTaskEntity; import org.jeecgframework.web.system.service.TimeTaskServiceI; import org.quartz.Scheduler; +import org.quartz.TriggerKey; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.scheduling.quartz.SchedulerFactoryBean; /** @@ -21,7 +24,10 @@ public class DataBaseSchedulerFactoryBean extends SchedulerFactoryBean { */ public void afterPropertiesSet() throws Exception { super.afterPropertiesSet(); - String[] trigerrNames = this.getScheduler().getTriggerNames(Scheduler.DEFAULT_GROUP); + +// String[] trigerrNames = this.getScheduler().getTriggerNames(Scheduler.DEFAULT_GROUP); + Scheduler scheduler = this.getScheduler(); + List trigerrNames = scheduler.getTriggerGroupNames(); TSTimeTaskEntity task; for (String trigerrName : trigerrNames) { @@ -29,8 +35,10 @@ public class DataBaseSchedulerFactoryBean extends SchedulerFactoryBean { //数据库查询不到的定时任务或者定时任务的运行状态不为1时,都停止 //TASK #327 定时器任务默认未启动 if(task==null || !"1".equals(task.getIsStart())){ - this.getScheduler().pauseTrigger(trigerrName,Scheduler.DEFAULT_GROUP); +// this.getScheduler().pauseTrigger(trigerrName,Scheduler.DEFAULT_GROUP); + scheduler.pauseTrigger(new TriggerKey(trigerrName)); } + } } diff --git a/jeecg-framework/src/main/java/org/jeecgframework/core/timer/DynamicTask.java b/jeecg-framework/src/main/java/org/jeecgframework/core/timer/DynamicTask.java index a382eaf4..1a336118 100644 --- a/jeecg-framework/src/main/java/org/jeecgframework/core/timer/DynamicTask.java +++ b/jeecg-framework/src/main/java/org/jeecgframework/core/timer/DynamicTask.java @@ -2,7 +2,6 @@ package org.jeecgframework.core.timer; import java.io.IOException; import java.net.UnknownHostException; -import java.text.ParseException; import java.util.List; import javax.annotation.Resource; @@ -17,18 +16,21 @@ import org.jeecgframework.core.util.StringUtil; import org.jeecgframework.web.system.pojo.base.TSTimeTaskEntity; import org.jeecgframework.web.system.service.SystemService; import org.jeecgframework.web.system.service.TimeTaskServiceI; +import org.quartz.CronScheduleBuilder; import org.quartz.CronTrigger; +import org.quartz.JobBuilder; import org.quartz.JobDetail; +import org.quartz.JobKey; import org.quartz.Scheduler; import org.quartz.SchedulerException; +import org.quartz.Trigger; +import org.quartz.TriggerBuilder; +import org.quartz.TriggerKey; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.scheduling.quartz.CronTriggerBean; import org.springframework.stereotype.Service; import com.alibaba.fastjson.JSONObject; - - /** * 动态任务,用以动态调整Spring的任务 * @author JueYue @@ -40,13 +42,13 @@ public class DynamicTask { private static Logger logger = Logger.getLogger(DynamicTask.class); - @Resource + @Autowired(required=false) private Scheduler schedulerFactory; - @Autowired + @Autowired(required=false) private TimeTaskServiceI timeTaskService; - @Autowired + @Autowired(required=false) private SystemService systemService; @@ -56,26 +58,19 @@ public class DynamicTask { */ private boolean startTask(TSTimeTaskEntity task){ try { - /* - //quartz 2.2 - JobDetailImpl jobDetail = new JobDetailImpl(); - jobDetail.setName(taskCode); - jobDetail.setGroup(Scheduler.DEFAULT_GROUP); - jobDetail.setJobClass(getClassByTask(task.getJob_class())); - CronTriggerImpl cronTrigger = new CronTriggerImpl("cron_" + taskCode,Scheduler.DEFAULT_GROUP, jobDetail.getName(),Scheduler.DEFAULT_GROUP); - cronTrigger.setCronExpression(cronExpress); - */ + //quartz 1.6 - JobDetail jobDetail = new JobDetail(); - jobDetail.setName(task.getId()); - jobDetail.setGroup(Scheduler.DEFAULT_GROUP); - jobDetail.setJobClass(MyClassLoader.getClassByScn(task.getClassName())); - CronTrigger cronTrigger = new CronTrigger("cron_" + task.getId(),Scheduler.DEFAULT_GROUP, jobDetail.getName(),Scheduler.DEFAULT_GROUP); - cronTrigger.setCronExpression(task.getCronExpression()); - schedulerFactory.scheduleJob(jobDetail, cronTrigger); +// JobDetail jobDetail = new JobDetail(); +// jobDetail.setName(task.getId()); +// jobDetail.setGroup(Scheduler.DEFAULT_GROUP); +// jobDetail.setJobClass(MyClassLoader.getClassByScn(task.getClassName())); +// CronTrigger cronTrigger = new CronTrigger("cron_" + task.getId(),Scheduler.DEFAULT_GROUP, jobDetail.getName(),Scheduler.DEFAULT_GROUP); +// cronTrigger.setCronExpression(task.getCronExpression()); + //quartz 2.3.0 + //向调度器中添加任务 + scheduleJob(task); + return true; - } catch (ParseException e) { - logger.error("startTask ParseException"+ e.getMessage()); } catch (SchedulerException e) { logger.error("startTask SchedulerException"+" cron_" + task.getId()+ e.getMessage()); } @@ -90,13 +85,19 @@ public class DynamicTask { private boolean endTask(TSTimeTaskEntity task){ try{ - /* + //quartz 2.2 - JobKey jobKey = new JobKey(taskName, Scheduler.DEFAULT_GROUP); + TriggerKey triggerKey = new TriggerKey("cron_" + task.getId()); + //停止触发器 + schedulerFactory.pauseTrigger(triggerKey); + //移除触发器 + schedulerFactory.unscheduleJob(triggerKey); + JobKey jobKey = new JobKey(task.getId()); + //删除任务 schedulerFactory.deleteJob(jobKey); - */ + //quartz 1.6 - schedulerFactory.unscheduleJob("cron_" + task.getId(), Scheduler.DEFAULT_GROUP); +// schedulerFactory.unscheduleJob("cron_" + task.getId()); return true; }catch (SchedulerException e) { logger.error("endTask SchedulerException" + " cron_" + task.getId() + e.getMessage()); @@ -138,13 +139,24 @@ public class DynamicTask { //任务运行中 if("1".equals(task.getIsStart())){ - CronTriggerBean trigger = (CronTriggerBean)schedulerFactory.getTrigger("cron_" + task.getId(), Scheduler.DEFAULT_GROUP); - String originExpression = trigger.getCronExpression(); + +// CronTriggerBean trigger = (CronTriggerBean)schedulerFactory.getTrigger("cron_" + task.getId(), Scheduler.DEFAULT_GROUP); +// String originExpression = trigger.getCronExpression(); //检查运行中的任务触发规则是否与新规则一致 - if (!originExpression.equalsIgnoreCase(newExpression)) { - trigger.setCronExpression(newExpression); - schedulerFactory.rescheduleJob("cron_" + task.getId(), Scheduler.DEFAULT_GROUP, trigger); - } +// if (!originExpression.equalsIgnoreCase(newExpression)) { +// trigger.setCronExpression(newExpression); +// schedulerFactory.rescheduleJob("cron_" + task.getId(), Scheduler.DEFAULT_GROUP, trigger); +// } + //通过触发器key 向调度器 获取触发器实例 + Trigger oldTrigger = schedulerFactory.getTrigger(new TriggerKey("cron_" + task.getId())); + //获取bulid对象 + TriggerBuilder tb = oldTrigger.getTriggerBuilder(); + //创建触发器 + CronScheduleBuilder cronScheduleBuilder = CronScheduleBuilder.cronSchedule(newExpression); + Trigger newTrigger = tb.withSchedule(cronScheduleBuilder).build(); + //更新触发器 + schedulerFactory.rescheduleJob(oldTrigger.getKey(), newTrigger); + }else{ //立即生效 List ipList = IpUtil.getLocalIPList(); @@ -185,8 +197,6 @@ public class DynamicTask { } } catch (SchedulerException e) { logger.error("updateCronExpression SchedulerException" + " cron_" + task.getId() + e.getMessage()); - } catch (ParseException e) { - logger.error("updateCronExpression ParseException" + " cron_" + task.getId() + e.getMessage()); } return false; @@ -256,17 +266,18 @@ public class DynamicTask { if(ipList.contains(runServerIp) || StringUtil.isEmpty(runServerIp) || "本地".equals(runServerIp)){//当前服务器IP匹配成功 //quartz 1.6 - JobDetail jobDetail = new JobDetail(); - jobDetail.setName(task.getId()); - jobDetail.setGroup(Scheduler.DEFAULT_GROUP); - jobDetail.setJobClass(MyClassLoader.getClassByScn(task.getClassName())); - CronTrigger cronTrigger = new CronTrigger("cron_" + task.getId(),Scheduler.DEFAULT_GROUP, jobDetail.getName(),Scheduler.DEFAULT_GROUP); - cronTrigger.setCronExpression(task.getCronExpression()); - schedulerFactory.scheduleJob(jobDetail, cronTrigger); + +// JobDetail jobDetail = new JobDetail(); +// jobDetail.setName(task.getId()); +// jobDetail.setGroup(Scheduler.DEFAULT_GROUP); +// jobDetail.setJobClass(MyClassLoader.getClassByScn(task.getClassName())); +// CronTrigger cronTrigger = new CronTrigger("cron_" + task.getId(),Scheduler.DEFAULT_GROUP, jobDetail.getName(),Scheduler.DEFAULT_GROUP); +// cronTrigger.setCronExpression(task.getCronExpression()); + //向调度器中添加任务 + scheduleJob(task); + logger.info(" register time task class is { "+task.getClassName()+" } "); } - } catch (ParseException e) { - logger.error("startTask ParseException"+ e.getMessage()); } catch (SchedulerException e) { logger.error("startTask SchedulerException"+" cron_" + task.getId()+ e.getMessage()); } @@ -274,5 +285,27 @@ public class DynamicTask { } } + /** + * 注册 定时任务 + * @param task 定时任务对象 + * @throws SchedulerException + */ + private void scheduleJob(TSTimeTaskEntity task) throws SchedulerException { + //build 要执行的任务 + JobDetail jobDetail = JobBuilder.newJob(MyClassLoader.getClassByScn(task.getClassName())) + .withIdentity(task.getId()) + .storeDurably() + .requestRecovery() + .build(); + //根据Cron表达式 build 触发时间对象 + CronScheduleBuilder cronScheduleBuilder = CronScheduleBuilder.cronSchedule(task.getCronExpression()); + //build 任务触发器 + CronTrigger cronTrigger = TriggerBuilder.newTrigger() + .withIdentity("cron_" + task.getId()) + .withSchedule(cronScheduleBuilder)//标明触发时间 + .build(); + //向调度器注册 定时任务 + schedulerFactory.scheduleJob(jobDetail, cronTrigger); + } } diff --git a/jeecg-framework/src/main/java/org/jeecgframework/core/util/DynamicDBUtil.java b/jeecg-framework/src/main/java/org/jeecgframework/core/util/DynamicDBUtil.java index 6b3e8b94..5f09736a 100644 --- a/jeecg-framework/src/main/java/org/jeecgframework/core/util/DynamicDBUtil.java +++ b/jeecg-framework/src/main/java/org/jeecgframework/core/util/DynamicDBUtil.java @@ -39,11 +39,12 @@ public class DynamicDBUtil { String driverClassName = dynamicSourceEntity.getDriverClass(); String url = dynamicSourceEntity.getUrl(); String dbUser = dynamicSourceEntity.getDbUser(); - +// update-start--Author:chenjin Date:20160712 for:多数据源目前数据库密码是明文,采用加密方式存储 //设置数据源的时候,要重新解密 //String dbPassword = dynamicSourceEntity.getDbPassword(); String dbPassword = PasswordUtil.decrypt(dynamicSourceEntity.getDbPassword(), dynamicSourceEntity.getDbUser(), PasswordUtil.getStaticSalt());//解密字符串; - + +// update-end--Author:chenjin Date:20160712 for:多数据源目前数据库密码是明文,采用加密方式存储 dataSource.setDriverClassName(driverClassName); dataSource.setUrl(url); @@ -115,7 +116,8 @@ public class DynamicDBUtil { } return effectCount; } - + + //add-begin--Author:yugwu Date:20170808 for:TASK #1827 【改造】多数据源,支持minidao语法sql---- /** * 支持miniDao语法操作的Update * @param dbKey 数据源标识 @@ -132,13 +134,13 @@ public class DynamicDBUtil { effectCount = namedParameterJdbcTemplate.update(sql, data); return effectCount; } - + //add-end--Author:yugwu Date:20170808 for:TASK #1827 【改造】多数据源,支持minidao语法sql---- public static Object findOne(final String dbKey, String sql, Object... param) { List> list; - + //update-begin--Author:yugwu Date:20170808 for:TASK #1827 【改造】多数据源,支持minidao语法sql---- list = findList(dbKey, sql, param); - + //update-end--Author:yugwu Date:20170808 for:TASK #1827 【改造】多数据源,支持minidao语法sql---- if(ListUtils.isNullOrEmpty(list)) { @@ -152,7 +154,7 @@ public class DynamicDBUtil { return list.get(0); } - + //add-begin--Author:yugwu Date:20170808 for:TASK #1827 【改造】多数据源,支持minidao语法sql---- /** * 支持miniDao语法操作的查询 返回HashMap * @param dbKey 数据源标识 @@ -171,7 +173,8 @@ public class DynamicDBUtil { } return list.get(0); } - + //add-end--Author:yugwu Date:20170808 for:TASK #1827 【改造】多数据源,支持minidao语法sql---- + //add-begin--Author:yugwu Date:20170810 for:返回单个实例而非hashMap---- /** * 直接sql查询 根据clazz返回单个实例 * @param dbKey 数据源标识 @@ -198,7 +201,7 @@ public class DynamicDBUtil { Map map = (Map) findOneByHash(dbKey, sql, data); return ReflectHelper.setAll(clazz, map); } - + //add-begin--Author:yugwu Date:20170810 for:返回单个实例而非hashMap---- public static List> findList(final String dbKey, String sql, Object... param) { List> list; JdbcTemplate jdbcTemplate = getJdbcTemplate(dbKey); @@ -210,7 +213,7 @@ public class DynamicDBUtil { } return list; } - + //add-begin--Author:yugwu Date:20170808 for:TASK #1827 【改造】多数据源,支持minidao语法sql---- /** * 支持miniDao语法操作的查询 * @param dbKey 数据源标识 @@ -227,7 +230,8 @@ public class DynamicDBUtil { list = namedParameterJdbcTemplate.queryForList(sql, data); return list; } - + //add-end--Author:yugwu Date:20170808 for:TASK #1827 【改造】多数据源,支持minidao语法sql---- + //add-begin--Author:luobaoli Date:20150620 for:增加返回值为List的方法 //此方法只能返回单列,不能返回实体类 public static List findList(final String dbKey, String sql, Class clazz,Object... param) { List list; @@ -240,7 +244,8 @@ public class DynamicDBUtil { } return list; } - + //add-end--Author:luobaoli Date:20150620 for:增加返回值为List的方法 + //add-begin--Author:yugwu Date:20170808 for:TASK #1827 【改造】多数据源,支持minidao语法sql---- /** * 支持miniDao语法操作的查询 返回单列数据list * @param dbKey 数据源标识 @@ -282,7 +287,7 @@ public class DynamicDBUtil { List> queryList = findListByHash(dbKey, sql, data); return ReflectHelper.transList2Entrys(queryList, clazz); } - + //add-end--Author:yugwu Date:20170808 for:TASK #1827 【改造】多数据源,支持minidao语法sql---- @SuppressWarnings("unchecked") public static void main(String[] args) { diff --git a/jeecg-framework/src/main/java/org/jeecgframework/core/util/EhcacheUtil.java b/jeecg-framework/src/main/java/org/jeecgframework/core/util/EhcacheUtil.java index 2add999c..4e70c043 100644 --- a/jeecg-framework/src/main/java/org/jeecgframework/core/util/EhcacheUtil.java +++ b/jeecg-framework/src/main/java/org/jeecgframework/core/util/EhcacheUtil.java @@ -62,6 +62,16 @@ public class EhcacheUtil { tagCache.removeAll(); } } + + /** + * 清空系统Ehcache缓存 + */ + public static void clean(String cacheName) { + Cache eCache = manager.getCache(cacheName); + if (eCache != null) { + eCache.removeAll(); + } + } public static void main(String[] args) { String key = "key"; diff --git a/jeecg-framework/src/main/java/org/jeecgframework/core/util/JSONHelper.java b/jeecg-framework/src/main/java/org/jeecgframework/core/util/JSONHelper.java index e99a1040..12bcf441 100644 --- a/jeecg-framework/src/main/java/org/jeecgframework/core/util/JSONHelper.java +++ b/jeecg-framework/src/main/java/org/jeecgframework/core/util/JSONHelper.java @@ -17,9 +17,6 @@ import org.codehaus.jackson.map.ObjectMapper; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - /** * JSON和JAVA的POJO的相互转换 * @author 张代浩 diff --git a/jeecg-framework/src/main/java/org/jeecgframework/core/util/PinyinUtil.java b/jeecg-framework/src/main/java/org/jeecgframework/core/util/PinyinUtil.java index 4168d12f..f8446bae 100644 --- a/jeecg-framework/src/main/java/org/jeecgframework/core/util/PinyinUtil.java +++ b/jeecg-framework/src/main/java/org/jeecgframework/core/util/PinyinUtil.java @@ -211,8 +211,9 @@ public class PinyinUtil { try { - pinyingStr = PinyinHelper.toHanyuPinyinString(hanzi, defaultFormat, - separator); + pinyingStr = PinyinHelper.toHanYuPinyinString(hanzi, defaultFormat, + separator,false); + } catch (BadHanyuPinyinOutputFormatCombination e) { diff --git a/jeecg-framework/src/main/java/org/jeecgframework/core/util/RedisCacheUtil.java b/jeecg-framework/src/main/java/org/jeecgframework/core/util/RedisCacheUtil.java index 8f27c01b..db9bb6ab 100644 --- a/jeecg-framework/src/main/java/org/jeecgframework/core/util/RedisCacheUtil.java +++ b/jeecg-framework/src/main/java/org/jeecgframework/core/util/RedisCacheUtil.java @@ -3,7 +3,6 @@ package org.jeecgframework.core.util; import java.util.Set; import org.springframework.data.redis.core.RedisTemplate; -import org.springframework.data.redis.serializer.JdkSerializationRedisSerializer; /** * radis 缓存工具类 @@ -17,7 +16,6 @@ public class RedisCacheUtil { static{ redisTemplate=(RedisTemplate) ApplicationContextUtil.getContext().getBean("redisTemplate"); - redisTemplate.setValueSerializer(new JdkSerializationRedisSerializer()); } public static Object get(String cacheName, Object key) { diff --git a/jeecg-framework/src/main/java/org/jeecgframework/core/util/RedisUtil.java b/jeecg-framework/src/main/java/org/jeecgframework/core/util/RedisUtil.java deleted file mode 100644 index 6bd4c79e..00000000 --- a/jeecg-framework/src/main/java/org/jeecgframework/core/util/RedisUtil.java +++ /dev/null @@ -1,317 +0,0 @@ -package org.jeecgframework.core.util; - -import java.util.ArrayList; -import java.util.List; -import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.TimeUnit; -import org.springframework.context.support.AbstractApplicationContext; -import org.springframework.context.support.ClassPathXmlApplicationContext; -import org.springframework.data.redis.core.BoundKeyOperations; -import org.springframework.data.redis.core.BoundListOperations; -import org.springframework.data.redis.core.BoundValueOperations; -import org.springframework.data.redis.core.RedisTemplate; - -/** - * redis 缓存工具类 - * yugw 20170929 v2.0 - * redis数据库信息在redis.properties - */ -@SuppressWarnings({ "rawtypes", "unchecked" }) -public class RedisUtil { - - private static RedisTemplate redisTemplate; - private static ConcurrentHashMap boundKeyOperations = new ConcurrentHashMap(); - - /** - * 各个工具类的缓存区域,防止多区域之间因重名而报错 - */ - private static String StringRKey = "StringR."; - private static String ObjectRKey = "ObjectR."; - private static String ListRKey = "ListR."; - - static { - if (redisTemplate == null) { - AbstractApplicationContext ac = new ClassPathXmlApplicationContext( - "classpath:/redis.xml"); - redisTemplate = (RedisTemplate) ac.getBean("redisTemplate"); - ac.close(); - } - } - - /** - * 专用于String的Redis处理工具类 - * 所有工具类都包含getBound、setIfAbsent、set、delete、hasKey、get、getAndRemove等通用方法 - * getBound用来缓存处理类,防止多次处理生成多个处理类; - * setIfAbsent 如果不存在就添加缓存 - * set 添加或更改缓存内容 - * delete 删除缓存 - * hasKey 是否存在缓存 - * get 获取缓存内容 - * getAndRemove 获取缓存内容并删除缓存 - */ - public static class StringR { - /**getBound用来缓存处理类,防止多次处理生成多个处理类*/ - public static BoundValueOperations getBound(String oldkey){ - cleanOperas(); - String key = StringRKey + oldkey; - BoundKeyOperations boundKeyOperation = boundKeyOperations.get(key); - if(boundKeyOperation == null){ - boundKeyOperation = redisTemplate.boundValueOps(key); - boundKeyOperations.put(key, boundKeyOperation); - } - return (BoundValueOperations)boundKeyOperation; - } - /**setIfAbsent 如果不存在就添加缓存*/ - public static Boolean setIfAbsent(String key, String value) { - return setIfAbsent(key, value, 30L, TimeUnit.MINUTES); - } - /**setIfAbsent 如果不存在就添加缓存,并设置缓存超时时间*/ - public static Boolean setIfAbsent(String key, String value, long expire, - TimeUnit timeUnit) { - if(hasKey(key)){ - return false; - }else{ - return set(key, value, expire, timeUnit); - } - } - /**set 添加或更改缓存内容*/ - public static Boolean set(String key, String value) { - return set(key, value, 30L, TimeUnit.MINUTES); - } - /**set 添加或更改缓存内容,并设置过期时间*/ - public static Boolean set(String key, String value, long expire, - TimeUnit timeUnit) { - Boolean rt = Boolean.FALSE; - getBound(key).set(value); - if (rt) { - redisTemplate.expire(StringRKey + key, expire, timeUnit); - } - return rt; - } - /**get 获取缓存内容*/ - public static String get(String key) { - return getBound(key).get(); - } - /**getAndRemove 获取缓存内容并删除缓存*/ - public static String getAndRemove(String key) { - String rt = get(key); - delete(key); - return rt; - } - /**delete 删除缓存*/ - public static void delete(String key) { - RedisUtil.delete(StringRKey, key); - } - /**hasKey 是否存在缓存*/ - public static Boolean hasKey(String key) { - return RedisUtil.hasKey(StringRKey, key); - } - } - /** - * 专用于Object的Redis处理工具类 - */ - public static class ObjectR { - /**getBound用来缓存处理类,防止多次处理生成多个处理类*/ - public static BoundValueOperations getBound(String oldkey){ - cleanOperas(); - String key = ObjectRKey + oldkey; - BoundKeyOperations boundKeyOperation = boundKeyOperations.get(key); - if(boundKeyOperation == null){ - boundKeyOperation = redisTemplate.boundValueOps(key); - boundKeyOperations.put(key, boundKeyOperation); - } - return (BoundValueOperations)boundKeyOperation; - } - /**setIfAbsent 如果不存在就添加缓存*/ - public static Boolean setIfAbsent(String key, Object value) { - return setIfAbsent(key, value, 30L, TimeUnit.MINUTES); - } - /**setIfAbsent 如果不存在就添加缓存,并设置缓存超时时间*/ - public static Boolean setIfAbsent(String key, Object value, long expire, - TimeUnit timeUnit) { - if(hasKey(key)){ - return false; - }else{ - return set(key, value, expire, timeUnit); - } - } - /**set 添加或更改缓存内容*/ - public static Boolean set(String key, Object value) { - return set(key, value, 30L, TimeUnit.MINUTES); - } - /**set 添加或更改缓存内容,并设置过期时间*/ - public static Boolean set(String key, Object value, long expire, - TimeUnit timeUnit) { - Boolean rt = Boolean.FALSE; - if (value == null) { - return rt; - } - getBound(key).set(value); - if (rt) { - redisTemplate.expire(ObjectRKey + key, expire, timeUnit); - } - return rt; - } - /**get 获取缓存内容*/ - public static Object get(String key) { - return getBound(key).get(); - } - /**getAndRemove 获取缓存内容并删除缓存*/ - public static Object getAndRemove(String key) { - Object rt = get(key); - delete(key); - return rt; - } - /**delete 删除缓存*/ - public static void delete(String key) { - RedisUtil.delete(ObjectRKey, key); - } - /**hasKey 是否存在缓存*/ - public static Boolean hasKey(String key) { - return RedisUtil.hasKey(ObjectRKey, key); - } - } - - /** - * 专用于List的Redis处理工具类 - * add 在list末添加新实体 - * size 当前list的size - * get 当前list的第index个数据 - * getAll 获取当前list数据 - * getAllAndRemove 获取当前list数据,并删除缓存 - */ - public static class ListR { - /**getBound用来缓存处理类,防止多次处理生成多个处理类*/ - public static BoundListOperations getBound(String oldkey){ - cleanOperas(); - String key = ListRKey + oldkey; - BoundKeyOperations boundKeyOperation = boundKeyOperations.get(key); - if(boundKeyOperation == null){ - boundKeyOperation = redisTemplate.boundListOps(key); - boundKeyOperations.put(key, boundKeyOperation); - } - return (BoundListOperations)boundKeyOperation; - } - /**setIfAbsent 如果不存在就添加缓存*/ - public static Boolean setIfAbsent(String key, List value) { - return setIfAbsent(key, value, 30L, TimeUnit.MINUTES); - } - /**setIfAbsent 如果不存在就添加缓存,并设置缓存超时时间*/ - public static Boolean setIfAbsent(String key, List value, long expire, - TimeUnit timeUnit) { - if(hasKey(key)){ - return false; - }else{ - return set(key, value, expire, timeUnit); - } - } - /**set 添加或更改缓存内容*/ - public static Boolean set(String key, List value) { - return set(key, value, 30L, TimeUnit.MINUTES); - } - /**set 添加或更改缓存内容,并设置过期时间*/ - public static Boolean set(String key, List value, long expire, - TimeUnit timeUnit) { - Boolean rt = Boolean.FALSE; - if (value == null || value.size() <= 0) { - return rt; - } - BoundListOperations boundListOperations = getBound(key); - for(Object obj : value){ - boundListOperations.rightPush(obj); - } - if (rt) { - redisTemplate.expire(ListRKey + key, expire, timeUnit); - } - return rt; - } - /**add 在list末添加新实体e*/ - public static Boolean add(String key, Object value) { - return add(key, value, 30L, TimeUnit.MINUTES); - } - /**add 在list末添加新实体,并设置过期时间*/ - public static Boolean add(String key, Object value, long expire, - TimeUnit timeUnit) { - Boolean rt = Boolean.FALSE; - if (value == null) { - return rt; - } - getBound(key).rightPush(value); - if (rt) { - redisTemplate.expire(ListRKey + key, expire, timeUnit); - } - return rt; - } - /**size 当前list的size*/ - public static Long size(String key) { - return getBound(key).size(); - } - /**get 当前list的第index个数据*/ - public static Object get(String key, long index) { - return getBound(key).index(index); - } - /**getAll 获取当前list数据*/ - public static ArrayList getAll(String key) { - if(!hasKey(key)){ - return null; - } - List list = getBound(key).range(0, size(key) - 1); - ArrayList result = new ArrayList(); - for(Object single : list){ - result.add(single); - } - return result; - } - /**getAllAndRemove 获取当前list数据,并删除缓存*/ - public static ArrayList getAllAndRemove(String key) { - ArrayList rt = getAll(key); - delete(key); - return rt; - } - /**delete 删除缓存*/ - public static void delete(String key) { - RedisUtil.delete(ListRKey, key); - } - /**hasKey 是否存在缓存*/ - public static Boolean hasKey(String key) { - return RedisUtil.hasKey(ListRKey, key); - } - } - - private static Long lastGet; - /**清理boundKeyOperations*/ - public static void cleanOperas(){ - if(lastGet == null){ - lastGet = System.currentTimeMillis(); - return; - } - //每过20分钟清理一次,防止无效Opera占用内存 - if(System.currentTimeMillis() - lastGet > 20*60*1000){ - boundKeyOperations = new ConcurrentHashMap(); - } - } - - /** - * 所有删除方法的入口 - * @param area 缓存区域 - * @param key - */ - public static void delete(String area, String key) { - redisTemplate.delete(area + key); - } - - /** - * 所有hasKey的入口 - * @param area 缓存区域 - * @param key - */ - public static Boolean hasKey(String area, String key) { - return redisTemplate.hasKey(area + key); - } - /** - * 清理所有redis缓存 - */ - public static void cleanAll(){ - redisTemplate.getConnectionFactory().getConnection().flushAll(); - } -} \ No newline at end of file diff --git a/jeecg-framework/src/main/java/org/jeecgframework/core/util/ReflectHelper.java b/jeecg-framework/src/main/java/org/jeecgframework/core/util/ReflectHelper.java index 5dbefe76..9efc5fd1 100644 --- a/jeecg-framework/src/main/java/org/jeecgframework/core/util/ReflectHelper.java +++ b/jeecg-framework/src/main/java/org/jeecgframework/core/util/ReflectHelper.java @@ -10,12 +10,15 @@ import java.util.Map; import java.util.Map.Entry; import java.util.regex.Pattern; +import org.apache.log4j.Logger; + /** * @author 张代浩 * @desc 通过反射来动态调用get 和 set 方法 */ public class ReflectHelper { - + private static final Logger logger = Logger.getLogger(ReflectHelper.class); + @SuppressWarnings("rawtypes") private Class cls; /** @@ -70,7 +73,7 @@ public class ReflectHelper { param = setM.matcher(methodName).replaceAll(rapl).toLowerCase(); setMethods.put(param, m); } else { - // org.jeecgframework.core.util.LogUtil.info(methodName + " 不是getter,setter方法!"); + // logger.info(methodName + " 不是getter,setter方法!"); } } } @@ -87,7 +90,7 @@ public class ReflectHelper { m.invoke(obj, object); return true; } catch (Exception ex) { - org.jeecgframework.core.util.LogUtil.info("invoke getter on " + property + " error: " + ex.toString()); + logger.info("invoke getter on " + property + " error: " + ex.toString()); return false; } } @@ -109,7 +112,7 @@ public class ReflectHelper { value=m.invoke(obj, new Object[] {}); } catch (Exception ex) { - org.jeecgframework.core.util.LogUtil.info("invoke getter on " + property + " error: " + ex.toString()); + logger.info("invoke getter on " + property + " error: " + ex.toString()); } } return value; diff --git a/jeecg-framework/src/main/java/org/jeecgframework/core/util/ResourceUtil.java b/jeecg-framework/src/main/java/org/jeecgframework/core/util/ResourceUtil.java index c53f4d8b..80762820 100644 --- a/jeecg-framework/src/main/java/org/jeecgframework/core/util/ResourceUtil.java +++ b/jeecg-framework/src/main/java/org/jeecgframework/core/util/ResourceUtil.java @@ -17,7 +17,6 @@ import org.jeecgframework.web.system.manager.ClientManager; import org.jeecgframework.web.system.pojo.base.Client; import org.jeecgframework.web.system.pojo.base.DynamicDataSourceEntity; import org.jeecgframework.web.system.pojo.base.TSIcon; -import org.jeecgframework.web.system.pojo.base.TSRoleFunction; import org.jeecgframework.web.system.pojo.base.TSType; import org.jeecgframework.web.system.pojo.base.TSTypegroup; import org.jeecgframework.web.system.pojo.base.TSUser; @@ -52,7 +51,12 @@ public class ResourceUtil { public static Map dynamicDataSourceMap = new HashMap(); private static final ResourceBundle bundle = java.util.ResourceBundle.getBundle("sysConfig"); - + + /** + * 域名路径 basePath + */ + private static String basePath = null; + /** * 属性文件[resources/sysConfig.properties] * #默认开启模糊查询方式 1为开启 条件无需带*就能模糊查询[暂时取消] @@ -86,20 +90,6 @@ public class ResourceUtil { return null; } - @Deprecated - public static final List getSessionTSRoleFunction(String roleId) { - HttpSession session = ContextHolderUtils.getSession(); - if (session.getAttributeNames().hasMoreElements()) { - List TSRoleFunctionList = (List)session.getAttribute(roleId); - if (TSRoleFunctionList != null) { - return TSRoleFunctionList; - } else { - return null; - } - } else { - return null; - } - } /** * 获得请求路径【注意: 不通用】 @@ -107,7 +97,7 @@ public class ResourceUtil { * @param request * @return */ - public static String getRequestPath(HttpServletRequest request) { + public static String getJgAuthRequsetPath(HttpServletRequest request) { // String requestPath = request.getRequestURI() + "?" + request.getQueryString(); String queryString = request.getQueryString(); @@ -378,6 +368,20 @@ public class ResourceUtil { data.put("sys."+DataBaseConstant.SYS_TIME_TABLE, DateUtils.formatTime()); return data; } + + /** + * 获取当前域名路径 + * @param request + * @return + */ + public static String getBasePath() { + if(StringUtils.isBlank(basePath)) { + HttpServletRequest request = ContextHolderUtils.getRequest(); + basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+request.getContextPath(); + } + return basePath; + } + /** * sql值替换 diff --git a/jeecg-framework/src/main/java/org/jeecgframework/core/util/SqlInjectionUtil.java b/jeecg-framework/src/main/java/org/jeecgframework/core/util/SqlInjectionUtil.java new file mode 100644 index 00000000..e4ea5e43 --- /dev/null +++ b/jeecg-framework/src/main/java/org/jeecgframework/core/util/SqlInjectionUtil.java @@ -0,0 +1,42 @@ + + +package org.jeecgframework.core.util; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * sql注入处理工具类 + * @author zhoujf + * + */ +public class SqlInjectionUtil { + private static final Logger logger = LoggerFactory.getLogger(SqlInjectionUtil.class); + /** + * sql注入过滤处理,遇到注入关键字抛异常 + * @param value + * @return + */ + public static void filterContent(String value) { + if(value == null || "".equals(value)){ + return ; + } + value = value.toLowerCase();//统一转为小写 +// throw new RuntimeException("值存在sql注入风险:"+value); +// String xssStr = "and |or |select |update |delete |drop |truncate |%20|=|--|!="; + String xssStr = "'|and |exec |insert |select |delete |update |drop |count |chr |mid |master |truncate |char |declare |;|or |+|,"; + String[] xssArr = xssStr.split("\\|"); + for(int i=0;i-1){ + logger.info("请注意,值可能存在SQL注入风险!---> {}",value); + throw new RuntimeException("请注意,值可能存在SQL注入风险!--->"+value); + } + } + return ; + } + + public static void main(String[] args) { + String str = "' and"; + filterContent(str); + } + +} diff --git a/jeecg-framework/src/main/java/org/jeecgframework/core/util/SysThemesUtil.java b/jeecg-framework/src/main/java/org/jeecgframework/core/util/SysThemesUtil.java index 3151d7cb..d12ec661 100644 --- a/jeecg-framework/src/main/java/org/jeecgframework/core/util/SysThemesUtil.java +++ b/jeecg-framework/src/main/java/org/jeecgframework/core/util/SysThemesUtil.java @@ -43,7 +43,8 @@ public class SysThemesUtil { */ public static String getEasyUiTheme(SysThemesEnum sysThemesEnum){ StringBuffer sb = new StringBuffer(""); - sb.append(""); + String basePath = ResourceUtil.getBasePath(); + sb.append(""); return sb.toString(); } @@ -66,10 +67,11 @@ public class SysThemesUtil { */ public static String getEasyUiMainTheme(SysThemesEnum sysThemesEnum){ StringBuffer sb = new StringBuffer(""); + String basePath = ResourceUtil.getBasePath(); if("metro".equals(sysThemesEnum.getThemes())){ - sb.append(""); + sb.append(""); }else if("metrole".equals(sysThemesEnum.getThemes())){ - sb.append(""); + sb.append(""); } return sb.toString(); } @@ -98,10 +100,11 @@ public class SysThemesUtil { */ public static String getEasyUiIconTheme(SysThemesEnum sysThemesEnum){ StringBuffer sb = new StringBuffer(""); + String basePath = ResourceUtil.getBasePath(); if("metrole".equals(sysThemesEnum.getThemes())){ - sb.append(""); + sb.append(""); }else { - sb.append(""); + sb.append(""); } return sb.toString(); } @@ -113,15 +116,16 @@ public class SysThemesUtil { */ public static String getCommonTheme(SysThemesEnum sysThemesEnum){ StringBuffer sb = new StringBuffer(""); + String basePath = ResourceUtil.getBasePath(); if("metro".equals(sysThemesEnum.getThemes())){ - sb.append(""); + sb.append(""); }else if("metrole".equals(sysThemesEnum.getThemes())){ - sb.append(""); + sb.append(""); }else{ - sb.append(""); + sb.append(""); } - sb.append(""); + sb.append(""); return sb.toString(); } @@ -154,12 +158,13 @@ public class SysThemesUtil { */ public static String getLhgdialogTheme(SysThemesEnum sysThemesEnum){ StringBuffer sb = new StringBuffer(""); + String basePath = ResourceUtil.getBasePath(); if("metro".equals(sysThemesEnum.getThemes())){ - sb.append(""); + sb.append(""); }else if("metrole".equals(sysThemesEnum.getThemes())){ - sb.append(""); + sb.append(""); }else{ - sb.append(""); + sb.append(""); } return sb.toString(); } @@ -189,13 +194,15 @@ public class SysThemesUtil { */ public static String getBootstrapTabTheme(SysThemesEnum sysThemesEnum){ StringBuffer sb = new StringBuffer(""); + String basePath = ResourceUtil.getBasePath(); if("metro".equals(sysThemesEnum.getThemes())){ - sb.append(""); + sb.append(""); }else if("metrole".equals(sysThemesEnum.getThemes())){ - sb.append(""); + sb.append(""); } return sb.toString(); } + /** @@ -205,12 +212,13 @@ public class SysThemesUtil { */ public static String getReportTheme(SysThemesEnum sysThemesEnum){ StringBuffer sb = new StringBuffer(""); + String basePath = ResourceUtil.getBasePath(); if("metro".equals(sysThemesEnum.getThemes())){ - sb.append(""); + sb.append(""); }else if("metrole".equals(sysThemesEnum.getThemes())){ - sb.append(""); + sb.append(""); }else{ - sb.append(""); + sb.append(""); } return sb.toString(); } @@ -222,12 +230,13 @@ public class SysThemesUtil { */ public static String getValidformDivfromTheme(SysThemesEnum sysThemesEnum){ StringBuffer sb = new StringBuffer(""); + String basePath = ResourceUtil.getBasePath(); if("metro".equals(sysThemesEnum.getThemes())){ - sb.append(""); + sb.append(""); }else if("metrole".equals(sysThemesEnum.getThemes())){ - sb.append(""); + sb.append(""); }else{ - sb.append(""); + sb.append(""); } return sb.toString(); } @@ -239,12 +248,13 @@ public class SysThemesUtil { */ public static String getValidformStyleTheme(SysThemesEnum sysThemesEnum){ StringBuffer sb = new StringBuffer(""); + String basePath = ResourceUtil.getBasePath(); if("metro".equals(sysThemesEnum.getThemes())){ - sb.append(""); + sb.append(""); }else if("metrole".equals(sysThemesEnum.getThemes())){ - sb.append(""); + sb.append(""); }else{ - sb.append(""); + sb.append(""); } return sb.toString(); } @@ -274,12 +284,13 @@ public class SysThemesUtil { */ public static String getValidformTablefrom(SysThemesEnum sysThemesEnum){ StringBuffer sb = new StringBuffer(""); + String basePath = ResourceUtil.getBasePath(); if("metro".equals(sysThemesEnum.getThemes())){ - sb.append(""); + sb.append(""); }else if("metrole".equals(sysThemesEnum.getThemes())){ - sb.append(""); + sb.append(""); }else{ - sb.append(""); + sb.append(""); } return sb.toString(); } diff --git a/jeecg-framework/src/main/java/org/jeecgframework/jwt/service/RedisTokenManager.java b/jeecg-framework/src/main/java/org/jeecgframework/jwt/service/RedisTokenManager.java index b721802a..0a945f85 100644 --- a/jeecg-framework/src/main/java/org/jeecgframework/jwt/service/RedisTokenManager.java +++ b/jeecg-framework/src/main/java/org/jeecgframework/jwt/service/RedisTokenManager.java @@ -10,8 +10,7 @@ import org.jeecgframework.jwt.def.JwtConstants; import org.jeecgframework.jwt.model.TokenModel; import org.jeecgframework.web.system.pojo.base.TSUser; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.data.redis.core.RedisTemplate; -import org.springframework.data.redis.serializer.JdkSerializationRedisSerializer; +import org.springframework.data.redis.core.StringRedisTemplate; import org.springframework.stereotype.Component; /** @@ -21,15 +20,8 @@ import org.springframework.stereotype.Component; */ @Component public class RedisTokenManager implements TokenManager { - - private RedisTemplate redisTemplate; - - @Autowired - public void setRedis(RedisTemplate redisTemplate) { - this.redisTemplate = redisTemplate; - //泛型设置成Long后必须更改对应的序列化方案 - redisTemplate.setKeySerializer(new JdkSerializationRedisSerializer()); - } + @Autowired + private StringRedisTemplate redisTemplate; /** * 生成TOKEN diff --git a/jeecg-framework/src/main/java/org/jeecgframework/jwt/util/JwtHttpUtil.java b/jeecg-framework/src/main/java/org/jeecgframework/jwt/util/JwtHttpUtil.java index 063b952e..f9f475c5 100644 --- a/jeecg-framework/src/main/java/org/jeecgframework/jwt/util/JwtHttpUtil.java +++ b/jeecg-framework/src/main/java/org/jeecgframework/jwt/util/JwtHttpUtil.java @@ -7,7 +7,10 @@ import java.io.OutputStream; import java.net.ConnectException; import java.net.HttpURLConnection; import java.net.URL; + +import org.apache.log4j.Logger; import org.jeecgframework.core.util.LogUtil; + import com.alibaba.fastjson.JSONObject; /** @@ -16,6 +19,7 @@ import com.alibaba.fastjson.JSONObject; * */ public class JwtHttpUtil { + private static Logger log = Logger.getLogger(JwtHttpUtil.class); /** * 发起https请求并获取结果 @@ -70,9 +74,8 @@ public class JwtHttpUtil { inputStream.close(); inputStream = null; httpUrlConn.disconnect(); - System.out.println(buffer.toString()); + log.debug(buffer.toString()); jsonObject = JSONObject.parseObject(buffer.toString()); - // jsonObject = JSONObject.fromObject(buffer.toString()); } catch (ConnectException ce) { LogUtil.info("Weixin server connection timed out."); } catch (Exception e) { @@ -143,9 +146,7 @@ public class JwtHttpUtil { inputStream = null; httpUrlConn.disconnect(); res = buffer.toString(); - System.out.println(res); -// jsonObject = JSONObject.parseObject(buffer.toString()); - // jsonObject = JSONObject.fromObject(buffer.toString()); + log.debug(res); } catch (ConnectException ce) { LogUtil.info("Weixin server connection timed out."); } catch (Exception e) { diff --git a/jeecg-framework/src/main/java/org/jeecgframework/tag/core/easyui/BaseTag.java b/jeecg-framework/src/main/java/org/jeecgframework/tag/core/easyui/BaseTag.java index 021f03f3..309c2147 100644 --- a/jeecg-framework/src/main/java/org/jeecgframework/tag/core/easyui/BaseTag.java +++ b/jeecg-framework/src/main/java/org/jeecgframework/tag/core/easyui/BaseTag.java @@ -11,6 +11,7 @@ import jodd.util.StringUtil; import org.apache.log4j.Logger; import org.jeecgframework.core.enums.SysThemesEnum; import org.jeecgframework.core.util.ContextHolderUtils; +import org.jeecgframework.core.util.ResourceUtil; import org.jeecgframework.core.util.SysThemesUtil; import org.jeecgframework.core.util.oConvertUtils; import org.jeecgframework.tag.core.JeecgTag; @@ -21,7 +22,7 @@ import org.jeecgframework.tag.core.JeecgTag; * */ public class BaseTag extends JeecgTag { - private Logger log = Logger.getLogger(BaseTag.class); + private static Logger log = Logger.getLogger(BaseTag.class); private static final long serialVersionUID = 1L; protected String type = "default";// 加载类型 protected String cssTheme ; @@ -80,104 +81,111 @@ public class BaseTag extends JeecgTag { } //插入多语言脚本 - String lang = (String)((HttpServletRequest) this.pageContext.getRequest()).getSession().getAttribute("lang"); + HttpServletRequest request =(HttpServletRequest) this.pageContext.getRequest(); + String lang = (String)request.getSession().getAttribute("lang"); + String basePath = ResourceUtil.getBasePath(); if(lang==null){lang="zh-cn";} - String langjs = StringUtil.replace("", "{0}", lang); + String langjs = StringUtil.replace("", "{0}", lang); sb.append(langjs); if (oConvertUtils.isIn("jquery-webos", types)) { - sb.append(""); + sb.append(""); } else if (oConvertUtils.isIn("jquery", types)) { - sb.append(""); - sb.append(""); - sb.append(""); + sb.append(""); + sb.append(""); + sb.append(""); } if (oConvertUtils.isIn("ckeditor", types)) { - sb.append(""); - sb.append(""); + sb.append(""); + sb.append(""); } if (oConvertUtils.isIn("easyui", types)) { - sb.append(""); + sb.append(""); sb.append(SysThemesUtil.getEasyUiTheme(sysThemesEnum)); sb.append(SysThemesUtil.getEasyUiMainTheme(sysThemesEnum)); sb.append(SysThemesUtil.getEasyUiIconTheme(sysThemesEnum)); - sb.append(""); - sb.append(""); - sb.append(""); - sb.append(StringUtil.replace("", "{0}", lang)); - sb.append(""); - sb.append(""); + sb.append(""); + sb.append(""); + sb.append(""); + sb.append(StringUtil.replace("", "{0}", lang)); + sb.append(""); + sb.append(""); + sb.append(""); } if (oConvertUtils.isIn("DatePicker", types)) { - sb.append(""); + sb.append(""); } if (oConvertUtils.isIn("jqueryui", types)) { - sb.append(""); - sb.append(""); + sb.append(""); + sb.append(""); } if (oConvertUtils.isIn("jqueryui-sortable", types)) { - sb.append(""); - sb.append(""); - sb.append(""); - sb.append(""); - sb.append(""); + sb.append(""); + sb.append(""); + sb.append(""); + sb.append(""); + sb.append(""); } if (oConvertUtils.isIn("prohibit", types)) { - sb.append(""); } + sb.append(""); } if (oConvertUtils.isIn("tools", types)) { sb.append(SysThemesUtil.getCommonTheme(sysThemesEnum)); sb.append(SysThemesUtil.getLhgdialogTheme(sysThemesEnum)); sb.append(SysThemesUtil.getBootstrapTabTheme(sysThemesEnum)); - sb.append(""); - sb.append(StringUtil.replace("", "{0}", lang)); - sb.append(""); - sb.append(""); - sb.append(""); + sb.append(""); + sb.append(StringUtil.replace("", "{0}", lang)); + sb.append(""); + sb.append(""); + sb.append(""); } if (oConvertUtils.isIn("toptip", types)) { - sb.append(""); - sb.append(""); + sb.append(""); + sb.append(""); } if (oConvertUtils.isIn("autocomplete", types)) { - sb.append(""); - sb.append(""); + sb.append(""); + sb.append(""); } if (oConvertUtils.isIn("jeasyuiextensions", types)) { - sb.append(""); - sb.append(""); - sb.append(""); - sb.append(""); - sb.append(""); - sb.append(""); - sb.append(""); - sb.append(""); - sb.append(""); - sb.append(""); + sb.append(""); + sb.append(""); + sb.append(""); + sb.append(""); + sb.append(""); + sb.append(""); + sb.append(""); + sb.append(""); + sb.append(""); + sb.append(""); } if (oConvertUtils.isIn("ztree", types)) { - sb.append(""); - sb.append(""); - sb.append(""); + sb.append(""); + sb.append(""); + sb.append(""); } if (oConvertUtils.isIn("bootstrap", types)) { - sb.append(""); - sb.append(""); - sb.append(""); - sb.append(""); + sb.append(""); + sb.append(""); + sb.append(""); + sb.append(""); } if (oConvertUtils.isIn("bootstrap-table", types)) { - sb.append(""); - sb.append(""); - sb.append(""); - sb.append(""); - sb.append(""); - sb.append(""); - sb.append(""); + sb.append(""); + sb.append(""); + sb.append(""); + sb.append(""); + sb.append(""); + sb.append(""); + sb.append(""); + + sb.append(""); + sb.append(""); + } if (oConvertUtils.isIn("layer", types)) { - sb.append(""); - sb.append(""); + sb.append(""); + sb.append(""); } types = null; diff --git a/jeecg-framework/src/main/java/org/jeecgframework/tag/core/easyui/DataGridColumnTag.java b/jeecg-framework/src/main/java/org/jeecgframework/tag/core/easyui/DataGridColumnTag.java index 505d5b8e..9ede16aa 100644 --- a/jeecg-framework/src/main/java/org/jeecgframework/tag/core/easyui/DataGridColumnTag.java +++ b/jeecg-framework/src/main/java/org/jeecgframework/tag/core/easyui/DataGridColumnTag.java @@ -64,7 +64,9 @@ public class DataGridColumnTag extends TagSupport { protected String dictCondition; //自定义字典表的显示文本-字典查询条件 - + private String filterType = "text";//过滤操作的类型 + private boolean optsMenu = false;//操作列风格转变 【船舶专用】 + public boolean isNewColumn() { return newColumn; } @@ -95,7 +97,7 @@ public class DataGridColumnTag extends TagSupport { Tag t = findAncestorWithClass(this, DataGridTag.class); DataGridTag parent = (DataGridTag) t; - parent.setColumn(title,field,width,showLen,rowspan,colspan,align,sortable,checkbox,formatter,formatterjs,hidden,replace,treefield,image,imageSize,query,url,funname,arg,queryMode, dictionary,popup,frozenColumn,extend,style,downloadName,autocomplete,extendParams,editor,defaultVal,showMode,newColumn,dictCondition); + parent.setColumn(title,field,width,showLen,rowspan,colspan,align,sortable,checkbox,formatter,formatterjs,hidden,replace,treefield,image,imageSize,query,url,funname,arg,queryMode, dictionary,popup,frozenColumn,extend,style,downloadName,autocomplete,extendParams,editor,defaultVal,showMode,newColumn,dictCondition,filterType,optsMenu); return EVAL_PAGE; } @@ -266,6 +268,19 @@ public class DataGridColumnTag extends TagSupport { this.defaultVal = defaultVal; } - + public String getFilterType() { + return filterType; + } + public void setFilterType(String filterType) { + this.filterType = filterType; + } + + public boolean isOptsMenu() { + return optsMenu; + } + + public void setOptsMenu(boolean optsMenu) { + this.optsMenu = optsMenu; + } } diff --git a/jeecg-framework/src/main/java/org/jeecgframework/tag/core/easyui/DataGridFunOptTag.java b/jeecg-framework/src/main/java/org/jeecgframework/tag/core/easyui/DataGridFunOptTag.java index b208e17e..accdc92e 100644 --- a/jeecg-framework/src/main/java/org/jeecgframework/tag/core/easyui/DataGridFunOptTag.java +++ b/jeecg-framework/src/main/java/org/jeecgframework/tag/core/easyui/DataGridFunOptTag.java @@ -26,7 +26,8 @@ public class DataGridFunOptTag extends TagSupport { private String urlclass;//按钮样式 private String urlfont;//按钮图标 - + private boolean inGroup;//操作列菜单一开始是否隐藏【船舶专用】 + public int doStartTag() throws JspTagException { return EVAL_PAGE; } @@ -35,7 +36,7 @@ public class DataGridFunOptTag extends TagSupport { Tag t = findAncestorWithClass(this, DataGridTag.class); DataGridTag parent = (DataGridTag) t; - parent.setFunUrl(title,exp,funname,operationCode,urlStyle,urlclass,urlfont); + parent.setFunUrl(title,exp,funname,operationCode,urlStyle,urlclass,urlfont,inGroup); return EVAL_PAGE; } public void setFunname(String funname) { @@ -74,7 +75,12 @@ public class DataGridFunOptTag extends TagSupport { this.urlfont = urlfont; } - - + + public boolean isInGroup() { + return inGroup; + } + public void setInGroup(boolean inGroup) { + this.inGroup = inGroup; + } } diff --git a/jeecg-framework/src/main/java/org/jeecgframework/tag/core/easyui/DataGridOpenOptTag.java b/jeecg-framework/src/main/java/org/jeecgframework/tag/core/easyui/DataGridOpenOptTag.java index 54d9cdec..1dc6f14e 100644 --- a/jeecg-framework/src/main/java/org/jeecgframework/tag/core/easyui/DataGridOpenOptTag.java +++ b/jeecg-framework/src/main/java/org/jeecgframework/tag/core/easyui/DataGridOpenOptTag.java @@ -25,13 +25,16 @@ public class DataGridOpenOptTag extends TagSupport { private String urlfont;//按钮图标 private String openModel = "OpenWin"; //弹出方式 + + private boolean inGroup;//操作列菜单一开始是否隐藏【船舶专用】 + public int doStartTag() throws JspTagException { return EVAL_PAGE; } public int doEndTag() throws JspTagException { Tag t = findAncestorWithClass(this, DataGridTag.class); DataGridTag parent = (DataGridTag) t; - parent.setOpenUrl(url,title,width,height,exp,operationCode,openModel,urlStyle,urlclass,urlfont); + parent.setOpenUrl(url,title,width,height,exp,operationCode,openModel,urlStyle,urlclass,urlfont,inGroup); return EVAL_PAGE; } public void setWidth(String width) { @@ -74,5 +77,11 @@ public class DataGridOpenOptTag extends TagSupport { public void setUrlfont(String urlfont) { this.urlfont = urlfont; } + public boolean isInGroup() { + return inGroup; + } + public void setInGroup(boolean inGroup) { + this.inGroup = inGroup; + } } diff --git a/jeecg-framework/src/main/java/org/jeecgframework/tag/core/easyui/DataGridTag.java b/jeecg-framework/src/main/java/org/jeecgframework/tag/core/easyui/DataGridTag.java index 6491119d..ecbb4ddf 100644 --- a/jeecg-framework/src/main/java/org/jeecgframework/tag/core/easyui/DataGridTag.java +++ b/jeecg-framework/src/main/java/org/jeecgframework/tag/core/easyui/DataGridTag.java @@ -60,7 +60,7 @@ import com.google.gson.Gson; */ @SuppressWarnings({"serial","rawtypes","unchecked","static-access"}) public class DataGridTag extends TagSupport { - private Logger log = Logger.getLogger(DataGridTag.class); + private static Logger log = Logger.getLogger(DataGridTag.class); private final String DATE_FORMATTER = "yyyy-MM-dd"; private final String DATETIME_FORMATTER = "yyyy-MM-dd hh:mm:ss"; @@ -407,13 +407,15 @@ public class DataGridTag extends TagSupport { /** * 设置自定义函数操作URL */ - public void setFunUrl(String title, String exp, String funname,String operationCode, String urlStyle,String urlclass,String urlfont) { + public void setFunUrl(String title, String exp, String funname,String operationCode, String urlStyle,String urlclass,String urlfont,boolean inGroup) { DataGridUrl dataGridUrl = new DataGridUrl(); dataGridUrl.setTitle(title); dataGridUrl.setType(OptTypeDirection.Fun); dataGridUrl.setExp(exp); dataGridUrl.setFunname(funname); + dataGridUrl.setInGroup(inGroup); + if(checkBrowerIsNotIE()){ dataGridUrl.setUrlStyle(urlStyle); @@ -433,7 +435,7 @@ public class DataGridTag extends TagSupport { * @param urlfont * @param urlclass */ - public void setOpenUrl(String url, String title, String width, String height, String exp,String operationCode, String openModel, String urlStyle, String urlclass, String urlfont) { + public void setOpenUrl(String url, String title, String width, String height, String exp,String operationCode, String openModel, String urlStyle, String urlclass, String urlfont,boolean inGroup) { DataGridUrl dataGridUrl = new DataGridUrl(); dataGridUrl.setTitle(title); dataGridUrl.setUrl(url); @@ -442,6 +444,8 @@ public class DataGridTag extends TagSupport { dataGridUrl.setType(OptTypeDirection.valueOf(openModel)); dataGridUrl.setExp(exp); + dataGridUrl.setInGroup(inGroup); + if(checkBrowerIsNotIE()){ dataGridUrl.setUrlStyle(urlStyle); @@ -474,7 +478,7 @@ public class DataGridTag extends TagSupport { String arg,String queryMode, String dictionary,boolean popup, boolean frozenColumn,String extend, - String style,String downloadName,boolean isAuto,String extendParams,String editor,String defaultVal,String showMode, boolean newColumn,String dictCondition) { + String style,String downloadName,boolean isAuto,String extendParams,String editor,String defaultVal,String showMode, boolean newColumn,String dictCondition,String filterType,boolean optsMenu) { DataGridColumn dataGridColumn = new DataGridColumn(); dataGridColumn.setAlign(align); @@ -517,6 +521,9 @@ public class DataGridTag extends TagSupport { dataGridColumn.setDictCondition(dictCondition); + dataGridColumn.setFilterType(filterType); + dataGridColumn.setOptsMenu(optsMenu); + columnList.add(dataGridColumn); Set operationCodes = (Set) super.pageContext.getRequest().getAttribute(Globals.OPERATIONCODES); @@ -654,9 +661,11 @@ public class DataGridTag extends TagSupport { if("bootstrap-table".equals(component)){ ComponentFactory componentFactory = new BootstrapTableComponent(); String content = componentFactory.invoke("/org/jeecgframework/tag/core/factory/ftl/component/bootstrapTable.ftl", getDataGridTag()); + //log.debug(" content ===>" + content); out.print(content); }else{ out.print(end().toString()); + //log.debug(" end() ===>" + end().toString()); } out.flush(); @@ -958,7 +967,7 @@ public class DataGridTag extends TagSupport { sb.append("');"); + if(oConvertUtils.isNotEmpty(datatype)){ + sb.append("\r\n$('#"+name+"uploader').find('div.btns').append('');"); } sb.append("\r\nvar reset_"+name+"_dataTypeInpVal=function(addOrdel){var obj = $(\"#" + name + "dataTypeInp\");if(obj.length>0){var objval=obj.val()||'';\r\nif (addOrdel == 1) {if(objval==''){obj.val('1');}else{obj.val(objval.toString()+(parseInt(objval.length)+1));}}else{if(objval.length <=1){obj.val('');}else{obj.val(objval.substr(0,objval.length-1));\r\n}\r\n}obj.blur();}}"); //设置默认值 @@ -372,11 +372,11 @@ public class WebUploaderTag extends TagSupport { public void setExtensions(String extensions) { this.extensions = extensions; } - public String getDataType() { - return dataType; + public String getDatatype() { + return datatype; } - public void setDataType(String dataType) { - this.dataType = dataType; + public void setDatatype(String datatype) { + this.datatype = datatype; } public String getNullMsg() { if(oConvertUtils.isEmpty(nullMsg)){ diff --git a/jeecg-framework/src/main/java/org/jeecgframework/tag/core/factory/ftl/component/bootstrapTable.ftl b/jeecg-framework/src/main/java/org/jeecgframework/tag/core/factory/ftl/component/bootstrapTable.ftl index 4ccf4b49..acc1b968 100644 --- a/jeecg-framework/src/main/java/org/jeecgframework/tag/core/factory/ftl/component/bootstrapTable.ftl +++ b/jeecg-framework/src/main/java/org/jeecgframework/tag/core/factory/ftl/component/bootstrapTable.ftl @@ -9,7 +9,7 @@
<#list dataGrid.columnList as po> <#if po.query==true> - <#include "bootstrapTable-search.ftl"> + <#include "/org/jeecgframework/tag/core/factory/ftl/component/bootstrapTable-search.ftl">
@@ -129,12 +129,12 @@ } <#list dataGrid.columnList as po> <#if po.field!="opt"> - <#include "bootstrapTable-column.ftl"> + <#include "/org/jeecgframework/tag/core/factory/ftl/component/bootstrapTable-column.ftl"> <#else> ,{ title: "操作",align: 'center',valign: 'middle',width: ${po.width}, formatter: function (value, row, index) { - <#include "bootstrapTable-opt.ftl"> + <#include "/org/jeecgframework/tag/core/factory/ftl/component/bootstrapTable-opt.ftl"> } } diff --git a/jeecg-framework/src/main/java/org/jeecgframework/tag/core/factory/util/ComponentTools.java b/jeecg-framework/src/main/java/org/jeecgframework/tag/core/factory/util/ComponentTools.java index 26f0627c..26ee5b2d 100644 --- a/jeecg-framework/src/main/java/org/jeecgframework/tag/core/factory/util/ComponentTools.java +++ b/jeecg-framework/src/main/java/org/jeecgframework/tag/core/factory/util/ComponentTools.java @@ -93,23 +93,24 @@ public class ComponentTools { urlclass.append("\'"); } StringBuffer urlfont = new StringBuffer(); + if(!StringUtil.isEmpty(dataGridUrl.getUrlfont())){ - urlfont.append(" "); + urlfont.append("\' aria-hidden=\'true\'>"); } if (OptTypeDirection.Confirm.equals(dataGridUrl.getType())) { if(!StringUtil.isEmpty(dataGridUrl.getUrlclass())){ - sb.append("href+=\" \";"); - + sb.append("href+=\"" + dataGridUrl.getTitle() + " \";"); + if (StringUtil.isNotEmpty(exp)) { for (int i = 0; i < exp.split("&&").length; i++) { diff --git a/jeecg-framework/src/main/java/org/jeecgframework/tag/core/util/GzipUtilities.java b/jeecg-framework/src/main/java/org/jeecgframework/tag/core/util/GzipUtilities.java new file mode 100644 index 00000000..82097a38 --- /dev/null +++ b/jeecg-framework/src/main/java/org/jeecgframework/tag/core/util/GzipUtilities.java @@ -0,0 +1,24 @@ +package org.jeecgframework.tag.core.util; + +import java.io.IOException; +import java.io.PrintWriter; +import java.util.zip.GZIPOutputStream; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +public class GzipUtilities { + + public static boolean isGzipSupported(HttpServletRequest request) { + String encodings = request.getHeader("Accept-Encoding"); + return ((encodings != null) && (encodings.indexOf("gzip") != -1)); + } + + public static boolean isGzipDisabled(HttpServletRequest request) { + String flag = request.getParameter("disableGzip"); + return ((flag != null) && (!flag.equalsIgnoreCase("false"))); + } + + public static PrintWriter getGzipWriter(HttpServletResponse response) throws IOException { + return (new PrintWriter(new GZIPOutputStream(response.getOutputStream()))); + } +} diff --git a/jeecg-framework/src/main/java/org/jeecgframework/tag/vo/easyui/DataGridColumn.java b/jeecg-framework/src/main/java/org/jeecgframework/tag/vo/easyui/DataGridColumn.java index 659e0522..e72aa7b0 100644 --- a/jeecg-framework/src/main/java/org/jeecgframework/tag/vo/easyui/DataGridColumn.java +++ b/jeecg-framework/src/main/java/org/jeecgframework/tag/vo/easyui/DataGridColumn.java @@ -51,7 +51,10 @@ public class DataGridColumn { protected String showMode;//表单元素,查询表单中显示样式,默认样式select protected boolean newColumn; - + + private String filterType = "text";//过滤操作的类型 + private boolean optsMenu = false;//操作列风格转变 + public boolean isNewColumn() { return newColumn; } @@ -330,6 +333,20 @@ public class DataGridColumn { this.defaultVal = defaultVal; } + public String getFilterType() { + return filterType; + } + public void setFilterType(String filterType) { + this.filterType = filterType; + } + + public boolean isOptsMenu() { + return optsMenu; + } + public void setOptsMenu(boolean optsMenu) { + this.optsMenu = optsMenu; + } + @Override public String toString() { return "DataGridColumn [title=" + title + ", field=" + field + ", width=" + width + ", showLen=" + showLen + ", rowspan=" + rowspan + ", colspan=" + colspan + diff --git a/jeecg-framework/src/main/java/org/jeecgframework/tag/vo/easyui/DataGridUrl.java b/jeecg-framework/src/main/java/org/jeecgframework/tag/vo/easyui/DataGridUrl.java index 94a6f8e0..460f45b5 100644 --- a/jeecg-framework/src/main/java/org/jeecgframework/tag/vo/easyui/DataGridUrl.java +++ b/jeecg-framework/src/main/java/org/jeecgframework/tag/vo/easyui/DataGridUrl.java @@ -28,6 +28,8 @@ public class DataGridUrl { private String operationCode;//按钮的操作Code + private boolean inGroup = false; + public String getOnclick() { return onclick; } @@ -163,6 +165,14 @@ public class DataGridUrl { this.id = id; } + public boolean isInGroup() { + return inGroup; + } + + public void setInGroup(boolean inGroup) { + this.inGroup = inGroup; + } + @Override public String toString() { return "DataGridUrl [url=" + url + ", title=" + title + ", icon=" + icon + ", value=" + value + ", width=" + width + ", height=" + height + diff --git a/jeecg-framework/src/main/java/com/jeecg/black/controller/TsBlackListController.java b/jeecg-framework/src/main/java/org/jeecgframework/web/black/controller/TsBlackListController.java similarity index 95% rename from jeecg-framework/src/main/java/com/jeecg/black/controller/TsBlackListController.java rename to jeecg-framework/src/main/java/org/jeecgframework/web/black/controller/TsBlackListController.java index 015d3697..d0aa0088 100644 --- a/jeecg-framework/src/main/java/com/jeecg/black/controller/TsBlackListController.java +++ b/jeecg-framework/src/main/java/org/jeecgframework/web/black/controller/TsBlackListController.java @@ -1,4 +1,4 @@ -package com.jeecg.black.controller; +package org.jeecgframework.web.black.controller; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; @@ -39,6 +39,7 @@ import org.jeecgframework.web.system.pojo.base.InterfaceRuleDto; import org.jeecgframework.web.system.service.SystemService; import org.jeecgframework.web.system.util.InterfaceUtil; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.dao.DataIntegrityViolationException; import org.springframework.http.MediaType; import org.springframework.stereotype.Controller; import org.springframework.ui.ModelMap; @@ -51,8 +52,8 @@ import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartHttpServletRequest; import org.springframework.web.servlet.ModelAndView; -import com.jeecg.black.entity.TsBlackListEntity; -import com.jeecg.black.service.TsBlackListServiceI; +import org.jeecgframework.web.black.entity.TsBlackListEntity; +import org.jeecgframework.web.black.service.TsBlackListServiceI; /** * @Title: Controller @@ -87,7 +88,7 @@ public class TsBlackListController extends BaseController { */ @RequestMapping(params = "list") public ModelAndView list(HttpServletRequest request) { - return new ModelAndView("com/jeecg/black/tsBlackListList"); + return new ModelAndView("jeecg/black/tsBlackListList"); } /** @@ -182,6 +183,11 @@ public class TsBlackListController extends BaseController { try{ tsBlackListService.save(tsBlackList); systemService.addLog(message, Globals.Log_Type_INSERT, Globals.Log_Leavel_INFO); + + }catch(DataIntegrityViolationException ce){ + j.setSuccess(false); + message = "该IP:"+tsBlackList.getIp()+"已存在!"; + }catch(Exception e){ e.printStackTrace(); message = "黑名单添加失败"; @@ -208,7 +214,12 @@ public class TsBlackListController extends BaseController { MyBeanUtils.copyBeanNotNull2Bean(tsBlackList, t); tsBlackListService.saveOrUpdate(t); systemService.addLog(message, Globals.Log_Type_UPDATE, Globals.Log_Leavel_INFO); - } catch (Exception e) { + + } catch(DataIntegrityViolationException ce){ + j.setSuccess(false); + message = "该IP:"+tsBlackList.getIp()+"已存在!"; + + }catch (Exception e) { e.printStackTrace(); message = "黑名单更新失败"; throw new BusinessException(e.getMessage()); @@ -229,7 +240,7 @@ public class TsBlackListController extends BaseController { tsBlackList = tsBlackListService.getEntity(TsBlackListEntity.class, tsBlackList.getId()); req.setAttribute("tsBlackListPage", tsBlackList); } - return new ModelAndView("com/jeecg/black/tsBlackList-add"); + return new ModelAndView("jeecg/black/tsBlackList-add"); } /** * 黑名单编辑页面跳转 @@ -242,7 +253,7 @@ public class TsBlackListController extends BaseController { tsBlackList = tsBlackListService.getEntity(TsBlackListEntity.class, tsBlackList.getId()); req.setAttribute("tsBlackListPage", tsBlackList); } - return new ModelAndView("com/jeecg/black/tsBlackList-update"); + return new ModelAndView("jeecg/black/tsBlackList-update"); } /** diff --git a/jeecg-framework/src/main/java/com/jeecg/black/entity/TsBlackListEntity.java b/jeecg-framework/src/main/java/org/jeecgframework/web/black/entity/TsBlackListEntity.java similarity index 99% rename from jeecg-framework/src/main/java/com/jeecg/black/entity/TsBlackListEntity.java rename to jeecg-framework/src/main/java/org/jeecgframework/web/black/entity/TsBlackListEntity.java index a8a169e1..3f214089 100644 --- a/jeecg-framework/src/main/java/com/jeecg/black/entity/TsBlackListEntity.java +++ b/jeecg-framework/src/main/java/org/jeecgframework/web/black/entity/TsBlackListEntity.java @@ -1,4 +1,4 @@ -package com.jeecg.black.entity; +package org.jeecgframework.web.black.entity; import javax.persistence.Column; import javax.persistence.Entity; diff --git a/jeecg-framework/src/main/java/com/jeecg/black/service/TsBlackListServiceI.java b/jeecg-framework/src/main/java/org/jeecgframework/web/black/service/TsBlackListServiceI.java similarity index 77% rename from jeecg-framework/src/main/java/com/jeecg/black/service/TsBlackListServiceI.java rename to jeecg-framework/src/main/java/org/jeecgframework/web/black/service/TsBlackListServiceI.java index d5b31efb..c90cb051 100644 --- a/jeecg-framework/src/main/java/com/jeecg/black/service/TsBlackListServiceI.java +++ b/jeecg-framework/src/main/java/org/jeecgframework/web/black/service/TsBlackListServiceI.java @@ -1,5 +1,5 @@ -package com.jeecg.black.service; -import com.jeecg.black.entity.TsBlackListEntity; +package org.jeecgframework.web.black.service; +import org.jeecgframework.web.black.entity.TsBlackListEntity; import org.jeecgframework.core.common.service.CommonService; import java.io.Serializable; diff --git a/jeecg-framework/src/main/java/com/jeecg/black/service/impl/TsBlackListServiceImpl.java b/jeecg-framework/src/main/java/org/jeecgframework/web/black/service/impl/TsBlackListServiceImpl.java similarity index 96% rename from jeecg-framework/src/main/java/com/jeecg/black/service/impl/TsBlackListServiceImpl.java rename to jeecg-framework/src/main/java/org/jeecgframework/web/black/service/impl/TsBlackListServiceImpl.java index b13f0c2b..b28fc552 100644 --- a/jeecg-framework/src/main/java/com/jeecg/black/service/impl/TsBlackListServiceImpl.java +++ b/jeecg-framework/src/main/java/org/jeecgframework/web/black/service/impl/TsBlackListServiceImpl.java @@ -1,7 +1,7 @@ -package com.jeecg.black.service.impl; -import com.jeecg.black.service.TsBlackListServiceI; +package org.jeecgframework.web.black.service.impl; +import org.jeecgframework.web.black.service.TsBlackListServiceI; import org.jeecgframework.core.common.service.impl.CommonServiceImpl; -import com.jeecg.black.entity.TsBlackListEntity; +import org.jeecgframework.web.black.entity.TsBlackListEntity; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.util.HashMap; diff --git a/jeecg-framework/src/main/java/org/jeecgframework/web/cgdynamgraph/controller/CgDynamGraphConfigHeadController.java b/jeecg-framework/src/main/java/org/jeecgframework/web/cgdynamgraph/controller/CgDynamGraphConfigHeadController.java index c4eac1a1..b628e216 100644 --- a/jeecg-framework/src/main/java/org/jeecgframework/web/cgdynamgraph/controller/CgDynamGraphConfigHeadController.java +++ b/jeecg-framework/src/main/java/org/jeecgframework/web/cgdynamgraph/controller/CgDynamGraphConfigHeadController.java @@ -30,7 +30,7 @@ import org.springframework.web.servlet.ModelAndView; /** * @Title: Controller - * @Description: Online移动报表配置功能 + * @Description: Online移动图表配置 * @author scott * @date 2016-01-10 16:00:21 * @version V1.0 @@ -52,7 +52,7 @@ public class CgDynamGraphConfigHeadController extends BaseController { /** - * 动态报表配置抬头列表 页面跳转 + * 移动图表配置抬头列表 页面跳转 * * @return */ @@ -86,7 +86,7 @@ public class CgDynamGraphConfigHeadController extends BaseController { } /** - * 删除动态报表配置抬头 + * 删除移动图表配置抬头 * * @return */ @@ -96,14 +96,14 @@ public class CgDynamGraphConfigHeadController extends BaseController { String message = null; AjaxJson j = new AjaxJson(); cgDynamGraphConfigHead = systemService.getEntity(CgDynamGraphConfigHeadEntity.class, cgDynamGraphConfigHead.getId()); - message = "动态报表配置抬头删除成功"; + message = "移动图表配置抬头删除成功"; try{ cgDynamGraphConfigHeadService.delMain(cgDynamGraphConfigHead); systemService.addLog(message, Globals.Log_Type_DEL, Globals.Log_Leavel_INFO); logger.info("["+IpUtil.getIpAddr(request)+"][online移动图表删除]["+cgDynamGraphConfigHead.getCode()+"]"+message); }catch(Exception e){ e.printStackTrace(); - message = "动态报表配置抬头删除失败"; + message = "移动图表配置抬头删除失败"; throw new BusinessException(e.getMessage()); } j.setMsg(message); @@ -111,7 +111,7 @@ public class CgDynamGraphConfigHeadController extends BaseController { } /** - * 批量删除动态报表配置抬头 + * 批量删除移动图表配置抬头 * * @return */ @@ -120,7 +120,7 @@ public class CgDynamGraphConfigHeadController extends BaseController { public AjaxJson doBatchDel(String ids,HttpServletRequest request){ String message = null; AjaxJson j = new AjaxJson(); - message = "动态报表配置抬头删除成功"; + message = "移动图表配置抬头删除成功"; try{ for(String id:ids.split(",")){ CgDynamGraphConfigHeadEntity cgDynamGraphConfigHead = systemService.getEntity(CgDynamGraphConfigHeadEntity.class, id); @@ -130,7 +130,7 @@ public class CgDynamGraphConfigHeadController extends BaseController { } }catch(Exception e){ e.printStackTrace(); - message = "动态报表配置抬头删除失败"; + message = "移动图表配置抬头删除失败"; throw new BusinessException(e.getMessage()); } j.setMsg(message); @@ -138,7 +138,7 @@ public class CgDynamGraphConfigHeadController extends BaseController { } /** - * 添加动态报表配置抬头 + * 添加移动图表配置抬头 * * @param ids * @return @@ -157,14 +157,14 @@ public class CgDynamGraphConfigHeadController extends BaseController { logger.info("["+IpUtil.getIpAddr(request)+"][online移动图表录入]["+cgDynamGraphConfigHead.getCode()+"]"+message); }catch(Exception e){ e.printStackTrace(); - message = "动态报表配置抬头添加失败"; + message = "移动图表配置抬头添加失败"; throw new BusinessException(e.getMessage()); } j.setMsg(message); return j; } /** - * 更新动态报表配置抬头 + * 更新移动图表配置抬头 * * @param ids * @return @@ -183,7 +183,7 @@ public class CgDynamGraphConfigHeadController extends BaseController { logger.info("["+IpUtil.getIpAddr(request)+"][online移动图表更新]["+cgDynamGraphConfigHead.getCode()+"]"+message); }catch(Exception e){ e.printStackTrace(); - message = "更新动态报表配置抬头失败"; + message = "更新移动图表配置抬头失败"; throw new BusinessException(e.getMessage()); } j.setMsg(message); @@ -191,7 +191,7 @@ public class CgDynamGraphConfigHeadController extends BaseController { } /** - * 动态报表配置抬头新增页面跳转 + * 移动图表配置抬头新增页面跳转 * * @return */ @@ -205,7 +205,7 @@ public class CgDynamGraphConfigHeadController extends BaseController { } /** - * 动态报表配置抬头编辑页面跳转 + * 移动图表配置抬头编辑页面跳转 * * @return */ @@ -219,7 +219,7 @@ public class CgDynamGraphConfigHeadController extends BaseController { } /** - * 加载明细列表[动态报表配置明细] + * 加载明细列表[移动图表配置明细] * * @return */ @@ -230,7 +230,7 @@ public class CgDynamGraphConfigHeadController extends BaseController { //获取参数 Object id0 = cgDynamGraphConfigHead.getId(); //=================================================================================== - //查询-动态报表配置明细 + //查询-移动图表配置明细 String hql0 = "from CgDynamGraphConfigItemEntity where 1 = 1 AND cgrheadId = ? "; try{ List cgDynamGraphConfigItemEntityList = systemService.findHql(hql0,id0); @@ -242,7 +242,7 @@ public class CgDynamGraphConfigHeadController extends BaseController { } /** - * 加载参数列表[动态报表参数] + * 加载参数列表[移动图表参数] * * @return */ @@ -253,7 +253,7 @@ public class CgDynamGraphConfigHeadController extends BaseController { //获取参数 Object id0 = cgDynamGraphConfigHead.getId(); //=================================================================================== - //查询-动态报表配置明细 + //查询-移动图表配置明细 String hql0 = "from CgDynamGraphConfigParamEntity where 1 = 1 AND cgrheadId = ? "; try{ List cgDynamGraphConfigParamEntityList = systemService.findHql(hql0,id0); diff --git a/jeecg-framework/src/main/java/org/jeecgframework/web/cgdynamgraph/controller/CgDynamGraphController.java b/jeecg-framework/src/main/java/org/jeecgframework/web/cgdynamgraph/controller/CgDynamGraphController.java index 55efc6fa..98b3f46c 100644 --- a/jeecg-framework/src/main/java/org/jeecgframework/web/cgdynamgraph/controller/CgDynamGraphController.java +++ b/jeecg-framework/src/main/java/org/jeecgframework/web/cgdynamgraph/controller/CgDynamGraphController.java @@ -8,9 +8,6 @@ import java.util.HashMap; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -import java.util.Set; -import java.util.regex.Matcher; -import java.util.regex.Pattern; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @@ -18,7 +15,6 @@ import javax.servlet.http.HttpSession; import org.apache.commons.lang.StringUtils; import org.jeecgframework.core.common.controller.BaseController; -import org.jeecgframework.core.common.exception.BusinessException; import org.jeecgframework.core.enums.SysThemesEnum; import org.jeecgframework.core.online.def.CgReportConstant; import org.jeecgframework.core.online.exception.CgReportNotFoundException; @@ -26,11 +22,12 @@ import org.jeecgframework.core.online.util.CgReportQueryParamUtil; import org.jeecgframework.core.online.util.FreemarkerHelper; import org.jeecgframework.core.util.ContextHolderUtils; import org.jeecgframework.core.util.DynamicDBUtil; +import org.jeecgframework.core.util.SqlInjectionUtil; import org.jeecgframework.core.util.SqlUtil; import org.jeecgframework.core.util.StringUtil; import org.jeecgframework.core.util.SysThemesUtil; -import org.jeecgframework.core.util.oConvertUtils; import org.jeecgframework.web.cgdynamgraph.service.core.CgDynamGraphServiceI; +import org.jeecgframework.web.cgreport.service.core.CgReportServiceI; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; @@ -49,6 +46,8 @@ import org.springframework.web.bind.annotation.ResponseBody; public class CgDynamGraphController extends BaseController { @Autowired private CgDynamGraphServiceI cgDynamGraphService; + @Autowired + private CgReportServiceI cgReportService; @RequestMapping(params = "design") public void design(String id, HttpServletRequest request,String gtype, @@ -136,7 +135,7 @@ public class CgDynamGraphController extends BaseController { fl.put(CgReportConstant.ITEM_FIELDNAME, ((String)fl.get(CgReportConstant.ITEM_FIELDNAME)).toLowerCase()); String isQuery = (String) fl.get(CgReportConstant.ITEM_ISQUERY); if(CgReportConstant.BOOL_TRUE.equalsIgnoreCase(isQuery)){ - loadDic(fl,fl); + cgReportService.loadDic(fl); queryList.add(fl); } } @@ -160,68 +159,6 @@ public class CgDynamGraphController extends BaseController { } - /** - * 处理数据字典 - * @param result 查询的结果集 - * @param beans 字段配置 - */ - @SuppressWarnings("unchecked") - private void dealDic(List> result, - List> beans) { - for(Map bean:beans){ - String dict_code = (String) bean.get(CgReportConstant.ITEM_DICCODE); - if(StringUtil.isEmpty(dict_code)){ - //不需要处理字典 - continue; - }else{ - List> dicDatas = queryDic(dict_code); - for(Map r:result){ - String value = String.valueOf(r.get(bean.get(CgReportConstant.ITEM_FIELDNAME))); - for(Map m:dicDatas){ - String typecode = String.valueOf(m.get("typecode")); - String typename = String.valueOf(m.get("typename")); - if(value.equalsIgnoreCase(typecode)){ - r.put(bean.get(CgReportConstant.ITEM_FIELDNAME),typename); - } - } - } - } - } - } - /** - * 处理取值表达式 - * @param result - * @param beans - */ - @SuppressWarnings("unchecked") - private void dealReplace(List> result, - List> beans){ - for(Map bean:beans){ - try{ - //获取取值表达式 - String replace = (String) bean.get(CgReportConstant.ITEM_REPLACE); - if(StringUtil.isEmpty(replace)){ - continue; - } - String[] groups = replace.split(","); - for(String g:groups){ - String[] items = g.split("_"); - String v = items[0];//逻辑判断值 - String txt = items[1];//要转换的文本 - for(Map r:result){ - String value = String.valueOf(r.get(bean.get(CgReportConstant.ITEM_FIELDNAME))); - if(value.equalsIgnoreCase(v)){ - r.put(bean.get(CgReportConstant.ITEM_FIELDNAME),txt); - } - } - } - }catch (Exception e) { - //这里出现异常原因是因为取值表达式不正确 - e.printStackTrace(); - throw new BusinessException("取值表达式不正确"); - } - } - } /** * 动态报表数据查询 * @param configId 配置id-code @@ -254,6 +191,9 @@ public class CgDynamGraphController extends BaseController { for(String param :paramList){ String value = request.getParameter(param); value = value==null?"":value; + + SqlInjectionUtil.filterContent(value); + querySql = querySql.replace("${"+param+"}", value); } }else{ @@ -285,8 +225,8 @@ public class CgDynamGraphController extends BaseController { size = cgDynamGraphService.countQueryByCgDynamGraphSql(querySql, queryparams); } - dealDic(result,items); - dealReplace(result,items); + cgReportService.dealDic(result,items); + cgReportService.dealReplace(result,items); response.setContentType("application/json"); response.setHeader("Cache-Control", "no-store"); PrintWriter writer = null; @@ -317,8 +257,8 @@ public class CgDynamGraphController extends BaseController { List params = null; Map reJson = new HashMap(); try{ - fields = getFields(sql, dbKey); - params = getSqlParams(sql); + fields = cgReportService.getFields(sql, dbKey); + params = cgReportService.getSqlParams(sql); }catch (Exception e) { e.printStackTrace(); String errorInfo = "解析失败!

失败原因:"; @@ -342,90 +282,4 @@ public class CgDynamGraphController extends BaseController { return reJson; } - private List getFields(String sql,String dbKey){ - List fields = null; - sql = getSql(sql); - if(StringUtils.isNotBlank(dbKey)){ - List> dataList=DynamicDBUtil.findList(dbKey,SqlUtil.jeecgCreatePageSql(dbKey,sql,null,1,1),null); - if(dataList.size()<1){ - throw new BusinessException("该报表sql没有数据"); - } - Set fieldsSet= dataList.get(0).keySet(); - fields = new ArrayList(fieldsSet); - }else{ - fields = cgDynamGraphService.getSqlFields(sql); - } - return fields; - } - - private String getSql(String sql){ - String regex = "\\$\\{\\w+\\}"; - Pattern p = Pattern.compile(regex); - Matcher m = p.matcher(sql); - while(m.find()){ - String whereParam = m.group(); - //System.out.println(whereParam); - sql = sql.replace(whereParam, "'' or 1=1 or 1=''"); - sql = sql.replace("'''", "''"); - //System.out.println(sql); - } - //兼容图表 - regex = "\\{\\w+\\}"; - p = Pattern.compile(regex); - m = p.matcher(sql); - while(m.find()){ - String whereParam = m.group(); - //System.out.println(whereParam); - sql = sql.replace(whereParam, " 1=1 "); - //System.out.println(sql); - } - return sql; - } - - public List getSqlParams(String sql) { - if(oConvertUtils.isEmpty(sql)){ - return null; - } - List params = new ArrayList(); - String regex = "\\$\\{\\w+\\}"; - - Pattern p = Pattern.compile(regex); - Matcher m = p.matcher(sql); - while(m.find()){ - String whereParam = m.group(); - params.add(whereParam.substring(whereParam.indexOf("{")+1,whereParam.indexOf("}"))); - } - return params; - } - - - /** - * 装载数据字典 - * @param m 要放入freemarker的数据 - * @param bean 读取出来的动态配置数据 - */ - @SuppressWarnings("unchecked") - private void loadDic(Map m, Map cgDynamGraphMap) { - String dict_code = (String) cgDynamGraphMap.get("dict_code"); - if(StringUtil.isEmpty(dict_code)){ - m.put(CgReportConstant.FIELD_DICTLIST, new ArrayList(0)); - return; - } - List> dicDatas = queryDic(dict_code); - m.put(CgReportConstant.FIELD_DICTLIST, dicDatas); - } - /** - * 查询数据字典 - * @param diccode 字典编码 - * @return - */ - private List> queryDic(String diccode) { - StringBuilder dicSql = new StringBuilder(); - dicSql.append(" SELECT TYPECODE,TYPENAME FROM"); - dicSql.append(" "+CgReportConstant.SYS_DIC); - dicSql.append(" "+"WHERE TYPEGROUPID = "); - dicSql.append(" "+"(SELECT ID FROM "+CgReportConstant.SYS_DICGROUP+" WHERE TYPEGROUPCODE = '"+diccode+"' )"); - List> dicDatas = cgDynamGraphService.findForJdbc(dicSql.toString()); - return dicDatas; - } } diff --git a/jeecg-framework/src/main/java/org/jeecgframework/web/cgdynamgraph/engine/core/cgDynamGraphDesign.ftl b/jeecg-framework/src/main/java/org/jeecgframework/web/cgdynamgraph/engine/core/cgDynamGraphDesign.ftl index dc44b719..c8986651 100644 --- a/jeecg-framework/src/main/java/org/jeecgframework/web/cgdynamgraph/engine/core/cgDynamGraphDesign.ftl +++ b/jeecg-framework/src/main/java/org/jeecgframework/web/cgdynamgraph/engine/core/cgDynamGraphDesign.ftl @@ -266,7 +266,7 @@ <#if x['search_mode']=="single"> <#if (x['field_dictlist']?size >0)> - + <#list x['field_dictlist'] as xd> diff --git a/jeecg-framework/src/main/java/org/jeecgframework/web/cgform/engine/tag/ExpTag.java b/jeecg-framework/src/main/java/org/jeecgframework/web/cgform/engine/tag/ExpTag.java new file mode 100644 index 00000000..153fa0a3 --- /dev/null +++ b/jeecg-framework/src/main/java/org/jeecgframework/web/cgform/engine/tag/ExpTag.java @@ -0,0 +1,91 @@ +package org.jeecgframework.web.cgform.engine.tag; + +import java.io.IOException; +import java.io.Writer; +import java.util.Map; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Component; + +import freemarker.core.Environment; +import freemarker.template.TemplateDirectiveBody; +import freemarker.template.TemplateDirectiveModel; +import freemarker.template.TemplateException; +import freemarker.template.TemplateModel; +import freemarker.template.TemplateModelException; +import freemarker.template.TemplateScalarModel; + +/** + * 自定义Online自定义按钮 + * 使用方法 :<@exp exp='${x['exp']}' data='name' > + * @author gj_shaojc + * + */ +@Component("expTag") +public class ExpTag implements TemplateDirectiveModel { + + private static final Logger LOG = LoggerFactory.getLogger(ExpTag.class); + + public void execute(Environment env, Map params, TemplateModel[] loopVars, + TemplateDirectiveBody body) throws TemplateException, IOException { + + String exp = getAttribute(params, "exp"); + String data = getAttribute(params, "data"); + if (exp == null||data == null) { + throw new TemplateException( + "Can not find attribute 'name' in data tag", env); + } + StringBuilder resexp=new StringBuilder(); + String[] ShowbyFields = exp.split("&&"); + for (String ShowbyField : ShowbyFields) { + int beginIndex = ShowbyField.indexOf("#"); + int endIndex = ShowbyField.lastIndexOf("#"); + String exptype = ShowbyField.substring(beginIndex + 1, endIndex);// 表达式类型 + String field = ShowbyField.substring(0, beginIndex);// 判断显示依据字段 + String[] values = ShowbyField.substring(endIndex + 1, ShowbyField.length()).split(",");// 传入字段值 + String value = ""; + for (int i = 0; i < values.length; i++) { + value += "'" + "" + values[i] + "" + "'"; + if (i < values.length - 1) { + value += ","; + } + } + if ("eq".equals(exptype)) { + resexp.append("$.inArray("+data+"." + field + ",[" + value + "])>=0"); + } + if ("ne".equals(exptype)) { + resexp.append("$.inArray("+data+"." + field + ",[" + value + "])<0"); + } + if ("empty".equals(exptype) && value.equals("'true'")) { + resexp.append(""+data+"." + field + "==''"); + } + if ("empty".equals(exptype) && value.equals("'false'")) { + resexp.append(""+data+"." + field + "!=''"); + } + } + Writer out = env.getOut(); + out.append(resexp); + } + + /** + * 取得标签参数 + * + * @param params + * @param name + * @return + */ + @SuppressWarnings("unchecked") + private String getAttribute(Map params, String name) { + String value = null; + if (params.containsKey(name)) { + TemplateModel paramValue = (TemplateModel) params.get(name); + try { + value = ((TemplateScalarModel) paramValue).getAsString(); + } catch (TemplateModelException e) { + LOG.error("get attribute '{}' error", name, e); + } + } + return value; + } +} diff --git a/jeecg-framework/src/main/java/org/jeecgframework/web/cgform/interceptors/CgFormVersionInterceptor.java b/jeecg-framework/src/main/java/org/jeecgframework/web/cgform/interceptors/CgFormVersionInterceptor.java index 327efe1f..8e4c2dc2 100644 --- a/jeecg-framework/src/main/java/org/jeecgframework/web/cgform/interceptors/CgFormVersionInterceptor.java +++ b/jeecg-framework/src/main/java/org/jeecgframework/web/cgform/interceptors/CgFormVersionInterceptor.java @@ -30,7 +30,7 @@ public class CgFormVersionInterceptor implements HandlerInterceptor { public void afterCompletion(HttpServletRequest arg0, HttpServletResponse arg1, Object arg2, Exception arg3) throws Exception { - String requestPath = ResourceUtil.getRequestPath(arg0);// 用户访问的资源地址 + String requestPath = ResourceUtil.getJgAuthRequsetPath(arg0);// 用户访问的资源地址 if(!includeUrls.contains(requestPath)){ return; } diff --git a/jeecg-framework/src/main/java/org/jeecgframework/web/cgform/service/impl/build/DataBaseServiceImpl.java b/jeecg-framework/src/main/java/org/jeecgframework/web/cgform/service/impl/build/DataBaseServiceImpl.java index 683cfe23..8830d38d 100644 --- a/jeecg-framework/src/main/java/org/jeecgframework/web/cgform/service/impl/build/DataBaseServiceImpl.java +++ b/jeecg-framework/src/main/java/org/jeecgframework/web/cgform/service/impl/build/DataBaseServiceImpl.java @@ -17,6 +17,7 @@ import org.jeecgframework.core.util.DBTypeUtil; import org.jeecgframework.core.util.DateUtils; import org.jeecgframework.core.util.MyClassLoader; import org.jeecgframework.core.util.ResourceUtil; +import org.jeecgframework.core.util.SqlInjectionUtil; import org.jeecgframework.core.util.StringUtil; import org.jeecgframework.core.util.UUIDGenerator; import org.jeecgframework.core.util.oConvertUtils; @@ -131,6 +132,9 @@ public class DataBaseServiceImpl extends CommonServiceImpl implements DataBaseSe * @param data 数据 */ private Map dataAdapter(String tableName,Map data) { + + SqlInjectionUtil.filterContent(tableName); + //step.1 获取表单的字段配置 Map fieldConfigs =cgFormFieldService.getAllCgFormFieldByTableName(tableName); //step.2 迭代将要持久化的数据 @@ -235,11 +239,14 @@ public class DataBaseServiceImpl extends CommonServiceImpl implements DataBaseSe } } - if(id instanceof java.lang.String){ - sqlBuffer.append(" where id='").append(id).append("'"); - }else{ - sqlBuffer.append(" where id=").append(id); - } +// if(id instanceof java.lang.String){ +// sqlBuffer.append(" where id='").append(id).append("'"); +// }else{ +// sqlBuffer.append(" where id=").append(id); +// } + sqlBuffer.append(" where id=:id"); + data.put("id", id); + CgFormHeadEntity cgFormHeadEntity = cgFormFieldService.getCgFormHeadByTableName(tableName); int num = this.executeSql(sqlBuffer.toString(), data); @@ -263,6 +270,9 @@ public class DataBaseServiceImpl extends CommonServiceImpl implements DataBaseSe */ public Map findOneForJdbc(String tableName, String id) { + + SqlInjectionUtil.filterContent(tableName); + StringBuffer sqlBuffer = new StringBuffer(); sqlBuffer.append("select * from ").append(tableName); sqlBuffer.append(" where id= ? "); @@ -570,6 +580,9 @@ public class DataBaseServiceImpl extends CommonServiceImpl implements DataBaseSe */ private void deleteSubTableDataById(Object subId,String subTableName){ StringBuilder sql = new StringBuilder(""); + + SqlInjectionUtil.filterContent(subTableName); + sql.append(" delete from ").append(subTableName).append(" where id = ? "); this.executeSql(sql.toString(), subId); @@ -644,7 +657,6 @@ public class DataBaseServiceImpl extends CommonServiceImpl implements DataBaseSe ||getAllFieldByTableName(tableName).containsKey(DataBaseConstant.SYS_USER_CODE_TABLE)){ data.put(DataBaseConstant.SYS_USER_CODE_TABLE, ResourceUtil.getUserSystemData(DataBaseConstant.SYS_USER_CODE)); } - //--author:scott---begin------date:20170725--------for: 流程状态赋予默认值---------- if(data.containsKey(DataBaseConstant.BPM_STATUS_TABLE) ||getAllFieldByTableName(tableName).containsKey(DataBaseConstant.BPM_STATUS_TABLE)){ data.put(DataBaseConstant.BPM_STATUS_TABLE, ResourceUtil.getUserSystemData(DataBaseConstant.BPM_STATUS_TABLE)); @@ -738,12 +750,14 @@ public class DataBaseServiceImpl extends CommonServiceImpl implements DataBaseSe public CgformEnhanceJavaEntity getCgformEnhanceJavaEntityByCodeFormId(String buttonCode, String formId) { StringBuilder hql = new StringBuilder(""); hql.append(" from CgformEnhanceJavaEntity t"); - hql.append(" where t.formId='").append(formId).append("'"); - hql.append(" and t.buttonCode ='").append(buttonCode).append("'"); + + hql.append(" where t.formId=?"); + hql.append(" and t.buttonCode =?"); hql.append(" and t.activeStatus ='1'"); - List list = this.findHql(hql.toString()); + List list = this.findHql(hql.toString(),formId,buttonCode); + if(list!=null&&list.size()>0){ return list.get(0); } @@ -753,8 +767,8 @@ public class DataBaseServiceImpl extends CommonServiceImpl implements DataBaseSe public List getCgformEnhanceJavaEntityByFormId( String formId) { StringBuilder hql = new StringBuilder(""); hql.append(" from CgformEnhanceJavaEntity t"); - hql.append(" where t.formId='").append(formId).append("'"); - List list = this.findHql(hql.toString()); + hql.append(" where t.formId=?"); + List list = this.findHql(hql.toString(),formId); return list; } diff --git a/jeecg-framework/src/main/java/org/jeecgframework/web/cgform/service/impl/button/CgformButtonServiceImpl.java b/jeecg-framework/src/main/java/org/jeecgframework/web/cgform/service/impl/button/CgformButtonServiceImpl.java index a4fc584e..e9777fcd 100644 --- a/jeecg-framework/src/main/java/org/jeecgframework/web/cgform/service/impl/button/CgformButtonServiceImpl.java +++ b/jeecg-framework/src/main/java/org/jeecgframework/web/cgform/service/impl/button/CgformButtonServiceImpl.java @@ -36,12 +36,17 @@ public class CgformButtonServiceImpl extends CommonServiceImpl implements Cgform public List checkCgformButton(CgformButtonEntity cgformButtonEntity) { StringBuilder hql = new StringBuilder(""); hql.append(" from CgformButtonEntity t"); - hql.append(" where t.formId='").append(cgformButtonEntity.getFormId()).append("'"); - hql.append(" and t.buttonCode ='").append(cgformButtonEntity.getButtonCode()).append("'"); + + hql.append(" where t.formId=?"); + hql.append(" and t.buttonCode =?"); + List list = null; if(cgformButtonEntity.getId()!=null){ - hql.append(" and t.id !='").append(cgformButtonEntity.getId()).append("'"); + hql.append(" and t.id !=?"); + list = this.findHql(hql.toString(),cgformButtonEntity.getFormId(),cgformButtonEntity.getButtonCode(),cgformButtonEntity.getId()); + }else{ + list = this.findHql(hql.toString(),cgformButtonEntity.getFormId(),cgformButtonEntity.getButtonCode()); } - List list = this.findHql(hql.toString()); + return list; } diff --git a/jeecg-framework/src/main/java/org/jeecgframework/web/cgform/service/impl/button/CgformButtonSqlServiceImpl.java b/jeecg-framework/src/main/java/org/jeecgframework/web/cgform/service/impl/button/CgformButtonSqlServiceImpl.java index ebbf00db..78d5aa4f 100644 --- a/jeecg-framework/src/main/java/org/jeecgframework/web/cgform/service/impl/button/CgformButtonSqlServiceImpl.java +++ b/jeecg-framework/src/main/java/org/jeecgframework/web/cgform/service/impl/button/CgformButtonSqlServiceImpl.java @@ -23,12 +23,17 @@ public class CgformButtonSqlServiceImpl extends CommonServiceImpl implements Cgf CgformButtonSqlEntity cgformButtonSqlEntity) { StringBuilder hql = new StringBuilder(""); hql.append(" from CgformButtonSqlEntity t"); - hql.append(" where t.formId='").append(cgformButtonSqlEntity.getFormId()).append("'"); - hql.append(" and t.buttonCode ='").append(cgformButtonSqlEntity.getButtonCode()).append("'"); + + hql.append(" where t.formId=?"); + hql.append(" and t.buttonCode =?"); + List list = null; if(cgformButtonSqlEntity.getId()!=null){ - hql.append(" and t.id !='").append(cgformButtonSqlEntity.getId()).append("'"); + hql.append(" and t.id !=?"); + list = this.findHql(hql.toString(),cgformButtonSqlEntity.getFormId(),cgformButtonSqlEntity.getButtonCode(),cgformButtonSqlEntity.getId()); + }else{ + list = this.findHql(hql.toString(),cgformButtonSqlEntity.getFormId(),cgformButtonSqlEntity.getButtonCode()); } - List list = this.findHql(hql.toString()); + return list; } diff --git a/jeecg-framework/src/main/java/org/jeecgframework/web/cgform/service/impl/config/CgFormFieldServiceImpl.java b/jeecg-framework/src/main/java/org/jeecgframework/web/cgform/service/impl/config/CgFormFieldServiceImpl.java index e23ac585..618165de 100644 --- a/jeecg-framework/src/main/java/org/jeecgframework/web/cgform/service/impl/config/CgFormFieldServiceImpl.java +++ b/jeecg-framework/src/main/java/org/jeecgframework/web/cgform/service/impl/config/CgFormFieldServiceImpl.java @@ -19,6 +19,7 @@ import org.jeecgframework.core.common.service.impl.CommonServiceImpl; import org.jeecgframework.core.constant.Globals; import org.jeecgframework.core.util.ContextHolderUtils; import org.jeecgframework.core.util.MyBeanUtils; +import org.jeecgframework.core.util.SqlInjectionUtil; import org.jeecgframework.core.util.StringUtil; import org.jeecgframework.core.util.oConvertUtils; import org.jeecgframework.web.cgform.common.CgAutoListConstant; @@ -387,6 +388,8 @@ public class CgFormFieldServiceImpl extends CommonServiceImpl implements List> list = this.findForJdbc(sql1.toString(), subTableName, mainTableName); + SqlInjectionUtil.filterContent(subTableName); + StringBuilder sql2 = new StringBuilder(""); sql2.append("select sub.* from ").append(subTableName).append(" sub "); sql2.append(", ").append(mainTableName).append(" main "); diff --git a/jeecg-framework/src/main/java/org/jeecgframework/web/cgform/service/impl/config/DbTableServiceMysqlImpl.java b/jeecg-framework/src/main/java/org/jeecgframework/web/cgform/service/impl/config/DbTableServiceMysqlImpl.java index ee9f910b..8720ffe1 100644 --- a/jeecg-framework/src/main/java/org/jeecgframework/web/cgform/service/impl/config/DbTableServiceMysqlImpl.java +++ b/jeecg-framework/src/main/java/org/jeecgframework/web/cgform/service/impl/config/DbTableServiceMysqlImpl.java @@ -51,12 +51,12 @@ public class DbTableServiceMysqlImpl implements DbTableServiceI { return " DROP TABLE IF EXISTS "+tableProperty.getTableName()+" ;"; } - + @Deprecated public String updateTableSQL(CgFormHeadEntity cgFormHead, JdbcTemplate jdbcTemplate) { String sql = "select column_name,data_type,column_comment,numeric_precision,numeric_scale,character_maximum_length," + - "is_nullable nullable from information_schema.columns where table_name = '"+cgFormHead.getTableName()+"'and table_schema = '"+CodeResourceUtil.DATABASE_NAME+"';"; + "is_nullable nullable from information_schema.columns where table_name = ? and table_schema = ?;"; - Map fieldMap = DbTableUtil.getColumnMap(jdbcTemplate.queryForList(sql)); + Map fieldMap = DbTableUtil.getColumnMap(jdbcTemplate.queryForList(sql,cgFormHead.getTableName(),CodeResourceUtil.DATABASE_NAME)); StringBuilder sb = new StringBuilder(); sb.append(createChangeTableSql(cgFormHead)); CgFormFieldEntity column,agoColumn = null; diff --git a/jeecg-framework/src/main/java/org/jeecgframework/web/cgform/service/impl/config/util/ColumnMeta.java b/jeecg-framework/src/main/java/org/jeecgframework/web/cgform/service/impl/config/util/ColumnMeta.java index acc9ece3..e4487962 100644 --- a/jeecg-framework/src/main/java/org/jeecgframework/web/cgform/service/impl/config/util/ColumnMeta.java +++ b/jeecg-framework/src/main/java/org/jeecgframework/web/cgform/service/impl/config/util/ColumnMeta.java @@ -66,9 +66,11 @@ public class ColumnMeta { } }else{ if (colunmType.contains("date") || colunmType.contains("blob") || colunmType.contains("text")) { - return columnName.equals(meta.getColumnName()) + + return colunmType.equals(meta.getColunmType()) && columnName.equals(meta.getColumnName()) &&isNullable.equals(meta.isNullable) &&isEquals(comment,meta.getComment())&&isEquals(fieldDefault,meta.getFieldDefault()); + }else { return colunmType.equals(meta.getColunmType()) &&isNullable.equals(meta.isNullable)&&columnSize==meta.getColumnSize() diff --git a/jeecg-framework/src/main/java/org/jeecgframework/web/cgform/service/impl/config/util/ExtendJsonConvert.java b/jeecg-framework/src/main/java/org/jeecgframework/web/cgform/service/impl/config/util/ExtendJsonConvert.java index 811fde35..1212da68 100644 --- a/jeecg-framework/src/main/java/org/jeecgframework/web/cgform/service/impl/config/util/ExtendJsonConvert.java +++ b/jeecg-framework/src/main/java/org/jeecgframework/web/cgform/service/impl/config/util/ExtendJsonConvert.java @@ -94,9 +94,11 @@ public class ExtendJsonConvert { } re.append("\" "); } catch (Exception e) { + re.append(key+"="+"\""); - re.append(obj.get(key)+"\""); + re.append(obj.get(key)+"\" ");//为了正则匹配 加上空格 //re.append("\" "); + } } }catch (Exception e) { diff --git a/jeecg-framework/src/main/java/org/jeecgframework/web/cgform/service/impl/enhance/CgformEnhanceJavaServiceImpl.java b/jeecg-framework/src/main/java/org/jeecgframework/web/cgform/service/impl/enhance/CgformEnhanceJavaServiceImpl.java index 5282fd2d..92f73fb1 100644 --- a/jeecg-framework/src/main/java/org/jeecgframework/web/cgform/service/impl/enhance/CgformEnhanceJavaServiceImpl.java +++ b/jeecg-framework/src/main/java/org/jeecgframework/web/cgform/service/impl/enhance/CgformEnhanceJavaServiceImpl.java @@ -79,9 +79,11 @@ public class CgformEnhanceJavaServiceImpl extends CommonServiceImpl implements C String buttonCode, String formId) { StringBuilder hql = new StringBuilder(""); hql.append(" from CgformEnhanceJavaEntity t"); - hql.append(" where t.formId='").append(formId).append("'"); - hql.append(" and t.buttonCode ='").append(buttonCode).append("'"); - List list = this.findHql(hql.toString()); + + hql.append(" where t.formId=?"); + hql.append(" and t.buttonCode =?"); + List list = this.findHql(hql.toString(),formId,buttonCode); + if(list!=null&&list.size()>0){ return list.get(0); } @@ -93,12 +95,17 @@ public class CgformEnhanceJavaServiceImpl extends CommonServiceImpl implements C CgformEnhanceJavaEntity cgformEnhanceJavaEntity) { StringBuilder hql = new StringBuilder(""); hql.append(" from CgformEnhanceJavaEntity t"); - hql.append(" where t.formId='").append(cgformEnhanceJavaEntity.getFormId()).append("'"); - hql.append(" and t.buttonCode ='").append(cgformEnhanceJavaEntity.getButtonCode()).append("'"); + + hql.append(" where t.formId=?"); + hql.append(" and t.buttonCode =?"); + List list = null; if(cgformEnhanceJavaEntity.getId()!=null){ - hql.append(" and t.id !='").append(cgformEnhanceJavaEntity.getId()).append("'"); + hql.append(" and t.id !=?"); + list = this.findHql(hql.toString(),cgformEnhanceJavaEntity.getFormId(),cgformEnhanceJavaEntity.getButtonCode(),cgformEnhanceJavaEntity.getId()); + }else{ + list = this.findHql(hql.toString(),cgformEnhanceJavaEntity.getFormId(),cgformEnhanceJavaEntity.getButtonCode()); } - List list = this.findHql(hql.toString()); + return list; } diff --git a/jeecg-framework/src/main/java/org/jeecgframework/web/cgform/service/impl/enhance/CgformEnhanceJsServiceImpl.java b/jeecg-framework/src/main/java/org/jeecgframework/web/cgform/service/impl/enhance/CgformEnhanceJsServiceImpl.java index 47b1f6b4..b343a71f 100644 --- a/jeecg-framework/src/main/java/org/jeecgframework/web/cgform/service/impl/enhance/CgformEnhanceJsServiceImpl.java +++ b/jeecg-framework/src/main/java/org/jeecgframework/web/cgform/service/impl/enhance/CgformEnhanceJsServiceImpl.java @@ -23,9 +23,11 @@ public class CgformEnhanceJsServiceImpl extends CommonServiceImpl implements Cgf public CgformEnhanceJsEntity getCgformEnhanceJsByTypeFormId(String cgJsType, String formId) { StringBuilder hql = new StringBuilder(""); hql.append(" from CgformEnhanceJsEntity t"); - hql.append(" where t.formId='").append(formId).append("'"); - hql.append(" and t.cgJsType ='").append(cgJsType).append("'"); - List list = this.findHql(hql.toString()); + + hql.append(" where t.formId=?"); + hql.append(" and t.cgJsType =?"); + List list = this.findHql(hql.toString(),formId,cgJsType); + if(list!=null&&list.size()>0){ return list.get(0); } diff --git a/jeecg-framework/src/main/java/org/jeecgframework/web/cgform/service/impl/generate/TempletContextWord.java b/jeecg-framework/src/main/java/org/jeecgframework/web/cgform/service/impl/generate/TempletContextWord.java index f135ca66..e8013b99 100644 --- a/jeecg-framework/src/main/java/org/jeecgframework/web/cgform/service/impl/generate/TempletContextWord.java +++ b/jeecg-framework/src/main/java/org/jeecgframework/web/cgform/service/impl/generate/TempletContextWord.java @@ -47,6 +47,7 @@ public class TempletContextWord { private SystemService systemService; @Autowired private CgformFtlServiceI cgformFtlService; + @Resource(name = "freemarkerWord") private Configuration freemarker; diff --git a/jeecg-framework/src/main/java/org/jeecgframework/web/cgform/sql/config/CgFormVersionDao_getCgFormVersionById.sql b/jeecg-framework/src/main/java/org/jeecgframework/web/cgform/sql/config/CgFormVersionDao_getCgFormVersionById.sql index fb4e649c..3f960d5a 100644 --- a/jeecg-framework/src/main/java/org/jeecgframework/web/cgform/sql/config/CgFormVersionDao_getCgFormVersionById.sql +++ b/jeecg-framework/src/main/java/org/jeecgframework/web/cgform/sql/config/CgFormVersionDao_getCgFormVersionById.sql @@ -1,4 +1,4 @@ select jform_version from cgform_head -where id = '${id}' \ No newline at end of file +where id = :id \ No newline at end of file diff --git a/jeecg-framework/src/main/java/org/jeecgframework/web/cgform/sql/config/CgFormVersionDao_getCgFormVersionByTableName.sql b/jeecg-framework/src/main/java/org/jeecgframework/web/cgform/sql/config/CgFormVersionDao_getCgFormVersionByTableName.sql index dc18d50f..dc013bc0 100644 --- a/jeecg-framework/src/main/java/org/jeecgframework/web/cgform/sql/config/CgFormVersionDao_getCgFormVersionByTableName.sql +++ b/jeecg-framework/src/main/java/org/jeecgframework/web/cgform/sql/config/CgFormVersionDao_getCgFormVersionByTableName.sql @@ -1,4 +1,4 @@ select jform_version from cgform_head -where table_name = '${tableName}' \ No newline at end of file +where table_name = :tableName \ No newline at end of file diff --git a/jeecg-framework/src/main/java/org/jeecgframework/web/cgform/sql/config/CgFormVersionDao_updateVersion.sql b/jeecg-framework/src/main/java/org/jeecgframework/web/cgform/sql/config/CgFormVersionDao_updateVersion.sql index 2dceb641..068b6b57 100644 --- a/jeecg-framework/src/main/java/org/jeecgframework/web/cgform/sql/config/CgFormVersionDao_updateVersion.sql +++ b/jeecg-framework/src/main/java/org/jeecgframework/web/cgform/sql/config/CgFormVersionDao_updateVersion.sql @@ -1 +1 @@ -update cgform_head set jform_version = '${newVersion}' where id = '${formId}' \ No newline at end of file +update cgform_head set jform_version = :newVersion where id = :formId \ No newline at end of file diff --git a/jeecg-framework/src/main/java/org/jeecgframework/web/cgform/sql/upload/CgFormUploadDao_updateBackFileInfo.sql b/jeecg-framework/src/main/java/org/jeecgframework/web/cgform/sql/upload/CgFormUploadDao_updateBackFileInfo.sql index a962a2b6..e47f15c1 100644 --- a/jeecg-framework/src/main/java/org/jeecgframework/web/cgform/sql/upload/CgFormUploadDao_updateBackFileInfo.sql +++ b/jeecg-framework/src/main/java/org/jeecgframework/web/cgform/sql/upload/CgFormUploadDao_updateBackFileInfo.sql @@ -1 +1 @@ -update ${cgFormName} set ${cgFormField} = '${fileUrl}' where id='${cgFormId}' \ No newline at end of file +update ${cgFormName} set ${cgFormField} = :fileUrl where id= :cgFormId \ No newline at end of file diff --git a/jeecg-framework/src/main/java/org/jeecgframework/web/cgreport/controller/core/CgReportController.java b/jeecg-framework/src/main/java/org/jeecgframework/web/cgreport/controller/core/CgReportController.java index ddf75b25..34742b97 100644 --- a/jeecg-framework/src/main/java/org/jeecgframework/web/cgreport/controller/core/CgReportController.java +++ b/jeecg-framework/src/main/java/org/jeecgframework/web/cgreport/controller/core/CgReportController.java @@ -8,9 +8,6 @@ import java.util.HashMap; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -import java.util.Set; -import java.util.regex.Matcher; -import java.util.regex.Pattern; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @@ -18,7 +15,6 @@ import javax.servlet.http.HttpSession; import org.apache.commons.lang.StringUtils; import org.jeecgframework.core.common.controller.BaseController; -import org.jeecgframework.core.common.exception.BusinessException; import org.jeecgframework.core.enums.SysThemesEnum; import org.jeecgframework.core.online.def.CgReportConstant; import org.jeecgframework.core.online.exception.CgReportNotFoundException; @@ -26,14 +22,11 @@ import org.jeecgframework.core.online.util.CgReportQueryParamUtil; import org.jeecgframework.core.online.util.FreemarkerHelper; import org.jeecgframework.core.util.ContextHolderUtils; import org.jeecgframework.core.util.DynamicDBUtil; -import org.jeecgframework.core.util.MutiLangUtil; -import org.jeecgframework.core.util.ResourceUtil; +import org.jeecgframework.core.util.SqlInjectionUtil; import org.jeecgframework.core.util.SqlUtil; import org.jeecgframework.core.util.StringUtil; import org.jeecgframework.core.util.SysThemesUtil; -import org.jeecgframework.core.util.oConvertUtils; import org.jeecgframework.web.cgreport.service.core.CgReportServiceI; -import org.jeecgframework.web.system.pojo.base.TSType; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; @@ -184,7 +177,7 @@ public class CgReportController extends BaseController { fl.put(CgReportConstant.ITEM_FIELDNAME, ((String)fl.get(CgReportConstant.ITEM_FIELDNAME)).toLowerCase()); String isQuery = (String) fl.get(CgReportConstant.ITEM_ISQUERY); if(CgReportConstant.BOOL_TRUE.equalsIgnoreCase(isQuery)){ - loadDic(fl,fl); + cgReportService.loadDic(fl); queryList.add(fl); } } @@ -208,72 +201,6 @@ public class CgReportController extends BaseController { } - /** - * 处理数据字典 - * @param result 查询的结果集 - * @param beans 字段配置 - */ - @SuppressWarnings("unchecked") - private void dealDic(List> result, - List> beans) { - for(Map bean:beans){ - String dict_code = (String) bean.get(CgReportConstant.ITEM_DICCODE); - String field_name=bean.get(CgReportConstant.ITEM_FIELDNAME).toString(); - if(StringUtil.isEmpty(dict_code)){ - //不需要处理字典 - continue; - }else{ - -// List> dicDatas = queryDic(dict_code); - List dicDatas = ResourceUtil.allTypes.get(dict_code.toLowerCase()); - for(Map r:result){ - String value = String.valueOf(r.get(field_name)); - for(TSType m:dicDatas){ - String typecode = String.valueOf(m.getTypecode()); - if(value.equalsIgnoreCase(typecode)){ - String typename = String.valueOf(m.getTypename()); - r.put(bean.get(CgReportConstant.ITEM_FIELDNAME),MutiLangUtil.doMutiLang(typename, null)); - } - } - } - - } - } - } - /** - * 处理取值表达式 - * @param result - * @param beans - */ - @SuppressWarnings("unchecked") - private void dealReplace(List> result, - List> beans){ - for(Map bean:beans){ - try{ - //获取取值表达式 - String replace = (String) bean.get(CgReportConstant.ITEM_REPLACE); - if(StringUtil.isEmpty(replace)){ - continue; - } - String[] groups = replace.split(","); - for(String g:groups){ - String[] items = g.split("_"); - String v = items[0];//逻辑判断值 - String txt = items[1];//要转换的文本 - for(Map r:result){ - String value = String.valueOf(r.get(bean.get(CgReportConstant.ITEM_FIELDNAME))); - if(value.equalsIgnoreCase(v)){ - r.put(bean.get(CgReportConstant.ITEM_FIELDNAME),txt); - } - } - } - }catch (Exception e) { - //这里出现异常原因是因为取值表达式不正确 - e.printStackTrace(); - throw new BusinessException("取值表达式不正确"); - } - } - } /** * 动态报表数据查询 * @param configId 配置id-code @@ -306,6 +233,9 @@ public class CgReportController extends BaseController { for(String param :paramList){ String value = request.getParameter(param); value = value==null?"":value; + + SqlInjectionUtil.filterContent(value); + querySql = querySql.replace("${"+param+"}", value); } }else{ @@ -340,8 +270,8 @@ public class CgReportController extends BaseController { size = cgReportService.countQueryByCgReportSql(querySql, queryparams); } - dealDic(result,items); - dealReplace(result,items); + cgReportService.dealDic(result,items); + cgReportService.dealReplace(result,items); response.setContentType("application/json"); response.setHeader("Cache-Control", "no-store"); PrintWriter writer = null; @@ -372,8 +302,8 @@ public class CgReportController extends BaseController { List params = null; Map reJson = new HashMap(); try{ - fields = getFields(sql, dbKey); - params = getSqlParams(sql); + fields = cgReportService.getFields(sql, dbKey); + params = cgReportService.getSqlParams(sql); }catch (Exception e) { e.printStackTrace(); String errorInfo = "解析失败!

失败原因:"; @@ -397,90 +327,4 @@ public class CgReportController extends BaseController { return reJson; } - private List getFields(String sql,String dbKey){ - List fields = null; - sql = getSql(sql); - if(StringUtils.isNotBlank(dbKey)){ - List> dataList=DynamicDBUtil.findList(dbKey,SqlUtil.jeecgCreatePageSql(dbKey,sql,null,1,1),null); - if(dataList.size()<1){ - throw new BusinessException("该报表sql没有数据"); - } - Set fieldsSet= dataList.get(0).keySet(); - fields = new ArrayList(fieldsSet); - }else{ - fields = cgReportService.getSqlFields(sql); - } - return fields; - } - - private String getSql(String sql){ - String regex = "\\$\\{\\w+\\}"; - Pattern p = Pattern.compile(regex); - Matcher m = p.matcher(sql); - while(m.find()){ - String whereParam = m.group(); - //System.out.println(whereParam); - sql = sql.replace(whereParam, "'' or 1=1 or 1=''"); - sql = sql.replace("'''", "''"); - //System.out.println(sql); - } - //兼容图表 - regex = "\\{\\w+\\}"; - p = Pattern.compile(regex); - m = p.matcher(sql); - while(m.find()){ - String whereParam = m.group(); - //System.out.println(whereParam); - sql = sql.replace(whereParam, " 1=1 "); - //System.out.println(sql); - } - return sql; - } - - public List getSqlParams(String sql) { - if(oConvertUtils.isEmpty(sql)){ - return null; - } - List params = new ArrayList(); - String regex = "\\$\\{\\w+\\}"; - - Pattern p = Pattern.compile(regex); - Matcher m = p.matcher(sql); - while(m.find()){ - String whereParam = m.group(); - params.add(whereParam.substring(whereParam.indexOf("{")+1,whereParam.indexOf("}"))); - } - return params; - } - - - /** - * 装载数据字典 - * @param m 要放入freemarker的数据 - * @param bean 读取出来的动态配置数据 - */ - @SuppressWarnings("unchecked") - private void loadDic(Map m, Map cgReportMap) { - String dict_code = (String) cgReportMap.get("dict_code"); - if(StringUtil.isEmpty(dict_code)){ - m.put(CgReportConstant.FIELD_DICTLIST, new ArrayList(0)); - return; - } - List> dicDatas = queryDic(dict_code); - m.put(CgReportConstant.FIELD_DICTLIST, dicDatas); - } - /** - * 查询数据字典 - * @param diccode 字典编码 - * @return - */ - private List> queryDic(String diccode) { - StringBuilder dicSql = new StringBuilder(); - dicSql.append(" SELECT TYPECODE,TYPENAME FROM"); - dicSql.append(" "+CgReportConstant.SYS_DIC); - dicSql.append(" "+"WHERE TYPEGROUPID = "); - dicSql.append(" "+"(SELECT ID FROM "+CgReportConstant.SYS_DICGROUP+" WHERE TYPEGROUPCODE = '"+diccode+"' )"); - List> dicDatas = cgReportService.findForJdbc(dicSql.toString()); - return dicDatas; - } } diff --git a/jeecg-framework/src/main/java/org/jeecgframework/web/cgreport/engine/core/cgreportlist.ftl b/jeecg-framework/src/main/java/org/jeecgframework/web/cgreport/engine/core/cgreportlist.ftl index dfe5a32e..8432e2dd 100644 --- a/jeecg-framework/src/main/java/org/jeecgframework/web/cgreport/engine/core/cgreportlist.ftl +++ b/jeecg-framework/src/main/java/org/jeecgframework/web/cgreport/engine/core/cgreportlist.ftl @@ -109,7 +109,7 @@ $(function(){$('#${config_id}List').datagrid( <#if x['search_mode']=="single"> <#if (x['field_dictlist']?size >0)> - + <#list x['field_dictlist'] as xd> diff --git a/jeecg-framework/src/main/java/org/jeecgframework/web/cgreport/service/core/CgReportServiceI.java b/jeecg-framework/src/main/java/org/jeecgframework/web/cgreport/service/core/CgReportServiceI.java index 1215f4d8..4b0a7465 100644 --- a/jeecg-framework/src/main/java/org/jeecgframework/web/cgreport/service/core/CgReportServiceI.java +++ b/jeecg-framework/src/main/java/org/jeecgframework/web/cgreport/service/core/CgReportServiceI.java @@ -54,4 +54,26 @@ public interface CgReportServiceI extends CommonService{ * @return */ public List getSqlFields(String sql); + /** + * 解析sql字段,支持多数据源 + * @param sql + * @param dbKey + * @return + */ + public List getFields(String sql, String dbKey); + /** + * 解析sql参数 + * @param sql + * @return + */ + public List getSqlParams(String sql); + + /** + * 加载字典 + * @param fl + * @param fl2 + */ + public void loadDic(Map fl); + public void dealDic(List> result, List> items); + public void dealReplace(List> result, List> items); } diff --git a/jeecg-framework/src/main/java/org/jeecgframework/web/cgreport/service/impl/core/CgReportServiceImpl.java b/jeecg-framework/src/main/java/org/jeecgframework/web/cgreport/service/impl/core/CgReportServiceImpl.java index 0a5a3421..fe436f70 100644 --- a/jeecg-framework/src/main/java/org/jeecgframework/web/cgreport/service/impl/core/CgReportServiceImpl.java +++ b/jeecg-framework/src/main/java/org/jeecgframework/web/cgreport/service/impl/core/CgReportServiceImpl.java @@ -6,16 +6,23 @@ import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Set; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import org.apache.commons.lang.StringUtils; import org.jeecgframework.web.cgreport.dao.core.CgReportDao; import org.jeecgframework.web.cgreport.entity.core.CgreportConfigHeadEntity; import org.jeecgframework.web.cgreport.entity.core.CgreportConfigParamEntity; import org.jeecgframework.web.cgreport.service.core.CgReportServiceI; - +import org.jeecgframework.web.system.pojo.base.TSType; import org.jeecgframework.core.common.dao.jdbc.JdbcDao; import org.jeecgframework.core.common.exception.BusinessException; import org.jeecgframework.core.common.service.impl.CommonServiceImpl; import org.jeecgframework.core.online.def.CgReportConstant; +import org.jeecgframework.core.util.DynamicDBUtil; +import org.jeecgframework.core.util.MutiLangUtil; +import org.jeecgframework.core.util.ResourceUtil; +import org.jeecgframework.core.util.SqlUtil; import org.jeecgframework.core.util.StringUtil; import org.jeecgframework.core.util.oConvertUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -138,4 +145,199 @@ public class CgReportServiceImpl extends CommonServiceImpl implements List fileds = new ArrayList(fieldsSet); return fileds; } + + //------------------------------------------------------------------------------------------------------------ + /** + * 动态数据源: 获取SQL解析的字段 + */ + public List getFields(String sql,String dbKey){ + List fields = null; + sql = getSql(sql); + if(StringUtils.isNotBlank(dbKey)){ + List> dataList=DynamicDBUtil.findList(dbKey,SqlUtil.jeecgCreatePageSql(dbKey,sql,null,1,1),null); + if(dataList.size()<1){ + throw new BusinessException("该报表sql没有数据"); + } + Set fieldsSet= dataList.get(0).keySet(); + fields = new ArrayList(fieldsSet); + }else{ + fields = this.getSqlFields(sql); + } + return fields; + } + + /** + * 过滤非法sql规则,降低sql注入风险 + * @param sql + * @return + */ + private String getSql(String sql){ + String regex = "\\$\\{\\w+\\}"; + Pattern p = Pattern.compile(regex); + Matcher m = p.matcher(sql); + while(m.find()){ + String whereParam = m.group(); + //System.out.println(whereParam); + sql = sql.replace(whereParam, "'' or 1=1 or 1=''"); + sql = sql.replace("'''", "''"); + //System.out.println(sql); + } + //兼容图表 + regex = "\\{\\w+\\}"; + p = Pattern.compile(regex); + m = p.matcher(sql); + while(m.find()){ + String whereParam = m.group(); + //System.out.println(whereParam); + sql = sql.replace(whereParam, " 1=1 "); + //System.out.println(sql); + } + return sql; + } + + /** + * 解析SQL参数 + */ + public List getSqlParams(String sql) { + if(oConvertUtils.isEmpty(sql)){ + return null; + } + List params = new ArrayList(); + String regex = "\\$\\{\\w+\\}"; + + Pattern p = Pattern.compile(regex); + Matcher m = p.matcher(sql); + while(m.find()){ + String whereParam = m.group(); + params.add(whereParam.substring(whereParam.indexOf("{")+1,whereParam.indexOf("}"))); + } + return params; + } + + + /** + * 装载数据字典 + * @param m 要放入freemarker的数据 + * @param bean 读取出来的动态配置数据 + */ + public void loadDic(Map m) { + String dict_code = (String) m.get("dict_code"); + if(StringUtil.isEmpty(dict_code)){ + m.put(CgReportConstant.FIELD_DICTLIST, new ArrayList(0)); + return; + } + List> dicDatas = queryDicBySQL(dict_code); + m.put(CgReportConstant.FIELD_DICTLIST, dicDatas); + } + + /** + * 查询数据字典,扩展了对SQL的支持 + * @param dictCodeOrSQL 字典编码或SQL + * @author bit 2014-4-19 + */ + private List> queryDicBySQL(String dictCodeOrSQL) { + List> dicDatas = null; + dictCodeOrSQL = dictCodeOrSQL.trim(); + if(dictCodeOrSQL.toLowerCase().startsWith("select ")) { + + dictCodeOrSQL = dictCodeOrSQL.replaceAll("'[kK][eE][yY]'", "typecode").replaceAll("'[vV][aA][lL][uU][eE]'", "typename"); + + dicDatas = this.findForJdbc(dictCodeOrSQL); + }else { + dicDatas = queryDic(dictCodeOrSQL); + } + return dicDatas; + } + + + /** + * 查询数据字典 + * @param diccode 字典编码 + * @return + */ + private List> queryDic(String diccode) { + + List> dicDatas = new ArrayList>(); + List tstypes = ResourceUtil.allTypes.get(diccode.toLowerCase()); + for(TSType t:tstypes){ + Map mp = new HashMap(); + mp.put("typecode",t.getTypecode()); + mp.put("typename",MutiLangUtil.doMutiLang(t.getTypename(), null)); + dicDatas.add(mp); + } +// StringBuilder dicSql = new StringBuilder(); +// dicSql.append(" SELECT TYPECODE,TYPENAME FROM"); +// dicSql.append(" "+CgReportConstant.SYS_DIC); +// dicSql.append(" "+"WHERE TYPEGROUPID = "); +// dicSql.append(" "+"(SELECT ID FROM "+CgReportConstant.SYS_DICGROUP+" WHERE TYPEGROUPCODE = ? )"); +// List> dicDatas = cgReportService.findForJdbc(dicSql.toString(),diccode); + + return dicDatas; + } + + /** + * 处理取值表达式 + * @param result + * @param beans + */ + @SuppressWarnings("unchecked") + public void dealReplace(List> result,List> beans){ + for(Map bean:beans){ + try{ + //获取取值表达式 + String replace = (String) bean.get(CgReportConstant.ITEM_REPLACE); + if(StringUtil.isEmpty(replace)){ + continue; + } + String[] groups = replace.split(","); + for(String g:groups){ + String[] items = g.split("_"); + String v = items[0];//逻辑判断值 + String txt = items[1];//要转换的文本 + for(Map r:result){ + String value = String.valueOf(r.get(bean.get(CgReportConstant.ITEM_FIELDNAME))); + if(value.equalsIgnoreCase(v)){ + r.put(bean.get(CgReportConstant.ITEM_FIELDNAME),txt); + } + } + } + }catch (Exception e) { + //这里出现异常原因是因为取值表达式不正确 + e.printStackTrace(); + throw new BusinessException("取值表达式不正确"); + } + } + } + + /** + * 装载数据字典 + * @param result 查询的结果集 + * @param beans 字段配置 + */ + @SuppressWarnings("unchecked") + public void dealDic(List> result,List> beans) { + for(Map bean:beans){ + String dict_code = (String) bean.get(CgReportConstant.ITEM_DICCODE); + String field_name=bean.get(CgReportConstant.ITEM_FIELDNAME).toString(); + if(StringUtil.isEmpty(dict_code)){ + //不需要处理字典 + continue; + }else{ + + List> dicDatas = queryDicBySQL(dict_code); + for(Map r:result){ + String value = String.valueOf(r.get(field_name)); + for(Map m:dicDatas){ + String typecode = String.valueOf(m.get("typecode")); + String typename = String.valueOf(m.get("typename")); + if(value.equalsIgnoreCase(typecode)){ + r.put(bean.get(CgReportConstant.ITEM_FIELDNAME),typename); + } + } + } + + } + } + } + //------------------------------------------------------------------------------------------------------------ } diff --git a/jeecg-framework/src/main/java/org/jeecgframework/web/cgreport/sql/core/CgReportDao_queryCgReportItems.sql b/jeecg-framework/src/main/java/org/jeecgframework/web/cgreport/sql/core/CgReportDao_queryCgReportItems.sql index 2207eb23..489925c1 100644 --- a/jeecg-framework/src/main/java/org/jeecgframework/web/cgreport/sql/core/CgReportDao_queryCgReportItems.sql +++ b/jeecg-framework/src/main/java/org/jeecgframework/web/cgreport/sql/core/CgReportDao_queryCgReportItems.sql @@ -13,5 +13,5 @@ ci.cgrhead_id as cgreport_head_id from jform_cgreport_item ci,jform_cgreport_head ch where 1=1 and ci.cgrhead_id = ch.id -and ch.code = '${configId}' +and ch.code =:configId order by ci.order_num asc \ No newline at end of file diff --git a/jeecg-framework/src/main/java/org/jeecgframework/web/cgreport/sql/core/CgReportDao_queryCgReportMainConfig.sql b/jeecg-framework/src/main/java/org/jeecgframework/web/cgreport/sql/core/CgReportDao_queryCgReportMainConfig.sql index f883e0fb..c79696dc 100644 --- a/jeecg-framework/src/main/java/org/jeecgframework/web/cgreport/sql/core/CgReportDao_queryCgReportMainConfig.sql +++ b/jeecg-framework/src/main/java/org/jeecgframework/web/cgreport/sql/core/CgReportDao_queryCgReportMainConfig.sql @@ -7,4 +7,4 @@ ch.content as content, ch.db_source, ch.pop_retype from jform_cgreport_head ch -where ch.code = '${id}' \ No newline at end of file +where ch.code =:id \ No newline at end of file diff --git a/jeecg-framework/src/main/java/org/jeecgframework/web/graphreport/controller/GraphReportController.java b/jeecg-framework/src/main/java/org/jeecgframework/web/graphreport/controller/GraphReportController.java index 972222f4..016fe6b4 100644 --- a/jeecg-framework/src/main/java/org/jeecgframework/web/graphreport/controller/GraphReportController.java +++ b/jeecg-framework/src/main/java/org/jeecgframework/web/graphreport/controller/GraphReportController.java @@ -11,14 +11,16 @@ import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import java.util.Set; + import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; + import org.apache.poi.hssf.usermodel.HSSFWorkbook; +import org.jeecgframework.web.cgreport.service.core.CgReportServiceI; import org.jeecgframework.web.graphreport.service.core.GraphReportServiceI; import org.jeecgframework.web.system.service.SystemService; import org.jeecgframework.core.common.controller.BaseController; -import org.jeecgframework.core.common.exception.BusinessException; import org.jeecgframework.core.common.service.CommonExcelServiceI; import org.jeecgframework.core.enums.SysThemesEnum; import org.jeecgframework.core.online.def.CgReportConstant; @@ -49,6 +51,8 @@ public class GraphReportController extends BaseController { @Autowired private GraphReportServiceI graphReportService; @Autowired + private CgReportServiceI cgReportService; + @Autowired private SystemService systemService; @Autowired private CommonExcelServiceI cgReportExcelService; @@ -191,7 +195,7 @@ public class GraphReportController extends BaseController { fl.put(CgReportConstant.ITEM_FIELDNAME, ((String)fl.get(CgReportConstant.ITEM_FIELDNAME)).toLowerCase()); String isQuery = (String) fl.get(CgReportConstant.ITEM_ISQUERY); if(CgReportConstant.BOOL_TRUE.equalsIgnoreCase(isQuery)){ - loadDic(fl,fl); + cgReportService.loadDic(fl); queryList.add(fl); } if("y".equals(fl.get("is_graph")) || "Y".equals(fl.get("is_graph"))) { @@ -212,89 +216,7 @@ public class GraphReportController extends BaseController { } - /** - * 处理数据字典 - * @param result 查询的结果集 - * @param beans 字段配置 - */ - @SuppressWarnings("unchecked") - private void dealDic(List> result, - List> beans) { - for(Map bean:beans){ - String dict_code = (String) bean.get(CgReportConstant.ITEM_DICCODE); - if(StringUtil.isEmpty(dict_code)){ - //不需要处理字典 - continue; - }else{ - List> dicDatas = queryDicBySQL(dict_code); - - for(Map r:result){ - String value = String.valueOf(r.get(bean.get(CgReportConstant.ITEM_FIELDNAME))); - for(Map m:dicDatas){ - String typecode = String.valueOf(m.get("typecode")); - String typename = String.valueOf(m.get("typename")); - if(value.equalsIgnoreCase(typecode)){ - r.put(bean.get(CgReportConstant.ITEM_FIELDNAME),typename); - } - } - } - } - } - } - - /** - * 查询数据字典,扩展了对SQL的支持 - * @param dictCodeOrSQL 字典编码或SQL - * @author bit 2014-4-19 - */ - private List> queryDicBySQL(String dictCodeOrSQL) { - List> dicDatas = null; - dictCodeOrSQL = dictCodeOrSQL.trim(); - if(dictCodeOrSQL.toLowerCase().startsWith("select ")) { - - dictCodeOrSQL = dictCodeOrSQL.replaceAll("'[kK][eE][yY]'", "typecode").replaceAll("'[vV][aA][lL][uU][eE]'", "typename"); - - dicDatas = systemService.findForJdbc(dictCodeOrSQL, null); - }else { - dicDatas = queryDic(dictCodeOrSQL); - } - return dicDatas; - } - /** - * 处理取值表达式 - * @param result - * @param beans - */ - @SuppressWarnings("unchecked") - private void dealReplace(List> result, - List> beans){ - for(Map bean:beans){ - try{ - //获取取值表达式 - String replace = (String) bean.get(CgReportConstant.ITEM_REPLACE); - if(StringUtil.isEmpty(replace)){ - continue; - } - String[] groups = replace.split(","); - for(String g:groups){ - String[] items = g.split("_"); - String v = items[0];//逻辑判断值 - String txt = items[1];//要转换的文本 - for(Map r:result){ - String value = String.valueOf(r.get(bean.get(CgReportConstant.ITEM_FIELDNAME))); - if(value.equalsIgnoreCase(v)){ - r.put(bean.get(CgReportConstant.ITEM_FIELDNAME),txt); - } - } - } - }catch (Exception e) { - //这里出现异常原因是因为取值表达式不正确 - e.printStackTrace(); - throw new BusinessException("取值表达式不正确"); - } - } - } /** * 动态报表数据查询(不分页) * @param configId 配置id-code @@ -330,8 +252,8 @@ public class GraphReportController extends BaseController { } //step.4 进行查询返回结果 List> result= graphReportService.queryByCgReportSql(querySql, queryparams, -1, -1); - dealDic(result,items); - dealReplace(result,items); + cgReportService.dealDic(result,items); + cgReportService.dealReplace(result,items); //导出execel List fields = new ArrayList(); @@ -402,8 +324,8 @@ public class GraphReportController extends BaseController { int r = rows==null?99999:Integer.parseInt(rows); List> result= graphReportService.queryByCgReportSql(querySql, queryparams, p, r); long size = graphReportService.countQueryByCgReportSql(querySql, queryparams); - dealDic(result,items); - dealReplace(result,items); + cgReportService.dealDic(result,items); + cgReportService.dealReplace(result,items); response.setContentType("application/json"); response.setHeader("Cache-Control", "no-store"); PrintWriter writer = null; @@ -446,35 +368,7 @@ public class GraphReportController extends BaseController { reJson.put("datas", result); return reJson; } - /** - * 装载数据字典 - * @param m 要放入freemarker的数据 - * @param bean 读取出来的动态配置数据 - */ - @SuppressWarnings("unchecked") - private void loadDic(Map m, Map cgReportMap) { - String dict_code = (String) cgReportMap.get("dict_code"); - if(StringUtil.isEmpty(dict_code)){ - m.put(CgReportConstant.FIELD_DICTLIST, new ArrayList(0)); - return; - } - List> dicDatas = queryDicBySQL(dict_code); - m.put(CgReportConstant.FIELD_DICTLIST, dicDatas); - } - /** - * 查询数据字典 - * @param diccode 字典编码 - * @return - */ - private List> queryDic(String diccode) { - StringBuilder dicSql = new StringBuilder(); - dicSql.append(" SELECT TYPECODE,TYPENAME FROM"); - dicSql.append(" "+CgReportConstant.SYS_DIC); - dicSql.append(" "+"WHERE TYPEGROUPID = "); - dicSql.append(" "+"(SELECT ID FROM "+CgReportConstant.SYS_DICGROUP+" WHERE TYPEGROUPCODE = '"+diccode+"' )"); - List> dicDatas = graphReportService.findForJdbc(dicSql.toString()); - return dicDatas; - } + /** * 导出execel diff --git a/jeecg-framework/src/main/java/org/jeecgframework/web/graphreport/engine/core/graphreportlist.ftl b/jeecg-framework/src/main/java/org/jeecgframework/web/graphreport/engine/core/graphreportlist.ftl index cadeec42..70fd7045 100644 --- a/jeecg-framework/src/main/java/org/jeecgframework/web/graphreport/engine/core/graphreportlist.ftl +++ b/jeecg-framework/src/main/java/org/jeecgframework/web/graphreport/engine/core/graphreportlist.ftl @@ -43,7 +43,7 @@ ${config_iframe} <#else> + <#-- update--end--Author:gj_shaojc Date:20180605 for:TASK #2767 【专题任务】element-ui 代码生成器遗留问题改造(问题5) --> @@ -23,37 +41,47 @@ <#if po.showType=='text'> - - - <#elseif po.showType=='textarea'> - - + <#elseif po.showType=='password'> - + <#elseif po.showType=='date'> - + <#elseif po.showType=='datetime'> - + <#elseif po.showType=='checkbox'> - + <#elseif po.showType=='select' || po.showType=='list' || po.showType=='radio'> - + - <#elseif po.showType=='file' || po.showType == 'image'> + <#-- update--begin--Author:gj_shaojc Date:20180605 for:TASK #2767 【专题任务】element-ui 代码生成器遗留问题改造(问题10) --> + <#elseif po.showType == 'image'> + + + 点击上传 + + + <#elseif po.showType=='file'> + <#-- update--end--Author:gj_shaojc Date:20180605 for:TASK #2767 【专题任务】element-ui 代码生成器遗留问题改造(问题10) --> <#else> - + + <#list pageAreatextColumns as po> + + <#if po.showType=='textarea'> + + + + <#elseif po.showType='umeditor'> + + + + + + @@ -167,22 +208,32 @@
- - - - - + + + - + + - - - - + + + + - + +<#if hasUEditor==true> + + + - - - - - + + + + + + + + <#-- update--begin-- Author:gj_shaojc Date:20180606 for:TASK #2767 【专题任务】element-ui 代码生成器遗留问题改造(问题9)--> + + + + <#-- update--end-- Author:gj_shaojc Date:20180606 for:TASK #2767 【专题任务】element-ui 代码生成器遗留问题改造(问题9)--> -
-
- - <@dgcol columns=columns noquery = "1"/> - - - -
-
- - - \ No newline at end of file diff --git a/jeecg-framework/src/main/resources/jeecg/ext-common-template/multitable/onetomany/webapp/webpage/${bussiPackage}/${entityPackage}/${entityNameUncapFirst}-list.jspi b/jeecg-framework/src/main/resources/jeecg/ext-common-template/multitable/onetomany/webapp/webpage/${bussiPackage}/${entityPackage}/${entityNameUncapFirst}-list.jspi new file mode 100644 index 00000000..c7f7cabf --- /dev/null +++ b/jeecg-framework/src/main/resources/jeecg/ext-common-template/multitable/onetomany/webapp/webpage/${bussiPackage}/${entityPackage}/${entityNameUncapFirst}-list.jspi @@ -0,0 +1,96 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> +<%@include file="/context/mytags.jsp"%> +<#include "../../ui/tdgColcb.ftl"/> + + + +
+
+ + + + + + + <@dgcol columns=columns noquery = "1"/> + +
+
+ + + \ No newline at end of file diff --git a/jeecg-framework/src/main/resources/jeecg/ext-common-template/multitable/onetomany/webapp/webpage/${bussiPackage}/${entityPackage}/${entityNameUncapFirst}-update.jsp b/jeecg-framework/src/main/resources/jeecg/ext-common-template/multitable/onetomany/webapp/webpage/${bussiPackage}/${entityPackage}/${entityNameUncapFirst}-update.jspi similarity index 55% rename from jeecg-framework/src/main/resources/jeecg/ext-common-template/multitable/onetomany/webapp/webpage/${bussiPackage}/${entityPackage}/${entityNameUncapFirst}-update.jsp rename to jeecg-framework/src/main/resources/jeecg/ext-common-template/multitable/onetomany/webapp/webpage/${bussiPackage}/${entityPackage}/${entityNameUncapFirst}-update.jspi index 437759d0..16f8550f 100644 --- a/jeecg-framework/src/main/resources/jeecg/ext-common-template/multitable/onetomany/webapp/webpage/${bussiPackage}/${entityPackage}/${entityNameUncapFirst}-update.jsp +++ b/jeecg-framework/src/main/resources/jeecg/ext-common-template/multitable/onetomany/webapp/webpage/${bussiPackage}/${entityPackage}/${entityNameUncapFirst}-update.jspi @@ -20,33 +20,34 @@ ${ftl_description} - - - - + + + + - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + <#if callbackFlag == true> - - + + + - - - + + + - + - <#if callbackFlag == true> - - \ No newline at end of file diff --git a/jeecg-framework/src/main/resources/jeecg/ext-common-template/multitable/onetomany/webapp/webpage/${bussiPackage}/${entityPackage}/[1-n]sub-add.jsp b/jeecg-framework/src/main/resources/jeecg/ext-common-template/multitable/onetomany/webapp/webpage/${bussiPackage}/${entityPackage}/[1-n]sub-add.jspi similarity index 100% rename from jeecg-framework/src/main/resources/jeecg/ext-common-template/multitable/onetomany/webapp/webpage/${bussiPackage}/${entityPackage}/[1-n]sub-add.jsp rename to jeecg-framework/src/main/resources/jeecg/ext-common-template/multitable/onetomany/webapp/webpage/${bussiPackage}/${entityPackage}/[1-n]sub-add.jspi diff --git a/jeecg-framework/src/main/resources/jeecg/ext-common-template/multitable/onetomany/webapp/webpage/${bussiPackage}/${entityPackage}/[1-n]sub-list.jsp b/jeecg-framework/src/main/resources/jeecg/ext-common-template/multitable/onetomany/webapp/webpage/${bussiPackage}/${entityPackage}/[1-n]sub-list.jspi similarity index 100% rename from jeecg-framework/src/main/resources/jeecg/ext-common-template/multitable/onetomany/webapp/webpage/${bussiPackage}/${entityPackage}/[1-n]sub-list.jsp rename to jeecg-framework/src/main/resources/jeecg/ext-common-template/multitable/onetomany/webapp/webpage/${bussiPackage}/${entityPackage}/[1-n]sub-list.jspi diff --git a/jeecg-framework/src/main/resources/jeecg/ext-common-template/multitable/onetomany/webapp/webpage/${bussiPackage}/${entityPackage}/[1-n]sub-page-list.jsp b/jeecg-framework/src/main/resources/jeecg/ext-common-template/multitable/onetomany/webapp/webpage/${bussiPackage}/${entityPackage}/[1-n]sub-page-list.jspi similarity index 100% rename from jeecg-framework/src/main/resources/jeecg/ext-common-template/multitable/onetomany/webapp/webpage/${bussiPackage}/${entityPackage}/[1-n]sub-page-list.jsp rename to jeecg-framework/src/main/resources/jeecg/ext-common-template/multitable/onetomany/webapp/webpage/${bussiPackage}/${entityPackage}/[1-n]sub-page-list.jspi diff --git a/jeecg-framework/src/main/resources/jeecg/ext-common-template/multitable/onetomany/webapp/webpage/${bussiPackage}/${entityPackage}/[1-n]sub-update.jsp b/jeecg-framework/src/main/resources/jeecg/ext-common-template/multitable/onetomany/webapp/webpage/${bussiPackage}/${entityPackage}/[1-n]sub-update.jspi similarity index 100% rename from jeecg-framework/src/main/resources/jeecg/ext-common-template/multitable/onetomany/webapp/webpage/${bussiPackage}/${entityPackage}/[1-n]sub-update.jsp rename to jeecg-framework/src/main/resources/jeecg/ext-common-template/multitable/onetomany/webapp/webpage/${bussiPackage}/${entityPackage}/[1-n]sub-update.jspi diff --git a/jeecg-framework/src/main/resources/jeecg/ext-common-template/multitable/onetomany/webapp/webpage/${bussiPackage}/${entityPackage}/page-${entityNameUncapFirst}.jsp b/jeecg-framework/src/main/resources/jeecg/ext-common-template/multitable/onetomany/webapp/webpage/${bussiPackage}/${entityPackage}/page-${entityNameUncapFirst}.jspi similarity index 88% rename from jeecg-framework/src/main/resources/jeecg/ext-common-template/multitable/onetomany/webapp/webpage/${bussiPackage}/${entityPackage}/page-${entityNameUncapFirst}.jsp rename to jeecg-framework/src/main/resources/jeecg/ext-common-template/multitable/onetomany/webapp/webpage/${bussiPackage}/${entityPackage}/page-${entityNameUncapFirst}.jspi index 08e9fe63..3e4d2d27 100644 --- a/jeecg-framework/src/main/resources/jeecg/ext-common-template/multitable/onetomany/webapp/webpage/${bussiPackage}/${entityPackage}/page-${entityNameUncapFirst}.jsp +++ b/jeecg-framework/src/main/resources/jeecg/ext-common-template/multitable/onetomany/webapp/webpage/${bussiPackage}/${entityPackage}/page-${entityNameUncapFirst}.jspi @@ -35,18 +35,18 @@
${po.content}:
-
+ <#if po.showType=='file' || po.showType == 'image'> +
+ <#else> +
+ <#if po.showType=='textarea'> <#elseif po.showType=='file' || po.showType == 'image'> - <@uploadtag po = po opt = "update"/> + <@webuploadtag po = po defval="${'$'}{${entityName?uncap_first}Page.${po.fieldName}}"/> <#elseif po.showType='umeditor'> <#assign ue_widget_count = ue_widget_count + 1> - <#if ue_widget_count == 1> - - - - + @@ -95,10 +95,6 @@ <#elseif po.showType='umeditor'> <#assign ue_widget_count = ue_widget_count + 1> - <#if ue_widget_count == 1> - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + <#if callbackFlag == true> + + + + <#if subsG['${key}'].cgFormHead.isTree=='Y'> - +
- - <@dgcol columns=subColumnsMap['${key}'] noquery = "1"/> - - + + + + + + + <@dgcol columns=subColumnsMap['${key}'] noquery = "1"/>
- - + + \ No newline at end of file diff --git a/jeecg-framework/src/main/resources/jeecg/ext-common-template/multitable/onetomany/webapp/webpage/sub_page_list_one2many.ftl b/jeecg-framework/src/main/resources/jeecg/ext-common-template/multitable/onetomany/webapp/webpage/sub_page_list_one2many.ftl index fa0213a4..e23b9bff 100644 --- a/jeecg-framework/src/main/resources/jeecg/ext-common-template/multitable/onetomany/webapp/webpage/sub_page_list_one2many.ftl +++ b/jeecg-framework/src/main/resources/jeecg/ext-common-template/multitable/onetomany/webapp/webpage/sub_page_list_one2many.ftl @@ -3,6 +3,7 @@ <#include "/ui/datatype.ftl"/> <#include "/ui/dictInfo.ftl"/> <#include "/ui/formControl.ftl"/> +<#include "/ui/tag.ftl"/>
@@ -43,7 +44,6 @@ <#assign index = 0 > <#list subColumnsMap['${key}'] as po> <#if po.isShow=="Y"> - <#assign check = 0 > <#list subsG['${key}'].foreignKeys as key> <#if subFieldMeta[po.fieldName]==key?uncap_first> @@ -51,11 +51,10 @@ <#break> - <#if check==0> - - ${po.content} - + + ${po.content} + @@ -104,10 +103,8 @@
${'$'}{stuts.index+1 }
<#assign index = 0 > - <#-- update--begin--author:zhoujf Date:20180404 for:TASK #2600 【代码生成器一对多问题】一对多 子表 多行文本 和 UE编辑器控件字段 没有生成 --> <#list subColumnsMap['${key}'] as po> <#if po.isShow=="Y"> - <#-- update--end--author:zhoujf Date:20180404 for:TASK #2600 【代码生成器一对多问题】一对多 子表 多行文本 和 UE编辑器控件字段 没有生成 --> <#assign check = 0 > <#list subsG['${key}'].foreignKeys as key> <#if subFieldMeta[po.fieldName]==key?uncap_first> @@ -117,18 +114,7 @@ <#if check==0> - <#if po.showType=='file' || po.showType == 'image'> - - - - - - - 下载 - - <#else> - <@formControl po = po namepre="${subsG['${key}'].entityName?uncap_first}List[${'$'}{stuts.index}]." valuepre = "poVal."/> - + <@formControl po = po namepre="${subsG['${key}'].entityName?uncap_first}List[${'$'}{stuts.index}]." valuepre = "poVal."/> diff --git a/jeecg-framework/src/main/resources/jeecg/ext-common-template/multitable/onetomany/webapp/webpage/sub_page_list_one2one.ftl b/jeecg-framework/src/main/resources/jeecg/ext-common-template/multitable/onetomany/webapp/webpage/sub_page_list_one2one.ftl index 644d3d8a..e0b4cc80 100644 --- a/jeecg-framework/src/main/resources/jeecg/ext-common-template/multitable/onetomany/webapp/webpage/sub_page_list_one2one.ftl +++ b/jeecg-framework/src/main/resources/jeecg/ext-common-template/multitable/onetomany/webapp/webpage/sub_page_list_one2one.ftl @@ -3,6 +3,7 @@ <#include "/ui/datatype.ftl"/> <#include "/ui/dictInfo.ftl"/> <#include "/ui/formControl.ftl"/> +<#include "/ui/tag.ftl"/> - - - - - - - - - - - - - - - + + + + + + + + + + + + + + <#if callbackFlag == true> + + + + + + <#if subsG['${key}'].cgFormHead.isTree=='Y'> - + ' + ); + } + } + + /** + * create filter component + */ + function createFilter(frozen){ + var dc = state.dc; + var fields = $(target).datagrid('getColumnFields', frozen); + if (frozen && opts.rownumbers){ + fields.unshift('_'); + } + var table = (frozen?dc.header1:dc.header2).find('table.datagrid-htable'); + table.find('tr').each(function(){ + $(this).height($(this).height()); + }); + + // clear the old filter component + table.find('input.datagrid-filter').each(function(){ + if (this.filter.destroy){ + this.filter.destroy(this); + } + if (this.menu){ + $(this.menu).menu('destroy'); + } + }); + table.find('tr.datagrid-filter-row').remove(); + + var tr = $(''); + if (opts.filterPosition == 'bottom'){ + tr.appendTo(table.find('tbody')); + } else { + tr.prependTo(table.find('tbody')); + } + + for(var i=0; i').attr('field', field).appendTo(tr); + }else{ + var td = $('').attr('field', field).appendTo(tr); + } + if(col && col.field == 'opt'){ + + /*//$('
') + var tr_opt = $('
').appendTo(td); + var opt_a = $('') + .appendTo(tr_opt); + opt_a.bind("click",function(){ + resetQuery(target); + opt_a.closest("tr.datagrid-filter-row").remove(); + var tableRemove = (frozen?dc.header2:dc.header1).find('table.datagrid-htable'); + tableRemove.find("tr.datagrid-filter-row").remove(); + });*/ + continue; + } + //var td = $('').attr('field', field).appendTo(tr); + if (field == '_'){continue;} + + if(frozen){ + addColty(field); + } + var div = $('
').appendTo(td); + + var fopts = getFilter(field); + var type = fopts ? fopts.type : 'text'; + + if("no"==type){ + $('').appendTo(div); + continue; + } + + var filter = opts.filters[fopts ? fopts.type : 'text']; + var input = filter.init(div, fopts ? (fopts.options||{}) : {}); + input.addClass('datagrid-filter').attr('name', field); + input[0].filter = filter; + + if (fopts){ + //console.log("type="+type); + input[0].menu = createFilterButton(div, fopts.op); + if (fopts.options && fopts.options.onInit){ + fopts.options.onInit.call(input[0]); + } + } else if (type == 'text'){ + input.bind('keydown', function(e){ + var t = $(this); + /* if (this.timer){ + clearTimeout(this.timer); + }*/ + if (e.keyCode == 13){ + addFilterRule(target, { + field: t.attr('name'), + op: 'contains', + value: t.val() + }); + doFilter(target); + } + /* else { + this.timer = setTimeout(function(){ + addFilterRule(target, { + field: t.attr('name'), + op: 'contains', + value: t.val() + }); + doFilter(target); + }, opts.filterDelay); + }*/ + + + }); + } + + resizeFilter(target, field); + } + } + + function createFilterButton(container, operators){ + if (!operators){return null;} + + var btn = $(' ').addClass(opts.filterBtnIconCls); + if (opts.filterBtnPosition == 'right'){ + btn.appendTo(container); + } else { + btn.prependTo(container); + } + var menu = $('
').appendTo('body'); + menu.menu({ + alignTo:btn, + onClick:function(item){ + var btn = $(this).menu('options').alignTo; + var td = btn.closest('td[field]'); + var field = td.attr('field'); + var input = td.find('input.datagrid-filter'); + var value = input[0].filter.getValue(input); + + addFilterRule(target, { + field: field, + op: item.name, + value: value + }); + + doFilter(target); + } + }); + $.each(['nofilter'].concat(operators), function(index,item){ + var lang = opts.lang; + //console.log("var lang = opts.lang;"+lang) + var op ; + if(lang){ + op = opts.operators[lang][item]; + }else{ + op = opts.operators[item]; + } + if (op){ + menu.menu('appendItem', { + text: op.text, + name: item + }); + } + }); + btn.bind('click', {menu:menu}, function(e){ + $(e.data.menu).menu('show', { + left: e.pageX, + top: e.pageY + }); + return false; + }); + return menu; + } + + function getFilter(field){ + for(var i=0; i=0){ + oo={ + field:fieldkk, + type:'numberbox', + options:{precision:1}, + op:['equal','lessorequal','greaterorequal'] + }; + }else{ + oo={ + field:fieldkk, + type:'text', + options:{precision:1}, + op:['equal','contains'] + }; + } + + filterArr.push(oo); + }*/ + init(this, filters); + } + }); + }, + addFilterRule: function(jq, param){ + return jq.each(function(){ + addFilterRule(this, param); + }); + }, + removeFilterRule: function(jq, field){ + return jq.each(function(){ + removeFilterRule(this, field); + }); + }, + doFilter: function(jq){ + return jq.each(function(){ + doFilter(this); + }); + }, + getFilterComponent: function(jq, field){ + return getFilterComponent(jq[0], field); + } + }); +})(jQuery); diff --git a/jeecg-framework/src/main/webapp/plug-in/mutitables/datagrid.menu.css b/jeecg-framework/src/main/webapp/plug-in/mutitables/datagrid.menu.css new file mode 100644 index 00000000..a8067e12 --- /dev/null +++ b/jeecg-framework/src/main/webapp/plug-in/mutitables/datagrid.menu.css @@ -0,0 +1,188 @@ +.opts_menu_container { + float: left; + font-size: 12px; + /* left: 10px; + width:100px; */ + left:35%; + position: relative; + top: 1px; +} +div[class$='-optsMenu'] { + height: 31px !important; + width: 100px; + z-index: 2; + overflow: visible !important; +} +.datagrid-view td[field='optsMenu'],.datagrid-btable td[field='optsMenu'] { + overflow: visible !important; +} +div[class$='-opt'] { + height: 31px !important; + width: 100px; + z-index: 2; + overflow: visible !important; +} +.datagrid-view td[field='opt'],.datagrid-btable td[field='opt'] { + overflow: visible !important; +} +.optb-g{border:1px solid green;} +.optb-r{border:1px solid red;} +.optb-b{border:1px solid black;} +.opts_menu_btn { + display: inline-block; + height: 14px; + position: absolute; + /* left: 30px; */ + top: 7px; + margin-left:2px; + width: 14px; + z-index: 10000; + padding-bottom: 2px !important; +} +/* .btn-menu { + + box-shadow: inset 0 1px 0 rgba(255,255,255,0.2), 0 1px 2px rgba(0,0,0,0.05); + vertical-align: middle; + cursor: pointer; + background-color: #f5f5f5; + background-image: -webkit-gradient(linear,0 0,0 100%,from(#fff),to(#e6e6e6)); + background-image: -webkit-linear-gradient(top,#fff,#e6e6e6); + background-image: -o-linear-gradient(top,#fff,#e6e6e6); + background-image: linear-gradient(to bottom,#fff,#e6e6e6); + background-image: -moz-linear-gradient(top,#fff,#e6e6e6); + text-shadow: 0 1px 1px rgba(255,255,255,0.75); + margin-bottom: 0; + color: #07a695; + background-color: #fff; + border:1px solid #07a695; + text-align: center; + white-space: nowrap; + vertical-align: middle; + -ms-touch-action: manipulation; + touch-action: manipulation; + cursor: pointer; + border-radius: 4px; +} +.btn-menu:hover{ + background-color: #07A695; + border-color: #068577; + color: #fff; + font-weight:100; +} */ +.btn-menu { + box-shadow: inset 0 1px 0 rgba(255,255,255,0.2), 0 1px 2px rgba(0,0,0,0.05); + vertical-align: middle; + cursor: pointer; + text-shadow: 0 1px 1px rgba(255,255,255,0.75); + margin-bottom: 0; + /*color: #07a695; + background-color: #fff; + border:1px solid #07a695; */ + background-color:#fff; + color:#000; + text-align: center; + white-space: nowrap; + vertical-align: middle; + -ms-touch-action: manipulation; + touch-action: manipulation; + cursor: pointer; + border-radius: 4px; + padding: 1px; + margin-right:1px; + margin-top:1px; +} +.datagrid-row-over .btn-menu{ + background-color:#f5f5f5; +} +.datagrid-row-selected .btn-menu{ + background-color:#eeeeee; +} +.btn-menu:hover{ + background-color: #07A695; + border-color: #068577; + color: #fff; + font-weight:100; +} +a.btn-menu i.fa{ + padding:2px;font-size: 12px; +} +.opts_menu_box { + position: absolute; + top: -1px; + z-index: 1000; + /* background-color: #FFFFFF; */ + background-color: #f5f5f5; + border: 1px solid #dddddd; + border-radius: 4px; + box-shadow: 2px 2px 5px #969696; + padding-left:3px; + /* padding: 2px 4px; */ +} +.opts_menu_box ul { + list-style-type: none; + padding: 0; + white-space:nowrap; +} +.opts_menu_box ul li { + list-style-type: none; + padding: 0 4px; + display:inline; +} +/*li浮动使得ul*/ +ul{float:left;zoom:1;} +ul{overflow:hidden;zoom:1;} +ul, ol { + padding: 0; + margin: 0 0 0 0; +} + +.opts-menus-auto{ + display:inline-block; + *display:inline; + *zoom:1; + /*border:1px solid blue;*/ +} +a.menu-more { + background-position: 8px 25px !important; + font-size: 13px; + padding: 4px 6px 4px 6px; + /* padding: 4px 6px 4px 12px; */ + font-family: Microsoft YaHei,Microsoft JhengHei,STHeiti,MingLiu; +} +.opts_menu_box .fa, .opts_menu_box.button { + display: inline-block; + font-family: FontAwesome,Microsoft YaHei,Microsoft JhengHei,STHeiti,MingLiu!important; + font-style: normal; + font-weight: normal; + line-height: 1; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} + +.icon-opts-menu { + background:url('icons/bbx_black.png') no-repeat center center; +} +.icon-opts-menu-h { + background:url('icons/bbx_gray.png') no-repeat center center; +} +.icon-opts-menu:hover { + background:url('icons/bbx_gray.png') no-repeat center center; +} + +.datagrid-cell .opts-menus-parent{ +display: none; +} +.opt-menus{ +overflow:visible !important; +} +.datagrid-cell.opt-menus .opts-menus-parent{ +display:block; +} + +/* 过滤行菜单样式 */ +.filter-menu .menu-line{height:auto;} +/* 行新增操作列小图标 */ +a.cancel-row-btn{/* padding:0px 0px 3px 5px; */padding:1px 2px 1px 1px;} +.cancel-row-div{text-align:center;height:30px;line-height:30px;vertical-align:middle} +/* a.cancel-row-btn{font-size:1.2em;color:black;margin-lef:5px;} +a.cancel-row-btn:hover{color:#c8615d;} */ \ No newline at end of file diff --git a/jeecg-framework/src/main/webapp/plug-in/mutitables/jquery.resize.y.js b/jeecg-framework/src/main/webapp/plug-in/mutitables/jquery.resize.y.js new file mode 100644 index 00000000..8eee780f --- /dev/null +++ b/jeecg-framework/src/main/webapp/plug-in/mutitables/jquery.resize.y.js @@ -0,0 +1,51 @@ +/** + * 船舶拖动bug 自定义拖动JS + * @author 86729 + */ +$(function() { + $(document).mousemove(function(e) { + if (!!this.move) { + var callback = document.call_down; + callback.call(this, e); + } + }).mouseup(function(e) { + if (!!this.move) { + $("div.resize-iframe-shade").each(function() { + this.parentNode.removeChild(this); + }); + var callback = document.call_up || function(){}; + callback.call(this, e); + $.extend(this, { + 'move': false, + 'move_target': null, + 'call_down': false, + 'call_up': false + }); + } + }); + var resizeYiframeBorder = $('.resize-y-iframe > .resize-y-border'); + if(!resizeYiframeBorder || resizeYiframeBorder.length<=0){ + $('.resize-y-iframe').append("
"); + } + var $box = $('.resize-y-iframe').mousedown(function(e) { + var offset = $(this).offset(); + this.posix = {'y': e.pageY - offset.top}; + console.log("box mousedown:"+e.pageY +"--"+ offset.top); + $.extend(document, {'move': true, 'move_target': this}); + }).on('mousedown', '.resize-y-border', function(e) { + $box.append("
"); + //$box.find("iframe").css({position:"relative","z-index":-2}); + var posix = { + 'w': $box.width(), + 'h': $box.height(), + 'x': e.pageX, + 'y': e.pageY + }; + $.extend(document, {'move': true, 'call_down': function(e) { + $box.css({ + 'height': Math.max(30, e.pageY - posix.y + posix.h) + }); + }}); + return false; + }); +}); \ No newline at end of file diff --git a/jeecg-framework/src/main/webapp/plug-in/mutitables/mutitables.curdInIframe.js b/jeecg-framework/src/main/webapp/plug-in/mutitables/mutitables.curdInIframe.js index ef21f60b..a87ddfb9 100644 --- a/jeecg-framework/src/main/webapp/plug-in/mutitables/mutitables.curdInIframe.js +++ b/jeecg-framework/src/main/webapp/plug-in/mutitables/mutitables.curdInIframe.js @@ -22,6 +22,7 @@ var defaults = { isMain:false, isSeq:false, + queryCode:"", describe:"", name:"", form:{width:"",height:""}, @@ -31,7 +32,8 @@ detail:'', batchDel:'', saveRows:'', - excelImport:'' + excelImport:'', + deleteOne:'' }, afterRowEdit:function(index){} }; @@ -41,9 +43,9 @@ var dgthis = "#"+dgname; var methods = { - test:function(a){console.log(123+a);}, //激活tab加载子表数据 initListByMain:function (id,isDel){ + gridname = dgname; if(!isDel){ var tempv = $("#"+options.name+"ListMainId").val(); if(tempv==id){ @@ -97,19 +99,23 @@ options.form.width,options.form.height); }, //查FORM - detail:function(){ - var req = options.urls.detail; - if(!req){ - req = options.name+'Controller.do?goUpdate'; - } - detailPms('查看详情',req,dgname, - options.form.width,options.form.height); + detail:function(id,url){ + if(!isNaN(url)){ + //因为该函数会默认拼接一个index到参数中,故而此处判断是否是数字,是数字则走doDel + if(!options.urls.detail){ + url = options.name+'Controller.do?goUpdate'; + }else{ + url = options.urls.detail; + } + } + url +="&load=detail&id="+id; + createdetailwindow('查看详情',url,dgname,options.form.width,options.form.height); }, //批量删除 batchDel:function(){ - var ids = []; - var mainId = $("#"+options.name+"ListMainId").val(); - var rows = $(dgthis).datagrid('getSelections'); + // var ids = []; + //var mainId = $("#"+options.name+"ListMainId").val(); + //var rows = $(dgthis).datagrid('getSelections'); var req = options.urls.batchDel; if(!req){ req = options.name+'Controller.do?doBatchDel'; @@ -166,6 +172,27 @@ } saveData(req,dgname); }, + doFilterit:function(){ + if(typeof(eval(dgname+"Filter")) == "function"){ + eval(dgname+"Filter();"); + } + }, + deleteOne:function(id,url){ + if(!isNaN(url)){ + //因为该函数会默认拼接一个index到参数中,故而此处判断是否是数字,是数字则走doDel + if(!options.urls.deleteOne){ + url = options.name+'Controller.do?doDel'; + }else{ + url = options.urls.deleteOne; + } + } + if(!options.isMain){ + //如果不是主表 + delObjPms(id,url); + }else{ + deleteMainRecord(id,url); + } + }, //EXCEL导入 excelImport:function(){ var mainId =''; @@ -209,8 +236,13 @@ } ] }); - } - + }, + superQuery:function(){ + if(!!options.queryCode){ + eval(dgname+"SuperQuery").call(this,options.queryCode); + } + }, + test:function(a){console.log(123+a);} } return methods; } diff --git a/jeecg-framework/src/main/webapp/plug-in/mutitables/mutitables.mainpage.css b/jeecg-framework/src/main/webapp/plug-in/mutitables/mutitables.mainpage.css index 7186e691..13814c54 100644 --- a/jeecg-framework/src/main/webapp/plug-in/mutitables/mutitables.mainpage.css +++ b/jeecg-framework/src/main/webapp/plug-in/mutitables/mutitables.mainpage.css @@ -397,3 +397,24 @@ a span.accordion-collapse.accordion-expand:hover { /*---------------高级查询器---------------*/ #accDiv{border:0} #accDiv>.panel{border:1px solid #ddd;border-bottom:0} + +/*-----------拖动css-----------*/ +.resize-y-border{ + width: 100%; height:1px; + overflow: hidden; + cursor: n-resize; + position: absolute; + right: 0; + bottom: 3px; + background-color: #1ab394d6; +} +.resize-iframe-shade{ + z-index:100; + opacity: 0.1; + position:absolute; + top: 0;left: 0; + width:100%;height:100%; + background:#eee; + cursor: n-resize; +} +.resize-y-iframe{position: relative;} \ No newline at end of file diff --git a/jeecg-framework/src/main/webapp/plug-in/mutitables/mutitables.mainpage.js b/jeecg-framework/src/main/webapp/plug-in/mutitables/mutitables.mainpage.js index 4fc8d544..6cf7e18f 100644 --- a/jeecg-framework/src/main/webapp/plug-in/mutitables/mutitables.mainpage.js +++ b/jeecg-framework/src/main/webapp/plug-in/mutitables/mutitables.mainpage.js @@ -95,10 +95,10 @@ function iframeExportXls(mm){ function iframeFilter(mm){ if(mm==1){ - $("#mainList")[0].contentWindow.doFilterit(); + $("#mainList")[0].contentWindow.curd.doFilterit(); }else{ var listname = $("#mainPageFrameActived").val(); - $("#"+listname+"Iframe")[0].contentWindow.doFilterit(); + $("#"+listname+"Iframe")[0].contentWindow.curd.doFilterit(); } } //新增弹框 @@ -203,12 +203,26 @@ function scrollToEndit(){ } //宽度适应当前窗口 -function initdivwidth(){console.log(1); - var abc = parseInt(document.body.clientWidth)-17; +function initdivwidth(){ + var allw = document.body.clientWidth; + var abc = parseInt(allw)-17; $("#accDiv").css("width", abc); $("#tabsok").css("width", abc); $("#tab-menus-attached").css("width", abc); $("#tab-menus-main").css("width", abc); + + var singleWidth = 225; + var rowLen = Math.floor((allw-15)/singleWidth); + var alllen = $("#associated_query").find("span.query-item").length; + var lenOffset = Math.floor(alllen/rowLen); + $("#accDiv").accordion('getPanel',0).panel('resize',{height:lenOffset*30+100}); + var menu_top1 = (78+lenOffset*30)+"px",menu_top2 = '30px'; + $('#accDiv').children(".panel:first-child").children('.panel-header').click(function(){ + toggleMainMenusTop(menu_top1,menu_top2); + }); + $('#accDiv').children(".panel:first-child").find('.panel-tool a').click(function(){ + toggleMainMenusTop(menu_top1,menu_top2); + }); } /** @@ -341,8 +355,12 @@ function doAssociatedQuery(queryCode,dgname){ }); sqlbuildObj.children = childArr; sqlbuildArr.push(sqlbuildObj); - console.log(JSON.stringify(sqlbuildArr)+"---"+dgname); + //console.log(JSON.stringify(sqlbuildArr)+"---"+dgname); $("#mainList").contents().find("#_complexSqlbuilder").val(JSON.stringify(sqlbuildArr)); $("#mainList")[0].contentWindow[dgname+'search'].call(this); } +function superQuery(){ + $("#mainList")[0].contentWindow.curd.superQuery(); +} + diff --git a/jeecg-framework/src/main/webapp/plug-in/mutitables/mutitables.urd.js b/jeecg-framework/src/main/webapp/plug-in/mutitables/mutitables.urd.js index 22133526..abaf7a3a 100644 --- a/jeecg-framework/src/main/webapp/plug-in/mutitables/mutitables.urd.js +++ b/jeecg-framework/src/main/webapp/plug-in/mutitables/mutitables.urd.js @@ -19,13 +19,7 @@ function updatePms(title,url, id,width,height,isRestful) { } function detailPms(title,url, id,width,height) { - //var rowsData = $('#'+id).datagrid('getSelections'); var rowsData = $('#'+id).datagrid('getChecked'); -// if (rowData.id == '') { -// topWinTip('请选择查看项目'); -// return; -// } - if (!rowsData || rowsData.length == 0) { topWinTip('请选择查看项目'); return; @@ -46,8 +40,6 @@ function detailByMenu(title,url,dgname,width,height) { } function delObjPms(id,url){ //不带遮罩 - //var url = url+'&id='+id; - //createdialog('删除确认 ', '确定删除该记录吗 ?', url,dgname,1); deleteRecord(id,url) } function deleteMainRecord(id,url,index){ @@ -101,8 +93,8 @@ function deleteRecord(id,url,tip,flag){ */ function deleteALLSelectPms(confirm,url,gname,flag) { var ids = []; - // var rows = $("#"+gname).datagrid('getSelections'); - var rows = $("#"+gname).datagrid('getChecked'); + var rows = $("#"+gname).datagrid('getSelections'); + // var rows = $("#"+gname).datagrid('getChecked'); if (rows.length > 0) { $.dialog.setting.zIndex = getzIndex(true); if(!confirm){ @@ -263,6 +255,36 @@ function endEdit(gname){ } return true; } + +/*-------------------------------文件图片formatter---------------------------------------*/ +function formatterImg(value,rec,index){ + return listFileImgFormat(value,"image"); + } + + function formatterFile(value,rec,index){ + return listFileImgFormat(value); + } +//列表文件图片 列格式化方法 + function listFileImgFormat(value,type){ + var href=''; + if(value==null || value.length==0){ + return href; + } + var value1 = "systemController/showOrDownByurl.do?dbPath="+value; + if("image"==type){ + href+=""; + }else{ + if(value.indexOf(".jpg")>-1 || value.indexOf(".gif")>-1 || value.indexOf(".png")>-1){ + href+=""; + }else{ + var value2 = "systemController/showOrDownByurl.do?down=1&dbPath="+value; + href+="点击下载"; + } + } + return href; + } + /*-----------------------------------------------------------------------------*/ + /*---------------------------------自定义验证--------------------------------------------*/ $.extend($.fn.validatebox.defaults.rules,{ phoneRex: { @@ -292,7 +314,7 @@ function endEdit(gname){ },{ decimalTwo:{ validator: function(value){ - var rex= /^([1-9]\d{0,16})(\.\d{1,2})?$/; + var rex= /^([0-9]\d{0,16})(\.\d{1,2})?$/; if(rex.test(value)){ return true; }else{ diff --git a/jeecg-framework/src/main/webapp/plug-in/printthis/printThis.js b/jeecg-framework/src/main/webapp/plug-in/printthis/printThis.js new file mode 100644 index 00000000..b7dc8fda --- /dev/null +++ b/jeecg-framework/src/main/webapp/plug-in/printthis/printThis.js @@ -0,0 +1,286 @@ +/* + * printThis v1.12.3 + * @desc Printing plug-in for jQuery + * @author Jason Day + * + * Resources (based on) : + * jPrintArea: http://plugins.jquery.com/project/jPrintArea + * jqPrint: https://github.com/permanenttourist/jquery.jqprint + * Ben Nadal: http://www.bennadel.com/blog/1591-Ask-Ben-Print-Part-Of-A-Web-Page-With-jQuery.htm + * + * Licensed under the MIT licence: + * http://www.opensource.org/licenses/mit-license.php + * + * (c) Jason Day 2015 + * + * Usage: + * + * $("#mySelector").printThis({ + * debug: false, // show the iframe for debugging + * importCSS: true, // import page CSS + * importStyle: false, // import style tags + * printContainer: true, // grab outer container as well as the contents of the selector + * loadCSS: "path/to/my.css", // path to additional css file - us an array [] for multiple + * pageTitle: "", // add title to print page + * removeInline: false, // remove all inline styles from print elements + * printDelay: 333, // variable print delay + * header: null, // prefix to html + * footer: null, // postfix to html + * base: false, // preserve the BASE tag, or accept a string for the URL + * formValues: true, // preserve input/form values + * canvas: false, // copy canvas elements (experimental) + * doctypeString: '...', // enter a different doctype for older markup + * removeScripts: false, // remove script tags from print content + * copyTagClasses: false // copy classes from the html & body tag + * }); + * + * Notes: + * - the loadCSS will load additional css (with or without @media print) into the iframe, adjusting layout + */ +; +(function($) { + + function appendContent($el, content) { + if (!content) return; + + // Simple test for a jQuery element + $el.append(content.jquery ? content.clone() : content); + } + + function appendBody($body, $element, opt) { + // Clone for safety and convenience + // Calls clone(withDataAndEvents = true) to copy form values. + var $content = $element.clone(opt.formValues); + + if (opt.formValues) { + // Copy original select and textarea values to their cloned counterpart + // Makes up for inability to clone select and textarea values with clone(true) + copyValues($element, $content, 'select, textarea'); + } + + if (opt.removeScripts) { + $content.find('script').remove(); + } + + if (opt.printContainer) { + // grab $.selector as container + $content.appendTo($body); + } else { + // otherwise just print interior elements of container + $content.each(function() { + $(this).children().appendTo($body) + }); + } + } + + // Copies values from origin to clone for passed in elementSelector + function copyValues(origin, clone, elementSelector) { + var $originalElements = origin.find(elementSelector); + + clone.find(elementSelector).each(function(index, item) { + $(item).val($originalElements.eq(index).val()); + }); + } + + var opt; + $.fn.printThis = function(options) { + opt = $.extend({}, $.fn.printThis.defaults, options); + var $element = this instanceof jQuery ? this : $(this); + + var strFrameName = "printThis-" + (new Date()).getTime(); + + if (window.location.hostname !== document.domain && navigator.userAgent.match(/msie/i)) { + // Ugly IE hacks due to IE not inheriting document.domain from parent + // checks if document.domain is set by comparing the host name against document.domain + var iframeSrc = "javascript:document.write(\" + + + + + \ No newline at end of file diff --git a/jeecg-framework/src/main/webapp/webpage/com/jeecg/demo/form_webuploader.jsp b/jeecg-framework/src/main/webapp/webpage/com/jeecg/demo/form_webuploader.jsp new file mode 100644 index 00000000..9f27dcd8 --- /dev/null +++ b/jeecg-framework/src/main/webapp/webpage/com/jeecg/demo/form_webuploader.jsp @@ -0,0 +1,204 @@ +<%@ page language="java" import="java.util.*" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> +<%@include file="/context/mytags.jsp"%> + + + + +form_nature + + + + + + + + + +
+ 文件上传 +
+ +
+
+
+
选择文件
+
开始上传
+
+
+
+ +
+
+ +
+ + + \ No newline at end of file diff --git a/jeecg-framework/src/main/webapp/webpage/com/jeecg/demo/jeecgDemo-add.jsp b/jeecg-framework/src/main/webapp/webpage/com/jeecg/demo/jeecgDemo-add.jsp index 7d074c67..84124711 100644 --- a/jeecg-framework/src/main/webapp/webpage/com/jeecg/demo/jeecgDemo-add.jsp +++ b/jeecg-framework/src/main/webapp/webpage/com/jeecg/demo/jeecgDemo-add.jsp @@ -9,7 +9,7 @@ - +
@@ -147,7 +147,7 @@ @@ -161,7 +161,7 @@
- + - +
- + diff --git a/jeecg-framework/src/main/webapp/webpage/com/jeecg/demo/jeecgDemo-bootstrap-add.jsp b/jeecg-framework/src/main/webapp/webpage/com/jeecg/demo/jeecgDemo-bootstrap-add.jsp index 4ac6d761..0f08aefa 100644 --- a/jeecg-framework/src/main/webapp/webpage/com/jeecg/demo/jeecgDemo-bootstrap-add.jsp +++ b/jeecg-framework/src/main/webapp/webpage/com/jeecg/demo/jeecgDemo-bootstrap-add.jsp @@ -86,8 +86,8 @@ - + diff --git a/jeecg-framework/src/main/webapp/webpage/com/jeecg/demo/jeecgDemo-bootstrap-add2.jsp b/jeecg-framework/src/main/webapp/webpage/com/jeecg/demo/jeecgDemo-bootstrap-add2.jsp index aeb78db7..7c737d87 100644 --- a/jeecg-framework/src/main/webapp/webpage/com/jeecg/demo/jeecgDemo-bootstrap-add2.jsp +++ b/jeecg-framework/src/main/webapp/webpage/com/jeecg/demo/jeecgDemo-bootstrap-add2.jsp @@ -88,7 +88,7 @@ - + diff --git a/jeecg-framework/src/main/webapp/webpage/com/jeecg/demo/jeecgDemo-bootstrap-update.jsp b/jeecg-framework/src/main/webapp/webpage/com/jeecg/demo/jeecgDemo-bootstrap-update.jsp index ba0d70a2..00a06c7b 100644 --- a/jeecg-framework/src/main/webapp/webpage/com/jeecg/demo/jeecgDemo-bootstrap-update.jsp +++ b/jeecg-framework/src/main/webapp/webpage/com/jeecg/demo/jeecgDemo-bootstrap-update.jsp @@ -88,7 +88,7 @@ - + diff --git a/jeecg-framework/src/main/webapp/webpage/com/jeecg/demo/jeecgDemo-nature-ace-add.jsp b/jeecg-framework/src/main/webapp/webpage/com/jeecg/demo/jeecgDemo-nature-ace-add.jsp index 0c3022b9..57be100f 100644 --- a/jeecg-framework/src/main/webapp/webpage/com/jeecg/demo/jeecgDemo-nature-ace-add.jsp +++ b/jeecg-framework/src/main/webapp/webpage/com/jeecg/demo/jeecgDemo-nature-ace-add.jsp @@ -83,7 +83,7 @@
@@ -114,17 +114,6 @@
-
-
- 个人介绍: -
-
- - - -
-
- diff --git a/jeecg-framework/src/main/webapp/webpage/com/jeecg/demo/jeecgDemo-nature-ace-update.jsp b/jeecg-framework/src/main/webapp/webpage/com/jeecg/demo/jeecgDemo-nature-ace-update.jsp index 5629515a..88c00254 100644 --- a/jeecg-framework/src/main/webapp/webpage/com/jeecg/demo/jeecgDemo-nature-ace-update.jsp +++ b/jeecg-framework/src/main/webapp/webpage/com/jeecg/demo/jeecgDemo-nature-ace-update.jsp @@ -83,7 +83,7 @@
@@ -113,18 +113,6 @@
- -
-
- 个人介绍: -
-
- - - -
-
- diff --git a/jeecg-framework/src/main/webapp/webpage/com/jeecg/demo/jeecgDemo-print.jsp b/jeecg-framework/src/main/webapp/webpage/com/jeecg/demo/jeecgDemo-print.jsp index 15460970..d1e1645d 100644 --- a/jeecg-framework/src/main/webapp/webpage/com/jeecg/demo/jeecgDemo-print.jsp +++ b/jeecg-framework/src/main/webapp/webpage/com/jeecg/demo/jeecgDemo-print.jsp @@ -16,7 +16,8 @@ function printview(){ -
+
+ @@ -71,20 +72,6 @@ function printview(){ - <%-- - - - --%> -
- - - - -
打印 diff --git a/jeecg-framework/src/main/webapp/webpage/com/jeecg/demo/jeecgDemo-update.jsp b/jeecg-framework/src/main/webapp/webpage/com/jeecg/demo/jeecgDemo-update.jsp index fac06748..a9ad695f 100644 --- a/jeecg-framework/src/main/webapp/webpage/com/jeecg/demo/jeecgDemo-update.jsp +++ b/jeecg-framework/src/main/webapp/webpage/com/jeecg/demo/jeecgDemo-update.jsp @@ -9,7 +9,7 @@ - +
@@ -129,7 +129,7 @@ @@ -140,7 +140,7 @@ @@ -152,7 +152,7 @@
- + - +
- +
- + diff --git a/jeecg-framework/src/main/webapp/webpage/com/jeecg/demo/jeecgDemoList-multihead.jsp b/jeecg-framework/src/main/webapp/webpage/com/jeecg/demo/jeecgDemoList-multihead.jsp index 5d345e44..d1fe5b33 100644 --- a/jeecg-framework/src/main/webapp/webpage/com/jeecg/demo/jeecgDemoList-multihead.jsp +++ b/jeecg-framework/src/main/webapp/webpage/com/jeecg/demo/jeecgDemoList-multihead.jsp @@ -4,54 +4,32 @@
- + title="多表头列表" actionUrl="jeecgListDemoController.do?datagrid" idField="id" fit="true" queryMode="group"> + - - - + + + - + - + - + - - - - - - - - <%-- --%>
\ No newline at end of file diff --git a/jeecg-framework/src/main/webapp/webpage/com/jeecg/demo/jfromOrderGridViewList.jsp b/jeecg-framework/src/main/webapp/webpage/com/jeecg/demo/jfromOrderGridViewList.jsp new file mode 100644 index 00000000..f8a33f7a --- /dev/null +++ b/jeecg-framework/src/main/webapp/webpage/com/jeecg/demo/jfromOrderGridViewList.jsp @@ -0,0 +1,110 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> +<%@include file="/context/mytags.jsp"%> + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + \ No newline at end of file diff --git a/jeecg-framework/src/main/webapp/webpage/common/upload/mutitables_excel_upload.jsp b/jeecg-framework/src/main/webapp/webpage/common/upload/mutitables_excel_upload.jsp new file mode 100644 index 00000000..e5f75a04 --- /dev/null +++ b/jeecg-framework/src/main/webapp/webpage/common/upload/mutitables_excel_upload.jsp @@ -0,0 +1,69 @@ +<%@ page language="java" import="java.util.*" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> +<%@include file="/context/mytags.jsp"%> + + + +Excel导入 + + + + + +
+
+ +
+ +
+
+
+ + + + diff --git a/jeecg-framework/src/main/webapp/webpage/common/upload/swfView.jsp b/jeecg-framework/src/main/webapp/webpage/common/upload/swfView.jsp index dde8ead2..1a224c43 100644 --- a/jeecg-framework/src/main/webapp/webpage/common/upload/swfView.jsp +++ b/jeecg-framework/src/main/webapp/webpage/common/upload/swfView.jsp @@ -1,60 +1,91 @@ -<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> -<%@include file="/context/mytags.jsp"%> - - - -附件查看 - - - -
- - -
- - - - - - - - - - - - - - - - - - - - - +<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> +<%@include file="/context/mytags.jsp"%> + + + +附件查看 + + + + + + +
+ + +
+ + + + + + + + + + + + + + + + + + + + + diff --git a/jeecg-framework/src/main/webapp/webpage/com/jeecg/black/tsBlackList-add.jsp b/jeecg-framework/src/main/webapp/webpage/jeecg/black/tsBlackList-add.jsp similarity index 96% rename from jeecg-framework/src/main/webapp/webpage/com/jeecg/black/tsBlackList-add.jsp rename to jeecg-framework/src/main/webapp/webpage/jeecg/black/tsBlackList-add.jsp index 1fcde226..5929c83a 100644 --- a/jeecg-framework/src/main/webapp/webpage/com/jeecg/black/tsBlackList-add.jsp +++ b/jeecg-framework/src/main/webapp/webpage/jeecg/black/tsBlackList-add.jsp @@ -38,4 +38,4 @@
- + \ No newline at end of file diff --git a/jeecg-framework/src/main/webapp/webpage/com/jeecg/black/tsBlackList-update.jsp b/jeecg-framework/src/main/webapp/webpage/jeecg/black/tsBlackList-update.jsp similarity index 96% rename from jeecg-framework/src/main/webapp/webpage/com/jeecg/black/tsBlackList-update.jsp rename to jeecg-framework/src/main/webapp/webpage/jeecg/black/tsBlackList-update.jsp index c3c56687..430bf7dc 100644 --- a/jeecg-framework/src/main/webapp/webpage/com/jeecg/black/tsBlackList-update.jsp +++ b/jeecg-framework/src/main/webapp/webpage/jeecg/black/tsBlackList-update.jsp @@ -37,4 +37,4 @@
- + \ No newline at end of file diff --git a/jeecg-framework/src/main/webapp/webpage/com/jeecg/black/tsBlackListList.jsp b/jeecg-framework/src/main/webapp/webpage/jeecg/black/tsBlackListList.jsp similarity index 96% rename from jeecg-framework/src/main/webapp/webpage/com/jeecg/black/tsBlackListList.jsp rename to jeecg-framework/src/main/webapp/webpage/jeecg/black/tsBlackListList.jsp index 84cddb26..9eeaa5df 100644 --- a/jeecg-framework/src/main/webapp/webpage/com/jeecg/black/tsBlackListList.jsp +++ b/jeecg-framework/src/main/webapp/webpage/jeecg/black/tsBlackListList.jsp @@ -27,12 +27,7 @@
-
- @@ -15,7 +15,7 @@ - + diff --git a/jeecg-framework/src/main/webapp/webpage/jeecg/cgform/config/cgFormHeadList.jsp b/jeecg-framework/src/main/webapp/webpage/jeecg/cgform/config/cgFormHeadList.jsp index d96d93e1..c2ea5bff 100644 --- a/jeecg-framework/src/main/webapp/webpage/jeecg/cgform/config/cgFormHeadList.jsp +++ b/jeecg-framework/src/main/webapp/webpage/jeecg/cgform/config/cgFormHeadList.jsp @@ -32,7 +32,7 @@
- diff --git a/jeecg-framework/src/main/webapp/webpage/jeecg/cgform/fillrule/tSFillRule-add.jsp b/jeecg-framework/src/main/webapp/webpage/jeecg/cgform/fillrule/tSFillRule-add.jsp index cfa64f22..6587ae72 100644 --- a/jeecg-framework/src/main/webapp/webpage/jeecg/cgform/fillrule/tSFillRule-add.jsp +++ b/jeecg-framework/src/main/webapp/webpage/jeecg/cgform/fillrule/tSFillRule-add.jsp @@ -161,6 +161,4 @@ - \ No newline at end of file diff --git a/jeecg-framework/src/main/webapp/webpage/jeecg/cgform/fillrule/tSFillRule-update.jsp b/jeecg-framework/src/main/webapp/webpage/jeecg/cgform/fillrule/tSFillRule-update.jsp index 5e44dc86..19049f0d 100644 --- a/jeecg-framework/src/main/webapp/webpage/jeecg/cgform/fillrule/tSFillRule-update.jsp +++ b/jeecg-framework/src/main/webapp/webpage/jeecg/cgform/fillrule/tSFillRule-update.jsp @@ -136,5 +136,4 @@ - \ No newline at end of file diff --git a/jeecg-framework/src/main/webapp/webpage/jeecg/cgform/fillrule/tSFillRule.js b/jeecg-framework/src/main/webapp/webpage/jeecg/cgform/fillrule/tSFillRule.js deleted file mode 100644 index 3c340156..00000000 --- a/jeecg-framework/src/main/webapp/webpage/jeecg/cgform/fillrule/tSFillRule.js +++ /dev/null @@ -1,28 +0,0 @@ - - -//通用弹出式文件上传 -function commonUpload(callback){ - $.dialog({ - content: "url:systemController.do?commonUpload", - lock : true, - title:"文件上传", - zIndex:2100, - width:700, - height: 200, - parent:windowapi, - cache:false, - ok: function(){ - var iframe = this.iframe.contentWindow; - iframe.uploadCallback(callback); - return true; - }, - cancelVal: '关闭', - cancel: function(){ - } - }); -} -function decode(value, id) {//value传入值,id接受值 - var last = value.lastIndexOf("/"); - var filename = value.substring(last + 1, value.length); - $("#" + id).text(decodeURIComponent(filename)); -} \ No newline at end of file diff --git a/jeecg-framework/src/main/webapp/webpage/jeecg/cgform/fillrule/tSFillRuleList.jsp b/jeecg-framework/src/main/webapp/webpage/jeecg/cgform/fillrule/tSFillRuleList.jsp index 45605dfd..e5e9850b 100644 --- a/jeecg-framework/src/main/webapp/webpage/jeecg/cgform/fillrule/tSFillRuleList.jsp +++ b/jeecg-framework/src/main/webapp/webpage/jeecg/cgform/fillrule/tSFillRuleList.jsp @@ -30,7 +30,6 @@
- + +
- @@ -205,3 +206,4 @@
+
\ No newline at end of file diff --git a/jeecg-framework/src/main/webapp/webpage/jeecg/superquery/dialog.jsp b/jeecg-framework/src/main/webapp/webpage/jeecg/superquery/dialog.jsp new file mode 100644 index 00000000..9551009a --- /dev/null +++ b/jeecg-framework/src/main/webapp/webpage/jeecg/superquery/dialog.jsp @@ -0,0 +1,988 @@ +<%@ page language="java" import="java.util.*" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> +<%@include file="/context/mytags.jsp"%> + + + +高级查询 + + + + + + + + +
+ +
+
+
+
    + +
    +
    +
    + + +
    +
    +
    +
      + +
    • + + 过滤条件匹配: + + +
    • +
    • + +   + + + + + + + + + + + + + + + +
    • +
    +
    +
    +
    + + + +
    +
    编辑
    +
    删除
    +
    + + + + + + + + + + + +
    + + + + + + \ No newline at end of file diff --git a/jeecg-framework/src/main/webapp/webpage/com/jeecg/superquery/superQueryFieldList.jsp b/jeecg-framework/src/main/webapp/webpage/jeecg/superquery/superQueryFieldList.jsp similarity index 98% rename from jeecg-framework/src/main/webapp/webpage/com/jeecg/superquery/superQueryFieldList.jsp rename to jeecg-framework/src/main/webapp/webpage/jeecg/superquery/superQueryFieldList.jsp index 19b0f963..4edd2f14 100644 --- a/jeecg-framework/src/main/webapp/webpage/com/jeecg/superquery/superQueryFieldList.jsp +++ b/jeecg-framework/src/main/webapp/webpage/jeecg/superquery/superQueryFieldList.jsp @@ -88,7 +88,7 @@ <%-- --%> @@ -148,7 +148,7 @@ - + @@ -188,4 +188,4 @@ - + diff --git a/jeecg-framework/src/main/webapp/webpage/com/jeecg/superquery/superQueryMain-add.jsp b/jeecg-framework/src/main/webapp/webpage/jeecg/superquery/superQueryMain-add.jsp similarity index 98% rename from jeecg-framework/src/main/webapp/webpage/com/jeecg/superquery/superQueryMain-add.jsp rename to jeecg-framework/src/main/webapp/webpage/jeecg/superquery/superQueryMain-add.jsp index 7e4d4c20..ef5f0027 100644 --- a/jeecg-framework/src/main/webapp/webpage/com/jeecg/superquery/superQueryMain-add.jsp +++ b/jeecg-framework/src/main/webapp/webpage/jeecg/superquery/superQueryMain-add.jsp @@ -133,7 +133,7 @@ <%-- --%> @@ -170,4 +170,4 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/jeecg-framework/src/main/webapp/webpage/com/jeecg/superquery/superQueryMain-update.jsp b/jeecg-framework/src/main/webapp/webpage/jeecg/superquery/superQueryMain-update.jsp similarity index 98% rename from jeecg-framework/src/main/webapp/webpage/com/jeecg/superquery/superQueryMain-update.jsp rename to jeecg-framework/src/main/webapp/webpage/jeecg/superquery/superQueryMain-update.jsp index 175767fe..898f3f56 100644 --- a/jeecg-framework/src/main/webapp/webpage/com/jeecg/superquery/superQueryMain-update.jsp +++ b/jeecg-framework/src/main/webapp/webpage/jeecg/superquery/superQueryMain-update.jsp @@ -143,7 +143,7 @@ <%-- --%> @@ -179,4 +179,4 @@ - + diff --git a/jeecg-framework/src/main/webapp/webpage/com/jeecg/superquery/superQueryMain.js b/jeecg-framework/src/main/webapp/webpage/jeecg/superquery/superQueryMain.js similarity index 100% rename from jeecg-framework/src/main/webapp/webpage/com/jeecg/superquery/superQueryMain.js rename to jeecg-framework/src/main/webapp/webpage/jeecg/superquery/superQueryMain.js diff --git a/jeecg-framework/src/main/webapp/webpage/jeecg/superquery/superQueryMainList.js b/jeecg-framework/src/main/webapp/webpage/jeecg/superquery/superQueryMainList.js new file mode 100644 index 00000000..e69de29b diff --git a/jeecg-framework/src/main/webapp/webpage/com/jeecg/superquery/superQueryMainList.jsp b/jeecg-framework/src/main/webapp/webpage/jeecg/superquery/superQueryMainList.jsp similarity index 96% rename from jeecg-framework/src/main/webapp/webpage/com/jeecg/superquery/superQueryMainList.jsp rename to jeecg-framework/src/main/webapp/webpage/jeecg/superquery/superQueryMainList.jsp index e151ee25..df4e7cb1 100644 --- a/jeecg-framework/src/main/webapp/webpage/com/jeecg/superquery/superQueryMainList.jsp +++ b/jeecg-framework/src/main/webapp/webpage/jeecg/superquery/superQueryMainList.jsp @@ -78,7 +78,7 @@ textarea, input[type=text], input[type=password], select { - +
    \ No newline at end of file diff --git a/jeecg-framework/src/main/webapp/webpage/com/jeecg/superquery/superQueryTableList.jsp b/jeecg-framework/src/main/webapp/webpage/jeecg/superquery/superQueryTableList.jsp similarity index 99% rename from jeecg-framework/src/main/webapp/webpage/com/jeecg/superquery/superQueryTableList.jsp rename to jeecg-framework/src/main/webapp/webpage/jeecg/superquery/superQueryTableList.jsp index 47a5811e..67929798 100644 --- a/jeecg-framework/src/main/webapp/webpage/com/jeecg/superquery/superQueryTableList.jsp +++ b/jeecg-framework/src/main/webapp/webpage/jeecg/superquery/superQueryTableList.jsp @@ -161,4 +161,4 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/jeecg-framework/src/main/webapp/webpage/login/login-ace.js b/jeecg-framework/src/main/webapp/webpage/login/login-ace.js new file mode 100644 index 00000000..c43e1710 --- /dev/null +++ b/jeecg-framework/src/main/webapp/webpage/login/login-ace.js @@ -0,0 +1,186 @@ +var navigatorName = "Microsoft Internet Explorer"; + if( navigator.appName == navigatorName ){ + alert("IE浏览器采用传统首页风格,更佳体验建议使用Chrome浏览器!") + $.cookie('JEECGINDEXSTYLE', 'shortcut'); + } + +function reloadRandCodeImage() { + var date = new Date(); + var img = document.getElementById("randCodeImage"); + img.src='randCodeImage?a=' + date.getTime(); + } + + function darkStyle(){ + $('body').attr('class', 'login-layout'); + $('#id-text2').attr('class', 'red'); + $('#id-company-text').attr('class', 'blue'); + e.preventDefault(); + } + function lightStyle(){ + $('body').attr('class', 'login-layout light-login'); + $('#id-text2').attr('class', 'grey'); + $('#id-company-text').attr('class', 'blue'); + + e.preventDefault(); + } + function blurStyle(){ + $('body').attr('class', 'login-layout blur-login'); + $('#id-text2').attr('class', 'white'); + $('#id-company-text').attr('class', 'light-blue'); + e.preventDefault(); + } + //设置cookie + function setCookie() + { + // 记住登录用户名--- + if ($('#on_off').attr("checked")) { + $("input[iscookie='true']").each(function() { + $.cookie(this.name, $("#"+this.name).val(), "/",24); + $.cookie("COOKIE_NAME","true", "/",24); + }); + } else { + $("input[iscookie='true']").each(function() { + $.cookie(this.name,null); + $.cookie("COOKIE_NAME",null); + }); + } + } + //读取cookie + function getCookie() + { + var COOKIE_NAME=$.cookie("COOKIE_NAME"); + if (COOKIE_NAME !=null) { + $("input[iscookie='true']").each(function() { + $($("#"+this.name).val( $.cookie(this.name))); + if("admin" == $.cookie(this.name)) { + $("#randCode").focus(); + } else { + $("#password").val(""); + $("#password").focus(); + } + }); + $("#on_off").attr("checked", true); + $("#on_off").val("1"); + } + else + { + $("#on_off").attr("checked", false); + $("#on_off").val("0"); + $("#randCode").focus(); + } + } + + function optErrMsg(){ + $("#showErrMsg").html(''); + $("#errMsgContiner").hide(); + } + +//登录处理函数 + function newLogin(orgId) { + setCookie(); + var actionurl="loginController.do?login";//提交路径 + var checkurl="loginController.do?checkuser";//验证路径 + var formData = new Object(); + var data=$(":input").each(function() { + formData[this.name] =$("#"+this.name ).val(); + }); + formData['orgId'] = orgId ? orgId : ""; + //语言 + formData['langCode']=$("#langCode").val(); + formData['langCode'] = $("#langCode option:selected").val(); + $.ajax({ + async : false, + cache : false, + type : 'POST', + url : checkurl,// 请求的action路径 + data : formData, + error : function() {// 请求失败处理函数 + }, + success : function(data) { + var d = $.parseJSON(data); + if (d.success) { + if (d.attributes.orgNum > 1) { + //用户拥有多个部门,需选择部门进行登录 + var title, okButton; + if($("#langCode").val() == 'en') { + title = "Please select Org"; + okButton = "Ok"; + } else { + title = "请选择组织机构"; + okButton = "确定"; + } + $.dialog({ + id: 'LHG1976D', + title: title, + max: false, + min: false, + drag: false, + resize: false, + content: 'url:userController.do?userOrgSelect&userId=' + d.attributes.user.id, + lock:true, + button : [ { + name : okButton, + focus : true, + callback : function() { + iframe = this.iframe.contentWindow; + var orgId = $('#orgId', iframe.document).val(); + //---------------------------------------------------- + //变更采用ajax方式提高效率 + formData['orgId'] = orgId ? orgId : ""; + $.ajax({ + async : false, + cache : false, + type : 'POST', + url : 'loginController.do?changeDefaultOrg',// 请求的action路径 + data : formData, + error : function() {// 请求失败处理函数 + }, + success : function(data) { + window.location.href = actionurl; + } + }); + //---------------------------------------------------- + this.close(); + return false; + } + }], + close: function(){ + setTimeout("window.location.href='"+actionurl+"'", 10); + } + }); + } else { + window.location.href = actionurl; + } + } else { + showErrorMsg(d.msg); + if(d.msg === "用户名或密码错误" || d.msg === "验证码错误") + reloadRandCodeImage(); + } + } + }); + } + //登录提示消息显示 + function showErrorMsg(msg){ + $("#errMsgContiner").show(); + $("#showErrMsg").html(msg); + window.setTimeout(optErrMsg,3000); + } + + //表单验证 + function validForm(){ + if($.trim($("#userName").val()).length==0){ + showErrorMsg("请输入用户名"); + return false; + } + + if($.trim($("#password").val()).length==0){ + showErrorMsg("请输入密码"); + return false; + } + + if($.trim($("#randCode").val()).length==0){ + showErrorMsg("请输入验证码"); + return false; + } + return true; + } \ No newline at end of file diff --git a/jeecg-framework/src/main/webapp/webpage/login/login.jsp b/jeecg-framework/src/main/webapp/webpage/login/login.jsp index c1dfe8f2..689a4663 100644 --- a/jeecg-framework/src/main/webapp/webpage/login/login.jsp +++ b/jeecg-framework/src/main/webapp/webpage/login/login.jsp @@ -34,8 +34,6 @@ - -
    - +
    @@ -122,7 +117,7 @@
    -

    © JEECG版权所有 v_3.7.5-beta

    +

    © JEECG版权所有 v_3.7.6

    - - - + +<%=lhgdialogTheme %> -<%=lhgdialogTheme %> \ No newline at end of file diff --git a/jeecg-framework/src/main/webapp/webpage/main/acehome.jsp b/jeecg-framework/src/main/webapp/webpage/main/acehome.jsp index 7e370975..8405c6e8 100644 --- a/jeecg-framework/src/main/webapp/webpage/main/acehome.jsp +++ b/jeecg-framework/src/main/webapp/webpage/main/acehome.jsp @@ -47,7 +47,7 @@

    JEECG是一款基于代码生成器的J2EE快速开发平台,开源界“小普元”超越传统商业企业级开发平台。引领新的开发模式(Online Coding模式(自定义表单)->代码生成器模式->手工MERGE智能开发), 可以帮助解决Java项目60%的重复工作,让开发更多关注业务逻辑。既能快速提高开发效率,帮助公司节省人力成本,同时又不失灵活性。她可以用于所有的Web应用程序,如:MISCRMOAERPCMS网站后台微信管家,等等,当然,您也可以对她进行深度定制,以做出更强系统。

    - 当前版本:v_3.7.5-beta + 当前版本:v_3.7.6

    开源 免费 diff --git a/jeecg-framework/src/main/webapp/webpage/main/fineui_home.jsp b/jeecg-framework/src/main/webapp/webpage/main/fineui_home.jsp index 71f040e1..b6aa4007 100644 --- a/jeecg-framework/src/main/webapp/webpage/main/fineui_home.jsp +++ b/jeecg-framework/src/main/webapp/webpage/main/fineui_home.jsp @@ -177,7 +177,7 @@

    JEECG是一款基于代码生成器的J2EE快速开发平台,开源界“小普元”超越传统商业企业级开发平台。引领新的开发模式(Online Coding模式(自定义表单)->代码生成器模式->手工MERGE智能开发), 可以帮助解决Java项目60%的重复工作,让开发更多关注业务逻辑。既能快速提高开发效率,帮助公司节省人力成本,同时又不失灵活性。她可以用于所有的Web应用程序,如:MISCRMOAERPCMS网站后台微信管家,等等,当然,您也可以对她进行深度定制,以做出更强系统。

    - 当前版本:v_3.7.5-beta + 当前版本:v_3.7.6

    开源   |   免费 |   更多插件 @@ -439,10 +439,80 @@

    - v3.7.5-beta2018.05.17 + v3.7.62018.06.06
    -
    +
    +
    +
    此版本提供新一代风格代码生成器模板,采用Vue技术,提供两套精美模板 ElementUI风格、Bootstrap风格,追逐潮流技术支持移动端;
    +
      +
    1. 【功能升级】新一代 (单表/一对多) 代码生成器模板,Vue+ElementUI风格功能优化升级;
    2. +
    3. 【功能升级】新一代 (单表) 代码生成器模板,Bootstrap表单+EasyUI原生态列表风格功能优化升级;
    4. +
    5. 【功能升级】新一代 (一对多) 代码生成器模板,ElementUI表单+EasyUI原生态列表风格功能优化升级;
    6. +
    7. 【功能升级】新一代 (一对多) 代码生成器模板,EasyUI标签列表上下布局(列表数据编辑)+Table风格表单功能优化升级;
    8. +
    9. 【功能升级】牛牛叉功能 -> Datagrid标签升级,通过参数component可以快速实现BootstrapTable与easyUI列表风格切换功能优化升级;
    10. +
    11. 【功能升级】定时任务支持版本升级;
    12. +
    13. 【功能升级】定时任务,多个tomcat部署一台服务器的解决方案升级;
    14. +
    15. 【功能改造】新版代码生成器模板文件扩展名题处理,扩展名统一增加字母“i”;
    16. +
    17. 【功能改造】清理hplus/js/plugins下的插件;
    18. +
    19. 【功能改造】将不常改的js组件放进jar包 jeecg-plugin-in,减少eclipse check js;
    20. +
    21. 【功能改造】删除无用的代码,减少项目jar依赖;
    22. +
    23. 【功能改造】提示信息停留时间延长;
    24. +
    25. 【功能改造】防止SQL注入处理;
    26. +
    27. 【功能改造】druid扫描排除资源修改,durid数据源配置优化;
    28. +
    29. 【功能改造】权限拦截器重构优化
    30. +
    31. 【功能改造】重构登录逻辑;
    32. +
    33. 【功能改造】列表返回json进行gzip压缩,提高加载速度;
    34. +
    35. 【功能改造】在线清空用户登录权限缓存;
    36. +
    37. 【功能改造】重构redis缓存功能;
    38. +
    39. 【功能改造】在线文档预览效果优化;
    40. +
    41. 【功能改造】简化log4j12配置、highchart 图片导出依赖修改采用官仓;
    42. +
    43. 【功能改造】演示demo效果优化;
    44. +
    45. 【功能改造】jacob升级版本,采用官仓maven;
    46. +
    47. 【功能改造】重构online报表,通用方法抽取统一维护[解析字典支持缓存、解析SQL字段、解析SQL字段参数],优化UI效果;
    48. +
    49. 【功能改造】重构webupload上传功能;
    50. +
    51. 【功能改造】下拉默认请选择去掉,默认为空,美化页面效果;
    52. +
    53. 【功能改造】bootstrap-table表单,列表按钮图标样式和ace,hplus保持统一;
    54. +
    55. 【Demo】boostrap报表布局,嵌套多个报表示例;
    56. +
    57. 【BUG】ElemetUI版本问题修正;
    58. +
    59. 【BUG】naturebt代码生成器单表文件上传、excel导入,一对多验证settimeout问题修正;
    60. +
    61. 【BUG】分布式部署不支持redis共享 集群部署问题修正;
    62. +
    63. 【BUG】online删除文件confirm弹框z-index不足导致被遮挡;
    64. +
    65. 【BUG】代码生成器radio,checkbox宽度样式修正;
    66. +
    67. 【BUG】代码生成器多列表级联风格form页面带文件提交弹框不关闭问题修正;
    68. +
    69. 【BUG】范围查询double类型字段错误问题;
    70. +
    71. 【BUG】消息模板 查询按钮 改为 查看;
    72. +
    73. 【BUG】多表头列表 审核弹框大小调整;
    74. +
    75. 【BUG】部门二级管理员,部门角色在系统角色列表中显示问题修正;
    76. +
    77. 【BUG】online扩展参数用法问题修正;
    78. +
    79. 【BUG】UE编辑器图片 回显问题修正;
    80. +
    81. 【BUG】图片上传blob类型报错问题修正;
    82. +
    83. 【BUG】修改登录逻辑,解决重复执行login问题,简化代码;
    84. +
    85. 【BUG】定时任务日志包冲突问题修正;
    86. +
    87. 【BUG】替换官方仓库版本freemarker,采用classic_compatible=true解决空指针报错问题;
    88. +
    89. 【BUG】黑名单数据排重处理;
    90. +
    91. 【BUG】uploadify上传控件被隐藏导致上传失败问题修正;
    92. +
    93. 【BUG】单表代码生成器,老版NOPOP风格 生成的代码查看功能存在提交按钮问题修正;
    94. +
    95. 【BUG】合计金额展示千分位格式 如:61,100.00 显示问题修正;
    96. +
    97. 【BUG】vue 采用validform校验,重复校验提交check不住问题修正;
    98. +
    99. 【BUG】权限逻辑没有针对组织机构的角色进行控制问题修正;
    100. +
    101. 【BUG】online开发,自定义按钮显示表达式不起作用问题修正;
    102. +
    103. 【BUG】注释定时任务调度器启动解决抛出异常问题修正;
    104. +
    105. 【BUG】element-ui 代码生成器遗留问题修正;
    106. +
    107. 【BUG】数据字典项录入字典code重复校验问题修正;
    108. +
    109. 【BUG】用户编辑页面,系统角色列表不需要显示接口角色信息;
    110. +
    111. 【BUG】一系列论坛网友问题解决;
    112. +
    +
    +
    +
    +
    +
    +
    + v3.7.52018.05.17 +
    +
    +
    此版本提供新一代风格代码生成器模板,采用Vue技术,提供两套精美模板 ElementUI风格、Bootstrap风格,追逐潮流技术支持移动端;
      diff --git a/jeecg-framework/src/main/webapp/webpage/main/fineui_main.jsp b/jeecg-framework/src/main/webapp/webpage/main/fineui_main.jsp index bb5dace9..c0483a58 100644 --- a/jeecg-framework/src/main/webapp/webpage/main/fineui_main.jsp +++ b/jeecg-framework/src/main/webapp/webpage/main/fineui_main.jsp @@ -7,6 +7,7 @@ + @@ -353,6 +354,12 @@ $(this).next("div").removeClass("ui-iconss-focus"); }); $("body").css("height",document.documentElement.clientHeight); + + $(window).resize(function(){ + $("body").css("height",document.documentElement.clientHeight); + }); + + }); $(".personInfo").hover(function(){ diff --git a/jeecg-framework/src/main/webapp/webpage/main/home.jsp b/jeecg-framework/src/main/webapp/webpage/main/home.jsp index f6b08293..ce125008 100644 --- a/jeecg-framework/src/main/webapp/webpage/main/home.jsp +++ b/jeecg-framework/src/main/webapp/webpage/main/home.jsp @@ -10,7 +10,7 @@

      架构说明

      • JEECG开发平台,采用SpringMVC + Hibernate + Minidao(类Mybatis) + Easyui(UI库)+ Jquery + Boostrap + Ehcache + Redis + Ztree等基础架构,采用面向声明的开发模式, 基于泛型编写极少代码即可实现复杂的数据展示、数据编辑、表单处理等功能,再配合代码生成器的使用,将J2EE的开发效率提高6倍以上,可以将代码减少60%以上。
      • -
      • JEECG_v_3.7.5-beta 功能点: 1.代码生成器 2.数据权限 3.Online表单 4.工作流组件 5.移动OA 6.EasyPOI工具类 7.查询过滤器 8.UI库 9.国际化 10.多数据源 11.自定义表单 12.在线报表 13.移动报表 14.日志监控 15.首页切换 16.插件开发
      • +
      • JEECG_v_3.7.6 功能点: 1.代码生成器 2.数据权限 3.Online表单 4.工作流组件 5.移动OA 6.EasyPOI工具类 7.查询过滤器 8.UI库 9.国际化 10.多数据源 11.自定义表单 12.在线报表 13.移动报表 14.日志监控 15.首页切换 16.插件开发
      • [1].代码生成器,支持多种数据模型,根据表生成对应的Entity,Service,Dao,Action,JSP等,增删改查功能生成直接使用
      • [2].用户权限,强大数据权限new,支持精细化数据权限控制,控制到行级,列表级,表单字段级,实现不同人看不同数据,不同人对同一个页面操作不同字段
      • [3].Online表单,通过在线配置实现表模型的增删改查功能,零代码,支持用户自定义表单风格,new表单配置PC样式和移动样式,针对移动端采用移动样式展示
      • diff --git a/jeecg-framework/src/main/webapp/webpage/main/hplushome.jsp b/jeecg-framework/src/main/webapp/webpage/main/hplushome.jsp index 9b7b57c7..8b19a65e 100644 --- a/jeecg-framework/src/main/webapp/webpage/main/hplushome.jsp +++ b/jeecg-framework/src/main/webapp/webpage/main/hplushome.jsp @@ -47,7 +47,7 @@

        JEECG是一款基于代码生成器的J2EE快速开发平台,开源界“小普元”超越传统商业企业级开发平台。引领新的开发模式(Online Coding模式(自定义表单)->代码生成器模式->手工MERGE智能开发), 可以帮助解决Java项目60%的重复工作,让开发更多关注业务逻辑。既能快速提高开发效率,帮助公司节省人力成本,同时又不失灵活性。她可以用于所有的Web应用程序,如:MISCRMOAERPCMS网站后台微信管家,等等,当然,您也可以对她进行深度定制,以做出更强系统。

        - 当前版本:v_3.7.5-beta + 当前版本:v_3.7.6

        开源   |   免费 |   更多插件 @@ -135,10 +135,80 @@

        - v3.7.5-beta2018.05.17 + v3.7.62018.06.06
        -
        +
        +
        +
        此版本提供新一代风格代码生成器模板,采用Vue技术,提供两套精美模板 ElementUI风格、Bootstrap风格,追逐潮流技术支持移动端;
        +
          +
        1. 【功能升级】新一代 (单表/一对多) 代码生成器模板,Vue+ElementUI风格功能优化升级;
        2. +
        3. 【功能升级】新一代 (单表) 代码生成器模板,Bootstrap表单+EasyUI原生态列表风格功能优化升级;
        4. +
        5. 【功能升级】新一代 (一对多) 代码生成器模板,ElementUI表单+EasyUI原生态列表风格功能优化升级;
        6. +
        7. 【功能升级】新一代 (一对多) 代码生成器模板,EasyUI标签列表上下布局(列表数据编辑)+Table风格表单功能优化升级;
        8. +
        9. 【功能升级】牛牛叉功能 -> Datagrid标签升级,通过参数component可以快速实现BootstrapTable与easyUI列表风格切换功能优化升级;
        10. +
        11. 【功能升级】定时任务支持版本升级;
        12. +
        13. 【功能升级】定时任务,多个tomcat部署一台服务器的解决方案升级;
        14. +
        15. 【功能改造】新版代码生成器模板文件扩展名题处理,扩展名统一增加字母“i”;
        16. +
        17. 【功能改造】清理hplus/js/plugins下的插件;
        18. +
        19. 【功能改造】将不常改的js组件放进jar包 jeecg-plugin-in,减少eclipse check js;
        20. +
        21. 【功能改造】删除无用的代码,减少项目jar依赖;
        22. +
        23. 【功能改造】提示信息停留时间延长;
        24. +
        25. 【功能改造】防止SQL注入处理;
        26. +
        27. 【功能改造】druid扫描排除资源修改,durid数据源配置优化;
        28. +
        29. 【功能改造】权限拦截器重构优化
        30. +
        31. 【功能改造】重构登录逻辑;
        32. +
        33. 【功能改造】列表返回json进行gzip压缩,提高加载速度;
        34. +
        35. 【功能改造】在线清空用户登录权限缓存;
        36. +
        37. 【功能改造】重构redis缓存功能;
        38. +
        39. 【功能改造】在线文档预览效果优化;
        40. +
        41. 【功能改造】简化log4j12配置、highchart 图片导出依赖修改采用官仓;
        42. +
        43. 【功能改造】演示demo效果优化;
        44. +
        45. 【功能改造】jacob升级版本,采用官仓maven;
        46. +
        47. 【功能改造】重构online报表,通用方法抽取统一维护[解析字典支持缓存、解析SQL字段、解析SQL字段参数],优化UI效果;
        48. +
        49. 【功能改造】重构webupload上传功能;
        50. +
        51. 【功能改造】下拉默认请选择去掉,默认为空,美化页面效果;
        52. +
        53. 【功能改造】bootstrap-table表单,列表按钮图标样式和ace,hplus保持统一;
        54. +
        55. 【Demo】boostrap报表布局,嵌套多个报表示例;
        56. +
        57. 【BUG】ElemetUI版本问题修正;
        58. +
        59. 【BUG】naturebt代码生成器单表文件上传、excel导入,一对多验证settimeout问题修正;
        60. +
        61. 【BUG】分布式部署不支持redis共享 集群部署问题修正;
        62. +
        63. 【BUG】online删除文件confirm弹框z-index不足导致被遮挡;
        64. +
        65. 【BUG】代码生成器radio,checkbox宽度样式修正;
        66. +
        67. 【BUG】代码生成器多列表级联风格form页面带文件提交弹框不关闭问题修正;
        68. +
        69. 【BUG】范围查询double类型字段错误问题;
        70. +
        71. 【BUG】消息模板 查询按钮 改为 查看;
        72. +
        73. 【BUG】多表头列表 审核弹框大小调整;
        74. +
        75. 【BUG】部门二级管理员,部门角色在系统角色列表中显示问题修正;
        76. +
        77. 【BUG】online扩展参数用法问题修正;
        78. +
        79. 【BUG】UE编辑器图片 回显问题修正;
        80. +
        81. 【BUG】图片上传blob类型报错问题修正;
        82. +
        83. 【BUG】修改登录逻辑,解决重复执行login问题,简化代码;
        84. +
        85. 【BUG】定时任务日志包冲突问题修正;
        86. +
        87. 【BUG】替换官方仓库版本freemarker,采用classic_compatible=true解决空指针报错问题;
        88. +
        89. 【BUG】黑名单数据排重处理;
        90. +
        91. 【BUG】uploadify上传控件被隐藏导致上传失败问题修正;
        92. +
        93. 【BUG】单表代码生成器,老版NOPOP风格 生成的代码查看功能存在提交按钮问题修正;
        94. +
        95. 【BUG】合计金额展示千分位格式 如:61,100.00 显示问题修正;
        96. +
        97. 【BUG】vue 采用validform校验,重复校验提交check不住问题修正;
        98. +
        99. 【BUG】权限逻辑没有针对组织机构的角色进行控制问题修正;
        100. +
        101. 【BUG】online开发,自定义按钮显示表达式不起作用问题修正;
        102. +
        103. 【BUG】注释定时任务调度器启动解决抛出异常问题修正;
        104. +
        105. 【BUG】element-ui 代码生成器遗留问题修正;
        106. +
        107. 【BUG】数据字典项录入字典code重复校验问题修正;
        108. +
        109. 【BUG】用户编辑页面,系统角色列表不需要显示接口角色信息;
        110. +
        111. 【BUG】一系列论坛网友问题解决;
        112. +
        +
        +
        +
        +
        +
        +
        + v3.7.52018.05.17 +
        +
        +
        此版本提供新一代风格代码生成器模板,采用Vue技术,提供两套精美模板 ElementUI风格、Bootstrap风格,追逐潮流技术支持移动端;
          diff --git a/jeecg-framework/src/main/webapp/webpage/system/dataLog/dataDiff.jsp b/jeecg-framework/src/main/webapp/webpage/system/dataLog/dataDiff.jsp index d131f322..cb0e6204 100644 --- a/jeecg-framework/src/main/webapp/webpage/system/dataLog/dataDiff.jsp +++ b/jeecg-framework/src/main/webapp/webpage/system/dataLog/dataDiff.jsp @@ -23,7 +23,6 @@ data = [{}]; data.unshift({id: id1,versionNumber: versionNumber1}); data.unshift({id: id2,versionNumber: versionNumber2}); - data.unshift({id: '0',versionNumber: '---请选择---'}); $('#versionNumber1').combobox({ valueField:'id', textField:'versionNumber', @@ -64,7 +63,7 @@ data = [{}]; data.unshift({id: '0',versionNumber: '---无数据---'}); }else{ - data.unshift({id: '0',versionNumber: '---请选择---'}); + data.unshift({id: '0',versionNumber: '--'}); } $('#versionNumber1').combobox({ @@ -110,7 +109,7 @@ data = [{}]; data.unshift({id: '0',versionNumber: '---无数据---'}); }else{ - data.unshift({id: '0',versionNumber: '---请选择---'}); + data.unshift({id: '0',versionNumber: '--'}); } $('#versionNumber1').combobox({ diff --git a/jeecg-framework/src/main/webapp/webpage/system/dataLog/dataLogList.jsp b/jeecg-framework/src/main/webapp/webpage/system/dataLog/dataLogList.jsp index da180af0..1d024314 100644 --- a/jeecg-framework/src/main/webapp/webpage/system/dataLog/dataLogList.jsp +++ b/jeecg-framework/src/main/webapp/webpage/system/dataLog/dataLogList.jsp @@ -23,6 +23,16 @@ tip(''); return; } + + var dataId1=rowsData[0].dataId; + var dataId2=rowsData[1].dataId; + var table1=rowsData[0].tableName; + var table2=rowsData[1].tableName; + if(dataId1!=dataId2||table1!=table2){ + tip('请选择相同的数据库表和数据ID进行比较'); + return; + } + var tableName = rowsData[0].tableName; var dataId = rowsData[0].dataId; var versionNumber1 = rowsData[0].versionNumber; diff --git a/jeecg-framework/src/main/webapp/webpage/system/dbsource/dbSource.jsp b/jeecg-framework/src/main/webapp/webpage/system/dbsource/dbSource.jsp index e367c0a3..35d829f7 100644 --- a/jeecg-framework/src/main/webapp/webpage/system/dbsource/dbSource.jsp +++ b/jeecg-framework/src/main/webapp/webpage/system/dbsource/dbSource.jsp @@ -138,7 +138,7 @@ value="${showDbPassword}"> - [] + diff --git a/jeecg-framework/src/main/webapp/webpage/system/icon/icons.jsp b/jeecg-framework/src/main/webapp/webpage/system/icon/icons.jsp index 477cb2a9..7ef0daa7 100644 --- a/jeecg-framework/src/main/webapp/webpage/system/icon/icons.jsp +++ b/jeecg-framework/src/main/webapp/webpage/system/icon/icons.jsp @@ -10,7 +10,38 @@ $(function(){ $("#formobj").submit(function(){ var file_upload = $("#file_upload").val(); - + + var existIcon = $("#existIcon"); + if(!!existIcon && existIcon.val()=="1"){ + if(!$("#filediv").html()){ + //此处直接只修改表单数据,不修改图片 + var id = $("#id").val(); + var iconName = $("#iconName").val(); + var iconType = $("#iconType").val(); + var formData = { + "id":id, + "iconName":iconName, + "iconType":iconType + }; + $.ajax({ + async : false, + cache : false, + type : 'POST', + data:formData, + url : "iconController.do?updateInfo", + dataType:"JSON", + success : function(d) { + if (d.success) { + var win = frameElement.api.opener; + win.reloadTable(); + win.tip(d.msg); + } + frameElement.api.close(); + } + }); + } + } + if($.trim(file_upload) == ""){ tip("请选择上载文件."); return false; @@ -41,6 +72,7 @@
          +
          diff --git a/jeecg-framework/src/main/webapp/webpage/system/interrole/interroleUserList.jsp b/jeecg-framework/src/main/webapp/webpage/system/interrole/interroleUserList.jsp index debd800e..82faec8b 100644 --- a/jeecg-framework/src/main/webapp/webpage/system/interrole/interroleUserList.jsp +++ b/jeecg-framework/src/main/webapp/webpage/system/interrole/interroleUserList.jsp @@ -13,9 +13,9 @@ - + - + diff --git a/jeecg-framework/src/main/webapp/webpage/system/organzation/myDepartList.jsp b/jeecg-framework/src/main/webapp/webpage/system/organzation/myDepartList.jsp index c4c87c38..93b0ed26 100644 --- a/jeecg-framework/src/main/webapp/webpage/system/organzation/myDepartList.jsp +++ b/jeecg-framework/src/main/webapp/webpage/system/organzation/myDepartList.jsp @@ -95,10 +95,19 @@ function beforeDbl(){ } //加载树 var orgTree ; + +function showIndex(){ +var treeObj = $.fn.zTree.getZTreeObj("orgTree"); +var node =treeObj.getNodes()[0]; +$("#"+node.tId+" a").click(); +} + function loadTree() { var zNodes; var ztreeCreator = new ZtreeCreator('orgTree',"","") - .setCallback({onClick:zTreeOnLeftClick,onRightClick:zTreeOnRightClick,onDblClick:zTreeOnDblClick,beforeDblClick:beforeDbl}) + + .setCallback({onClick:zTreeOnLeftClick,onRightClick:zTreeOnRightClick,onDblClick:zTreeOnDblClick,beforeDblClick:beforeDbl,onAsyncSuccess:showIndex}) + .setAsync({ enable: true, url:"organzationController.do?getMyTreeData", diff --git a/jeecg-framework/src/main/webapp/webpage/system/role/roleList.jsp b/jeecg-framework/src/main/webapp/webpage/system/role/roleList.jsp index f9c00662..101a1b29 100644 --- a/jeecg-framework/src/main/webapp/webpage/system/role/roleList.jsp +++ b/jeecg-framework/src/main/webapp/webpage/system/role/roleList.jsp @@ -20,6 +20,7 @@ +
        @@ -75,4 +76,25 @@ function ExportXls() { function ExportXlsByT() { JeecgExcelExport("roleController.do?exportXlsByT", "roleList"); } + +//模板下载 +function refresh() { + $.ajax({ + async : false, + cache : false, + type : 'POST', + url : 'roleController.do?refresh', + error : function() { + }, + success : function(data) { + var d = $.parseJSON(data); + if (d.success) { + var msg = d.msg; + tip(msg); + } else { + tip(d.msg); + } + } + }); +} diff --git a/jeecg-framework/src/main/webapp/webpage/system/timetask/timeTask.jsp b/jeecg-framework/src/main/webapp/webpage/system/timetask/timeTask.jsp index 873a8be2..2cf282ec 100644 --- a/jeecg-framework/src/main/webapp/webpage/system/timetask/timeTask.jsp +++ b/jeecg-framework/src/main/webapp/webpage/system/timetask/timeTask.jsp @@ -24,12 +24,16 @@
        - +
        diff --git a/jeecg-framework/src/main/webapp/webpage/system/type/type.jsp b/jeecg-framework/src/main/webapp/webpage/system/type/type.jsp index e8140c11..41b1ff1e 100644 --- a/jeecg-framework/src/main/webapp/webpage/system/type/type.jsp +++ b/jeecg-framework/src/main/webapp/webpage/system/type/type.jsp @@ -23,7 +23,7 @@
        + ajaxurl="systemController.do?checkType&code=${type.typecode }&typeGroupCode=${typegroup.typegroupcode}"> 类型编码在1~10位字符
        diff --git a/jeecg-framework/src/main/webapp/webpage/system/user/interfaceUser.jsp b/jeecg-framework/src/main/webapp/webpage/system/user/interfaceUser.jsp index 8747aee4..2272d27f 100644 --- a/jeecg-framework/src/main/webapp/webpage/system/user/interfaceUser.jsp +++ b/jeecg-framework/src/main/webapp/webpage/system/user/interfaceUser.jsp @@ -5,74 +5,13 @@ 用户信息 - - + - @@ -87,6 +26,7 @@ + + + - - + + - - - - <%-- - - - --%> - - - - - - - + + - - - - - - - - - - <%-- - - - --%> - <%-- - - - --%> - - - - - - - - - - - - - - - - - - - - @@ -240,28 +78,6 @@ 填写备注 - <%-- - - - - - - - --%>
        @@ -95,6 +35,7 @@ ${roleName}
        @@ -102,135 +43,32 @@
        - - 填写英文名 - + + + +
        - - 填写工号 -
        - - - -
        - - -
        - - 填写身份证号 - + + +
        - - - -
        - - -
        - update-start--Author:jg_renjie Date:20160320 for:#942 【组件封装】组织机构弹出模式,目前是列表,得改造成树方式 - update-start--Author:zhangguoming Date:20140826 for:将combobox修改为combotree - - update-end--Author:zhangguoming Date:20140826 for:将combobox修改为combotree - - - - - - - - - 选择 - 清空 - -
        - - - - -
        -
        - - -
        - - - -
        - - 填写传真 -
        - - 填写联系地址 -
        - - 填写邮编
        - - - -
        - - - checked="true" value="1"> - 同步 - checked="true" value="0"> - 不同步 - 是否同步工作流引擎 -
        \ No newline at end of file diff --git a/jeecg-framework/src/main/webapp/webpage/system/user/interfaceUserList.jsp b/jeecg-framework/src/main/webapp/webpage/system/user/interfaceUserList.jsp new file mode 100644 index 00000000..06d99041 --- /dev/null +++ b/jeecg-framework/src/main/webapp/webpage/system/user/interfaceUserList.jsp @@ -0,0 +1,17 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> +<%@include file="/context/mytags.jsp"%> + + + + + + + + + + + + + + + diff --git a/jeecg-framework/src/test/java/org/jeecgframework/test/demo/DynamicDBTest.java b/jeecg-framework/src/test/java/org/jeecgframework/test/demo/DynamicDBTest.java new file mode 100644 index 00000000..fbef48a8 --- /dev/null +++ b/jeecg-framework/src/test/java/org/jeecgframework/test/demo/DynamicDBTest.java @@ -0,0 +1,62 @@ +package org.jeecgframework.test.demo; + +import java.util.List; +import java.util.Map; +import java.util.UUID; + +import org.jeecgframework.AbstractUnitTest; +import org.jeecgframework.core.util.DynamicDBUtil; +import org.jeecgframework.core.util.ResourceUtil; +import org.jeecgframework.web.system.pojo.base.DynamicDataSourceEntity; +import org.junit.Before; +import org.junit.Test; + +public class DynamicDBTest extends AbstractUnitTest { + static String dbKey = "JEECG_LOCAL"; + + static { + DynamicDataSourceEntity dynamicSourceEntity = new DynamicDataSourceEntity(); + String driverClassName = "com.mysql.jdbc.Driver"; + String url = "jdbc:mysql://localhost:3306/jeecg"; + String dbUser = "root"; + String dbPassword = "ea3d519525358e00"; + + dynamicSourceEntity.setDbKey(dbKey); + dynamicSourceEntity.setDriverClass(driverClassName); + dynamicSourceEntity.setUrl(url); + dynamicSourceEntity.setDbUser(dbUser); + dynamicSourceEntity.setDbPassword(dbPassword); + ResourceUtil.dynamicDataSourceMap.put(dbKey, dynamicSourceEntity); + } + + @Test + public void testInsert() throws Exception { + String id = UUID.randomUUID().toString().replaceAll("-", "").toUpperCase(); + // 测试查询列表 + String sql = "insert jeecg_demo (id,name)values(?,'DynamicDBTest-insert') "; + DynamicDBUtil.update(dbKey,sql,id); + System.out.println("-----------testInsert---------"); + } + + @Test + public void testUpdate() throws Exception { + // 测试查询列表 + String sql = "update jeecg_demo set name='动态数据库源测试' where id = '402881f3633e483e01633e56ebed0009'"; + DynamicDBUtil.update(dbKey,sql); + System.out.println("-----------testUpdate---------"); + } + + + @Test + public void testSelectList() throws Exception { + // 测试查询列表 + String sql = "select * from jeecg_demo"; + List> list = DynamicDBUtil.findList(dbKey, sql); + System.out.println("---------------testSelectList------listSize--------"+ list.size()); + for (Map mp : list) { + System.out.println(mp.toString()); + } + } + + +} diff --git a/jeecg-framework/src/test/java/org/jeecgframework/test/demo/JwtRestfulClientDemo.java b/jeecg-framework/src/test/java/org/jeecgframework/test/demo/JwtRestfulClientDemo.java index 1e47297e..447ad58c 100644 --- a/jeecg-framework/src/test/java/org/jeecgframework/test/demo/JwtRestfulClientDemo.java +++ b/jeecg-framework/src/test/java/org/jeecgframework/test/demo/JwtRestfulClientDemo.java @@ -59,8 +59,8 @@ public class JwtRestfulClientDemo { public static void main(String[] args) { String token = getToken("interfaceuser","123456"); + System.out.println(" token : "+ token); // String token = "eyJhbGciOiJIUzI1NiJ9.eyJqdGkiOiJhZG1pbiIsInN1YiI6ImFkbWluIiwiaWF0IjoxNTExODU5NjM2fQ.Emfe8VZKA_L33jaW8ZUtVFVDEin83Np_d3gKlPIZryE"; -// System.out.println(token); //添加黑名单 // JSONObject jsonObject=new JSONObject(); diff --git a/jeecg-framework/src/test/java/org/jeecgframework/test/demo/RedisUtilTest.java b/jeecg-framework/src/test/java/org/jeecgframework/test/demo/RedisUtilTest.java deleted file mode 100644 index 8303a20c..00000000 --- a/jeecg-framework/src/test/java/org/jeecgframework/test/demo/RedisUtilTest.java +++ /dev/null @@ -1,127 +0,0 @@ -package org.jeecgframework.test.demo; - -import static org.junit.Assert.*; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import org.jeecgframework.AbstractUnitTest; -import org.jeecgframework.core.util.RedisUtil; -import org.jeecgframework.web.system.pojo.base.TSUser; -import org.junit.Before; -import org.junit.Test; -/** - * RedisUtil的junit测试类 - * @author yugwu - */ -public class RedisUtilTest extends AbstractUnitTest{ - - @Before - public void setup() throws Exception { - RedisUtil.cleanAll(); - } - //RedisUtil.delete - @Test - public void testDelete() throws Exception { - RedisUtil.StringR.set("aaa", "aaa"); - RedisUtil.StringR.delete("aaa"); - assertTrue(RedisUtil.StringR.get("aaa") == null); - } - //RedisUtil.hasKey - @Test - public void testHasKey() throws Exception { - RedisUtil.StringR.set("aaa", "aaa"); - Boolean hasKey = RedisUtil.StringR.hasKey("aaa"); - RedisUtil.StringR.delete("aaa"); - Boolean deleteKey = RedisUtil.StringR.hasKey("aaa"); - assertTrue(hasKey&&!deleteKey); - } - //RedisUtil.StringR.setIfAbsent - @Test - public void testSsetIfAbsent() throws Exception { - RedisUtil.StringR.setIfAbsent("aaa", "aaa"); - String aaa = RedisUtil.StringR.get("aaa"); - RedisUtil.StringR.setIfAbsent("aaa", "bbb"); - String bbb = RedisUtil.StringR.get("aaa"); - RedisUtil.StringR.delete("aaa"); - assertTrue("aaa".equals(aaa)&&"aaa".equals(bbb)); - } - //RedisUtil.StringR.getAndRemove - @Test - public void testSgetAndRemove() throws Exception { - RedisUtil.StringR.setIfAbsent("aaa", "aaa"); - String aaa = RedisUtil.StringR.getAndRemove("aaa"); - String bbb = RedisUtil.StringR.get("aaa"); - RedisUtil.StringR.delete("aaa"); - assertTrue("aaa".equals(aaa)&&null == bbb); - } - //RedisUtil.ObjectR.set RedisUtil.ObjectR.getAndRemove - @Test - public void testOSetAndGet() throws Exception { - TSUser user = new TSUser(); - user.setUserName("test"); - user.setEmail("testEmail"); - RedisUtil.ObjectR.set("aaa", user); - TSUser aaa = (TSUser) RedisUtil.ObjectR.getAndRemove("aaa"); - assertTrue("test".equals(aaa.getUserName())&&"testEmail".equals(aaa.getEmail())); - } - //RedisUtil.ListR.size RedisUtil.ListR.add RedisUtil.ListR.get RedisUtil.ListR.getAllAndRemove - @SuppressWarnings("rawtypes") - @Test - public void testList() throws Exception { - List list = new ArrayList(); - for(int i=0;i<10;i++){ - TSUser user = new TSUser(); - user.setUserName("test"+i); - user.setEmail("testEmail"+i); - list.add(user); - } - RedisUtil.ListR.set("aaa", list); - Long size = RedisUtil.ListR.size("aaa"); - Boolean sizeAssert = size == 10; - TSUser user = new TSUser(); - user.setUserName("test"+10); - user.setEmail("testEmail"+10); - list.add(user); - RedisUtil.ListR.add("aaa", user); - Long size1 = RedisUtil.ListR.size("aaa"); - Boolean addAssert = size1 == 11; - TSUser userR = (TSUser) RedisUtil.ListR.get("aaa", 10); - Boolean getAssert = ("test10".equals(userR.getUserName()))&&("testEmail10".equals(userR.getEmail())); - ArrayList result = RedisUtil.ListR.getAllAndRemove("aaa"); - Iterator it = result.iterator(); - int index = 0; - Boolean getAllAssert = true; - while(it.hasNext()){ - TSUser userI = (TSUser) it.next(); - if(!("test"+index).equals(userI.getUserName())){ - getAllAssert = false; - } - if(!("testEmail"+index).equals(userI.getEmail())){ - getAllAssert = false; - } - index++; - } - assertTrue(sizeAssert && addAssert && getAssert && getAllAssert); - } - //测试清理cleanAll - @Test - public void testClean() throws Exception { - List list = new ArrayList(); - for(int i=0;i<10;i++){ - TSUser user = new TSUser(); - user.setUserName("test"+i); - user.setEmail("testEmail"+i); - list.add(user); - } - RedisUtil.ListR.set("aaa", list); - RedisUtil.StringR.setIfAbsent("aaa", "aaa"); - TSUser user = new TSUser(); - user.setUserName("test"); - user.setEmail("testEmail"); - RedisUtil.ObjectR.set("aaa", user); - RedisUtil.cleanAll(); - assertTrue(null == RedisUtil.StringR.get("aaa") && null == RedisUtil.ObjectR.get("aaa") && 0 == RedisUtil.ListR.size("aaa")); - } -} diff --git a/jeecg-plugin-ui/README.md b/jeecg-plugin-ui/README.md index 0439e87c..5af43eb4 100644 --- a/jeecg-plugin-ui/README.md +++ b/jeecg-plugin-ui/README.md @@ -1,7 +1,7 @@ JEECG ΢ƿٿƽ̨ =============== -ǰ°汾 3.7.5 betaڣ20180519 +ǰ°汾 3.7.6ڣ20180607 ˹Ϊjeecg-frameworkĿIJ ṵ̀jeecg-frameworkĿplug-inĿ¼²õIJǨƵ˴޸˹޸ġ \ No newline at end of file diff --git a/入门必读.txt b/入门必读.txt index fd4aae1e..77de0d39 100644 --- a/入门必读.txt +++ b/入门必读.txt @@ -4,7 +4,7 @@ eclipse + maven + jdk7 + tomcat7 + mysql 2. ִֹгʼSQLű - docs/db/jeecg_3.7.5_beta_mysql.sql + docs/db/jeecg_3.7.6_mysql.sql ע⣺ ִֹdoc\dbµݿű 3. ſ