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.集成简易报表工具,图像报表和数据导出非常方便,可极其方便的生成pdf、excel、word等报表; -* 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', '鍔ㄦ乼ab璁捐', '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,閿欒鎻忚堪锛歂o 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,閿欒鎻忚堪锛歂o 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,閿欒鎻忚堪锛歂o 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. oracle、SqlServer脚步索引会有部分丢失,为了系统性能,请自行补加索引。 @@ -16,6 +16,6 @@ 4.老版本数据库增量升级 执行老版本升级SQL脚本 - 3.7.3升级到3.7.5_beta - docs/老版本增量升级/jeecg_mysql-3.7.3_beta-update-3.7.5.sql + 3.7.5_beta升级到3.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 @@ -锘縄NSERT 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 @@ +锘縰pdate 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) { /** * 娉ㄦ剰锛歮inidao浼氶伒寰猻pringjdbc瑙勫垯锛屼細鑷姩鎶婃暟鎹簱浠ヤ笅鍒掔嚎鐨勫瓧娈碉紝杞寲涓洪┘宄板啓娉 - * 渚嬪鏁版嵁搴撹〃瀛楁锛歿USER_NAME} + * 渚嬪鏁版嵁搴撹〃瀛楁锛歿user_name} * 杞寲瀹炰綋瀵瑰簲瀛楁锛歿userName} */ - + + //step.1 鑾峰彇鏁版嵁鏉冮檺SQL鐗囨 String authSql = JeecgDataAutorUtils.loadDataSearchConditonSQLString(); + + //step.2 灏嗘潈闄怱QL鐗囨娉ㄥ叆鍒颁笟鍔QL涓 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"); + } + + /** + * 璁㈠崟鍒楄〃鍒楄〃 椤甸潰璺宠浆 (鑷畾涔夊瓙琛ㄦ樉绀篸emo) + * + * @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); //璇曞浘寰楀埌鏍囨敞鐨凟hcache绫 @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; - //娉涘瀷璁剧疆鎴怢ong鍚庡繀椤绘洿鏀瑰搴旂殑搴忓垪鍖栨柟妗 - 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鐨刢lass */ - 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鐨刢lass */ +// 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(); } + +// 銆恠cott 20180526 鍒犻櫎鏃犵敤浠g爜|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; - } - - - - - /** - * 璇ユ柟娉曟彁渚汥etachedCriteria瀵规煡璇㈠瓧娈电殑灏佽锛 2008-9-29 - * 2009.9.9淇敼鍚庯紝鍙敮鎸佹棤闄愮骇鑱斿彇閮ㄥ垎瀛楁锛屽鍙栧涓嬪瓧娈 - * user.organization.parentOrganization.parentOrganization.orgName - * 浣嗚娉ㄦ剰1鐐 ,杩炴帴閲囩敤鍐呰仈锛岀骇鑱旇秺澶氾紝缁撴灉闆嗗彲鑳藉氨瓒婂皯锛 - * @author - * @param columnNames - * 瀛楃涓叉暟缁勶紝浠ユ暟鎹殑褰㈠紡鎺ユ敹瑕佹煡璇㈢殑瀛楁灞炴э紝濡係tring[] column={"灞炴1","灞炴2","灞炴3"}; - * @param pojoClass - * 瀹炰綋绫荤殑Class,濡侻obile.class; - * @param aials - * 涓鸿鏌ヨ鐨凱OJO瀵硅薄鎸囧畾涓涓埆鍚 - * @return DetachedCriteria 鐨勪竴涓璞★紝濡傛灉闇瑕佹煡璇㈡潯浠讹紝鍦ㄤ簺瀵硅薄鍚庤拷鍔犳煡璇㈡潯浠躲 - * - * @param forJoinTable 鏄惁澶氳〃杩炴帴鏌ヨ - */ - public static void selectColumn(DetachedCriteria criteria, String[] columnNames, - Class pojoClass,boolean forJoinTable) { - if (null == columnNames) { - return; - } - - //浣跨敤杩欎釜涓存椂鍙橀噺闆嗗悎锛屾槸鍥犱负dinstinct鍏抽敭瀛楄鏀惧湪鏈鍓嶉潰锛岃宒istinct鍏抽敭瀛楄鍦ㄤ笅闈㈡墠鍐冲畾鏀句笉鏀撅紝 - 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; +// } +// +// +// +// +// /** +// * 璇ユ柟娉曟彁渚汥etachedCriteria瀵规煡璇㈠瓧娈电殑灏佽锛 2008-9-29 +// * 2009.9.9淇敼鍚庯紝鍙敮鎸佹棤闄愮骇鑱斿彇閮ㄥ垎瀛楁锛屽鍙栧涓嬪瓧娈 +// * user.organization.parentOrganization.parentOrganization.orgName +// * 浣嗚娉ㄦ剰1鐐 ,杩炴帴閲囩敤鍐呰仈锛岀骇鑱旇秺澶氾紝缁撴灉闆嗗彲鑳藉氨瓒婂皯锛 +// * @author +// * @param columnNames +// * 瀛楃涓叉暟缁勶紝浠ユ暟鎹殑褰㈠紡鎺ユ敹瑕佹煡璇㈢殑瀛楁灞炴э紝濡係tring[] column={"灞炴1","灞炴2","灞炴3"}; +// * @param pojoClass +// * 瀹炰綋绫荤殑Class,濡侻obile.class; +// * @param aials +// * 涓鸿鏌ヨ鐨凱OJO瀵硅薄鎸囧畾涓涓埆鍚 +// * @return DetachedCriteria 鐨勪竴涓璞★紝濡傛灉闇瑕佹煡璇㈡潯浠讹紝鍦ㄤ簺瀵硅薄鍚庤拷鍔犳煡璇㈡潯浠躲 +// * +// * @param forJoinTable 鏄惁澶氳〃杩炴帴鏌ヨ +// */ +// public static void selectColumn(DetachedCriteria criteria, String[] columnNames, +// Class pojoClass,boolean forJoinTable) { +// if (null == columnNames) { +// return; +// } +// +// //浣跨敤杩欎釜涓存椂鍙橀噺闆嗗悎锛屾槸鍥犱负dinstinct鍏抽敭瀛楄鏀惧湪鏈鍓嶉潰锛岃宒istinct鍏抽敭瀛楄鍦ㄤ笅闈㈡墠鍐冲畾鏀句笉鏀撅紝 +// 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鍜寁alue + */ + public void delete(String key){ + redisTemplate.delete(key); + } + + /** + * 鏍规嵁key鑾峰彇value + */ + public String get(String key){ + String value = redisTemplate.opsForValue().get(key); + return value; + } + + /** + * 灏唊ey鍜寁alue瀛樺叆redis锛屽苟璁剧疆鏈夋晥鏃堕棿锛屽崟浣嶏細澶 + */ + public void set(String key, String value, long timeout){ + redisTemplate.opsForValue().set(key, value, timeout, TimeUnit.DAYS); + } + + /** + * 灏唊ey鍜寁alue瀛樺叆redis + */ + public void set(String key, String value){ + redisTemplate.opsForValue().set(key, value); + } + + /** + * 浠巖edis涓幏鍙杕ap + */ + public Map getMap(String key){ + HashOperations hash = redisTemplate.opsForHash(); + Map map = hash.entries(key); + return map; + } + + /** + * 灏唌ap瀛樺叆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瀛楃涓蹭笉瑕佹湁鍖呭惈鐨勬儏鍐 (渚嬪锛氭湁浜哸dd 灏变笉鑳芥湁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锛歴ql缁勮 /** * 鏍规嵁瀛楁鍚嶇О,鑾峰彇瀛楁鐨勭被鍨嬪瓧绗︿覆 * 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; - } - - /** - * 鍦╟ontroller鍚庢嫤鎴 - */ - 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 { - - } + + /** * 鍦╟ontroller鍓嶆嫤鎴 */ public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object object) throws Exception { - - //鍒ゆ柇鏄惁琚敞瑙h烦杩囨潈闄愯璇 鍏堝垽鏂被娉ㄨВ鐒跺悗鏂规硶娉ㄨВ 閮芥病鏈夊垯璧板師鏉ラ昏緫 + //-----------------------娉ㄨВ鎺掗櫎鏉冮檺鎷︽埅鏈哄埗--------------------------------------- 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; } - + + //閽堝鎷︽埅鍣ㄦ帓闄RLS锛岃繘琛屾帓闄 if (excludeUrls.contains(requestPath)) { return true; - } else if(moHuContain(excludeContainUrls, requestPath)){ return true; - } else { - //姝ラ浜岋細 鏉冮檺鎺у埗锛屼紭鍏堥噸缁勮姹俇RL(鑰冭檻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鐗规畩瑙勫垯锛屾牴鎹鍒欓噸缁刄RL锛屾敮鎸佸涓弬鏁 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; - } - - - //瑙e喅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瀵瑰簲鐨勮彍鍗旾D锛堝洜涓烘暟鎹潈闄愩侀〉闈㈡帶浠舵潈闄愭槸鍩轰簬鑿滃崟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=""; - //鏁版嵁鏉冮檺瑙勫垯鐨勬煡璇 - //鏌ヨ鎵鏈夌殑褰撳墠杩欎釜鐢ㄦ埛鎵瀵瑰簲鐨勮鑹插拰鑿滃崟鐨刣atarule鐨勬暟鎹鍒檌d - - 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); - } - } + //鏌ヨ褰撳墠鐢ㄦ埛鎺堟潈鐨勬暟鎹鍒橧DS - 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 + * 鍦╟ontroller鍚庢嫤鎴 */ - 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); + + /** + * 鍦ㄧ嚎寮鍙戠壒娈奤RL(闇瑕佸綍鍏QL鐗囨)锛岃繘琛岀壒娈婂鐞 + */ + 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.鍦ㄧ嚎寮鍙戝姛鑳斤紙鏈塖QL鍊兼儏鍐碉級锛岄拡瀵规暟鎹簱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锛屽父瑙勪笟鍔℃搷浣滐紙鏃燬QL鍊兼儏鍐碉級锛 閽堝鏁版嵁搴揝QL鎿嶄綔锛岃繘琛屽紑鍙戣呮潈闄愭帶鍒讹紝闃叉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; - } - /** - * 褰撳瓨鍦╯ql娉ㄥ叆鏃舵姏寮傚父 - * @param str 杈撳叆sql - */ - public static void sql_inj_throw(String str){ - if(sql_inj(str)){ - throw new RuntimeException("璇锋敞鎰,濉叆鐨勫弬鏁板彲鑳藉瓨鍦⊿QL娉ㄥ叆!"); - } - } + +// /** +// * 闃叉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; +// } +// /** +// * 褰撳瓨鍦╯ql娉ㄥ叆鏃舵姏寮傚父 +// * @param str 杈撳叆sql +// */ +// public static void sql_inj_throw(String str){ +// if(sql_inj(str)){ +// throw new RuntimeException("璇锋敞鎰,濉叆鐨勫弬鏁板彲鑳藉瓨鍦⊿QL娉ㄥ叆!"); +// } +// } + /** * 鏍规嵁瀛楁绫诲瀷 杩涜澶勭悊 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; - - /** * 鍔ㄦ佷换鍔,鐢ㄤ互鍔ㄦ佽皟鏁碨pring鐨勪换鍔 * @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); +// } + //閫氳繃瑙﹀彂鍣╧ey 鍚戣皟搴﹀櫒 鑾峰彇瑙﹀彂鍣ㄥ疄渚 + 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)){//褰撳墠鏈嶅姟鍣↖P鍖归厤鎴愬姛 //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());//瑙e瘑瀛楃涓诧紱 - + +// 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璇硶鎿嶄綔鐨刄pdate * @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鍜孞AVA鐨凱OJO鐨勭浉浜掕浆鎹 * @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(); - } - } - - /** - * 涓撶敤浜嶴tring鐨凴edis澶勭悊宸ュ叿绫 - * 鎵鏈夊伐鍏风被閮藉寘鍚玤etBound銆乻etIfAbsent銆乻et銆乨elete銆乭asKey銆乬et銆乬etAndRemove绛夐氱敤鏂规硶 - * 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); - } - } - /** - * 涓撶敤浜嶰bject鐨凴edis澶勭悊宸ュ叿绫 - */ - 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); - } - } - - /** - * 涓撶敤浜嶭ist鐨凴edis澶勭悊宸ュ叿绫 - * add 鍦╨ist鏈坊鍔犳柊瀹炰綋 - * size 褰撳墠list鐨剆ize - * 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 鍦╨ist鏈坊鍔犳柊瀹炰綋e*/ - public static Boolean add(String key, Object value) { - return add(key, value, 30L, TimeUnit.MINUTES); - } - /**add 鍦╨ist鏈坊鍔犳柊瀹炰綋锛屽苟璁剧疆杩囨湡鏃堕棿*/ - 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鐨剆ize*/ - 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); - } - - /** - * 鎵鏈塰asKey鐨勫叆鍙 - * @param area 缂撳瓨鍖哄煙 - * @param key - */ - public static Boolean hasKey(String area, String key) { - return redisTemplate.hasKey(area + key); - } - /** - * 娓呯悊鎵鏈塺edis缂撳瓨 - */ - 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 閫氳繃鍙嶅皠鏉ュ姩鎬佽皟鐢╣et 鍜 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("鍊煎瓨鍦╯ql娉ㄥ叆椋庨櫓锛"+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("璇锋敞鎰,鍊煎彲鑳藉瓨鍦⊿QL娉ㄥ叆椋庨櫓!---> {}",value); + throw new RuntimeException("璇锋敞鎰,鍊煎彲鑳藉瓨鍦⊿QL娉ㄥ叆椋庨櫓!--->"+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; - //娉涘瀷璁剧疆鎴怢ong鍚庡繀椤绘洿鏀瑰搴旂殑搴忓垪鍖栨柟妗 - 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 { /** * 璁剧疆鑷畾涔夊嚱鏁版搷浣淯RL */ - 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;//鎸夐挳鐨勬搷浣淐ode + 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 = "璇P:"+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 = "璇P:"+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 = "瑙f瀽澶辫触!

澶辫触鍘熷洜锛"; @@ -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("璇ユ姤琛╯ql娌℃湁鏁版嵁"); - } - 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 瑕佹斁鍏reemarker鐨勬暟鎹 - * @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; + +/** + * 鑷畾涔塐nline鑷畾涔夋寜閽 + * 浣跨敤鏂规硶 锛<@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锛歴cott---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)+"\" ");//涓轰簡姝e垯鍖归厤 鍔犱笂绌烘牸 //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 = "瑙f瀽澶辫触!

澶辫触鍘熷洜锛"; @@ -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("璇ユ姤琛╯ql娌℃湁鏁版嵁"); - } - 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 瑕佹斁鍏reemarker鐨勬暟鎹 - * @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); + /** + * 瑙f瀽sql瀛楁锛屾敮鎸佸鏁版嵁婧 + * @param sql + * @param dbKey + * @return + */ + public List getFields(String sql, String dbKey); + /** + * 瑙f瀽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瑙f瀽鐨勫瓧娈 + */ + 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("璇ユ姤琛╯ql娌℃湁鏁版嵁"); + } + Set fieldsSet= dataList.get(0).keySet(); + fields = new ArrayList(fieldsSet); + }else{ + fields = this.getSqlFields(sql); + } + return fields; + } + + /** + * 杩囨护闈炴硶sql瑙勫垯锛岄檷浣巗ql娉ㄥ叆椋庨櫓 + * @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; + } + + /** + * 瑙f瀽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 瑕佹斁鍏reemarker鐨勬暟鎹 + * @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); + } + + /** + * 鏌ヨ鏁版嵁瀛楀吀锛屾墿灞曚簡瀵筍QL鐨勬敮鎸 + * @param dictCodeOrSQL 瀛楀吀缂栫爜鎴朣QL + * @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); - } - } - } - } - } - } - - /** - * 鏌ヨ鏁版嵁瀛楀吀锛屾墿灞曚簡瀵筍QL鐨勬敮鎸 - * @param dictCodeOrSQL 瀛楀吀缂栫爜鎴朣QL - * @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 瑕佹斁鍏reemarker鐨勬暟鎹 - * @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锛歍ASK #2767 銆愪笓棰樹换鍔°慹lement-ui 浠g爜鐢熸垚鍣ㄩ仐鐣欓棶棰樻敼閫(闂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锛歍ASK #2767 銆愪笓棰樹换鍔°慹lement-ui 浠g爜鐢熸垚鍣ㄩ仐鐣欓棶棰樻敼閫(闂10) --> + <#elseif po.showType == 'image'> + + + 鐐瑰嚮涓婁紶 + + + <#elseif po.showType=='file'> + <#-- update--end--Author:gj_shaojc Date:20180605 for锛歍ASK #2767 銆愪笓棰樹换鍔°慹lement-ui 浠g爜鐢熸垚鍣ㄩ仐鐣欓棶棰樻敼閫(闂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锛歍ASK #2767 銆愪笓棰樹换鍔°慹lement-ui 浠g爜鐢熸垚鍣ㄩ仐鐣欓棶棰樻敼閫(闂9)--> + + + + <#-- update--end-- Author:gj_shaojc Date:20180606 for锛歍ASK #2767 銆愪笓棰樹换鍔°慹lement-ui 浠g爜鐢熸垚鍣ㄩ仐鐣欓棶棰樻敼閫(闂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 鑷畾涔夋嫋鍔↗S + * @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);}, //婵娲籺ab鍔犺浇瀛愯〃鏁版嵁 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); }, //鏌ORM - 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)){ + //鍥犱负璇ュ嚱鏁颁細榛樿鎷兼帴涓涓猧ndex鍒板弬鏁颁腑,鏁呰屾澶勫垽鏂槸鍚︽槸鏁板瓧,鏄暟瀛楀垯璧癲oDel + 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)){ + //鍥犱负璇ュ嚱鏁颁細榛樿鎷兼帴涓涓猧ndex鍒板弬鏁颁腑,鏁呰屾澶勫垽鏂槸鍚︽槸鏁板瓧,鏄暟瀛楀垯璧癲oDel + 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,// 璇锋眰鐨刟ction璺緞 + 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',// 璇锋眰鐨刟ction璺緞 + 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鏄竴娆惧熀浜庝唬鐮佺敓鎴愬櫒鐨凧2EE蹇熷紑鍙戝钩鍙帮紝寮婧愮晫鈥滃皬鏅厓鈥濊秴瓒婁紶缁熷晢涓氫紒涓氱骇寮鍙戝钩鍙般傚紩棰嗘柊鐨勫紑鍙戞ā寮(Online Coding妯″紡(鑷畾涔夎〃鍗)->浠g爜鐢熸垚鍣ㄦā寮->鎵嬪伐MERGE鏅鸿兘寮鍙)锛 鍙互甯姪瑙e喅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鏄竴娆惧熀浜庝唬鐮佺敓鎴愬櫒鐨凧2EE蹇熷紑鍙戝钩鍙帮紝寮婧愮晫鈥滃皬鏅厓鈥濊秴瓒婁紶缁熷晢涓氫紒涓氱骇寮鍙戝钩鍙般傚紩棰嗘柊鐨勫紑鍙戞ā寮(Online Coding妯″紡(鑷畾涔夎〃鍗)->浠g爜鐢熸垚鍣ㄦā寮->鎵嬪伐MERGE鏅鸿兘寮鍙)锛 鍙互甯姪瑙e喅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
    -
    +
    +
    +
    姝ょ増鏈彁渚涙柊涓浠i鏍间唬鐮佺敓鎴愬櫒妯℃澘锛岄噰鐢╒ue鎶鏈紝鎻愪緵涓ゅ绮剧編妯℃澘 ElementUI椋庢牸銆丅ootstrap椋庢牸锛岃拷閫愭疆娴佹妧鏈敮鎸佺Щ鍔ㄧ锛
    +
      +
    1. 銆愬姛鑳藉崌绾с戞柊涓浠 (鍗曡〃/涓瀵瑰) 浠g爜鐢熸垚鍣ㄦā鏉匡紝Vue+ElementUI椋庢牸鍔熻兘浼樺寲鍗囩骇;
    2. +
    3. 銆愬姛鑳藉崌绾с戞柊涓浠 (鍗曡〃) 浠g爜鐢熸垚鍣ㄦā鏉匡紝Bootstrap琛ㄥ崟+EasyUI鍘熺敓鎬佸垪琛ㄩ鏍煎姛鑳戒紭鍖栧崌绾;
    4. +
    5. 銆愬姛鑳藉崌绾с戞柊涓浠 (涓瀵瑰) 浠g爜鐢熸垚鍣ㄦā鏉匡紝ElementUI琛ㄥ崟+EasyUI鍘熺敓鎬佸垪琛ㄩ鏍煎姛鑳戒紭鍖栧崌绾;
    6. +
    7. 銆愬姛鑳藉崌绾с戞柊涓浠 (涓瀵瑰) 浠g爜鐢熸垚鍣ㄦā鏉匡紝EasyUI鏍囩鍒楄〃涓婁笅甯冨眬(鍒楄〃鏁版嵁缂栬緫)+Table椋庢牸琛ㄥ崟鍔熻兘浼樺寲鍗囩骇;
    8. +
    9. 銆愬姛鑳藉崌绾с戠墰鐗涘弶鍔熻兘 -> Datagrid鏍囩鍗囩骇,閫氳繃鍙傛暟component鍙互蹇熷疄鐜癇ootstrapTable涓巈asyUI鍒楄〃椋庢牸鍒囨崲鍔熻兘浼樺寲鍗囩骇;
    10. +
    11. 銆愬姛鑳藉崌绾с戝畾鏃朵换鍔℃敮鎸佺増鏈崌绾;
    12. +
    13. 銆愬姛鑳藉崌绾с戝畾鏃朵换鍔★紝澶氫釜tomcat閮ㄧ讲涓鍙版湇鍔″櫒鐨勮В鍐虫柟妗堝崌绾;
    14. +
    15. 銆愬姛鑳芥敼閫犮戞柊鐗堜唬鐮佺敓鎴愬櫒妯℃澘鏂囦欢鎵╁睍鍚嶉澶勭悊,鎵╁睍鍚嶇粺涓澧炲姞瀛楁瘝鈥渋鈥;
    16. +
    17. 銆愬姛鑳芥敼閫犮戞竻鐞唄plus/js/plugins涓嬬殑鎻掍欢;
    18. +
    19. 銆愬姛鑳芥敼閫犮戝皢涓嶅父鏀圭殑js缁勪欢鏀捐繘jar鍖 jeecg-plugin-in,鍑忓皯eclipse check js;
    20. +
    21. 銆愬姛鑳芥敼閫犮戝垹闄ゆ棤鐢ㄧ殑浠g爜锛屽噺灏戦」鐩甹ar渚濊禆;
    22. +
    23. 銆愬姛鑳芥敼閫犮戞彁绀轰俊鎭仠鐣欐椂闂村欢闀;
    24. +
    25. 銆愬姛鑳芥敼閫犮戦槻姝QL娉ㄥ叆澶勭悊;
    26. +
    27. 銆愬姛鑳芥敼閫犮慸ruid鎵弿鎺掗櫎璧勬簮淇敼,durid鏁版嵁婧愰厤缃紭鍖;
    28. +
    29. 銆愬姛鑳芥敼閫犮戞潈闄愭嫤鎴櫒閲嶆瀯浼樺寲
    30. +
    31. 銆愬姛鑳芥敼閫犮戦噸鏋勭櫥褰曢昏緫;
    32. +
    33. 銆愬姛鑳芥敼閫犮戝垪琛ㄨ繑鍥瀓son杩涜gzip鍘嬬缉锛屾彁楂樺姞杞介熷害;
    34. +
    35. 銆愬姛鑳芥敼閫犮戝湪绾挎竻绌虹敤鎴风櫥褰曟潈闄愮紦瀛;
    36. +
    37. 銆愬姛鑳芥敼閫犮戦噸鏋剅edis缂撳瓨鍔熻兘;
    38. +
    39. 銆愬姛鑳芥敼閫犮戝湪绾挎枃妗i瑙堟晥鏋滀紭鍖;
    40. +
    41. 銆愬姛鑳芥敼閫犮戠畝鍖杔og4j12閰嶇疆銆乭ighchart 鍥剧墖瀵煎嚭渚濊禆淇敼閲囩敤瀹樹粨;
    42. +
    43. 銆愬姛鑳芥敼閫犮戞紨绀篸emo鏁堟灉浼樺寲;
    44. +
    45. 銆愬姛鑳芥敼閫犮慾acob鍗囩骇鐗堟湰锛岄噰鐢ㄥ畼浠搈aven;
    46. +
    47. 銆愬姛鑳芥敼閫犮戦噸鏋刼nline鎶ヨ〃锛岄氱敤鏂规硶鎶藉彇缁熶竴缁存姢[瑙f瀽瀛楀吀鏀寔缂撳瓨銆佽В鏋怱QL瀛楁銆佽В鏋怱QL瀛楁鍙傛暟]锛屼紭鍖朥I鏁堟灉;
    48. +
    49. 銆愬姛鑳芥敼閫犮戦噸鏋剋ebupload涓婁紶鍔熻兘;
    50. +
    51. 銆愬姛鑳芥敼閫犮戜笅鎷夐粯璁よ閫夋嫨鍘绘帀锛岄粯璁や负绌猴紝缇庡寲椤甸潰鏁堟灉;
    52. +
    53. 銆愬姛鑳芥敼閫犮慴ootstrap-table琛ㄥ崟锛屽垪琛ㄦ寜閽浘鏍囨牱寮忓拰ace锛宧plus淇濇寔缁熶竴;
    54. +
    55. 銆怐emo銆慴oostrap鎶ヨ〃甯冨眬锛屽祵濂楀涓姤琛ㄧず渚;
    56. +
    57. 銆怋UG銆慐lemetUI鐗堟湰闂淇;
    58. +
    59. 銆怋UG銆憂aturebt浠g爜鐢熸垚鍣ㄥ崟琛ㄦ枃浠朵笂浼犮乪xcel瀵煎叆锛屼竴瀵瑰楠岃瘉settimeout闂淇;
    60. +
    61. 銆怋UG銆戝垎甯冨紡閮ㄧ讲涓嶆敮鎸乺edis鍏变韩 闆嗙兢閮ㄧ讲闂淇;
    62. +
    63. 銆怋UG銆憃nline鍒犻櫎鏂囦欢confirm寮规z-index涓嶈冻瀵艰嚧琚伄鎸;
    64. +
    65. 銆怋UG銆戜唬鐮佺敓鎴愬櫒radio锛宑heckbox瀹藉害鏍峰紡淇;
    66. +
    67. 銆怋UG銆戜唬鐮佺敓鎴愬櫒澶氬垪琛ㄧ骇鑱旈鏍糵orm椤甸潰甯︽枃浠舵彁浜ゅ脊妗嗕笉鍏抽棴闂淇;
    68. +
    69. 銆怋UG銆戣寖鍥存煡璇ouble绫诲瀷瀛楁閿欒闂;
    70. +
    71. 銆怋UG銆戞秷鎭ā鏉 鏌ヨ鎸夐挳 鏀逛负 鏌ョ湅;
    72. +
    73. 銆怋UG銆戝琛ㄥご鍒楄〃 瀹℃牳寮规澶у皬璋冩暣;
    74. +
    75. 銆怋UG銆戦儴闂ㄤ簩绾х鐞嗗憳锛岄儴闂ㄨ鑹插湪绯荤粺瑙掕壊鍒楄〃涓樉绀洪棶棰樹慨姝;
    76. +
    77. 銆怋UG銆憃nline鎵╁睍鍙傛暟鐢ㄦ硶闂淇;
    78. +
    79. 銆怋UG銆慤E缂栬緫鍣ㄥ浘鐗 鍥炴樉闂淇;
    80. +
    81. 銆怋UG銆戝浘鐗囦笂浼燽lob绫诲瀷鎶ラ敊闂淇;
    82. +
    83. 銆怋UG銆戜慨鏀圭櫥褰曢昏緫锛岃В鍐抽噸澶嶆墽琛宭ogin闂锛岀畝鍖栦唬鐮;
    84. +
    85. 銆怋UG銆戝畾鏃朵换鍔℃棩蹇楀寘鍐茬獊闂淇;
    86. +
    87. 銆怋UG銆戞浛鎹㈠畼鏂逛粨搴撶増鏈琭reemarker,閲囩敤classic_compatible=true瑙e喅绌烘寚閽堟姤閿欓棶棰;
    88. +
    89. 銆怋UG銆戦粦鍚嶅崟鏁版嵁鎺掗噸澶勭悊;
    90. +
    91. 銆怋UG銆憉ploadify涓婁紶鎺т欢琚殣钘忓鑷翠笂浼犲け璐ラ棶棰樹慨姝;
    92. +
    93. 銆怋UG銆戝崟琛ㄤ唬鐮佺敓鎴愬櫒锛岃佺増NOPOP椋庢牸 鐢熸垚鐨勪唬鐮佹煡鐪嬪姛鑳藉瓨鍦ㄦ彁浜ゆ寜閽棶棰樹慨姝;
    94. +
    95. 銆怋UG銆戝悎璁¢噾棰濆睍绀哄崈鍒嗕綅鏍煎紡 濡傦細61,100.00 鏄剧ず闂淇;
    96. +
    97. 銆怋UG銆憊ue 閲囩敤validform鏍¢獙锛岄噸澶嶆牎楠屾彁浜heck涓嶄綇闂淇;
    98. +
    99. 銆怋UG銆戞潈闄愰昏緫娌℃湁閽堝缁勭粐鏈烘瀯鐨勮鑹茶繘琛屾帶鍒堕棶棰樹慨姝;
    100. +
    101. 銆怋UG銆憃nline寮鍙,鑷畾涔夋寜閽樉绀鸿〃杈惧紡涓嶈捣浣滅敤闂淇;
    102. +
    103. 銆怋UG銆戞敞閲婂畾鏃朵换鍔¤皟搴﹀櫒鍚姩瑙e喅鎶涘嚭寮傚父闂淇;
    104. +
    105. 銆怋UG銆慹lement-ui 浠g爜鐢熸垚鍣ㄩ仐鐣欓棶棰樹慨姝;
    106. +
    107. 銆怋UG銆戞暟鎹瓧鍏搁」褰曞叆瀛楀吀code閲嶅鏍¢獙闂淇;
    108. +
    109. 銆怋UG銆戠敤鎴风紪杈戦〉闈紝绯荤粺瑙掕壊鍒楄〃涓嶉渶瑕佹樉绀烘帴鍙h鑹蹭俊鎭;
    110. +
    111. 銆怋UG銆戜竴绯诲垪璁哄潧缃戝弸闂瑙e喅;
    112. +
    +
    +
    +
    +
    +
    +
    + v3.7.52018.05.17 +
    +
    +
    姝ょ増鏈彁渚涙柊涓浠i鏍间唬鐮佺敓鎴愬櫒妯℃澘锛岄噰鐢╒ue鎶鏈紝鎻愪緵涓ゅ绮剧編妯℃澘 ElementUI椋庢牸銆丅ootstrap椋庢牸锛岃拷閫愭疆娴佹妧鏈敮鎸佺Щ鍔ㄧ锛
      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(绫籑ybatis) + Easyui(UI搴)+ Jquery + Boostrap + Ehcache + Redis + Ztree绛夊熀纭鏋舵瀯,閲囩敤闈㈠悜澹版槑鐨勫紑鍙戞ā寮忥紝 鍩轰簬娉涘瀷缂栧啓鏋佸皯浠g爜鍗冲彲瀹炵幇澶嶆潅鐨勬暟鎹睍绀恒佹暟鎹紪杈戙佽〃鍗曞鐞嗙瓑鍔熻兘锛屽啀閰嶅悎浠g爜鐢熸垚鍣ㄧ殑浣跨敤,灏咼2EE鐨勫紑鍙戞晥鐜囨彁楂6鍊嶄互涓婏紝鍙互灏嗕唬鐮佸噺灏60%浠ヤ笂銆
      • -
      • JEECG_v_3.7.5-beta 鍔熻兘鐐: 1.浠g爜鐢熸垚鍣 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.浠g爜鐢熸垚鍣 2.鏁版嵁鏉冮檺 3.Online琛ㄥ崟 4.宸ヤ綔娴佺粍浠 5.绉诲姩OA 6.EasyPOI宸ュ叿绫 7.鏌ヨ杩囨护鍣 8.UI搴 9.鍥介檯鍖 10.澶氭暟鎹簮 11.鑷畾涔夎〃鍗 12.鍦ㄧ嚎鎶ヨ〃 13.绉诲姩鎶ヨ〃 14.鏃ュ織鐩戞帶 15.棣栭〉鍒囨崲 16.鎻掍欢寮鍙
      • [1].浠g爜鐢熸垚鍣紝鏀寔澶氱鏁版嵁妯″瀷,鏍规嵁琛ㄧ敓鎴愬搴旂殑Entity,Service,Dao,Action,JSP绛,澧炲垹鏀规煡鍔熻兘鐢熸垚鐩存帴浣跨敤
      • [2].鐢ㄦ埛鏉冮檺锛屽己澶ф暟鎹潈闄new锛屾敮鎸佺簿缁嗗寲鏁版嵁鏉冮檺鎺у埗锛屾帶鍒跺埌琛岀骇锛屽垪琛ㄧ骇锛岃〃鍗曞瓧娈电骇锛屽疄鐜颁笉鍚屼汉鐪嬩笉鍚屾暟鎹紝涓嶅悓浜哄鍚屼竴涓〉闈㈡搷浣滀笉鍚屽瓧娈
      • [3].Online琛ㄥ崟锛岄氳繃鍦ㄧ嚎閰嶇疆瀹炵幇琛ㄦā鍨嬬殑澧炲垹鏀规煡鍔熻兘锛岄浂浠g爜锛屾敮鎸佺敤鎴疯嚜瀹氫箟琛ㄥ崟椋庢牸锛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鏄竴娆惧熀浜庝唬鐮佺敓鎴愬櫒鐨凧2EE蹇熷紑鍙戝钩鍙帮紝寮婧愮晫鈥滃皬鏅厓鈥濊秴瓒婁紶缁熷晢涓氫紒涓氱骇寮鍙戝钩鍙般傚紩棰嗘柊鐨勫紑鍙戞ā寮(Online Coding妯″紡(鑷畾涔夎〃鍗)->浠g爜鐢熸垚鍣ㄦā寮->鎵嬪伐MERGE鏅鸿兘寮鍙)锛 鍙互甯姪瑙e喅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
        -
        +
        +
        +
        姝ょ増鏈彁渚涙柊涓浠i鏍间唬鐮佺敓鎴愬櫒妯℃澘锛岄噰鐢╒ue鎶鏈紝鎻愪緵涓ゅ绮剧編妯℃澘 ElementUI椋庢牸銆丅ootstrap椋庢牸锛岃拷閫愭疆娴佹妧鏈敮鎸佺Щ鍔ㄧ锛
        +
          +
        1. 銆愬姛鑳藉崌绾с戞柊涓浠 (鍗曡〃/涓瀵瑰) 浠g爜鐢熸垚鍣ㄦā鏉匡紝Vue+ElementUI椋庢牸鍔熻兘浼樺寲鍗囩骇;
        2. +
        3. 銆愬姛鑳藉崌绾с戞柊涓浠 (鍗曡〃) 浠g爜鐢熸垚鍣ㄦā鏉匡紝Bootstrap琛ㄥ崟+EasyUI鍘熺敓鎬佸垪琛ㄩ鏍煎姛鑳戒紭鍖栧崌绾;
        4. +
        5. 銆愬姛鑳藉崌绾с戞柊涓浠 (涓瀵瑰) 浠g爜鐢熸垚鍣ㄦā鏉匡紝ElementUI琛ㄥ崟+EasyUI鍘熺敓鎬佸垪琛ㄩ鏍煎姛鑳戒紭鍖栧崌绾;
        6. +
        7. 銆愬姛鑳藉崌绾с戞柊涓浠 (涓瀵瑰) 浠g爜鐢熸垚鍣ㄦā鏉匡紝EasyUI鏍囩鍒楄〃涓婁笅甯冨眬(鍒楄〃鏁版嵁缂栬緫)+Table椋庢牸琛ㄥ崟鍔熻兘浼樺寲鍗囩骇;
        8. +
        9. 銆愬姛鑳藉崌绾с戠墰鐗涘弶鍔熻兘 -> Datagrid鏍囩鍗囩骇,閫氳繃鍙傛暟component鍙互蹇熷疄鐜癇ootstrapTable涓巈asyUI鍒楄〃椋庢牸鍒囨崲鍔熻兘浼樺寲鍗囩骇;
        10. +
        11. 銆愬姛鑳藉崌绾с戝畾鏃朵换鍔℃敮鎸佺増鏈崌绾;
        12. +
        13. 銆愬姛鑳藉崌绾с戝畾鏃朵换鍔★紝澶氫釜tomcat閮ㄧ讲涓鍙版湇鍔″櫒鐨勮В鍐虫柟妗堝崌绾;
        14. +
        15. 銆愬姛鑳芥敼閫犮戞柊鐗堜唬鐮佺敓鎴愬櫒妯℃澘鏂囦欢鎵╁睍鍚嶉澶勭悊,鎵╁睍鍚嶇粺涓澧炲姞瀛楁瘝鈥渋鈥;
        16. +
        17. 銆愬姛鑳芥敼閫犮戞竻鐞唄plus/js/plugins涓嬬殑鎻掍欢;
        18. +
        19. 銆愬姛鑳芥敼閫犮戝皢涓嶅父鏀圭殑js缁勪欢鏀捐繘jar鍖 jeecg-plugin-in,鍑忓皯eclipse check js;
        20. +
        21. 銆愬姛鑳芥敼閫犮戝垹闄ゆ棤鐢ㄧ殑浠g爜锛屽噺灏戦」鐩甹ar渚濊禆;
        22. +
        23. 銆愬姛鑳芥敼閫犮戞彁绀轰俊鎭仠鐣欐椂闂村欢闀;
        24. +
        25. 銆愬姛鑳芥敼閫犮戦槻姝QL娉ㄥ叆澶勭悊;
        26. +
        27. 銆愬姛鑳芥敼閫犮慸ruid鎵弿鎺掗櫎璧勬簮淇敼,durid鏁版嵁婧愰厤缃紭鍖;
        28. +
        29. 銆愬姛鑳芥敼閫犮戞潈闄愭嫤鎴櫒閲嶆瀯浼樺寲
        30. +
        31. 銆愬姛鑳芥敼閫犮戦噸鏋勭櫥褰曢昏緫;
        32. +
        33. 銆愬姛鑳芥敼閫犮戝垪琛ㄨ繑鍥瀓son杩涜gzip鍘嬬缉锛屾彁楂樺姞杞介熷害;
        34. +
        35. 銆愬姛鑳芥敼閫犮戝湪绾挎竻绌虹敤鎴风櫥褰曟潈闄愮紦瀛;
        36. +
        37. 銆愬姛鑳芥敼閫犮戦噸鏋剅edis缂撳瓨鍔熻兘;
        38. +
        39. 銆愬姛鑳芥敼閫犮戝湪绾挎枃妗i瑙堟晥鏋滀紭鍖;
        40. +
        41. 銆愬姛鑳芥敼閫犮戠畝鍖杔og4j12閰嶇疆銆乭ighchart 鍥剧墖瀵煎嚭渚濊禆淇敼閲囩敤瀹樹粨;
        42. +
        43. 銆愬姛鑳芥敼閫犮戞紨绀篸emo鏁堟灉浼樺寲;
        44. +
        45. 銆愬姛鑳芥敼閫犮慾acob鍗囩骇鐗堟湰锛岄噰鐢ㄥ畼浠搈aven;
        46. +
        47. 銆愬姛鑳芥敼閫犮戦噸鏋刼nline鎶ヨ〃锛岄氱敤鏂规硶鎶藉彇缁熶竴缁存姢[瑙f瀽瀛楀吀鏀寔缂撳瓨銆佽В鏋怱QL瀛楁銆佽В鏋怱QL瀛楁鍙傛暟]锛屼紭鍖朥I鏁堟灉;
        48. +
        49. 銆愬姛鑳芥敼閫犮戦噸鏋剋ebupload涓婁紶鍔熻兘;
        50. +
        51. 銆愬姛鑳芥敼閫犮戜笅鎷夐粯璁よ閫夋嫨鍘绘帀锛岄粯璁や负绌猴紝缇庡寲椤甸潰鏁堟灉;
        52. +
        53. 銆愬姛鑳芥敼閫犮慴ootstrap-table琛ㄥ崟锛屽垪琛ㄦ寜閽浘鏍囨牱寮忓拰ace锛宧plus淇濇寔缁熶竴;
        54. +
        55. 銆怐emo銆慴oostrap鎶ヨ〃甯冨眬锛屽祵濂楀涓姤琛ㄧず渚;
        56. +
        57. 銆怋UG銆慐lemetUI鐗堟湰闂淇;
        58. +
        59. 銆怋UG銆憂aturebt浠g爜鐢熸垚鍣ㄥ崟琛ㄦ枃浠朵笂浼犮乪xcel瀵煎叆锛屼竴瀵瑰楠岃瘉settimeout闂淇;
        60. +
        61. 銆怋UG銆戝垎甯冨紡閮ㄧ讲涓嶆敮鎸乺edis鍏变韩 闆嗙兢閮ㄧ讲闂淇;
        62. +
        63. 銆怋UG銆憃nline鍒犻櫎鏂囦欢confirm寮规z-index涓嶈冻瀵艰嚧琚伄鎸;
        64. +
        65. 銆怋UG銆戜唬鐮佺敓鎴愬櫒radio锛宑heckbox瀹藉害鏍峰紡淇;
        66. +
        67. 銆怋UG銆戜唬鐮佺敓鎴愬櫒澶氬垪琛ㄧ骇鑱旈鏍糵orm椤甸潰甯︽枃浠舵彁浜ゅ脊妗嗕笉鍏抽棴闂淇;
        68. +
        69. 銆怋UG銆戣寖鍥存煡璇ouble绫诲瀷瀛楁閿欒闂;
        70. +
        71. 銆怋UG銆戞秷鎭ā鏉 鏌ヨ鎸夐挳 鏀逛负 鏌ョ湅;
        72. +
        73. 銆怋UG銆戝琛ㄥご鍒楄〃 瀹℃牳寮规澶у皬璋冩暣;
        74. +
        75. 銆怋UG銆戦儴闂ㄤ簩绾х鐞嗗憳锛岄儴闂ㄨ鑹插湪绯荤粺瑙掕壊鍒楄〃涓樉绀洪棶棰樹慨姝;
        76. +
        77. 銆怋UG銆憃nline鎵╁睍鍙傛暟鐢ㄦ硶闂淇;
        78. +
        79. 銆怋UG銆慤E缂栬緫鍣ㄥ浘鐗 鍥炴樉闂淇;
        80. +
        81. 銆怋UG銆戝浘鐗囦笂浼燽lob绫诲瀷鎶ラ敊闂淇;
        82. +
        83. 銆怋UG銆戜慨鏀圭櫥褰曢昏緫锛岃В鍐抽噸澶嶆墽琛宭ogin闂锛岀畝鍖栦唬鐮;
        84. +
        85. 銆怋UG銆戝畾鏃朵换鍔℃棩蹇楀寘鍐茬獊闂淇;
        86. +
        87. 銆怋UG銆戞浛鎹㈠畼鏂逛粨搴撶増鏈琭reemarker,閲囩敤classic_compatible=true瑙e喅绌烘寚閽堟姤閿欓棶棰;
        88. +
        89. 銆怋UG銆戦粦鍚嶅崟鏁版嵁鎺掗噸澶勭悊;
        90. +
        91. 銆怋UG銆憉ploadify涓婁紶鎺т欢琚殣钘忓鑷翠笂浼犲け璐ラ棶棰樹慨姝;
        92. +
        93. 銆怋UG銆戝崟琛ㄤ唬鐮佺敓鎴愬櫒锛岃佺増NOPOP椋庢牸 鐢熸垚鐨勪唬鐮佹煡鐪嬪姛鑳藉瓨鍦ㄦ彁浜ゆ寜閽棶棰樹慨姝;
        94. +
        95. 銆怋UG銆戝悎璁¢噾棰濆睍绀哄崈鍒嗕綅鏍煎紡 濡傦細61,100.00 鏄剧ず闂淇;
        96. +
        97. 銆怋UG銆憊ue 閲囩敤validform鏍¢獙锛岄噸澶嶆牎楠屾彁浜heck涓嶄綇闂淇;
        98. +
        99. 銆怋UG銆戞潈闄愰昏緫娌℃湁閽堝缁勭粐鏈烘瀯鐨勮鑹茶繘琛屾帶鍒堕棶棰樹慨姝;
        100. +
        101. 銆怋UG銆憃nline寮鍙,鑷畾涔夋寜閽樉绀鸿〃杈惧紡涓嶈捣浣滅敤闂淇;
        102. +
        103. 銆怋UG銆戞敞閲婂畾鏃朵换鍔¤皟搴﹀櫒鍚姩瑙e喅鎶涘嚭寮傚父闂淇;
        104. +
        105. 銆怋UG銆慹lement-ui 浠g爜鐢熸垚鍣ㄩ仐鐣欓棶棰樹慨姝;
        106. +
        107. 銆怋UG銆戞暟鎹瓧鍏搁」褰曞叆瀛楀吀code閲嶅鏍¢獙闂淇;
        108. +
        109. 銆怋UG銆戠敤鎴风紪杈戦〉闈紝绯荤粺瑙掕壊鍒楄〃涓嶉渶瑕佹樉绀烘帴鍙h鑹蹭俊鎭;
        110. +
        111. 銆怋UG銆戜竴绯诲垪璁哄潧缃戝弸闂瑙e喅;
        112. +
        +
        +
        +
        +
        +
        +
        + v3.7.52018.05.17 +
        +
        +
        姝ょ増鏈彁渚涙柊涓浠i鏍间唬鐮佺敓鎴愬櫒妯℃澘锛岄噰鐢╒ue鎶鏈紝鎻愪緵涓ゅ绮剧編妯℃澘 ElementUI椋庢牸銆丅ootstrap椋庢牸锛岃拷閫愭疆娴佹妧鏈敮鎸佺Щ鍔ㄧ锛
          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淇敼涓篶ombotree - - update-end--Author:zhangguoming Date:20140826 for锛氬皢combobox淇敼涓篶ombotree - - - - - - - - - 閫夋嫨 - 娓呯┖ - -
        - - - - -
        -
        - - -
        - - - -
        - - 濉啓浼犵湡 -
        - - 濉啓鑱旂郴鍦板潃 -
        - - 濉啓閭紪
        - - - -
        - - - 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鐨刯unit娴嬭瘯绫 - * @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项目的插件工程 该工程把jeecg-framework项目plug-in目录下不常用的插件迁移到此处,如需修改引入此工程修改。 \ 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. 入门开发环境搭建