为高考学子加油,JEECG 3.7.6 高考性能加强版本发布

jeecg_3.7.6
zhangdaihao 6 years ago
parent a4e0a72a15
commit 13777cbd4c

@ -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
* <b>技术点二十五:</b>支持二级管理员,权限细化管理</br>
* <b>技术点二十六:</b>代码生成器支持resutful接口生成</br>
* JEECG V3.7.5 beta, 经过了专业压力测试,性能测试,保证后台数据的准确性和页面访问速度</br>
* JEECG V3.7.6, 经过了专业压力测试,性能测试,保证后台数据的准确性和页面访问速度</br>
* 支持多种浏览器: IE, 火狐, Google 等</br>
* 支持数据库: Mysql,Oracle,Postgre,SqlServer等</br>
* 基础权限: 用户,角色,菜单权限,按钮权限,数据权限</br>

@ -4,13 +4,13 @@ Navicat MySQL Data Transfer
Source Server : mysql
Source Server Version : 50037
Source Host : 127.0.0.1:3306
Source Database : jeecg_3_7_5
Source Database : jeecg_3_7_6
Target Server Type : MYSQL
Target Server Version : 50037
File Encoding : 65001
Date: 2018-05-19 16:40:58
Date: 2018-06-06 20:37:32
*/
SET FOREIGN_KEY_CHECKS=0;
@ -1021,7 +1021,7 @@ CREATE TABLE `jeecg_demo` (
`name` varchar(255) NOT NULL COMMENT '名称',
`age` int(10) default NULL COMMENT '年龄',
`birthday` datetime default NULL COMMENT '生日',
`content` varchar(255) default NULL COMMENT '个人介绍',
`content` text COMMENT '个人介绍',
`dep_id` varchar(255) default NULL COMMENT '部门',
`email` varchar(255) default NULL COMMENT '邮箱',
`phone` varchar(255) default NULL COMMENT '电话',
@ -1705,7 +1705,7 @@ CREATE TABLE `jform_graphreport_head` (
`update_by` varchar(50) default NULL,
`update_name` varchar(100) default NULL,
PRIMARY KEY (`id`),
KEY `index_code` (`code`)
UNIQUE KEY `index_code` (`code`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
@ -3059,21 +3059,14 @@ CREATE TABLE `t_s_black_list` (
`sys_company_code` varchar(50) default NULL COMMENT '所属公司',
`bpm_status` varchar(32) default '1' COMMENT '流程状态',
`ip` varchar(32) default NULL COMMENT 'ip地址',
PRIMARY KEY (`id`)
PRIMARY KEY (`id`),
UNIQUE KEY `unique_key_ip` (`ip`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of t_s_black_list
-- ----------------------------
INSERT INTO `t_s_black_list` VALUES ('402881e75f91017e015f91023f7c0001', '管理员', 'admin', '2017-11-06 19:06:04', null, null, null, 'A03', 'A03', '1', '192.1562.1.1');
INSERT INTO `t_s_black_list` VALUES ('402881e75f947fc7015f9481be250004', '管理员', 'admin', '2017-11-06 14:53:22', '管理员', 'admin', '2018-05-19 14:03:18', 'A03', 'A03', '1', '1.0.0.1');
INSERT INTO `t_s_black_list` VALUES ('402881e75f948375015f94842cc30001', '管理员', 'admin', '2017-11-06 14:53:22', null, null, null, 'A03', 'A03', '1', '1.0.0.1');
INSERT INTO `t_s_black_list` VALUES ('402881e75f94878e015f948921d30001', '管理员', 'admin', '2017-11-06 18:53:22', null, null, null, 'A03', 'A03', '1', '1.0.0.1');
INSERT INTO `t_s_black_list` VALUES ('402881e75f94878e015f94896bb80002', '管理员', 'admin', '2017-11-06 00:00:00', null, null, null, 'A03', 'A03', '1', '1.0.0.1');
INSERT INTO `t_s_black_list` VALUES ('402881e75f949b19015f949cde920001', '管理员', 'admin', '2017-11-11 14:53:22', null, null, null, 'A03', 'A03', '1', '1.0.0.1');
INSERT INTO `t_s_black_list` VALUES ('402881e75f949b19015f949d07ad0002', '管理员', 'admin', '2017-11-11 00:00:00', null, null, null, 'A03', 'A03', '1', '1.0.0.1');
INSERT INTO `t_s_black_list` VALUES ('402881e75f94a099015f94a1c66e0001', '管理员', 'admin', '2017-11-11 14:53:22', null, null, null, 'A03', 'A03', '1', '1.0.0.1');
INSERT INTO `t_s_black_list` VALUES ('402881e75f94a099015f94a1dd040002', '管理员', 'admin', '2017-11-11 00:00:00', null, null, null, 'A03', 'A03', '1', '1.0.0.1');
INSERT INTO `t_s_black_list` VALUES ('402881e75f94a099015f94afe9700003', '管理员', 'admin', '2017-11-07 12:14:37', null, null, '2017-11-11 08:00:00', 'A03', 'A03', '1', '1.0.0.1');
INSERT INTO `t_s_black_list` VALUES ('402881e75fa48e5b015fa494806a0002', '管理员', 'admin', '2017-11-12 06:14:12', null, null, null, 'A03', 'A03', '1', '2.2.2.2');
INSERT INTO `t_s_black_list` VALUES ('402881e75fa48e5b015fa49494680003', '管理员', 'admin', '2017-11-12 06:14:12', null, null, null, 'A03', 'A03', '1', '2.2.2.3');
@ -3232,7 +3225,6 @@ INSERT INTO `t_s_data_rule` VALUES ('4028ab775dca0d1b015dca4183530018', '表名
INSERT INTO `t_s_data_rule` VALUES ('402880ec5ddec439015ddf9225060038', '复杂关系', '', 'USE_SQL_RULES', 'name like \'%%\' or age > 10', null, null, null, '2017-08-14 15:10:25', 'demo', 'demo', '40288088481d019401481d2fcebf000d');
INSERT INTO `t_s_data_rule` VALUES ('402880ec5ddfdd26015ddfe3e0570011', '复杂sql配置', '', 'USE_SQL_RULES', 'table_name like \'%test%\' or is_tree = \'Y\'', null, null, null, '2017-08-14 16:38:55', 'demo', 'demo', '4028ab775dca0d1b015dca3fccb60016');
INSERT INTO `t_s_data_rule` VALUES ('40283181614231d401614234fe670003', 'createBy', 'createBy', '=', '#{sys_user_code}', '2018-01-29 21:57:04', 'admin', '管理员', null, null, null, '40283181614231d401614232cd1c0001');
INSERT INTO `t_s_data_rule` VALUES ('4028318161424e730161424fca6f0004', 'createBy', 'createBy', '=', '#{sys_user_code}', '2018-01-29 22:26:20', 'admin', '管理员', null, null, null, '4028318161424e730161424f61510002');
INSERT INTO `t_s_data_rule` VALUES ('402881e56266f43101626727aff60067', '销售自己看自己的数据', 'createBy', '=', '#{sys_user_code}', '2018-03-27 19:11:16', 'admin', '管理员', null, null, null, '402881e56266f43101626724eb730065');
INSERT INTO `t_s_data_rule` VALUES ('402881e56266f4310162672fb1a70082', '销售经理看所有下级数据', 'sysOrgCode', 'LIKE', '#{sys_org_code}', '2018-03-27 19:20:01', 'admin', '管理员', null, null, null, '402881e56266f43101626724eb730065');
INSERT INTO `t_s_data_rule` VALUES ('402881e56266f431016267387c9f0088', '只看金额大于1000的数据', 'money', '>=', '1000', '2018-03-27 19:29:37', 'admin', '管理员', null, null, null, '402881e56266f43101626724eb730065');
@ -3496,7 +3488,6 @@ INSERT INTO `t_s_function` VALUES ('297e7ae162b925a20162b9271b300001', null, '1'
INSERT INTO `t_s_function` VALUES ('297edb626033bbcb016033fd0a190001', null, '1', 'Online组合查询配置', '6', 'superQueryMainController.do?list', '8a8ab0b246dc81120146dc8180ce0019', '8a8ab0b246dc81120146dc8180460000', '8a8ab0b246dc81120146dc8180dd001e', '0', '', 'admin', '管理员', 'admin', '2018-05-06 14:53:26', '2017-12-08 10:38:29', '管理员');
INSERT INTO `t_s_function` VALUES ('2c90ac564c9d1734014c9d6f4e370024', null, '1', 'menu.graph.configuration', '4', 'jformGraphreportHeadController.do?jformGraphreportHead', '8a8ab0b246dc81120146dc8180ce0019', '8a8ab0b246dc81120146dc8180460000', '8a8ab0b246dc81120146dc8180dd001e', '0', null, null, null, null, null, null, null);
INSERT INTO `t_s_function` VALUES ('40283181614231d401614232cd1c0001', null, '1', '移动报表数据权限', '9', 'cgDynamGraphConfigHeadController.do?datagrid', '402889fb486e848101486e8de3d60005', '8a8ab0b246dc81120146dc8180460000', '8a8ab0b246dc81120146dc8180dd001e', '0', '', 'admin', '管理员', 'admin', '2018-01-29 22:25:34', '2018-01-29 21:54:41', '管理员');
INSERT INTO `t_s_function` VALUES ('4028318161424e730161424f61510002', null, '1', '在线报表权限', '10', 'jformGraphreportHeadController.do?datagrid', '402889fb486e848101486e8de3d60005', '8a8ab0b246dc81120146dc8180460000', '8a8ab0b246dc81120146dc8180dd001e', '0', '', 'admin', '管理员', null, null, '2018-01-29 22:25:54', null);
INSERT INTO `t_s_function` VALUES ('40284a815b48b411015b48b56fd80001', null, '1', '动态tab设计', '24', 'jeecgFormDemoController.do?ueditor', '4028f6815af3ce54015af3d1ad610001', '8a8ab0b246dc81120146dc8180460000', '8a8ab0b246dc81120146dc8180dd001e', '0', 'icon-bug', null, null, 'admin', '2017-11-14 11:32:23', null, '管理员');
INSERT INTO `t_s_function` VALUES ('40284a815bb75d7b015bb7607ba00001', null, '1', '电子签章', '25', 'jeecgFormDemoController.do?eSign', '4028f6815af3ce54015af3d1ad610001', '8a8ab0b246dc81120146dc8180460000', '8a8ab0b246dc81120146dc8180dd001e', '0', 'fa-empire', 'admin', '管理员', 'admin', '2017-11-14 11:32:52', '2017-04-29 09:43:25', '管理员');
INSERT INTO `t_s_function` VALUES ('40284a815c1bac76015c1bc02abe0003', null, '1', '黑名单管理', '9', 'tsBlackListController.do?list', '8a8ab0b246dc81120146dc8180d9001d', '8a8ab0b246dc81120146dc8180460000', '8a8ab0b246dc81120146dc8180dd001e', '0', '', null, null, 'admin', '2018-05-06 17:02:49', null, '管理员');
@ -3570,6 +3561,9 @@ INSERT INTO `t_s_function` VALUES ('402881f4606cc3d501606cd07a520005', null, '1'
INSERT INTO `t_s_function` VALUES ('402881f4609299ad0160929ab2e00001', null, '1', '二级管理员', '6', '', '8a8ab0b246dc81120146dc8180d2001a', '8a8ab0b246dc81120146dc8180460000', '8a8ab0b246dc81120146dc8180dd001e', '0', 'fa-group', 'admin', '管理员', 'admin', '2018-01-16 17:20:57', '2017-12-26 19:35:00', '管理员');
INSERT INTO `t_s_function` VALUES ('402881f462bcd9fe0162bcdd0e4c0001', null, '1', 'vue列表', '32', 'jeecgListDemoController.do?vueList', '4028f6815af3ce54015af3d1ad610001', '8a8ab0b246dc81120146dc8180460000', '8a8ab0b246dc81120146dc8180dd001e', '0', 'fa-vimeo-square', 'admin', '管理员', 'admin', '2018-05-06 14:56:17', '2018-04-13 10:37:07', '管理员');
INSERT INTO `t_s_function` VALUES ('402881f462fa6ee90162fa78deba0001', null, '1', 'vueBootstrap', '33', 'jeecgListDemoController.do?vueBootstrapTableList', '4028f6815af3ce54015af3d1ad610001', '8a8ab0b246dc81120146dc8180460000', '8a8ab0b246dc81120146dc8180dd001e', '0', 'fa-vimeo-square', 'admin', '管理员', 'admin', '2018-05-06 14:56:04', '2018-04-25 09:44:08', '管理员');
INSERT INTO `t_s_function` VALUES ('402881f463a591710163a5e59a830010', null, '2', '接口用户管理', '3', 'userController.do?interfaceUser', '402881fc60a07a350160a07cf68e0001', '8a8ab0b246dc81120146dc8180460000', '8a8ab0b246dc81120146dc8180dd001e', '0', '', 'admin', '管理员', null, null, '2018-05-28 16:37:58', null);
INSERT INTO `t_s_function` VALUES ('402881f463b4e5d20163b4f9a81b0001', null, '1', 'Bootstrap布局报表', '34', 'jeecgListDemoController.do?bootStrapEchartsDemo', '8a8ab0b246dc81120146dc8180d4001b', '8a8ab0b246dc81120146dc8180460000', '8a8ab0b246dc81120146dc8180dd001e', '0', '', 'admin', '管理员', 'admin', '2018-05-31 19:48:06', '2018-05-31 14:54:10', '管理员');
INSERT INTO `t_s_function` VALUES ('402881f463b56b950163b5aefcdb0002', null, '1', '自定义嵌套子表列表', '35', 'jfromOrderController.do?gridViewlist', '4028f6815af3ce54015af3d1ad610001', '8a8ab0b246dc81120146dc8180460000', '8a8ab0b246dc81120146dc8180dd001e', '0', '', 'admin', '管理员', null, null, '2018-05-31 18:12:14', null);
INSERT INTO `t_s_function` VALUES ('402881f66260fc8e016260ffdde70001', null, '1', '上下布局表单二', '21', 'jformOrderMain2Controller.do?index', '4028f6815af3ce54015af3d1ad610001', '8a8ab0b246dc81120146dc8180460000', '8a8ab0b246dc81120146dc8180dd001e', '0', 'fa-facebook-official', 'admin', '管理员', 'admin', '2018-05-06 15:39:26', '2018-03-26 14:30:04', '管理员');
INSERT INTO `t_s_function` VALUES ('402881fc60a07a350160a07cf68e0001', null, '1', '接口权限', '6', '', '8a8ab0b246dc81120146dc8180d2001a', '8a8ab0b246dc81120146dc8180460000', '8a8ab0b246dc81120146dc8180dd001e', '0', 'fa-share-alt', 'admin', '管理员', 'admin', '2018-01-16 17:20:36', '2017-12-29 12:17:12', '管理员');
INSERT INTO `t_s_function` VALUES ('402881fc60a07a350160a07d4f860003', null, '2', '接口权限管理', '1', 'interfaceController.do?interface', '402881fc60a07a350160a07cf68e0001', '8a8ab0b246dc81120146dc8180460000', '8a8ab0b246dc81120146dc8180dd001e', '0', '', 'admin', '管理员', null, null, '2017-12-29 12:17:35', null);
@ -3614,6 +3608,7 @@ INSERT INTO `t_s_function` VALUES ('4028f6815af9fb56015af9fc51d30001', null, '1'
INSERT INTO `t_s_function` VALUES ('4028f6815afa8964015afa8a63e20001', null, '1', '行编辑列表', '4', 'jeecgListDemoController.do?rowListDemo', '4028f6815af3ce54015af3d1ad610001', '8a8ab0b246dc81120146dc8180460000', '8a8ab0b246dc81120146dc8180dd001e', '0', 'icon-frown', 'admin', '管理员', 'admin', '2018-05-06 15:00:17', '2017-03-23 17:40:57', '管理员');
INSERT INTO `t_s_function` VALUES ('4028f6815b0b1017015b0b1265cf0002', null, '2', '日志报表', '25', 'jeecgListDemoController.do?log', '4028810061f41d790161f4e293140015', '8a8ab0b246dc81120146dc8180460000', '8a8ab0b246dc81120146dc8180dd001e', '0', 'fa-pencil-square', null, null, 'admin', '2018-05-06 16:57:13', null, '管理员');
INSERT INTO `t_s_function` VALUES ('4028f681630b600701630bc1eee30030', null, '1', 'Easyui原生列表', '5', 'jeecgListDemoController.do?natureAceTableDemo', '4028f6815af3ce54015af3d1ad610001', '8a8ab0b246dc81120146dc8180460000', '8a8ab0b246dc81120146dc8180dd001e', '0', 'fa-code', 'admin', '管理员', 'admin', '2018-05-06 15:29:42', '2018-04-28 18:17:29', '管理员');
INSERT INTO `t_s_function` VALUES ('4028f68163b5547e0163b55616930001', null, '1', '上传重构demo', '34', 'jeecgFormDemoController.do?webuploader', '4028f6815af3ce54015af3d1ad610001', '8a8ab0b246dc81120146dc8180460000', '8a8ab0b246dc81120146dc8180dd001e', '0', '', 'admin', '管理员', null, null, '2018-05-31 16:35:08', null);
INSERT INTO `t_s_function` VALUES ('4028fbc65c3ab6e3015c3ab7ba690003', null, '1', '文件上传一', '14', 'commonController.do?listTurn&turn=system/document/filesList', '4028f6815af3ce54015af3d1ad610001', '8a8ab0b246dc81120146dc8180460000', '8a8ab0b246dc81120146dc8180dd001e', '0', 'fa-files-o', null, null, 'admin', '2018-05-06 15:07:01', null, '管理员');
INSERT INTO `t_s_function` VALUES ('4028fbc65c56ece6015c56f508300002', null, '1', '树形列表', '4', 'jeecgFormDemoController.do?function', '4028f6815af3ce54015af3d1ad610001', '8a8ab0b246dc81120146dc8180460000', '8a8ab0b246dc81120146dc8180dd001e', '0', 'fa-tree', null, null, 'admin', '2017-11-14 11:35:33', null, '管理员');
INSERT INTO `t_s_function` VALUES ('8a8ab0b246dc81120146dc8180ce0019', null, '0', 'online.develop', '5', '', null, '8a8ab0b246dc81120146dc8180890008', '8a8ab0b246dc81120146dc8180dd001e', '0', 'fa-cloud', null, null, 'admin', '2016-04-08 22:28:17', null, '管理员');
@ -14513,6 +14508,13 @@ INSERT INTO `t_s_log` VALUES ('4028608163773dd40163776268610012', 'Chrome', '错
INSERT INTO `t_s_log` VALUES ('4028608163773dd401637762890d0013', 'Chrome', '错误异常: ObjectNotFoundException,错误描述No row with the given identifier exists: [org.jeecgframework.web.system.pojo.base.TSFunction#4028838d5f351a87015f351fc33d0002]', '6', '本地', '2018-05-19 15:52:16', '3', '8a8ab0b246dc81120146dc8181950052', 'admin', '管理员');
INSERT INTO `t_s_log` VALUES ('4028608163773dd401637762e7190014', 'Chrome', '错误异常: ObjectNotFoundException,错误描述No row with the given identifier exists: [org.jeecgframework.web.system.pojo.base.TSFunction#4028838d5f351a87015f351fc33d0002]', '6', '本地', '2018-05-19 15:52:40', '3', '8a8ab0b246dc81120146dc8181950052', 'admin', '管理员');
INSERT INTO `t_s_log` VALUES ('4028608163773dd401637767f5c60015', 'Chrome', '错误异常: ObjectNotFoundException,错误描述No row with the given identifier exists: [org.jeecgframework.web.system.pojo.base.TSFunction#4028911b5c0bf9b9015c0c034d8e0013]', '6', '本地', '2018-05-19 15:58:11', '3', '8a8ab0b246dc81120146dc8181950052', 'admin', '管理员');
INSERT INTO `t_s_log` VALUES ('4028608163d50e5d0163d50eb6bd0000', 'Chrome', '用户: admin[JEECG开源社区]common.login.success', '1', '192.168.224.1', '2018-06-06 20:25:01', '1', '8a8ab0b246dc81120146dc8181950052', 'admin', '管理员');
INSERT INTO `t_s_log` VALUES ('4028608163d50e5d0163d50fc4310001', 'Chrome', '操作删除成功', '4', '本地', '2018-06-06 20:26:10', '1', '8a8ab0b246dc81120146dc8181950052', 'admin', '管理员');
INSERT INTO `t_s_log` VALUES ('4028608163d50e5d0163d50fd51f0002', 'Chrome', '菜单删除成功', '4', '本地', '2018-06-06 20:26:14', '1', '8a8ab0b246dc81120146dc8181950052', 'admin', '管理员');
INSERT INTO `t_s_log` VALUES ('4028608163d50e5d0163d50fe9ce0003', 'Chrome', 'admin', '2', '本地', '2018-06-06 20:26:19', '1', '8a8ab0b246dc81120146dc8181950052', 'admin', '管理员');
INSERT INTO `t_s_log` VALUES ('4028608163d50e5d0163d51004580004', 'Chrome', '用户: admin[JEECG开源社区]common.login.success', '1', '192.168.224.1', '2018-06-06 20:26:26', '1', '8a8ab0b246dc81120146dc8181950052', 'admin', '管理员');
INSERT INTO `t_s_log` VALUES ('4028608163d50e5d0163d510c7e40005', 'Chrome', 'admin', '2', '本地', '2018-06-06 20:27:16', '1', '8a8ab0b246dc81120146dc8181950052', 'admin', '管理员');
INSERT INTO `t_s_log` VALUES ('4028608163d50e5d0163d510dd7b0006', 'Chrome', '用户: admin[JEECG开源社区]common.login.success', '1', '192.168.224.1', '2018-06-06 20:27:22', '1', '8a8ab0b246dc81120146dc8181950052', 'admin', '管理员');
-- ----------------------------
-- Table structure for t_s_muti_lang
@ -15209,8 +15211,8 @@ INSERT INTO `t_s_muti_lang` VALUES ('4028ef81533051360153305c60c90008', 'form.te
INSERT INTO `t_s_muti_lang` VALUES ('4028ef815335c1da015335c8647d0003', 'self.defined.form', 'use defined form', 'en', '2016-03-02 13:23:58', 'admin', '管理员', null, null, null);
INSERT INTO `t_s_muti_lang` VALUES ('4028ef81533a788e01533a7a53180005', 'form.tb.db.table.name', 'table', 'en', '2016-03-03 11:16:48', 'admin', '管理员', '2016-03-03 11:17:56', 'admin', '管理员');
INSERT INTO `t_s_muti_lang` VALUES ('4028ef81533a788e01533a7ba98c0008', 'form.tb.db.key', 'db source', 'en', '2016-03-03 11:18:16', 'admin', '管理员', null, null, null);
INSERT INTO `t_s_muti_lang` VALUES ('4028ef81533c078201533c08b1ca0001', 'system.version.number', '3.7.5-beta', 'zh-cn', '2016-03-03 18:31:56', 'admin', '管理员', '2016-06-29 11:50:18', 'admin', '管理员');
INSERT INTO `t_s_muti_lang` VALUES ('4028ef81533c078201533c08e2370003', 'system.version.number', '3.7.5-beta', 'en', '2016-03-03 18:32:08', 'admin', '管理员', '2016-06-29 11:50:12', 'admin', '管理员');
INSERT INTO `t_s_muti_lang` VALUES ('4028ef81533c078201533c08b1ca0001', 'system.version.number', '3.7.6', 'zh-cn', '2016-03-03 18:31:56', 'admin', '管理员', '2016-06-29 11:50:18', 'admin', '管理员');
INSERT INTO `t_s_muti_lang` VALUES ('4028ef81533c078201533c08e2370003', 'system.version.number', '3.7.6', 'en', '2016-03-03 18:32:08', 'admin', '管理员', '2016-06-29 11:50:12', 'admin', '管理员');
INSERT INTO `t_s_muti_lang` VALUES ('4028ef8154753f26015475436db30001', 'common.returntxttype', 'return type', 'en', '2016-05-03 14:17:13', 'admin', '管理员', '2016-05-03 14:41:57', 'admin', '管理员');
INSERT INTO `t_s_muti_lang` VALUES ('4028ef8154753f26015475438dd00003', 'common.returntxttype', '返回类型', 'zh-cn', '2016-05-03 14:17:22', 'admin', '管理员', '2016-05-03 14:42:06', 'admin', '管理员');
INSERT INTO `t_s_muti_lang` VALUES ('4028efa2523a030601523a55381d0004', 'self.defined.form', '自定义表单', 'zh-cn', '2016-01-13 17:33:29', 'admin', '管理员', null, null, null);
@ -15221,8 +15223,8 @@ INSERT INTO `t_s_muti_lang` VALUES ('4028fc4d46c481da0146c4a15aa60003', 'common.
INSERT INTO `t_s_muti_lang` VALUES ('4028fc4d46c481da0146c4a190580005', 'common.calendar', 'Calendar', 'en', '2014-06-23 01:31:01', 'admin', '管理员', '2014-06-23 01:31:01', 'admin', '管理员');
INSERT INTO `t_s_muti_lang` VALUES ('4028fc4d46c481da0146c4a2dc220007', 'common.map', '地图', 'zh-cn', '2014-06-23 01:32:26', 'admin', '管理员', '2014-06-23 01:32:26', 'admin', '管理员');
INSERT INTO `t_s_muti_lang` VALUES ('4028fc4d46c481da0146c4a2f24e0009', 'common.map', 'Map', 'en', '2014-06-23 01:32:31', 'admin', '管理员', '2014-06-23 01:32:31', 'admin', '管理员');
INSERT INTO `t_s_muti_lang` VALUES ('4028fc4d46c481da0146c4aff7ea000b', 'common.please.select', '-- 请选择 --', 'zh-cn', '2014-06-23 01:46:45', 'admin', '管理员', '2017-11-06 10:37:16', 'admin', '管理员');
INSERT INTO `t_s_muti_lang` VALUES ('4028fc4d46c481da0146c4b03310000d', 'common.please.select', 'Please Select', 'en', '2014-06-23 01:47:00', 'admin', '管理员', '2014-06-23 02:01:20', 'admin', '管理员');
INSERT INTO `t_s_muti_lang` VALUES ('4028fc4d46c481da0146c4aff7ea000b', 'common.please.select', ' ', 'zh-cn', '2014-06-23 01:46:45', 'admin', '管理员', '2017-11-06 10:37:16', 'admin', '管理员');
INSERT INTO `t_s_muti_lang` VALUES ('4028fc4d46c481da0146c4b03310000d', 'common.please.select', ' ', 'en', '2014-06-23 01:47:00', 'admin', '管理员', '2014-06-23 02:01:20', 'admin', '管理员');
INSERT INTO `t_s_muti_lang` VALUES ('4028fc4d46c481da0146c4b8af79000f', 'common.please.input.keyword', '请输入关键字', 'zh-cn', '2014-06-23 01:56:16', 'admin', '管理员', '2014-06-23 01:56:16', 'admin', '管理员');
INSERT INTO `t_s_muti_lang` VALUES ('4028fc4d46c481da0146c4b8f7aa0011', 'common.please.input.keyword', 'Keyword', 'en', '2014-06-23 01:56:34', 'admin', '管理员', '2014-06-23 01:56:34', 'admin', '管理员');
INSERT INTO `t_s_muti_lang` VALUES ('4028fc4d46c481da0146c4ba979a0013', 'common.please.input.query.keyword', '请输入查询关键字', 'zh-cn', '2014-06-23 01:58:21', 'admin', '管理员', '2014-06-23 01:58:21', 'admin', '管理员');
@ -19460,10 +19462,10 @@ CREATE TABLE `t_s_role` (
-- Records of t_s_role
-- ----------------------------
INSERT INTO `t_s_role` VALUES ('4028608163773dd4016377623cf2000f', '11', '11', '402881f4609299ad0160929bd4ac000c', '1', null, null, null, '管理员', '2018-05-19 15:51:56', 'admin');
INSERT INTO `t_s_role` VALUES ('402880e74d75c4dd014d75d3c5f40001', 'demo', 'demo', null, null, '管理员', '2017-03-01 21:54:06', 'admin', null, null, null);
INSERT INTO `t_s_role` VALUES ('402881875b19f141015b19fb1d490019', 'dep_jingli', '经理角色', null, null, null, null, null, '管理员', '2017-03-29 20:12:19', 'admin');
INSERT INTO `t_s_role` VALUES ('8a8ab0b246dc81120146dc8181870050', 'admin', '管理员', null, null, '管理员', '2018-05-19 14:25:06', 'admin', null, null, null);
INSERT INTO `t_s_role` VALUES ('8a8ab0b246dc81120146dc81818b0051', 'manager', '普通用户', null, null, '管理员', '2016-05-29 17:42:19', 'admin', null, null, null);
INSERT INTO `t_s_role` VALUES ('402880e74d75c4dd014d75d3c5f40001', 'demo', 'demo', null, '0', '管理员', '2017-03-01 21:54:06', 'admin', null, null, null);
INSERT INTO `t_s_role` VALUES ('402881875b19f141015b19fb1d490019', 'dep_jingli', '经理角色', null, '0', null, null, null, '管理员', '2017-03-29 20:12:19', 'admin');
INSERT INTO `t_s_role` VALUES ('8a8ab0b246dc81120146dc8181870050', 'admin', '管理员', null, '0', '管理员', '2018-05-19 14:25:06', 'admin', null, null, null);
INSERT INTO `t_s_role` VALUES ('8a8ab0b246dc81120146dc81818b0051', 'manager', '普通用户', null, '0', '管理员', '2016-05-29 17:42:19', 'admin', null, null, null);
-- ----------------------------
-- Table structure for t_s_role_function
@ -19489,7 +19491,6 @@ INSERT INTO `t_s_role_function` VALUES ('40283181614231d40161423538320006', null
INSERT INTO `t_s_role_function` VALUES ('40283181614231d40161423561340007', null, '8a8ab0b246dc81120146dc818109002e', '402880e74d75c4dd014d75d3c5f40001', null);
INSERT INTO `t_s_role_function` VALUES ('40283181614231d40161423561370008', null, '2c90ac564c9d1734014c9d6f4e370024', '402880e74d75c4dd014d75d3c5f40001', null);
INSERT INTO `t_s_role_function` VALUES ('40283181614231d40161424756b0001e', null, '40287d81522a428401522a44aafb0002', '402880e74d75c4dd014d75d3c5f40001', null);
INSERT INTO `t_s_role_function` VALUES ('4028318161424e73016142501c930006', null, '4028318161424e730161424f61510002', '402880e74d75c4dd014d75d3c5f40001', '4028318161424e730161424fca6f0004,');
INSERT INTO `t_s_role_function` VALUES ('4028318163342ab60163342ce743000a', null, '4028ef8155fd32e40155fd33c6670001', '8a8ab0b246dc81120146dc8181870050', null);
INSERT INTO `t_s_role_function` VALUES ('40284a815bb75d7b015bb760d9130003', null, '40284a815bb75d7b015bb7607ba00001', '8a8ab0b246dc81120146dc8181870050', null);
INSERT INTO `t_s_role_function` VALUES ('402860816367e48e016367ea19a50002', null, '402860816361f06a016361f1be0d0001', '8a8ab0b246dc81120146dc8181870050', null);

@ -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. 入门开发环境搭建

@ -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

@ -1,35 +0,0 @@
INSERT INTO `t_s_interface` (`id`, `create_name`, `create_by`, `create_date`, `update_name`, `update_by`, `update_date`, `sys_org_code`, `sys_company_code`, `interface_name`, `interface_order`, `interface_level`, `interface_url`, `interface_code`, `interface_method`, `parent_interface_id`) VALUES ('402881ef624bd23701624bda83d80008', '管理员', 'admin', '2018-03-22 11:57:15', NULL, NULL, NULL, 'A03', 'A03', 'jeecgDemo接口', '1', '0', '', 'jeecgDemo', 'GET', NULL);
INSERT INTO `t_s_interface` (`id`, `create_name`, `create_by`, `create_date`, `update_name`, `update_by`, `update_date`, `sys_org_code`, `sys_company_code`, `interface_name`, `interface_order`, `interface_level`, `interface_url`, `interface_code`, `interface_method`, `parent_interface_id`) VALUES ('402881ef624bd23701624bdaea80000a', '管理员', 'admin', '2018-03-22 11:57:41', NULL, NULL, NULL, 'A03', 'A03', 'jeecgDemo列表查询', '1', '1', '/rest/jeecgListDemoController/list', 'jeecgdemo_list', 'GET', '402881ef624bd23701624bda83d80008');
INSERT INTO `t_s_interface` (`id`, `create_name`, `create_by`, `create_date`, `update_name`, `update_by`, `update_date`, `sys_org_code`, `sys_company_code`, `interface_name`, `interface_order`, `interface_level`, `interface_url`, `interface_code`, `interface_method`, `parent_interface_id`) VALUES ('402881ef624bd23701624bdb477e000c', '管理员', 'admin', '2018-03-22 11:58:05', NULL, NULL, NULL, 'A03', 'A03', 'jeecgDemo单条数据查询', '2', '1', '/rest/jeecgListDemoController/{id}', 'jeecgdemo_get', 'GET', '402881ef624bd23701624bda83d80008');
INSERT INTO `t_s_interface` (`id`, `create_name`, `create_by`, `create_date`, `update_name`, `update_by`, `update_date`, `sys_org_code`, `sys_company_code`, `interface_name`, `interface_order`, `interface_level`, `interface_url`, `interface_code`, `interface_method`, `parent_interface_id`) VALUES ('402881ef624bd23701624bdba184000e', '管理员', 'admin', '2018-03-22 11:58:28', NULL, NULL, NULL, 'A03', 'A03', 'jeecgDemo添加', '3', '1', '/rest/jeecgListDemoController', 'jeecgdemo_add', 'POST', '402881ef624bd23701624bda83d80008');
INSERT INTO `t_s_interface` (`id`, `create_name`, `create_by`, `create_date`, `update_name`, `update_by`, `update_date`, `sys_org_code`, `sys_company_code`, `interface_name`, `interface_order`, `interface_level`, `interface_url`, `interface_code`, `interface_method`, `parent_interface_id`) VALUES ('402881ef624bd23701624bdbfcec0010', '管理员', 'admin', '2018-03-22 11:58:51', NULL, NULL, NULL, 'A03', 'A03', 'jeecgDemo编辑', '4', '1', '/rest/jeecgListDemoController', 'jeecgdemo_edit', 'PUT', '402881ef624bd23701624bda83d80008');
INSERT INTO `t_s_interface` (`id`, `create_name`, `create_by`, `create_date`, `update_name`, `update_by`, `update_date`, `sys_org_code`, `sys_company_code`, `interface_name`, `interface_order`, `interface_level`, `interface_url`, `interface_code`, `interface_method`, `parent_interface_id`) VALUES ('402881ef624bd23701624bdc56f30012', '管理员', 'admin', '2018-03-22 11:59:14', NULL, NULL, NULL, 'A03', 'A03', 'jeecgDemo删除', '5', '1', '/rest/jeecgListDemoController/{id}', 'jeecgdemo_delete', 'DELETE', '402881ef624bd23701624bda83d80008');
update cgform_template set template_code = 'rowsEdit' where id = '40288af454ff777c0154ffad599e0003';
INSERT INTO `t_s_function` (`ID`, `functioniframe`, `functionlevel`, `functionname`, `functionorder`, `functionurl`, `parentfunctionid`, `iconid`, `desk_iconid`, `functiontype`, `function_icon_style`, `create_by`, `create_name`, `update_by`, `update_date`, `create_date`, `update_name`) VALUES ('402881ff6265de9b016266eb26380035', NULL, '1', '接口测试', '28', 'jeecgFormDemoController.do?interfaceTestDemo', '4028f6815af3ce54015af3d1ad610001', '8a8ab0b246dc81120146dc8180460000', '8a8ab0b246dc81120146dc8180f00026', '0', 'fa-check-circle-o', 'admin', '管理员', NULL, NULL, '2018-03-27 18:05:09', NULL);
INSERT INTO `t_s_function` (`ID`, `functioniframe`, `functionlevel`, `functionname`, `functionorder`, `functionurl`, `parentfunctionid`, `iconid`, `desk_iconid`, `functiontype`, `function_icon_style`, `create_by`, `create_name`, `update_by`, `update_date`, `create_date`, `update_name`) VALUES ('402881f66260fc8e016260ffdde70001', NULL, '1', '一对多表单二', '99', 'jformOrderMain2Controller.do?index', '4028f6815af3ce54015af3d1ad610001', '8a8ab0b246dc81120146dc8180460000', '8a8ab0b246dc81120146dc8180dd001e', '0', 'fa-list-ul', 'admin', '管理员', 'admin', '2018-03-27 16:14:26', '2018-03-26 14:30:04', '管理员');
INSERT INTO `super_query_main` (`id`, `create_name`, `create_by`, `create_date`, `update_name`, `update_by`, `update_date`, `sys_org_code`, `sys_company_code`, `query_name`, `query_code`, `query_type`, `content`) VALUES ('402881f66265f83b016266197dcf0005', '管理员', 'admin', '2018-03-27 14:16:09', '管理员', 'admin', '2018-03-27 17:42:28', 'A03', 'A03', '一对多表单测试高级查询', 'jformOrderMain2', 'M', '一对多表单测试高级查询');
INSERT INTO `super_query_table` (`id`, `create_name`, `create_by`, `create_date`, `update_name`, `update_by`, `update_date`, `sys_org_code`, `sys_company_code`, `seq`, `table_name`, `instruction`, `is_main`, `fk_field`, `main_id`) VALUES ('402881f66265f83b016266197dcf0006', '管理员', 'admin', '2018-03-27 14:16:09', '管理员', 'admin', '2018-03-27 17:42:28', 'A03', 'A03', '1', 'jform_order_main', '合同测试表', 'Y', NULL, '402881f66265f83b016266197dcf0005');
INSERT INTO `t_s_function` (`ID`, `functioniframe`, `functionlevel`, `functionname`, `functionorder`, `functionurl`, `parentfunctionid`, `iconid`, `desk_iconid`, `functiontype`, `function_icon_style`, `create_by`, `create_name`, `update_by`, `update_date`, `create_date`, `update_name`) VALUES ('402881f462bcd9fe0162bcdd0e4c0001', NULL, '1', 'vue列表', '1', 'jeecgListDemoController.do?vueList', '4028f6815af3ce54015af3d1ad610001', '8a8ab0b246dc81120146dc8180460000', '8a8ab0b246dc81120146dc8180dd001e', '0', 'fa-vimeo-square', 'admin', '管理员', 'admin', '2018-04-13 11:49:34', '2018-04-13 10:37:07', '管理员');
INSERT INTO `t_s_function` (`ID`, `functioniframe`, `functionlevel`, `functionname`, `functionorder`, `functionurl`, `parentfunctionid`, `iconid`, `desk_iconid`, `functiontype`, `function_icon_style`, `create_by`, `create_name`, `update_by`, `update_date`, `create_date`, `update_name`) VALUES ('297e7ae162b925a20162b9271b300001', NULL, '1', 'BootstrapTable', '30', 'jeecgListDemoController.do?bootTableDemo', '4028f6815af3ce54015af3d1ad610001', '8a8ab0b246dc81120146dc8180460000', '8a8ab0b246dc81120146dc8180dd001e', '0', 'fa-life-ring', 'admin', '管理员', 'admin', '2018-04-19 10:32:54', '2018-04-12 17:19:31', '管理员');
INSERT INTO `t_s_function` (`ID`, `functioniframe`, `functionlevel`, `functionname`, `functionorder`, `functionurl`, `parentfunctionid`, `iconid`, `desk_iconid`, `functiontype`, `function_icon_style`, `create_by`, `create_name`, `update_by`, `update_date`, `create_date`, `update_name`) VALUES ('402881f462fa6ee90162fa78deba0001', NULL, '1', 'vueBootstrapTable', '1', 'jeecgListDemoController.do?vueBootstrapTableList', '4028f6815af3ce54015af3d1ad610001', '8a8ab0b246dc81120146dc8180460000', '8a8ab0b246dc81120146dc8180dd001e', '0', 'fa-vimeo-square', 'admin', '管理员', 'admin', '2018-04-26 10:24:34', '2018-04-25 09:44:08', '管理员');
INSERT INTO `t_s_muti_lang` (`id`, `lang_key`, `lang_context`, `lang_code`, `create_date`, `create_by`, `create_name`, `update_date`, `update_by`, `update_name`) VALUES ('402881fc6305bc640163061f9a79000f', 'confirm.online.delete.record', '确认删除该记录吗?(同时删除表)', 'zh-cn', '2018-04-27 16:02:04', 'admin', '管理员', NULL, NULL, NULL);
INSERT INTO `t_s_muti_lang` (`id`, `lang_key`, `lang_context`, `lang_code`, `create_date`, `create_by`, `create_name`, `update_date`, `update_by`, `update_name`) VALUES ('402881fc6305bc640163061fd1dc0011', 'confirm.online.delete.record', 'Confirm delete record?(Drop table)', 'en', '2018-04-27 16:02:18', 'admin', '管理员', NULL, NULL, NULL);
INSERT INTO `t_s_function` (`ID`, `functioniframe`, `functionlevel`, `functionname`, `functionorder`, `functionurl`, `parentfunctionid`, `iconid`, `desk_iconid`, `functiontype`, `function_icon_style`, `create_by`, `create_name`, `update_by`, `update_date`, `create_date`, `update_name`) VALUES ('4028f681630b600701630bc1eee30030', NULL, '1', 'easyui原生态', '30', 'jeecgListDemoController.do?aceTableDemo', '4028f6815af3ce54015af3d1ad610001', '8a8ab0b246dc81120146dc8180460000', '8a8ab0b246dc81120146dc8180dd001e', '0', '', 'admin', '管理员', NULL, NULL, '2018-04-28 18:17:29', NULL);
delete from t_s_role_function where functionid = '402881ef5f5c650e015f5c67ddd20001';
delete from t_s_function where id = '402881ef5f5c650e015f5c67ddd20001';
update t_s_function set functionname = '一对多表单' where id = '402881f66260fc8e016260ffdde70001';
update t_s_function set functionurl='jeecgListDemoController.do?natureAceTableDemo' where id='4028f681630b600701630bc1eee30030';
INSERT INTO `t_s_function` (`ID`, `functioniframe`, `functionlevel`, `functionname`, `functionorder`, `functionurl`, `parentfunctionid`, `iconid`, `desk_iconid`, `functiontype`, `function_icon_style`, `create_by`, `create_name`, `update_by`, `update_date`, `create_date`, `update_name`) VALUES ('402860816329336901632a527c4d0028', NULL, '1', 'BootstrapTable(标签版)', '31', 'jeecgListDemoController.do?bootstrapTableTagDemo', '4028f6815af3ce54015af3d1ad610001', '8a8ab0b246dc81120146dc8180460000', '8a8ab0b246dc81120146dc8180dd001e', '0', 'fa-life-ring', 'admin', '管理员', 'admin', '2018-05-04 16:44:42', '2018-05-04 16:43:58', '管理员');
ALTER TABLE `t_s_base_user`
MODIFY COLUMN `username` varchar(50) NOT NULL COMMENT '用户账号' AFTER `userkey`;
INSERT INTO `t_s_muti_lang` (`id`, `lang_key`, `lang_context`, `lang_code`, `create_date`, `create_by`, `create_name`, `update_date`, `update_by`, `update_name`) VALUES ('402881f2635d5b6e01635d773ab20001', 'username.rang2to50', '用户账号范围在2~50位字符', 'zh-cn', '2018-05-14 15:04:44', 'admin', '管理员', NULL, NULL, NULL);
INSERT INTO `t_s_muti_lang` (`id`, `lang_key`, `lang_context`, `lang_code`, `create_date`, `create_by`, `create_name`, `update_date`, `update_by`, `update_name`) VALUES ('402881f2635d5b6e01635d77bb650003', 'username.rang2to50', 'User account need 2~50 bits', 'en', '2018-05-14 15:05:17', 'admin', '管理员', NULL, NULL, NULL);
INSERT INTO `t_s_function` (`ID`, `functioniframe`, `functionlevel`, `functionname`, `functionorder`, `functionurl`, `parentfunctionid`, `iconid`, `desk_iconid`, `functiontype`, `function_icon_style`, `create_by`, `create_name`, `update_by`, `update_date`, `create_date`, `update_name`) VALUES ('402860816361f06a016361f1be0d0001', NULL, '1', 'BootstrapTable(标签版2)', '32', 'jeecgListDemoController.do?bootstrapTableTagDemo2', '4028f6815af3ce54015af3d1ad610001', '8a8ab0b246dc81120146dc8180460000', '8a8ab0b246dc81120146dc8180dd001e', '0', 'fa-life-ring', 'admin', '管理员', 'admin', '2018-05-15 19:27:32', '2018-05-15 11:57:02', '管理员');
ALTER TABLE `jform_graphreport_head`
MODIFY COLUMN `create_name` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL AFTER `create_by`,
MODIFY COLUMN `update_name` varchar(100) NULL DEFAULT NULL AFTER `update_by`;
INSERT INTO `t_s_muti_lang` (`id`, `lang_key`, `lang_context`, `lang_code`, `create_date`, `create_by`, `create_name`, `update_date`, `update_by`, `update_name`) VALUES ('40286081637677e601637724773f0037', 'common.please.select.two.item', '请选择两条数据', 'zh-cn', '2018-05-19 14:44:28', 'admin', '管理员', NULL, NULL, NULL);
INSERT INTO `t_s_muti_lang` (`id`, `lang_key`, `lang_context`, `lang_code`, `create_date`, `create_by`, `create_name`, `update_date`, `update_by`, `update_name`) VALUES ('40286081637677e601637725f4a50039', 'common.please.select.two.item', 'Please select two data', 'en', '2018-05-19 14:46:06', 'admin', '管理员', NULL, NULL, NULL);
delete FROM t_s_depart_authg_function_rel where auth_id = '4028838d5f351a87015f351fc33d0002';
delete FROM t_s_depart_authg_function_rel where auth_id = '4028911b5c0bf9b9015c0c034d8e0013';
update t_s_muti_lang set lang_context = '3.7.5-beta' where lang_key ='system.version.number';

@ -0,0 +1,16 @@
update t_s_role set role_type=0 where role_type is null;
ALTER TABLE `jeecg_demo`
MODIFY COLUMN `content` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '个人介绍' AFTER `birthday`;
INSERT INTO `t_s_function` (`ID`, `functioniframe`, `functionlevel`, `functionname`, `functionorder`, `functionurl`, `parentfunctionid`, `iconid`, `desk_iconid`, `functiontype`, `function_icon_style`, `create_by`, `create_name`, `update_by`, `update_date`, `create_date`, `update_name`) VALUES ('402881f463a591710163a5e59a830010', NULL, '2', '接口用户管理', '3', 'userController.do?interfaceUser', '402881fc60a07a350160a07cf68e0001', '8a8ab0b246dc81120146dc8180460000', '8a8ab0b246dc81120146dc8180dd001e', '0', '', 'admin', '管理员', NULL, NULL, '2018-05-28 16:37:58', NULL);
delete from t_s_black_list where ip in (select a.ip from (select ip from t_s_black_list GROUP BY ip HAVING COUNT(1) > 1) a )
and id not in (select b.md from (select max(id) md from t_s_black_list GROUP BY ip HAVING COUNT(1) > 1) b );
ALTER TABLE `t_s_black_list`
ADD UNIQUE INDEX `unique_key_ip` (`ip`) ;
INSERT INTO `t_s_function` (`ID`, `functioniframe`, `functionlevel`, `functionname`, `functionorder`, `functionurl`, `parentfunctionid`, `iconid`, `desk_iconid`, `functiontype`, `function_icon_style`, `create_by`, `create_name`, `update_by`, `update_date`, `create_date`, `update_name`) VALUES ('4028f68163b5547e0163b55616930001', NULL, '1', '上传重构demo', '34', 'jeecgFormDemoController.do?webuploader', '4028f6815af3ce54015af3d1ad610001', '8a8ab0b246dc81120146dc8180460000', '8a8ab0b246dc81120146dc8180dd001e', '0', '', 'admin', '管理员', NULL, NULL, '2018-05-31 16:35:08', NULL);
INSERT INTO `t_s_function` (`ID`, `functioniframe`, `functionlevel`, `functionname`, `functionorder`, `functionurl`, `parentfunctionid`, `iconid`, `desk_iconid`, `functiontype`, `function_icon_style`, `create_by`, `create_name`, `update_by`, `update_date`, `create_date`, `update_name`) VALUES ('402881f463b56b950163b5aefcdb0002', NULL, '1', '自定义嵌套子表列表', '35', 'jfromOrderController.do?gridViewlist', '4028f6815af3ce54015af3d1ad610001', '8a8ab0b246dc81120146dc8180460000', '8a8ab0b246dc81120146dc8180dd001e', '0', '', 'admin', '管理员', NULL, NULL, '2018-05-31 18:12:14', NULL);
INSERT INTO `t_s_function` (`ID`, `functioniframe`, `functionlevel`, `functionname`, `functionorder`, `functionurl`, `parentfunctionid`, `iconid`, `desk_iconid`, `functiontype`, `function_icon_style`, `create_by`, `create_name`, `update_by`, `update_date`, `create_date`, `update_name`) VALUES ('402881f463b4e5d20163b4f9a81b0001', NULL, '1', 'Bootstrap布局报表', '34', 'jeecgListDemoController.do?bootStrapEchartsDemo', '8a8ab0b246dc81120146dc8180d4001b', '8a8ab0b246dc81120146dc8180460000', '8a8ab0b246dc81120146dc8180dd001e', '0', '', 'admin', '管理员', 'admin', '2018-05-31 19:48:06', '2018-05-31 14:54:10', '管理员');
update t_s_muti_lang set lang_context = ' ' where lang_key ='common.please.select';
ALTER TABLE `jform_graphreport_head`
DROP INDEX `index_code`,
ADD UNIQUE INDEX `index_code`(`code`);
update t_s_muti_lang set lang_context = '3.7.6' where lang_key ='system.version.number';

@ -1,14 +1,14 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.jeecgframework</groupId>
<artifactId>jeecg</artifactId>
<version>3.7.5-beta</version>
<version>3.7.6</version>
<packaging>war</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<codegenerate.version>3.6.3</codegenerate.version>
<minidao.version>1.6.2</minidao.version>
<minidao.version>1.6.4</minidao.version>
<guava.version>16.0.1</guava.version>
<spring.version>4.0.9.RELEASE</spring.version>
@ -45,7 +45,7 @@
<commons-lang.version>2.6</commons-lang.version>
<commons-lang3.version>3.1</commons-lang3.version>
<commons-email.version>1.2</commons-email.version>
<commons-logging.version>1.0.4</commons-logging.version>
<commons-logging.version>1.1.3</commons-logging.version>
<commons-logging-api.version>1.1</commons-logging-api.version>
<commons-validator.version>1.3.1</commons-validator.version>
<ehcache.version>2.4.3</ehcache.version>
@ -61,7 +61,7 @@
<proxool.version>0.9.1</proxool.version>
<commons-pool.version>1.6</commons-pool.version>
<commons-dbcp.version>1.4</commons-dbcp.version>
<druid.version>0.2.9</druid.version>
<druid.version>1.1.9</druid.version>
<mysql.version>5.1.27</mysql.version>
<!-- sqlserver 2008 -->
<sqlserver.version>4.0</sqlserver.version>
@ -81,8 +81,8 @@
<!-- java生成缩略图 -->
<thumbnailator.version>0.4.6</thumbnailator.version>
<pinyin4j.version>2.5.0</pinyin4j.version>
<org.quartz.version>1.6.2</org.quartz.version>
<pinyin4j.version>2.5.1</pinyin4j.version>
<org.quartz.version>2.3.0</org.quartz.version>
<activation.version>1.1.1</activation.version>
<aopalliance.version>1.0</aopalliance.version>
<xstream.version>1.4.4</xstream.version>
@ -96,6 +96,13 @@
<jedis.version>2.9.0</jedis.version>
<webserver.port>8080</webserver.port>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<!-- jeecg-p3-core -->
<jeecg-p3-core.version>1.0.0</jeecg-p3-core.version>
<!-- jeecg-p3-biz 业务插件 -->
<jeecg-p3-biz-demo.version>1.0.2</jeecg-p3-biz-demo.version>
<jeecg-p3-biz-chat.version>1.0.4</jeecg-p3-biz-chat.version>
<jeecg-p3-biz-mail.version>1.0.0</jeecg-p3-biz-mail.version>
</properties>
<!-- 设定主仓库,按设定顺序进行查找 -->
@ -146,22 +153,12 @@
<artifactId>codegenerate</artifactId>
<version>${codegenerate.version}</version>
<scope>system</scope>
<systemPath>${project.basedir}/src/main/webapp/WEB-INF/lib/codegenerate-3.6.3-20180503.jar</systemPath>
<systemPath>${project.basedir}/src/main/webapp/WEB-INF/lib/codegenerate-3.6.3-20180606.jar</systemPath>
</dependency>
<dependency>
<groupId>org.jeecgframework</groupId>
<artifactId>minidao-pe</artifactId>
<version>${minidao.version}</version>
<exclusions>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-asm</artifactId>
</exclusion>
<exclusion>
<groupId>org.junit</groupId>
<artifactId>com.springsource.org.junit</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- java生成缩略图-->
<dependency>
@ -169,26 +166,37 @@
<artifactId>thumbnailator</artifactId>
<version>${thumbnailator.version}</version>
</dependency>
<!-- jboss vfs 应该没用到
<dependency>
<groupId>org.jboss</groupId>
<artifactId>jboss-vfs</artifactId>
<version>3.1.0.Final</version>
</dependency>
</dependency> -->
<dependency>
<!-- <dependency>
<groupId>pinyin4j</groupId>
<artifactId>pinyin4j</artifactId>
<version>${pinyin4j.version}</version>
<scope>system</scope>
<systemPath>${project.basedir}/src/main/webapp/WEB-INF/lib/pinyin4j-2.5.0-20170917.jar</systemPath>
</dependency>
</dependency> -->
<dependency>
<groupId>com.belerweb</groupId>
<artifactId>pinyin4j</artifactId>
<version>${pinyin4j.version}</version>
</dependency>
<!-- <dependency>
<groupId>com.springsource</groupId>
<artifactId>org.quartz</artifactId>
<version>${org.quartz.version}</version>
<scope>system</scope>
<systemPath>${project.basedir}/src/main/webapp/WEB-INF/lib/org.quartz-1.6.2-20170917.jar</systemPath>
</dependency> -->
<dependency>
<groupId>org.quartz-scheduler</groupId>
<artifactId>quartz</artifactId>
<version>${org.quartz.version}</version>
</dependency>
<!-- SPRING start -->
<dependency>
@ -245,11 +253,13 @@
<artifactId>hibernate-ehcache</artifactId>
<version>${hibernate.version}</version>
</dependency>
<!-- 工程中用的是阿里巴巴的连接池, 应该没用到
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-proxool</artifactId>
<version>${hibernate.version}</version>
</dependency>
-->
<dependency>
<groupId>org.hibernate.common</groupId>
<artifactId>hibernate-commons-annotations</artifactId>
@ -274,7 +284,7 @@
<!-- 数据库相关依赖包 _start -->
<!--proxool start -->
<!--proxool start 工程中用的是阿里巴巴的连接池,应该没用到
<dependency>
<groupId>com.cloudhopper.proxool</groupId>
<artifactId>proxool</artifactId>
@ -293,8 +303,10 @@
<groupId>com.cloudhopper.proxool</groupId>
</exclusion>
</exclusions>
</dependency>
</dependency> -->
<!-- proxool end-->
<!-- DBCP连接池 -->
<dependency>
<groupId>commons-pool</groupId>
<artifactId>commons-pool</artifactId>
@ -307,6 +319,7 @@
<version>${commons-dbcp.version}</version>
<scope>compile</scope>
</dependency>
<!-- druid连接池 -->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid</artifactId>
@ -320,12 +333,13 @@
<version>${mysql.version}</version>
<scope>runtime</scope>
</dependency>
<!-- sqlserver 2008-->
<!-- sqlserver 2008
<dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>sqljdbc4</artifactId>
<version>${sqlserver.version}</version>
</dependency>
<scope>runtime</scope>
</dependency>-->
<!--sqlserver 2005
<dependency>
<groupId>org.jeecgframework</groupId>
@ -338,6 +352,7 @@
<groupId>com.oracle</groupId>
<artifactId>ojdbc14</artifactId>
<version>${ojdbc14.version}</version>
<scope>runtime</scope>
<scope>system</scope>
<systemPath>${project.basedir}/src/main/webapp/WEB-INF/lib/ojdbc14-10.2.0.5.0-20170917.jar</systemPath>
</dependency>-->
@ -480,23 +495,12 @@
</exclusion>
</exclusions>
</dependency>
<!-- slf4j -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${slf4j.version}</version>
</dependency>
<!-- log4j12 -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>${slf4j.version}</version>
</dependency>
<!-- log4j -->
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>${log4j.version}</version>
</dependency>
<!--Logger Support
<dependency>
<groupId>ch.qos.logback</groupId>
@ -509,12 +513,12 @@
<version>1.6.1</version>
</dependency>
-->
<!-- classmate -->
<!-- classmate 干嘛用的??应该没用到
<dependency>
<groupId>com.fasterxml</groupId>
<artifactId>classmate</artifactId>
<version>${classmate.version}</version>
</dependency>
</dependency> -->
<!-- commons-beanutils -->
<dependency>
@ -534,24 +538,24 @@
<artifactId>commons-collections</artifactId>
<version>${commons-collections.version}</version>
</dependency>
<!-- commons-chain -->
<!-- commons-chain 应该没用到
<dependency>
<groupId>commons-chain</groupId>
<artifactId>commons-chain</artifactId>
<version>${commons-chain.version}</version>
</dependency>
</dependency>-->
<!-- commons-codec -->
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<version>${commons-codec.version}</version>
</dependency>
<!-- commons-digester -->
<!-- commons-digester 应该没用到
<dependency>
<groupId>commons-digester</groupId>
<artifactId>commons-digester</artifactId>
<version>${commons-digester.version}</version>
</dependency>
</dependency>-->
<!-- commons-io -->
<dependency>
<groupId>commons-io</groupId>
@ -594,30 +598,35 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<!-- <dependency> 应该没用到
<groupId>commons-logging</groupId>
<artifactId>commons-logging-api</artifactId>
<version>${commons-logging-api.version}</version>
</dependency>
<!-- commons-validator -->
</dependency> -->
<!-- commons-validator 应该没用到TODO
<dependency>
<groupId>commons-validator</groupId>
<artifactId>commons-validator</artifactId>
<version>${commons-validator.version}</version>
</dependency>
</dependency>-->
<!-- ehcache -->
<dependency>
<groupId>net.sf.ehcache</groupId>
<artifactId>ehcache-core</artifactId>
<version>${ehcache.version}</version>
</dependency>
<!-- freemarker -->
<!-- freemarker
<dependency>
<groupId>org.jeecgframework</groupId>
<artifactId>freemarker-null</artifactId>
<version>${freemarker.version}</version>
<scope>system</scope>
<systemPath>${project.basedir}/src/main/webapp/WEB-INF/lib/freemarker-null-2.3.19-20170917.jar</systemPath>
</dependency>-->
<dependency>
<groupId>org.freemarker</groupId>
<artifactId>freemarker</artifactId>
<version>${freemarker.version}</version>
</dependency>
<!-- JSR303 Bean Validator -->
<dependency>
@ -704,11 +713,13 @@
<systemPath>${project.basedir}/src/main/webapp/WEB-INF/lib/jodconverter-3.0-beta-4-20170917.jar</systemPath>
</dependency>
<!-- openoffice end -->
<!-- struts的jar包应该不要用到吧 用在org.jeecgframework.core.common.hibernate.qbc类中) 删掉了
<dependency>
<groupId>com.opensymphony</groupId>
<artifactId>xwork-core</artifactId>
<version>${xwork-core.version}</version>
</dependency>
</dependency>-->
<!-- TEST begin -->
<!-- junit -->
@ -723,86 +734,69 @@
<artifactId>hamcrest-all</artifactId>
<version>${hamcrest.version}</version>
</dependency>
<dependency>
<!-- 干嘛用的,应该没用到 TODO
<dependency>
<groupId>com.jayway.jsonpath</groupId>
<artifactId>json-path</artifactId>
<version>0.8.1</version>
<scope>test</scope>
</dependency>
</dependency>-->
<!-- spring -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>${spring.version}</version>
</dependency>
<!-- jacob -->
<!-- jacob
<dependency>
<groupId>org.jeecgframework</groupId>
<artifactId>jacob</artifactId>
<version>1.0.0</version>
<scope>system</scope>
<systemPath>${project.basedir}/src/main/webapp/WEB-INF/lib/jacob-1.0.0-20170917.jar</systemPath>
</dependency>
<!-- highchart 图片导出 -->
</dependency>-->
<dependency>
<groupId>org.jeecgframework</groupId>
<artifactId>batik-all</artifactId>
<version>1.6</version>
<scope>system</scope>
<systemPath>${project.basedir}/src/main/webapp/WEB-INF/lib/batik-all-1.6-20170917.jar</systemPath>
</dependency>
<groupId>com.hynnet</groupId>
<artifactId>jacob</artifactId>
<version>1.18</version>
</dependency>
<!-- <dependency>
<groupId>net.sf.jacob-project</groupId>
<artifactId>jacob</artifactId>
<version>1.14.3</version>
</dependency> -->
<!-- highchart 图片导出-->
<dependency>
<groupId>org.jeecgframework</groupId>
<artifactId>fop</artifactId>
<version>1.0</version>
<scope>system</scope>
<systemPath>${project.basedir}/src/main/webapp/WEB-INF/lib/fop-1.0-20170917.jar</systemPath>
<groupId>org.apache.xmlgraphics</groupId>
<artifactId>batik-codec</artifactId>
<version>1.7</version>
</dependency>
<dependency>
<groupId>xerces</groupId>
<artifactId>xercesImpl</artifactId>
<version>2.7.1</version>
</dependency>
<dependency>
<groupId>xml-apis</groupId>
<artifactId>xml-apis-ext</artifactId>
<version>1.3.04</version>
</dependency>
<dependency>
<groupId>xml-apis</groupId>
<artifactId>xml-apis</artifactId>
<version>1.3.04</version>
</dependency>
<dependency>
<groupId>org.apache.xmlgraphics</groupId>
<artifactId>xmlgraphics-commons</artifactId>
<version>1.4</version>
</dependency>
<dependency>
<groupId>xalan</groupId>
<artifactId>xalan</artifactId>
<version>2.7.0</version>
</dependency>
<!-- Xml数据导出导入 -->
<dependency>
<groupId>com.thoughtworks.xstream</groupId>
<artifactId>xstream</artifactId>
<version>${xstream.version}</version>
</dependency>
<!-- highchart export -->
<dependency>
<groupId>commons-httpclient</groupId>
<artifactId>commons-httpclient</artifactId>
<version>3.0.1</version>
</dependency>
<!-- 应该没用到
<dependency>
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-javamail_1.4_spec</artifactId>
<version>1.6</version>
</dependency>
</dependency> -->
<!-- baidu ueditor-->
<dependency>
<!-- <dependency>
<groupId>com.baidu.ueditor.jeecg</groupId>
<artifactId>ueditor</artifactId>
<version>1.1.1</version>
@ -815,7 +809,7 @@
<version>1.0</version>
<scope>system</scope>
<systemPath>${project.basedir}/src/main/webapp/WEB-INF/lib/json-1.0-20170917.jar</systemPath>
</dependency>
</dependency> -->
<!-- baidu ueditor-->
<!-- jeecg plugin-ui-->
@ -833,7 +827,7 @@
<artifactId>jsoup</artifactId>
<version>1.8.3</version>
</dependency>
<!-- google 工具类 -->
<!-- guava -->
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
@ -848,7 +842,7 @@
</dependency>
<!-- kisso end -->
<!-- cxf webservice
<!-- cxf webservice (暂时注释掉提高平台性能,需要此功能,可以放开注释)
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-frontend-jaxws</artifactId>
@ -861,43 +855,71 @@
</dependency>
-->
<!-- jeecg plugin -->
<!-- p3 core -->
<dependency>
<groupId>org.p3framework</groupId>
<groupId>org.jeecgframework.p3</groupId>
<artifactId>jeecg-p3-core</artifactId>
<version>1.1.1</version>
<version>${jeecg-p3-core.version}</version>
</dependency>
<dependency>
<groupId>org.p3framework</groupId>
<artifactId>jeecg-p3-ui</artifactId>
<version>1.1.3</version>
<type>jar</type>
<groupId>org.jeecgframework.p3</groupId>
<artifactId>jeecg-p3-core-api</artifactId>
<version>${jeecg-p3-core.version}</version>
<exclusions>
<exclusion>
<groupId>org.jeecgframework.p3</groupId>
<artifactId>jeecg-p3-core</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.p3framework</groupId>
<artifactId>jeecg-p3-bizcore</artifactId>
<version>1.0-SNAPSHOT</version>
<type>jar</type>
<groupId>org.jeecgframework.p3</groupId>
<artifactId>jeecg-p3-core-ui</artifactId>
<version>${jeecg-p3-core.version}</version>
<exclusions>
<exclusion>
<groupId>org.jeecgframework.p3</groupId>
<artifactId>jeecg-p3-core</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- 插件demo -->
<!-- 插件Demo -->
<dependency>
<groupId>org.p3framework</groupId>
<groupId>org.jeecgframework.p3</groupId>
<artifactId>jeecg-p3-biz-demo</artifactId>
<version>1.0.2</version>
<version>${jeecg-p3-biz-demo.version}</version>
<exclusions>
<exclusion>
<groupId>org.jeecgframework.p3</groupId>
<artifactId>jeecg-p3-start-quick</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- 插件: 我的邮箱 -->
<!-- 插件:在线聊天 -->
<dependency>
<groupId>org.p3framework</groupId>
<artifactId>jeecg-p3-biz-mail</artifactId>
<version>1.0.0</version>
<type>jar</type>
<groupId>org.jeecgframework.p3</groupId>
<artifactId>jeecg-p3-biz-chat</artifactId>
<version>${jeecg-p3-biz-chat.version}</version>
<exclusions>
<exclusion>
<groupId>org.jeecgframework.p3</groupId>
<artifactId>jeecg-p3-start-quick</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- 在线聊天工具-->
<!-- 插件: 我的邮箱-->
<dependency>
<groupId>org.p3framework</groupId>
<artifactId>jeecg-p3-biz-chat</artifactId>
<version>1.0.3</version>
<groupId>org.jeecgframework.p3</groupId>
<artifactId>jeecg-p3-biz-mail</artifactId>
<version>${jeecg-p3-biz-mail.version}</version>
<exclusions>
<exclusion>
<groupId>org.jeecgframework.p3</groupId>
<artifactId>jeecg-p3-start-quick</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- begin 腾讯云-->
@ -986,9 +1008,9 @@
<artifactId>tomcat-maven-plugin</artifactId>
<version>1.1</version>
<configuration>
<path>/jeecg</path>
<port>8080</port>
<uriEncoding>UTF-8</uriEncoding>
<path>/${project.artifactId}</path>
<port>${webserver.port}</port>
<uriEncoding>${project.build.sourceEncoding}</uriEncoding>
<url>http://localhost:8080/manager/html</url>
<server>tomcat6</server>
</configuration>

@ -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<String,Object> info = new HashMap<String,Object>();
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();
}
}
}
}

@ -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) {
/**
* minidaospringjdbc线
* {USER_NAME}
* {user_name}
* {userName}
*/
//step.1 获取数据权限SQL片段
String authSql = JeecgDataAutorUtils.loadDataSearchConditonSQLString();
//step.2 将权限SQL片段注入到业务SQL中
MiniDaoPage<JeecgDemoEntity> 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");
}
}

@ -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;

@ -58,7 +58,7 @@ import com.jeecg.demo.entity.JfromOrderEntity;
import com.jeecg.demo.entity.JfromOrderLineEntity;
import com.jeecg.demo.page.JfromOrderPage;
import com.jeecg.demo.service.JfromOrderServiceI;
import com.jeecg.superquery.util.SuperQueryUtil;
import org.jeecgframework.web.superquery.util.SuperQueryUtil;
/**
* @Title: Controller
@ -92,8 +92,19 @@ public class JfromOrderController extends BaseController {
@RequestMapping(params = "list")
public ModelAndView list(HttpServletRequest request) {
return new ModelAndView("com/jeecg/demo/jfromOrderList");
}
/**
* (demo)
*
* @return
*/
@RequestMapping(params = "gridViewlist")
public ModelAndView gridViewlist(HttpServletRequest request) {
return new ModelAndView("com/jeecg/demo/jfromOrderGridViewList");
}
/**
* easyui AJAX
*
@ -274,6 +285,17 @@ public class JfromOrderController extends BaseController {
return new ModelAndView("com/jeecg/demo/jfromOrderLineList");
}
@RequestMapping(params = "jfromOrderLineDatagrid")
public void jfromOrderLineDatagrid(JfromOrderLineEntity jfromOrderLineEntity,HttpServletRequest request, HttpServletResponse response, DataGrid dataGrid) {
CriteriaQuery cq = new CriteriaQuery(JfromOrderLineEntity.class, dataGrid);
//查询条件组装器
org.jeecgframework.core.extend.hqlsearch.HqlGenerateUtil.installHql(cq, jfromOrderLineEntity);
cq.add();
this.jfromOrderService.getDataGridReturn(cq, true);
TagUtil.datagrid(response, dataGrid);
}
/**
* excel
*

@ -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<Map<String, String>> 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<Map<String, String>> getAllRegions();
@ResultType(JeecgDemoEntity.class)
public MiniDaoPage<JeecgDemoEntity> 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<Map> getAllEntities(JeecgMinidaoEntity jeecgMinidao, int page, int rows);
@Arguments({"jeecgMinidao", "page", "rows"})
@ResultType(JeecgMinidaoEntity.class)
public List<JeecgMinidaoEntity> 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<JeecgLogReport> getLogReportData(JeecgLogReport log);

@ -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;
}
/**

@ -21,6 +21,7 @@ public @interface Ehcache {
// 增加缓存还是删除缓存,默认为增加缓存
boolean addOrdel() default true;
//临时缓存还是永久缓存,默认为永久缓存
//临时缓存还是永久缓存,默认为缓存缓存
//TODO 暂时只支持临时缓存,未实现永久缓存
boolean eternal() default true;
}

@ -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;
}

@ -7,12 +7,14 @@ import net.sf.ehcache.Cache;
import net.sf.ehcache.CacheManager;
import net.sf.ehcache.Element;
import org.apache.log4j.Logger;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.AfterReturning;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import org.jeecgframework.core.annotation.Ehcache;
import org.jeecgframework.core.util.oConvertUtils;
import org.springframework.stereotype.Component;
import com.alibaba.fastjson.JSON;
@ -20,23 +22,14 @@ import com.alibaba.fastjson.JSON;
/**
*
* @author
* @
*
*/
@Component
@Aspect
public class EhcacheAspect {
// private static Cache dictCache;
// private static Cache eternalCache;
//
// static {
// if (eternalCache == null) {
// eternalCache = CacheManager.getInstance().getCache("eternalCache");
// }
// if (dictCache == null) {
// dictCache = CacheManager.getInstance().getCache("dictCache");
// }
// }
private static final Logger logger = Logger.getLogger(EhcacheAspect.class);
@Pointcut("@annotation(org.jeecgframework.core.annotation.Ehcache)")
public void simplePointcut() {
}
@ -46,40 +39,42 @@ public class EhcacheAspect {
}
@Around("simplePointcut()")
public Object aroundLogCalls(ProceedingJoinPoint joinPoint)
throws Throwable {
Cache eternalCache = CacheManager.getInstance().getCache("eternalCache");
Cache dictCache = CacheManager.getInstance().getCache("eternalCache");
public Object aroundLogCalls(ProceedingJoinPoint joinPoint)throws Throwable {
String targetName = joinPoint.getTarget().getClass().toString();
String methodName = joinPoint.getSignature().getName();
Object[] arguments = joinPoint.getArgs();
Object[] arguments = joinPoint.getArgs();
logger.debug("-------ehcache------aspect-----targetclass: "+ targetName);
//试图得到标注的Ehcache类
@SuppressWarnings("unused")
Method[] methods = joinPoint.getTarget().getClass().getMethods();
Ehcache flag = null;
for(Method m:methods){
if(m.getName().equals(methodName)){
Class[] tmpCs = m.getParameterTypes();
if(tmpCs.length==arguments.length){
flag = m.getAnnotation(Ehcache.class);
break;
}
for (Method m : methods) {
if (m.getName().equals(methodName)) {
Class[] tmpCs = m.getParameterTypes();
if (tmpCs.length == arguments.length) {
flag = m.getAnnotation(Ehcache.class);
break;
}
}
}
if(flag==null){
return null;
}
//Ehcache flag =joinPoint.getTarget().getClass().getMethod(methodName).getAnnotation(Ehcache.class);
Object result;
String cacheKey = getCacheKey(targetName, methodName, arguments);
Element element = null;
Cache eternalCache = CacheManager.getInstance().getCache("eternalCache");
//自定义缓存名字
if(oConvertUtils.isNotEmpty(flag.cacheName())){
eternalCache = CacheManager.getInstance().getCache(flag.cacheName());
}
if(flag.eternal()){
//永久缓存
element = dictCache.get(cacheKey);
element = eternalCache.get(cacheKey);
}else{
//临时缓存
element = eternalCache.get(cacheKey);
@ -96,7 +91,7 @@ public class EhcacheAspect {
element = new Element(cacheKey, (Serializable) result);
if(flag.eternal()){
//永久缓存
dictCache.put(element);
eternalCache.put(element);
}else{
//临时缓存
eternalCache.put(element);

@ -3,17 +3,15 @@ package org.jeecgframework.core.aop;
import java.lang.reflect.Method;
import java.util.concurrent.TimeUnit;
import javax.annotation.Resource;
import org.apache.commons.lang.StringUtils;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import org.jeecgframework.core.annotation.Ehcache;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.BoundValueOperations;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.serializer.JdkSerializationRedisSerializer;
import org.springframework.stereotype.Component;
import com.alibaba.fastjson.JSON;
@ -24,15 +22,10 @@ import com.alibaba.fastjson.JSON;
//@Component
//@Aspect
public class RedisCacheAspect {
private RedisTemplate redisTemplate;
@Autowired
public void setRedis(RedisTemplate redisTemplate) {
this.redisTemplate = redisTemplate;
//泛型设置成Long后必须更改对应的序列化方案
redisTemplate.setValueSerializer(new JdkSerializationRedisSerializer());
}
//TODO ?
@Resource
private RedisTemplate redisTemplate;
@Pointcut("@annotation(org.jeecgframework.core.annotation.Ehcache)")
public void simplePointcut() {}

@ -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<T, PK extends Serializable>
} 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());
}

@ -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<String,Boolean> context = new HashMap<String,Boolean>(1);
static{
context.put(ReflectionContextState.CREATE_NULL_OBJECTS, true);
}
/** POJO的class */
private final Class<?> resultClass;
public AliasToBean(Class<?> pojoClass) {
if(pojoClass==null) throw new IllegalArgumentException("resultClass cannot be null");
this.resultClass = pojoClass;
}
@SuppressWarnings("unchecked")
public List transformList(List collection) {
return collection;
}
/**
*
* 2009-4-7
* @author
* @param tuple
* @param aliases
* @return POJO--
*/
public Object transformTuple(Object[] tuple, String[] aliases) {
try {
Object root = resultClass.newInstance();
for (int i = 0; i < aliases.length; i++) {
if(aliases[i]!=null && !aliases[i].equals(""))
{
Ognl.setValue(ognlUntil.compile(aliases[i]), context, root, tuple[i]);
}
}
return root;
} catch (Exception e) {
throw new HibernateException(e.getMessage(),e);
}
}
}
//package org.jeecgframework.core.common.hibernate.qbc;
//
//import java.util.HashMap;
//import java.util.List;
//import java.util.Map;
//
//import ognl.Ognl;
//
//import org.hibernate.HibernateException;
//import org.hibernate.transform.ResultTransformer;
//
//import com.opensymphony.xwork2.ognl.OgnlUtil;
//import com.opensymphony.xwork2.util.reflection.ReflectionContextState;
//
///**
// * 此版本运行在xwork-core-2.1.6.jar
// * 支持属性为自定义对象的结果集转换的部份属性查询
// * 2009-3-30
// * @author 苍鹰
// */
//public class AliasToBean implements ResultTransformer {
// private static final long serialVersionUID = 1L;
// private static final OgnlUtil ognlUntil = new OgnlUtil();
// private static final Map<String,Boolean> context = new HashMap<String,Boolean>(1);
// static{
// context.put(ReflectionContextState.CREATE_NULL_OBJECTS, true);
// }
//
// /** POJO的class */
// private final Class<?> resultClass;
//
// public AliasToBean(Class<?> pojoClass) {
// if(pojoClass==null) throw new IllegalArgumentException("resultClass cannot be null");
// this.resultClass = pojoClass;
// }
//
// @SuppressWarnings("unchecked")
//
// public List transformList(List collection) {
// return collection;
// }
//
// /**
// * 结果集转换
// * 2009-4-7
// * @author 苍鹰
// * @param tuple 属性值集合
// * @param aliases 属性名集合
// * @return 单个POJO实例--查询结果
// */
//
// public Object transformTuple(Object[] tuple, String[] aliases) {
// try {
// Object root = resultClass.newInstance();
// for (int i = 0; i < aliases.length; i++) {
// if(aliases[i]!=null && !aliases[i].equals(""))
// {
// Ognl.setValue(ognlUntil.compile(aliases[i]), context, root, tuple[i]);
// }
// }
// return root;
// } catch (Exception e) {
// throw new HibernateException(e.getMessage(),e);
// }
// }
//
//}

@ -145,12 +145,16 @@ public class CriteriaQuery {
this.ordermap = new LinkedHashMap<String, Object>();
}
// 【scott 20180526 删除无用代码|xwork-core】
public CriteriaQuery(Class entityClass,DataTables dataTables) {
this.curPage = dataTables.getDisplayStart();
String[] fieldstring=dataTables.getsColumns().split(",");
this.detachedCriteria = DetachedCriteriaUtil
.createDetachedCriteria(entityClass, "start", "_table",fieldstring);
//this.detachedCriteria = DetachedCriteria.forClass(c);
this.detachedCriteria = DetachedCriteria.forClass(entityClass);
//this.detachedCriteria = DetachedCriteriaUtil.createDetachedCriteria(entityClass, "start", "_table",fieldstring);
this.field=dataTables.getsColumns();
this.entityClass=entityClass;
this.dataTables=dataTables;

@ -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<String> aliases) {
request.setAttribute(ALIAS_KEY_IN_REQUEST, aliases);
}
@SuppressWarnings("unchecked")
private static Set<String> getAliasesFromRequest(){
Set<String> aliases = (Set<String>) ContextHolderUtils.getRequest().getAttribute(ALIAS_KEY_IN_REQUEST);
if(aliases==null){
aliases = new HashSet<String>(5);
setAliasToRequest(ContextHolderUtils.getRequest(), aliases);
}
return aliases;
}
private static boolean getHasJoinTatleFromRequest(){
Boolean hasJoin = (Boolean) ContextHolderUtils.getRequest().getAttribute(HAS_JOIN_TABLE_KEY_IN_REQUEST);
return hasJoin==null?false:hasJoin;
}
/**
* DetachedCriteria 2008-9-29
* 2009.9.9
* user.organization.parentOrganization.parentOrganization.orgName
* 1 ,
* @author
* @param columnNames
* String[] column={"属性1","属性2","属性3"};
* @param pojoClass
* Class,Mobile.class;
* @param aials
* POJO
* @return DetachedCriteria
*
* @param forJoinTable
*/
public static void selectColumn(DetachedCriteria criteria, String[] columnNames,
Class<?> pojoClass,boolean forJoinTable) {
if (null == columnNames) {
return;
}
//使用这个临时变量集合是因为dinstinct关键字要放在最前面而distinct关键字要在下面才决定放不放
List<Projection> tempProjectionList = new ArrayList<Projection>();
Set<String> 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<String> aliases,String[] columns,int currentStep){
if(currentStep<columns.length-1){
if(!aliases.contains(converArrayToAlias(columns, currentStep))){
if(currentStep>0){
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<String> aliases) {
// request.setAttribute(ALIAS_KEY_IN_REQUEST, aliases);
// }
//
// @SuppressWarnings("unchecked")
// private static Set<String> getAliasesFromRequest(){
// Set<String> aliases = (Set<String>) ContextHolderUtils.getRequest().getAttribute(ALIAS_KEY_IN_REQUEST);
// if(aliases==null){
// aliases = new HashSet<String>(5);
// setAliasToRequest(ContextHolderUtils.getRequest(), aliases);
// }
// return aliases;
// }
//
// private static boolean getHasJoinTatleFromRequest(){
// Boolean hasJoin = (Boolean) ContextHolderUtils.getRequest().getAttribute(HAS_JOIN_TABLE_KEY_IN_REQUEST);
// return hasJoin==null?false:hasJoin;
// }
//
//
//
//
// /**
// * 该方法提供DetachedCriteria对查询字段的封装 2008-9-29
// * 2009.9.9修改后,可支持无限级联取部分字段,如取如下字段
// * user.organization.parentOrganization.parentOrganization.orgName
// * 但请注意1点 ,连接采用内联,级联越多,结果集可能就越少;
// * @author
// * @param columnNames
// * 字符串数组以数据的形式接收要查询的字段属性如String[] column={"属性1","属性2","属性3"};
// * @param pojoClass
// * 实体类的Class,如Mobile.class;
// * @param aials
// * 为要查询的POJO对象指定一个别名
// * @return DetachedCriteria 的一个对象,如果需要查询条件,在些对象后追加查询条件。
// *
// * @param forJoinTable 是否多表连接查询
// */
// public static void selectColumn(DetachedCriteria criteria, String[] columnNames,
// Class<?> pojoClass,boolean forJoinTable) {
// if (null == columnNames) {
// return;
// }
//
// //使用这个临时变量集合是因为dinstinct关键字要放在最前面而distinct关键字要在下面才决定放不放
// List<Projection> tempProjectionList = new ArrayList<Projection>();
//
// Set<String> 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<String> aliases,String[] columns,int currentStep){
// if(currentStep<columns.length-1){
// if(!aliases.contains(converArrayToAlias(columns, currentStep))){
// if(currentStep>0){
// 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();
// }
//
//
//
//
//}

@ -338,7 +338,7 @@ public interface CommonService {
* 使For JDBC-
*
*/
public Long getCountForJdbcParam(String sql, Object[] objs);
public Long getCountForJdbcParam(String sql, Object... objs);
/**
* hql

@ -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);
}

@ -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;
/**
* keyvalue
*/
public void delete(String key){
redisTemplate.delete(key);
}
/**
* keyvalue
*/
public String get(String key){
String value = redisTemplate.opsForValue().get(key);
return value;
}
/**
* keyvalueredis
*/
public void set(String key, String value, long timeout){
redisTemplate.opsForValue().set(key, value, timeout, TimeUnit.DAYS);
}
/**
* keyvalueredis
*/
public void set(String key, String value){
redisTemplate.opsForValue().set(key, value);
}
/**
* redismap
*/
public Map<String, Object> getMap(String key){
HashOperations<String, String, Object> hash = redisTemplate.opsForHash();
Map<String,Object> map = hash.entries(key);
return map;
}
/**
* mapredis
*/
public void set(String key, Map<? extends String, ? extends Object> map, long timeout){
redisTemplate.opsForHash().putAll(key, map);
redisTemplate.expire(key, timeout, TimeUnit.DAYS);
}
}

@ -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
*/

@ -4,6 +4,7 @@ import org.jeecgframework.core.util.oConvertUtils;
/**
* ,code (add addOne)
*
* @author taoYan
* @since 20171225
*/
@ -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")*/
}

@ -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");

@ -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;

@ -473,7 +473,6 @@ public class HqlGenerateUtil {
}
return sb.toString();
}
// --author陈璞 ------begin---date20150612--------forsql组装
/**
* ,
* return: java.lang.Integer

@ -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<String> excludeUrls;
/**
*
*/
//模糊匹配排除URLS
private List<String> excludeContainUrls;
public List<String> getExcludeUrls() {
return excludeUrls;
}
public void setExcludeUrls(List<String> excludeUrls) {
this.excludeUrls = excludeUrls;
}
public List<String> getExcludeContainUrls() {
return excludeContainUrls;
}
public void setExcludeContainUrls(List<String> excludeContainUrls) {
this.excludeContainUrls = excludeContainUrls;
}
public SystemService getSystemService() {
return systemService;
}
@Autowired
public void setSystemService(SystemService systemService) {
this.systemService = systemService;
}
/**
* controller
*/
public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object object, Exception exception) throws Exception {
}
public void postHandle(HttpServletRequest request, HttpServletResponse response, Object object, ModelAndView modelAndView) throws Exception {
}
/**
* controller
*/
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object object) throws Exception {
//判断是否被注解跳过权限认证 先判断类注解然后方法注解 都没有则走原来逻辑
//-----------------------注解排除权限拦截机制---------------------------------------
HandlerMethod handlerMethod=(HandlerMethod)object;
JAuth jauthType =handlerMethod.getBean().getClass().getAnnotation(JAuth.class);
if(jauthType!=null){
if(jauthType.auth()==Permission.SKIP_AUTH){
return true;
}
if(jauthType!=null && jauthType.auth()==Permission.SKIP_AUTH){
return true;
}else{
//JAuthority jauthMethod =handlerMethod.getMethodAnnotation(JAuthority.class);
JAuth jauthMethod =handlerMethod.getMethod().getAnnotation(JAuth.class);
if(jauthMethod!=null){
Permission permission=jauthMethod.auth();
if(permission==Permission.SKIP_AUTH){
return true;
}
if(jauthMethod!=null && jauthMethod.auth()==Permission.SKIP_AUTH){
return true;
}
}
Boolean isAjax=isAjax(request,response);
String requestPath = ResourceUtil.getRequestPath(request);// 用户访问的资源地址
//logger.info("-----authInterceptor----requestPath------"+requestPath);
//步骤一: 判断是否是排除拦截请求直接返回TRUE
//-----------------------注解排除权限拦截机制---------------------------------------
//通过转换获取用户的请求URL地址
String requestPath = ResourceUtil.getJgAuthRequsetPath(request);
//API接口不做登陆验证
if (requestPath.length()>3&&"api/".equals(requestPath.substring(0,4))) {
return true;
}
//针对拦截器排除URLS进行排除
if (excludeUrls.contains(requestPath)) {
return true;
} else if(moHuContain(excludeContainUrls, requestPath)){
return true;
} else {
//步骤二: 权限控制优先重组请求URL(考虑online请求前缀一致问题)
String clickFunctionId = request.getParameter("clickFunctionId");
Client client = ClientManager.getInstance().getClient(ContextHolderUtils.getSession().getId());
TSUser currLoginUser = client!=null?client.getUser():null;
if (client != null && currLoginUser!=null ) {
//onlinecoding的访问地址有规律可循数据权限链接篡改
if (currLoginUser!=null ) {
String loginUserName = currLoginUser.getUserName();
String loginUserId = currLoginUser.getId();
String orgId = currLoginUser.getDepartid();
//点击菜单ID
String functionId = request.getParameter("clickFunctionId");
//-----------------OnlineCoding--------------------------------------------------------------
//步骤二: Online功能请求URL特殊规则根据规则重组URL支持多个参数
if(requestPath.equals("cgAutoListController.do?datagrid")) {
requestPath += "&configId=" + request.getParameter("configId");
}
if(requestPath.equals("cgAutoListController.do?list")) {
}else if(requestPath.equals("cgAutoListController.do?list")) {
requestPath += "&id=" + request.getParameter("id");
}
if(requestPath.endsWith("?olstylecode=")) {
requestPath = requestPath.replace("?olstylecode=", "");
}
//------------------------OnlineCoding-------------------------------------------------------
logger.debug("-----authInterceptor----requestPath------"+requestPath);
//步骤三: 根据重组请求URL,进行权限授权判断
if((!(hasMenuAuth(requestPath,clickFunctionId,currLoginUser)) && !currLoginUser.getUserName().equals("admin"))){
//步骤三: 判断请求URL是否有菜单访问权限
if(!systemService.loginUserIsHasMenuAuth(requestPath,functionId,loginUserId,orgId)){
Boolean isAjax=isAjax(request);
if(isAjax){
processAjax(response);
processAjax(response);
}else {
response.sendRedirect(request.getSession().getServletContext().getContextPath()+"/loginController.do?noAuth");
}
return false;
}
//解决rest风格下 权限失效问题
String functionId="";
String uri= request.getRequestURI().substring(request.getContextPath().length() + 1);
String realRequestPath = null;
if(uri.endsWith(".do")||uri.endsWith(".action")){
realRequestPath=requestPath;
}else {
realRequestPath=uri;
}
// if(!oConvertUtils.isEmpty(clickFunctionId)){
// functionId = clickFunctionId;
// }else{
if(realRequestPath.indexOf("autoFormController/af/")>-1 && realRequestPath.indexOf("?")!=-1){
realRequestPath = realRequestPath.substring(0, realRequestPath.indexOf("?"));
}
List<TSFunction> 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<TSOperation> operations = systemService.getOperationsByUserIdAndFunctionId(currLoginUser, functionId);
request.setAttribute(Globals.NOAUTO_OPERATIONCODES, operations);
if(operations==null){
request.setAttribute(Globals.OPERATIONCODES, null);
}else{
Set<String> operationCodes = new HashSet<String>();
for (TSOperation operation : operations) {
operationCodes.add(operation.getId());
}
request.setAttribute(Globals.OPERATIONCODES, operationCodes);
//Admin拥有特权数据权限、页面表单权限、按钮权限不做控制
if(!"admin".equals(loginUserName)){
//-----------------------------------------------------------------------------------------------------------------
if(oConvertUtils.isEmpty(functionId)){
//查询请求URL对应的菜单ID因为数据权限、页面控件权限是基于菜单ID配置的数据
String url = request.getRequestURI().substring(request.getContextPath().length() + 1);
functionId = systemService.getFunctionIdByUrl(url,requestPath);
//如果通过请求URL无法匹配出数据库中菜单ID则不进行数据权限、页面控件权限的逻辑处理
if(oConvertUtils.isEmpty(functionId)){
return true;
}
}
//-----------------------------------------------------------------------------------------------------------------
//Set<String> operationCodes = systemService.getOperationCodesByUserIdAndFunctionId(currLoginUser.getId(), functionId);
//request.setAttribute(Globals.OPERATIONCODES, operationCodes);
//}
//if(!oConvertUtils.isEmpty(functionId)){
//Step.1 【页面控件权限】第一部分处理页面表单和列表的页面控件权限(页面表单字段+页面按钮等控件)
//获取菜单对应的页面控制权限(包括表单字段和操作按钮)
//多个角色权限并集问题因为是反的控制导致有admin的最大权限反而受小权限控制
// List<TSOperation> allOperation=this.systemService.findByProperty(TSOperation.class, "TSFunction.id", functionId);
// List<TSOperation> newall = new ArrayList<TSOperation>();
// 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<String> 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<TSOperation> newall = new ArrayList<TSOperation>();
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<String> 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<TSOperation> operations = systemService.getLoginOperationsByUserId(loginUserId, functionId, orgId);
request.setAttribute(Globals.NOAUTO_OPERATIONCODES, operations);
if(operations!=null){
Set<String> operationCodes = new HashSet<String>();
for (TSOperation operation : operations) {
operationCodes.add(operation.getId());
}
request.setAttribute(Globals.OPERATIONCODES, operationCodes);
}
//Step.2 第二部分处理列表数据级权限 (菜单数据规则集合)
//Step.2 【数据权限】第二部分处理列表数据级权限 (菜单数据规则集合)
List<TSDataRule> MENU_DATA_AUTHOR_RULES = new ArrayList<TSDataRule>();
String MENU_DATA_AUTHOR_RULE_SQL="";
//数据权限规则的查询
//查询所有的当前这个用户所对应的角色和菜单的datarule的数据规则id
if(!currLoginUser.getUserName().equals("admin")){
//Globals.BUTTON_AUTHORITY_CHECK
Set<String> dataruleCodes = systemService.getOperationCodesByUserIdAndDataId(currLoginUser, functionId);
request.setAttribute("dataRulecodes", dataruleCodes);
for (String dataRuleId : dataruleCodes) {
TSDataRule dataRule = systemService.getEntity(TSDataRule.class, dataRuleId);
MENU_DATA_AUTHOR_RULES.add(dataRule);
MENU_DATA_AUTHOR_RULE_SQL += SysContextSqlConvert.setSqlModel(dataRule);
}
}
//查询当前用户授权的数据规则IDS
JeecgDataAutorUtils.installDataSearchConditon(request, MENU_DATA_AUTHOR_RULES);//菜单数据规则集合
JeecgDataAutorUtils.installDataSearchConditon(request, MENU_DATA_AUTHOR_RULE_SQL);//菜单数据规则sql
Set<String> dataRuleIds = systemService.getLoginDataRuleIdsByUserId(loginUserId, functionId, orgId);
request.setAttribute("dataRulecodes", dataRuleIds);
for (String dataRuleId : dataRuleIds) {
TSDataRule dataRule = systemService.getEntity(TSDataRule.class, dataRuleId);
MENU_DATA_AUTHOR_RULES.add(dataRule);
MENU_DATA_AUTHOR_RULE_SQL += SysContextSqlConvert.setSqlModel(dataRule);
}
//【加载数据权限】数据权限规则Hibernate字段方式
JeecgDataAutorUtils.installDataSearchConditon(request, MENU_DATA_AUTHOR_RULES);
//【加载数据权限】数据权限规则Sql方式
JeecgDataAutorUtils.installDataSearchConditon(request, MENU_DATA_AUTHOR_RULE_SQL);
}
return true;
} else {
//forword(request);
forward(request, response);
//登录用户信息为空,跳转到用户登录超时页面
forwardTimeOut(request, response);
return false;
}
}
}
/**
* 访
* @param requestPath
* @param clickFunctionId
* @param currLoginUser
* @return
* controller
*/
private boolean hasMenuAuth(String requestPath,String clickFunctionId,TSUser currLoginUser){
String userid = currLoginUser.getId();
public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object object, Exception exception) throws Exception {
}
//step.1 先判断请求是否配置菜单,没有配置菜单默认不作权限控制[注意:这里不限制权限类型菜单]
String hasMenuSql = "select count(*) from t_s_function where functiontype = 0 and functionurl = '"+requestPath+"'";
Long hasMenuCount = systemService.getCountForJdbc(hasMenuSql);
if(hasMenuCount<=0){
return true;
}
//step.2 判断菜单是否有角色权限
Long authSize = Long.valueOf(0);
String sql = "SELECT count(*) FROM t_s_function f,t_s_role_function rf,t_s_role_user ru " +
" WHERE f.id=rf.functionid AND rf.roleid=ru.roleid AND " +
"ru.userid='"+userid+"' AND f.functionurl = '"+requestPath+"'";
authSize = this.systemService.getCountForJdbc(sql);
if(authSize <=0){
//step.3 判断菜单是否有组织机构角色权限
String orgId = currLoginUser.getCurrentDepart().getId();
Long orgAuthSize = Long.valueOf(0);
String functionOfOrgSql = "SELECT count(*) from t_s_function f, t_s_role_function rf, t_s_role_org ro " +
"WHERE f.ID=rf.functionid AND rf.roleid=ro.role_id " +
"AND ro.org_id='" +orgId+ "' AND f.functionurl = '"+requestPath+"'";
orgAuthSize = this.systemService.getCountForJdbc(functionOfOrgSql);
return orgAuthSize > 0;
}else{
return true;
}
public void postHandle(HttpServletRequest request, HttpServletResponse response, Object object, ModelAndView modelAndView) throws Exception {
}
/**
*
@ -328,15 +202,15 @@ public class AuthInterceptor implements HandlerInterceptor {
return new ModelAndView(new RedirectView("loginController.do?login"));
}
private void forward(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
//超时,未登陆页面跳转
//response.sendRedirect(request.getServletContext().getContextPath()+"/loginController.do?login");
/**
*
* @param request
* @param response
* @throws ServletException
* @throws IOException
*/
private void forwardTimeOut(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
response.sendRedirect(request.getSession().getServletContext().getContextPath()+"/webpage/login/timeout.jsp");
//request.getRequestDispatcher("loginController.do?login").forward(request, response);
}
/**
@ -357,11 +231,14 @@ public class AuthInterceptor implements HandlerInterceptor {
/**
* .
*/
@SuppressWarnings("unused")
private boolean isAjax(HttpServletRequest request, HttpServletResponse response){
private boolean isAjax(HttpServletRequest request){
return oConvertUtils.isNotEmpty(request.getHeader("X-Requested-With"));
}
/**
* Ajax
* @param response
*/
private void processAjax(HttpServletResponse response){
AjaxJson json = new AjaxJson();
json.setSuccess(false);
@ -377,5 +254,21 @@ public class AuthInterceptor implements HandlerInterceptor {
pw.close();
}
}
public List<String> getExcludeUrls() {
return excludeUrls;
}
public void setExcludeUrls(List<String> excludeUrls) {
this.excludeUrls = excludeUrls;
}
public List<String> getExcludeContainUrls() {
return excludeContainUrls;
}
public void setExcludeContainUrls(List<String> excludeContainUrls) {
this.excludeContainUrls = excludeContainUrls;
}
}

@ -13,7 +13,11 @@ import java.util.HashMap;
import java.util.Map;
/**
* Created by dangzhenghui on 2017-4-1.
* API <br/>
* { /api/**headerX-JEECG-SIGN }
* date: 2017-4-1 <br/>
* @author dangzhenghui
*
*/
public class SignInterceptor implements HandlerInterceptor {
private static final String SIGN_KEY = "26F72780372E84B6CFAED6F7B19139CC47B1912B6CAED753";

@ -0,0 +1,138 @@
package org.jeecgframework.core.interceptors;
import java.util.Enumeration;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.log4j.Logger;
import org.jeecgframework.core.common.model.json.AjaxJson;
import org.jeecgframework.core.util.IpUtil;
import org.jeecgframework.core.util.JSONHelper;
import org.jeecgframework.core.util.ResourceUtil;
import org.jeecgframework.web.cgform.common.CgAutoListConstant;
import org.jeecgframework.web.system.pojo.base.TSUser;
import org.springframework.web.servlet.HandlerInterceptor;
import org.springframework.web.servlet.ModelAndView;
/**
* SQL
*
* @author scott
* @time 2018-05-21
*/
public class SqlInjectInterceptor implements HandlerInterceptor {
private static final Logger logger = Logger.getLogger(SqlInjectInterceptor.class);
/**
* 线URL(SQL)
*/
private List<String> onlineOptUrls;
@Override
public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object arg2, Exception arg3)
throws Exception {
// TODO Auto-generated method stub
}
@Override
public void postHandle(HttpServletRequest request, HttpServletResponse response, Object arg2, ModelAndView arg3)
throws Exception {
// TODO Auto-generated method stub
}
@Override
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object arg2) throws Exception {
//1.在线开发功能有SQL值情况针对数据库SQL操作进行开发者权限控制防止SQL注入
String requestPath = ResourceUtil.getJgAuthRequsetPath(request);
if (onlineOptUrls.contains(requestPath)) {
TSUser currentUser = ResourceUtil.getSessionUser();
if(CgAutoListConstant.SYS_DEV_FLAG_0.equals(currentUser.getDevFlag())){
logger.info(" ---操作失败,当前用户未授权开发权限-------- 请求IP ---------+"+IpUtil.getIpAddr(request));
AjaxJson json = new AjaxJson();
json.setSuccess(false);
json.setMsg("操作失败,当前用户未授权开发权限!!");
response.setHeader("Cache-Control", "no-store");
response.getWriter().print(JSONHelper.bean2json(json));
return false;
}
return true;
}
//2常规业务操作无SQL值情况 针对数据库SQL操作进行开发者权限控制防止SQL注入
Enumeration<String> 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<xssArr.length;i++){
if(value.indexOf(xssArr[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<String> getOnlineOptUrls() {
return onlineOptUrls;
}
public void setOnlineOptUrls(List<String> onlineOptUrls) {
this.onlineOptUrls = onlineOptUrls;
}
}

@ -12,6 +12,7 @@ import net.sf.json.JSONObject;
import org.jeecgframework.core.online.def.CgReportConstant;
import org.jeecgframework.core.util.DBTypeUtil;
import org.jeecgframework.core.util.SqlInjectionUtil;
import org.jeecgframework.core.util.StringUtil;
/**
@ -54,7 +55,10 @@ public class CgReportQueryParamUtil
e.printStackTrace();
return;
}
sql_inj_throw(value);
// sql_inj_throw(value);
SqlInjectionUtil.filterContent(value);
value = applyType(filedType,value);
if(!StringUtil.isEmpty(value)){
if(value.contains("*")){
@ -68,10 +72,16 @@ public class CgReportQueryParamUtil
}else if("group".equals(queryMode)){
//范围查询组装
String begin = request.getParameter(filedName+"_begin");
sql_inj_throw(begin);
// sql_inj_throw(begin);
SqlInjectionUtil.filterContent(begin);
begin= applyType(filedType,begin);
String end = request.getParameter(filedName+"_end");
sql_inj_throw(end);
// sql_inj_throw(end);
SqlInjectionUtil.filterContent(end);
end= applyType(filedType,end);
if(!StringUtil.isEmpty(begin)){
String re = CgReportConstant.OP_RQ+begin;
@ -155,35 +165,36 @@ public class CgReportQueryParamUtil
return datetime;
}
}
/**
* sql
* @param str sql
* @return
*/
public static boolean sql_inj(String str) {
if(StringUtil.isEmpty(str)){
return false;
}
String inj_str = "'|and|exec|insert|select|delete|update|count|chr|mid|master|truncate|char|declare|;|or|+|,";
// String inj_str = "'|and|exec|insert|select|delete|update|count|chr|mid|master|truncate|char|declare|;|or|-|+|,";
String inj_stra[] = inj_str.split("\\|");
for (int i = 0; i < inj_stra.length; i++) {
if (str.indexOf(" "+inj_stra[i]+" ") >= 0) {
return true;
}
}
return false;
}
/**
* sql
* @param str sql
*/
public static void sql_inj_throw(String str){
if(sql_inj(str)){
throw new RuntimeException("请注意,填入的参数可能存在SQL注入!");
}
}
// /**
// * 防止sql注入
// * @param str 输入sql
// * @return 是否存在注入关键字
// */
// public static boolean sql_inj(String str) {
// if(StringUtil.isEmpty(str)){
// return false;
// }
// String inj_str = "'|and|exec|insert|select|delete|update|count|chr|mid|master|truncate|char|declare|;|or|+|,";
//// String inj_str = "'|and|exec|insert|select|delete|update|count|chr|mid|master|truncate|char|declare|;|or|-|+|,";
// String inj_stra[] = inj_str.split("\\|");
// for (int i = 0; i < inj_stra.length; i++) {
// if (str.indexOf(" "+inj_stra[i]+" ") >= 0) {
// return true;
// }
// }
// return false;
// }
// /**
// * 当存在sql注入时抛异常
// * @param str 输入sql
// */
// public static void sql_inj_throw(String str){
// if(sql_inj(str)){
// throw new RuntimeException("请注意,填入的参数可能存在SQL注入!");
// }
// }
/**
*

@ -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);
}
/**

@ -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());
}
}
}

@ -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<String> 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));
}
}
}

@ -2,7 +2,6 @@ package org.jeecgframework.core.timer;
import java.io.IOException;
import java.net.UnknownHostException;
import java.text.ParseException;
import java.util.List;
import javax.annotation.Resource;
@ -17,18 +16,21 @@ import org.jeecgframework.core.util.StringUtil;
import org.jeecgframework.web.system.pojo.base.TSTimeTaskEntity;
import org.jeecgframework.web.system.service.SystemService;
import org.jeecgframework.web.system.service.TimeTaskServiceI;
import org.quartz.CronScheduleBuilder;
import org.quartz.CronTrigger;
import org.quartz.JobBuilder;
import org.quartz.JobDetail;
import org.quartz.JobKey;
import org.quartz.Scheduler;
import org.quartz.SchedulerException;
import org.quartz.Trigger;
import org.quartz.TriggerBuilder;
import org.quartz.TriggerKey;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.quartz.CronTriggerBean;
import org.springframework.stereotype.Service;
import com.alibaba.fastjson.JSONObject;
/**
* ,Spring
* @author JueYue
@ -40,13 +42,13 @@ public class DynamicTask {
private static Logger logger = Logger.getLogger(DynamicTask.class);
@Resource
@Autowired(required=false)
private Scheduler schedulerFactory;
@Autowired
@Autowired(required=false)
private TimeTaskServiceI timeTaskService;
@Autowired
@Autowired(required=false)
private SystemService systemService;
@ -56,26 +58,19 @@ public class DynamicTask {
*/
private boolean startTask(TSTimeTaskEntity task){
try {
/*
//quartz 2.2
JobDetailImpl jobDetail = new JobDetailImpl();
jobDetail.setName(taskCode);
jobDetail.setGroup(Scheduler.DEFAULT_GROUP);
jobDetail.setJobClass(getClassByTask(task.getJob_class()));
CronTriggerImpl cronTrigger = new CronTriggerImpl("cron_" + taskCode,Scheduler.DEFAULT_GROUP, jobDetail.getName(),Scheduler.DEFAULT_GROUP);
cronTrigger.setCronExpression(cronExpress);
*/
//quartz 1.6
JobDetail jobDetail = new JobDetail();
jobDetail.setName(task.getId());
jobDetail.setGroup(Scheduler.DEFAULT_GROUP);
jobDetail.setJobClass(MyClassLoader.getClassByScn(task.getClassName()));
CronTrigger cronTrigger = new CronTrigger("cron_" + task.getId(),Scheduler.DEFAULT_GROUP, jobDetail.getName(),Scheduler.DEFAULT_GROUP);
cronTrigger.setCronExpression(task.getCronExpression());
schedulerFactory.scheduleJob(jobDetail, cronTrigger);
// JobDetail jobDetail = new JobDetail();
// jobDetail.setName(task.getId());
// jobDetail.setGroup(Scheduler.DEFAULT_GROUP);
// jobDetail.setJobClass(MyClassLoader.getClassByScn(task.getClassName()));
// CronTrigger cronTrigger = new CronTrigger("cron_" + task.getId(),Scheduler.DEFAULT_GROUP, jobDetail.getName(),Scheduler.DEFAULT_GROUP);
// cronTrigger.setCronExpression(task.getCronExpression());
//quartz 2.3.0
//向调度器中添加任务
scheduleJob(task);
return true;
} catch (ParseException e) {
logger.error("startTask ParseException"+ e.getMessage());
} catch (SchedulerException e) {
logger.error("startTask SchedulerException"+" cron_" + task.getId()+ e.getMessage());
}
@ -90,13 +85,19 @@ public class DynamicTask {
private boolean endTask(TSTimeTaskEntity task){
try{
/*
//quartz 2.2
JobKey jobKey = new JobKey(taskName, Scheduler.DEFAULT_GROUP);
TriggerKey triggerKey = new TriggerKey("cron_" + task.getId());
//停止触发器
schedulerFactory.pauseTrigger(triggerKey);
//移除触发器
schedulerFactory.unscheduleJob(triggerKey);
JobKey jobKey = new JobKey(task.getId());
//删除任务
schedulerFactory.deleteJob(jobKey);
*/
//quartz 1.6
schedulerFactory.unscheduleJob("cron_" + task.getId(), Scheduler.DEFAULT_GROUP);
// schedulerFactory.unscheduleJob("cron_" + task.getId());
return true;
}catch (SchedulerException e) {
logger.error("endTask SchedulerException" + " cron_" + task.getId() + e.getMessage());
@ -138,13 +139,24 @@ public class DynamicTask {
//任务运行中
if("1".equals(task.getIsStart())){
CronTriggerBean trigger = (CronTriggerBean)schedulerFactory.getTrigger("cron_" + task.getId(), Scheduler.DEFAULT_GROUP);
String originExpression = trigger.getCronExpression();
// CronTriggerBean trigger = (CronTriggerBean)schedulerFactory.getTrigger("cron_" + task.getId(), Scheduler.DEFAULT_GROUP);
// String originExpression = trigger.getCronExpression();
//检查运行中的任务触发规则是否与新规则一致
if (!originExpression.equalsIgnoreCase(newExpression)) {
trigger.setCronExpression(newExpression);
schedulerFactory.rescheduleJob("cron_" + task.getId(), Scheduler.DEFAULT_GROUP, trigger);
}
// if (!originExpression.equalsIgnoreCase(newExpression)) {
// trigger.setCronExpression(newExpression);
// schedulerFactory.rescheduleJob("cron_" + task.getId(), Scheduler.DEFAULT_GROUP, trigger);
// }
//通过触发器key 向调度器 获取触发器实例
Trigger oldTrigger = schedulerFactory.getTrigger(new TriggerKey("cron_" + task.getId()));
//获取bulid对象
TriggerBuilder tb = oldTrigger.getTriggerBuilder();
//创建触发器
CronScheduleBuilder cronScheduleBuilder = CronScheduleBuilder.cronSchedule(newExpression);
Trigger newTrigger = tb.withSchedule(cronScheduleBuilder).build();
//更新触发器
schedulerFactory.rescheduleJob(oldTrigger.getKey(), newTrigger);
}else{
//立即生效
List<String> ipList = IpUtil.getLocalIPList();
@ -185,8 +197,6 @@ public class DynamicTask {
}
} catch (SchedulerException e) {
logger.error("updateCronExpression SchedulerException" + " cron_" + task.getId() + e.getMessage());
} catch (ParseException e) {
logger.error("updateCronExpression ParseException" + " cron_" + task.getId() + e.getMessage());
}
return false;
@ -256,17 +266,18 @@ public class DynamicTask {
if(ipList.contains(runServerIp) || StringUtil.isEmpty(runServerIp) || "本地".equals(runServerIp)){//当前服务器IP匹配成功
//quartz 1.6
JobDetail jobDetail = new JobDetail();
jobDetail.setName(task.getId());
jobDetail.setGroup(Scheduler.DEFAULT_GROUP);
jobDetail.setJobClass(MyClassLoader.getClassByScn(task.getClassName()));
CronTrigger cronTrigger = new CronTrigger("cron_" + task.getId(),Scheduler.DEFAULT_GROUP, jobDetail.getName(),Scheduler.DEFAULT_GROUP);
cronTrigger.setCronExpression(task.getCronExpression());
schedulerFactory.scheduleJob(jobDetail, cronTrigger);
// JobDetail jobDetail = new JobDetail();
// jobDetail.setName(task.getId());
// jobDetail.setGroup(Scheduler.DEFAULT_GROUP);
// jobDetail.setJobClass(MyClassLoader.getClassByScn(task.getClassName()));
// CronTrigger cronTrigger = new CronTrigger("cron_" + task.getId(),Scheduler.DEFAULT_GROUP, jobDetail.getName(),Scheduler.DEFAULT_GROUP);
// cronTrigger.setCronExpression(task.getCronExpression());
//向调度器中添加任务
scheduleJob(task);
logger.info(" register time task class is { "+task.getClassName()+" } ");
}
} catch (ParseException e) {
logger.error("startTask ParseException"+ e.getMessage());
} catch (SchedulerException e) {
logger.error("startTask SchedulerException"+" cron_" + task.getId()+ e.getMessage());
}
@ -274,5 +285,27 @@ public class DynamicTask {
}
}
/**
*
* @param task
* @throws SchedulerException
*/
private void scheduleJob(TSTimeTaskEntity task) throws SchedulerException {
//build 要执行的任务
JobDetail jobDetail = JobBuilder.newJob(MyClassLoader.getClassByScn(task.getClassName()))
.withIdentity(task.getId())
.storeDurably()
.requestRecovery()
.build();
//根据Cron表达式 build 触发时间对象
CronScheduleBuilder cronScheduleBuilder = CronScheduleBuilder.cronSchedule(task.getCronExpression());
//build 任务触发器
CronTrigger cronTrigger = TriggerBuilder.newTrigger()
.withIdentity("cron_" + task.getId())
.withSchedule(cronScheduleBuilder)//标明触发时间
.build();
//向调度器注册 定时任务
schedulerFactory.scheduleJob(jobDetail, cronTrigger);
}
}

@ -39,11 +39,12 @@ public class DynamicDBUtil {
String driverClassName = dynamicSourceEntity.getDriverClass();
String url = dynamicSourceEntity.getUrl();
String dbUser = dynamicSourceEntity.getDbUser();
// update-start--Author:chenjin Date:20160712 for多数据源目前数据库密码是明文采用加密方式存储
//设置数据源的时候,要重新解密
//String dbPassword = dynamicSourceEntity.getDbPassword();
String dbPassword = PasswordUtil.decrypt(dynamicSourceEntity.getDbPassword(), dynamicSourceEntity.getDbUser(), PasswordUtil.getStaticSalt());//解密字符串;
// update-end--Author:chenjin Date:20160712 for多数据源目前数据库密码是明文采用加密方式存储
dataSource.setDriverClassName(driverClassName);
dataSource.setUrl(url);
@ -115,7 +116,8 @@ public class DynamicDBUtil {
}
return effectCount;
}
//add-begin--Author:yugwu Date:20170808 for:TASK #1827 【改造】多数据源支持minidao语法sql----
/**
* miniDaoUpdate
* @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<Map<String, Object>> 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<String, Object> map = (Map<String, Object>) findOneByHash(dbKey, sql, data);
return ReflectHelper.setAll(clazz, map);
}
//add-begin--Author:yugwu Date:20170810 for:返回单个实例而非hashMap----
public static List<Map<String, Object>> findList(final String dbKey, String sql, Object... param) {
List<Map<String, Object>> 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 <T> List<T> findList(final String dbKey, String sql, Class<T> clazz,Object... param) {
List<T> 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<Map<String,Object>> 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) {

@ -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";

@ -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;
/**
* JSONJAVAPOJO
* @author

@ -211,8 +211,9 @@ public class PinyinUtil {
try {
pinyingStr = PinyinHelper.toHanyuPinyinString(hanzi, defaultFormat,
separator);
pinyingStr = PinyinHelper.toHanYuPinyinString(hanzi, defaultFormat,
separator,false);
} catch (BadHanyuPinyinOutputFormatCombination e) {

@ -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) {

@ -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
* redisredis.properties
*/
@SuppressWarnings({ "rawtypes", "unchecked" })
public class RedisUtil {
private static RedisTemplate redisTemplate;
private static ConcurrentHashMap<String, BoundKeyOperations> boundKeyOperations = new ConcurrentHashMap<String, BoundKeyOperations>();
/**
*
*/
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();
}
}
/**
* StringRedis
* getBoundsetIfAbsentsetdeletehasKeygetgetAndRemove
* getBound
* setIfAbsent
* set
* delete
* hasKey
* get
* getAndRemove
*/
public static class StringR {
/**getBound用来缓存处理类防止多次处理生成多个处理类*/
public static BoundValueOperations<String, String> 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<String, String>)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);
}
}
/**
* ObjectRedis
*/
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);
}
}
/**
* ListRedis
* add list
* size listsize
* get listindex
* getAll list
* getAllAndRemove list
*/
public static class ListR {
/**getBound用来缓存处理类防止多次处理生成多个处理类*/
public static BoundListOperations getBound(String oldkey){
cleanOperas();
String key = ListRKey + oldkey;
BoundKeyOperations boundKeyOperation = boundKeyOperations.get(key);
if(boundKeyOperation == null){
boundKeyOperation = redisTemplate.boundListOps(key);
boundKeyOperations.put(key, boundKeyOperation);
}
return (BoundListOperations)boundKeyOperation;
}
/**setIfAbsent 如果不存在就添加缓存*/
public static Boolean setIfAbsent(String key, List value) {
return setIfAbsent(key, value, 30L, TimeUnit.MINUTES);
}
/**setIfAbsent 如果不存在就添加缓存,并设置缓存超时时间*/
public static Boolean setIfAbsent(String key, List value, long expire,
TimeUnit timeUnit) {
if(hasKey(key)){
return false;
}else{
return set(key, value, expire, timeUnit);
}
}
/**set 添加或更改缓存内容*/
public static Boolean set(String key, List value) {
return set(key, value, 30L, TimeUnit.MINUTES);
}
/**set 添加或更改缓存内容,并设置过期时间*/
public static Boolean set(String key, List value, long expire,
TimeUnit timeUnit) {
Boolean rt = Boolean.FALSE;
if (value == null || value.size() <= 0) {
return rt;
}
BoundListOperations boundListOperations = getBound(key);
for(Object obj : value){
boundListOperations.rightPush(obj);
}
if (rt) {
redisTemplate.expire(ListRKey + key, expire, timeUnit);
}
return rt;
}
/**add 在list末添加新实体e*/
public static Boolean add(String key, Object value) {
return add(key, value, 30L, TimeUnit.MINUTES);
}
/**add 在list末添加新实体并设置过期时间*/
public static Boolean add(String key, Object value, long expire,
TimeUnit timeUnit) {
Boolean rt = Boolean.FALSE;
if (value == null) {
return rt;
}
getBound(key).rightPush(value);
if (rt) {
redisTemplate.expire(ListRKey + key, expire, timeUnit);
}
return rt;
}
/**size 当前list的size*/
public static Long size(String key) {
return getBound(key).size();
}
/**get 当前list的第index个数据*/
public static Object get(String key, long index) {
return getBound(key).index(index);
}
/**getAll 获取当前list数据*/
public static ArrayList getAll(String key) {
if(!hasKey(key)){
return null;
}
List<String> 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<String, BoundKeyOperations>();
}
}
/**
*
* @param area
* @param key
*/
public static void delete(String area, String key) {
redisTemplate.delete(area + key);
}
/**
* hasKey
* @param area
* @param key
*/
public static Boolean hasKey(String area, String key) {
return redisTemplate.hasKey(area + key);
}
/**
* redis
*/
public static void cleanAll(){
redisTemplate.getConnectionFactory().getConnection().flushAll();
}
}

@ -10,12 +10,15 @@ import java.util.Map;
import java.util.Map.Entry;
import java.util.regex.Pattern;
import org.apache.log4j.Logger;
/**
* @author
* @desc get set
*/
public class ReflectHelper {
private static final Logger logger = Logger.getLogger(ReflectHelper.class);
@SuppressWarnings("rawtypes")
private Class cls;
/**
@ -70,7 +73,7 @@ public class ReflectHelper {
param = setM.matcher(methodName).replaceAll(rapl).toLowerCase();
setMethods.put(param, m);
} else {
// org.jeecgframework.core.util.LogUtil.info(methodName + " 不是getter,setter方法");
// logger.info(methodName + " 不是getter,setter方法");
}
}
}
@ -87,7 +90,7 @@ public class ReflectHelper {
m.invoke(obj, object);
return true;
} catch (Exception ex) {
org.jeecgframework.core.util.LogUtil.info("invoke getter on " + property + " error: " + ex.toString());
logger.info("invoke getter on " + property + " error: " + ex.toString());
return false;
}
}
@ -109,7 +112,7 @@ public class ReflectHelper {
value=m.invoke(obj, new Object[] {});
} catch (Exception ex) {
org.jeecgframework.core.util.LogUtil.info("invoke getter on " + property + " error: " + ex.toString());
logger.info("invoke getter on " + property + " error: " + ex.toString());
}
}
return value;

@ -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<String, DynamicDataSourceEntity> dynamicDataSourceMap = new HashMap<String, DynamicDataSourceEntity>();
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<TSRoleFunction> getSessionTSRoleFunction(String roleId) {
HttpSession session = ContextHolderUtils.getSession();
if (session.getAttributeNames().hasMoreElements()) {
List<TSRoleFunction> TSRoleFunctionList = (List<TSRoleFunction>)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

@ -0,0 +1,42 @@
package org.jeecgframework.core.util;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* sql
* @author zhoujf
*
*/
public class SqlInjectionUtil {
private static final Logger logger = LoggerFactory.getLogger(SqlInjectionUtil.class);
/**
* sql
* @param value
* @return
*/
public static void filterContent(String value) {
if(value == null || "".equals(value)){
return ;
}
value = value.toLowerCase();//统一转为小写
// throw new RuntimeException("值存在sql注入风险"+value);
// String xssStr = "and |or |select |update |delete |drop |truncate |%20|=|--|!=";
String xssStr = "'|and |exec |insert |select |delete |update |drop |count |chr |mid |master |truncate |char |declare |;|or |+|,";
String[] xssArr = xssStr.split("\\|");
for(int i=0;i<xssArr.length;i++){
if(value.indexOf(xssArr[i])>-1){
logger.info("请注意,值可能存在SQL注入风险!---> {}",value);
throw new RuntimeException("请注意,值可能存在SQL注入风险!--->"+value);
}
}
return ;
}
public static void main(String[] args) {
String str = "' and";
filterContent(str);
}
}

@ -43,7 +43,8 @@ public class SysThemesUtil {
*/
public static String getEasyUiTheme(SysThemesEnum sysThemesEnum){
StringBuffer sb = new StringBuffer("");
sb.append("<link id=\"easyuiTheme\" rel=\"stylesheet\" href=\"plug-in/easyui/themes/"+sysThemesEnum.getThemes()+"/easyui.css\" type=\"text/css\"></link>");
String basePath = ResourceUtil.getBasePath();
sb.append("<link id=\"easyuiTheme\" rel=\"stylesheet\" href=\""+basePath+"/plug-in/easyui/themes/"+sysThemesEnum.getThemes()+"/easyui.css\" type=\"text/css\"></link>");
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("<link id=\"easyuiTheme\" rel=\"stylesheet\" href=\"plug-in/easyui/themes/metro/main.css\" type=\"text/css\"></link>");
sb.append("<link id=\"easyuiTheme\" rel=\"stylesheet\" href=\""+basePath+"/plug-in/easyui/themes/metro/main.css\" type=\"text/css\"></link>");
}else if("metrole".equals(sysThemesEnum.getThemes())){
sb.append("<link id=\"easyuiTheme\" rel=\"stylesheet\" href=\"plug-in/easyui/themes/metrole/main.css\" type=\"text/css\"></link>");
sb.append("<link id=\"easyuiTheme\" rel=\"stylesheet\" href=\""+basePath+"/plug-in/easyui/themes/metrole/main.css\" type=\"text/css\"></link>");
}
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("<link id=\"easyuiTheme\" rel=\"stylesheet\" href=\"plug-in/easyui/themes/metrole/icon.css\" type=\"text/css\"></link>");
sb.append("<link id=\"easyuiTheme\" rel=\"stylesheet\" href=\""+basePath+"/plug-in/easyui/themes/metrole/icon.css\" type=\"text/css\"></link>");
}else {
sb.append("<link id=\"easyuiTheme\" rel=\"stylesheet\" href=\"plug-in/easyui/themes/icon.css\" type=\"text/css\"></link>");
sb.append("<link id=\"easyuiTheme\" rel=\"stylesheet\" href=\""+basePath+"/plug-in/easyui/themes/icon.css\" type=\"text/css\"></link>");
}
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("<link rel=\"stylesheet\" href=\"plug-in/tools/css/metro/common.css\" type=\"text/css\"></link>");
sb.append("<link rel=\"stylesheet\" href=\""+basePath+"/plug-in/tools/css/metro/common.css\" type=\"text/css\"></link>");
}else if("metrole".equals(sysThemesEnum.getThemes())){
sb.append("<link rel=\"stylesheet\" href=\"plug-in/tools/css/metrole/common.css\" type=\"text/css\"></link>");
sb.append("<link rel=\"stylesheet\" href=\""+basePath+"/plug-in/tools/css/metrole/common.css\" type=\"text/css\"></link>");
}else{
sb.append("<link rel=\"stylesheet\" href=\"plug-in/tools/css/common.css\" type=\"text/css\"></link>");
sb.append("<link rel=\"stylesheet\" href=\""+basePath+"/plug-in/tools/css/common.css\" type=\"text/css\"></link>");
}
sb.append("<link rel=\"stylesheet\" href=\"plug-in/ace/css/font-awesome.css\" type=\"text/css\"></link>");
sb.append("<link rel=\"stylesheet\" href=\""+basePath+"/plug-in/ace/css/font-awesome.css\" type=\"text/css\"></link>");
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("<script type=\"text/javascript\" src=\"plug-in/lhgDialog/lhgdialog.min.js?skin=metro\"></script>");
sb.append("<script type=\"text/javascript\" src=\""+basePath+"/plug-in/lhgDialog/lhgdialog.min.js?skin=metro\"></script>");
}else if("metrole".equals(sysThemesEnum.getThemes())){
sb.append("<script type=\"text/javascript\" src=\"plug-in/lhgDialog/lhgdialog.min.js?skin=metrole\"></script>");
sb.append("<script type=\"text/javascript\" src=\""+basePath+"/plug-in/lhgDialog/lhgdialog.min.js?skin=metrole\"></script>");
}else{
sb.append("<script type=\"text/javascript\" src=\"plug-in/lhgDialog/lhgdialog.min.js\"></script>");
sb.append("<script type=\"text/javascript\" src=\""+basePath+"/plug-in/lhgDialog/lhgdialog.min.js\"></script>");
}
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("<script type=\"text/javascript\" src=\"plug-in/ace/js/bootstrap-tab.js\"></script>");
sb.append("<script type=\"text/javascript\" src=\""+basePath+"/plug-in/ace/js/bootstrap-tab.js\"></script>");
}else if("metrole".equals(sysThemesEnum.getThemes())){
sb.append("<script type=\"text/javascript\" src=\"plug-in/ace/js/bootstrap-tab.js\"></script>");
sb.append("<script type=\"text/javascript\" src=\""+basePath+"/plug-in/ace/js/bootstrap-tab.js\"></script>");
}
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("<link rel=\"stylesheet\" href=\"plug-in/graphreport/css/metro/report.css\" type=\"text/css\"></link>");
sb.append("<link rel=\"stylesheet\" href=\""+basePath+"/plug-in/graphreport/css/metro/report.css\" type=\"text/css\"></link>");
}else if("metrole".equals(sysThemesEnum.getThemes())){
sb.append("<link rel=\"stylesheet\" href=\"plug-in/graphreport/css/metrole/report.css\" type=\"text/css\"></link>");
sb.append("<link rel=\"stylesheet\" href=\""+basePath+"/plug-in/graphreport/css/metrole/report.css\" type=\"text/css\"></link>");
}else{
sb.append("<link rel=\"stylesheet\" href=\"plug-in/graphreport/css/report.css\" type=\"text/css\"></link>");
sb.append("<link rel=\"stylesheet\" href=\""+basePath+"/plug-in/graphreport/css/report.css\" type=\"text/css\"></link>");
}
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("<link rel=\"stylesheet\" href=\"plug-in/Validform/css/metro/divfrom.css\" type=\"text/css\"/>");
sb.append("<link rel=\"stylesheet\" href=\""+basePath+"/plug-in/Validform/css/metro/divfrom.css\" type=\"text/css\"/>");
}else if("metrole".equals(sysThemesEnum.getThemes())){
sb.append("<link rel=\"stylesheet\" href=\"plug-in/Validform/css/metrole/divfrom.css\" type=\"text/css\"/>");
sb.append("<link rel=\"stylesheet\" href=\""+basePath+"/plug-in/Validform/css/metrole/divfrom.css\" type=\"text/css\"/>");
}else{
sb.append("<link rel=\"stylesheet\" href=\"plug-in/Validform/css/divfrom.css\" type=\"text/css\"/>");
sb.append("<link rel=\"stylesheet\" href=\""+basePath+"/plug-in/Validform/css/divfrom.css\" type=\"text/css\"/>");
}
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("<link rel=\"stylesheet\" href=\"plug-in/Validform/css/metro/style.css\" type=\"text/css\"/>");
sb.append("<link rel=\"stylesheet\" href=\""+basePath+"/plug-in/Validform/css/metro/style.css\" type=\"text/css\"/>");
}else if("metrole".equals(sysThemesEnum.getThemes())){
sb.append("<link rel=\"stylesheet\" href=\"plug-in/Validform/css/metrole/style.css\" type=\"text/css\"/>");
sb.append("<link rel=\"stylesheet\" href=\""+basePath+"/plug-in/Validform/css/metrole/style.css\" type=\"text/css\"/>");
}else{
sb.append("<link rel=\"stylesheet\" href=\"plug-in/Validform/css/style.css\" type=\"text/css\"/>");
sb.append("<link rel=\"stylesheet\" href=\""+basePath+"/plug-in/Validform/css/style.css\" type=\"text/css\"/>");
}
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("<link rel=\"stylesheet\" href=\"plug-in/Validform/css/metro/tablefrom.css\" type=\"text/css\"/>");
sb.append("<link rel=\"stylesheet\" href=\""+basePath+"/plug-in/Validform/css/metro/tablefrom.css\" type=\"text/css\"/>");
}else if("metrole".equals(sysThemesEnum.getThemes())){
sb.append("<link rel=\"stylesheet\" href=\"plug-in/Validform/css/metrole/tablefrom.css\" type=\"text/css\"/>");
sb.append("<link rel=\"stylesheet\" href=\""+basePath+"/plug-in/Validform/css/metrole/tablefrom.css\" type=\"text/css\"/>");
}else{
sb.append("<link rel=\"stylesheet\" href=\"plug-in/Validform/css/tablefrom.css\" type=\"text/css\"/>");
sb.append("<link rel=\"stylesheet\" href=\""+basePath+"/plug-in/Validform/css/tablefrom.css\" type=\"text/css\"/>");
}
return sb.toString();
}

@ -10,8 +10,7 @@ import org.jeecgframework.jwt.def.JwtConstants;
import org.jeecgframework.jwt.model.TokenModel;
import org.jeecgframework.web.system.pojo.base.TSUser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.serializer.JdkSerializationRedisSerializer;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Component;
/**
@ -21,15 +20,8 @@ import org.springframework.stereotype.Component;
*/
@Component
public class RedisTokenManager implements TokenManager {
private RedisTemplate redisTemplate;
@Autowired
public void setRedis(RedisTemplate redisTemplate) {
this.redisTemplate = redisTemplate;
//泛型设置成Long后必须更改对应的序列化方案
redisTemplate.setKeySerializer(new JdkSerializationRedisSerializer());
}
@Autowired
private StringRedisTemplate redisTemplate;
/**
* TOKEN

@ -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) {

@ -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("<script type=\"text/javascript\" src=\"plug-in/mutiLang/{0}.js\"></script>", "{0}", lang);
String langjs = StringUtil.replace("<script type=\"text/javascript\" src=\""+basePath+"/plug-in/mutiLang/{0}.js\"></script>", "{0}", lang);
sb.append(langjs);
if (oConvertUtils.isIn("jquery-webos", types)) {
sb.append("<script type=\"text/javascript\" src=\"plug-in/sliding/js/jquery-1.7.1.min.js\"></script>");
sb.append("<script type=\"text/javascript\" src=\""+basePath+"/plug-in/sliding/js/jquery-1.7.1.min.js\"></script>");
} else if (oConvertUtils.isIn("jquery", types)) {
sb.append("<script type=\"text/javascript\" src=\"plug-in/jquery/jquery-1.8.3.js\"></script>");
sb.append("<script type=\"text/javascript\" src=\"plug-in/jquery/jquery.cookie.js\" ></script>");
sb.append("<script type=\"text/javascript\" src=\"plug-in/jquery-plugs/storage/jquery.storageapi.min.js\" ></script>");
sb.append("<script type=\"text/javascript\" src=\""+basePath+"/plug-in/jquery/jquery-1.8.3.js\"></script>");
sb.append("<script type=\"text/javascript\" src=\""+basePath+"/plug-in/jquery/jquery.cookie.js\" ></script>");
sb.append("<script type=\"text/javascript\" src=\""+basePath+"/plug-in/jquery-plugs/storage/jquery.storageapi.min.js\" ></script>");
}
if (oConvertUtils.isIn("ckeditor", types)) {
sb.append("<script type=\"text/javascript\" src=\"plug-in/ckeditor/ckeditor.js\"></script>");
sb.append("<script type=\"text/javascript\" src=\"plug-in/tools/ckeditorTool.js\"></script>");
sb.append("<script type=\"text/javascript\" src=\""+basePath+"/plug-in/ckeditor/ckeditor.js\"></script>");
sb.append("<script type=\"text/javascript\" src=\""+basePath+"/plug-in/tools/ckeditorTool.js\"></script>");
}
if (oConvertUtils.isIn("easyui", types)) {
sb.append("<script type=\"text/javascript\" src=\"plug-in/tools/dataformat.js\"></script>");
sb.append("<script type=\"text/javascript\" src=\""+basePath+"/plug-in/tools/dataformat.js\"></script>");
sb.append(SysThemesUtil.getEasyUiTheme(sysThemesEnum));
sb.append(SysThemesUtil.getEasyUiMainTheme(sysThemesEnum));
sb.append(SysThemesUtil.getEasyUiIconTheme(sysThemesEnum));
sb.append("<link rel=\"stylesheet\" type=\"text/css\" href=\"plug-in/accordion/css/accordion.css\">");
sb.append("<link rel=\"stylesheet\" type=\"text/css\" href=\"plug-in/accordion/css/icons.css\">");
sb.append("<script type=\"text/javascript\" src=\"plug-in/easyui/jquery.easyui.min.1.3.2.js\"></script>");
sb.append(StringUtil.replace("<script type=\"text/javascript\" src=\"plug-in/easyui/locale/{0}.js\"></script>", "{0}", lang));
sb.append("<script type=\"text/javascript\" src=\"plug-in/tools/syUtil.js\"></script>");
sb.append("<script type=\"text/javascript\" src=\"plug-in/easyui/extends/datagrid-scrollview.js\"></script>");
sb.append("<link rel=\"stylesheet\" type=\"text/css\" href=\""+basePath+"/plug-in/accordion/css/accordion.css\">");
sb.append("<link rel=\"stylesheet\" type=\"text/css\" href=\""+basePath+"/plug-in/accordion/css/icons.css\">");
sb.append("<script type=\"text/javascript\" src=\""+basePath+"/plug-in/easyui/jquery.easyui.min.1.3.2.js\"></script>");
sb.append(StringUtil.replace("<script type=\"text/javascript\" src=\""+basePath+"/plug-in/easyui/locale/{0}.js\"></script>", "{0}", lang));
sb.append("<script type=\"text/javascript\" src=\""+basePath+"/plug-in/tools/syUtil.js\"></script>");
sb.append("<script type=\"text/javascript\" src=\""+basePath+"/plug-in/easyui/extends/datagrid-scrollview.js\"></script>");
sb.append("<script type=\"text/javascript\" src=\""+basePath+"/plug-in/mutitables/datagrid-filter.js\"></script>");
}
if (oConvertUtils.isIn("DatePicker", types)) {
sb.append("<script type=\"text/javascript\" src=\"plug-in/My97DatePicker/WdatePicker.js\"></script>");
sb.append("<script type=\"text/javascript\" src=\""+basePath+"/plug-in/My97DatePicker/WdatePicker.js\"></script>");
}
if (oConvertUtils.isIn("jqueryui", types)) {
sb.append("<link rel=\"stylesheet\" href=\"plug-in/jquery-ui/css/ui-lightness/jquery-ui-1.9.2.custom.min.css\" type=\"text/css\"></link>");
sb.append("<script type=\"text/javascript\" src=\"plug-in/jquery-ui/js/jquery-ui-1.9.2.custom.min.js\"></script>");
sb.append("<link rel=\"stylesheet\" href=\""+basePath+"/plug-in/jquery-ui/css/ui-lightness/jquery-ui-1.9.2.custom.min.css\" type=\"text/css\"></link>");
sb.append("<script type=\"text/javascript\" src=\""+basePath+"/plug-in/jquery-ui/js/jquery-ui-1.9.2.custom.min.js\"></script>");
}
if (oConvertUtils.isIn("jqueryui-sortable", types)) {
sb.append("<link rel=\"stylesheet\" href=\"plug-in/jquery-ui/css/ui-lightness/jquery-ui-1.9.2.custom.min.css\" type=\"text/css\"></link>");
sb.append("<script type=\"text/javascript\" src=\"plug-in/jquery-ui/js/ui/jquery.ui.core.js\"></script>");
sb.append("<script type=\"text/javascript\" src=\"plug-in/jquery-ui/js/ui/jquery.ui.widget.js\"></script>");
sb.append("<script type=\"text/javascript\" src=\"plug-in/jquery-ui/js/ui/jquery.ui.mouse.js\"></script>");
sb.append("<script type=\"text/javascript\" src=\"plug-in/jquery-ui/js/ui/jquery.ui.sortable.js\"></script>");
sb.append("<link rel=\"stylesheet\" href=\""+basePath+"/plug-in/jquery-ui/css/ui-lightness/jquery-ui-1.9.2.custom.min.css\" type=\"text/css\"></link>");
sb.append("<script type=\"text/javascript\" src=\""+basePath+"/plug-in/jquery-ui/js/ui/jquery.ui.core.js\"></script>");
sb.append("<script type=\"text/javascript\" src=\""+basePath+"/plug-in/jquery-ui/js/ui/jquery.ui.widget.js\"></script>");
sb.append("<script type=\"text/javascript\" src=\""+basePath+"/plug-in/jquery-ui/js/ui/jquery.ui.mouse.js\"></script>");
sb.append("<script type=\"text/javascript\" src=\""+basePath+"/plug-in/jquery-ui/js/ui/jquery.ui.sortable.js\"></script>");
}
if (oConvertUtils.isIn("prohibit", types)) {
sb.append("<script type=\"text/javascript\" src=\"plug-in/tools/prohibitutil.js\"></script>"); }
sb.append("<script type=\"text/javascript\" src=\""+basePath+"/plug-in/tools/prohibitutil.js\"></script>"); }
if (oConvertUtils.isIn("tools", types)) {
sb.append(SysThemesUtil.getCommonTheme(sysThemesEnum));
sb.append(SysThemesUtil.getLhgdialogTheme(sysThemesEnum));
sb.append(SysThemesUtil.getBootstrapTabTheme(sysThemesEnum));
sb.append("<script type=\"text/javascript\" src=\"plug-in/layer/layer.js\"></script>");
sb.append(StringUtil.replace("<script type=\"text/javascript\" src=\"plug-in/tools/curdtools_{0}.js\"></script>", "{0}", lang));
sb.append("<script type=\"text/javascript\" src=\"plug-in/tools/easyuiextend.js\"></script>");
sb.append("<script type=\"text/javascript\" src=\"plug-in/jquery-plugs/hftable/jquery-hftable.js\"></script>");
sb.append("<script type=\"text/javascript\" src=\"plug-in/tools/json2.js\" ></script>");
sb.append("<script type=\"text/javascript\" src=\""+basePath+"/plug-in/layer/layer.js\"></script>");
sb.append(StringUtil.replace("<script type=\"text/javascript\" src=\""+basePath+"/plug-in/tools/curdtools_{0}.js\"></script>", "{0}", lang));
sb.append("<script type=\"text/javascript\" src=\""+basePath+"/plug-in/tools/easyuiextend.js\"></script>");
sb.append("<script type=\"text/javascript\" src=\""+basePath+"/plug-in/jquery-plugs/hftable/jquery-hftable.js\"></script>");
sb.append("<script type=\"text/javascript\" src=\""+basePath+"/plug-in/tools/json2.js\" ></script>");
}
if (oConvertUtils.isIn("toptip", types)) {
sb.append("<link rel=\"stylesheet\" href=\"plug-in/toptip/css/css.css\" type=\"text/css\"></link>");
sb.append("<script type=\"text/javascript\" src=\"plug-in/toptip/manhua_msgTips.js\"></script>");
sb.append("<link rel=\"stylesheet\" href=\""+basePath+"/plug-in/toptip/css/css.css\" type=\"text/css\"></link>");
sb.append("<script type=\"text/javascript\" src=\""+basePath+"/plug-in/toptip/manhua_msgTips.js\"></script>");
}
if (oConvertUtils.isIn("autocomplete", types)) {
sb.append("<link rel=\"stylesheet\" href=\"plug-in/jquery/jquery-autocomplete/jquery.autocomplete.css\" type=\"text/css\"></link>");
sb.append("<script type=\"text/javascript\" src=\"plug-in/jquery/jquery-autocomplete/jquery.autocomplete.min.js\"></script>");
sb.append("<link rel=\"stylesheet\" href=\""+basePath+"/plug-in/jquery/jquery-autocomplete/jquery.autocomplete.css\" type=\"text/css\"></link>");
sb.append("<script type=\"text/javascript\" src=\""+basePath+"/plug-in/jquery/jquery-autocomplete/jquery.autocomplete.min.js\"></script>");
}
if (oConvertUtils.isIn("jeasyuiextensions", types)) {
sb.append("<script src=\"plug-in/jquery-extensions/release/jquery.jdirk.min.js\" type=\"text/javascript\"></script>");
sb.append("<link href=\"plug-in/jquery-extensions/icons/icon-all.css\" rel=\"stylesheet\" type=\"text/css\" />");
sb.append("<link href=\"plug-in/jquery-extensions/jeasyui-extensions/jeasyui.extensions.css\" rel=\"stylesheet\" type=\"text/css\" />");
sb.append("<script src=\"plug-in/jquery-extensions/jeasyui-extensions/jeasyui.extensions.js\" type=\"text/javascript\"></script>");
sb.append("<script src=\"plug-in/jquery-extensions/jeasyui-extensions/jeasyui.extensions.linkbutton.js\" type=\"text/javascript\"></script>");
sb.append("<script src=\"plug-in/jquery-extensions/jeasyui-extensions/jeasyui.extensions.menu.js\" type=\"text/javascript\"></script>");
sb.append("<script src=\"plug-in/jquery-extensions/jeasyui-extensions/jeasyui.extensions.panel.js\" type=\"text/javascript\"></script>");
sb.append("<script src=\"plug-in/jquery-extensions/jeasyui-extensions/jeasyui.extensions.window.js\" type=\"text/javascript\"></script>");
sb.append("<script src=\"plug-in/jquery-extensions/jeasyui-extensions/jeasyui.extensions.dialog.js\" type=\"text/javascript\"></script>");
sb.append("<script src=\"plug-in/jquery-extensions/jeasyui-extensions/jeasyui.extensions.datagrid.js\" type=\"text/javascript\"></script>");
sb.append("<script src=\""+basePath+"/plug-in/jquery-extensions/release/jquery.jdirk.min.js\" type=\"text/javascript\"></script>");
sb.append("<link href=\""+basePath+"/plug-in/jquery-extensions/icons/icon-all.css\" rel=\"stylesheet\" type=\"text/css\" />");
sb.append("<link href=\""+basePath+"/plug-in/jquery-extensions/jeasyui-extensions/jeasyui.extensions.css\" rel=\"stylesheet\" type=\"text/css\" />");
sb.append("<script src=\""+basePath+"/plug-in/jquery-extensions/jeasyui-extensions/jeasyui.extensions.js\" type=\"text/javascript\"></script>");
sb.append("<script src=\""+basePath+"/plug-in/jquery-extensions/jeasyui-extensions/jeasyui.extensions.linkbutton.js\" type=\"text/javascript\"></script>");
sb.append("<script src=\""+basePath+"/plug-in/jquery-extensions/jeasyui-extensions/jeasyui.extensions.menu.js\" type=\"text/javascript\"></script>");
sb.append("<script src=\""+basePath+"/plug-in/jquery-extensions/jeasyui-extensions/jeasyui.extensions.panel.js\" type=\"text/javascript\"></script>");
sb.append("<script src=\""+basePath+"/plug-in/jquery-extensions/jeasyui-extensions/jeasyui.extensions.window.js\" type=\"text/javascript\"></script>");
sb.append("<script src=\""+basePath+"/plug-in/jquery-extensions/jeasyui-extensions/jeasyui.extensions.dialog.js\" type=\"text/javascript\"></script>");
sb.append("<script src=\""+basePath+"/plug-in/jquery-extensions/jeasyui-extensions/jeasyui.extensions.datagrid.js\" type=\"text/javascript\"></script>");
}
if (oConvertUtils.isIn("ztree", types)) {
sb.append("<link rel=\"stylesheet\" href=\"plug-in/ztree/css/zTreeStyle.css\" type=\"text/css\"></link>");
sb.append("<script type=\"text/javascript\" src=\"plug-in/ztree/js/jquery.ztree.core-3.5.min.js\"></script>");
sb.append("<script type=\"text/javascript\" src=\"plug-in/ztree/js/jquery.ztree.excheck-3.5.min.js\"></script>");
sb.append("<link rel=\"stylesheet\" href=\""+basePath+"/plug-in/ztree/css/zTreeStyle.css\" type=\"text/css\"></link>");
sb.append("<script type=\"text/javascript\" src=\""+basePath+"/plug-in/ztree/js/jquery.ztree.core-3.5.min.js\"></script>");
sb.append("<script type=\"text/javascript\" src=\""+basePath+"/plug-in/ztree/js/jquery.ztree.excheck-3.5.min.js\"></script>");
}
if (oConvertUtils.isIn("bootstrap", types)) {
sb.append("<script type=\"text/javascript\" src=\"plug-in/jquery/jquery-1.9.1.js\"></script>");
sb.append("<link rel=\"stylesheet\" href=\"plug-in/bootstrap3.3.5/css/bootstrap.min.css\" type=\"text/css\"></link>");
sb.append("<script type=\"text/javascript\" src=\"plug-in/bootstrap3.3.5/js/bootstrap.min.js\"></script>");
sb.append("<link rel=\"stylesheet\" href=\"plug-in/bootstrap3.3.5/css/default.css\" type=\"text/css\"></link>");
sb.append("<script type=\"text/javascript\" src=\""+basePath+"/plug-in/jquery/jquery-1.9.1.js\"></script>");
sb.append("<link rel=\"stylesheet\" href=\""+basePath+"/plug-in/bootstrap3.3.5/css/bootstrap.min.css\" type=\"text/css\"></link>");
sb.append("<script type=\"text/javascript\" src=\""+basePath+"/plug-in/bootstrap3.3.5/js/bootstrap.min.js\"></script>");
sb.append("<link rel=\"stylesheet\" href=\""+basePath+"/plug-in/bootstrap3.3.5/css/default.css\" type=\"text/css\"></link>");
}
if (oConvertUtils.isIn("bootstrap-table", types)) {
sb.append("<link rel=\"stylesheet\" href=\"plug-in/bootstrap-table/bootstrap-table.min.css\" type=\"text/css\"></link>");
sb.append("<script type=\"text/javascript\" src=\"plug-in/bootstrap-table/bootstrap-table.js\"></script>");
sb.append("<script type=\"text/javascript\" src=\"plug-in/bootstrap-table/locale/bootstrap-table-zh-CN.min.js\"></script>");
sb.append("<script type=\"text/javascript\" src=\"plug-in/themes/bootstrap-ext/js/common.js\"></script>");
sb.append("<script type=\"text/javascript\" src=\"plug-in/tools/dataformat.js\"></script>");
sb.append("<script type=\"text/javascript\" src=\"plug-in/lhgDialog/lhgdialog.min.js?skin=metrole\"></script>");
sb.append("<script type=\"text/javascript\" src=\"plug-in/themes/bootstrap-ext/js/bootstrap-lhgdialog-curdtools_zh-cn.js\"></script>");
sb.append("<link rel=\"stylesheet\" href=\""+basePath+"/plug-in/bootstrap-table/bootstrap-table.min.css\" type=\"text/css\"></link>");
sb.append("<script type=\"text/javascript\" src=\""+basePath+"/plug-in/bootstrap-table/bootstrap-table.js\"></script>");
sb.append("<script type=\"text/javascript\" src=\""+basePath+"/plug-in/bootstrap-table/locale/bootstrap-table-zh-CN.min.js\"></script>");
sb.append("<script type=\"text/javascript\" src=\""+basePath+"/plug-in/themes/bootstrap-ext/js/common.js\"></script>");
sb.append("<script type=\"text/javascript\" src=\""+basePath+"/plug-in/tools/dataformat.js\"></script>");
sb.append("<script type=\"text/javascript\" src=\""+basePath+"/plug-in/lhgDialog/lhgdialog.min.js?skin=metrole\"></script>");
sb.append("<script type=\"text/javascript\" src=\""+basePath+"/plug-in/themes/bootstrap-ext/js/bootstrap-lhgdialog-curdtools_zh-cn.js\"></script>");
sb.append("<link rel=\"stylesheet\" href=\""+basePath+"/plug-in/tools/css/metrole/common.css\" type=\"text/css\"></link>");
sb.append("<link rel=\"stylesheet\" href=\""+basePath+"/plug-in/ace/css/font-awesome.css\" type=\"text/css\"></link>");
}
if (oConvertUtils.isIn("layer", types)) {
sb.append("<script type=\"text/javascript\" src=\"plug-in/layer/layer.js\"></script>");
sb.append("<script type=\"text/javascript\" src=\"plug-in/laydate/laydate.js\"></script>");
sb.append("<script type=\"text/javascript\" src=\""+basePath+"/plug-in/layer/layer.js\"></script>");
sb.append("<script type=\"text/javascript\" src=\""+basePath+"/plug-in/laydate/laydate.js\"></script>");
}
types = null;

@ -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;
}
}

@ -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;
}
}

@ -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;
}
}

@ -60,7 +60,7 @@ import com.google.gson.Gson;
*/
@SuppressWarnings({"serial","rawtypes","unchecked","static-access"})
public class DataGridTag extends TagSupport {
private Logger log = Logger.getLogger(DataGridTag.class);
private static Logger log = Logger.getLogger(DataGridTag.class);
private final String DATE_FORMATTER = "yyyy-MM-dd";
private final String DATETIME_FORMATTER = "yyyy-MM-dd hh:mm:ss";
@ -407,13 +407,15 @@ public class DataGridTag extends TagSupport {
/**
* URL
*/
public void setFunUrl(String title, String exp, String funname,String operationCode, String urlStyle,String urlclass,String urlfont) {
public void setFunUrl(String title, String exp, String funname,String operationCode, String urlStyle,String urlclass,String urlfont,boolean inGroup) {
DataGridUrl dataGridUrl = new DataGridUrl();
dataGridUrl.setTitle(title);
dataGridUrl.setType(OptTypeDirection.Fun);
dataGridUrl.setExp(exp);
dataGridUrl.setFunname(funname);
dataGridUrl.setInGroup(inGroup);
if(checkBrowerIsNotIE()){
dataGridUrl.setUrlStyle(urlStyle);
@ -433,7 +435,7 @@ public class DataGridTag extends TagSupport {
* @param urlfont
* @param urlclass
*/
public void setOpenUrl(String url, String title, String width, String height, String exp,String operationCode, String openModel, String urlStyle, String urlclass, String urlfont) {
public void setOpenUrl(String url, String title, String width, String height, String exp,String operationCode, String openModel, String urlStyle, String urlclass, String urlfont,boolean inGroup) {
DataGridUrl dataGridUrl = new DataGridUrl();
dataGridUrl.setTitle(title);
dataGridUrl.setUrl(url);
@ -442,6 +444,8 @@ public class DataGridTag extends TagSupport {
dataGridUrl.setType(OptTypeDirection.valueOf(openModel));
dataGridUrl.setExp(exp);
dataGridUrl.setInGroup(inGroup);
if(checkBrowerIsNotIE()){
dataGridUrl.setUrlStyle(urlStyle);
@ -474,7 +478,7 @@ public class DataGridTag extends TagSupport {
String arg,String queryMode, String dictionary,boolean popup,
boolean frozenColumn,String extend,
String style,String downloadName,boolean isAuto,String extendParams,String editor,String defaultVal,String showMode, boolean newColumn,String dictCondition) {
String style,String downloadName,boolean isAuto,String extendParams,String editor,String defaultVal,String showMode, boolean newColumn,String dictCondition,String filterType,boolean optsMenu) {
DataGridColumn dataGridColumn = new DataGridColumn();
dataGridColumn.setAlign(align);
@ -517,6 +521,9 @@ public class DataGridTag extends TagSupport {
dataGridColumn.setDictCondition(dictCondition);
dataGridColumn.setFilterType(filterType);
dataGridColumn.setOptsMenu(optsMenu);
columnList.add(dataGridColumn);
Set<String> operationCodes = (Set<String>) 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("<select name=\"");
sb.append(column.getField());
sb.append("\">");
sb.append("<option value=\"\">-- 请选择 --</option>");
sb.append("<option value=\"\"></option>");
if(dictionary.indexOf(",")>-1){
//表格数据信息
try{
@ -1691,6 +1700,14 @@ public class DataGridTag extends TagSupport {
//update by jg_renjie at 2016/1/11 for:TASK #823 增加form实现Form表单验证,此处避免reset时走验证代码做了冗余
sb.append("}");
}
//高级查询避免方法名出现重复
if(oConvertUtils.isNotEmpty(complexSuperQuery)) {
sb.append("function "+name+"SuperQuery(queryCode){if(typeof(windowapi)=='undefined'){$.dialog({content:'url:superQueryMainController.do?dialog&code='+queryCode+'&tableName="+name+"',width:880,height:400,zIndex:getzIndex(),title:'高级查询构造器',cache:false,lock:true})}else{$.dialog({content:'url:superQueryMainController.do?dialog&code='+queryCode+'&tableName="+name+"',width:880,height:400,zIndex:getzIndex(),title:title,cache:false,lock:true,parent:windowapi})}};");
}
//过滤操作
getFilterFields(sb);
sb.append("</script>");
sb.append("<table width=\"100%\" id=\"" + name + "\" toolbar=\"#" + name + "tb\"></table>");
sb.append("<div id=\"" + name + "tb\" style=\"padding:3px; height: auto\">");
@ -2007,7 +2024,9 @@ public class DataGridTag extends TagSupport {
}
if(oConvertUtils.isNotEmpty(complexSuperQuery)) {
sb.append("<button class=\""+defalutCls+"\" type=\"button\" onclick=\"superQuery('"+complexSuperQuery+"')\">");
sb.append("<button class=\""+defalutCls+"\" type=\"button\" onclick=\""+name+"SuperQuery('"+complexSuperQuery+"')\">");
sb.append("<i class=\"fa fa-search\"></i>");
sb.append("<span class=\"bigger-110 no-text-shadow\">"+MutiLangUtil.getLang("common.advancedQuery")+"</span>");
sb.append("</button>");
@ -2025,7 +2044,9 @@ public class DataGridTag extends TagSupport {
}
if(oConvertUtils.isNotEmpty(complexSuperQuery)) {
sb.append("<a href=\"#\" class=\""+btnCls+"\" onclick=\"superQuery('"+complexSuperQuery+"')\">"+MutiLangUtil.getLang("common.advancedQuery")+"</a>");
sb.append("<a href=\"#\" class=\""+btnCls+"\" onclick=\""+name+"SuperQuery('"+complexSuperQuery+"')\">"+MutiLangUtil.getLang("common.advancedQuery")+"</a>");
}
}
@ -2041,7 +2062,9 @@ public class DataGridTag extends TagSupport {
}
if(oConvertUtils.isNotEmpty(complexSuperQuery)) {
sb.append("<a href=\"#\" class=\"easyui-linkbutton\" iconCls=\"icon-search\" onclick=\"superQuery('"+complexSuperQuery+"')\">"+MutiLangUtil.getLang("common.advancedQuery")+"</a>");
sb.append("<a href=\"#\" class=\"easyui-linkbutton\" iconCls=\"icon-search\" onclick=\""+name+"SuperQuery('"+complexSuperQuery+"')\">"+MutiLangUtil.getLang("common.advancedQuery")+"</a>");
}
}
@ -2512,7 +2535,13 @@ public class DataGridTag extends TagSupport {
}
if (OptTypeDirection.OpenTab.equals(dataGridUrl.getType())) {
sb.append("href+=\"[<a href=\'#\' onclick=addOneTab('" + dataGridUrl.getTitle() + "','" + url + "')>\";");
if(!StringUtil.isEmpty(dataGridUrl.getUrlclass())){//倘若urlclass不为空则去掉链接前面的"[";
sb.append("href+=\"<a href=\'#\' "+urlclass.toString()+" onclick=addOneTab('" + dataGridUrl.getTitle() + "','" + url + "') "+ style.toString() +">"+urlfont.toString()+"\";");
}else{
sb.append("href+=\"[<a href=\'#\' onclick=addOneTab('" + dataGridUrl.getTitle() + "','" + url + "') "+ style.toString() +">\";");
}
}
if(!StringUtil.isEmpty(dataGridUrl.getUrlclass())){//倘若urlclass不为空则去掉链接后面的"]";
sb.append("href+=\"" + dataGridUrl.getTitle() + "</a>&nbsp;\";");
@ -2805,9 +2834,14 @@ public class DataGridTag extends TagSupport {
}else if (StringUtil.isNotEmpty(column.getField()) && column.getField().equals("opt")) {// 加入操作
sb.append(",formatter:function(value,rec,index){");
// sb.append("return \"");
this.getOptUrl(sb);
if(column.isOptsMenu()){
getOptsMenuUrl(sb);
}else{
this.getOptUrl(sb);
}
sb.append("}");
}else if(column.getFormatter()!=null)
{
sb.append(",formatter:function(value,rec,index){");
@ -3487,7 +3521,9 @@ public class DataGridTag extends TagSupport {
}
if(oConvertUtils.isNotEmpty(complexSuperQuery)) {
sb.append("<button class=\""+defalutCls+"\" onclick=\"superQuery('"+complexSuperQuery+"')\">");
sb.append("<button class=\""+defalutCls+"\" onclick=\""+name+"SuperQuery('"+complexSuperQuery+"')\">");
sb.append("<i class=\"fa fa-search\"></i>");
sb.append("<span class=\"bigger-110 no-text-shadow\">"+MutiLangUtil.getLang("common.advancedQuery")+"</span>");
sb.append("</button>");
@ -3505,7 +3541,7 @@ public class DataGridTag extends TagSupport {
}
if(oConvertUtils.isNotEmpty(complexSuperQuery)){
sb.append("<a href=\"#\" class=\""+btnCls+"\" onclick=\"superQuery('"+complexSuperQuery+"')\">"+MutiLangUtil.getLang("common.advancedQuery")+"</a>");
sb.append("<a href=\"#\" class=\""+btnCls+"\" onclick=\""+name+"SuperQuery('"+complexSuperQuery+"')\">"+MutiLangUtil.getLang("common.advancedQuery")+"</a>");
}
}
@ -3521,7 +3557,9 @@ public class DataGridTag extends TagSupport {
}
if(oConvertUtils.isNotEmpty(complexSuperQuery)){
sb.append("<a href=\"#\" class=\"button\" iconCls=\"icon-search\" onclick=\"superQuery('"+complexSuperQuery+"')\">"+MutiLangUtil.getLang("common.advancedQuery")+"</a>");
sb.append("<a href=\"#\" class=\"button\" iconCls=\"icon-search\" onclick=\""+name+"SuperQuery('"+complexSuperQuery+"')\">"+MutiLangUtil.getLang("common.advancedQuery")+"</a>");
}
}
@ -4008,17 +4046,224 @@ appendLine(sb," }}\">关系</th>");
}
}
protected boolean filterBtn = false;//按钮过滤模式是否开启列表上若有一个按钮可以让其调用xxFilter函数出现过滤行--
public boolean isFilterBtn() {
return filterBtn;
}
public void setFilterBtn(boolean filterBtn) {
this.filterBtn = filterBtn;
}
/**
*
* @return
*/
private void getFilterFields(StringBuffer sb){
if(this.isFilterBtn()){
StringBuffer ffs = new StringBuffer();
int index = 0;
for (DataGridColumn column :columnList) {
if(column.getField().equals("opt")){
continue;
}
if(index!=0){
ffs.append(",");
}
index++;
String filterType = column.getFilterType();
ffs.append("{");
ffs.append("field:'"+column.getField()+"',");
ffs.append("type:'"+filterType+"',");
if("combobox".equals(filterType)){
ffs.append("options:{");
ffs.append("panelHeight:'auto',");
ffs.append("data:[{value:'',text:'All'}");
for (ColumnValue columnValue : columnValueList) {
if (columnValue.getName().equals(column.getField())) {
String[] value = columnValue.getValue().split(",");
String[] text = columnValue.getText().split(",");
for (int k = 0; k < value.length; k++) {
ffs.append(",{value:'"+value[k]+"',text:'"+text[k]+"'}");
}
break;
}
}
ffs.append("],");
ffs.append("onChange:function(value){");//if (value == ''){}$('#"+name+"').datagrid('removeFilterRule', '"+column.getField()+"');
// else {
ffs.append("$('#"+name+"').datagrid('addFilterRule', {field: '"+column.getField()+"',op: 'equal',value: value});");//}
ffs.append("$('#"+name+"').datagrid('doFilter');}}");//option-end
}else{
ffs.append("options:{precision:1},");
if("numberbox".equals(filterType) || "datebox".equals(filterType)|| "datetimebox".equals(filterType)){
ffs.append("op:['equal','lessorequal','greaterorequal']");
}else{
ffs.append("op:['equal','contains']");
}
}
ffs.append("}");
}
sb.append("function "+name+"Filter(){$('#"+name+"').datagrid('enableFilter',["+ffs.toString()+"]);}");
}
}
/**
* ,
* @param sb
*/
private void getOptsMenuUrl(StringBuffer sb){
this.getOptUrl(sb,true,false);
StringBuffer groupString = new StringBuffer();
this.getOptUrl(groupString,true,true);
if(oConvertUtils.isNotEmpty(groupString.toString())){
sb.append("href+='<div style=\"left:40px;top:-1px\" class=\"opts_menu_container\"><div class=\"opts_menu_btn btn-menu\"><i class=\"fa fa-caret-right\" style=\"margin-top:1px;\"></i></div>';");
sb.append("href+='<div style=\"clear: both;\"></div><div style=\"\" class=\"opts-menus-parent pp_menu_box\"><div class=\"opts_menu_box opts-menus-auto\" style=\"left:18px;\">';");
sb.append(groupString.toString());
sb.append("href+='</div></div><em class=\"ops_shadeEm\" style=\"display: inline;\"></em></div>';");
}
sb.append("return href;");
}
/**
* * ,
* @param sb
* @param noReturn href
* @param initGroup
*/
protected void getOptUrl(StringBuffer sb,boolean noReturn,boolean initGroup) {
//注:操作列表会带入合计列中去,故加此判断
List<DataGridUrl> list = urlList;
if(!initGroup){
sb.append("if(!rec.id){return '';}");
sb.append("var href='';");
}
for (DataGridUrl dataGridUrl : list) {
if(initGroup){
//若加载的是组菜单 但该菜单其实不是组菜单则 跳过
if(!dataGridUrl.isInGroup()){
continue;
}
}else{
//若加载的不是组菜单 但该菜单其实是组菜单则 跳过
if(dataGridUrl.isInGroup()){
continue;
}
}
String url = dataGridUrl.getUrl();
MessageFormat formatter = new MessageFormat("");
if (dataGridUrl.getValue() != null) {
String[] testvalue = dataGridUrl.getValue().split(",");
List value = new ArrayList<Object>();
for (String string : testvalue) {
value.add("\"+rec." + string + " +\"");
}
url = formatter.format(url, value.toArray());
}
if (url != null && dataGridUrl.getValue() == null) {
url = formatUrlPlus(url);
}
String exp = dataGridUrl.getExp();// 判断显示表达式
if (StringUtil.isNotEmpty(exp)) {
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)) {
sb.append("if($.inArray(rec." + field + ",[" + value + "])>=0){");
}
if ("ne".equals(exptype)) {
sb.append("if($.inArray(rec." + field + ",[" + value + "])<0){");
}
if ("empty".equals(exptype) && value.equals("'true'")) {
sb.append("if(rec." + field + "==''){");
}
if ("empty".equals(exptype) && value.equals("'false'")) {
sb.append("if(rec." + field + "!=''){");
}
}
}
StringBuffer style = new StringBuffer();
if (!StringUtil.isEmpty(dataGridUrl.getUrlStyle())) {
style.append(" style=\'");
style.append(dataGridUrl.getUrlStyle());
style.append("\' ");
}
StringBuffer urlclass = new StringBuffer();
StringBuffer urlfont = new StringBuffer();
if(initGroup){
urlclass.append(" class=\'btn btn-menu fa ");
if(!StringUtil.isEmpty(dataGridUrl.getUrlfont())){
urlclass.append(dataGridUrl.getUrlfont());
}else{
urlclass.append("fa-font");
}
urlclass.append(" menu-more\'");
}else{
urlclass.append(" class=\'btn-menu\'");
urlfont.append("<i class=\'fa ");
if(!StringUtil.isEmpty(dataGridUrl.getUrlfont())){
urlfont.append(dataGridUrl.getUrlfont());
}else{
urlfont.append("fa-font");
}
urlfont.append("\'></i>");
}
if (OptTypeDirection.Fun.equals(dataGridUrl.getType())) {
String name = TagUtil.getFunction(dataGridUrl.getFunname());
String parmars = TagUtil.getFunParams(dataGridUrl.getFunname());
sb.append("href+=\"<a href=\'#\' title='"+dataGridUrl.getTitle()+"' "+urlclass.toString()+" onclick=" + name + "(" + parmars + ")" + style.toString() + ">"+urlfont.toString()+"\";");
}
if (OptTypeDirection.OpenWin.equals(dataGridUrl.getType())) {
String funname = dataGridUrl.getFunname();
if(oConvertUtils.isEmpty(funname)){
funname = "openwindow";
}
String dgFormWidth = dataGridUrl.getWidth();
if("100%".equals(dgFormWidth)){
dgFormWidth = "'"+dgFormWidth+"'";
}else if(oConvertUtils.isEmpty(dgFormWidth)){
dgFormWidth = "''";
}
String dgFormHeight = dataGridUrl.getHeight();
if("100%".equals(dgFormHeight)){
dgFormHeight = "'"+dgFormHeight+"'";
}else if(oConvertUtils.isEmpty(dgFormHeight)){
dgFormHeight = "''";
}
sb.append("href+=\"<a href=\'####\' title='"+dataGridUrl.getTitle()+"' "+urlclass.toString()+" onclick="+funname+"('" + dataGridUrl.getTitle() + "','" + url + "','"+name+"'," + dgFormWidth + "," + dgFormHeight + ")" + style.toString() + ">"+urlfont.toString()+"\";");
}
sb.append("href+=\"" + "" + "</a>&nbsp;\";");
if (StringUtil.isNotEmpty(exp)) {
for (int i = 0; i < exp.split("&&").length; i++) {
sb.append("}");
}
}
}
if(!noReturn){
sb.append("return href;");
}
}
/**
*
* @param sb
*/
private void addAdvancedQuery(StringBuffer sb,String buttonSytle) {
FreemarkerHelper free = new FreemarkerHelper();
/*FreemarkerHelper free = new FreemarkerHelper();
Map<String, Object> mainConfig = new HashMap<String, Object>();
mainConfig.put("queryCode", complexSuperQuery);
mainConfig.put("tableName", name);
String complexSuperQuery = free.parseTemplate("/org/jeecgframework/tag/ftl/complexSuperQuery.ftl", mainConfig);
appendLine(sb,complexSuperQuery);
appendLine(sb,complexSuperQuery);*/
}

@ -1,12 +1,15 @@
package org.jeecgframework.tag.core.easyui;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.Date;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.JspWriter;
import javax.servlet.jsp.tagext.TagSupport;
import org.apache.log4j.Logger;
import org.jeecgframework.core.enums.SysThemesEnum;
import org.jeecgframework.core.util.ContextHolderUtils;
import org.jeecgframework.core.util.StringUtil;
@ -18,7 +21,9 @@ import org.jeecgframework.core.util.SysThemesUtil;
*
*/
public class FormValidationTag extends TagSupport {
private static final Logger logger = Logger.getLogger(FormValidationTag.class);
private static final long serialVersionUID = 8360534826228271024L;
protected String formid = "formobj";// 表单FORM ID
protected Boolean refresh = true;
protected String callback;// 回调函数
@ -81,6 +86,9 @@ public class FormValidationTag extends TagSupport {
}
public int doStartTag() throws JspException {
//SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
//long start = System.currentTimeMillis();
//logger.debug("=================Form=====doStartTag==========开始时间:" + sdf.format(new Date()) + "==============================");
JspWriter out = null;
try {
out = this.pageContext.getOut();
@ -124,11 +132,18 @@ public class FormValidationTag extends TagSupport {
e2.printStackTrace();
}
}
//long end = System.currentTimeMillis();
//logger.debug("==============Form=====doStartTag=================结束时间:" + sdf.format(new Date()) + "==============================");
//logger.debug("===============Form=====doStartTag=================耗时:" + (end - start) + "ms==============================");
return EVAL_PAGE;
}
public int doEndTag() throws JspException {
//SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
//long start = System.currentTimeMillis();
//logger.debug("=================Form=====doEndTag==========开始时间:" + sdf.format(new Date()) + "==============================");
StringBuffer sb = null;
String lang = (String)((HttpServletRequest) this.pageContext.getRequest()).getSession().getAttribute("lang");
@ -357,6 +372,10 @@ public class FormValidationTag extends TagSupport {
} catch (Exception e2) {
}
}
//long end = System.currentTimeMillis();
//logger.debug("==============Form=====doEndTag=================结束时间:" + sdf.format(new Date()) + "==============================");
//logger.debug("===============Form=====doEndTag=================耗时:" + (end - start) + "ms==============================");
return EVAL_PAGE;
}

@ -23,6 +23,7 @@ import org.jeecgframework.web.system.service.SystemService;
* @Title:MenuButtonTag
* @description:JSP
* @version V1.0
*
* name-code
* 1.
* 2.
@ -311,14 +312,14 @@ public class MenuButtonsTag extends TagSupport{
*/
private void addAdvancedQuery(StringBuffer sb,String queryCode,String tableName) {
MenuButtonsEnum menu = MenuButtonsEnum.getMenuByCode("superQuery");
sb.append("<a title=\""+menu.getTitle()+"\" onclick=\"superQuery('"+codes+"')\" href=\"####\" class=\"btn-menu "+menu.getIcon()+" menu-more\" ></a>");
FreemarkerHelper free = new FreemarkerHelper();
sb.append("<a title=\""+menu.getTitle()+"\" onclick=\"superQuery()\" href=\"####\" class=\"btn-menu "+menu.getIcon()+" menu-more\" ></a>");
//onclick=\"superQuery('"+codes+"','"+tableName+"')\"
/*FreemarkerHelper free = new FreemarkerHelper();
Map<String, Object> mainConfig = new HashMap<String, Object>();
mainConfig.put("queryCode", queryCode);
mainConfig.put("tableName", tableName);
String complexSuperQuery = free.parseTemplate("/org/jeecgframework/tag/ftl/complexSuperQueryForPage.ftl", mainConfig);
appendLine(sb,complexSuperQuery);
appendLine(sb,complexSuperQuery);*/
}
private void appendLine(StringBuffer sb,String str) {
String format = "\r\n"; //调试 格式化

@ -71,9 +71,11 @@ public class MenuTag extends JeecgTag {
// if(endString != null){
// endString.setLength(0);
// }
// endString = null;
//end().setLength(0);
} catch (Exception e2) {
} catch (Exception e) {
e.printStackTrace();
}
}
return EVAL_PAGE;

@ -8,17 +8,21 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.log4j.Logger;
import org.codehaus.jackson.JsonGenerationException;
import org.codehaus.jackson.map.JsonMappingException;
import org.codehaus.jackson.map.ObjectMapper;
import org.jeecgframework.core.common.hibernate.qbc.PageList;
import org.jeecgframework.core.common.model.json.ComboBox;
import org.jeecgframework.core.common.model.json.DataGrid;
import org.jeecgframework.core.util.ContextHolderUtils;
import org.jeecgframework.core.util.ReflectHelper;
import org.jeecgframework.core.util.StringUtil;
import org.jeecgframework.core.util.oConvertUtils;
import org.jeecgframework.tag.core.util.GzipUtilities;
import org.jeecgframework.tag.vo.datatable.DataTableReturn;
import org.jeecgframework.tag.vo.easyui.Autocomplete;
import org.jeecgframework.web.system.pojo.base.TSRole;
@ -36,6 +40,8 @@ import com.alibaba.fastjson.JSONObject;
* @author liuht
*/
public class TagUtil {
private static Logger log = Logger.getLogger(TagUtil.class);
/**
* <b>Summary: </b> getFiled(Bean)
*
@ -235,6 +241,73 @@ public class TagUtil {
return jsonTemp.toString();
}
/**
* LISTEASYUIJSONFootersjson
* @param fields
* @param total
* @param list
* @param dataStyle
* @param page
*/
private static String listtojsonByFootersJson(String[] fields, int total, List<?> list,String footers, String dataStyle, int pageSize) throws Exception {
StringBuffer jsonTemp = new StringBuffer();
if("jqgrid".equals(dataStyle)){
int totalPage = total % pageSize > 0 ? total / pageSize + 1 : total / pageSize;
if(totalPage == 0) totalPage = 1;
jsonTemp.append("{\"total\":" + totalPage );
}else{
jsonTemp.append("{\"total\":" + total );
}
jsonTemp.append(",\"rows\":[");
int i;
String fieldName;
if(list==null){
list = new ArrayList();
}
for (int j = 0; j < list.size(); ++j) {
jsonTemp.append("{\"state\":\"closed\",");
Object fieldValue = null;
for (i = 0; i < fields.length; ++i) {
fieldName = fields[i].toString();
if (list.get(j) instanceof Map)
fieldValue = ((Map<?, ?>) list.get(j)).get(fieldName);
else {
fieldValue = fieldNametoValues(fieldName, list.get(j));
}
jsonTemp.append("\"" + fieldName + "\"" + ":\"" + getStringValue(fieldValue).replace("\"", "\\\"") + "\"");
if (i != fields.length - 1) {
jsonTemp.append(",");
}
}
if (j != list.size() - 1)
jsonTemp.append("},");
else {
jsonTemp.append("}");
}
}
jsonTemp.append("]");
if (footers != null) {
jsonTemp.append(",");
jsonTemp.append("\"footer\":[");
JSONArray js=JSONArray.parseArray(footers);
for(int f=0;f<js.size();f++){
jsonTemp.append("{");
Map <String,Object>map=(Map) js.get(f);
for(String key:map.keySet()){
if(StringUtil.isEmpty(map.get(key).toString())){
jsonTemp.append("\"" + key + "\":\"" + getTotalValue(key, list) + "\",");
}else{
jsonTemp.append("\"" + key + "\":\"" + map.get(key).toString() + "\",");
}
}
jsonTemp.append("},");
}
jsonTemp.append("]");
}
jsonTemp.append("}");
return jsonTemp.toString();
}
//为空时返回空串
private static String getStringValue(Object obj){
return (obj == null) ? "" : obj.toString();
@ -343,7 +416,13 @@ public class TagUtil {
try {
if(!StringUtil.isEmpty(dg.getFooter())){
jObject = JSONObject.parseObject(listtojson(dg.getField().split(","), dg.getTotal(), dg.getResults(),dg.getFooter().split(","),dg.getDataStyle(),dg.getRows()));
if(dg.getFooter().startsWith("[")){
jObject = JSONObject.parseObject(listtojsonByFootersJson(dg.getField().split(","), dg.getTotal(), dg.getResults(),dg.getFooter(),dg.getDataStyle(),dg.getRows()));
}else{
jObject = JSONObject.parseObject(listtojson(dg.getField().split(","), dg.getTotal(), dg.getResults(),dg.getFooter().split(","),dg.getDataStyle(),dg.getRows()));
}
}else{
jObject = JSONObject.parseObject(listtojson(dg.getField().split(","), dg.getTotal(), dg.getResults(),null,dg.getDataStyle(),dg.getRows()));
}
@ -479,15 +558,26 @@ public class TagUtil {
response.setHeader("Cache-Control", "no-store");
JSONObject object = TagUtil.getJson(dg);
PrintWriter pw = null;
try {
pw=response.getWriter();
HttpServletRequest request = ContextHolderUtils.getRequest();
if (GzipUtilities.isGzipSupported(request) && !GzipUtilities.isGzipDisabled(request)) {
log.debug("-------datagrid----json-----开启Gzip压缩-------------");
pw = GzipUtilities.getGzipWriter(response);
response.setHeader("Content-Encoding", "gzip");
} else {
pw = response.getWriter();
}
pw.write(object.toString());
pw.flush();
pw.close();
} catch (IOException e) {
e.printStackTrace();
}finally{
try {
pw.close();
object.clear();
object = null;
@ -514,14 +604,23 @@ public class TagUtil {
JSONArray rows = object.getJSONArray("rows");
PrintWriter pw = null;
try {
pw=response.getWriter();
HttpServletRequest request = ContextHolderUtils.getRequest();
if (GzipUtilities.isGzipSupported(request) && !GzipUtilities.isGzipDisabled(request)) {
log.info("-------datagrid----json-----开启Gzip压缩-------------");
pw = GzipUtilities.getGzipWriter(response);
response.setHeader("Content-Encoding", "gzip");
} else {
pw = response.getWriter();
}
pw.write(rows.toString());
pw.flush();
pw.close();
} catch (IOException e) {
e.printStackTrace();
}finally{
try {
pw.close();
object.clear();
@ -553,14 +652,23 @@ public class TagUtil {
}
PrintWriter pw = null;
try {
pw=response.getWriter();
HttpServletRequest request = ContextHolderUtils.getRequest();
if (GzipUtilities.isGzipSupported(request) && !GzipUtilities.isGzipDisabled(request)) {
log.debug("-------datagrid----json-----开启Gzip压缩-------------");
pw = GzipUtilities.getGzipWriter(response);
response.setHeader("Content-Encoding", "gzip");
} else {
pw = response.getWriter();
}
pw.write(object.toString());
pw.flush();
pw.close();
} catch (IOException e) {
e.printStackTrace();
}finally{
try {
pw.close();
object.clear();

@ -33,7 +33,7 @@ public class WebUploaderTag extends TagSupport {
private String buttonText;//控件按钮显示文本
private String extensions;//允许的文件后缀,不带点,多个用逗号分割
private String extendParams;//类似css写法 这是文件上传时候需要传递的参数
private String dataType;//只要该属性有值,均视之为不为空
private String datatype;//只要该属性有值,均视之为不为空
private String nullMsg;//空的时候的提示信息,默认会根据当前控件的类型提示,文件类则提示“请选择文件”;图片类则提示“请选择图片”.
private String readOnly="false";//保留字段
private String bizType;//业务类型,根据该类型确定上传路径
@ -150,8 +150,8 @@ public class WebUploaderTag extends TagSupport {
//获取文件名
sb.append("\r\nvar mygetFileName=function(filepath){if(filepath.lastIndexOf('\\\\')>0){return filepath.substring(filepath.lastIndexOf('\\\\')+1);\r\n}else if(filepath.lastIndexOf('/')>0){return filepath.substring(filepath.lastIndexOf('/')+1);}else{return filepath;}}");
//如果dataType有值
if(oConvertUtils.isNotEmpty(dataType)){
sb.append("\r\n$('#"+name+"uploader').find('div.btns').append('<input nullMsg=\""+getNullMsg()+"\" dataType=\"*\" type=\"hidden\" id= \""+name+"dataTypeInp\" />');");
if(oConvertUtils.isNotEmpty(datatype)){
sb.append("\r\n$('#"+name+"uploader').find('div.btns').append('<input nullMsg=\""+getNullMsg()+"\" datatype=\"*\" type=\"hidden\" id= \""+name+"dataTypeInp\" />');");
}
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)){

@ -9,7 +9,7 @@
<form id="searchForm" class="form form-horizontal" action="" method="post">
<#list dataGrid.columnList as po>
<#if po.query==true>
<#include "bootstrapTable-search.ftl">
<#include "/org/jeecgframework/tag/core/factory/ftl/component/bootstrapTable-search.ftl">
</#if>
</#list>
<div class="col-xs-12 col-sm-6 col-md-4">
@ -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">
}
}
</#if>

@ -93,23 +93,24 @@ public class ComponentTools {
urlclass.append("\'");
}
StringBuffer urlfont = new StringBuffer();
if(!StringUtil.isEmpty(dataGridUrl.getUrlfont())){
urlfont.append(" <span class=\'");
urlfont.append(" <i class=\'fa ");
urlfont.append(dataGridUrl.getUrlfont());
urlfont.append("\' aria-hidden=\'true\'></span>");
urlfont.append("\' aria-hidden=\'true\'></i>");
}
if (OptTypeDirection.Confirm.equals(dataGridUrl.getType())) {
if(!StringUtil.isEmpty(dataGridUrl.getUrlclass())){
sb.append("href+=\"<button "+urlclass.toString()+" onclick=confirm(\'" + url + "\',\'" + dataGridUrl.getMessage() + "\',\'"+dataGridTag.getName()+"\')" + style.toString() + "> "+urlfont.toString()+" \";");
sb.append("href+=\"<a href=\'javascript:void(0);\' "+urlclass.toString()+" onclick=confirm(\'" + url + "\',\'" + dataGridUrl.getMessage() + "\',\'"+dataGridTag.getName()+"\')" + style.toString() + "> "+urlfont.toString()+" \";");
}else{
sb.append("href+=\"<button class='btn btn-primary btn-xs' onclick=confirm(\'" + url + "\',\'" + dataGridUrl.getMessage() + "\',\'"+dataGridTag.getName()+"\')" + style.toString() + "> \";");
sb.append("href+=\"<a href=\'javascript:void(0);\' class='btn btn-primary btn-xs' onclick=confirm(\'" + url + "\',\'" + dataGridUrl.getMessage() + "\',\'"+dataGridTag.getName()+"\')" + style.toString() + "> \";");
}
}
if (OptTypeDirection.Del.equals(dataGridUrl.getType())) {
if(!StringUtil.isEmpty(dataGridUrl.getUrlclass())){//倘若urlclass不为空则去掉链接前面的"[";
sb.append("href+=\"<button "+urlclass.toString()+" onclick=delObj(\'" + url + "\',\'"+dataGridTag.getName()+"\')" + style.toString() + "> "+urlfont.toString()+" \";");
sb.append("href+=\"<a href=\'javascript:void(0);\' "+urlclass.toString()+" onclick=delObj(\'" + url + "\',\'"+dataGridTag.getName()+"\')" + style.toString() + "> "+urlfont.toString()+" \";");
}else{
sb.append("href+=\"<button class='btn btn-danger btn-xs' onclick=delObj(\'" + url + "\',\'"+dataGridTag.getName()+"\')" + style.toString() + ">\";");
sb.append("href+=\"<a href=\'javascript:void(0);\' class='btn btn-danger btn-xs' onclick=delObj(\'" + url + "\',\'"+dataGridTag.getName()+"\')" + style.toString() + ">\";");
}
}
@ -117,31 +118,31 @@ public class ComponentTools {
String name = TagUtil.getFunction(dataGridUrl.getFunname());
String parmars = getFunParams(dataGridUrl.getFunname());
if(!StringUtil.isEmpty(dataGridUrl.getUrlclass())){//倘若urlclass不为空则去掉链接前面的"[";
sb.append("href+=\"<button "+urlclass.toString()+" onclick=" + name + "(" + parmars + ")" + style.toString() + "> "+urlfont.toString()+" \";");
sb.append("href+=\"<a href=\'javascript:void(0);\' "+urlclass.toString()+" onclick=" + name + "(" + parmars + ")" + style.toString() + "> "+urlfont.toString()+" \";");
}else{
sb.append("href+=\"<button class='btn btn-info btn-xs' onclick=" + name + "(" + parmars + ")" + style.toString() + ">\";");
sb.append("href+=\"<a href=\'javascript:void(0);\' class='btn btn-info btn-xs' onclick=" + name + "(" + parmars + ")" + style.toString() + ">\";");
}
}
if (OptTypeDirection.OpenWin.equals(dataGridUrl.getType())) {
if(!StringUtil.isEmpty(dataGridUrl.getUrlclass())){//倘若urlclass不为空则去掉链接前面的"[";
sb.append("href+=\"<button "+urlclass.toString()+" onclick=openwindow('" + dataGridUrl.getTitle() + "','" + url + "','"+dataGridTag.getName()+"'," + dataGridUrl.getWidth() + "," + dataGridUrl.getHeight() + ")" + style.toString() + "> "+urlfont.toString()+" \";");
sb.append("href+=\"<a href=\'javascript:void(0);\' "+urlclass.toString()+" onclick=openwindow('" + dataGridUrl.getTitle() + "','" + url + "','"+dataGridTag.getName()+"'," + dataGridUrl.getWidth() + "," + dataGridUrl.getHeight() + ")" + style.toString() + "> "+urlfont.toString()+" \";");
}else{
sb.append("href+=\"<button class='btn btn-success btn-xs' onclick=openwindow('" + dataGridUrl.getTitle() + "','" + url + "','"+dataGridTag.getName()+"'," + dataGridUrl.getWidth() + "," + dataGridUrl.getHeight() + ")" + style.toString() + ">\";");
sb.append("href+=\"<a href=\'javascript:void(0);\' class='btn btn-success btn-xs' onclick=openwindow('" + dataGridUrl.getTitle() + "','" + url + "','"+dataGridTag.getName()+"'," + dataGridUrl.getWidth() + "," + dataGridUrl.getHeight() + ")" + style.toString() + ">\";");
}
} //update-end--Author:liuht Date:20130228 for弹出窗口设置参数不生效
if (OptTypeDirection.Deff.equals(dataGridUrl.getType())) {
if(!StringUtil.isEmpty(dataGridUrl.getUrlclass())){
sb.append("href+=\"<button onclick=\'location.href=" + url + "' "+urlclass.toString()+" title=\'"+dataGridUrl.getTitle()+"\'" + style.toString() + "> "+urlfont.toString()+" \";");
sb.append("href+=\"<a href=\'javascript:void(0);\' onclick=\'location.href=" + url + "' "+urlclass.toString()+" title=\'"+dataGridUrl.getTitle()+"\'" + style.toString() + "> "+urlfont.toString()+" \";");
}else{
sb.append("href+=\"<button class='btn btn-default btn-xs' onclick=\'location.href=" + url + "' title=\'"+dataGridUrl.getTitle()+"\'" + style.toString() + ">\";");
sb.append("href+=\"<a href=\'javascript:void(0);\' class='btn btn-default btn-xs' onclick=\'location.href=" + url + "' title=\'"+dataGridUrl.getTitle()+"\'" + style.toString() + ">\";");
}
}
if (OptTypeDirection.OpenTab.equals(dataGridUrl.getType())) {
sb.append("href+=\"<button class='btn btn-primary btn-xs' onclick=addOneTab('" + dataGridUrl.getTitle() + "','" + url + "')>\";");
sb.append("href+=\"<a href=\'javascript:void(0);\' class='btn btn-primary btn-xs' onclick=addOneTab('" + dataGridUrl.getTitle() + "','" + url + "')>\";");
}
sb.append("href+=\"" + dataGridUrl.getTitle() + "</button>&nbsp;\";");
sb.append("href+=\"" + dataGridUrl.getTitle() + "</a>&nbsp;\";");
if (StringUtil.isNotEmpty(exp)) {
for (int i = 0; i < exp.split("&&").length; i++) {

@ -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())));
}
}

@ -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 +

@ -28,6 +28,8 @@ public class DataGridUrl {
private String operationCode;//按钮的操作Code
private boolean inGroup = false;
public String getOnclick() {
return onclick;
}
@ -163,6 +165,14 @@ public class DataGridUrl {
this.id = id;
}
public boolean isInGroup() {
return inGroup;
}
public void setInGroup(boolean inGroup) {
this.inGroup = inGroup;
}
@Override
public String toString() {
return "DataGridUrl [url=" + url + ", title=" + title + ", icon=" + icon + ", value=" + value + ", width=" + width + ", height=" + height +

@ -1,4 +1,4 @@
package com.jeecg.black.controller;
package org.jeecgframework.web.black.controller;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@ -39,6 +39,7 @@ import org.jeecgframework.web.system.pojo.base.InterfaceRuleDto;
import org.jeecgframework.web.system.service.SystemService;
import org.jeecgframework.web.system.util.InterfaceUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.dao.DataIntegrityViolationException;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
@ -51,8 +52,8 @@ import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import org.springframework.web.servlet.ModelAndView;
import com.jeecg.black.entity.TsBlackListEntity;
import com.jeecg.black.service.TsBlackListServiceI;
import org.jeecgframework.web.black.entity.TsBlackListEntity;
import org.jeecgframework.web.black.service.TsBlackListServiceI;
/**
* @Title: Controller
@ -87,7 +88,7 @@ public class TsBlackListController extends BaseController {
*/
@RequestMapping(params = "list")
public ModelAndView list(HttpServletRequest request) {
return new ModelAndView("com/jeecg/black/tsBlackListList");
return new ModelAndView("jeecg/black/tsBlackListList");
}
/**
@ -182,6 +183,11 @@ public class TsBlackListController extends BaseController {
try{
tsBlackListService.save(tsBlackList);
systemService.addLog(message, Globals.Log_Type_INSERT, Globals.Log_Leavel_INFO);
}catch(DataIntegrityViolationException ce){
j.setSuccess(false);
message = "该IP:"+tsBlackList.getIp()+"已存在!";
}catch(Exception e){
e.printStackTrace();
message = "黑名单添加失败";
@ -208,7 +214,12 @@ public class TsBlackListController extends BaseController {
MyBeanUtils.copyBeanNotNull2Bean(tsBlackList, t);
tsBlackListService.saveOrUpdate(t);
systemService.addLog(message, Globals.Log_Type_UPDATE, Globals.Log_Leavel_INFO);
} catch (Exception e) {
} catch(DataIntegrityViolationException ce){
j.setSuccess(false);
message = "该IP:"+tsBlackList.getIp()+"已存在!";
}catch (Exception e) {
e.printStackTrace();
message = "黑名单更新失败";
throw new BusinessException(e.getMessage());
@ -229,7 +240,7 @@ public class TsBlackListController extends BaseController {
tsBlackList = tsBlackListService.getEntity(TsBlackListEntity.class, tsBlackList.getId());
req.setAttribute("tsBlackListPage", tsBlackList);
}
return new ModelAndView("com/jeecg/black/tsBlackList-add");
return new ModelAndView("jeecg/black/tsBlackList-add");
}
/**
*
@ -242,7 +253,7 @@ public class TsBlackListController extends BaseController {
tsBlackList = tsBlackListService.getEntity(TsBlackListEntity.class, tsBlackList.getId());
req.setAttribute("tsBlackListPage", tsBlackList);
}
return new ModelAndView("com/jeecg/black/tsBlackList-update");
return new ModelAndView("jeecg/black/tsBlackList-update");
}
/**

@ -1,4 +1,4 @@
package com.jeecg.black.entity;
package org.jeecgframework.web.black.entity;
import javax.persistence.Column;
import javax.persistence.Entity;

@ -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;

@ -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;

@ -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<CgDynamGraphConfigItemEntity> 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<CgDynamGraphConfigParamEntity> cgDynamGraphConfigParamEntityList = systemService.findHql(hql0,id0);

@ -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<Map<String, Object>> result,
List<Map<String,Object>> beans) {
for(Map<String,Object> bean:beans){
String dict_code = (String) bean.get(CgReportConstant.ITEM_DICCODE);
if(StringUtil.isEmpty(dict_code)){
//不需要处理字典
continue;
}else{
List<Map<String, Object>> 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<Map<String, Object>> result,
List<Map<String,Object>> beans){
for(Map<String,Object> 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<String> params = null;
Map reJson = new HashMap<String, Object>();
try{
fields = getFields(sql, dbKey);
params = getSqlParams(sql);
fields = cgReportService.getFields(sql, dbKey);
params = cgReportService.getSqlParams(sql);
}catch (Exception e) {
e.printStackTrace();
String errorInfo = "解析失败!<br><br>失败原因:";
@ -342,90 +282,4 @@ public class CgDynamGraphController extends BaseController {
return reJson;
}
private List<String> getFields(String sql,String dbKey){
List<String> fields = null;
sql = getSql(sql);
if(StringUtils.isNotBlank(dbKey)){
List<Map<String,Object>> dataList=DynamicDBUtil.findList(dbKey,SqlUtil.jeecgCreatePageSql(dbKey,sql,null,1,1),null);
if(dataList.size()<1){
throw new BusinessException("该报表sql没有数据");
}
Set fieldsSet= dataList.get(0).keySet();
fields = new ArrayList<String>(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<String> getSqlParams(String sql) {
if(oConvertUtils.isEmpty(sql)){
return null;
}
List<String> params = new ArrayList<String>();
String regex = "\\$\\{\\w+\\}";
Pattern p = Pattern.compile(regex);
Matcher m = p.matcher(sql);
while(m.find()){
String whereParam = m.group();
params.add(whereParam.substring(whereParam.indexOf("{")+1,whereParam.indexOf("}")));
}
return params;
}
/**
*
* @param m freemarker
* @param bean
*/
@SuppressWarnings("unchecked")
private void loadDic(Map m, Map<String, Object> cgDynamGraphMap) {
String dict_code = (String) cgDynamGraphMap.get("dict_code");
if(StringUtil.isEmpty(dict_code)){
m.put(CgReportConstant.FIELD_DICTLIST, new ArrayList(0));
return;
}
List<Map<String, Object>> dicDatas = queryDic(dict_code);
m.put(CgReportConstant.FIELD_DICTLIST, dicDatas);
}
/**
*
* @param diccode
* @return
*/
private List<Map<String, Object>> 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<Map<String, Object>> dicDatas = cgDynamGraphService.findForJdbc(dicSql.toString());
return dicDatas;
}
}

@ -266,7 +266,7 @@
<#if x['search_mode']=="single">
<#if (x['field_dictlist']?size >0)>
<select name = "${x['field_name']}" WIDTH="100" style="width: 104px">
<option value = "">-- 请选择 --</option>
<option value = ""></option>
<#list x['field_dictlist'] as xd>
<option value = "${xd['typecode']}">${xd['typename']}</option>
</#list>

@ -13,5 +13,5 @@ ci.cgrhead_id as cgreport_head_id
from jform_cgdynamgraph_item ci,jform_cgdynamgraph_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

@ -7,4 +7,4 @@ ch.content as content,
ch.db_source,
ch.graph_type
from jform_cgdynamgraph_head ch
where ch.code = '${id}'
where ch.code = :id

@ -171,4 +171,10 @@ public class CgAutoListConstant {
public static final String BASEPATH = "basePath";
//===============Online开发权限{针对sql敏感操作}=================
/** 1 有在线开发权限 */
public static final String SYS_DEV_FLAG_1 = "1";
/** 0 无在线开发权限 */
public static final String SYS_DEV_FLAG_0 = "0";
}

@ -13,6 +13,8 @@
<property name="templateLoader" ref="templetLoader" />
<property name="defaultEncoding" value="UTF-8"></property>
<property name="numberFormat" value="0"></property>
<!--用于解决前端报空指针问题-->
<property name="classicCompatible" value="true"></property>
</bean>
<!-- Template Context -->
<bean id="templetContext" class="org.jeecgframework.web.cgform.engine.TempletContext">
@ -28,6 +30,8 @@
<property name="templateLoader" ref="templetLoaderWord" />
<property name="defaultEncoding" value="UTF-8"></property>
<property name="numberFormat" value="0"></property>
<!--用于解决前端报空指针问题-->
<property name="classicCompatible" value="true"></property>
</bean>
<!-- Template Context 自定义word代码生成器 -->
<bean id="templetContextWord" class="org.jeecgframework.web.cgform.service.impl.generate.TempletContextWord">

@ -27,6 +27,7 @@ import org.jeecgframework.core.util.IpUtil;
import org.jeecgframework.core.util.JeecgDataAutorUtils;
import org.jeecgframework.core.util.MutiLangUtil;
import org.jeecgframework.core.util.ResourceUtil;
import org.jeecgframework.core.util.SqlInjectionUtil;
import org.jeecgframework.core.util.StringUtil;
import org.jeecgframework.core.util.SysThemesUtil;
import org.jeecgframework.core.util.oConvertUtils;
@ -183,11 +184,12 @@ public class CgAutoListController extends BaseController{
* @param request
* @param response
* @param dataGrid
* @throws Exception
*/
@SuppressWarnings("unchecked")
@RequestMapping(params = "datagrid")
public void datagrid(String configId,String page,String field,String rows,String sort,String order, HttpServletRequest request,
HttpServletResponse response, DataGrid dataGrid) {
HttpServletResponse response, DataGrid dataGrid) throws Exception {
Object dataRuleSql =JeecgDataAutorUtils.loadDataSearchConditonSQLString(); //request.getAttribute(Globals.MENU_DATA_AUTHOR_RULE_SQL);
long start = System.currentTimeMillis();
//step.1 获取动态配置
@ -220,6 +222,9 @@ public class CgAutoListController extends BaseController{
if("null".equalsIgnoreCase(parentIdDefault)) {
parentIdDefault = null;
}
SqlInjectionUtil.filterContent(treeId);
if(treeId == null) {
treeId = parentIdDefault;
}else {
@ -285,9 +290,19 @@ public class CgAutoListController extends BaseController{
}
resultMap.put(b.getFieldName(), sb.toString().substring(0, sb.toString().length()-1));
}
}
}
if("Blob".equals(b.getType())) {
for(Map<String, Object> resultMap:result){
Object obj = resultMap.get(b.getFieldName());
if(obj instanceof byte[]) {
resultMap.put(b.getFieldName(), new String((byte[])obj,"utf-8"));
}
}
}
}
Long size = cgTableService.getQuerySingleSize(table, field, params);
dealDic(result,beans);

@ -10,13 +10,14 @@ import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.apache.commons.lang.StringUtils;
import org.apache.log4j.Logger;
import org.jeecgframework.core.common.controller.BaseController;
import org.jeecgframework.core.common.model.json.AjaxJson;
import org.jeecgframework.core.enums.SysThemesEnum;
@ -42,6 +43,8 @@ import org.jeecgframework.web.cgform.service.template.CgformTemplateServiceI;
import org.jeecgframework.web.cgform.util.FillRuleUtil;
import org.jeecgframework.web.cgform.util.PublicUtil;
import org.jeecgframework.web.cgform.util.TemplateUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
@ -60,7 +63,8 @@ import freemarker.template.TemplateException;
@Controller
@RequestMapping("/cgFormBuildController")
public class CgFormBuildController extends BaseController {
private static final Logger logger = Logger.getLogger(CgFormBuildController.class);
private static final Logger logger = LoggerFactory.getLogger(CgFormBuildController.class);
@Autowired
private TempletContext templetContext;
@Autowired
@ -97,8 +101,8 @@ public class CgFormBuildController extends BaseController {
@RequestMapping(params = "mobileForm")
public void mobileForm(HttpServletRequest request,HttpServletResponse response) {
String tableName =request.getParameter("tableName");
String sql = "select form_template_mobile from cgform_head where table_name = '"+tableName+"'";
Map<String, Object> mp = cgFormFieldService.findOneForJdbc(sql);
String sql = "select form_template_mobile from cgform_head where table_name = ?";
Map<String, Object> mp = cgFormFieldService.findOneForJdbc(sql,tableName);
if(mp.containsKey("form_template_mobile") && oConvertUtils.isNotEmpty(mp.get("form_template_mobile"))){
String urlTemplateName=request.getParameter("olstylecode");
if(oConvertUtils.isEmpty(urlTemplateName)){
@ -122,7 +126,51 @@ public class CgFormBuildController extends BaseController {
}
}
/**
* onlinevalue
* @param list
*/
private void replaceExtendJson(List<Map<String,Object>> list){
if(list!=null && !list.isEmpty()){
for (Map<String, Object> column : list) {
Object extendJson=column.get("extend_json");
if(extendJson!=null && !extendJson.equals("")){
String reg="value=\"[\\S]*\" ";
column.put("extend_json", extendJson.toString().replaceAll(reg,""));
}
}
}
}
/**
*
* selectcheckboxradio
* @param list
* @param dataForm
*/
private void initAddDictTagDefaultVal(List<Map<String,Object>> list,Map<String, Object> dataForm){
if(list!=null && !list.isEmpty()){
for (Map<String, Object> column : list) {
Object extendJson = column.get("extend_json");
Object show_type = column.get("show_type");
if(oConvertUtils.isNotEmpty(extendJson) && oConvertUtils.isNotEmpty(show_type) && "radio|checkbox|list".contains(show_type.toString())){
Pattern p = Pattern.compile("value=\"[\\S]*\" ");
Matcher m = p.matcher(extendJson.toString());
String dfVal = "";
while(m.find()) {
dfVal = m.group();
}
dfVal = dfVal.replace("value=","").replace("\"","").trim();
dataForm.put(column.get("field_name").toString(),dfVal);
logger.debug("--------------online添加页面字典类型默认值初始化----------field_name:{} ,dfVal:{} ,show_type :{}", column.get("field_name").toString(),dfVal,show_type.toString());
}
}
}
}
/**
* form
*/
@ -182,21 +230,27 @@ public class CgFormBuildController extends BaseController {
Map<String, Object> dataForm = new HashMap<String, Object>();
if(StringUtils.isNotEmpty(id)){
dataForm = dataBaseService.findOneForJdbc(tablename, id);
if(dataForm!=null){
Iterator it=dataForm.entrySet().iterator();
while(it.hasNext()){
Map.Entry entry=(Map.Entry)it.next();
String ok=(String)entry.getKey();
Object ov=entry.getValue();
data.put(ok, ov);
}
}else{
logger.info("online表单【"+tablename+"】【"+id+"】不存在");
id = null;
dataForm = new HashMap<String, Object>();
}
dataForm = dataBaseService.findOneForJdbc(tablename, id);
if(dataForm!=null){
Iterator it=dataForm.entrySet().iterator();
while(it.hasNext()){
Map.Entry entry=(Map.Entry)it.next();
String ok=(String)entry.getKey();
Object ov=entry.getValue();
if(ov instanceof byte[]) {
ov=new String((byte[])ov,"utf-8");
entry.setValue(ov);
}
data.put(ok, ov);
}
}else{
logger.info("online表单【"+tablename+"】【"+id+"】不存在");
id = null;
dataForm = new HashMap<String, Object>();
}
}
//如果该表是主表查出关联的附表
CgFormHeadEntity head = (CgFormHeadEntity)data.get("head");
@ -205,6 +259,11 @@ public class CgFormBuildController extends BaseController {
//获取主表或单表表单数据
if(StringUtils.isBlank(id)){
//Online添加页面select\radio\checkbox 支持默认值设置
initAddDictTagDefaultVal((List<Map<String,Object>>)data.get("columns"),dataForm);
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
logger.info("============================填值规则开始时间:"+sdf.format(new Date())+"==============================");
long startTime = System.currentTimeMillis();
@ -222,6 +281,10 @@ public class CgFormBuildController extends BaseController {
CgSubTableVO subTableVO=(CgSubTableVO) field.get(subTable);
subTableData=new ArrayList<Map<String,Object>>();
subDataForm=new HashMap<String, Object>();
//Online添加页面select\radio\checkbox控件 支持默认值设置
initAddDictTagDefaultVal((List<Map<String,Object>>)subTableVO.getFieldList(),subDataForm);
putFormData(subTableVO.getFieldList(),subDataForm);
putFormData(subTableVO.getHiddenFieldList(),subDataForm);
subTableData.add(subDataForm);
@ -240,14 +303,25 @@ public class CgFormBuildController extends BaseController {
//获取附表表表单数据
if(StringUtils.isNotEmpty(id)){
//过滤扩展参数value属性
replaceExtendJson((List<Map<String,Object>>) data.get("columns"));
replaceExtendJson((List<Map<String,Object>>) data.get("columnhidden"));
if(head.getJformType()==CgAutoListConstant.JFORM_TYPE_MAIN_TALBE){
String subTableStr = head.getSubTableStr();
if(StringUtils.isNotEmpty(subTableStr)){
String [] subTables = subTableStr.split(",");
List<Map<String,Object>> subTableData = new ArrayList<Map<String,Object>>();
Map<String, Object> field = (Map<String, Object>) data.get("field");
for(String subTable:subTables){
subTableData = cgFormFieldService.getSubTableData(tableName,subTable,id);
tableData.put(subTable, subTableData);
subTableData = cgFormFieldService.getSubTableData(tableName,subTable,id);
tableData.put(subTable, subTableData);
CgSubTableVO subTableVO=(CgSubTableVO) field.get(subTable);
replaceExtendJson(subTableVO.getFieldList());
replaceExtendJson(subTableVO.getHiddenFieldList());
}
}
}

@ -29,6 +29,7 @@ import org.jeecgframework.core.util.IpUtil;
import org.jeecgframework.core.util.LogUtil;
import org.jeecgframework.core.util.ReflectHelper;
import org.jeecgframework.core.util.ResourceUtil;
import org.jeecgframework.core.util.SqlInjectionUtil;
import org.jeecgframework.core.util.StringUtil;
import org.jeecgframework.core.util.oConvertUtils;
import org.springframework.beans.BeanUtils;
@ -264,6 +265,9 @@ public class CgformSqlController extends BaseController {
if(t instanceof CgFormHeadPojo){
reflectHelper.setMethodValue("isDbsynch", "N");
}
SqlInjectionUtil.filterContent(dbTable.getTableName());
id = (String) reflectHelper.getMethodValue("id");
countSql = "select id from "+ dbTable.getTableName() + " where id=?";
if(t instanceof CgFormHeadPojo){

@ -251,8 +251,8 @@ public class CgFormHeadController extends BaseController {
logger.info("---同步数据库 ---doDbSynch-----> TableName:"+cgFormHead.getTableName()+" ---修改时间 :"+cgFormHead.getUpdateDate()+" ----创建时间:"+cgFormHead.getCreateDate() +"---请求IP ---+"+oConvertUtils.getIpAddrByRequest(request));
//安全控制判断不在online管理中表单不允许操作
String sql = "select count(*) from cgform_head where table_name = '"+cgFormHead.getTableName()+"'";
Long i = systemService.getCountForJdbc(sql);
String sql = "select count(*) from cgform_head where table_name = ?";
Long i = systemService.getCountForJdbcParam(sql,cgFormHead.getTableName());
if(i==0){
message = "同步失败,非法无授权访问!";
logger.info(message+" ----- 请求IP ---+"+IpUtil.getIpAddr(request));
@ -260,8 +260,8 @@ public class CgFormHeadController extends BaseController {
return j;
}
TSUser currentUser = ResourceUtil.getSessionUser();
if("0".equals(currentUser.getDevFlag())){
message = "同步失败,您不是开发人员无授权访问";
if(CgAutoListConstant.SYS_DEV_FLAG_0.equals(currentUser.getDevFlag())){
message = "同步失败,当前用户未授权开发权限";
logger.info(message+" ----- 请求IP ---+"+IpUtil.getIpAddr(request));
j.setMsg(message);
return j;

@ -20,6 +20,7 @@ import jodd.io.ZipUtil;
import org.apache.commons.lang.StringUtils;
import org.apache.log4j.Logger;
import org.jeecgframework.core.annotation.JAuth;
import org.jeecgframework.core.common.controller.BaseController;
import org.jeecgframework.core.common.exception.BusinessException;
import org.jeecgframework.core.common.hibernate.qbc.CriteriaQuery;
@ -510,6 +511,7 @@ public class CgformTemplateController extends BaseController {
* @param path
* @param response
*/
@JAuth
@RequestMapping(params = "showPic")
public void showPic(HttpServletRequest request,String code, String path,HttpServletResponse response){
String defaultPath="default.jpg";

@ -34,7 +34,6 @@ import org.jeecgframework.core.util.ResourceUtil;
import org.jeecgframework.core.util.StringUtil;
import org.jeecgframework.core.util.oConvertUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;
import org.springframework.util.FileCopyUtils;
import org.springframework.web.bind.annotation.RequestMapping;
@ -136,10 +135,8 @@ public class CgUploadController extends BaseController {
boolean updateFlag = false;
if(path.equals(realPath)){
//获取这个关联的其他文件信息
String hql = "from CgUploadEntity where cgformId = '"+file.getCgformId()+"' "
+ " and cgformField = '"+file.getCgformField()+"' "
+ " and cgformName = '"+file.getCgformName()+"'";
List<CgUploadEntity> uploadList = systemService.findHql(hql);
String hql = "from CgUploadEntity where cgformId = ? and cgformField = ? and cgformName = ?";
List<CgUploadEntity> uploadList = systemService.findHql(hql,file.getCgformId(),file.getCgformField(),file.getCgformName());
if(uploadList != null && !uploadList.isEmpty() && uploadList.size() > 1){
for (CgUploadEntity cgUploadEntity : uploadList) {
if(!file.getId().equals(cgUploadEntity.getId())){

@ -353,7 +353,7 @@ function createDataGrid${config_id}(){
<#if x['field_isQuery']=="Y">
<#if (x['field_dictlist']?size >0)>
<select name = "${x['field_id']}" style="width: 104px">
<option value = "">-- 请选择 --</option>
<option value = ""></option>
<#list x['field_dictlist'] as xd>
<option value = "${xd['typecode']}">${xd['typename']}</option>
</#list>

@ -0,0 +1,91 @@
package org.jeecgframework.web.cgform.engine.tag;
import java.io.IOException;
import java.io.Writer;
import java.util.Map;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
import freemarker.core.Environment;
import freemarker.template.TemplateDirectiveBody;
import freemarker.template.TemplateDirectiveModel;
import freemarker.template.TemplateException;
import freemarker.template.TemplateModel;
import freemarker.template.TemplateModelException;
import freemarker.template.TemplateScalarModel;
/**
* Online
* 使 <@exp exp='${x['exp']}' data='name' >
* @author gj_shaojc
*
*/
@Component("expTag")
public class ExpTag implements TemplateDirectiveModel {
private static final Logger LOG = LoggerFactory.getLogger(ExpTag.class);
public void execute(Environment env, Map params, TemplateModel[] loopVars,
TemplateDirectiveBody body) throws TemplateException, IOException {
String exp = getAttribute(params, "exp");
String data = getAttribute(params, "data");
if (exp == null||data == null) {
throw new TemplateException(
"Can not find attribute 'name' in data tag", env);
}
StringBuilder resexp=new StringBuilder();
String[] ShowbyFields = exp.split("&&");
for (String ShowbyField : ShowbyFields) {
int beginIndex = ShowbyField.indexOf("#");
int endIndex = ShowbyField.lastIndexOf("#");
String exptype = ShowbyField.substring(beginIndex + 1, endIndex);// 表达式类型
String field = ShowbyField.substring(0, beginIndex);// 判断显示依据字段
String[] values = ShowbyField.substring(endIndex + 1, ShowbyField.length()).split(",");// 传入字段值
String value = "";
for (int i = 0; i < values.length; i++) {
value += "'" + "" + values[i] + "" + "'";
if (i < values.length - 1) {
value += ",";
}
}
if ("eq".equals(exptype)) {
resexp.append("$.inArray("+data+"." + field + ",[" + value + "])>=0");
}
if ("ne".equals(exptype)) {
resexp.append("$.inArray("+data+"." + field + ",[" + value + "])<0");
}
if ("empty".equals(exptype) && value.equals("'true'")) {
resexp.append(""+data+"." + field + "==''");
}
if ("empty".equals(exptype) && value.equals("'false'")) {
resexp.append(""+data+"." + field + "!=''");
}
}
Writer out = env.getOut();
out.append(resexp);
}
/**
*
*
* @param params
* @param name
* @return
*/
@SuppressWarnings("unchecked")
private String getAttribute(Map params, String name) {
String value = null;
if (params.containsKey(name)) {
TemplateModel paramValue = (TemplateModel) params.get(name);
try {
value = ((TemplateScalarModel) paramValue).getAsString();
} catch (TemplateModelException e) {
LOG.error("get attribute '{}' error", name, e);
}
}
return value;
}
}

@ -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;
}

@ -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<String, Object> dataAdapter(String tableName,Map<String, Object> data) {
SqlInjectionUtil.filterContent(tableName);
//step.1 获取表单的字段配置
Map<String, CgFormFieldEntity> 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<String, Object> 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));
}
//--authorscott---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<CgformEnhanceJavaEntity> list = this.findHql(hql.toString());
List<CgformEnhanceJavaEntity> 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<CgformEnhanceJavaEntity> getCgformEnhanceJavaEntityByFormId( String formId) {
StringBuilder hql = new StringBuilder("");
hql.append(" from CgformEnhanceJavaEntity t");
hql.append(" where t.formId='").append(formId).append("'");
List<CgformEnhanceJavaEntity> list = this.findHql(hql.toString());
hql.append(" where t.formId=?");
List<CgformEnhanceJavaEntity> list = this.findHql(hql.toString(),formId);
return list;
}

@ -36,12 +36,17 @@ public class CgformButtonServiceImpl extends CommonServiceImpl implements Cgform
public List<CgformButtonEntity> 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<CgformButtonEntity> 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<CgformButtonEntity> list = this.findHql(hql.toString());
return list;
}

@ -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<CgformButtonSqlEntity> 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<CgformButtonSqlEntity> list = this.findHql(hql.toString());
return list;
}

@ -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<Map<String, Object>> 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 ");

@ -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<String, Object> fieldMap = DbTableUtil.getColumnMap(jdbcTemplate.queryForList(sql));
Map<String, Object> fieldMap = DbTableUtil.getColumnMap(jdbcTemplate.queryForList(sql,cgFormHead.getTableName(),CodeResourceUtil.DATABASE_NAME));
StringBuilder sb = new StringBuilder();
sb.append(createChangeTableSql(cgFormHead));
CgFormFieldEntity column,agoColumn = null;

@ -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()

@ -94,9 +94,11 @@ public class ExtendJsonConvert {
}
re.append("\" ");
} catch (Exception e) {
re.append(key+"="+"\"");
re.append(obj.get(key)+"\"");
re.append(obj.get(key)+"\" ");//为了正则匹配 加上空格
//re.append("\" ");
}
}
}catch (Exception e) {

@ -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<CgformEnhanceJavaEntity> list = this.findHql(hql.toString());
hql.append(" where t.formId=?");
hql.append(" and t.buttonCode =?");
List<CgformEnhanceJavaEntity> 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<CgformEnhanceJavaEntity> 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<CgformEnhanceJavaEntity> list = this.findHql(hql.toString());
return list;
}

@ -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<CgformEnhanceJsEntity> list = this.findHql(hql.toString());
hql.append(" where t.formId=?");
hql.append(" and t.cgJsType =?");
List<CgformEnhanceJsEntity> list = this.findHql(hql.toString(),formId,cgJsType);
if(list!=null&&list.size()>0){
return list.get(0);
}

@ -47,6 +47,7 @@ public class TempletContextWord {
private SystemService systemService;
@Autowired
private CgformFtlServiceI cgformFtlService;
@Resource(name = "freemarkerWord")
private Configuration freemarker;

@ -1,4 +1,4 @@
select
jform_version
from cgform_head
where id = '${id}'
where id = :id

@ -1,4 +1,4 @@
select
jform_version
from cgform_head
where table_name = '${tableName}'
where table_name = :tableName

@ -1 +1 @@
update cgform_head set jform_version = '${newVersion}' where id = '${formId}'
update cgform_head set jform_version = :newVersion where id = :formId

@ -1 +1 @@
update ${cgFormName} set ${cgFormField} = '${fileUrl}' where id='${cgFormId}'
update ${cgFormName} set ${cgFormField} = :fileUrl where id= :cgFormId

@ -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<Map<String, Object>> result,
List<Map<String,Object>> beans) {
for(Map<String,Object> 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<Map<String, Object>> dicDatas = queryDic(dict_code);
List<TSType> 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<Map<String, Object>> result,
List<Map<String,Object>> beans){
for(Map<String,Object> 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<String> params = null;
Map reJson = new HashMap<String, Object>();
try{
fields = getFields(sql, dbKey);
params = getSqlParams(sql);
fields = cgReportService.getFields(sql, dbKey);
params = cgReportService.getSqlParams(sql);
}catch (Exception e) {
e.printStackTrace();
String errorInfo = "解析失败!<br><br>失败原因:";
@ -397,90 +327,4 @@ public class CgReportController extends BaseController {
return reJson;
}
private List<String> getFields(String sql,String dbKey){
List<String> fields = null;
sql = getSql(sql);
if(StringUtils.isNotBlank(dbKey)){
List<Map<String,Object>> dataList=DynamicDBUtil.findList(dbKey,SqlUtil.jeecgCreatePageSql(dbKey,sql,null,1,1),null);
if(dataList.size()<1){
throw new BusinessException("该报表sql没有数据");
}
Set fieldsSet= dataList.get(0).keySet();
fields = new ArrayList<String>(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<String> getSqlParams(String sql) {
if(oConvertUtils.isEmpty(sql)){
return null;
}
List<String> params = new ArrayList<String>();
String regex = "\\$\\{\\w+\\}";
Pattern p = Pattern.compile(regex);
Matcher m = p.matcher(sql);
while(m.find()){
String whereParam = m.group();
params.add(whereParam.substring(whereParam.indexOf("{")+1,whereParam.indexOf("}")));
}
return params;
}
/**
*
* @param m freemarker
* @param bean
*/
@SuppressWarnings("unchecked")
private void loadDic(Map m, Map<String, Object> cgReportMap) {
String dict_code = (String) cgReportMap.get("dict_code");
if(StringUtil.isEmpty(dict_code)){
m.put(CgReportConstant.FIELD_DICTLIST, new ArrayList(0));
return;
}
List<Map<String, Object>> dicDatas = queryDic(dict_code);
m.put(CgReportConstant.FIELD_DICTLIST, dicDatas);
}
/**
*
* @param diccode
* @return
*/
private List<Map<String, Object>> 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<Map<String, Object>> dicDatas = cgReportService.findForJdbc(dicSql.toString());
return dicDatas;
}
}

@ -109,7 +109,7 @@ $(function(){$('#${config_id}List').datagrid(
<#if x['search_mode']=="single">
<#if (x['field_dictlist']?size >0)>
<select name = "${x['field_name']}" WIDTH="100" style="width: 104px">
<option value = "">-- 请选择 --</option>
<option value = ""></option>
<#list x['field_dictlist'] as xd>
<option value = "${xd['typecode']}">${xd['typename']}</option>
</#list>

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save