Pre Merge pull request !8 from xingqiangProfile/jeecg_3.7.8

pull/8/MERGE
xingqiangProfile 2 years ago committed by Gitee
commit c1e3d87aef
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

@ -1,21 +1,25 @@
JEECG 微云快速开发平台
===============
当前最新版本: 3.6发布日期20151204
当前最新版本: 3.7.8发布日期20180806
JEECG微服务架构 [jeecg-p3 1.0版](https://gitee.com/jeecg/jeecg-p3)
前言:
-----------------------------------
随着 WEB UI 框架 ( EasyUI/Jquery UI/Ext/DWZ) 等的逐渐成熟,系统界面逐渐实现统一化,代码生成器也可以生成统一规范的界面!
代码生成+手工MERGE半智能开发将是新的趋势单表数据模型和一对多数据模型的增删改查功能直接生成使用,可节省60%工作量,快速提高开发效率!!!
随着 WEB UI 框架 ( EasyUI/Jquery UI/Ext/DWZ/VUE/Boostrap) 等的逐渐成熟,系统界面逐渐实现统一化,代码生成器也可以生成统一规范的界面!
代码生成+手工MERGE半智能开发将是新的趋势单表数据模型和一对多数据模型的增删改查功能直接生成使用,可节省80%工作量,快速提高开发效率!!!
简介
-----------------------------------
JEECGJ2EE Code Generation是一款基于代码生成器的智能开发平台。引领新的开发模式(Online Coding模式->代码生成器模式->手工MERGE智能开发)
可以帮助解决Java项目60%的重复工作,让开发更多关注业务逻辑。既能快速提高开发效率,帮助公司节省人力成本,同时又不失灵活性。
JEECGJ2EE Code Generation是一款基于代码生成器的智能开发平台。引领新的开发模式(Online Coding->代码生成器->手工MERGE智能开发)可以帮助解决Java项目90%的重复工作,让开发更多关注业务逻辑。既能快速提高开发效率,帮助公司节省人力成本,同时又不失灵活性。
JEECG宗旨是: 简单功能由代Online Coding配置出功能;复杂功能由代码生成器生成进行手工Merge; 复杂流程业务采用表单自定义,业务流程使用工作流来实现、扩展出任务接口,供开发编写业务逻辑。实现了流程任务节点和任务接口的灵活配置,既保证了公司流程的保密行,又减少了开发人员的工作量。
适用项目
-----------------------------------
JEECG快速开发平台可以应用在任何J2EE项目的开发中尤其适合企业信息管理系统MIS、内部办公系统OA、企业资源计划系统ERP、客户关系管理系统CRM其半智能手工Merge的开发方式可以显著提高开发效率90%以上极大降低开发成本JEECG尤为显著的支持SAAS企业级应用开发插件机制更好的支持了SAAS云应用需求。
为什么选择JEECG?
-----------------------------------
@ -26,7 +30,7 @@ JEECG
* 5.常用共通封装,各种工具类(定时任务,短信接口,邮件发送,Excel导出等),基本满足80%项目需求
* 6.集成简易报表工具图像报表和数据导出非常方便可极其方便的生成pdf、excel、word等报表
* 7.集成工作流activiti并实现了只需在页面配置流程转向可极大的简化jbpm工作流的开发用jbpm的流程设计器画出了流程走向一个工作流基本就完成了只需写很少量的java代码
* 8.UI快速开发针对WEB UI进行标准式封装页面统一采用自定义标签实现功能列表数据展现、页面校验等,标签使用简单清晰且便于维护
* 8.UI标签针对WEB UI进行标准式封装页面统一采用自定义标签实现功能列表数据展现、页面校验等,标签使用简单清晰且便于维护
* 9.在线流程设计采用开源Activiti流程引擎实现在线画流程,自定义表单,表单挂靠,业务流转
* 10.查询过滤器查询功能自动生成后台动态拼SQL追加查询条件支持多种匹配方式全匹配/模糊查询/包含查询/不匹配查询);
* 11.多数据源:及其简易的使用方式,在线配置数据源配置,便捷的从其他数据抓取数据;
@ -36,70 +40,164 @@ JEECG
* 15.在线配置报表(无需编码,通过在线配置方式,实现曲线图,柱状图,数据等报表)
* 16.简易Excel导入导出支持单表导出和一对多表模式导出生成的代码自带导入导出功能
* 17.自定义表单支持用户自定义表单布局支持单表一对多表单、支持select、radio、checkbox、textarea、date、popup、列表、宏等控件
JEECG 适用范围
-----------------------------------
JEECG智能开发平台可以应用在任何J2EE项目的开发中尤其适合企业信息管理系统MIS、内部办公系统OA、企业资源计划系统ERP
、客户关系管理系统CRM其半智能手工Merge的开发方式可以显著提高开发效率60%以上,极大降低开发成本。
* 18.专业接口对接机制统一采用restful接口方式集成swagger-ui在线接口文档Jwt token安全验证方便客户端对接
* 19.接口安全机制,可细化控制接口授权,非常简便实现不同客户端只看自己数据等控制
* 20.高级组合查询功能,在线配置支持主子表关联查询,可保存查询历史
* 21.支持二级管理员,权限细化管理
* 22.代码生成器支持resutful接口生成
JEECG 功能特点
-----------------------------------
* SpringMvc + Hibernate + UI标签库 + Minidao + Easyui + Easypoi + Highcharts + Ehcache 等基础架构</br>
* 采用面向声明的开发模式, 基于泛型编写极少代码即可实现复杂的数据展示、数据编辑、
表单处理等功能再配合Online Coding在线开发与代码生成器的使用,将J2EE的开发效率提高6倍以上可以将代码减少80%以上。</br>
* JEECG V3.6 版本技术点总结:
* <b>技术点一:</b>Online Coding在线开发(通过在线配置实现一个表模型的增删改查功能,无需一行代码,支持用户自定义表单布局) </br>
* <b>技术点二:</b>代码生成器,支持多种数据模型,根据表生成对应的Entity,Service,Dao,Action,JSP等,增删改查功能生成直接使用</br>
* <b>技术点三:</b>UI快速开发库针对WEB UI进行标准封装页面统一采用UI标签实现功能数据datagrid,表单校验,Popup,Tab等实现JSP页面零JS开发维护非常高效</br>
* <b>技术点四:</b>在线流程定义采用开源Activiti流程引擎实现在线画流程,自定义表单,表单挂接,业务流转,流程监控,流程跟踪,流程委托等</br>
* <b>技术点五:</b>自定义表单,支持用户自定义表单布局支持单表、列表、Select\Radio\Checkbox\PopUP\Date等特殊控件</br>
* <b>技术点六:</b>查询过滤器查询功能自动生成后台动态拼SQL追加查询条件支持多种匹配方式全匹配/模糊查询/包含查询/不匹配查询)</br>
* <b>技术点七:</b>移动平台支持对Bootstrap(兼容Html5)进行标准封装 </br>
* <b>技术点八:</b>动态报表功能用户输入一个sql系统自动解析生成报表</br>
* <b>技术点九:</b>数据权限(精细化数据权限控制,控制到行级,列表级,表单字段级,实现不同人看不同数据,不同人对同一个页面操作不同字段)</br>
* <b>技术点十:</b>国际化(支持多语言,国际化的封装为多语言做了便捷支持)</br>
* <b>技术点十一:</b>多数据源(在线配置数据源,数据源工作类封装)</br>
* <b>技术点十二:</b>多种首页风格切换,支持自定义首页风格。经典风格、Shortcut风格、ACE bootstrap风格、云桌面风格</br>
* <b>技术点十三:</b>在线配置报表(无需编码,通过在线配置方式,实现曲线图,柱状图,数据等报表)</br>
* <b>技术点十四:</b>简易Excel导入导出支持单表导出和一对多表模式导出生成的代码自带导入导出功能</br>
* JEECG V3.6, 经过了专业压力测试,性能测试,保证后台数据的准确性和页面访问速度</br>
* 采用SpringMVC + Hibernate + Minidao(类Mybatis) + Easyui(UI库)+ Jquery + Boostrap + Ehcache + Redis + Ztree + Vue + Boostrap-table + ElementUI等基础架构</br>
* 采用面向声明的开发模式, 基于泛型编写极少代码即可实现复杂的数据展示、数据编辑、表单处理等功能再配合Online Coding在线开发与代码生成器的使用,将J2EE的开发效率提高8倍以上可以将代码减少90%以上。</br>
* JEECG 技术点总结:
* <b>技术点一:</b>代码生成器SPA单页面应用快速生成采用VUE+ElementUI打造酷炫效果 </br>
* <b>技术点二:</b>新一代代码生成器更灵活的代码生成器工厂,可灵活自定义生成的代码文件名称、路径等;根据模板结构生成代码文件</br>
* <b>技术点三:</b>新一代代码生成器支持Vue+ElementUI风格Bootstrap表单+EasyUI原生态列表风格ElementUI表单+EasyUI原生态列表风格</br>
* <b>技术点四:</b>Dategrid标签多列表风格快速切换给用户提供多种选择</br>
* <b>技术点五:</b>Online Coding在线开发(通过在线配置实现一个表模型的增删改查功能,无需一行代码,支持用户自定义表单布局) </br>
* <b>技术点六:</b>代码生成器,支持多种数据模型,根据表生成对应的Entity,Service,Dao,Action,JSP等,增删改查功能生成直接使用</br>
* <b>技术点七:</b>UI快速开发库针对WEB UI进行标准封装页面统一采用UI标签实现功能数据datagrid,表单校验,Popup,Tab等实现JSP页面零JS开发维护非常高效</br>
* <b>技术点八:</b>在线流程定义采用开源Activiti流程引擎实现在线画流程,自定义表单,表单挂接,业务流转,流程监控,流程跟踪,流程委托等</br>
* <b>技术点九:</b>自定义表单,支持用户自定义表单布局支持单表、列表、Select\Radio\Checkbox\PopUP\Date等特殊控件</br>
* <b>技术点十:</b>查询过滤器查询功能自动生成后台动态拼SQL追加查询条件支持多种匹配方式全匹配/模糊查询/包含查询/不匹配查询)</br>
* <b>技术点十一::</b>移动平台支持对Bootstrap(兼容Html5)进行标准封装 </br>
* <b>技术点十二:</b>动态报表功能用户输入一个sql系统自动解析生成报表</br>
* <b>技术点十三:</b>数据权限(精细化数据权限控制,控制到行级,列表级,表单字段级,实现不同人看不同数据,不同人对同一个页面操作不同字段)</br>
* <b>技术点十四:</b>国际化(支持多语言,国际化的封装为多语言做了便捷支持)</br>
* <b>技术点十五:</b>多数据源(在线配置数据源,数据源工作类封装)</br>
* <b>技术点十六:</b>多种首页风格切换,支持自定义首页风格。经典风格、Shortcut风格、ACE bootstrap风格、云桌面风格</br>
* <b>技术点十七:</b>在线配置报表(无需编码,通过在线配置方式,实现曲线图,柱状图,数据等报表)</br>
* <b>技术点十八:</b>简易Excel导入导出支持单表导出和一对多表模式导出生成的代码自带导入导出功能</br>
* <b>技术点十九:</b>移动OA移动OA审批功能采用H5技术实现手机移动办公无缝对接微信、钉钉、微信企业号、也可以做APP</br>
* <b>技术点二十:</b>移动图表在线配置移动报表采用H5技术可以手机端查看</br>
* <b>技术点二十一::</b>插件开发业务功能组件以插件方式集成平台也可以单独部署发发布有力支撑了SAAS云应用系统需求</br>
* <b>技术点二十二::</b>专业接口对接机制统一采用restful接口方式集成swagger-ui在线接口文档Jwt token安全验证方便客户端对接</br>
* <b>技术点二十三:</b>接口安全机制,可细化控制接口授权,非常简便实现不同客户端只看自己数据等控制</br>
* <b>技术点二十四:</b>高级组合查询功能,在线配置支持主子表关联查询,可保存查询历史</br>
* <b>技术点二十五:</b>支持二级管理员,权限细化管理</br>
* <b>技术点二十六:</b>代码生成器支持resutful接口生成</br>
* JEECG V3.7.8, 经过了专业压力测试,性能测试,保证后台数据的准确性和页面访问速度</br>
* 支持多种浏览器: IE, 火狐, Google 等</br>
* 支持数据库: Mysql,Oracle10g,Postgre,SqlServer等</br>
* 支持数据库: Mysql,Oracle,Postgre,SqlServer等</br>
* 基础权限: 用户,角色,菜单权限,按钮权限,数据权限</br>
* 智能报表集成: 简易的图像报表工具和Excel导入导出</br>
* Web容器测试通过的有Jetty和Tomcat6,Weblogic</br>
* 即将推出功能:分布式部署,云平台,移动平台开发,规则引擎</br>
* Web容器测试通过的有Jetty和Tomcat,Weblogic</br>
* 亮点功能:分布式部署,云平台,移动平台开发,规则引擎</br>
* 要求JDK1.6+</br>
技术文档
-----------------------------------
* [在线演示](http://demo.jeecg.org)
* [JEECG 入门开发环境搭建](https://blog.csdn.net/zhangdaiscott/article/details/50915206)
* [JEECG 在线开发文档](http://jeecg3.mydoc.io)
* [JEECG 常见问题贴](http://www.jeecg.org/forum.php?mod=viewthread&tid=1830&extra=page%3D1)
* [JEECG 本地maven仓库下载](https://gitee.com/jeecg/jeecg-local-maven)
* [JEECG 在线视频教程](https://edu.csdn.net/lecturer/929)
* [非Maven版本下载](https://github.com/zhangdaiscott/jeecg-nomaven)
* [JEECG 版本日志](http://www.jeecg.org/forum.php?mod=viewthread&tid=365&extra=page%3D1)
系统演示
技术交流
-----------------------------------
平台提供首页风格,支持自定义:经典风格|Shortcut风格|ACE bootstrap风格|云桌面风格
![github](http://img.blog.csdn.net/20150607214324659?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvemhhbmdkYWlzY290dA==/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center "jeecg")
![github](http://img.blog.csdn.net/20150607214353113?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvemhhbmdkYWlzY290dA==/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center "jeecg")
* QQ交流群 ⑥190866569、其他群(全满)</br>
* 官方论坛: [http://www.jeecg.org](http://www.jeecg.org)
* 官方博客: [http://blog.csdn.net/zhangdaiscott](http://blog.csdn.net/zhangdaiscott)
* 关注官方微信公众号,获取更多资讯
自定义表单设计布局效果
![github](http://www.jeecg.org/data/attachment/forum/201512/17/175056vgzo2j2thph29jdp.jpg "jeecg")
![github](http://www.jeecg.org/data/attachment/forum/201512/17/175135xq9fwiun3pi6i4e6.jpg "jeecg")
![github](http://www.jeecg.org/data/attachment/forum/201512/17/175152r6eg2f15g58jzzej.png "jeecg")
![github](http://www.jeecg.org/data/attachment/forum/201512/17/175103v1r87337prnfr1du.jpg "jeecg")
![输入图片说明](https://static.oschina.net/uploads/img/201807/09172938_ltsb.jpg "在这里输入图片标题")
![github](http://img.blog.csdn.net/20150607222027195?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvemhhbmdkYWlzY290dA==/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center "jeecg")
![github](http://img.blog.csdn.net/20150607214724128?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvemhhbmdkYWlzY290dA==/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center "jeecg")
![github](http://img.blog.csdn.net/20150607221941932?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvemhhbmdkYWlzY290dA==/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center "jeecg")
![github](http://img.blog.csdn.net/20150607214807402?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvemhhbmdkYWlzY290dA==/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center "jeecg")
![github](http://www.jeecg.org/data/attachment/forum/201303/02/123311mf9fa22tv69b228f.jpg "jeecg")
![github](http://www.jeecg.org/data/attachment/forum/201303/02/123412x003euegeg7nb68z.jpg "jeecg")
![github](http://www.jeecg.org/data/attachment/forum/201303/02/124748gyhrgvr45vshyc82.jpg "jeecg")
![github](http://www.jeecg.org/data/attachment/forum/201303/02/123428ubcjjnuwjbkjrnrw.jpg "jeecg")
![github](http://www.jeecg.org/data/attachment/forum/201303/02/124749up2j5id7gj9kppp8.jpg "jeecg")
社区荣誉
-----------------------------------
* 开源社区http://www.jeecg.org
* ★2012年JEECG在Google Code上开源;
* ★2012年底开源项目JEECG被"ITeye专家访谈";
* ★2012年底开源项目JEECG被"CSDN专家访谈";
* ★2013年应邀参加"第八届开源中国开源世界高峰论坛"该论坛由中国开源软件推进联盟主办、全球最大中文IT社区CSDN与程序员杂志协办
* ★2013年应邀参加"开源群英会2013”的开源英雄;
* ★2013年度中国优秀开源项目评选-公开投票,“JEECG以887票位居第九"该项目中国开源软件推进联盟主办、全球最大中文IT社区CSDN与程序员杂志协办
* ★2013年度成立JEECG开源团队创立JEECG开源社区;
* ★2013年度JEECG参加“云计算成就创业梦想”第二届阿里云开发者大赛";
* ★2013年度应邀参加了"SDCC 2013中国软件开发者大会" 大会由CSDN和《程序员》杂志倾力打造
* ★2013年下半年推出开源项目"MiniDao(持久层解决方案)"超越了Mybatis和Hibernate
* ★2014年5月应邀参加中国科学院大学创新创业年度论坛探讨“创业企业发展、创新创业孵化”的主题成为中国科学院大学创新创业和风险投资协会副会长。
* ★2014年推出当前最火的开源项目“JeeWx(捷微:敏捷微信开发平台并获得CSDN举办的“2014年开发者大会”公开投票第一名
* ★2014年8月份捷微jeewx2.0与百度达成战略合作,集成百度地图,增加地图功能,附近商家团购等信息搜索。
* ★2014年12月份捷微jeewx与联通集团达成战略合作负责联通集团微信公众账号集团化运营。
* ★2015年3月份捷微jeewx推出集团化微信运营版本专注微信应用一体化企业系统集成实现公众账号上下级类似组织机构权限模式。
* ★2015年6月份捷微jeewx推出集企业号版本与中国移动打成战略合作推出企业号营销新模式。
* ★2015开源中国最火开源项目,TOP5独占2位(jeewx\jeecg),TOP50占4位jeewx\jeecg\easypoi\jeewx-api)
* ★2016年2月JEECG推出移动能力版本在线配置移动报表在线配置移动表单微信OA一体化集成
* ★2016年3月JEECG插件开发机制采用插件方式为用户提供插件服务目前插件OA、微信企业号、文档云盘
* ★2016年4月捷微H5活动平台与微盟达成战略合作伙伴
系统演示
-----------------------------------
### [1].多套首页风格支持自定义H+风格|FineUI风格|ACE风格|Shortcut风格/云桌面等)
![输入图片说明](https://static.oschina.net/uploads/img/201807/09163742_IbMJ.png "在这里输入图片标题")
![输入图片说明](https://static.oschina.net/uploads/img/201807/09164411_zSuo.png "在这里输入图片标题")
![输入图片说明](https://static.oschina.net/uploads/img/201807/09164423_JfhR.png "在这里输入图片标题")
![输入图片说明](https://static.oschina.net/uploads/img/201807/09164434_NSLt.png "在这里输入图片标题")
![输入图片说明](https://static.oschina.net/uploads/img/201807/09164152_hxHU.png "在这里输入图片标题")
![输入图片说明](https://static.oschina.net/uploads/img/201807/09164204_uVWu.jpg "在这里输入图片标题")
### [2].表单设计能力online表单开发、表单设计器、word布局、积木表单
![输入图片说明](https://static.oschina.net/uploads/img/201807/09164800_npNS.png "在这里输入图片标题")
![输入图片说明](https://static.oschina.net/uploads/img/201807/09164811_4UmX.png "在这里输入图片标题")
![输入图片说明](https://static.oschina.net/uploads/img/201807/09164822_SE7Z.png "在这里输入图片标题")
![输入图片说明](https://static.oschina.net/uploads/img/201807/09165024_90bw.png "在这里输入图片标题")
![输入图片说明](https://static.oschina.net/uploads/img/201807/09165445_QkbR.png "在这里输入图片标题")
![输入图片说明](https://static.oschina.net/uploads/img/201807/09165756_D2m3.png "在这里输入图片标题")
![输入图片说明](https://static.oschina.net/uploads/img/201807/09165958_syDn.png "在这里输入图片标题")
![输入图片说明](https://static.oschina.net/uploads/img/201804/19165540_CizC.jpg "在这里输入图片标题")
![输入图片说明](https://static.oschina.net/uploads/img/201807/09170233_i84Q.png "在这里输入图片标题")
### [3].流程组件演示
![输入图片说明](https://static.oschina.net/uploads/img/201807/09171414_X1ee.png "在这里输入图片标题")
![输入图片说明](https://static.oschina.net/uploads/img/201807/09171521_bghO.png "在这里输入图片标题")
![输入图片说明](https://static.oschina.net/uploads/img/201807/09171532_NoB0.png "在这里输入图片标题")
![输入图片说明](https://static.oschina.net/uploads/img/201807/09171539_gh87.png "在这里输入图片标题")
![输入图片说明](https://static.oschina.net/uploads/img/201807/09171656_QTea.png "在这里输入图片标题")
![输入图片说明](https://static.oschina.net/uploads/img/201807/09171705_CTug.png "在这里输入图片标题")
![输入图片说明](https://static.oschina.net/uploads/img/201807/09171845_83W0.png "在这里输入图片标题")
### [4].报表演示(在线配置报表)
![输入图片说明](https://static.oschina.net/uploads/img/201807/09170858_40eu.png "在这里输入图片标题")
![输入图片说明](https://static.oschina.net/uploads/img/201807/09170906_l8g0.png "在这里输入图片标题")
![输入图片说明](https://static.oschina.net/uploads/img/201807/09170916_KkLG.png "在这里输入图片标题")
![输入图片说明](https://static.oschina.net/uploads/img/201807/09170924_hDPz.png "在这里输入图片标题")
![输入图片说明](https://static.oschina.net/uploads/img/201807/09170932_HABN.png "在这里输入图片标题")
![输入图片说明](https://static.oschina.net/uploads/img/201807/09170941_McYh.png "在这里输入图片标题")
![输入图片说明](https://static.oschina.net/uploads/img/201807/09171047_38JE.png "在这里输入图片标题")
![输入图片说明](https://static.oschina.net/uploads/img/201807/09170949_FWks.png "在这里输入图片标题")
### [5].移动报表演示
![输入图片说明](https://static.oschina.net/uploads/img/201804/19165909_OXfn.png "在这里输入图片标题")
![输入图片说明](https://static.oschina.net/uploads/img/201804/19165929_OnoB.png "在这里输入图片标题")
![输入图片说明](https://static.oschina.net/uploads/img/201804/19165943_eyQF.png "在这里输入图片标题")
![输入图片说明](https://static.oschina.net/uploads/img/201804/19165955_tJkX.png "在这里输入图片标题")
![输入图片说明](https://static.oschina.net/uploads/img/201804/19170011_9CWF.png "在这里输入图片标题")
### [6].移动OA演示
![输入图片说明](https://static.oschina.net/uploads/img/201804/19173027_byRC.png "在这里输入图片标题")
![输入图片说明](https://static.oschina.net/uploads/img/201804/19173036_C5Kv.png "在这里输入图片标题")
![输入图片说明](https://static.oschina.net/uploads/img/201804/19170252_9gZf.png "在这里输入图片标题")
![输入图片说明](https://static.oschina.net/uploads/img/201804/19170305_ud5Y.png "在这里输入图片标题")
![输入图片说明](https://static.oschina.net/uploads/img/201804/19170337_0myK.png "在这里输入图片标题")
### [6].移动APP
![输入图片说明](https://static.oschina.net/uploads/img/201804/19170420_v4qK.jpg "在这里输入图片标题")
![输入图片说明](https://static.oschina.net/uploads/img/201804/19170430_kqK2.jpg "在这里输入图片标题")
![输入图片说明](https://static.oschina.net/uploads/img/201804/19170449_W72k.jpg "在这里输入图片标题")
![输入图片说明](https://static.oschina.net/uploads/img/201804/19170458_qIv2.jpg "在这里输入图片标题")
![输入图片说明](https://static.oschina.net/uploads/img/201804/19170508_q2XJ.jpg "在这里输入图片标题")
代码示例
@ -129,18 +227,3 @@ JEECG
</div>
</div>
技术文档
-----------------------------------
* [JEECG 开发入门搭建文档Maven版](http://www.jeecg.org/forum.php?mod=viewthread&tid=2537&extra=page%3D1)
* [JEECG 开发入门视频](http://www.jeecg.org/forum.php?mod=viewthread&tid=197&extra=page%3D1)
* [JEECG 在线演示](http://demo.jeecg.org)
* [JEECG 技术论坛 - 更多资料](http://www.jeecg.org)
技术交流
-----------------------------------
* 作者:[张代浩](http://www.jeecg.org/forum.php?mod=viewthread&tid=1047)</br>
* 邮箱jeecg@sina.com</br>
* QQ交流群 106838471二群、106259349一群</br>

Binary file not shown.

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

Binary file not shown.

File diff suppressed because one or more lines are too long

@ -0,0 +1,21 @@
官方提供mysql\oracle\SqlServer脚步其他数据库可以通过工具自行转换。
转换方法参考http://blog.csdn.net/zhangdaiscott/article/details/46412453?yyue=a21bo.50862.201879
脚步说明:
1.oracle 导入命令
说明: jeecg脚本导出用户是scott
imp scott/tiger@orcl file=jeecg_3.7.8_oracle11g.dmp
导入其他用户的表
imp jeecgos/jeecgos@orcl file=/opt/datatmp/jeecg_3.7.8_oracle11g.dmp fromuser=scott touser=jeecgos ignore=y commit=y buffer=300000000 feedback=10000
2. oracle、SqlServer脚步索引会有部分丢失为了系统性能请自行补加索引。
3. jeecg系统数据库切换配置方法参考常见问题贴29
http://www.jeecg.org/forum.php?mod=viewthread&tid=1830&extra=page%3D1
4.老版本数据库增量升级
执行老版本升级SQL脚本
3.7.7升级到3.7.8
docs/老版本增量升级/jeecg_mysql-3.7.7-update-3.7.8.sql

@ -0,0 +1,12 @@
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 ('402881fa64a1ca500164a1d549e40001', NULL, '1', 'Bootstrap树形列表', '5', 'jeecgFormDemoController.do?bootstrapTreeListDemo', '4028f6815af3ce54015af3d1ad610001', '8a8ab0b246dc81120146dc8180460000', '8a8ab0b246dc81120146dc8180dd001e', '0', 'fa-tree', 'admin', '管理员', 'admin', '2018-07-16 16:17:45', '2018-07-16 14:44:27', '管理员');
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 ('4028f68164caf6520164cb5ecade0006', NULL, '1', '检索下拉框', '100', 'jeecgListDemoController.do?suggest', '4028f6815af3ce54015af3d1ad610001', '8a8ab0b246dc81120146dc8180460000', '8a8ab0b246dc81120146dc8180dd001e', '0', '', 'admin', '管理员', NULL, NULL, '2018-07-24 16:19:04', 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 ('4028f68164caf6520164cb5d79670004', NULL, '1', 'plupload上传1', '100', 'jeecgFormDemoController.do?plupload1', '4028f6815af3ce54015af3d1ad610001', '8a8ab0b246dc81120146dc8180460000', '8a8ab0b246dc81120146dc8180dd001e', '0', '', 'admin', '管理员', NULL, NULL, '2018-07-24 16:17:38', NULL);
UPDATE `t_s_function` SET `function_icon_style`='fa-list-ol' WHERE (`ID`='4028f68164caf6520164cb5ecade0006');
UPDATE `t_s_function` SET `function_icon_style`='fa-upload' WHERE (`ID`='4028f68164caf6520164cb5d79670004');
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 ('4028f68164cfec7b0164d07373540002', NULL, '1', 'plupload上传2', '100', 'jeecgFormDemoController.do?plupload2', '4028f6815af3ce54015af3d1ad610001', '8a8ab0b246dc81120146dc8180460000', '8a8ab0b246dc81120146dc8180dd001e', '0', 'fa-upload', 'admin', '管理员', NULL, NULL, '2018-07-25 15:59:44', 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 ('4028810a64e8d94d0164e9033a580005', NULL, '1', '单据打印', '10', 'jeecgFormDemoController.do?printingDemo', '4028f6815af3ce54015af3d1ad610001', '8a8ab0b246dc81120146dc8180460000', '8a8ab0b246dc81120146dc8180dd001e', '0', 'fa-print', 'admin', '管理员', 'admin', '2018-07-30 14:30:52', '2018-07-30 10:27:40', '管理员');
UPDATE `t_s_icon` SET `extend` = 'png', `iconclas` = 'deskIcon', `content` = NULL, `name` = 'Online表单开发', `path` = 'plug-in/sliding/icon/Finder.png', `type` = 3 WHERE `ID` = '8a8ab0b246dc81120146dc818102002c';
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 ('4028810264f4f97d0164f528560a0010', 'please.input.table.content', 'Please Input Table Content', 'en', '2018-08-01 19:03:39', '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 ('4028810264f4f97d0164f527c5dd000e', 'please.input.table.content', '请填写表描述!', 'zh-cn', '2018-08-01 19:03:02', 'admin', '管理员', NULL, NULL, NULL);
UPDATE `cgform_field` SET `id`='ff8080816021b031016021fced19000f', `content`='收货人', `create_by`='admin', `create_date`='2017-12-04 22:45:12', `create_name`='管理员', `dict_field`='receiver_name,receiver_mobile', `dict_table`='user_msg', `dict_text`='realname,account', `field_default`='', `field_href`='', `field_length`='120', `field_name`='receiver_name', `field_valid_type`='', `field_must_input`='N', `is_key`='N', `is_null`='Y', `is_query`='Y', `is_show`='Y', `is_show_list`='Y', `length`='56', `main_field`='', `main_table`='', `old_field_name`='receiver_name', `order_num`='11', `point_length`='0', `query_mode`='single', `show_type`='popup', `type`='string', `update_by`='admin', `update_date`='2018-08-02 20:14:54', `update_name`='管理员', `table_id`='ff8080816021b031016021fced100004', `extend_json`='', `fill_rule_code`='' WHERE (`id`='ff8080816021b031016021fced19000f');
update t_s_muti_lang set lang_context = '3.7.8' where lang_key ='system.version.number';

File diff suppressed because it is too large Load Diff

@ -0,0 +1,328 @@
package com.jeecg.demo.controller;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Validator;
import org.jeecgframework.core.common.controller.BaseController;
import org.jeecgframework.core.common.exception.BusinessException;
import org.jeecgframework.core.common.hibernate.qbc.CriteriaQuery;
import org.jeecgframework.core.common.model.json.AjaxJson;
import org.jeecgframework.core.common.model.json.DataGrid;
import org.jeecgframework.core.constant.Globals;
import org.jeecgframework.core.util.MyBeanUtils;
import org.jeecgframework.core.util.ResourceUtil;
import org.jeecgframework.core.util.StringUtil;
import org.jeecgframework.poi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.entity.ExportParams;
import org.jeecgframework.poi.excel.entity.ImportParams;
import org.jeecgframework.poi.excel.entity.vo.NormalExcelConstants;
import org.jeecgframework.tag.core.easyui.TagUtil;
import org.jeecgframework.web.system.service.SystemService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
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.jeecg.demo.entity.JeecgDemoExcelEntity;
import com.jeecg.demo.service.JeecgDemoExcelServiceI;
import com.jeecg.demo.util.FreemarkerUtil;
import io.swagger.annotations.Api;
/**
* @Title: Controller
* @Description: excel
* @author onlineGenerator
* @date 2018-06-15 15:46:09
* @version V1.0
*
*/
@Controller
@RequestMapping("/jeecgDemoExcelController")
@Api(value="JeecgDemoExcel",description="excel导入导出测试表",tags="jeecgDemoExcelController")
public class JeecgDemoExcelController extends BaseController {
private static final Logger logger = LoggerFactory.getLogger(JeecgDemoExcelController.class);
@Autowired
private JeecgDemoExcelServiceI jeecgDemoExcelService;
@Autowired
private SystemService systemService;
@Autowired
private Validator validator;
/**
* excel
*
* @return
*/
@RequestMapping(params = "list")
public ModelAndView list(HttpServletRequest request) {
return new ModelAndView("com/jeecg/demo/excel/jeecgDemoExcelList");
}
/**
* easyui AJAX
*
* @param request
* @param response
* @param dataGrid
* @param user
*/
@RequestMapping(params = "datagrid")
public void datagrid(JeecgDemoExcelEntity jeecgDemoExcel,HttpServletRequest request, HttpServletResponse response, DataGrid dataGrid) {
CriteriaQuery cq = new CriteriaQuery(JeecgDemoExcelEntity.class, dataGrid);
//查询条件组装器
org.jeecgframework.core.extend.hqlsearch.HqlGenerateUtil.installHql(cq, jeecgDemoExcel, request.getParameterMap());
try{
//自定义追加查询条件
}catch (Exception e) {
throw new BusinessException(e.getMessage());
}
cq.add();
this.jeecgDemoExcelService.getDataGridReturn(cq, true);
TagUtil.datagrid(response, dataGrid);
}
/**
* excel
*
* @return
*/
@RequestMapping(params = "doDel")
@ResponseBody
public AjaxJson doDel(JeecgDemoExcelEntity jeecgDemoExcel, HttpServletRequest request) {
String message = null;
AjaxJson j = new AjaxJson();
jeecgDemoExcel = systemService.getEntity(JeecgDemoExcelEntity.class, jeecgDemoExcel.getId());
message = "excel导入导出测试表删除成功";
try{
jeecgDemoExcelService.delete(jeecgDemoExcel);
systemService.addLog(message, Globals.Log_Type_DEL, Globals.Log_Leavel_INFO);
}catch(Exception e){
e.printStackTrace();
message = "excel导入导出测试表删除失败";
throw new BusinessException(e.getMessage());
}
j.setMsg(message);
return j;
}
/**
* excel
*
* @return
*/
@RequestMapping(params = "doBatchDel")
@ResponseBody
public AjaxJson doBatchDel(String ids,HttpServletRequest request){
String message = null;
AjaxJson j = new AjaxJson();
message = "excel导入导出测试表删除成功";
try{
for(String id:ids.split(",")){
JeecgDemoExcelEntity jeecgDemoExcel = systemService.getEntity(JeecgDemoExcelEntity.class,
id
);
jeecgDemoExcelService.delete(jeecgDemoExcel);
systemService.addLog(message, Globals.Log_Type_DEL, Globals.Log_Leavel_INFO);
}
}catch(Exception e){
e.printStackTrace();
message = "excel导入导出测试表删除失败";
throw new BusinessException(e.getMessage());
}
j.setMsg(message);
return j;
}
/**
* excel
*
* @param ids
* @return
*/
@RequestMapping(params = "doAdd")
@ResponseBody
public AjaxJson doAdd(JeecgDemoExcelEntity jeecgDemoExcel, HttpServletRequest request) {
String message = null;
AjaxJson j = new AjaxJson();
message = "excel导入导出测试表添加成功";
try{
jeecgDemoExcelService.save(jeecgDemoExcel);
systemService.addLog(message, Globals.Log_Type_INSERT, Globals.Log_Leavel_INFO);
}catch(Exception e){
e.printStackTrace();
message = "excel导入导出测试表添加失败";
throw new BusinessException(e.getMessage());
}
j.setMsg(message);
return j;
}
/**
* excel
*
* @param ids
* @return
*/
@RequestMapping(params = "doUpdate")
@ResponseBody
public AjaxJson doUpdate(JeecgDemoExcelEntity jeecgDemoExcel, HttpServletRequest request) {
String message = null;
AjaxJson j = new AjaxJson();
message = "excel导入导出测试表更新成功";
JeecgDemoExcelEntity t = jeecgDemoExcelService.get(JeecgDemoExcelEntity.class, jeecgDemoExcel.getId());
try {
MyBeanUtils.copyBeanNotNull2Bean(jeecgDemoExcel, t);
jeecgDemoExcelService.saveOrUpdate(t);
systemService.addLog(message, Globals.Log_Type_UPDATE, Globals.Log_Leavel_INFO);
} catch (Exception e) {
e.printStackTrace();
message = "excel导入导出测试表更新失败";
throw new BusinessException(e.getMessage());
}
j.setMsg(message);
return j;
}
/**
* excel
*
* @return
*/
@RequestMapping(params = "goAdd")
public ModelAndView goAdd(JeecgDemoExcelEntity jeecgDemoExcel, HttpServletRequest req) {
if (StringUtil.isNotEmpty(jeecgDemoExcel.getId())) {
jeecgDemoExcel = jeecgDemoExcelService.getEntity(JeecgDemoExcelEntity.class, jeecgDemoExcel.getId());
req.setAttribute("jeecgDemoExcelPage", jeecgDemoExcel);
}
return new ModelAndView("com/jeecg/demo/excel/jeecgDemoExcel-add");
}
/**
* excel
*
* @return
*/
@RequestMapping(params = "goUpdate")
public ModelAndView goUpdate(JeecgDemoExcelEntity jeecgDemoExcel, HttpServletRequest req) {
if (StringUtil.isNotEmpty(jeecgDemoExcel.getId())) {
jeecgDemoExcel = jeecgDemoExcelService.getEntity(JeecgDemoExcelEntity.class, jeecgDemoExcel.getId());
req.setAttribute("jeecgDemoExcelPage", jeecgDemoExcel);
}
return new ModelAndView("com/jeecg/demo/excel/jeecgDemoExcel-update");
}
/**
*
*
* @return
*/
@RequestMapping(params = "upload")
public ModelAndView upload(HttpServletRequest req) {
req.setAttribute("controller_name","jeecgDemoExcelController");
return new ModelAndView("common/upload/pub_excel_upload");
}
/**
* excel
*
* @param request
* @param response
*/
@RequestMapping(params = "exportXls")
public String exportXls(JeecgDemoExcelEntity jeecgDemoExcel,HttpServletRequest request,HttpServletResponse response
, DataGrid dataGrid,ModelMap modelMap) {
CriteriaQuery cq = new CriteriaQuery(JeecgDemoExcelEntity.class, dataGrid);
org.jeecgframework.core.extend.hqlsearch.HqlGenerateUtil.installHql(cq, jeecgDemoExcel, request.getParameterMap());
List<JeecgDemoExcelEntity> jeecgDemoExcels = this.jeecgDemoExcelService.getListByCriteriaQuery(cq,false);
modelMap.put(NormalExcelConstants.FILE_NAME,"excel导入导出测试表");
modelMap.put(NormalExcelConstants.CLASS,JeecgDemoExcelEntity.class);
modelMap.put(NormalExcelConstants.PARAMS,new ExportParams("excel导入导出测试表列表", "导出人:"+ResourceUtil.getSessionUser().getRealName(),
"导出信息"));
modelMap.put(NormalExcelConstants.DATA_LIST,jeecgDemoExcels);
return NormalExcelConstants.JEECG_EXCEL_VIEW;
}
/**
* excel 使
*
* @param request
* @param response
*/
@RequestMapping(params = "exportXlsByT")
public String exportXlsByT(JeecgDemoExcelEntity jeecgDemoExcel,HttpServletRequest request,HttpServletResponse response
, DataGrid dataGrid,ModelMap modelMap) {
modelMap.put(NormalExcelConstants.FILE_NAME,"excel导入导出测试表");
modelMap.put(NormalExcelConstants.CLASS,JeecgDemoExcelEntity.class);
modelMap.put(NormalExcelConstants.PARAMS,new ExportParams("excel导入导出测试表列表", "导出人:"+ResourceUtil.getSessionUser().getRealName(),
"导出信息"));
modelMap.put(NormalExcelConstants.DATA_LIST,new ArrayList());
return NormalExcelConstants.JEECG_EXCEL_VIEW;
}
@SuppressWarnings("unchecked")
@RequestMapping(params = "importExcel", method = RequestMethod.POST)
@ResponseBody
public AjaxJson importExcel(HttpServletRequest request, HttpServletResponse response) {
AjaxJson j = new AjaxJson();
MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
MultipartFile file = entity.getValue();// 获取上传文件对象
ImportParams params = new ImportParams();
params.setTitleRows(2);
params.setHeadRows(1);
params.setNeedSave(true);
try {
List<JeecgDemoExcelEntity> listJeecgDemoExcelEntitys = ExcelImportUtil.importExcel(file.getInputStream(),JeecgDemoExcelEntity.class,params);
for (JeecgDemoExcelEntity jeecgDemoExcel : listJeecgDemoExcelEntitys) {
jeecgDemoExcelService.save(jeecgDemoExcel);
}
j.setMsg("文件导入成功!");
} catch (Exception e) {
j.setMsg("文件导入失败!");
logger.error(e.getMessage());
}finally{
try {
file.getInputStream().close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
return j;
}
@RequestMapping("/ftl2word")
public void velocity2word(JeecgDemoExcelEntity jeecgDemoExcel,HttpServletRequest request,HttpServletResponse response) throws IOException{
try {
jeecgDemoExcel = this.jeecgDemoExcelService.getEntity(JeecgDemoExcelEntity.class, jeecgDemoExcel.getId());
List<Map<String,Object>> departs = this.systemService.findForJdbc("select id,departname from t_s_depart");
String docFileName ="word-模板导出测试.doc";
Map<String,Object> rootMap = new HashMap<String,Object>();
rootMap.put("info", jeecgDemoExcel);
rootMap.put("departs", departs);
FreemarkerUtil.createFile("ftl2doc.ftl", docFileName, rootMap, request, response, FreemarkerUtil.WORD_FILE);
} catch (Exception e) {
e.printStackTrace();
}
}
}

@ -0,0 +1,466 @@
package com.jeecg.demo.controller;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Set;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.validation.ConstraintViolation;
import javax.validation.Validator;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.jeecgframework.core.beanvalidator.BeanValidators;
import org.jeecgframework.core.common.controller.BaseController;
import org.jeecgframework.core.common.exception.BusinessException;
import org.jeecgframework.core.common.hibernate.qbc.CriteriaQuery;
import org.jeecgframework.core.common.model.json.AjaxJson;
import org.jeecgframework.core.common.model.json.DataGrid;
import org.jeecgframework.core.constant.Globals;
import org.jeecgframework.core.util.ExceptionUtil;
import org.jeecgframework.core.util.MyBeanUtils;
import org.jeecgframework.core.util.ResourceUtil;
import org.jeecgframework.core.util.StringUtil;
import org.jeecgframework.core.util.oConvertUtils;
import org.jeecgframework.jwt.util.ResponseMessage;
import org.jeecgframework.jwt.util.Result;
import org.jeecgframework.poi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.entity.ExportParams;
import org.jeecgframework.poi.excel.entity.ImportParams;
import org.jeecgframework.poi.excel.entity.vo.NormalExcelConstants;
import org.jeecgframework.tag.core.easyui.TagUtil;
import org.jeecgframework.web.system.service.SystemService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
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;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
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.bind.annotation.ResponseStatus;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.util.UriComponentsBuilder;
import com.alibaba.fastjson.JSONArray;
import com.jeecg.demo.entity.JformOrderCustomer2Entity;
import com.jeecg.demo.page.JformOrderMain2Page;
import com.jeecg.demo.service.JformOrderMain2ServiceI;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
/**
* @Title: Controller
* @Description:
* @author onlineGenerator
* @date 2018-03-27 17:02:39
* @version V1.0
*
*/
@Controller
@RequestMapping("/jformOrderCustomer2Controller")
@Api(value="JformOrderCustomer2",description="订单客户信息",tags="jformOrderCustomer2Controller")
public class JformOrderCustomer2Controller extends BaseController {
private static final Logger logger = LoggerFactory.getLogger(JformOrderCustomer2Controller.class);
@Autowired
private JformOrderMain2ServiceI jformOrderMain2Service;
@Autowired
private SystemService systemService;
@Autowired
private Validator validator;
/**
*
*
* @return
*/
@RequestMapping(params = "list")
public ModelAndView list(HttpServletRequest request) {
return new ModelAndView("com/jeecg/demo/jformOrderMain2/jformOrderCustomer2/list");
}
/**
* easyui AJAX
*
* @param request
* @param response
* @param dataGrid
* @param user
*/
@RequestMapping(params = "datagrid")
public void datagrid(JformOrderCustomer2Entity jformOrderCustomer2,HttpServletRequest request, HttpServletResponse response, DataGrid dataGrid) {
CriteriaQuery cq = new CriteriaQuery(JformOrderCustomer2Entity.class, dataGrid);
String mainId = request.getParameter("mainId");
if(oConvertUtils.isNotEmpty(mainId)){
//查询条件组装器
org.jeecgframework.core.extend.hqlsearch.HqlGenerateUtil.installHql(cq, jformOrderCustomer2, request.getParameterMap());
try{
//自定义追加查询条件
cq.eq("fkId", mainId);
String query_money_begin = request.getParameter("money_begin");
String query_money_end = request.getParameter("money_end");
if(StringUtil.isNotEmpty(query_money_begin)){
cq.ge("money", Double.parseDouble(query_money_begin));
}
if(StringUtil.isNotEmpty(query_money_end)){
cq.le("money", Double.parseDouble(query_money_end));
}
}catch (Exception e) {
throw new BusinessException(e.getMessage());
}
cq.add();
this.jformOrderMain2Service.getDataGridReturn(cq, true);
}
TagUtil.datagrid(response, dataGrid);
}
/**
*
*
* @return
*/
@RequestMapping(params = "doDel")
@ResponseBody
public AjaxJson doDel(JformOrderCustomer2Entity jformOrderCustomer2, HttpServletRequest request) {
String message = null;
AjaxJson j = new AjaxJson();
jformOrderCustomer2 = systemService.getEntity(JformOrderCustomer2Entity.class, jformOrderCustomer2.getId());
message = "订单客户信息删除成功";
try{
if(jformOrderCustomer2!=null){
jformOrderMain2Service.delete(jformOrderCustomer2);
systemService.addLog(message, Globals.Log_Type_DEL, Globals.Log_Leavel_INFO);
}
}catch(Exception e){
e.printStackTrace();
message = "订单客户信息删除失败";
throw new BusinessException(e.getMessage());
}
j.setMsg(message);
return j;
}
/**
*
*
* @return
*/
@RequestMapping(params = "doBatchDel")
@ResponseBody
public AjaxJson doBatchDel(String ids,HttpServletRequest request){
String message = null;
AjaxJson j = new AjaxJson();
message = "订单客户信息删除成功";
try{
for(String id:ids.split(",")){
JformOrderCustomer2Entity jformOrderCustomer2 = systemService.getEntity(JformOrderCustomer2Entity.class,
id
);
if(jformOrderCustomer2!=null){
jformOrderMain2Service.delete(jformOrderCustomer2);
systemService.addLog(message, Globals.Log_Type_DEL, Globals.Log_Leavel_INFO);
}
}
}catch(Exception e){
e.printStackTrace();
message = "订单客户信息删除失败";
throw new BusinessException(e.getMessage());
}
j.setMsg(message);
return j;
}
/**
*
*
* @param ids
* @return
*/
@RequestMapping(params = "doAdd")
@ResponseBody
public AjaxJson doAdd(JformOrderCustomer2Entity jformOrderCustomer2, HttpServletRequest request) {
String message = null;
AjaxJson j = new AjaxJson();
message = "订单客户信息添加成功";
try{
jformOrderMain2Service.save(jformOrderCustomer2);
systemService.addLog(message, Globals.Log_Type_INSERT, Globals.Log_Leavel_INFO);
}catch(Exception e){
e.printStackTrace();
message = "订单客户信息添加失败";
throw new BusinessException(e.getMessage());
}
j.setMsg(message);
return j;
}
/**
*
*
* @param ids
* @return
*/
@RequestMapping(params = "doUpdate")
@ResponseBody
public AjaxJson doUpdate(JformOrderCustomer2Entity jformOrderCustomer2, HttpServletRequest request) {
String message = null;
AjaxJson j = new AjaxJson();
message = "订单客户信息更新成功";
JformOrderCustomer2Entity t = jformOrderMain2Service.get(JformOrderCustomer2Entity.class, jformOrderCustomer2.getId());
try {
MyBeanUtils.copyBeanNotNull2Bean(jformOrderCustomer2, t);
jformOrderMain2Service.saveOrUpdate(t);
systemService.addLog(message, Globals.Log_Type_UPDATE, Globals.Log_Leavel_INFO);
} catch (Exception e) {
e.printStackTrace();
message = "订单客户信息更新失败";
throw new BusinessException(e.getMessage());
}
j.setMsg(message);
return j;
}
/**
*
*
* @return
*/
@RequestMapping(params = "goAdd")
public ModelAndView goAdd(JformOrderCustomer2Entity jformOrderCustomer2, HttpServletRequest req) {
if (StringUtil.isNotEmpty(jformOrderCustomer2.getId())) {
jformOrderCustomer2 = jformOrderMain2Service.getEntity(JformOrderCustomer2Entity.class, jformOrderCustomer2.getId());
req.setAttribute("jformOrderCustomer2Page", jformOrderCustomer2);
}
req.setAttribute("mainId", req.getParameter("mainId"));
return new ModelAndView("com/jeecg/demo/jformOrderMain2/jformOrderCustomer2/add");
}
/**
*
*
* @return
*/
@RequestMapping(params = "goUpdate")
public ModelAndView goUpdate(JformOrderCustomer2Entity jformOrderCustomer2, HttpServletRequest req) {
if (StringUtil.isNotEmpty(jformOrderCustomer2.getId())) {
jformOrderCustomer2 = jformOrderMain2Service.getEntity(JformOrderCustomer2Entity.class, jformOrderCustomer2.getId());
req.setAttribute("jformOrderCustomer2Page", jformOrderCustomer2);
}
return new ModelAndView("com/jeecg/demo/jformOrderMain2/jformOrderCustomer2/update");
}
/**
*
*
* @return
*/
@RequestMapping(params = "upload")
public ModelAndView upload(HttpServletRequest req) {
req.setAttribute("controller_name","jformOrderCustomer2Controller");
return new ModelAndView("common/upload/pub_excel_upload");
}
/**
* excel
*
* @param request
* @param response
*/
@RequestMapping(params = "exportXls")
public String exportXls(JformOrderCustomer2Entity jformOrderCustomer2,HttpServletRequest request,HttpServletResponse response
, DataGrid dataGrid,ModelMap modelMap) {
CriteriaQuery cq = new CriteriaQuery(JformOrderCustomer2Entity.class, dataGrid);
org.jeecgframework.core.extend.hqlsearch.HqlGenerateUtil.installHql(cq, jformOrderCustomer2, request.getParameterMap());
List<JformOrderCustomer2Entity> jformOrderCustomer2s = this.jformOrderMain2Service.getListByCriteriaQuery(cq,false);
modelMap.put(NormalExcelConstants.FILE_NAME,"订单客户信息");
modelMap.put(NormalExcelConstants.CLASS,JformOrderCustomer2Entity.class);
modelMap.put(NormalExcelConstants.PARAMS,new ExportParams("订单客户信息列表", "导出人:"+ResourceUtil.getSessionUser().getRealName(),
"导出信息"));
modelMap.put(NormalExcelConstants.DATA_LIST,jformOrderCustomer2s);
return NormalExcelConstants.JEECG_EXCEL_VIEW;
}
/**
* excel 使
*
* @param request
* @param response
*/
@RequestMapping(params = "exportXlsByT")
public String exportXlsByT(JformOrderCustomer2Entity jformOrderCustomer2,HttpServletRequest request,HttpServletResponse response
, DataGrid dataGrid,ModelMap modelMap) {
modelMap.put(NormalExcelConstants.FILE_NAME,"订单客户信息");
modelMap.put(NormalExcelConstants.CLASS,JformOrderCustomer2Entity.class);
modelMap.put(NormalExcelConstants.PARAMS,new ExportParams("订单客户信息列表", "导出人:"+ResourceUtil.getSessionUser().getRealName(),
"导出信息"));
modelMap.put(NormalExcelConstants.DATA_LIST,new ArrayList());
return NormalExcelConstants.JEECG_EXCEL_VIEW;
}
@SuppressWarnings("unchecked")
@RequestMapping(params = "importExcel", method = RequestMethod.POST)
@ResponseBody
public AjaxJson importExcel(HttpServletRequest request, HttpServletResponse response) {
AjaxJson j = new AjaxJson();
MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
MultipartFile file = entity.getValue();// 获取上传文件对象
ImportParams params = new ImportParams();
params.setTitleRows(2);
params.setHeadRows(1);
params.setNeedSave(true);
try {
List<JformOrderCustomer2Entity> listJformOrderCustomer2Entitys = ExcelImportUtil.importExcel(file.getInputStream(),JformOrderCustomer2Entity.class,params);
for (JformOrderCustomer2Entity jformOrderCustomer2 : listJformOrderCustomer2Entitys) {
jformOrderMain2Service.save(jformOrderCustomer2);
}
j.setMsg("文件导入成功!");
} catch (Exception e) {
j.setMsg("文件导入失败!");
logger.error(ExceptionUtil.getExceptionMessage(e));
}finally{
try {
file.getInputStream().close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
return j;
}
/**
*
* @param page
* @param req
* @return
*/
@RequestMapping(params = "saveRows")
@ResponseBody
public AjaxJson saveRows(JformOrderMain2Page page,HttpServletRequest req){
String message = "操作成功!";
List<JformOrderCustomer2Entity> lists=page.getJformOrderCustomer2List();
AjaxJson j = new AjaxJson();
String mainId = req.getParameter("mainId");
if(CollectionUtils.isNotEmpty(lists)){
for(JformOrderCustomer2Entity temp:lists){
if (StringUtil.isNotEmpty(temp.getId())) {
JformOrderCustomer2Entity t =this.systemService.get(JformOrderCustomer2Entity.class, temp.getId());
try {
MyBeanUtils.copyBeanNotNull2Bean(temp, t);
systemService.saveOrUpdate(t);
systemService.addLog(message, Globals.Log_Type_UPDATE, Globals.Log_Leavel_INFO);
} catch (Exception e) {
e.printStackTrace();
}
} else {
try {
//temp.setDelFlag(0);若有则需要加
temp.setFkId(mainId);
systemService.save(temp);
systemService.addLog(message, Globals.Log_Type_INSERT, Globals.Log_Leavel_INFO);
} catch (Exception e) {
e.printStackTrace();
}
}
}
}
return j;
}
@RequestMapping(method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value="订单客户信息列表信息",produces="application/json",httpMethod="GET")
public ResponseMessage<List<JformOrderCustomer2Entity>> list() {
List<JformOrderCustomer2Entity> listJformOrderCustomer2s=jformOrderMain2Service.getList(JformOrderCustomer2Entity.class);
return Result.success(listJformOrderCustomer2s);
}
@RequestMapping(value = "/{id}", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value="根据ID获取订单客户信息信息",notes="根据ID获取订单客户信息信息",httpMethod="GET",produces="application/json")
public ResponseMessage<?> get(@ApiParam(required=true,name="id",value="ID")@PathVariable("id") String id) {
JformOrderCustomer2Entity task = jformOrderMain2Service.get(JformOrderCustomer2Entity.class, id);
if (task == null) {
return Result.error("根据ID获取订单客户信息信息为空");
}
return Result.success(task);
}
@RequestMapping(method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE)
@ResponseBody
@ApiOperation(value="创建订单客户信息")
public ResponseMessage<?> create(@ApiParam(name="订单客户信息对象")@RequestBody JformOrderCustomer2Entity jformOrderCustomer2, UriComponentsBuilder uriBuilder) {
//调用JSR303 Bean Validator进行校验如果出错返回含400错误码及json格式的错误信息.
Set<ConstraintViolation<JformOrderCustomer2Entity>> failures = validator.validate(jformOrderCustomer2);
if (!failures.isEmpty()) {
return Result.error(JSONArray.toJSONString(BeanValidators.extractPropertyAndMessage(failures)));
}
//保存
try{
jformOrderMain2Service.save(jformOrderCustomer2);
} catch (Exception e) {
e.printStackTrace();
return Result.error("订单客户信息信息保存失败");
}
return Result.success(jformOrderCustomer2);
}
@RequestMapping(value = "/{id}", method = RequestMethod.PUT, consumes = MediaType.APPLICATION_JSON_VALUE)
@ResponseBody
@ApiOperation(value="更新订单客户信息",notes="更新订单客户信息")
public ResponseMessage<?> update(@ApiParam(name="订单客户信息对象")@RequestBody JformOrderCustomer2Entity jformOrderCustomer2) {
//调用JSR303 Bean Validator进行校验如果出错返回含400错误码及json格式的错误信息.
Set<ConstraintViolation<JformOrderCustomer2Entity>> failures = validator.validate(jformOrderCustomer2);
if (!failures.isEmpty()) {
return Result.error(JSONArray.toJSONString(BeanValidators.extractPropertyAndMessage(failures)));
}
//保存
try{
jformOrderMain2Service.saveOrUpdate(jformOrderCustomer2);
} catch (Exception e) {
e.printStackTrace();
return Result.error("更新订单客户信息信息失败");
}
//按Restful约定返回204状态码, 无内容. 也可以返回200状态码.
return Result.success("更新订单客户信息信息成功");
}
@RequestMapping(value = "/{id}", method = RequestMethod.DELETE)
@ResponseStatus(HttpStatus.NO_CONTENT)
@ApiOperation(value="删除订单客户信息")
public ResponseMessage<?> delete(@ApiParam(name="id",value="ID",required=true)@PathVariable("id") String id) {
logger.info("delete[{}]" , id);
// 验证
if (StringUtils.isEmpty(id)) {
return Result.error("ID不能为空");
}
try {
jformOrderMain2Service.deleteEntityById(JformOrderCustomer2Entity.class, id);
} catch (Exception e) {
e.printStackTrace();
return Result.error("订单客户信息删除失败");
}
return Result.success();
}
}

@ -0,0 +1,584 @@
package com.jeecg.demo.controller;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Set;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.validation.ConstraintViolation;
import javax.validation.Validator;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.hibernate.criterion.Restrictions;
import org.jeecgframework.core.beanvalidator.BeanValidators;
import org.jeecgframework.core.common.controller.BaseController;
import org.jeecgframework.core.common.exception.BusinessException;
import org.jeecgframework.core.common.hibernate.qbc.CriteriaQuery;
import org.jeecgframework.core.common.model.json.AjaxJson;
import org.jeecgframework.core.common.model.json.DataGrid;
import org.jeecgframework.core.constant.Globals;
import org.jeecgframework.core.util.ExceptionUtil;
import org.jeecgframework.core.util.MyBeanUtils;
import org.jeecgframework.core.util.ResourceUtil;
import org.jeecgframework.core.util.StringUtil;
import org.jeecgframework.core.util.oConvertUtils;
import org.jeecgframework.jwt.util.ResponseMessage;
import org.jeecgframework.jwt.util.Result;
import org.jeecgframework.poi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.entity.ExportParams;
import org.jeecgframework.poi.excel.entity.ImportParams;
import org.jeecgframework.poi.excel.entity.vo.NormalExcelConstants;
import org.jeecgframework.tag.core.easyui.TagUtil;
import org.jeecgframework.web.superquery.util.SuperQueryUtil;
import org.jeecgframework.web.system.service.SystemService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
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;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
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.bind.annotation.ResponseStatus;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.util.UriComponentsBuilder;
import com.alibaba.fastjson.JSONArray;
import com.jeecg.demo.entity.JformOrderCustomer2Entity;
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 io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
/**
* @Title: Controller
* @Description:
* @author onlineGenerator
* @date 2018-03-27 16:21:58
* @version V1.0
*
*/
@Api(value="JformOrderMain2",description="订单主信息",tags="jformOrderMain2Controller")
@Controller
@RequestMapping("/jformOrderMain2Controller")
public class JformOrderMain2Controller extends BaseController {
private static final Logger logger = LoggerFactory.getLogger(JformOrderMain2Controller.class);
@Autowired
private JformOrderMain2ServiceI jformOrderMain2Service;
@Autowired
private SystemService systemService;
@Autowired
private Validator validator;
/**
*
* @return
*/
@RequestMapping(params = "index")
public ModelAndView index(HttpServletRequest request) {
return new ModelAndView("com/jeecg/demo/jformOrderMain2/jformOrderMain2Index");
}
/**
*
*
* @return
*/
@RequestMapping(params = "list")
public ModelAndView list(HttpServletRequest request) {
return new ModelAndView("com/jeecg/demo/jformOrderMain2/main/list");
}
/**
* easyui AJAX
*
* @param request
* @param response
* @param dataGrid
* @param user
*/
@RequestMapping(params = "datagrid")
public void datagrid(JformOrderMain2Entity jformOrderMain2,HttpServletRequest request, HttpServletResponse response, DataGrid dataGrid) {
CriteriaQuery cq = new CriteriaQuery(JformOrderMain2Entity.class, dataGrid);
//查询条件组装器
org.jeecgframework.core.extend.hqlsearch.HqlGenerateUtil.installHql(cq, jformOrderMain2);
try{
//自定义追加查询条件
String sql = SuperQueryUtil.getComplxSuperQuerySQL(request);
if(oConvertUtils.isNotEmpty(sql)) {
cq.add(Restrictions.sqlRestriction(" id in ("+sql+")"));
}
}catch (Exception e) {
throw new BusinessException(e.getMessage());
}
cq.add();
this.jformOrderMain2Service.getDataGridReturn(cq, true);
TagUtil.datagrid(response, dataGrid);
}
/**
*
*
* @return
*/
@RequestMapping(params = "doDel")
@ResponseBody
public AjaxJson doDel(JformOrderMain2Entity jformOrderMain2, HttpServletRequest request) {
AjaxJson j = new AjaxJson();
jformOrderMain2 = systemService.getEntity(JformOrderMain2Entity.class, jformOrderMain2.getId());
String message = "订单主信息删除成功";
try{
if(jformOrderMain2!=null){
jformOrderMain2Service.delMain(jformOrderMain2);
systemService.addLog(message, Globals.Log_Type_DEL, Globals.Log_Leavel_INFO);
}
}catch(Exception e){
e.printStackTrace();
message = "订单主信息删除失败";
throw new BusinessException(e.getMessage());
}
j.setMsg(message);
return j;
}
/**
*
*
* @return
*/
@RequestMapping(params = "doBatchDel")
@ResponseBody
public AjaxJson doBatchDel(String ids,HttpServletRequest request){
AjaxJson j = new AjaxJson();
String message = "订单主信息删除成功";
try{
for(String id:ids.split(",")){
JformOrderMain2Entity jformOrderMain2 = systemService.getEntity(JformOrderMain2Entity.class,
id
);
if(jformOrderMain2!=null){
jformOrderMain2Service.delMain(jformOrderMain2);
systemService.addLog(message, Globals.Log_Type_DEL, Globals.Log_Leavel_INFO);
}
}
}catch(Exception e){
e.printStackTrace();
message = "订单主信息删除失败";
throw new BusinessException(e.getMessage());
}
j.setMsg(message);
return j;
}
/**
*
*
* @param ids
* @return
*/
@RequestMapping(params = "doAdd")
@ResponseBody
public AjaxJson doAdd(JformOrderMain2Entity jformOrderMain2,JformOrderMain2Page jformOrderMain2Page, HttpServletRequest request) {
List<JformOrderTicket2Entity> jformOrderTicket2List = jformOrderMain2Page.getJformOrderTicket2List();
List<JformOrderCustomer2Entity> jformOrderCustomer2List = jformOrderMain2Page.getJformOrderCustomer2List();
AjaxJson j = new AjaxJson();
String message = "添加成功";
try{
jformOrderMain2Service.addMain(jformOrderMain2, jformOrderTicket2List,jformOrderCustomer2List);
systemService.addLog(message, Globals.Log_Type_INSERT, Globals.Log_Leavel_INFO);
}catch(Exception e){
e.printStackTrace();
message = "订单主信息添加失败";
throw new BusinessException(e.getMessage());
}
j.setMsg(message);
return j;
}
/**
*
*
* @param ids
* @return
*/
@RequestMapping(params = "doUpdate")
@ResponseBody
public AjaxJson doUpdate(JformOrderMain2Entity jformOrderMain2,JformOrderMain2Page jformOrderMain2Page, HttpServletRequest request) {
List<JformOrderTicket2Entity> jformOrderTicket2List = jformOrderMain2Page.getJformOrderTicket2List();
List<JformOrderCustomer2Entity> jformOrderCustomer2List = jformOrderMain2Page.getJformOrderCustomer2List();
AjaxJson j = new AjaxJson();
String message = "更新成功";
try{
jformOrderMain2Service.updateMain(jformOrderMain2, jformOrderTicket2List,jformOrderCustomer2List);
systemService.addLog(message, Globals.Log_Type_UPDATE, Globals.Log_Leavel_INFO);
}catch(Exception e){
e.printStackTrace();
message = "更新订单主信息失败";
throw new BusinessException(e.getMessage());
}
j.setMsg(message);
return j;
}
@RequestMapping(params = "goAdd")
public ModelAndView goAdd(HttpServletRequest req) {
//跳转主页面
return new ModelAndView("com/jeecg/demo/jformOrderMain2/main/addOrUpdate");
}
@RequestMapping(params = "goUpdate")
public ModelAndView goUpdate(HttpServletRequest req) {
//跳转主页面
String id = req.getParameter("id");
req.setAttribute("mainId",id);
req.setAttribute("load", req.getParameter("load"));
return new ModelAndView("com/jeecg/demo/jformOrderMain2/main/addOrUpdate");
}
/**
*
*
* @return
*/
@RequestMapping(params = "mainPage")
public ModelAndView mainPage(JformOrderMain2Entity jformOrderMain2, HttpServletRequest req) {
if (StringUtil.isNotEmpty(jformOrderMain2.getId())) {
jformOrderMain2 = jformOrderMain2Service.getEntity(JformOrderMain2Entity.class, jformOrderMain2.getId());
req.setAttribute("jformOrderMain2Page", jformOrderMain2);
}
return new ModelAndView("com/jeecg/demo/jformOrderMain2/main/jformOrderMain2");
}
/**
* []
*
* @return
*/
@RequestMapping(params = "jformOrderTicket2List")
public ModelAndView jformOrderTicket2List(JformOrderMain2Entity jformOrderMain2, HttpServletRequest req) {
//===================================================================================
//获取参数
Object id0 = jformOrderMain2.getId();
//===================================================================================
//查询-订单机票信息
String hql0 = "from JformOrderTicket2Entity where 1 = 1 AND fCK_ID = ? ";
try{
List<JformOrderTicket2Entity> jformOrderTicket2EntityList = systemService.findHql(hql0,id0);
req.setAttribute("jformOrderTicket2List", jformOrderTicket2EntityList);
}catch(Exception e){
logger.info(e.getMessage());
}
return new ModelAndView("com/jeecg/demo/jformOrderMain2/main/jformOrderTicket2");
}
/**
* []
*
* @return
*/
@RequestMapping(params = "jformOrderCustomer2List")
public ModelAndView jformOrderCustomer2List(JformOrderMain2Entity jformOrderMain2, HttpServletRequest req) {
//===================================================================================
//获取参数
Object id1 = jformOrderMain2.getId();
//===================================================================================
//查询-订单客户信息
String hql1 = "from JformOrderCustomer2Entity where 1 = 1 AND fK_ID = ? ";
try{
List<JformOrderCustomer2Entity> jformOrderCustomer2EntityList = systemService.findHql(hql1,id1);
req.setAttribute("jformOrderCustomer2List", jformOrderCustomer2EntityList);
}catch(Exception e){
logger.info(e.getMessage());
}
return new ModelAndView("com/jeecg/demo/jformOrderMain2/main/jformOrderCustomer2");
}
/**
* excel
*
* @param request
* @param response
*/
@RequestMapping(params = "exportXls")
public String exportXls(JformOrderMain2Entity jformOrderMain2,HttpServletRequest request, HttpServletResponse response, DataGrid dataGrid,ModelMap map) {
CriteriaQuery cq = new CriteriaQuery(JformOrderMain2Entity.class, dataGrid);
//查询条件组装器
org.jeecgframework.core.extend.hqlsearch.HqlGenerateUtil.installHql(cq, jformOrderMain2);
try{
//自定义追加查询条件
}catch (Exception e) {
throw new BusinessException(e.getMessage());
}
cq.add();
List<JformOrderMain2Entity> list=this.jformOrderMain2Service.getListByCriteriaQuery(cq, false);
List<JformOrderMain2Page> pageList=new ArrayList<JformOrderMain2Page>();
if(list!=null&&list.size()>0){
for(JformOrderMain2Entity entity:list){
try{
JformOrderMain2Page page=new JformOrderMain2Page();
MyBeanUtils.copyBeanNotNull2Bean(entity,page);
Object id0 = entity.getId();
String hql0 = "from JformOrderTicket2Entity where 1 = 1 AND fCK_ID = ? ";
List<JformOrderTicket2Entity> jformOrderTicket2EntityList = systemService.findHql(hql0,id0);
page.setJformOrderTicket2List(jformOrderTicket2EntityList);
Object id1 = entity.getId();
String hql1 = "from JformOrderCustomer2Entity where 1 = 1 AND fK_ID = ? ";
List<JformOrderCustomer2Entity> jformOrderCustomer2EntityList = systemService.findHql(hql1,id1);
page.setJformOrderCustomer2List(jformOrderCustomer2EntityList);
pageList.add(page);
}catch(Exception e){
logger.info(e.getMessage());
}
}
}
map.put(NormalExcelConstants.FILE_NAME,"订单主信息");
map.put(NormalExcelConstants.CLASS,JformOrderMain2Page.class);
map.put(NormalExcelConstants.PARAMS,new ExportParams("订单主信息列表", "导出人:Jeecg",
"导出信息"));
map.put(NormalExcelConstants.DATA_LIST,pageList);
return NormalExcelConstants.JEECG_EXCEL_VIEW;
}
/**
* excel
* @param request
* @param
* @return
*/
@RequestMapping(params = "importExcel", method = RequestMethod.POST)
@ResponseBody
public AjaxJson importExcel(HttpServletRequest request, HttpServletResponse response) {
AjaxJson j = new AjaxJson();
MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
MultipartFile file = entity.getValue();// 获取上传文件对象
ImportParams params = new ImportParams();
params.setTitleRows(2);
params.setHeadRows(2);
params.setNeedSave(true);
try {
List<JformOrderMain2Page> list = ExcelImportUtil.importExcel(file.getInputStream(), JformOrderMain2Page.class, params);
JformOrderMain2Entity entity1=null;
for (JformOrderMain2Page page : list) {
entity1=new JformOrderMain2Entity();
MyBeanUtils.copyBeanNotNull2Bean(page,entity1);
jformOrderMain2Service.addMain(entity1, page.getJformOrderTicket2List(),page.getJformOrderCustomer2List());
}
j.setMsg("文件导入成功!");
} catch (Exception e) {
j.setMsg("文件导入失败!");
logger.error(ExceptionUtil.getExceptionMessage(e));
}finally{
try {
file.getInputStream().close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
return j;
}
/**
* excel 使
*/
@RequestMapping(params = "exportXlsByT")
public String exportXlsByT(ModelMap map) {
map.put(NormalExcelConstants.FILE_NAME,"订单主信息");
map.put(NormalExcelConstants.CLASS,JformOrderMain2Page.class);
map.put(NormalExcelConstants.PARAMS,new ExportParams("订单主信息列表", "导出人:"+ ResourceUtil.getSessionUser().getRealName(),
"导出信息"));
map.put(NormalExcelConstants.DATA_LIST,new ArrayList());
return NormalExcelConstants.JEECG_EXCEL_VIEW;
}
/**
*
*
* @return
*/
@RequestMapping(params = "upload")
public ModelAndView upload(HttpServletRequest req) {
req.setAttribute("controller_name", "jformOrderMain2Controller");
return new ModelAndView("common/upload/pub_excel_upload");
}
/**
*
* @param page
* @return
*/
@RequestMapping(params = "saveRows")
@ResponseBody
public AjaxJson saveRows(JformOrderMain2Page page,HttpServletRequest req){
String message = "操作成功!";
List<JformOrderMain2Entity> lists=page.getJformOrderMain2List();
AjaxJson j = new AjaxJson();
if(CollectionUtils.isNotEmpty(lists)){
for(JformOrderMain2Entity temp:lists){
if (StringUtil.isNotEmpty(temp.getId())) {
JformOrderMain2Entity t =this.systemService.get(JformOrderMain2Entity.class, temp.getId());
try {
MyBeanUtils.copyBeanNotNull2Bean(temp, t);
systemService.saveOrUpdate(t);
systemService.addLog(message, Globals.Log_Type_UPDATE, Globals.Log_Leavel_INFO);
} catch (Exception e) {
e.printStackTrace();
}
} else {
try {
//temp.setDelFlag(0);若有则需要加
systemService.save(temp);
systemService.addLog(message, Globals.Log_Type_INSERT, Globals.Log_Leavel_INFO);
} catch (Exception e) {
e.printStackTrace();
}
}
}
}
return j;
}
@RequestMapping(method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value="订单主信息列表信息",produces="application/json",httpMethod="GET")
public ResponseMessage<List<JformOrderMain2Page>> list() {
List<JformOrderMain2Entity> list= jformOrderMain2Service.getList(JformOrderMain2Entity.class);
List<JformOrderMain2Page> pageList=new ArrayList<JformOrderMain2Page>();
if(list!=null&&list.size()>0){
for(JformOrderMain2Entity entity:list){
try{
JformOrderMain2Page page=new JformOrderMain2Page();
MyBeanUtils.copyBeanNotNull2Bean(entity,page);
Object id0 = entity.getId();
Object id1 = entity.getId();
String hql0 = "from JformOrderTicket2Entity where 1 = 1 AND fCK_ID = ? ";
List<JformOrderTicket2Entity> jformOrderTicket2OldList = this.jformOrderMain2Service.findHql(hql0,id0);
page.setJformOrderTicket2List(jformOrderTicket2OldList);
String hql1 = "from JformOrderCustomer2Entity where 1 = 1 AND fK_ID = ? ";
List<JformOrderCustomer2Entity> jformOrderCustomer2OldList = this.jformOrderMain2Service.findHql(hql1,id1);
page.setJformOrderCustomer2List(jformOrderCustomer2OldList);
pageList.add(page);
}catch(Exception e){
logger.info(e.getMessage());
}
}
}
return Result.success(pageList);
}
@RequestMapping(value = "/{id}", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value="根据ID获取订单主信息信息",notes="根据ID获取订单主信息信息",httpMethod="GET",produces="application/json")
public ResponseMessage<?> get(@ApiParam(required=true,name="id",value="ID")@PathVariable("id") String id) {
JformOrderMain2Entity task = jformOrderMain2Service.get(JformOrderMain2Entity.class, id);
if (task == null) {
return Result.error("根据ID获取订单主信息信息为空");
}
JformOrderMain2Page page = new JformOrderMain2Page();
try {
MyBeanUtils.copyBeanNotNull2Bean(task, page);
Object id0 = task.getId();
Object id1 = task.getId();
String hql0 = "from JformOrderTicket2Entity where 1 = 1 AND fCK_ID = ? ";
List<JformOrderTicket2Entity> jformOrderTicket2OldList = this.jformOrderMain2Service.findHql(hql0,id0);
page.setJformOrderTicket2List(jformOrderTicket2OldList);
String hql1 = "from JformOrderCustomer2Entity where 1 = 1 AND fK_ID = ? ";
List<JformOrderCustomer2Entity> jformOrderCustomer2OldList = this.jformOrderMain2Service.findHql(hql1,id1);
page.setJformOrderCustomer2List(jformOrderCustomer2OldList);
} catch (Exception e) {
e.printStackTrace();
}
return Result.success(page);
}
@RequestMapping(method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE)
@ResponseBody
@ApiOperation(value="创建订单主信息")
public ResponseMessage<?> create(@ApiParam(name="订单主信息对象")@RequestBody JformOrderMain2Page jformOrderMain2Page, UriComponentsBuilder uriBuilder) {
//调用JSR303 Bean Validator进行校验如果出错返回含400错误码及json格式的错误信息.
Set<ConstraintViolation<JformOrderMain2Page>> failures = validator.validate(jformOrderMain2Page);
if (!failures.isEmpty()) {
return Result.error(JSONArray.toJSONString(BeanValidators.extractPropertyAndMessage(failures)));
}
//保存
List<JformOrderTicket2Entity> jformOrderTicket2List = jformOrderMain2Page.getJformOrderTicket2List();
List<JformOrderCustomer2Entity> jformOrderCustomer2List = jformOrderMain2Page.getJformOrderCustomer2List();
JformOrderMain2Entity jformOrderMain2 = new JformOrderMain2Entity();
try{
MyBeanUtils.copyBeanNotNull2Bean(jformOrderMain2Page,jformOrderMain2);
}catch(Exception e){
logger.info(e.getMessage());
return Result.error("保存订单主信息失败");
}
jformOrderMain2Service.addMain(jformOrderMain2, jformOrderTicket2List,jformOrderCustomer2List);
return Result.success(jformOrderMain2);
}
@RequestMapping(value = "/{id}", method = RequestMethod.PUT, consumes = MediaType.APPLICATION_JSON_VALUE)
@ResponseBody
@ApiOperation(value="更新订单主信息",notes="更新订单主信息")
public ResponseMessage<?> update(@RequestBody JformOrderMain2Page jformOrderMain2Page) {
//调用JSR303 Bean Validator进行校验如果出错返回含400错误码及json格式的错误信息.
Set<ConstraintViolation<JformOrderMain2Page>> failures = validator.validate(jformOrderMain2Page);
if (!failures.isEmpty()) {
return Result.error(JSONArray.toJSONString(BeanValidators.extractPropertyAndMessage(failures)));
}
//保存
List<JformOrderTicket2Entity> jformOrderTicket2List = jformOrderMain2Page.getJformOrderTicket2List();
List<JformOrderCustomer2Entity> jformOrderCustomer2List = jformOrderMain2Page.getJformOrderCustomer2List();
JformOrderMain2Entity jformOrderMain2 = new JformOrderMain2Entity();
try{
MyBeanUtils.copyBeanNotNull2Bean(jformOrderMain2Page,jformOrderMain2);
}catch(Exception e){
logger.info(e.getMessage());
return Result.error("订单主信息更新失败");
}
jformOrderMain2Service.updateMain(jformOrderMain2, jformOrderTicket2List,jformOrderCustomer2List);
//按Restful约定返回204状态码, 无内容. 也可以返回200状态码.
return Result.success();
}
@RequestMapping(value = "/{id}", method = RequestMethod.DELETE)
@ResponseStatus(HttpStatus.NO_CONTENT)
@ApiOperation(value="删除订单主信息")
public ResponseMessage<?> delete(@ApiParam(name="id",value="ID",required=true)@PathVariable("id") String id) {
logger.info("delete[{}]" , id);
// 验证
if (StringUtils.isEmpty(id)) {
return Result.error("ID不能为空");
}
try {
JformOrderMain2Entity jformOrderMain2 = jformOrderMain2Service.get(JformOrderMain2Entity.class, id);
jformOrderMain2Service.delMain(jformOrderMain2);
} catch (Exception e) {
e.printStackTrace();
return Result.error("订单主信息删除失败");
}
return Result.success();
}
}

@ -0,0 +1,769 @@
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.net.URI;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.validation.ConstraintViolation;
import javax.validation.Validator;
import org.apache.commons.collections.CollectionUtils;
import org.apache.log4j.Logger;
import org.apache.poi.ss.formula.functions.T;
import org.jeecgframework.core.beanvalidator.BeanValidators;
import org.jeecgframework.core.common.controller.BaseController;
import org.jeecgframework.core.common.exception.BusinessException;
import org.jeecgframework.core.common.hibernate.qbc.CriteriaQuery;
import org.jeecgframework.core.common.model.json.AjaxJson;
import org.jeecgframework.core.common.model.json.DataGrid;
import org.jeecgframework.core.constant.Globals;
import org.jeecgframework.core.util.ExceptionUtil;
import org.jeecgframework.core.util.MyBeanUtils;
import org.jeecgframework.core.util.ReflectHelper;
import org.jeecgframework.core.util.ResourceUtil;
import org.jeecgframework.core.util.StringUtil;
import org.jeecgframework.core.util.oConvertUtils;
import org.jeecgframework.poi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.entity.ExportParams;
import org.jeecgframework.poi.excel.entity.ImportParams;
import org.jeecgframework.poi.excel.entity.vo.NormalExcelConstants;
import org.jeecgframework.tag.core.easyui.TagUtil;
import org.jeecgframework.web.cgform.entity.upload.CgUploadEntity;
import org.jeecgframework.web.cgform.service.config.CgFormFieldServiceI;
import org.jeecgframework.web.system.pojo.base.TSDepart;
import org.jeecgframework.web.system.service.SystemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
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.bind.annotation.ResponseStatus;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.util.UriComponentsBuilder;
import com.alibaba.fastjson.JSONObject;
import com.jeecg.demo.entity.JformOrderCustomerEntity;
import com.jeecg.demo.entity.JformOrderMainEntity;
import com.jeecg.demo.entity.JformOrderTicketEntity;
import com.jeecg.demo.page.JformOrderCustomerPage;
import com.jeecg.demo.page.JformOrderMainPage;
import com.jeecg.demo.service.JformOrderMainServiceI;
/**
* @Title: Controller
* @Description:
* @author onlineGenerator
* @date 2017-09-17 11:49:08
* @version V1.0
*
*/
@Controller
@RequestMapping("/jformOrderMainController")
@Api(value="orderMainRest",description="一对多订单管理",tags="JformOrderMainController")
public class JformOrderMainController extends BaseController {
/**
* Logger for this class
*/
private static final Logger logger = Logger.getLogger(JformOrderMainController.class);
@Autowired
private JformOrderMainServiceI jformOrderMainService;
@Autowired
private SystemService systemService;
@Autowired
private Validator validator;
@Autowired
private CgFormFieldServiceI cgFormFieldService;
/**
*
*
* @return
*/
@RequestMapping(params = "list")
public ModelAndView list(HttpServletRequest request) {
return new ModelAndView("com/jeecg/demo/orderOne2Many/jformOrderMainList");
}
/**
*
*
* @return
*/
@RequestMapping(params = "mainlist")
public ModelAndView mainlist(HttpServletRequest request) {
return new ModelAndView("com/jeecg/demo/orderOne2Many/jformOrderMainListBase");
}
/**
*
*
* @return
*/
@RequestMapping(params = "customerlist")
public ModelAndView customerlist(HttpServletRequest request) {
return new ModelAndView("com/jeecg/demo/orderOne2Many/jformOrderCustomerListBase");
}
/**
* easyui AJAX
*
* @param request
* @param response
* @param dataGrid
* @param user
*/
@RequestMapping(params = "datagrid")
public void datagrid(JformOrderMainEntity jformOrderMain,HttpServletRequest request, HttpServletResponse response, DataGrid dataGrid) {
CriteriaQuery cq = new CriteriaQuery(JformOrderMainEntity.class, dataGrid);
//查询条件组装器
org.jeecgframework.core.extend.hqlsearch.HqlGenerateUtil.installHql(cq, jformOrderMain);
try{
//自定义追加查询条件
}catch (Exception e) {
throw new BusinessException(e.getMessage());
}
cq.add();
this.jformOrderMainService.getDataGridReturn(cq, true);
TagUtil.datagrid(response, dataGrid);
}
/**
* easyui AJAX
*
* @param request
* @param response
* @param dataGrid
* @param user
*/
@RequestMapping(params = "customerDatagrid")
public void customerDatagrid(JformOrderCustomerEntity jformCustomer,HttpServletRequest request, HttpServletResponse response, DataGrid dataGrid) {
CriteriaQuery cq = new CriteriaQuery(JformOrderCustomerEntity.class, dataGrid);
if(jformCustomer.getFkId() == null || "".equals(jformCustomer.getFkId())){
}else{
//查询条件组装器
org.jeecgframework.core.extend.hqlsearch.HqlGenerateUtil.installHql(cq, jformCustomer);
cq.add();
this.jformOrderMainService.getDataGridReturn(cq, true);
}
TagUtil.datagrid(response, dataGrid);
}
/**
*
*
* @return
*/
@RequestMapping(params = "doDel")
@ResponseBody
public AjaxJson doDel(JformOrderMainEntity jformOrderMain, HttpServletRequest request) {
AjaxJson j = new AjaxJson();
jformOrderMain = systemService.getEntity(JformOrderMainEntity.class, jformOrderMain.getId());
String message = "订单主信息删除成功";
try{
jformOrderMainService.delMain(jformOrderMain);
systemService.addLog(message, Globals.Log_Type_DEL, Globals.Log_Leavel_INFO);
}catch(Exception e){
e.printStackTrace();
message = "订单主信息删除失败";
throw new BusinessException(e.getMessage());
}
j.setMsg(message);
return j;
}
/**
*
*
* @return
*/
@RequestMapping(params = "doBatchDel")
@ResponseBody
public AjaxJson doBatchDel(String ids,HttpServletRequest request){
AjaxJson j = new AjaxJson();
String message = "订单主信息删除成功";
try{
for(String id:ids.split(",")){
JformOrderMainEntity jformOrderMain = systemService.getEntity(JformOrderMainEntity.class,
id
);
jformOrderMainService.delMain(jformOrderMain);
systemService.addLog(message, Globals.Log_Type_DEL, Globals.Log_Leavel_INFO);
}
}catch(Exception e){
e.printStackTrace();
message = "订单主信息删除失败";
throw new BusinessException(e.getMessage());
}
j.setMsg(message);
return j;
}
/**
*
*
* @param ids
* @return
*/
@RequestMapping(params = "doAdd")
@ResponseBody
public AjaxJson doAdd(JformOrderMainEntity jformOrderMain,JformOrderMainPage jformOrderMainPage, HttpServletRequest request) {
List<JformOrderCustomerEntity> jformOrderCustomerList = jformOrderMainPage.getJformOrderCustomerList();
List<JformOrderTicketEntity> jformOrderTicketList = jformOrderMainPage.getJformOrderTicketList();
AjaxJson j = new AjaxJson();
String message = "添加成功";
try{
jformOrderMainService.addMain(jformOrderMain, jformOrderCustomerList,jformOrderTicketList);
systemService.addLog(message, Globals.Log_Type_INSERT, Globals.Log_Leavel_INFO);
}catch(Exception e){
e.printStackTrace();
message = "订单主信息添加失败";
throw new BusinessException(e.getMessage());
}
j.setMsg(message);
j.setObj(jformOrderMain);
return j;
}
/**
*
*
* @param ids
* @return
*/
@RequestMapping(params = "doUpdate")
@ResponseBody
public AjaxJson doUpdate(JformOrderMainEntity jformOrderMain,JformOrderMainPage jformOrderMainPage, HttpServletRequest request) {
List<JformOrderCustomerEntity> jformOrderCustomerList = jformOrderMainPage.getJformOrderCustomerList();
List<JformOrderTicketEntity> jformOrderTicketList = jformOrderMainPage.getJformOrderTicketList();
AjaxJson j = new AjaxJson();
String message = "更新成功";
try{
jformOrderMainService.updateMain(jformOrderMain, jformOrderCustomerList,jformOrderTicketList);
systemService.addLog(message, Globals.Log_Type_UPDATE, Globals.Log_Leavel_INFO);
}catch(Exception e){
e.printStackTrace();
message = "更新订单主信息失败";
throw new BusinessException(e.getMessage());
}
j.setMsg(message);
return j;
}
/**
*
*
* @return
*/
@RequestMapping(params = "goAdd")
public ModelAndView goAdd(JformOrderMainEntity jformOrderMain, HttpServletRequest req) {
if (StringUtil.isNotEmpty(jformOrderMain.getId())) {
jformOrderMain = jformOrderMainService.getEntity(JformOrderMainEntity.class, jformOrderMain.getId());
req.setAttribute("jformOrderMainPage", jformOrderMain);
}
return new ModelAndView("com/jeecg/demo/orderOne2Many/jformOrderMain-add");
}
/**
*
*
* @return
*/
@RequestMapping(params = "goUpdate")
public ModelAndView goUpdate(JformOrderMainEntity jformOrderMain, HttpServletRequest req) {
if (StringUtil.isNotEmpty(jformOrderMain.getId())) {
jformOrderMain = jformOrderMainService.getEntity(JformOrderMainEntity.class, jformOrderMain.getId());
req.setAttribute("jformOrderMainPage", jformOrderMain);
}
return new ModelAndView("com/jeecg/demo/orderOne2Many/jformOrderMain-update");
}
/**
* [JformOrderMain]
*
* @return
*/
@RequestMapping(params = "jformOrderCustomerList")
public ModelAndView jformOrderCustomerList(JformOrderMainEntity jformOrderMain, HttpServletRequest req) {
//===================================================================================
//获取参数
Object id0 = jformOrderMain.getId();
//===================================================================================
//查询-JformOrderMain子表
String hql0 = "from JformOrderCustomerEntity where 1 = 1 AND fK_ID = ? ";
try{
List<JformOrderCustomerEntity> jformOrderCustomerEntityList = systemService.findHql(hql0,id0);
req.setAttribute("jformOrderCustomerList", jformOrderCustomerEntityList);
}catch(Exception e){
logger.info(e.getMessage());
}
return new ModelAndView("com/jeecg/demo/orderOne2Many/jformOrderCustomerList");
}
/**
* [JformOrderMain]
*
* @return
*/
@RequestMapping(params = "jformOrderTicketList")
public ModelAndView jformOrderTicketList(JformOrderMainEntity jformOrderMain, HttpServletRequest req) {
//===================================================================================
//获取参数
Object id1 = jformOrderMain.getId();
//===================================================================================
//查询-JformOrderMain子表
String hql1 = "from JformOrderTicketEntity where 1 = 1 AND fCK_ID = ? ";
try{
List<JformOrderTicketEntity> jformOrderTicketEntityList = systemService.findHql(hql1,id1);
req.setAttribute("jformOrderTicketList", jformOrderTicketEntityList);
}catch(Exception e){
logger.info(e.getMessage());
}
return new ModelAndView("com/jeecg/demo/orderOne2Many/jformOrderTicketList");
}
/**
* excel
*
* @param request
* @param response
*/
@RequestMapping(params = "exportXls")
public String exportXls(JformOrderMainEntity jformOrderMain,HttpServletRequest request, HttpServletResponse response, DataGrid dataGrid,ModelMap map) {
CriteriaQuery cq = new CriteriaQuery(JformOrderMainEntity.class, dataGrid);
//查询条件组装器
org.jeecgframework.core.extend.hqlsearch.HqlGenerateUtil.installHql(cq, jformOrderMain);
try{
//自定义追加查询条件
}catch (Exception e) {
throw new BusinessException(e.getMessage());
}
cq.add();
List<JformOrderMainEntity> list=this.jformOrderMainService.getListByCriteriaQuery(cq, false);
List<JformOrderMainPage> pageList=new ArrayList<JformOrderMainPage>();
if(list!=null&&list.size()>0){
for(JformOrderMainEntity entity:list){
try{
JformOrderMainPage page=new JformOrderMainPage();
MyBeanUtils.copyBeanNotNull2Bean(entity,page);
Object id0 = entity.getId();
String hql0 = "from JformOrderCustomerEntity where 1 = 1 AND fK_ID = ? ";
List<JformOrderCustomerEntity> jformOrderCustomerEntityList = systemService.findHql(hql0,id0);
page.setJformOrderCustomerList(jformOrderCustomerEntityList);
Object id1 = entity.getId();
String hql1 = "from JformOrderTicketEntity where 1 = 1 AND fCK_ID = ? ";
List<JformOrderTicketEntity> jformOrderTicketEntityList = systemService.findHql(hql1,id1);
page.setJformOrderTicketList(jformOrderTicketEntityList);
pageList.add(page);
}catch(Exception e){
logger.info(e.getMessage());
}
}
}
map.put(NormalExcelConstants.FILE_NAME,"订单主信息");
map.put(NormalExcelConstants.CLASS,JformOrderMainPage.class);
map.put(NormalExcelConstants.PARAMS,new ExportParams("订单主信息列表", "导出人:Jeecg",
"导出信息"));
map.put(NormalExcelConstants.DATA_LIST,pageList);
return NormalExcelConstants.JEECG_EXCEL_VIEW;
}
/**
* excel
* @param request
* @param
* @return
*/
@RequestMapping(params = "importExcel", method = RequestMethod.POST)
@ResponseBody
public AjaxJson importExcel(HttpServletRequest request, HttpServletResponse response) {
AjaxJson j = new AjaxJson();
MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
MultipartFile file = entity.getValue();// 获取上传文件对象
ImportParams params = new ImportParams();
params.setTitleRows(2);
params.setHeadRows(2);
params.setNeedSave(true);
try {
List<JformOrderMainPage> list = ExcelImportUtil.importExcel(file.getInputStream(), JformOrderMainPage.class, params);
JformOrderMainEntity entity1=null;
for (JformOrderMainPage page : list) {
entity1=new JformOrderMainEntity();
MyBeanUtils.copyBeanNotNull2Bean(page,entity1);
jformOrderMainService.addMain(entity1, page.getJformOrderCustomerList(),page.getJformOrderTicketList());
}
j.setMsg("文件导入成功!");
} catch (Exception e) {
j.setMsg("文件导入失败!");
logger.error(ExceptionUtil.getExceptionMessage(e));
}finally{
try {
file.getInputStream().close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
return j;
}
/**
* excel 使
*/
@RequestMapping(params = "exportXlsByT")
public String exportXlsByT(ModelMap map) {
map.put(NormalExcelConstants.FILE_NAME,"订单主信息");
map.put(NormalExcelConstants.CLASS,JformOrderMainPage.class);
map.put(NormalExcelConstants.PARAMS,new ExportParams("订单主信息列表", "导出人:"+ ResourceUtil.getSessionUser().getRealName(),
"导出信息"));
map.put(NormalExcelConstants.DATA_LIST,new ArrayList());
return NormalExcelConstants.JEECG_EXCEL_VIEW;
}
/**
*
*
* @return
*/
@RequestMapping(params = "upload")
public ModelAndView upload(HttpServletRequest req) {
req.setAttribute("controller_name", "jformOrderMainController");
return new ModelAndView("common/upload/pub_excel_upload");
}
@RequestMapping(method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value="订单列表信息",produces="application/json",httpMethod="GET")
public List<JformOrderMainPage> list() {
List<JformOrderMainEntity> list= jformOrderMainService.getList(JformOrderMainEntity.class);
List<JformOrderMainPage> pageList=new ArrayList<JformOrderMainPage>();
if(list!=null&&list.size()>0){
for(JformOrderMainEntity entity:list){
try{
JformOrderMainPage page=new JformOrderMainPage();
MyBeanUtils.copyBeanNotNull2Bean(entity,page);
Object id0 = entity.getId();
Object id1 = entity.getId();
String hql0 = "from JformOrderCustomerEntity where 1 = 1 AND fK_ID = ? ";
List<JformOrderCustomerEntity> jformOrderCustomerOldList = this.jformOrderMainService.findHql(hql0,id0);
page.setJformOrderCustomerList(jformOrderCustomerOldList);
String hql1 = "from JformOrderTicketEntity where 1 = 1 AND fCK_ID = ? ";
List<JformOrderTicketEntity> jformOrderTicketOldList = this.jformOrderMainService.findHql(hql1,id1);
page.setJformOrderTicketList(jformOrderTicketOldList);
pageList.add(page);
}catch(Exception e){
logger.info(e.getMessage());
}
}
}
return pageList;
}
@RequestMapping(value = "/{id}", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value="根据ID获取订单信息",notes="根据ID获取订单信息",httpMethod="GET",produces="application/json")
public ResponseEntity<?> get(@PathVariable("id") String id) {
JformOrderMainEntity task = jformOrderMainService.get(JformOrderMainEntity.class, id);
if (task == null) {
return new ResponseEntity(HttpStatus.NOT_FOUND);
}
JformOrderMainPage page = new JformOrderMainPage();
try {
MyBeanUtils.copyBeanNotNull2Bean(task, page);
String hql0 = "from JformOrderCustomerEntity where 1 = 1 AND fK_ID = ? ";
List<JformOrderCustomerEntity> jformOrderCustomerOldList = this.jformOrderMainService.findHql(hql0,id);
page.setJformOrderCustomerList(jformOrderCustomerOldList);
String hql1 = "from JformOrderTicketEntity where 1 = 1 AND fCK_ID = ? ";
List<JformOrderTicketEntity> jformOrderTicketOldList = this.jformOrderMainService.findHql(hql1,id);
page.setJformOrderTicketList(jformOrderTicketOldList);
} catch (Exception e) {
e.printStackTrace();
}
return new ResponseEntity(page, HttpStatus.OK);
}
@RequestMapping(method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE)
@ResponseBody
@ApiOperation(value="创建订单")
public ResponseEntity<?> create(@ApiParam(value="订单信息")@RequestBody JformOrderMainPage jformOrderMainPage, UriComponentsBuilder uriBuilder) {
//调用JSR303 Bean Validator进行校验如果出错返回含400错误码及json格式的错误信息.
Set<ConstraintViolation<JformOrderMainPage>> failures = validator.validate(jformOrderMainPage);
if (!failures.isEmpty()) {
return new ResponseEntity(BeanValidators.extractPropertyAndMessage(failures), HttpStatus.BAD_REQUEST);
}
//保存
List<JformOrderCustomerEntity> jformOrderCustomerList = jformOrderMainPage.getJformOrderCustomerList();
List<JformOrderTicketEntity> jformOrderTicketList = jformOrderMainPage.getJformOrderTicketList();
JformOrderMainEntity jformOrderMain = new JformOrderMainEntity();
try{
MyBeanUtils.copyBeanNotNull2Bean(jformOrderMainPage,jformOrderMain);
}catch(Exception e){
logger.info(e.getMessage());
}
jformOrderMainService.addMain(jformOrderMain, jformOrderCustomerList,jformOrderTicketList);
//按照Restful风格约定创建指向新任务的url, 也可以直接返回id或对象.
String id = jformOrderMainPage.getId();
URI uri = uriBuilder.path("/rest/jformOrderMainController/" + id).build().toUri();
HttpHeaders headers = new HttpHeaders();
headers.setLocation(uri);
return new ResponseEntity(headers, HttpStatus.CREATED);
}
@RequestMapping(value = "/{id}", method = RequestMethod.PUT, consumes = MediaType.APPLICATION_JSON_VALUE)
@ResponseBody
@ApiOperation(value="更新订单",notes="更新订单")
public ResponseEntity<?> update(@ApiParam(value="订单信息")@RequestBody JformOrderMainPage jformOrderMainPage) {
//调用JSR303 Bean Validator进行校验如果出错返回含400错误码及json格式的错误信息.
Set<ConstraintViolation<JformOrderMainPage>> failures = validator.validate(jformOrderMainPage);
if (!failures.isEmpty()) {
return new ResponseEntity(BeanValidators.extractPropertyAndMessage(failures), HttpStatus.BAD_REQUEST);
}
//保存
List<JformOrderCustomerEntity> jformOrderCustomerList = jformOrderMainPage.getJformOrderCustomerList();
List<JformOrderTicketEntity> jformOrderTicketList = jformOrderMainPage.getJformOrderTicketList();
JformOrderMainEntity jformOrderMain = new JformOrderMainEntity();
try{
MyBeanUtils.copyBeanNotNull2Bean(jformOrderMainPage,jformOrderMain);
}catch(Exception e){
logger.info(e.getMessage());
}
jformOrderMainService.updateMain(jformOrderMain, jformOrderCustomerList,jformOrderTicketList);
//按Restful约定返回204状态码, 无内容. 也可以返回200状态码.
return new ResponseEntity(HttpStatus.NO_CONTENT);
}
@RequestMapping(value = "/{id}", method = RequestMethod.DELETE)
@ResponseStatus(HttpStatus.NO_CONTENT)
@ApiOperation(value="删除订单")
public void delete(@PathVariable("id") String id) {
JformOrderMainEntity jformOrderMain = jformOrderMainService.get(JformOrderMainEntity.class, id);
jformOrderMainService.delMain(jformOrderMain);
}
/**
*
*
* @param id jformOrderMainid
*/
@RequestMapping(params = "getFiles")
@ResponseBody
public AjaxJson getFiles(String id){
List<CgUploadEntity> uploadBeans = cgFormFieldService.findByProperty(CgUploadEntity.class, "cgformId", id);
List<Map<String,Object>> files = new ArrayList<Map<String,Object>>(0);
for(CgUploadEntity b:uploadBeans){
String title = b.getAttachmenttitle();//附件名
String fileKey = b.getId();//附件主键
String path = b.getRealpath();//附件路径
String field = b.getCgformField();//表单中作为附件控件的字段
Map<String, Object> file = new HashMap<String, Object>();
file.put("title", title);
file.put("fileKey", fileKey);
file.put("path", path);
file.put("field", field==null?"":field);
files.add(file);
}
AjaxJson j = new AjaxJson();
j.setObj(files);
return j;
}
/**
*
* @param page
* @return
*/
@RequestMapping(params = "saveRows")
@ResponseBody
public AjaxJson saveRows(JformOrderCustomerPage page){
String message = "操作成功!";
List<JformOrderCustomerEntity> demos=page.getDemos();
AjaxJson j = new AjaxJson();
if(CollectionUtils.isNotEmpty(demos)){
for(JformOrderCustomerEntity jeecgDemo:demos){
if (StringUtil.isNotEmpty(jeecgDemo.getId())) {
JformOrderCustomerEntity t =this.systemService.get(JformOrderCustomerEntity.class, jeecgDemo.getId());
try {
MyBeanUtils.copyBeanNotNull2Bean(jeecgDemo, t);
systemService.saveOrUpdate(t);
systemService.addLog(message, Globals.Log_Type_UPDATE, Globals.Log_Leavel_INFO);
} catch (Exception e) {
e.printStackTrace();
}
} else {
try {
//jeecgDemo.setStatus("0");
systemService.save(jeecgDemo);
systemService.addLog(message, Globals.Log_Type_INSERT, Globals.Log_Leavel_INFO);
} catch (Exception e) {
e.printStackTrace();
}
}
}
}
return j;
}
/**
*
* @param req
* @return
*/
@RequestMapping(params = "departSelect")
public String departSelect(HttpServletRequest req) {
req.setAttribute("defaultName", req.getParameter("name"));
return "com/jeecg/demo/orderOne2Many/departSelect";
}
/**
*
* @param request
* @param response
* @return
*/
@RequestMapping(params = "getDepartInfo3")
@ResponseBody
public AjaxJson getDepartInfo3(HttpServletRequest request, HttpServletResponse response){
AjaxJson j = new AjaxJson();
net.sf.json.JSONArray jsonArray = new net.sf.json.JSONArray();
//String parentid = request.getParameter("parentid");
String sql = "select id,departname as name,ifnull(parentdepartid,0) as ppp_id,org_code as code from t_s_depart where 1=1 ";
List<Map<String,Object>> dateList = this.systemService.findForJdbc(sql);
Map<String,Map<String,Object>> dataMap = new HashMap<String,Map<String,Object>>();
//TODO 不应该每次都需要查询 建议从缓存中取到所有的list
String name = request.getParameter("name");
if(oConvertUtils.isNotEmpty(name)){
for (Map<String, Object> map : dateList) {
String temp = map.get("name").toString();
String id = map.get("id").toString();
if(temp.indexOf(name)>=0){
Object pid = map.get("ppp_id");
if(temp.equals(name)){
map.put("checked", true);
}
//判断是否有子节点 可用isleaf判断
sql = "select count(1) from t_s_depart t where t.parentdepartid = ?";
long count = this.systemService.getCountForJdbcParam(sql, new Object[]{id});
if(count>0){
map.put("isParent",true);
}
dataMap.put(id, map);
upwardQueryParents(dataMap, dateList, pid==null?"":pid.toString());
}
}
jsonArray = net.sf.json.JSONArray.fromObject(dataMap.values());
}else{
jsonArray = net.sf.json.JSONArray.fromObject(dateList);
}
j.setMsg(jsonArray.toString().replace("ppp_id", "pId"));
return j;
}
/**
*
* @param request
* @param response
* @return
*/
@RequestMapping(params = "getSubContent")
@ResponseBody
public AjaxJson getSubContent(HttpServletRequest request, HttpServletResponse response){
AjaxJson j = new AjaxJson();
String parentid = request.getParameter("parentid");
List<TSDepart> tSDeparts = new ArrayList<TSDepart>();
StringBuffer hql = new StringBuffer(" from TSDepart t where 1=1 ");
if(oConvertUtils.isNotEmpty(parentid)){
TSDepart dePart = this.systemService.getEntity(TSDepart.class, parentid);
hql.append(" and TSPDepart = ?");
tSDeparts = this.systemService.findHql(hql.toString(), dePart);
}
//TODO 不应该每次都需要查询 建议从缓存中取到所有的list 再筛选
List<Map<String,Object>> dateList = new ArrayList<Map<String,Object>>();
if(tSDeparts.size()>0){
Map<String,Object> map = null;
String sql = null;
Object[] params = null;
for(TSDepart depart:tSDeparts){
map = new HashMap<String,Object>();
map.put("id", depart.getId());
map.put("name", depart.getDepartname());
map.put("code",depart.getOrgCode());
TSDepart pdepart = depart.getTSPDepart();
if(pdepart!=null){
map.put("pId", pdepart.getId());
} else{
map.put("pId", "0");
}
//根据id判断是否有子节点
sql = "select count(1) from t_s_depart t where t.parentdepartid = ?";
params = new Object[]{depart.getId()};
long count = this.systemService.getCountForJdbcParam(sql, params);
if(count>0){
map.put("isParent",true);
}
dateList.add(map);
}
}
net.sf.json.JSONArray jsonArray = net.sf.json.JSONArray.fromObject(dateList);
j.setMsg(jsonArray.toString());
return j;
}
/**
*
*/
private void upwardQueryParents(Map<String,Map<String,Object>> dataMap,List<Map<String,Object>> dateList,String pid){
String pid_next = null;
for (Map<String, Object> map : dateList) {
String id = map.get("id").toString();
if(pid.equals(id)){
pid_next = map.get("ppp_id").toString();
dataMap.put(id, map);
break;
}
}
if(pid_next!=null && !pid_next.equals("0")){
upwardQueryParents(dataMap, dateList, pid_next);
}
}
}

@ -0,0 +1,458 @@
package com.jeecg.demo.controller;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Set;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.validation.ConstraintViolation;
import javax.validation.Validator;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.jeecgframework.core.beanvalidator.BeanValidators;
import org.jeecgframework.core.common.controller.BaseController;
import org.jeecgframework.core.common.exception.BusinessException;
import org.jeecgframework.core.common.hibernate.qbc.CriteriaQuery;
import org.jeecgframework.core.common.model.json.AjaxJson;
import org.jeecgframework.core.common.model.json.DataGrid;
import org.jeecgframework.core.constant.Globals;
import org.jeecgframework.core.util.ExceptionUtil;
import org.jeecgframework.core.util.MyBeanUtils;
import org.jeecgframework.core.util.ResourceUtil;
import org.jeecgframework.core.util.StringUtil;
import org.jeecgframework.core.util.oConvertUtils;
import org.jeecgframework.jwt.util.ResponseMessage;
import org.jeecgframework.jwt.util.Result;
import org.jeecgframework.poi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.entity.ExportParams;
import org.jeecgframework.poi.excel.entity.ImportParams;
import org.jeecgframework.poi.excel.entity.vo.NormalExcelConstants;
import org.jeecgframework.tag.core.easyui.TagUtil;
import org.jeecgframework.web.system.service.SystemService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
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;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
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.bind.annotation.ResponseStatus;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.util.UriComponentsBuilder;
import com.alibaba.fastjson.JSONArray;
import com.jeecg.demo.entity.JformOrderTicket2Entity;
import com.jeecg.demo.page.JformOrderMain2Page;
import com.jeecg.demo.service.JformOrderMain2ServiceI;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
/**
* @Title: Controller
* @Description:
* @author onlineGenerator
* @date 2018-03-27 17:03:29
* @version V1.0
*
*/
@Controller
@RequestMapping("/jformOrderTicket2Controller")
@Api(value="JformOrderTicket2",description="订单机票信息",tags="jformOrderTicket2Controller")
public class JformOrderTicket2Controller extends BaseController {
private static final Logger logger = LoggerFactory.getLogger(JformOrderTicket2Controller.class);
@Autowired
private JformOrderMain2ServiceI jformOrderMain2Service;
@Autowired
private SystemService systemService;
@Autowired
private Validator validator;
/**
*
*
* @return
*/
@RequestMapping(params = "list")
public ModelAndView list(HttpServletRequest request) {
return new ModelAndView("com/jeecg/demo/jformOrderMain2/jformOrderTicket2/list");
}
/**
* easyui AJAX
*
* @param request
* @param response
* @param dataGrid
* @param user
*/
@RequestMapping(params = "datagrid")
public void datagrid(JformOrderTicket2Entity jformOrderTicket2,HttpServletRequest request, HttpServletResponse response, DataGrid dataGrid) {
CriteriaQuery cq = new CriteriaQuery(JformOrderTicket2Entity.class, dataGrid);
String mainId = request.getParameter("mainId");
if(oConvertUtils.isNotEmpty(mainId)){
//查询条件组装器
org.jeecgframework.core.extend.hqlsearch.HqlGenerateUtil.installHql(cq, jformOrderTicket2, request.getParameterMap());
try{
//自定义追加查询条件
cq.eq("fckId", mainId);
}catch (Exception e) {
throw new BusinessException(e.getMessage());
}
cq.add();
this.jformOrderMain2Service.getDataGridReturn(cq, true);
}
TagUtil.datagrid(response, dataGrid);
}
/**
*
*
* @return
*/
@RequestMapping(params = "doDel")
@ResponseBody
public AjaxJson doDel(JformOrderTicket2Entity jformOrderTicket2, HttpServletRequest request) {
String message = null;
AjaxJson j = new AjaxJson();
jformOrderTicket2 = systemService.getEntity(JformOrderTicket2Entity.class, jformOrderTicket2.getId());
message = "订单机票信息删除成功";
try{
if(jformOrderTicket2!=null){
jformOrderMain2Service.delete(jformOrderTicket2);
systemService.addLog(message, Globals.Log_Type_DEL, Globals.Log_Leavel_INFO);
}
}catch(Exception e){
e.printStackTrace();
message = "订单机票信息删除失败";
throw new BusinessException(e.getMessage());
}
j.setMsg(message);
return j;
}
/**
*
*
* @return
*/
@RequestMapping(params = "doBatchDel")
@ResponseBody
public AjaxJson doBatchDel(String ids,HttpServletRequest request){
String message = null;
AjaxJson j = new AjaxJson();
message = "订单机票信息删除成功";
try{
for(String id:ids.split(",")){
JformOrderTicket2Entity jformOrderTicket2 = systemService.getEntity(JformOrderTicket2Entity.class,
id
);
if(jformOrderTicket2!=null){
jformOrderMain2Service.delete(jformOrderTicket2);
systemService.addLog(message, Globals.Log_Type_DEL, Globals.Log_Leavel_INFO);
}
}
}catch(Exception e){
e.printStackTrace();
message = "订单机票信息删除失败";
throw new BusinessException(e.getMessage());
}
j.setMsg(message);
return j;
}
/**
*
*
* @param ids
* @return
*/
@RequestMapping(params = "doAdd")
@ResponseBody
public AjaxJson doAdd(JformOrderTicket2Entity jformOrderTicket2, HttpServletRequest request) {
String message = null;
AjaxJson j = new AjaxJson();
message = "订单机票信息添加成功";
try{
jformOrderMain2Service.save(jformOrderTicket2);
systemService.addLog(message, Globals.Log_Type_INSERT, Globals.Log_Leavel_INFO);
}catch(Exception e){
e.printStackTrace();
message = "订单机票信息添加失败";
throw new BusinessException(e.getMessage());
}
j.setMsg(message);
return j;
}
/**
*
*
* @param ids
* @return
*/
@RequestMapping(params = "doUpdate")
@ResponseBody
public AjaxJson doUpdate(JformOrderTicket2Entity jformOrderTicket2, HttpServletRequest request) {
String message = null;
AjaxJson j = new AjaxJson();
message = "订单机票信息更新成功";
JformOrderTicket2Entity t = jformOrderMain2Service.get(JformOrderTicket2Entity.class, jformOrderTicket2.getId());
try {
MyBeanUtils.copyBeanNotNull2Bean(jformOrderTicket2, t);
jformOrderMain2Service.saveOrUpdate(t);
systemService.addLog(message, Globals.Log_Type_UPDATE, Globals.Log_Leavel_INFO);
} catch (Exception e) {
e.printStackTrace();
message = "订单机票信息更新失败";
throw new BusinessException(e.getMessage());
}
j.setMsg(message);
return j;
}
/**
*
*
* @return
*/
@RequestMapping(params = "goAdd")
public ModelAndView goAdd(JformOrderTicket2Entity jformOrderTicket2, HttpServletRequest req) {
if (StringUtil.isNotEmpty(jformOrderTicket2.getId())) {
jformOrderTicket2 = jformOrderMain2Service.getEntity(JformOrderTicket2Entity.class, jformOrderTicket2.getId());
req.setAttribute("jformOrderTicket2Page", jformOrderTicket2);
}
req.setAttribute("mainId", req.getParameter("mainId"));
return new ModelAndView("com/jeecg/demo/jformOrderMain2/jformOrderTicket2/add");
}
/**
*
*
* @return
*/
@RequestMapping(params = "goUpdate")
public ModelAndView goUpdate(JformOrderTicket2Entity jformOrderTicket2, HttpServletRequest req) {
if (StringUtil.isNotEmpty(jformOrderTicket2.getId())) {
jformOrderTicket2 = jformOrderMain2Service.getEntity(JformOrderTicket2Entity.class, jformOrderTicket2.getId());
req.setAttribute("jformOrderTicket2Page", jformOrderTicket2);
}
return new ModelAndView("com/jeecg/demo/jformOrderMain2/jformOrderTicket2/update");
}
/**
*
*
* @return
*/
@RequestMapping(params = "upload")
public ModelAndView upload(HttpServletRequest req) {
req.setAttribute("controller_name","jformOrderTicket2Controller");
return new ModelAndView("common/upload/pub_excel_upload");
}
/**
* excel
*
* @param request
* @param response
*/
@RequestMapping(params = "exportXls")
public String exportXls(JformOrderTicket2Entity jformOrderTicket2,HttpServletRequest request,HttpServletResponse response
, DataGrid dataGrid,ModelMap modelMap) {
CriteriaQuery cq = new CriteriaQuery(JformOrderTicket2Entity.class, dataGrid);
org.jeecgframework.core.extend.hqlsearch.HqlGenerateUtil.installHql(cq, jformOrderTicket2, request.getParameterMap());
List<JformOrderTicket2Entity> jformOrderTicket2s = this.jformOrderMain2Service.getListByCriteriaQuery(cq,false);
modelMap.put(NormalExcelConstants.FILE_NAME,"订单机票信息");
modelMap.put(NormalExcelConstants.CLASS,JformOrderTicket2Entity.class);
modelMap.put(NormalExcelConstants.PARAMS,new ExportParams("订单机票信息列表", "导出人:"+ResourceUtil.getSessionUser().getRealName(),
"导出信息"));
modelMap.put(NormalExcelConstants.DATA_LIST,jformOrderTicket2s);
return NormalExcelConstants.JEECG_EXCEL_VIEW;
}
/**
* excel 使
*
* @param request
* @param response
*/
@RequestMapping(params = "exportXlsByT")
public String exportXlsByT(JformOrderTicket2Entity jformOrderTicket2,HttpServletRequest request,HttpServletResponse response
, DataGrid dataGrid,ModelMap modelMap) {
modelMap.put(NormalExcelConstants.FILE_NAME,"订单机票信息");
modelMap.put(NormalExcelConstants.CLASS,JformOrderTicket2Entity.class);
modelMap.put(NormalExcelConstants.PARAMS,new ExportParams("订单机票信息列表", "导出人:"+ResourceUtil.getSessionUser().getRealName(),
"导出信息"));
modelMap.put(NormalExcelConstants.DATA_LIST,new ArrayList());
return NormalExcelConstants.JEECG_EXCEL_VIEW;
}
@SuppressWarnings("unchecked")
@RequestMapping(params = "importExcel", method = RequestMethod.POST)
@ResponseBody
public AjaxJson importExcel(HttpServletRequest request, HttpServletResponse response) {
AjaxJson j = new AjaxJson();
MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
MultipartFile file = entity.getValue();// 获取上传文件对象
ImportParams params = new ImportParams();
params.setTitleRows(2);
params.setHeadRows(1);
params.setNeedSave(true);
try {
List<JformOrderTicket2Entity> listJformOrderTicket2Entitys = ExcelImportUtil.importExcel(file.getInputStream(),JformOrderTicket2Entity.class,params);
for (JformOrderTicket2Entity jformOrderTicket2 : listJformOrderTicket2Entitys) {
jformOrderMain2Service.save(jformOrderTicket2);
}
j.setMsg("文件导入成功!");
} catch (Exception e) {
j.setMsg("文件导入失败!");
logger.error(ExceptionUtil.getExceptionMessage(e));
}finally{
try {
file.getInputStream().close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
return j;
}
/**
*
* @param page
* @param req
* @return
*/
@RequestMapping(params = "saveRows")
@ResponseBody
public AjaxJson saveRows(JformOrderMain2Page page,HttpServletRequest req){
String message = "操作成功!";
List<JformOrderTicket2Entity> lists=page.getJformOrderTicket2List();
AjaxJson j = new AjaxJson();
String mainId = req.getParameter("mainId");
if(CollectionUtils.isNotEmpty(lists)){
for(JformOrderTicket2Entity temp:lists){
if (StringUtil.isNotEmpty(temp.getId())) {
JformOrderTicket2Entity t =this.systemService.get(JformOrderTicket2Entity.class, temp.getId());
try {
MyBeanUtils.copyBeanNotNull2Bean(temp, t);
systemService.saveOrUpdate(t);
systemService.addLog(message, Globals.Log_Type_UPDATE, Globals.Log_Leavel_INFO);
} catch (Exception e) {
e.printStackTrace();
}
} else {
try {
//temp.setDelFlag(0);若有则需要加
temp.setFckId(mainId);
systemService.save(temp);
systemService.addLog(message, Globals.Log_Type_INSERT, Globals.Log_Leavel_INFO);
} catch (Exception e) {
e.printStackTrace();
}
}
}
}
return j;
}
@RequestMapping(method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value="订单机票信息列表信息",produces="application/json",httpMethod="GET")
public ResponseMessage<List<JformOrderTicket2Entity>> list() {
List<JformOrderTicket2Entity> listJformOrderTicket2s=jformOrderMain2Service.getList(JformOrderTicket2Entity.class);
return Result.success(listJformOrderTicket2s);
}
@RequestMapping(value = "/{id}", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value="根据ID获取订单机票信息信息",notes="根据ID获取订单机票信息信息",httpMethod="GET",produces="application/json")
public ResponseMessage<?> get(@ApiParam(required=true,name="id",value="ID")@PathVariable("id") String id) {
JformOrderTicket2Entity task = jformOrderMain2Service.get(JformOrderTicket2Entity.class, id);
if (task == null) {
return Result.error("根据ID获取订单机票信息信息为空");
}
return Result.success(task);
}
@RequestMapping(method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE)
@ResponseBody
@ApiOperation(value="创建订单机票信息")
public ResponseMessage<?> create(@ApiParam(name="订单机票信息对象")@RequestBody JformOrderTicket2Entity jformOrderTicket2, UriComponentsBuilder uriBuilder) {
//调用JSR303 Bean Validator进行校验如果出错返回含400错误码及json格式的错误信息.
Set<ConstraintViolation<JformOrderTicket2Entity>> failures = validator.validate(jformOrderTicket2);
if (!failures.isEmpty()) {
return Result.error(JSONArray.toJSONString(BeanValidators.extractPropertyAndMessage(failures)));
}
//保存
try{
jformOrderMain2Service.save(jformOrderTicket2);
} catch (Exception e) {
e.printStackTrace();
return Result.error("订单机票信息信息保存失败");
}
return Result.success(jformOrderTicket2);
}
@RequestMapping(value = "/{id}", method = RequestMethod.PUT, consumes = MediaType.APPLICATION_JSON_VALUE)
@ResponseBody
@ApiOperation(value="更新订单机票信息",notes="更新订单机票信息")
public ResponseMessage<?> update(@ApiParam(name="订单机票信息对象")@RequestBody JformOrderTicket2Entity jformOrderTicket2) {
//调用JSR303 Bean Validator进行校验如果出错返回含400错误码及json格式的错误信息.
Set<ConstraintViolation<JformOrderTicket2Entity>> failures = validator.validate(jformOrderTicket2);
if (!failures.isEmpty()) {
return Result.error(JSONArray.toJSONString(BeanValidators.extractPropertyAndMessage(failures)));
}
//保存
try{
jformOrderMain2Service.saveOrUpdate(jformOrderTicket2);
} catch (Exception e) {
e.printStackTrace();
return Result.error("更新订单机票信息信息失败");
}
//按Restful约定返回204状态码, 无内容. 也可以返回200状态码.
return Result.success("更新订单机票信息信息成功");
}
@RequestMapping(value = "/{id}", method = RequestMethod.DELETE)
@ResponseStatus(HttpStatus.NO_CONTENT)
@ApiOperation(value="删除订单机票信息")
public ResponseMessage<?> delete(@ApiParam(name="id",value="ID",required=true)@PathVariable("id") String id) {
logger.info("delete[{}]" , id);
// 验证
if (StringUtils.isEmpty(id)) {
return Result.error("ID不能为空");
}
try {
jformOrderMain2Service.deleteEntityById(JformOrderTicket2Entity.class, id);
} catch (Exception e) {
e.printStackTrace();
return Result.error("订单机票信息删除失败");
}
return Result.success();
}
}

@ -0,0 +1,520 @@
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.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Set;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.validation.ConstraintViolation;
import javax.validation.Validator;
import org.apache.commons.lang3.StringUtils;
import org.hibernate.criterion.Restrictions;
import org.jeecgframework.core.beanvalidator.BeanValidators;
import org.jeecgframework.core.common.controller.BaseController;
import org.jeecgframework.core.common.exception.BusinessException;
import org.jeecgframework.core.common.hibernate.qbc.CriteriaQuery;
import org.jeecgframework.core.common.model.json.AjaxJson;
import org.jeecgframework.core.common.model.json.DataGrid;
import org.jeecgframework.core.constant.Globals;
import org.jeecgframework.core.util.ExceptionUtil;
import org.jeecgframework.core.util.MyBeanUtils;
import org.jeecgframework.core.util.ResourceUtil;
import org.jeecgframework.core.util.StringUtil;
import org.jeecgframework.core.util.oConvertUtils;
import org.jeecgframework.jwt.util.ResponseMessage;
import org.jeecgframework.jwt.util.Result;
import org.jeecgframework.jwt.web.TokenController;
import org.jeecgframework.poi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.entity.ExportParams;
import org.jeecgframework.poi.excel.entity.ImportParams;
import org.jeecgframework.poi.excel.entity.vo.NormalExcelConstants;
import org.jeecgframework.tag.core.easyui.TagUtil;
import org.jeecgframework.web.system.service.SystemService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
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;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
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.bind.annotation.ResponseStatus;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.util.UriComponentsBuilder;
import com.alibaba.fastjson.JSONArray;
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 org.jeecgframework.web.superquery.util.SuperQueryUtil;
/**
* @Title: Controller
* @Description:
* @author onlineGenerator
* @date 2017-12-14 13:36:56
* @version V1.0
*
*/
//@Api(value="JfromOrder",description="订单列表",tags="jfromOrderController")
@Controller
@RequestMapping("/jfromOrderController")
public class JfromOrderController extends BaseController {
private static final Logger logger = LoggerFactory.getLogger(JfromOrderController.class);
@Autowired
private JfromOrderServiceI jfromOrderService;
@Autowired
private SystemService systemService;
@Autowired
private Validator validator;
/**
*
*
* @return
*/
@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
*
* @param request
* @param response
* @param dataGrid
* @param user
*/
@RequestMapping(params = "datagrid")
public void datagrid(JfromOrderEntity jfromOrder,HttpServletRequest request, HttpServletResponse response, DataGrid dataGrid) {
CriteriaQuery cq = new CriteriaQuery(JfromOrderEntity.class, dataGrid);
//查询条件组装器
org.jeecgframework.core.extend.hqlsearch.HqlGenerateUtil.installHql(cq, jfromOrder);
try{
String sql = SuperQueryUtil.getComplxSuperQuerySQL(request);
if(oConvertUtils.isNotEmpty(sql)) {
cq.add(Restrictions.sqlRestriction(" id in ("+sql+")"));
}
//自定义追加查询条件
}catch (Exception e) {
e.printStackTrace();
throw new BusinessException(e.getMessage());
}
cq.add();
this.jfromOrderService.getDataGridReturn(cq, true);
TagUtil.datagrid(response, dataGrid);
}
/**
*
*
* @return
*/
@RequestMapping(params = "doDel")
@ResponseBody
public AjaxJson doDel(JfromOrderEntity jfromOrder, HttpServletRequest request) {
AjaxJson j = new AjaxJson();
jfromOrder = systemService.getEntity(JfromOrderEntity.class, jfromOrder.getId());
String message = "订单列表删除成功";
try{
jfromOrderService.delMain(jfromOrder);
systemService.addLog(message, Globals.Log_Type_DEL, Globals.Log_Leavel_INFO);
}catch(Exception e){
e.printStackTrace();
message = "订单列表删除失败";
throw new BusinessException(e.getMessage());
}
j.setMsg(message);
return j;
}
/**
*
*
* @return
*/
@RequestMapping(params = "doBatchDel")
@ResponseBody
public AjaxJson doBatchDel(String ids,HttpServletRequest request){
AjaxJson j = new AjaxJson();
String message = "订单列表删除成功";
try{
for(String id:ids.split(",")){
JfromOrderEntity jfromOrder = systemService.getEntity(JfromOrderEntity.class,
id
);
jfromOrderService.delMain(jfromOrder);
systemService.addLog(message, Globals.Log_Type_DEL, Globals.Log_Leavel_INFO);
}
}catch(Exception e){
e.printStackTrace();
message = "订单列表删除失败";
throw new BusinessException(e.getMessage());
}
j.setMsg(message);
return j;
}
/**
*
*
* @param ids
* @return
*/
@RequestMapping(params = "doAdd")
@ResponseBody
public AjaxJson doAdd(JfromOrderEntity jfromOrder,JfromOrderPage jfromOrderPage, HttpServletRequest request) {
List<JfromOrderLineEntity> jfromOrderLineList = jfromOrderPage.getJfromOrderLineList();
AjaxJson j = new AjaxJson();
String message = "添加成功";
try{
jfromOrderService.addMain(jfromOrder, jfromOrderLineList);
systemService.addLog(message, Globals.Log_Type_INSERT, Globals.Log_Leavel_INFO);
}catch(Exception e){
e.printStackTrace();
message = "订单列表添加失败";
throw new BusinessException(e.getMessage());
}
j.setMsg(message);
return j;
}
/**
*
*
* @param ids
* @return
*/
@RequestMapping(params = "doUpdate")
@ResponseBody
public AjaxJson doUpdate(JfromOrderEntity jfromOrder,JfromOrderPage jfromOrderPage, HttpServletRequest request) {
List<JfromOrderLineEntity> jfromOrderLineList = jfromOrderPage.getJfromOrderLineList();
AjaxJson j = new AjaxJson();
String message = "更新成功";
try{
jfromOrderService.updateMain(jfromOrder, jfromOrderLineList);
systemService.addLog(message, Globals.Log_Type_UPDATE, Globals.Log_Leavel_INFO);
}catch(Exception e){
e.printStackTrace();
message = "更新订单列表失败";
throw new BusinessException(e.getMessage());
}
j.setMsg(message);
return j;
}
/**
*
*
* @return
*/
@RequestMapping(params = "goAdd")
public ModelAndView goAdd(JfromOrderEntity jfromOrder, HttpServletRequest req) {
if (StringUtil.isNotEmpty(jfromOrder.getId())) {
jfromOrder = jfromOrderService.getEntity(JfromOrderEntity.class, jfromOrder.getId());
req.setAttribute("jfromOrderPage", jfromOrder);
}
return new ModelAndView("com/jeecg/demo/jfromOrder-add");
}
/**
*
*
* @return
*/
@RequestMapping(params = "goUpdate")
public ModelAndView goUpdate(JfromOrderEntity jfromOrder, HttpServletRequest req) {
if (StringUtil.isNotEmpty(jfromOrder.getId())) {
jfromOrder = jfromOrderService.getEntity(JfromOrderEntity.class, jfromOrder.getId());
req.setAttribute("jfromOrderPage", jfromOrder);
}
return new ModelAndView("com/jeecg/demo/jfromOrder-update");
}
/**
* []
*
* @return
*/
@RequestMapping(params = "jfromOrderLineList")
public ModelAndView jfromOrderLineList(JfromOrderEntity jfromOrder, HttpServletRequest req) {
//===================================================================================
//获取参数
Object id0 = jfromOrder.getId();
//===================================================================================
//查询-订单表体
String hql0 = "from JfromOrderLineEntity where 1 = 1 AND oRDERID = ? ";
try{
List<JfromOrderLineEntity> jfromOrderLineEntityList = systemService.findHql(hql0,id0);
req.setAttribute("jfromOrderLineList", jfromOrderLineEntityList);
}catch(Exception e){
logger.info(e.getMessage());
}
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
*
* @param request
* @param response
*/
@RequestMapping(params = "exportXls")
public String exportXls(JfromOrderEntity jfromOrder,HttpServletRequest request, HttpServletResponse response, DataGrid dataGrid,ModelMap map) {
CriteriaQuery cq = new CriteriaQuery(JfromOrderEntity.class, dataGrid);
//查询条件组装器
org.jeecgframework.core.extend.hqlsearch.HqlGenerateUtil.installHql(cq, jfromOrder);
try{
//自定义追加查询条件
}catch (Exception e) {
throw new BusinessException(e.getMessage());
}
cq.add();
List<JfromOrderEntity> list=this.jfromOrderService.getListByCriteriaQuery(cq, false);
List<JfromOrderPage> pageList=new ArrayList<JfromOrderPage>();
if(list!=null&&list.size()>0){
for(JfromOrderEntity entity:list){
try{
JfromOrderPage page=new JfromOrderPage();
MyBeanUtils.copyBeanNotNull2Bean(entity,page);
Object id0 = entity.getId();
String hql0 = "from JfromOrderLineEntity where 1 = 1 AND oRDERID = ? ";
List<JfromOrderLineEntity> jfromOrderLineEntityList = systemService.findHql(hql0,id0);
page.setJfromOrderLineList(jfromOrderLineEntityList);
pageList.add(page);
}catch(Exception e){
logger.info(e.getMessage());
}
}
}
map.put(NormalExcelConstants.FILE_NAME,"订单列表");
map.put(NormalExcelConstants.CLASS,JfromOrderPage.class);
map.put(NormalExcelConstants.PARAMS,new ExportParams("订单列表列表", "导出人:Jeecg",
"导出信息"));
map.put(NormalExcelConstants.DATA_LIST,pageList);
return NormalExcelConstants.JEECG_EXCEL_VIEW;
}
/**
* excel
* @param request
* @param
* @return
*/
@RequestMapping(params = "importExcel", method = RequestMethod.POST)
@ResponseBody
public AjaxJson importExcel(HttpServletRequest request, HttpServletResponse response) {
AjaxJson j = new AjaxJson();
MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
MultipartFile file = entity.getValue();// 获取上传文件对象
ImportParams params = new ImportParams();
params.setTitleRows(2);
params.setHeadRows(2);
params.setNeedSave(true);
try {
List<JfromOrderPage> list = ExcelImportUtil.importExcel(file.getInputStream(), JfromOrderPage.class, params);
JfromOrderEntity entity1=null;
for (JfromOrderPage page : list) {
entity1=new JfromOrderEntity();
MyBeanUtils.copyBeanNotNull2Bean(page,entity1);
jfromOrderService.addMain(entity1, page.getJfromOrderLineList());
}
j.setMsg("文件导入成功!");
} catch (Exception e) {
j.setMsg("文件导入失败!");
logger.error(ExceptionUtil.getExceptionMessage(e));
}finally{
try {
file.getInputStream().close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
return j;
}
/**
* excel 使
*/
@RequestMapping(params = "exportXlsByT")
public String exportXlsByT(ModelMap map) {
map.put(NormalExcelConstants.FILE_NAME,"订单列表");
map.put(NormalExcelConstants.CLASS,JfromOrderPage.class);
map.put(NormalExcelConstants.PARAMS,new ExportParams("订单列表列表", "导出人:"+ ResourceUtil.getSessionUser().getRealName(),
"导出信息"));
map.put(NormalExcelConstants.DATA_LIST,new ArrayList());
return NormalExcelConstants.JEECG_EXCEL_VIEW;
}
/**
*
*
* @return
*/
@RequestMapping(params = "upload")
public ModelAndView upload(HttpServletRequest req) {
req.setAttribute("controller_name", "jfromOrderController");
return new ModelAndView("common/upload/pub_excel_upload");
}
@RequestMapping(method = RequestMethod.GET)
@ResponseBody
//@ApiOperation(value="订单列表列表信息",produces="application/json",httpMethod="GET")
public ResponseMessage<List<JfromOrderPage>> list() {
List<JfromOrderEntity> list= jfromOrderService.getList(JfromOrderEntity.class);
List<JfromOrderPage> pageList=new ArrayList<JfromOrderPage>();
if(list!=null&&list.size()>0){
for(JfromOrderEntity entity:list){
try{
JfromOrderPage page=new JfromOrderPage();
MyBeanUtils.copyBeanNotNull2Bean(entity,page);
Object id0 = entity.getId();
String hql0 = "from JfromOrderLineEntity where 1 = 1 AND oRDERID = ? ";
List<JfromOrderLineEntity> jfromOrderLineOldList = this.jfromOrderService.findHql(hql0,id0);
page.setJfromOrderLineList(jfromOrderLineOldList);
pageList.add(page);
}catch(Exception e){
logger.info(e.getMessage());
}
}
}
return Result.success(pageList);
}
@RequestMapping(value = "/{id}", method = RequestMethod.GET)
@ResponseBody
//@ApiOperation(value="根据ID获取订单列表信息",notes="根据ID获取订单列表信息",httpMethod="GET",produces="application/json")
public ResponseMessage<?> get(@ApiParam(required=true,name="id",value="ID")@PathVariable("id") String id) {
JfromOrderEntity task = jfromOrderService.get(JfromOrderEntity.class, id);
if (task == null) {
return Result.error("根据ID获取订单列表信息为空");
}
JfromOrderPage page = new JfromOrderPage();
try {
MyBeanUtils.copyBeanNotNull2Bean(task, page);
Object id0 = task.getId();
String hql0 = "from JfromOrderLineEntity where 1 = 1 AND oRDERID = ? ";
List<JfromOrderLineEntity> jfromOrderLineOldList = this.jfromOrderService.findHql(hql0,id0);
page.setJfromOrderLineList(jfromOrderLineOldList);
} catch (Exception e) {
e.printStackTrace();
}
return Result.success(page);
}
@RequestMapping(method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE)
@ResponseBody
//@ApiOperation(value="创建订单列表")
public ResponseMessage<?> create(@ApiParam(name="订单列表对象")@RequestBody JfromOrderPage jfromOrderPage, UriComponentsBuilder uriBuilder) {
//调用JSR303 Bean Validator进行校验如果出错返回含400错误码及json格式的错误信息.
Set<ConstraintViolation<JfromOrderPage>> failures = validator.validate(jfromOrderPage);
if (!failures.isEmpty()) {
return Result.error(JSONArray.toJSONString(BeanValidators.extractPropertyAndMessage(failures)));
}
//保存
List<JfromOrderLineEntity> jfromOrderLineList = jfromOrderPage.getJfromOrderLineList();
JfromOrderEntity jfromOrder = new JfromOrderEntity();
try{
MyBeanUtils.copyBeanNotNull2Bean(jfromOrderPage,jfromOrder);
}catch(Exception e){
logger.info(e.getMessage());
return Result.error("保存订单列表失败");
}
jfromOrderService.addMain(jfromOrder, jfromOrderLineList);
return Result.success(jfromOrder);
}
@RequestMapping(value = "/{id}", method = RequestMethod.PUT, consumes = MediaType.APPLICATION_JSON_VALUE)
@ResponseBody
//@ApiOperation(value="更新订单列表",notes="更新订单列表")
public ResponseMessage<?> update(@RequestBody JfromOrderPage jfromOrderPage) {
//调用JSR303 Bean Validator进行校验如果出错返回含400错误码及json格式的错误信息.
Set<ConstraintViolation<JfromOrderPage>> failures = validator.validate(jfromOrderPage);
if (!failures.isEmpty()) {
return Result.error(JSONArray.toJSONString(BeanValidators.extractPropertyAndMessage(failures)));
}
//保存
List<JfromOrderLineEntity> jfromOrderLineList = jfromOrderPage.getJfromOrderLineList();
JfromOrderEntity jfromOrder = new JfromOrderEntity();
try{
MyBeanUtils.copyBeanNotNull2Bean(jfromOrderPage,jfromOrder);
}catch(Exception e){
logger.info(e.getMessage());
return Result.error("订单列表更新失败");
}
jfromOrderService.updateMain(jfromOrder, jfromOrderLineList);
//按Restful约定返回204状态码, 无内容. 也可以返回200状态码.
return Result.success();
}
@RequestMapping(value = "/{id}", method = RequestMethod.DELETE)
@ResponseStatus(HttpStatus.NO_CONTENT)
//@ApiOperation(value="删除订单列表")
public ResponseMessage<?> delete(@ApiParam(name="id",value="ID",required=true)@PathVariable("id") String id) {
logger.info("delete[{}]" , id);
// 验证
if (StringUtils.isEmpty(id)) {
return Result.error("ID不能为空");
}
try {
JfromOrderEntity jfromOrder = jfromOrderService.get(JfromOrderEntity.class, id);
jfromOrderService.delMain(jfromOrder);
} catch (Exception e) {
e.printStackTrace();
return Result.error("订单列表删除失败");
}
return Result.success();
}
}

@ -0,0 +1,438 @@
package com.jeecg.demo.controller;
import com.jeecg.demo.entity.MultiUploadEntity;
import com.jeecg.demo.service.MultiUploadServiceI;
import java.util.ArrayList;
import java.util.List;
import java.text.SimpleDateFormat;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;
import org.jeecgframework.core.common.controller.BaseController;
import org.jeecgframework.core.common.exception.BusinessException;
import org.jeecgframework.core.common.hibernate.qbc.CriteriaQuery;
import org.jeecgframework.core.common.model.common.TreeChildCount;
import org.jeecgframework.core.common.model.json.AjaxJson;
import org.jeecgframework.core.common.model.json.DataGrid;
import org.jeecgframework.core.constant.Globals;
import org.jeecgframework.core.util.StringUtil;
import org.jeecgframework.tag.core.easyui.TagUtil;
import org.jeecgframework.web.system.pojo.base.TSDepart;
import org.jeecgframework.web.system.service.SystemService;
import org.jeecgframework.core.util.MyBeanUtils;
import java.io.OutputStream;
import org.jeecgframework.core.util.BrowserUtils;
import org.jeecgframework.poi.excel.ExcelExportUtil;
import org.jeecgframework.poi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.entity.ExportParams;
import org.jeecgframework.poi.excel.entity.ImportParams;
import org.jeecgframework.poi.excel.entity.TemplateExportParams;
import org.jeecgframework.poi.excel.entity.vo.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.vo.TemplateExcelConstants;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.jeecgframework.core.util.ResourceUtil;
import java.io.IOException;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import java.util.Map;
import java.util.HashMap;
import org.jeecgframework.core.util.ExceptionUtil;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
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.bind.annotation.ResponseStatus;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
import org.jeecgframework.core.beanvalidator.BeanValidators;
import java.util.Set;
import javax.validation.ConstraintViolation;
import javax.validation.Validator;
import java.net.URI;
import org.springframework.http.MediaType;
import org.springframework.web.util.UriComponentsBuilder;
import org.jeecgframework.web.cgform.entity.upload.CgUploadEntity;
import org.jeecgframework.web.cgform.service.config.CgFormFieldServiceI;
import java.util.HashMap;
/**
* @Title: Controller
* @Description:
* @author onlineGenerator
* @date 2017-07-17 10:50:36
* @version V1.0
*
*/
@Controller
@RequestMapping("/multiUploadController")
public class MultiUploadController extends BaseController {
/**
* Logger for this class
*/
private static final Logger logger = Logger.getLogger(MultiUploadController.class);
@Autowired
private MultiUploadServiceI multiUploadService;
@Autowired
private SystemService systemService;
@Autowired
private Validator validator;
@Autowired
private CgFormFieldServiceI cgFormFieldService;
/**
*
*
* @return
*/
@RequestMapping(params = "list")
public ModelAndView list(HttpServletRequest request) {
return new ModelAndView("com/jeecg/demo/multiUploadList");
}
/**
* easyui AJAX
*
* @param request
* @param response
* @param dataGrid
* @param user
*/
@RequestMapping(params = "datagrid")
public void datagrid(MultiUploadEntity multiUpload,HttpServletRequest request, HttpServletResponse response, DataGrid dataGrid) {
CriteriaQuery cq = new CriteriaQuery(MultiUploadEntity.class, dataGrid);
//查询条件组装器
org.jeecgframework.core.extend.hqlsearch.HqlGenerateUtil.installHql(cq, multiUpload, request.getParameterMap());
try{
//自定义追加查询条件
}catch (Exception e) {
throw new BusinessException(e.getMessage());
}
cq.add();
this.multiUploadService.getDataGridReturn(cq, true);
TagUtil.datagrid(response, dataGrid);
}
/**
*
*
* @return
*/
@RequestMapping(params = "doDel")
@ResponseBody
public AjaxJson doDel(MultiUploadEntity multiUpload, HttpServletRequest request) {
String message = null;
AjaxJson j = new AjaxJson();
multiUpload = systemService.getEntity(MultiUploadEntity.class, multiUpload.getId());
message = "测试多文件上传删除成功";
try{
multiUploadService.delete(multiUpload);
systemService.addLog(message, Globals.Log_Type_DEL, Globals.Log_Leavel_INFO);
}catch(Exception e){
e.printStackTrace();
message = "测试多文件上传删除失败";
throw new BusinessException(e.getMessage());
}
j.setMsg(message);
return j;
}
/**
*
*
* @return
*/
@RequestMapping(params = "doBatchDel")
@ResponseBody
public AjaxJson doBatchDel(String ids,HttpServletRequest request){
String message = null;
AjaxJson j = new AjaxJson();
message = "测试多文件上传删除成功";
try{
for(String id:ids.split(",")){
MultiUploadEntity multiUpload = systemService.getEntity(MultiUploadEntity.class,
id
);
multiUploadService.delete(multiUpload);
systemService.addLog(message, Globals.Log_Type_DEL, Globals.Log_Leavel_INFO);
}
}catch(Exception e){
e.printStackTrace();
message = "测试多文件上传删除失败";
throw new BusinessException(e.getMessage());
}
j.setMsg(message);
return j;
}
/**
*
*
* @param ids
* @return
*/
@RequestMapping(params = "doAdd")
@ResponseBody
public AjaxJson doAdd(MultiUploadEntity multiUpload, HttpServletRequest request) {
String message = null;
AjaxJson j = new AjaxJson();
message = "测试多文件上传添加成功";
try{
multiUploadService.save(multiUpload);
systemService.addLog(message, Globals.Log_Type_INSERT, Globals.Log_Leavel_INFO);
}catch(Exception e){
e.printStackTrace();
message = "测试多文件上传添加失败";
throw new BusinessException(e.getMessage());
}
j.setMsg(message);
j.setObj(multiUpload);
return j;
}
/**
*
*
* @param ids
* @return
*/
@RequestMapping(params = "doUpdate")
@ResponseBody
public AjaxJson doUpdate(MultiUploadEntity multiUpload, HttpServletRequest request) {
String message = null;
AjaxJson j = new AjaxJson();
message = "测试多文件上传更新成功";
MultiUploadEntity t = multiUploadService.get(MultiUploadEntity.class, multiUpload.getId());
try {
MyBeanUtils.copyBeanNotNull2Bean(multiUpload, t);
multiUploadService.saveOrUpdate(t);
systemService.addLog(message, Globals.Log_Type_UPDATE, Globals.Log_Leavel_INFO);
} catch (Exception e) {
e.printStackTrace();
message = "测试多文件上传更新失败";
throw new BusinessException(e.getMessage());
}
j.setMsg(message);
return j;
}
/**
*
*
* @return
*/
@RequestMapping(params = "goAdd")
public ModelAndView goAdd(MultiUploadEntity multiUpload, HttpServletRequest req) {
if (StringUtil.isNotEmpty(multiUpload.getId())) {
multiUpload = multiUploadService.getEntity(MultiUploadEntity.class, multiUpload.getId());
req.setAttribute("multiUploadPage", multiUpload);
}
return new ModelAndView("com/jeecg/demo/multiUpload-add");
}
/**
*
*
* @return
*/
@RequestMapping(params = "goUpdate")
public ModelAndView goUpdate(MultiUploadEntity multiUpload, HttpServletRequest req) {
if (StringUtil.isNotEmpty(multiUpload.getId())) {
multiUpload = multiUploadService.getEntity(MultiUploadEntity.class, multiUpload.getId());
req.setAttribute("multiUploadPage", multiUpload);
}
return new ModelAndView("com/jeecg/demo/multiUpload-update");
}
/**
*
*
* @return
*/
@RequestMapping(params = "upload")
public ModelAndView upload(HttpServletRequest req) {
req.setAttribute("controller_name","multiUploadController");
return new ModelAndView("common/upload/pub_excel_upload");
}
/**
* excel
*
* @param request
* @param response
*/
@RequestMapping(params = "exportXls")
public String exportXls(MultiUploadEntity multiUpload,HttpServletRequest request,HttpServletResponse response
, DataGrid dataGrid,ModelMap modelMap) {
CriteriaQuery cq = new CriteriaQuery(MultiUploadEntity.class, dataGrid);
org.jeecgframework.core.extend.hqlsearch.HqlGenerateUtil.installHql(cq, multiUpload, request.getParameterMap());
List<MultiUploadEntity> multiUploads = this.multiUploadService.getListByCriteriaQuery(cq,false);
modelMap.put(NormalExcelConstants.FILE_NAME,"测试多文件上传");
modelMap.put(NormalExcelConstants.CLASS,MultiUploadEntity.class);
modelMap.put(NormalExcelConstants.PARAMS,new ExportParams("测试多文件上传列表", "导出人:"+ResourceUtil.getSessionUser().getRealName(),
"导出信息"));
modelMap.put(NormalExcelConstants.DATA_LIST,multiUploads);
return NormalExcelConstants.JEECG_EXCEL_VIEW;
}
/**
* excel 使
*
* @param request
* @param response
*/
@RequestMapping(params = "exportXlsByT")
public String exportXlsByT(MultiUploadEntity multiUpload,HttpServletRequest request,HttpServletResponse response
, DataGrid dataGrid,ModelMap modelMap) {
modelMap.put(NormalExcelConstants.FILE_NAME,"测试多文件上传");
modelMap.put(NormalExcelConstants.CLASS,MultiUploadEntity.class);
modelMap.put(NormalExcelConstants.PARAMS,new ExportParams("测试多文件上传列表", "导出人:"+ResourceUtil.getSessionUser().getRealName(),
"导出信息"));
modelMap.put(NormalExcelConstants.DATA_LIST,new ArrayList());
return NormalExcelConstants.JEECG_EXCEL_VIEW;
}
@SuppressWarnings("unchecked")
@RequestMapping(params = "importExcel", method = RequestMethod.POST)
@ResponseBody
public AjaxJson importExcel(HttpServletRequest request, HttpServletResponse response) {
AjaxJson j = new AjaxJson();
MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
MultipartFile file = entity.getValue();// 获取上传文件对象
ImportParams params = new ImportParams();
params.setTitleRows(2);
params.setHeadRows(1);
params.setNeedSave(true);
try {
List<MultiUploadEntity> listMultiUploadEntitys = ExcelImportUtil.importExcel(file.getInputStream(),MultiUploadEntity.class,params);
for (MultiUploadEntity multiUpload : listMultiUploadEntitys) {
multiUploadService.save(multiUpload);
}
j.setMsg("文件导入成功!");
} catch (Exception e) {
j.setMsg("文件导入失败!");
logger.error(ExceptionUtil.getExceptionMessage(e));
}finally{
try {
file.getInputStream().close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
return j;
}
/**
*
*
* @param id multiUploadid
*/
@RequestMapping(params = "getFiles")
@ResponseBody
public AjaxJson getFiles(String id){
List<CgUploadEntity> uploadBeans = cgFormFieldService.findByProperty(CgUploadEntity.class, "cgformId", id);
List<Map<String,Object>> files = new ArrayList<Map<String,Object>>(0);
for(CgUploadEntity b:uploadBeans){
String title = b.getAttachmenttitle();//附件名
String fileKey = b.getId();//附件主键
String path = b.getRealpath();//附件路径
String field = b.getCgformField();//表单中作为附件控件的字段
Map<String, Object> file = new HashMap<String, Object>();
file.put("title", title);
file.put("fileKey", fileKey);
file.put("path", path);
file.put("field", field==null?"":field);
files.add(file);
}
AjaxJson j = new AjaxJson();
j.setObj(files);
return j;
}
@RequestMapping(method = RequestMethod.GET)
@ResponseBody
public List<MultiUploadEntity> list() {
List<MultiUploadEntity> listMultiUploads=multiUploadService.getList(MultiUploadEntity.class);
return listMultiUploads;
}
@RequestMapping(value = "/{id}", method = RequestMethod.GET)
@ResponseBody
public ResponseEntity<?> get(@PathVariable("id") String id) {
MultiUploadEntity task = multiUploadService.get(MultiUploadEntity.class, id);
if (task == null) {
return new ResponseEntity(HttpStatus.NOT_FOUND);
}
return new ResponseEntity(task, HttpStatus.OK);
}
@RequestMapping(method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE)
@ResponseBody
public ResponseEntity<?> create(@RequestBody MultiUploadEntity multiUpload, UriComponentsBuilder uriBuilder) {
//调用JSR303 Bean Validator进行校验如果出错返回含400错误码及json格式的错误信息.
Set<ConstraintViolation<MultiUploadEntity>> failures = validator.validate(multiUpload);
if (!failures.isEmpty()) {
return new ResponseEntity(BeanValidators.extractPropertyAndMessage(failures), HttpStatus.BAD_REQUEST);
}
//保存
try{
multiUploadService.save(multiUpload);
} catch (Exception e) {
e.printStackTrace();
return new ResponseEntity(HttpStatus.NO_CONTENT);
}
//按照Restful风格约定创建指向新任务的url, 也可以直接返回id或对象.
String id = multiUpload.getId();
URI uri = uriBuilder.path("/rest/multiUploadController/" + id).build().toUri();
HttpHeaders headers = new HttpHeaders();
headers.setLocation(uri);
return new ResponseEntity(headers, HttpStatus.CREATED);
}
@RequestMapping(value = "/{id}", method = RequestMethod.PUT, consumes = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<?> update(@RequestBody MultiUploadEntity multiUpload) {
//调用JSR303 Bean Validator进行校验如果出错返回含400错误码及json格式的错误信息.
Set<ConstraintViolation<MultiUploadEntity>> failures = validator.validate(multiUpload);
if (!failures.isEmpty()) {
return new ResponseEntity(BeanValidators.extractPropertyAndMessage(failures), HttpStatus.BAD_REQUEST);
}
//保存
try{
multiUploadService.saveOrUpdate(multiUpload);
} catch (Exception e) {
e.printStackTrace();
return new ResponseEntity(HttpStatus.NO_CONTENT);
}
//按Restful约定返回204状态码, 无内容. 也可以返回200状态码.
return new ResponseEntity(HttpStatus.NO_CONTENT);
}
@RequestMapping(value = "/{id}", method = RequestMethod.DELETE)
@ResponseStatus(HttpStatus.NO_CONTENT)
public void delete(@PathVariable("id") String id) {
multiUploadService.deleteEntityById(MultiUploadEntity.class, id);
}
}

@ -0,0 +1,45 @@
package com.jeecg.demo.dao;
import java.util.List;
import java.util.Map;
import org.jeecgframework.minidao.annotation.*;
import com.jeecg.demo.entity.JeecgDemoEntity;
import com.jeecg.demo.entity.JeecgLogReport;
import org.jeecgframework.minidao.pojo.MiniDaoPage;
/**
* Minidao
*
*/
@MiniDao
public interface JeecgMinidaoDao {
@Arguments("pid")
@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")
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("sort")String sort, @Param("order")String order,@Param("authSql") String authSql);
@Sql("select count(*) from jeecg_demo")
Integer getCount();
@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")
public java.lang.String getOrgCode(String id);
@Arguments("log")
@ResultType(JeecgLogReport.class)
List<JeecgLogReport> getLogReportData(JeecgLogReport log);
@Arguments("log")
List<Map<String, Object>> getLogChartData(JeecgLogReport log);
}

@ -0,0 +1,390 @@
package com.jeecg.demo.entity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import org.codehaus.jackson.map.annotate.JsonDeserialize;
import org.hibernate.annotations.GenericGenerator;
import org.jeecgframework.core.common.controller.CustomJsonDateDeserializer;
import org.jeecgframework.poi.excel.annotation.Excel;
/**
* @Title: Entity
* @Description: jeecg_demo
* @author onlineGenerator
* @date 2017-03-22 20:11:23
* @version V1.0
*
*/
@Entity
@Table(name = "jeecg_demo", schema = "")
@SuppressWarnings("serial")
public class JeecgDemoEntity implements java.io.Serializable {
/**id*/
private java.lang.String id;
/**名称*/
@Excel(name="名称",width=32)
private java.lang.String name;
/**年龄*/
@Excel(name="年龄")
private java.lang.Integer age;
/**生日*/
@Excel(name="生日",format = "yyyy-MM-dd")
private java.util.Date birthday;
/**个人介绍*/
@Excel(name="个人介绍")
private java.lang.String content;
/**部门*/
@Excel(name="部门",dictTable="t_s_depart",dicCode="id",dicText="departname")
private java.lang.String depId;
/**邮箱*/
@Excel(name="邮箱",width=32)
private java.lang.String email;
/**电话*/
@Excel(name="电话",width=12)
private java.lang.String phone;
/**工资*/
@Excel(name="工资",type=4)
private Double salary;
/**性别*/
@Excel(name="性别",dicCode="sex")
private java.lang.String sex;
/**入职状态*/
@Excel(name="入职状态",dicCode="sf_yn")
private java.lang.String status;
/**createDate*/
private java.util.Date createDate;
/**创建人id*/
private java.lang.String createBy;
/**创建人*/
private java.lang.String createName;
/**修改人id*/
private java.lang.String updateBy;
/**修改时间*/
private java.util.Date updateDate;
/**修改人*/
private java.lang.String updateName;
/** 组织 */
@Excel(name="部门编码",width=200)
private java.lang.String sysOrgCode;
/** 公司 */
private java.lang.String sysCompanyCode;
private java.lang.String touxiang;
private java.lang.String fujian;
/**
*: java.lang.String
*@return: java.lang.String id
*/
@Id
@GeneratedValue(generator = "paymentableGenerator")
@GenericGenerator(name = "paymentableGenerator", strategy = "uuid")
@Column(name ="ID",nullable=false,length=32)
public java.lang.String getId(){
return this.id;
}
/**
*: java.lang.String
*@param: java.lang.String id
*/
public void setId(java.lang.String id){
this.id = id;
}
/**
*: java.lang.String
*@return: java.lang.String
*/
@Column(name ="NAME",nullable=false,length=255)
public java.lang.String getName(){
return this.name;
}
/**
*: java.lang.String
*@param: java.lang.String
*/
public void setName(java.lang.String name){
this.name = name;
}
/**
*: java.lang.Integer
*@return: java.lang.Integer
*/
@Column(name ="AGE",nullable=true,length=10)
public java.lang.Integer getAge(){
return this.age;
}
/**
*: java.lang.Integer
*@param: java.lang.Integer
*/
public void setAge(java.lang.Integer age){
this.age = age;
}
/**
*: java.util.Date
*@return: java.util.Date
*/
@Column(name ="BIRTHDAY",nullable=true)
public java.util.Date getBirthday(){
return this.birthday;
}
/**
*: java.util.Date
*@param: java.util.Date
*/
@JsonDeserialize(using = CustomJsonDateDeserializer.class)
public void setBirthday(java.util.Date birthday){
this.birthday = birthday;
}
/**
*: java.lang.String
*@return: java.lang.String
*/
@Column(name ="CONTENT",nullable=true,length=255)
public java.lang.String getContent(){
return this.content;
}
/**
*: java.lang.String
*@param: java.lang.String
*/
public void setContent(java.lang.String content){
this.content = content;
}
/**
*: java.lang.String
*@return: java.lang.String
*/
@Column(name ="DEP_ID",nullable=true,length=255)
public java.lang.String getDepId(){
return this.depId;
}
/**
*: java.lang.String
*@param: java.lang.String
*/
public void setDepId(java.lang.String depId){
this.depId = depId;
}
/**
*: java.lang.String
*@return: java.lang.String
*/
@Column(name ="EMAIL",nullable=true,length=255)
public java.lang.String getEmail(){
return this.email;
}
/**
*: java.lang.String
*@param: java.lang.String
*/
public void setEmail(java.lang.String email){
this.email = email;
}
/**
*: java.lang.String
*@return: java.lang.String
*/
@Column(name ="PHONE",nullable=true,length=255)
public java.lang.String getPhone(){
return this.phone;
}
/**
*: java.lang.String
*@param: java.lang.String
*/
public void setPhone(java.lang.String phone){
this.phone = phone;
}
/**
*: java.lang.String
*@return: java.lang.String
*/
@Column(name ="SALARY",nullable=true,scale=2,length=19)
public Double getSalary(){
return this.salary;
}
/**
*: java.lang.String
*@param: java.lang.String
*/
public void setSalary(Double salary){
this.salary = salary;
}
/**
*: java.lang.String
*@return: java.lang.String
*/
@Column(name ="SEX",nullable=true,length=255)
public java.lang.String getSex(){
return this.sex;
}
/**
*: java.lang.String
*@param: java.lang.String
*/
public void setSex(java.lang.String sex){
this.sex = sex;
}
/**
*: java.lang.String
*@return: java.lang.String
*/
@Column(name ="STATUS",nullable=true,length=255)
public java.lang.String getStatus(){
return this.status;
}
/**
*: java.lang.String
*@param: java.lang.String
*/
public void setStatus(java.lang.String status){
this.status = status;
}
/**
*: java.util.Date
*@return: java.util.Date createDate
*/
@Column(name ="CREATE_DATE",nullable=true)
public java.util.Date getCreateDate(){
return this.createDate;
}
/**
*: java.util.Date
*@param: java.util.Date createDate
*/
@JsonDeserialize(using = CustomJsonDateDeserializer.class)
public void setCreateDate(java.util.Date createDate){
this.createDate = createDate;
}
/**
*: java.lang.String
*@return: java.lang.String id
*/
@Column(name ="CREATE_BY",nullable=true,length=32)
public java.lang.String getCreateBy(){
return this.createBy;
}
/**
*: java.lang.String
*@param: java.lang.String id
*/
public void setCreateBy(java.lang.String createBy){
this.createBy = createBy;
}
/**
*: java.lang.String
*@return: java.lang.String
*/
@Column(name ="CREATE_NAME",nullable=true,length=32)
public java.lang.String getCreateName(){
return this.createName;
}
/**
*: java.lang.String
*@param: java.lang.String
*/
public void setCreateName(java.lang.String createName){
this.createName = createName;
}
/**
*: java.lang.String
*@return: java.lang.String id
*/
@Column(name ="UPDATE_BY",nullable=true,length=32)
public java.lang.String getUpdateBy(){
return this.updateBy;
}
/**
*: java.lang.String
*@param: java.lang.String id
*/
public void setUpdateBy(java.lang.String updateBy){
this.updateBy = updateBy;
}
/**
*: java.util.Date
*@return: java.util.Date
*/
@Column(name ="UPDATE_DATE",nullable=true)
public java.util.Date getUpdateDate(){
return this.updateDate;
}
/**
*: java.util.Date
*@param: java.util.Date
*/
public void setUpdateDate(java.util.Date updateDate){
this.updateDate = updateDate;
}
/**
*: java.lang.String
*@return: java.lang.String
*/
@Column(name ="UPDATE_NAME",nullable=true,length=32)
public java.lang.String getUpdateName(){
return this.updateName;
}
/**
*: java.lang.String
*@param: java.lang.String
*/
public void setUpdateName(java.lang.String updateName){
this.updateName = updateName;
}
@Column(name = "sys_org_code", nullable = true, length = 15)
public java.lang.String getSysOrgCode() {
return sysOrgCode;
}
public void setSysOrgCode(java.lang.String sysOrgCode) {
this.sysOrgCode = sysOrgCode;
}
@Column(name = "sys_company_code", nullable = true, length = 15)
public java.lang.String getSysCompanyCode() {
return sysCompanyCode;
}
public void setSysCompanyCode(java.lang.String sysCompanyCode) {
this.sysCompanyCode = sysCompanyCode;
}
@Column(name = "touxiang", nullable = true, length = 255)
public java.lang.String getTouxiang() {
return touxiang;
}
public void setTouxiang(java.lang.String touxiang) {
this.touxiang = touxiang;
}
@Column(name = "fujian", nullable = true, length = 255)
public java.lang.String getFujian() {
return fujian;
}
public void setFujian(java.lang.String fujian) {
this.fujian = fujian;
}
}

@ -0,0 +1,168 @@
package com.jeecg.demo.entity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import org.hibernate.annotations.GenericGenerator;
import org.jeecgframework.poi.excel.annotation.Excel;
/**
* @Title: Entity
* @Description: excel
* @author onlineGenerator
* @date 2018-06-15 15:46:09
* @version V1.0
*
*/
@Entity
@Table(name = "jeecg_demo_excel", schema = "")
@SuppressWarnings("serial")
public class JeecgDemoExcelEntity implements java.io.Serializable {
/**主键*/
private java.lang.String id;
/**姓名*/
@Excel(name="姓名",width=15)
private java.lang.String name;
/**生日*/
@Excel(name="生日",format="yyyy-MM-dd")
private java.util.Date birthday;
/**性别*/
@Excel(name="性别",width=15,dicCode="sex")
private java.lang.String sex;
/**关联部门*/
@Excel(name="部门",dictTable="t_s_depart",dicCode="id",dicText="departname")
private java.lang.String depart;
/**测试替换*/
@Excel(name="测试替换",width=15,replace={"男_1","女_0"})
private java.lang.String fdReplace;
/**测试转换*/
@Excel(name="测试转换",width=15,exportConvert=true,importConvert=true)
private java.lang.String fdConvert;
/**
*: java.lang.String
*@return: java.lang.String
*/
@Id
@GeneratedValue(generator = "paymentableGenerator")
@GenericGenerator(name = "paymentableGenerator", strategy = "uuid")
@Column(name ="ID",nullable=false,length=36)
public java.lang.String getId(){
return this.id;
}
/**
*: java.lang.String
*@param: java.lang.String
*/
public void setId(java.lang.String id){
this.id = id;
}
/**
*: java.lang.String
*@return: java.lang.String
*/
@Column(name ="SEX",nullable=true,length=3)
public java.lang.String getSex(){
return this.sex;
}
/**
*: java.lang.String
*@param: java.lang.String
*/
public void setSex(java.lang.String sex){
this.sex = sex;
}
@Column(name ="name",nullable=true,length=100)
public java.lang.String getName() {
return name;
}
public void setName(java.lang.String name) {
this.name = name;
}
@Column(name ="birthday",nullable=true,length=20)
public java.util.Date getBirthday() {
return birthday;
}
public void setBirthday(java.util.Date birthday) {
this.birthday = birthday;
}
/**
*: java.lang.String
*@return: java.lang.String
*/
@Column(name ="DEPART",nullable=true,length=36)
public java.lang.String getDepart(){
return this.depart;
}
/**
*: java.lang.String
*@param: java.lang.String
*/
public void setDepart(java.lang.String depart){
this.depart = depart;
}
/**
*: java.lang.String
*@return: java.lang.String
*/
@Column(name ="FD_REPLACE",nullable=true,length=255)
public java.lang.String getFdReplace(){
return this.fdReplace;
}
/**
*: java.lang.String
*@param: java.lang.String
*/
public void setFdReplace(java.lang.String fdReplace){
this.fdReplace = fdReplace;
}
/**
*: java.lang.String
*@return: java.lang.String
*/
@Column(name ="FD_CONVERT",nullable=true,length=255)
public java.lang.String getFdConvert(){
return this.fdConvert;
}
/**
*: java.lang.String
*@param: java.lang.String
*/
public void setFdConvert(java.lang.String fdConvert){
this.fdConvert = fdConvert;
}
/**
*
* @return
*/
public String convertgetFdConvert(){
return this.fdConvert+"元";
}
/**
* excel"元"
* @return
*/
public void convertsetFdConvert(String fdConvert){
this.fdConvert = fdConvert.replace("元","");
}
}

@ -0,0 +1,17 @@
package com.jeecg.demo.entity;
import java.util.List;
/**
*/
public class JeecgDemoPage {
private List<JeecgDemoEntity> demos;
public List<JeecgDemoEntity> getDemos() {
return demos;
}
public void setDemos(List<JeecgDemoEntity> demos) {
this.demos = demos;
}
}

@ -0,0 +1,84 @@
package com.jeecg.demo.entity;
import java.util.Date;
public class JeecgLogReport {
private String id;
private String name;
private int ct;
private int loginct;
private int outct;
private int xgct;
public int getOutct() {
return outct;
}
public void setOutct(int outct) {
this.outct = outct;
}
public int getXgct() {
return xgct;
}
public void setXgct(int xgct) {
this.xgct = xgct;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getCt() {
return ct;
}
public void setCt(int ct) {
this.ct = ct;
}
public int getLoginct() {
return loginct;
}
public void setLoginct(int loginct) {
this.loginct = loginct;
}
private Date beginDate;
private Date endDate;
public Date getBeginDate() {
return beginDate;
}
public void setBeginDate(Date beginDate) {
this.beginDate = beginDate;
}
public Date getEndDate() {
return endDate;
}
public void setEndDate(Date endDate) {
this.endDate = endDate;
}
private int value;
private String color;
public int getValue() {
return value;
}
public void setValue(int value) {
this.value = value;
}
public String getColor() {
return color;
}
public void setColor(String color) {
this.color = color;
}
}

@ -0,0 +1,160 @@
package com.jeecg.demo.entity;
import java.math.BigDecimal;
import java.util.Date;
import java.lang.String;
import java.lang.Double;
import java.lang.Integer;
import java.math.BigDecimal;
import javax.xml.soap.Text;
import java.sql.Blob;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import org.hibernate.annotations.GenericGenerator;
import javax.persistence.SequenceGenerator;
import org.jeecgframework.poi.excel.annotation.Excel;
/**
* @Title: Entity
* @Description:
* @author onlineGenerator
* @date 2018-03-27 16:21:58
* @version V1.0
*
*/
@Entity
@Table(name = "jform_order_customer", schema = "")
@SuppressWarnings("serial")
public class JformOrderCustomer2Entity implements java.io.Serializable {
/**主键*/
private java.lang.String id;
/**客户名*/
@Excel(name="客户名",width=15)
private java.lang.String name;
/**单价*/
@Excel(name="单价",width=15)
private java.lang.Double money;
/**性别*/
@Excel(name="性别",width=15,dicCode="sex")
private java.lang.String sex;
/**电话*/
@Excel(name="电话",width=15)
private java.lang.String telphone;
/**外键*/
private java.lang.String fkId;
/**
*: java.lang.String
*@return: java.lang.String
*/
@Id
@GeneratedValue(generator = "paymentableGenerator")
@GenericGenerator(name = "paymentableGenerator", strategy = "uuid")
@Column(name ="ID",nullable=false,length=36)
public java.lang.String getId(){
return this.id;
}
/**
*: java.lang.String
*@param: java.lang.String
*/
public void setId(java.lang.String id){
this.id = id;
}
/**
*: java.lang.String
*@return: java.lang.String
*/
@Column(name ="NAME",nullable=true,length=32)
public java.lang.String getName(){
return this.name;
}
/**
*: java.lang.String
*@param: java.lang.String
*/
public void setName(java.lang.String name){
this.name = name;
}
/**
*: java.lang.Double
*@return: java.lang.Double
*/
@Column(name ="MONEY",nullable=true,scale=2,length=10)
public java.lang.Double getMoney(){
return this.money;
}
/**
*: java.lang.Double
*@param: java.lang.Double
*/
public void setMoney(java.lang.Double money){
this.money = money;
}
/**
*: java.lang.String
*@return: java.lang.String
*/
@Column(name ="SEX",nullable=true,length=4)
public java.lang.String getSex(){
return this.sex;
}
/**
*: java.lang.String
*@param: java.lang.String
*/
public void setSex(java.lang.String sex){
this.sex = sex;
}
/**
*: java.lang.String
*@return: java.lang.String
*/
@Column(name ="TELPHONE",nullable=true,length=32)
public java.lang.String getTelphone(){
return this.telphone;
}
/**
*: java.lang.String
*@param: java.lang.String
*/
public void setTelphone(java.lang.String telphone){
this.telphone = telphone;
}
/**
*: java.lang.String
*@return: java.lang.String
*/
@Column(name ="FK_ID",nullable=false,length=36)
public java.lang.String getFkId(){
return this.fkId;
}
/**
*: java.lang.String
*@param: java.lang.String
*/
public void setFkId(java.lang.String fkId){
this.fkId = fkId;
}
}

@ -0,0 +1,171 @@
package com.jeecg.demo.entity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import org.hibernate.annotations.GenericGenerator;
import org.jeecgframework.poi.excel.annotation.Excel;
/**
* @Title: Entity
* @Description: JformOrderMain
* @author onlineGenerator
* @date 2017-09-17 11:49:08
* @version V1.0
*
*/
@Entity
@Table(name = "jform_order_customer", schema = "")
@SuppressWarnings("serial")
public class JformOrderCustomerEntity implements java.io.Serializable {
/**主键*/
private java.lang.String id;
/**客户名*/
@Excel(name="客户名",width=15)
private java.lang.String name;
/**单价*/
@Excel(name="单价",width=15)
private java.lang.Double money;
/**性别*/
@Excel(name="性别",width=15,dicCode="sex")
private java.lang.String sex;
/**电话*/
@Excel(name="电话",width=15)
private java.lang.String telphone;
/**身份证扫描件*/
@Excel(name="身份证扫描件",width=15)
private java.lang.String sfPic;
/**外键*/
private java.lang.String fkId;
/**
*: java.lang.String
*@return: java.lang.String
*/
@Id
@GeneratedValue(generator = "paymentableGenerator")
@GenericGenerator(name = "paymentableGenerator", strategy = "uuid")
@Column(name ="ID",nullable=false,length=36)
public java.lang.String getId(){
return this.id;
}
/**
*: java.lang.String
*@param: java.lang.String
*/
public void setId(java.lang.String id){
this.id = id;
}
/**
*: java.lang.String
*@return: java.lang.String
*/
@Column(name ="NAME",nullable=true,length=100)
public java.lang.String getName(){
return this.name;
}
/**
*: java.lang.String
*@param: java.lang.String
*/
public void setName(java.lang.String name){
this.name = name;
}
/**
*: java.lang.Double
*@return: java.lang.Double
*/
@Column(name ="MONEY",nullable=true,scale=2,length=10)
public java.lang.Double getMoney(){
return this.money;
}
/**
*: java.lang.Double
*@param: java.lang.Double
*/
public void setMoney(java.lang.Double money){
this.money = money;
}
/**
*: java.lang.String
*@return: java.lang.String
*/
@Column(name ="SEX",nullable=true,length=4)
public java.lang.String getSex(){
return this.sex;
}
/**
*: java.lang.String
*@param: java.lang.String
*/
public void setSex(java.lang.String sex){
this.sex = sex;
}
/**
*: java.lang.String
*@return: java.lang.String
*/
@Column(name ="TELPHONE",nullable=true,length=32)
public java.lang.String getTelphone(){
return this.telphone;
}
/**
*: java.lang.String
*@param: java.lang.String
*/
public void setTelphone(java.lang.String telphone){
this.telphone = telphone;
}
/**
*: java.lang.String
*@return: java.lang.String
*/
@Column(name ="SF_PIC",nullable=true,length=500)
public java.lang.String getSfPic(){
return this.sfPic;
}
/**
*: java.lang.String
*@param: java.lang.String
*/
public void setSfPic(java.lang.String sfPic){
this.sfPic = sfPic;
}
/**
*: java.lang.String
*@return: java.lang.String
*/
@Column(name ="FK_ID",nullable=false,length=36)
public java.lang.String getFkId(){
return this.fkId;
}
/**
*: java.lang.String
*@param: java.lang.String
*/
public void setFkId(java.lang.String fkId){
this.fkId = fkId;
}
}

@ -0,0 +1,140 @@
package com.jeecg.demo.entity;
import java.math.BigDecimal;
import java.util.Date;
import java.lang.String;
import java.lang.Double;
import java.lang.Integer;
import java.math.BigDecimal;
import javax.xml.soap.Text;
import java.sql.Blob;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import org.hibernate.annotations.GenericGenerator;
import javax.persistence.SequenceGenerator;
import org.jeecgframework.poi.excel.annotation.Excel;
/**
* @Title: Entity
* @Description:
* @author onlineGenerator
* @date 2018-03-27 16:21:58
* @version V1.0
*
*/
@Entity
@Table(name = "jform_order_main", schema = "")
@SuppressWarnings("serial")
public class JformOrderMain2Entity implements java.io.Serializable {
/**主键*/
private java.lang.String id;
/**订单号*/
@Excel(name="订单号",width=15)
private java.lang.String orderCode;
/**订单日期*/
@Excel(name="订单日期",width=15,format = "yyyy-MM-dd")
private java.util.Date orderDate;
/**订单金额*/
@Excel(name="订单金额",width=15)
private java.lang.Double orderMoney;
/**备注*/
@Excel(name="备注",width=15)
private java.lang.String content;
/**
*: java.lang.String
*@return: java.lang.String
*/
@Id
@GeneratedValue(generator = "paymentableGenerator")
@GenericGenerator(name = "paymentableGenerator", strategy = "uuid")
@Column(name ="ID",nullable=false,length=36)
public java.lang.String getId(){
return this.id;
}
/**
*: java.lang.String
*@param: java.lang.String
*/
public void setId(java.lang.String id){
this.id = id;
}
/**
*: java.lang.String
*@return: java.lang.String
*/
@Column(name ="ORDER_CODE",nullable=true,length=50)
public java.lang.String getOrderCode(){
return this.orderCode;
}
/**
*: java.lang.String
*@param: java.lang.String
*/
public void setOrderCode(java.lang.String orderCode){
this.orderCode = orderCode;
}
/**
*: java.util.Date
*@return: java.util.Date
*/
@Column(name ="ORDER_DATE",nullable=true,length=20)
public java.util.Date getOrderDate(){
return this.orderDate;
}
/**
*: java.util.Date
*@param: java.util.Date
*/
public void setOrderDate(java.util.Date orderDate){
this.orderDate = orderDate;
}
/**
*: java.lang.Double
*@return: java.lang.Double
*/
@Column(name ="ORDER_MONEY",nullable=true,scale=3,length=10)
public java.lang.Double getOrderMoney(){
return this.orderMoney;
}
/**
*: java.lang.Double
*@param: java.lang.Double
*/
public void setOrderMoney(java.lang.Double orderMoney){
this.orderMoney = orderMoney;
}
/**
*: java.lang.String
*@return: java.lang.String
*/
@Column(name ="CONTENT",nullable=true,length=255)
public java.lang.String getContent(){
return this.content;
}
/**
*: java.lang.String
*@param: java.lang.String
*/
public void setContent(java.lang.String content){
this.content = content;
}
}

@ -0,0 +1,151 @@
package com.jeecg.demo.entity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import org.hibernate.annotations.GenericGenerator;
import org.jeecgframework.poi.excel.annotation.Excel;
/**
* @Title: Entity
* @Description:
* @author onlineGenerator
* @date 2017-09-17 11:49:08
* @version V1.0
*
*/
@Entity
@Table(name = "jform_order_main", schema = "")
@SuppressWarnings("serial")
public class JformOrderMainEntity implements java.io.Serializable {
/**主键*/
private java.lang.String id;
/**订单号*/
@Excel(name="订单号",width=15)
private java.lang.String orderCode;
/**订单日期*/
@Excel(name="订单日期",width=15,format = "yyyy-MM-dd")
private java.util.Date orderDate;
/**订单金额*/
@Excel(name="订单金额",width=15)
private java.lang.Double orderMoney;
/**备注*/
@Excel(name="备注",width=15)
private java.lang.String content;
/**订单扫描件*/
@Excel(name="订单扫描件",width=15,dicCode="sex")
private java.lang.String ctype;
/**
*: java.lang.String
*@return: java.lang.String
*/
@Id
@GeneratedValue(generator = "paymentableGenerator")
@GenericGenerator(name = "paymentableGenerator", strategy = "uuid")
@Column(name ="ID",nullable=false,length=36)
public java.lang.String getId(){
return this.id;
}
/**
*: java.lang.String
*@param: java.lang.String
*/
public void setId(java.lang.String id){
this.id = id;
}
/**
*: java.lang.String
*@return: java.lang.String
*/
@Column(name ="ORDER_CODE",nullable=true,length=50)
public java.lang.String getOrderCode(){
return this.orderCode;
}
/**
*: java.lang.String
*@param: java.lang.String
*/
public void setOrderCode(java.lang.String orderCode){
this.orderCode = orderCode;
}
/**
*: java.util.Date
*@return: java.util.Date
*/
@Column(name ="ORDER_DATE",nullable=true,length=20)
public java.util.Date getOrderDate(){
return this.orderDate;
}
/**
*: java.util.Date
*@param: java.util.Date
*/
public void setOrderDate(java.util.Date orderDate){
this.orderDate = orderDate;
}
/**
*: java.lang.Double
*@return: java.lang.Double
*/
@Column(name ="ORDER_MONEY",nullable=true,scale=3,length=10)
public java.lang.Double getOrderMoney(){
return this.orderMoney;
}
/**
*: java.lang.Double
*@param: java.lang.Double
*/
public void setOrderMoney(java.lang.Double orderMoney){
this.orderMoney = orderMoney;
}
/**
*: java.lang.String
*@return: java.lang.String
*/
@Column(name ="CONTENT",nullable=true,length=500)
public java.lang.String getContent(){
return this.content;
}
/**
*: java.lang.String
*@param: java.lang.String
*/
public void setContent(java.lang.String content){
this.content = content;
}
/**
*: java.lang.String
*@return: java.lang.String
*/
@Column(name ="CTYPE",nullable=true,length=500)
public java.lang.String getCtype(){
return this.ctype;
}
/**
*: java.lang.String
*@param: java.lang.String
*/
public void setCtype(java.lang.String ctype){
this.ctype = ctype;
}
}

@ -0,0 +1,118 @@
package com.jeecg.demo.entity;
import java.math.BigDecimal;
import java.util.Date;
import java.lang.String;
import java.lang.Double;
import java.lang.Integer;
import java.math.BigDecimal;
import javax.xml.soap.Text;
import java.sql.Blob;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import org.hibernate.annotations.GenericGenerator;
import javax.persistence.SequenceGenerator;
import org.jeecgframework.poi.excel.annotation.Excel;
/**
* @Title: Entity
* @Description:
* @author onlineGenerator
* @date 2018-03-27 16:21:58
* @version V1.0
*
*/
@Entity
@Table(name = "jform_order_ticket", schema = "")
@SuppressWarnings("serial")
public class JformOrderTicket2Entity implements java.io.Serializable {
/**主键*/
private java.lang.String id;
/**航班号*/
@Excel(name="航班号",width=15)
private java.lang.String ticketCode;
/**航班时间*/
@Excel(name="航班时间",width=15,format = "yyyy-MM-dd")
private java.util.Date tickectDate;
/**外键*/
private java.lang.String fckId;
/**
*: java.lang.String
*@return: java.lang.String
*/
@Id
@GeneratedValue(generator = "paymentableGenerator")
@GenericGenerator(name = "paymentableGenerator", strategy = "uuid")
@Column(name ="ID",nullable=false,length=36)
public java.lang.String getId(){
return this.id;
}
/**
*: java.lang.String
*@param: java.lang.String
*/
public void setId(java.lang.String id){
this.id = id;
}
/**
*: java.lang.String
*@return: java.lang.String
*/
@Column(name ="TICKET_CODE",nullable=false,length=100)
public java.lang.String getTicketCode(){
return this.ticketCode;
}
/**
*: java.lang.String
*@param: java.lang.String
*/
public void setTicketCode(java.lang.String ticketCode){
this.ticketCode = ticketCode;
}
/**
*: java.util.Date
*@return: java.util.Date
*/
@Column(name ="TICKECT_DATE",nullable=false,length=10)
public java.util.Date getTickectDate(){
return this.tickectDate;
}
/**
*: java.util.Date
*@param: java.util.Date
*/
public void setTickectDate(java.util.Date tickectDate){
this.tickectDate = tickectDate;
}
/**
*: java.lang.String
*@return: java.lang.String
*/
@Column(name ="FCK_ID",nullable=false,length=36)
public java.lang.String getFckId(){
return this.fckId;
}
/**
*: java.lang.String
*@param: java.lang.String
*/
public void setFckId(java.lang.String fckId){
this.fckId = fckId;
}
}

@ -0,0 +1,108 @@
package com.jeecg.demo.entity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import org.hibernate.annotations.GenericGenerator;
import org.jeecgframework.poi.excel.annotation.Excel;
/**
* @Title: Entity
* @Description: JformOrderMain
* @author onlineGenerator
* @date 2017-09-17 11:49:08
* @version V1.0
*
*/
@Entity
@Table(name = "jform_order_ticket", schema = "")
@SuppressWarnings("serial")
public class JformOrderTicketEntity implements java.io.Serializable {
/**主键*/
private java.lang.String id;
/**航班号*/
@Excel(name="航班号",width=15)
private java.lang.String ticketCode;
/**航班时间*/
@Excel(name="航班时间",width=15,format = "yyyy-MM-dd")
private java.util.Date tickectDate;
/**外键*/
private java.lang.String fckId;
/**
*: java.lang.String
*@return: java.lang.String
*/
@Id
@GeneratedValue(generator = "paymentableGenerator")
@GenericGenerator(name = "paymentableGenerator", strategy = "uuid")
@Column(name ="ID",nullable=false,length=36)
public java.lang.String getId(){
return this.id;
}
/**
*: java.lang.String
*@param: java.lang.String
*/
public void setId(java.lang.String id){
this.id = id;
}
/**
*: java.lang.String
*@return: java.lang.String
*/
@Column(name ="TICKET_CODE",nullable=false,length=100)
public java.lang.String getTicketCode(){
return this.ticketCode;
}
/**
*: java.lang.String
*@param: java.lang.String
*/
public void setTicketCode(java.lang.String ticketCode){
this.ticketCode = ticketCode;
}
/**
*: java.util.Date
*@return: java.util.Date
*/
@Column(name ="TICKECT_DATE",nullable=true,length=10)
public java.util.Date getTickectDate(){
return this.tickectDate;
}
/**
*: java.util.Date
*@param: java.util.Date
*/
public void setTickectDate(java.util.Date tickectDate){
this.tickectDate = tickectDate;
}
/**
*: java.lang.String
*@return: java.lang.String
*/
@Column(name ="FCK_ID",nullable=false,length=36)
public java.lang.String getFckId(){
return this.fckId;
}
/**
*: java.lang.String
*@param: java.lang.String
*/
public void setFckId(java.lang.String fckId){
this.fckId = fckId;
}
}

@ -0,0 +1,362 @@
package com.jeecg.demo.entity;
import java.math.BigDecimal;
import java.util.Date;
import java.lang.String;
import java.lang.Double;
import java.lang.Integer;
import java.math.BigDecimal;
import javax.xml.soap.Text;
import java.sql.Blob;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import org.hibernate.annotations.GenericGenerator;
import javax.persistence.SequenceGenerator;
import org.jeecgframework.poi.excel.annotation.Excel;
/**
* @Title: Entity
* @Description:
* @author onlineGenerator
* @date 2017-12-14 13:36:56
* @version V1.0
*
*/
@Entity
@Table(name = "jfrom_order", schema = "")
@SuppressWarnings("serial")
public class JfromOrderEntity implements java.io.Serializable {
/**主键*/
private java.lang.String id;
/**创建人名称*/
private java.lang.String createName;
/**创建人登录名称*/
private java.lang.String createBy;
/**创建日期*/
private java.util.Date createDate;
/**更新人名称*/
private java.lang.String updateName;
/**更新人登录名称*/
private java.lang.String updateBy;
/**更新日期*/
private java.util.Date updateDate;
/**所属部门*/
private java.lang.String sysOrgCode;
/**所属公司*/
private java.lang.String sysCompanyCode;
/**流程状态*/
private java.lang.String bpmStatus;
/**收货人*/
@Excel(name="收货人",width=15)
private java.lang.String receiverName;
/**联系电话*/
@Excel(name="联系电话",width=15)
private java.lang.String receiverMobile;
/**收货省*/
@Excel(name="收货省",width=15)
private java.lang.String receiverState;
/**收货市*/
@Excel(name="收货市",width=15)
private java.lang.String receiverCity;
/**收货区*/
@Excel(name="收货区",width=15)
private java.lang.String receiverDistrict;
/**收货地址*/
@Excel(name="收货地址",width=15)
private java.lang.String receiverAddress;
/**
*: java.lang.String
*@return: java.lang.String
*/
@Id
@GeneratedValue(generator = "paymentableGenerator")
@GenericGenerator(name = "paymentableGenerator", strategy = "uuid")
@Column(name ="ID",nullable=false,length=36)
public java.lang.String getId(){
return this.id;
}
/**
*: java.lang.String
*@param: java.lang.String
*/
public void setId(java.lang.String id){
this.id = id;
}
/**
*: java.lang.String
*@return: java.lang.String
*/
@Column(name ="CREATE_NAME",nullable=true,length=50)
public java.lang.String getCreateName(){
return this.createName;
}
/**
*: java.lang.String
*@param: java.lang.String
*/
public void setCreateName(java.lang.String createName){
this.createName = createName;
}
/**
*: java.lang.String
*@return: java.lang.String
*/
@Column(name ="CREATE_BY",nullable=true,length=50)
public java.lang.String getCreateBy(){
return this.createBy;
}
/**
*: java.lang.String
*@param: java.lang.String
*/
public void setCreateBy(java.lang.String createBy){
this.createBy = createBy;
}
/**
*: java.util.Date
*@return: java.util.Date
*/
@Column(name ="CREATE_DATE",nullable=true,length=20)
public java.util.Date getCreateDate(){
return this.createDate;
}
/**
*: java.util.Date
*@param: java.util.Date
*/
public void setCreateDate(java.util.Date createDate){
this.createDate = createDate;
}
/**
*: java.lang.String
*@return: java.lang.String
*/
@Column(name ="UPDATE_NAME",nullable=true,length=50)
public java.lang.String getUpdateName(){
return this.updateName;
}
/**
*: java.lang.String
*@param: java.lang.String
*/
public void setUpdateName(java.lang.String updateName){
this.updateName = updateName;
}
/**
*: java.lang.String
*@return: java.lang.String
*/
@Column(name ="UPDATE_BY",nullable=true,length=50)
public java.lang.String getUpdateBy(){
return this.updateBy;
}
/**
*: java.lang.String
*@param: java.lang.String
*/
public void setUpdateBy(java.lang.String updateBy){
this.updateBy = updateBy;
}
/**
*: java.util.Date
*@return: java.util.Date
*/
@Column(name ="UPDATE_DATE",nullable=true,length=20)
public java.util.Date getUpdateDate(){
return this.updateDate;
}
/**
*: java.util.Date
*@param: java.util.Date
*/
public void setUpdateDate(java.util.Date updateDate){
this.updateDate = updateDate;
}
/**
*: java.lang.String
*@return: java.lang.String
*/
@Column(name ="SYS_ORG_CODE",nullable=true,length=50)
public java.lang.String getSysOrgCode(){
return this.sysOrgCode;
}
/**
*: java.lang.String
*@param: java.lang.String
*/
public void setSysOrgCode(java.lang.String sysOrgCode){
this.sysOrgCode = sysOrgCode;
}
/**
*: java.lang.String
*@return: java.lang.String
*/
@Column(name ="SYS_COMPANY_CODE",nullable=true,length=50)
public java.lang.String getSysCompanyCode(){
return this.sysCompanyCode;
}
/**
*: java.lang.String
*@param: java.lang.String
*/
public void setSysCompanyCode(java.lang.String sysCompanyCode){
this.sysCompanyCode = sysCompanyCode;
}
/**
*: java.lang.String
*@return: java.lang.String
*/
@Column(name ="BPM_STATUS",nullable=true,length=32)
public java.lang.String getBpmStatus(){
return this.bpmStatus;
}
/**
*: java.lang.String
*@param: java.lang.String
*/
public void setBpmStatus(java.lang.String bpmStatus){
this.bpmStatus = bpmStatus;
}
/**
*: java.lang.String
*@return: java.lang.String
*/
@Column(name ="RECEIVER_NAME",nullable=true,length=56)
public java.lang.String getReceiverName(){
return this.receiverName;
}
/**
*: java.lang.String
*@param: java.lang.String
*/
public void setReceiverName(java.lang.String receiverName){
this.receiverName = receiverName;
}
/**
*: java.lang.String
*@return: java.lang.String
*/
@Column(name ="RECEIVER_MOBILE",nullable=true,length=32)
public java.lang.String getReceiverMobile(){
return this.receiverMobile;
}
/**
*: java.lang.String
*@param: java.lang.String
*/
public void setReceiverMobile(java.lang.String receiverMobile){
this.receiverMobile = receiverMobile;
}
/**
*: java.lang.String
*@return: java.lang.String
*/
@Column(name ="RECEIVER_STATE",nullable=true,length=32)
public java.lang.String getReceiverState(){
return this.receiverState;
}
/**
*: java.lang.String
*@param: java.lang.String
*/
public void setReceiverState(java.lang.String receiverState){
this.receiverState = receiverState;
}
/**
*: java.lang.String
*@return: java.lang.String
*/
@Column(name ="RECEIVER_CITY",nullable=true,length=32)
public java.lang.String getReceiverCity(){
return this.receiverCity;
}
/**
*: java.lang.String
*@param: java.lang.String
*/
public void setReceiverCity(java.lang.String receiverCity){
this.receiverCity = receiverCity;
}
/**
*: java.lang.String
*@return: java.lang.String
*/
@Column(name ="RECEIVER_DISTRICT",nullable=true,length=32)
public java.lang.String getReceiverDistrict(){
return this.receiverDistrict;
}
/**
*: java.lang.String
*@param: java.lang.String
*/
public void setReceiverDistrict(java.lang.String receiverDistrict){
this.receiverDistrict = receiverDistrict;
}
/**
*: java.lang.String
*@return: java.lang.String
*/
@Column(name ="RECEIVER_ADDRESS",nullable=true,length=128)
public java.lang.String getReceiverAddress(){
return this.receiverAddress;
}
/**
*: java.lang.String
*@param: java.lang.String
*/
public void setReceiverAddress(java.lang.String receiverAddress){
this.receiverAddress = receiverAddress;
}
}

@ -0,0 +1,340 @@
package com.jeecg.demo.entity;
import java.math.BigDecimal;
import java.util.Date;
import java.lang.String;
import java.lang.Double;
import java.lang.Integer;
import java.math.BigDecimal;
import javax.xml.soap.Text;
import java.sql.Blob;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import org.hibernate.annotations.GenericGenerator;
import javax.persistence.SequenceGenerator;
import org.jeecgframework.poi.excel.annotation.Excel;
/**
* @Title: Entity
* @Description:
* @author onlineGenerator
* @date 2017-12-14 13:36:56
* @version V1.0
*
*/
@Entity
@Table(name = "jfrom_order_line", schema = "")
@SuppressWarnings("serial")
public class JfromOrderLineEntity implements java.io.Serializable {
/**主键*/
private java.lang.String id;
/**创建人名称*/
private java.lang.String createName;
/**创建人登录名称*/
private java.lang.String createBy;
/**创建日期*/
private java.util.Date createDate;
/**更新人名称*/
private java.lang.String updateName;
/**更新人登录名称*/
private java.lang.String updateBy;
/**更新日期*/
private java.util.Date updateDate;
/**所属部门*/
private java.lang.String sysOrgCode;
/**所属公司*/
private java.lang.String sysCompanyCode;
/**流程状态*/
private java.lang.String bpmStatus;
/**订单ID*/
private java.lang.String orderid;
/**商品名称*/
@Excel(name="商品名称",width=15)
private java.lang.String itemName;
/**商品数量*/
@Excel(name="商品数量",width=15)
private java.lang.Integer qty;
/**商品价格*/
@Excel(name="商品价格",width=15)
private java.math.BigDecimal price;
/**金额*/
@Excel(name="金额",width=15)
private java.math.BigDecimal amount;
/**
*: java.lang.String
*@return: java.lang.String
*/
@Id
@GeneratedValue(generator = "paymentableGenerator")
@GenericGenerator(name = "paymentableGenerator", strategy = "uuid")
@Column(name ="ID",nullable=false,length=36)
public java.lang.String getId(){
return this.id;
}
/**
*: java.lang.String
*@param: java.lang.String
*/
public void setId(java.lang.String id){
this.id = id;
}
/**
*: java.lang.String
*@return: java.lang.String
*/
@Column(name ="CREATE_NAME",nullable=true,length=50)
public java.lang.String getCreateName(){
return this.createName;
}
/**
*: java.lang.String
*@param: java.lang.String
*/
public void setCreateName(java.lang.String createName){
this.createName = createName;
}
/**
*: java.lang.String
*@return: java.lang.String
*/
@Column(name ="CREATE_BY",nullable=true,length=50)
public java.lang.String getCreateBy(){
return this.createBy;
}
/**
*: java.lang.String
*@param: java.lang.String
*/
public void setCreateBy(java.lang.String createBy){
this.createBy = createBy;
}
/**
*: java.util.Date
*@return: java.util.Date
*/
@Column(name ="CREATE_DATE",nullable=true,length=20)
public java.util.Date getCreateDate(){
return this.createDate;
}
/**
*: java.util.Date
*@param: java.util.Date
*/
public void setCreateDate(java.util.Date createDate){
this.createDate = createDate;
}
/**
*: java.lang.String
*@return: java.lang.String
*/
@Column(name ="UPDATE_NAME",nullable=true,length=50)
public java.lang.String getUpdateName(){
return this.updateName;
}
/**
*: java.lang.String
*@param: java.lang.String
*/
public void setUpdateName(java.lang.String updateName){
this.updateName = updateName;
}
/**
*: java.lang.String
*@return: java.lang.String
*/
@Column(name ="UPDATE_BY",nullable=true,length=50)
public java.lang.String getUpdateBy(){
return this.updateBy;
}
/**
*: java.lang.String
*@param: java.lang.String
*/
public void setUpdateBy(java.lang.String updateBy){
this.updateBy = updateBy;
}
/**
*: java.util.Date
*@return: java.util.Date
*/
@Column(name ="UPDATE_DATE",nullable=true,length=20)
public java.util.Date getUpdateDate(){
return this.updateDate;
}
/**
*: java.util.Date
*@param: java.util.Date
*/
public void setUpdateDate(java.util.Date updateDate){
this.updateDate = updateDate;
}
/**
*: java.lang.String
*@return: java.lang.String
*/
@Column(name ="SYS_ORG_CODE",nullable=true,length=50)
public java.lang.String getSysOrgCode(){
return this.sysOrgCode;
}
/**
*: java.lang.String
*@param: java.lang.String
*/
public void setSysOrgCode(java.lang.String sysOrgCode){
this.sysOrgCode = sysOrgCode;
}
/**
*: java.lang.String
*@return: java.lang.String
*/
@Column(name ="SYS_COMPANY_CODE",nullable=true,length=50)
public java.lang.String getSysCompanyCode(){
return this.sysCompanyCode;
}
/**
*: java.lang.String
*@param: java.lang.String
*/
public void setSysCompanyCode(java.lang.String sysCompanyCode){
this.sysCompanyCode = sysCompanyCode;
}
/**
*: java.lang.String
*@return: java.lang.String
*/
@Column(name ="BPM_STATUS",nullable=true,length=32)
public java.lang.String getBpmStatus(){
return this.bpmStatus;
}
/**
*: java.lang.String
*@param: java.lang.String
*/
public void setBpmStatus(java.lang.String bpmStatus){
this.bpmStatus = bpmStatus;
}
/**
*: java.lang.String
*@return: java.lang.String ID
*/
@Column(name ="ORDERID",nullable=true,length=36)
public java.lang.String getOrderid(){
return this.orderid;
}
/**
*: java.lang.String
*@param: java.lang.String ID
*/
public void setOrderid(java.lang.String orderid){
this.orderid = orderid;
}
/**
*: java.lang.String
*@return: java.lang.String
*/
@Column(name ="ITEM_NAME",nullable=true,length=128)
public java.lang.String getItemName(){
return this.itemName;
}
/**
*: java.lang.String
*@param: java.lang.String
*/
public void setItemName(java.lang.String itemName){
this.itemName = itemName;
}
/**
*: java.lang.Integer
*@return: java.lang.Integer
*/
@Column(name ="QTY",nullable=true,length=32)
public java.lang.Integer getQty(){
return this.qty;
}
/**
*: java.lang.Integer
*@param: java.lang.Integer
*/
public void setQty(java.lang.Integer qty){
this.qty = qty;
}
/**
*: java.math.BigDecimal
*@return: java.math.BigDecimal
*/
@Column(name ="PRICE",nullable=true,length=32)
public java.math.BigDecimal getPrice(){
return this.price;
}
/**
*: java.math.BigDecimal
*@param: java.math.BigDecimal
*/
public void setPrice(java.math.BigDecimal price){
this.price = price;
}
/**
*: java.math.BigDecimal
*@return: java.math.BigDecimal
*/
@Column(name ="AMOUNT",nullable=true,length=32)
public java.math.BigDecimal getAmount(){
return this.amount;
}
/**
*: java.math.BigDecimal
*@param: java.math.BigDecimal
*/
public void setAmount(java.math.BigDecimal amount){
this.amount = amount;
}
}

@ -0,0 +1,287 @@
package com.jeecg.demo.entity;
import java.math.BigDecimal;
import java.util.Date;
import java.lang.String;
import java.lang.Double;
import java.lang.Integer;
import java.math.BigDecimal;
import javax.xml.soap.Text;
import java.sql.Blob;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import org.hibernate.annotations.GenericGenerator;
import javax.persistence.SequenceGenerator;
import org.jeecgframework.poi.excel.annotation.Excel;
/**
* @Title: Entity
* @Description:
* @author onlineGenerator
* @date 2017-07-17 10:50:36
* @version V1.0
*
*/
@Entity
@Table(name = "jeecg_multi_upload", schema = "")
@SuppressWarnings("serial")
public class MultiUploadEntity implements java.io.Serializable {
/**主键*/
private java.lang.String id;
/**创建人名称*/
private java.lang.String createName;
/**创建人登录名称*/
private java.lang.String createBy;
/**创建日期*/
private java.util.Date createDate;
/**更新人名称*/
private java.lang.String updateName;
/**更新人登录名称*/
private java.lang.String updateBy;
/**更新日期*/
private java.util.Date updateDate;
/**所属部门*/
private java.lang.String sysOrgCode;
/**所属公司*/
private java.lang.String sysCompanyCode;
/**流程状态*/
private java.lang.String bpmStatus;
/**测试文件1*/
@Excel(name="测试文件1",width=15)
private java.lang.String testFile1;
/**测试文件2*/
@Excel(name="测试文件2",width=15)
private java.lang.String testFile2;
/**测试文件3*/
@Excel(name="测试文件3",width=15)
private java.lang.String testFile3;
/**
*: java.lang.String
*@return: java.lang.String
*/
@Id
@GeneratedValue(generator = "paymentableGenerator")
@GenericGenerator(name = "paymentableGenerator", strategy = "uuid")
@Column(name ="ID",nullable=false,length=36)
public java.lang.String getId(){
return this.id;
}
/**
*: java.lang.String
*@param: java.lang.String
*/
public void setId(java.lang.String id){
this.id = id;
}
/**
*: java.lang.String
*@return: java.lang.String
*/
@Column(name ="CREATE_NAME",nullable=true,length=50)
public java.lang.String getCreateName(){
return this.createName;
}
/**
*: java.lang.String
*@param: java.lang.String
*/
public void setCreateName(java.lang.String createName){
this.createName = createName;
}
/**
*: java.lang.String
*@return: java.lang.String
*/
@Column(name ="CREATE_BY",nullable=true,length=50)
public java.lang.String getCreateBy(){
return this.createBy;
}
/**
*: java.lang.String
*@param: java.lang.String
*/
public void setCreateBy(java.lang.String createBy){
this.createBy = createBy;
}
/**
*: java.util.Date
*@return: java.util.Date
*/
@Column(name ="CREATE_DATE",nullable=true,length=20)
public java.util.Date getCreateDate(){
return this.createDate;
}
/**
*: java.util.Date
*@param: java.util.Date
*/
public void setCreateDate(java.util.Date createDate){
this.createDate = createDate;
}
/**
*: java.lang.String
*@return: java.lang.String
*/
@Column(name ="UPDATE_NAME",nullable=true,length=50)
public java.lang.String getUpdateName(){
return this.updateName;
}
/**
*: java.lang.String
*@param: java.lang.String
*/
public void setUpdateName(java.lang.String updateName){
this.updateName = updateName;
}
/**
*: java.lang.String
*@return: java.lang.String
*/
@Column(name ="UPDATE_BY",nullable=true,length=50)
public java.lang.String getUpdateBy(){
return this.updateBy;
}
/**
*: java.lang.String
*@param: java.lang.String
*/
public void setUpdateBy(java.lang.String updateBy){
this.updateBy = updateBy;
}
/**
*: java.util.Date
*@return: java.util.Date
*/
@Column(name ="UPDATE_DATE",nullable=true,length=20)
public java.util.Date getUpdateDate(){
return this.updateDate;
}
/**
*: java.util.Date
*@param: java.util.Date
*/
public void setUpdateDate(java.util.Date updateDate){
this.updateDate = updateDate;
}
/**
*: java.lang.String
*@return: java.lang.String
*/
@Column(name ="SYS_ORG_CODE",nullable=true,length=50)
public java.lang.String getSysOrgCode(){
return this.sysOrgCode;
}
/**
*: java.lang.String
*@param: java.lang.String
*/
public void setSysOrgCode(java.lang.String sysOrgCode){
this.sysOrgCode = sysOrgCode;
}
/**
*: java.lang.String
*@return: java.lang.String
*/
@Column(name ="SYS_COMPANY_CODE",nullable=true,length=50)
public java.lang.String getSysCompanyCode(){
return this.sysCompanyCode;
}
/**
*: java.lang.String
*@param: java.lang.String
*/
public void setSysCompanyCode(java.lang.String sysCompanyCode){
this.sysCompanyCode = sysCompanyCode;
}
/**
*: java.lang.String
*@return: java.lang.String
*/
@Column(name ="BPM_STATUS",nullable=true,length=32)
public java.lang.String getBpmStatus(){
return this.bpmStatus;
}
/**
*: java.lang.String
*@param: java.lang.String
*/
public void setBpmStatus(java.lang.String bpmStatus){
this.bpmStatus = bpmStatus;
}
/**
*: java.lang.String
*@return: java.lang.String 1
*/
@Column(name ="TEST_FILE_1",nullable=true,length=256)
public java.lang.String getTestFile1(){
return this.testFile1;
}
/**
*: java.lang.String
*@param: java.lang.String 1
*/
public void setTestFile1(java.lang.String testFile1){
this.testFile1 = testFile1;
}
/**
*: java.lang.String
*@return: java.lang.String 2
*/
@Column(name ="TEST_FILE_2",nullable=true,length=256)
public java.lang.String getTestFile2(){
return this.testFile2;
}
/**
*: java.lang.String
*@param: java.lang.String 2
*/
public void setTestFile2(java.lang.String testFile2){
this.testFile2 = testFile2;
}
/**
*: java.lang.String
*@return: java.lang.String 3
*/
@Column(name ="TEST_FILE_3",nullable=true,length=256)
public java.lang.String getTestFile3(){
return this.testFile3;
}
/**
*: java.lang.String
*@param: java.lang.String 3
*/
public void setTestFile3(java.lang.String testFile3){
this.testFile3 = testFile3;
}
}

@ -1,13 +1,10 @@
package org.jeecgframework.web.system.pojo.base;
package com.jeecg.demo.entity;
// default package
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.PrimaryKeyJoinColumn;
import javax.persistence.Table;
import javax.persistence.*;
import org.jeecgframework.web.system.pojo.base.TSAttachment;
import org.jeecgframework.web.system.pojo.base.TSType;
/**
* ,,
@ -22,6 +19,7 @@ public class TSDocument extends TSAttachment implements java.io.Serializable {
private Short documentState;//状态0未发布1已发布
private Short showHome;//是否首页显示
private TSType TSType;//文档分类
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "typeid")
public TSType getTSType() {

@ -0,0 +1,23 @@
package com.jeecg.demo.page;
import java.util.List;
import com.jeecg.demo.entity.JformOrderCustomerEntity;
/**
*
*/
public class JformOrderCustomerPage {
private List<JformOrderCustomerEntity> demos;
public List<JformOrderCustomerEntity> getDemos() {
return demos;
}
public void setDemos(List<JformOrderCustomerEntity> demos) {
this.demos = demos;
}
}

@ -0,0 +1,139 @@
package com.jeecg.demo.page;
import java.util.ArrayList;
import java.util.List;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.jeecgframework.poi.excel.annotation.ExcelCollection;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.jeecg.demo.entity.JformOrderCustomer2Entity;
import com.jeecg.demo.entity.JformOrderMain2Entity;
import com.jeecg.demo.entity.JformOrderTicket2Entity;
/**
* @Title: Entity
* @Description:
* @author onlineGenerator
* @date 2018-03-27 16:21:58
* @version V1.0
*
*/
public class JformOrderMain2Page implements java.io.Serializable {
/**主键*/
private java.lang.String id;
/**订单号*/
@Excel(name="订单号")
private java.lang.String orderCode;
/**订单日期*/
@Excel(name="订单日期",format = "yyyy-MM-dd")
private java.util.Date orderDate;
/**订单金额*/
@Excel(name="订单金额")
private java.lang.Double orderMoney;
/**备注*/
@Excel(name="备注")
private java.lang.String content;
/**
*: java.lang.String
*@return: java.lang.String
*/
public java.lang.String getId(){
return this.id;
}
/**
*: java.lang.String
*@param: java.lang.String
*/
public void setId(java.lang.String id){
this.id = id;
}
/**
*: java.lang.String
*@return: java.lang.String
*/
public java.lang.String getOrderCode(){
return this.orderCode;
}
/**
*: java.lang.String
*@param: java.lang.String
*/
public void setOrderCode(java.lang.String orderCode){
this.orderCode = orderCode;
}
/**
*: java.util.Date
*@return: java.util.Date
*/
public java.util.Date getOrderDate(){
return this.orderDate;
}
/**
*: java.util.Date
*@param: java.util.Date
*/
public void setOrderDate(java.util.Date orderDate){
this.orderDate = orderDate;
}
/**
*: java.lang.Double
*@return: java.lang.Double
*/
public java.lang.Double getOrderMoney(){
return this.orderMoney;
}
/**
*: java.lang.Double
*@param: java.lang.Double
*/
public void setOrderMoney(java.lang.Double orderMoney){
this.orderMoney = orderMoney;
}
/**
*: java.lang.String
*@return: java.lang.String
*/
public java.lang.String getContent(){
return this.content;
}
/**
*: java.lang.String
*@param: java.lang.String
*/
public void setContent(java.lang.String content){
this.content = content;
}
/**保存-订单机票信息*/
@ExcelCollection(name="订单机票信息")
private List<JformOrderTicket2Entity> jformOrderTicket2List = new ArrayList<JformOrderTicket2Entity>();
public List<JformOrderTicket2Entity> getJformOrderTicket2List() {
return jformOrderTicket2List;
}
public void setJformOrderTicket2List(List<JformOrderTicket2Entity> jformOrderTicket2List) {
this.jformOrderTicket2List = jformOrderTicket2List;
}
/**保存-订单客户信息*/
@ExcelCollection(name="订单客户信息")
private List<JformOrderCustomer2Entity> jformOrderCustomer2List = new ArrayList<JformOrderCustomer2Entity>();
public List<JformOrderCustomer2Entity> getJformOrderCustomer2List() {
return jformOrderCustomer2List;
}
public void setJformOrderCustomer2List(List<JformOrderCustomer2Entity> jformOrderCustomer2List) {
this.jformOrderCustomer2List = jformOrderCustomer2List;
}
@JsonIgnore
private List<JformOrderMain2Entity> jformOrderMain2List = new ArrayList<JformOrderMain2Entity>();
public List<JformOrderMain2Entity> getJformOrderMain2List() {
return jformOrderMain2List;
}
public void setJformOrderMain2List(List<JformOrderMain2Entity> jformOrderMain2List) {
this.jformOrderMain2List = jformOrderMain2List;
}
}

@ -0,0 +1,152 @@
package com.jeecg.demo.page;
import java.util.ArrayList;
import java.util.List;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.jeecgframework.poi.excel.annotation.ExcelCollection;
import com.jeecg.demo.entity.JformOrderCustomerEntity;
import com.jeecg.demo.entity.JformOrderTicketEntity;
/**
* @Title: Entity
* @Description:
* @author onlineGenerator
* @date 2017-09-17 11:49:08
* @version V1.0
*
*/
public class JformOrderMainPage implements java.io.Serializable {
/**主键*/
private java.lang.String id;
/**订单号*/
@Excel(name="订单号")
private java.lang.String orderCode;
/**订单日期*/
@Excel(name="订单日期",format = "yyyy-MM-dd")
private java.util.Date orderDate;
/**订单金额*/
@Excel(name="订单金额")
private java.lang.Double orderMoney;
/**备注*/
@Excel(name="备注")
private java.lang.String content;
/**订单扫描件*/
@Excel(name="订单扫描件")
private java.lang.String ctype;
/**
*: java.lang.String
*@return: java.lang.String
*/
public java.lang.String getId(){
return this.id;
}
/**
*: java.lang.String
*@param: java.lang.String
*/
public void setId(java.lang.String id){
this.id = id;
}
/**
*: java.lang.String
*@return: java.lang.String
*/
public java.lang.String getOrderCode(){
return this.orderCode;
}
/**
*: java.lang.String
*@param: java.lang.String
*/
public void setOrderCode(java.lang.String orderCode){
this.orderCode = orderCode;
}
/**
*: java.util.Date
*@return: java.util.Date
*/
public java.util.Date getOrderDate(){
return this.orderDate;
}
/**
*: java.util.Date
*@param: java.util.Date
*/
public void setOrderDate(java.util.Date orderDate){
this.orderDate = orderDate;
}
/**
*: java.lang.Double
*@return: java.lang.Double
*/
public java.lang.Double getOrderMoney(){
return this.orderMoney;
}
/**
*: java.lang.Double
*@param: java.lang.Double
*/
public void setOrderMoney(java.lang.Double orderMoney){
this.orderMoney = orderMoney;
}
/**
*: java.lang.String
*@return: java.lang.String
*/
public java.lang.String getContent(){
return this.content;
}
/**
*: java.lang.String
*@param: java.lang.String
*/
public void setContent(java.lang.String content){
this.content = content;
}
/**
*: java.lang.String
*@return: java.lang.String
*/
public java.lang.String getCtype(){
return this.ctype;
}
/**
*: java.lang.String
*@param: java.lang.String
*/
public void setCtype(java.lang.String ctype){
this.ctype = ctype;
}
/**保存-JformOrderMain子表*/
@ExcelCollection(name="订单客户信息")
private List<JformOrderCustomerEntity> jformOrderCustomerList = new ArrayList<JformOrderCustomerEntity>();
public List<JformOrderCustomerEntity> getJformOrderCustomerList() {
return jformOrderCustomerList;
}
public void setJformOrderCustomerList(List<JformOrderCustomerEntity> jformOrderCustomerList) {
this.jformOrderCustomerList = jformOrderCustomerList;
}
/**保存-JformOrderMain子表*/
@ExcelCollection(name="订单机票信息")
private List<JformOrderTicketEntity> jformOrderTicketList = new ArrayList<JformOrderTicketEntity>();
public List<JformOrderTicketEntity> getJformOrderTicketList() {
return jformOrderTicketList;
}
public void setJformOrderTicketList(List<JformOrderTicketEntity> jformOrderTicketList) {
this.jformOrderTicketList = jformOrderTicketList;
}
}

@ -0,0 +1,320 @@
package com.jeecg.demo.page;
import com.jeecg.demo.entity.JfromOrderEntity;
import com.jeecg.demo.entity.JfromOrderLineEntity;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import java.util.ArrayList;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import org.hibernate.annotations.GenericGenerator;
import javax.persistence.SequenceGenerator;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.jeecgframework.poi.excel.annotation.ExcelCollection;
/**
* @Title: Entity
* @Description:
* @author onlineGenerator
* @date 2017-12-14 13:36:56
* @version V1.0
*
*/
public class JfromOrderPage implements java.io.Serializable {
/**主键*/
private java.lang.String id;
/**创建人名称*/
private java.lang.String createName;
/**创建人登录名称*/
private java.lang.String createBy;
/**创建日期*/
private java.util.Date createDate;
/**更新人名称*/
private java.lang.String updateName;
/**更新人登录名称*/
private java.lang.String updateBy;
/**更新日期*/
private java.util.Date updateDate;
/**所属部门*/
private java.lang.String sysOrgCode;
/**所属公司*/
private java.lang.String sysCompanyCode;
/**流程状态*/
private java.lang.String bpmStatus;
/**收货人*/
@Excel(name="收货人")
private java.lang.String receiverName;
/**联系电话*/
@Excel(name="联系电话")
private java.lang.String receiverMobile;
/**收货省*/
@Excel(name="收货省")
private java.lang.String receiverState;
/**收货市*/
@Excel(name="收货市")
private java.lang.String receiverCity;
/**收货区*/
@Excel(name="收货区")
private java.lang.String receiverDistrict;
/**收货地址*/
@Excel(name="收货地址")
private java.lang.String receiverAddress;
/**
*: java.lang.String
*@return: java.lang.String
*/
public java.lang.String getId(){
return this.id;
}
/**
*: java.lang.String
*@param: java.lang.String
*/
public void setId(java.lang.String id){
this.id = id;
}
/**
*: java.lang.String
*@return: java.lang.String
*/
public java.lang.String getCreateName(){
return this.createName;
}
/**
*: java.lang.String
*@param: java.lang.String
*/
public void setCreateName(java.lang.String createName){
this.createName = createName;
}
/**
*: java.lang.String
*@return: java.lang.String
*/
public java.lang.String getCreateBy(){
return this.createBy;
}
/**
*: java.lang.String
*@param: java.lang.String
*/
public void setCreateBy(java.lang.String createBy){
this.createBy = createBy;
}
/**
*: java.util.Date
*@return: java.util.Date
*/
public java.util.Date getCreateDate(){
return this.createDate;
}
/**
*: java.util.Date
*@param: java.util.Date
*/
public void setCreateDate(java.util.Date createDate){
this.createDate = createDate;
}
/**
*: java.lang.String
*@return: java.lang.String
*/
public java.lang.String getUpdateName(){
return this.updateName;
}
/**
*: java.lang.String
*@param: java.lang.String
*/
public void setUpdateName(java.lang.String updateName){
this.updateName = updateName;
}
/**
*: java.lang.String
*@return: java.lang.String
*/
public java.lang.String getUpdateBy(){
return this.updateBy;
}
/**
*: java.lang.String
*@param: java.lang.String
*/
public void setUpdateBy(java.lang.String updateBy){
this.updateBy = updateBy;
}
/**
*: java.util.Date
*@return: java.util.Date
*/
public java.util.Date getUpdateDate(){
return this.updateDate;
}
/**
*: java.util.Date
*@param: java.util.Date
*/
public void setUpdateDate(java.util.Date updateDate){
this.updateDate = updateDate;
}
/**
*: java.lang.String
*@return: java.lang.String
*/
public java.lang.String getSysOrgCode(){
return this.sysOrgCode;
}
/**
*: java.lang.String
*@param: java.lang.String
*/
public void setSysOrgCode(java.lang.String sysOrgCode){
this.sysOrgCode = sysOrgCode;
}
/**
*: java.lang.String
*@return: java.lang.String
*/
public java.lang.String getSysCompanyCode(){
return this.sysCompanyCode;
}
/**
*: java.lang.String
*@param: java.lang.String
*/
public void setSysCompanyCode(java.lang.String sysCompanyCode){
this.sysCompanyCode = sysCompanyCode;
}
/**
*: java.lang.String
*@return: java.lang.String
*/
public java.lang.String getBpmStatus(){
return this.bpmStatus;
}
/**
*: java.lang.String
*@param: java.lang.String
*/
public void setBpmStatus(java.lang.String bpmStatus){
this.bpmStatus = bpmStatus;
}
/**
*: java.lang.String
*@return: java.lang.String
*/
public java.lang.String getReceiverName(){
return this.receiverName;
}
/**
*: java.lang.String
*@param: java.lang.String
*/
public void setReceiverName(java.lang.String receiverName){
this.receiverName = receiverName;
}
/**
*: java.lang.String
*@return: java.lang.String
*/
public java.lang.String getReceiverMobile(){
return this.receiverMobile;
}
/**
*: java.lang.String
*@param: java.lang.String
*/
public void setReceiverMobile(java.lang.String receiverMobile){
this.receiverMobile = receiverMobile;
}
/**
*: java.lang.String
*@return: java.lang.String
*/
public java.lang.String getReceiverState(){
return this.receiverState;
}
/**
*: java.lang.String
*@param: java.lang.String
*/
public void setReceiverState(java.lang.String receiverState){
this.receiverState = receiverState;
}
/**
*: java.lang.String
*@return: java.lang.String
*/
public java.lang.String getReceiverCity(){
return this.receiverCity;
}
/**
*: java.lang.String
*@param: java.lang.String
*/
public void setReceiverCity(java.lang.String receiverCity){
this.receiverCity = receiverCity;
}
/**
*: java.lang.String
*@return: java.lang.String
*/
public java.lang.String getReceiverDistrict(){
return this.receiverDistrict;
}
/**
*: java.lang.String
*@param: java.lang.String
*/
public void setReceiverDistrict(java.lang.String receiverDistrict){
this.receiverDistrict = receiverDistrict;
}
/**
*: java.lang.String
*@return: java.lang.String
*/
public java.lang.String getReceiverAddress(){
return this.receiverAddress;
}
/**
*: java.lang.String
*@param: java.lang.String
*/
public void setReceiverAddress(java.lang.String receiverAddress){
this.receiverAddress = receiverAddress;
}
/**保存-订单表体*/
@ExcelCollection(name="订单表体")
private List<JfromOrderLineEntity> jfromOrderLineList = new ArrayList<JfromOrderLineEntity>();
public List<JfromOrderLineEntity> getJfromOrderLineList() {
return jfromOrderLineList;
}
public void setJfromOrderLineList(List<JfromOrderLineEntity> jfromOrderLineList) {
this.jfromOrderLineList = jfromOrderLineList;
}
}

@ -0,0 +1,16 @@
package com.jeecg.demo.service;
import java.io.Serializable;
import org.jeecgframework.core.common.service.CommonService;
import com.jeecg.demo.entity.JeecgDemoExcelEntity;
public interface JeecgDemoExcelServiceI extends CommonService{
public void delete(JeecgDemoExcelEntity entity) throws Exception;
public Serializable save(JeecgDemoExcelEntity entity) throws Exception;
public void saveOrUpdate(JeecgDemoExcelEntity entity) throws Exception;
}

@ -0,0 +1,19 @@
package com.jeecg.demo.service;
import com.jeecg.demo.entity.JeecgDemoEntity;
import org.jeecgframework.core.common.service.CommonService;
import java.io.Serializable;
public interface JeecgDemoServiceI extends CommonService{
public void delete(JeecgDemoEntity entity) throws Exception;
public Serializable save(JeecgDemoEntity entity) throws Exception;
public void saveOrUpdate(JeecgDemoEntity entity) throws Exception;
public void jdbcBatchSave() throws Exception;
public void jdbcProcedure() throws Exception;
}

@ -0,0 +1,49 @@
package com.jeecg.demo.service;
import com.jeecg.demo.entity.JformOrderMain2Entity;
import com.jeecg.demo.entity.JformOrderTicket2Entity;
import com.jeecg.demo.entity.JformOrderCustomer2Entity;
import java.util.List;
import org.jeecgframework.core.common.service.CommonService;
import java.io.Serializable;
public interface JformOrderMain2ServiceI extends CommonService{
public <T> void delete(T entity);
/*public <T> void add(T entity);
public <T> void addOrUpdate(T entity);*/
/**
*
*
*/
public void addMain(JformOrderMain2Entity jformOrderMain2,
List<JformOrderTicket2Entity> jformOrderTicket2List,List<JformOrderCustomer2Entity> jformOrderCustomer2List) ;
/**
*
*
*/
public void updateMain(JformOrderMain2Entity jformOrderMain2,
List<JformOrderTicket2Entity> jformOrderTicket2List,List<JformOrderCustomer2Entity> jformOrderCustomer2List);
public void delMain (JformOrderMain2Entity jformOrderMain2);
/**
* -sql-
* @param id
* @return
*/
public boolean doAddSql(JformOrderMain2Entity t);
/**
* -sql-
* @param id
* @return
*/
public boolean doUpdateSql(JformOrderMain2Entity t);
/**
* -sql-
* @param id
* @return
*/
public boolean doDelSql(JformOrderMain2Entity t);
}

@ -0,0 +1,50 @@
package com.jeecg.demo.service;
import com.jeecg.demo.entity.JformOrderMainEntity;
import com.jeecg.demo.entity.JformOrderCustomerEntity;
import com.jeecg.demo.entity.JformOrderTicketEntity;
import java.util.List;
import org.jeecgframework.core.common.service.CommonService;
import java.io.Serializable;
public interface JformOrderMainServiceI extends CommonService{
public <T> void delete(T entity);
/**
*
*
*/
public void addMain(JformOrderMainEntity jformOrderMain,
List<JformOrderCustomerEntity> jformOrderCustomerList,List<JformOrderTicketEntity> jformOrderTicketList) ;
/**
*
*
*/
public void updateMain(JformOrderMainEntity jformOrderMain,
List<JformOrderCustomerEntity> jformOrderCustomerList,List<JformOrderTicketEntity> jformOrderTicketList);
public void delMain (JformOrderMainEntity jformOrderMain);
/**
* -sql-
* @param id
* @return
*/
public boolean doAddSql(JformOrderMainEntity t);
/**
* -sql-
* @param id
* @return
*/
public boolean doUpdateSql(JformOrderMainEntity t);
/**
* -sql-
* @param id
* @return
*/
public boolean doDelSql(JformOrderMainEntity t);
/**
*
* @param jformOrderCustomerList
*/
public void updateCustomers(List<JformOrderCustomerEntity> jformOrderCustomerList);
}

@ -0,0 +1,44 @@
package com.jeecg.demo.service;
import com.jeecg.demo.entity.JfromOrderEntity;
import com.jeecg.demo.entity.JfromOrderLineEntity;
import java.util.List;
import org.jeecgframework.core.common.service.CommonService;
import java.io.Serializable;
public interface JfromOrderServiceI extends CommonService{
public <T> void delete(T entity);
/**
*
*
*/
public void addMain(JfromOrderEntity jfromOrder,
List<JfromOrderLineEntity> jfromOrderLineList) ;
/**
*
*
*/
public void updateMain(JfromOrderEntity jfromOrder, List<JfromOrderLineEntity> jfromOrderLineList);
public void delMain (JfromOrderEntity jfromOrder);
/**
* -sql-
* @param id
* @return
*/
public boolean doAddSql(JfromOrderEntity t);
/**
* -sql-
* @param id
* @return
*/
public boolean doUpdateSql(JfromOrderEntity t);
/**
* -sql-
* @param id
* @return
*/
public boolean doDelSql(JfromOrderEntity t);
}

@ -0,0 +1,16 @@
package com.jeecg.demo.service;
import org.jeecgframework.core.common.service.CommonService;
import com.jeecg.demo.entity.MultiUploadEntity;
import java.io.Serializable;
public interface MultiUploadServiceI extends CommonService{
public void delete(MultiUploadEntity entity) throws Exception;
public Serializable save(MultiUploadEntity entity) throws Exception;
public void saveOrUpdate(MultiUploadEntity entity) throws Exception;
}

@ -0,0 +1,33 @@
package com.jeecg.demo.service.impl;
import java.io.Serializable;
import org.jeecgframework.core.common.service.impl.CommonServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.jeecg.demo.entity.JeecgDemoExcelEntity;
import com.jeecg.demo.service.JeecgDemoExcelServiceI;
@Service("jeecgDemoExcelService")
@Transactional
public class JeecgDemoExcelServiceImpl extends CommonServiceImpl implements JeecgDemoExcelServiceI {
@Autowired
private NamedParameterJdbcTemplate namedParameterJdbcTemplate;
public void delete(JeecgDemoExcelEntity entity) throws Exception{
super.delete(entity);
}
public Serializable save(JeecgDemoExcelEntity entity) throws Exception{
Serializable t = super.save(entity);
return t;
}
public void saveOrUpdate(JeecgDemoExcelEntity entity) throws Exception{
super.saveOrUpdate(entity);
}
}

@ -0,0 +1,89 @@
package com.jeecg.demo.service.impl;
import java.io.Serializable;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import org.apache.log4j.Logger;
import org.jeecgframework.core.common.dao.jdbc.JdbcDao;
import org.jeecgframework.core.common.service.impl.CommonServiceImpl;
import org.jeecgframework.core.util.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.BatchPreparedStatementSetter;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.jeecg.demo.entity.JeecgDemoEntity;
import com.jeecg.demo.service.JeecgDemoServiceI;
@Service("jeecgDemoService")
@Transactional
public class JeecgDemoServiceImpl extends CommonServiceImpl implements JeecgDemoServiceI {
private static final Logger logger = Logger.getLogger(JeecgDemoServiceImpl.class);
@Autowired
private JdbcDao jdbcDao;
public void delete(JeecgDemoEntity entity) throws Exception{
super.delete(entity);
}
public Serializable save(JeecgDemoEntity entity) throws Exception{
Serializable t = super.save(entity);
return t;
}
public void saveOrUpdate(JeecgDemoEntity entity) throws Exception{
super.saveOrUpdate(entity);
}
/**
* JDBC
*/
@Override
public void jdbcBatchSave() throws Exception {
final List<JeecgDemoEntity> jeecgDemoList=new ArrayList<JeecgDemoEntity>();
for(int i=0;i<1000;i++){
JeecgDemoEntity jeecgDemo=new JeecgDemoEntity();
jeecgDemo.setId(UUID.randomUUID().toString().replaceAll("-", ""));
jeecgDemo.setName("批量测试"+i);
jeecgDemo.setAge(10);
jeecgDemoList.add(jeecgDemo);
}
String sql="insert into jeecg_demo (id,name,age,create_date) values (?,?,?,?)";
logger.info("-------批处理sql ----"+ sql);
jdbcDao.batchUpdate(sql, new BatchPreparedStatementSetter()
{
public void setValues(PreparedStatement ps,int i)throws SQLException
{
String id=jeecgDemoList.get(i).getId();
String name=jeecgDemoList.get(i).getName();
int age=jeecgDemoList.get(i).getAge();
ps.setString(1, id);
ps.setString(2, name);
ps.setInt(3, age);
ps.setString(4, DateUtils.date2Str(new SimpleDateFormat("yyyy-MM-dd HH:mm")));
}
public int getBatchSize()
{
return jeecgDemoList.size();
}
});
}
/**
*
*/
@Override
public void jdbcProcedure() throws Exception {
String sql = "call delete_jeecgDemo_createDate('"+DateUtils.getDate("yyyy-MM-dd")+"')";
logger.info("-------执行存储过程--sql ----"+ sql);
jdbcDao.execute(sql);
}
}

@ -0,0 +1,205 @@
package com.jeecg.demo.service.impl;
import java.util.List;
import java.util.UUID;
import org.jeecgframework.core.common.exception.BusinessException;
import org.jeecgframework.core.common.service.impl.CommonServiceImpl;
import org.jeecgframework.core.util.MyBeanUtils;
import org.jeecgframework.core.util.StringUtil;
import org.jeecgframework.core.util.oConvertUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.jeecg.demo.entity.JformOrderCustomer2Entity;
import com.jeecg.demo.entity.JformOrderMain2Entity;
import com.jeecg.demo.entity.JformOrderTicket2Entity;
import com.jeecg.demo.service.JformOrderMain2ServiceI;
@Service("jformOrderMain2Service")
@Transactional
public class JformOrderMain2ServiceImpl extends CommonServiceImpl implements JformOrderMain2ServiceI {
public <T> void delete(T entity) {
super.delete(entity);
}
public void addMain(JformOrderMain2Entity jformOrderMain2,
List<JformOrderTicket2Entity> jformOrderTicket2List,List<JformOrderCustomer2Entity> jformOrderCustomer2List){
//保存主信息
this.save(jformOrderMain2);
/**保存-订单机票信息*/
for(JformOrderTicket2Entity jformOrderTicket2:jformOrderTicket2List){
//外键设置
jformOrderTicket2.setFckId(jformOrderMain2.getId());
this.save(jformOrderTicket2);
}
/**保存-订单客户信息*/
for(JformOrderCustomer2Entity jformOrderCustomer2:jformOrderCustomer2List){
//外键设置
jformOrderCustomer2.setFkId(jformOrderMain2.getId());
this.save(jformOrderCustomer2);
}
//执行新增操作配置的sql增强
this.doAddSql(jformOrderMain2);
}
public void updateMain(JformOrderMain2Entity jformOrderMain2,
List<JformOrderTicket2Entity> jformOrderTicket2List,List<JformOrderCustomer2Entity> jformOrderCustomer2List) {
//保存主表信息
if(StringUtil.isNotEmpty(jformOrderMain2.getId())){
try {
JformOrderMain2Entity temp = findUniqueByProperty(JformOrderMain2Entity.class, "id", jformOrderMain2.getId());
MyBeanUtils.copyBeanNotNull2Bean(jformOrderMain2, temp);
this.saveOrUpdate(temp);
} catch (Exception e) {
e.printStackTrace();
}
}else{
this.saveOrUpdate(jformOrderMain2);
}
//===================================================================================
//获取参数
Object id0 = jformOrderMain2.getId();
Object id1 = jformOrderMain2.getId();
//===================================================================================
//1.查询出数据库的明细数据-订单机票信息
String hql0 = "from JformOrderTicket2Entity where 1 = 1 AND fCK_ID = ? ";
List<JformOrderTicket2Entity> jformOrderTicket2OldList = this.findHql(hql0,id0);
//2.筛选更新明细数据-订单机票信息
if(jformOrderTicket2List!=null&&jformOrderTicket2List.size()>0){
for(JformOrderTicket2Entity oldE:jformOrderTicket2OldList){
boolean isUpdate = false;
for(JformOrderTicket2Entity sendE:jformOrderTicket2List){
//需要更新的明细数据-订单机票信息
if(oldE.getId().equals(sendE.getId())){
try {
MyBeanUtils.copyBeanNotNull2Bean(sendE,oldE);
this.saveOrUpdate(oldE);
} catch (Exception e) {
e.printStackTrace();
throw new BusinessException(e.getMessage());
}
isUpdate= true;
break;
}
}
if(!isUpdate){
//如果数据库存在的明细,前台没有传递过来则是删除-订单机票信息
super.delete(oldE);
}
}
//3.持久化新增的数据-订单机票信息
for(JformOrderTicket2Entity jformOrderTicket2:jformOrderTicket2List){
if(oConvertUtils.isEmpty(jformOrderTicket2.getId())){
//外键设置
jformOrderTicket2.setFckId(jformOrderMain2.getId());
this.save(jformOrderTicket2);
}
}
}
//===================================================================================
//1.查询出数据库的明细数据-订单客户信息
String hql1 = "from JformOrderCustomer2Entity where 1 = 1 AND fK_ID = ? ";
List<JformOrderCustomer2Entity> jformOrderCustomer2OldList = this.findHql(hql1,id1);
//2.筛选更新明细数据-订单客户信息
if(jformOrderCustomer2List!=null&&jformOrderCustomer2List.size()>0){
for(JformOrderCustomer2Entity oldE:jformOrderCustomer2OldList){
boolean isUpdate = false;
for(JformOrderCustomer2Entity sendE:jformOrderCustomer2List){
//需要更新的明细数据-订单客户信息
if(oldE.getId().equals(sendE.getId())){
try {
MyBeanUtils.copyBeanNotNull2Bean(sendE,oldE);
this.saveOrUpdate(oldE);
} catch (Exception e) {
e.printStackTrace();
throw new BusinessException(e.getMessage());
}
isUpdate= true;
break;
}
}
if(!isUpdate){
//如果数据库存在的明细,前台没有传递过来则是删除-订单客户信息
super.delete(oldE);
}
}
//3.持久化新增的数据-订单客户信息
for(JformOrderCustomer2Entity jformOrderCustomer2:jformOrderCustomer2List){
if(oConvertUtils.isEmpty(jformOrderCustomer2.getId())){
//外键设置
jformOrderCustomer2.setFkId(jformOrderMain2.getId());
this.save(jformOrderCustomer2);
}
}
}
//执行更新操作配置的sql增强
this.doUpdateSql(jformOrderMain2);
}
public void delMain(JformOrderMain2Entity jformOrderMain2) {
//删除主表信息
this.delete(jformOrderMain2);
//===================================================================================
//获取参数
Object id0 = jformOrderMain2.getId();
Object id1 = jformOrderMain2.getId();
//===================================================================================
//删除-订单机票信息
String hql0 = "from JformOrderTicket2Entity where 1 = 1 AND fCK_ID = ? ";
List<JformOrderTicket2Entity> jformOrderTicket2OldList = this.findHql(hql0,id0);
this.deleteAllEntitie(jformOrderTicket2OldList);
//===================================================================================
//删除-订单客户信息
String hql1 = "from JformOrderCustomer2Entity where 1 = 1 AND fK_ID = ? ";
List<JformOrderCustomer2Entity> jformOrderCustomer2OldList = this.findHql(hql1,id1);
this.deleteAllEntitie(jformOrderCustomer2OldList);
}
/**
* -sql-
* @param id
* @return
*/
public boolean doAddSql(JformOrderMain2Entity t){
return true;
}
/**
* -sql-
* @param id
* @return
*/
public boolean doUpdateSql(JformOrderMain2Entity t){
return true;
}
/**
* -sql-
* @param id
* @return
*/
public boolean doDelSql(JformOrderMain2Entity t){
return true;
}
/**
* sql
* @param sql
* @return
*/
public String replaceVal(String sql,JformOrderMain2Entity t){
sql = sql.replace("#{id}",String.valueOf(t.getId()));
sql = sql.replace("#{order_code}",String.valueOf(t.getOrderCode()));
sql = sql.replace("#{order_date}",String.valueOf(t.getOrderDate()));
sql = sql.replace("#{order_money}",String.valueOf(t.getOrderMoney()));
sql = sql.replace("#{content}",String.valueOf(t.getContent()));
sql = sql.replace("#{UUID}",UUID.randomUUID().toString());
return sql;
}
}

@ -0,0 +1,225 @@
package com.jeecg.demo.service.impl;
import com.jeecg.demo.service.JformOrderMainServiceI;
import org.jeecgframework.core.common.service.impl.CommonServiceImpl;
import com.jeecg.demo.entity.JformOrderMainEntity;
import com.jeecg.demo.entity.JformOrderCustomerEntity;
import com.jeecg.demo.entity.JformOrderTicketEntity;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
import org.jeecgframework.core.common.exception.BusinessException;
import org.jeecgframework.core.common.service.impl.CommonServiceImpl;
import org.jeecgframework.core.util.MyBeanUtils;
import org.jeecgframework.core.util.StringUtil;
import org.jeecgframework.core.util.oConvertUtils;
import java.util.ArrayList;
import java.util.UUID;
import java.io.Serializable;
@Service("jformOrderMainService")
@Transactional
public class JformOrderMainServiceImpl extends CommonServiceImpl implements JformOrderMainServiceI {
public <T> void delete(T entity) {
super.delete(entity);
//执行删除操作配置的sql增强
this.doDelSql((JformOrderMainEntity)entity);
}
public void addMain(JformOrderMainEntity jformOrderMain,
List<JformOrderCustomerEntity> jformOrderCustomerList,List<JformOrderTicketEntity> jformOrderTicketList){
//保存主信息
this.save(jformOrderMain);
/**保存-JformOrderMain子表*/
for(JformOrderCustomerEntity jformOrderCustomer:jformOrderCustomerList){
//外键设置
jformOrderCustomer.setFkId(jformOrderMain.getId());
this.save(jformOrderCustomer);
}
/**保存-JformOrderMain子表*/
for(JformOrderTicketEntity jformOrderTicket:jformOrderTicketList){
//外键设置
jformOrderTicket.setFckId(jformOrderMain.getId());
this.save(jformOrderTicket);
}
//执行新增操作配置的sql增强
this.doAddSql(jformOrderMain);
}
public void updateMain(JformOrderMainEntity jformOrderMain,
List<JformOrderCustomerEntity> jformOrderCustomerList,List<JformOrderTicketEntity> jformOrderTicketList) {
//保存主表信息
if(StringUtil.isNotEmpty(jformOrderMain.getId())){
try {
JformOrderMainEntity temp = findUniqueByProperty(JformOrderMainEntity.class, "id", jformOrderMain.getId());
MyBeanUtils.copyBeanNotNull2Bean(jformOrderMain, temp);
this.saveOrUpdate(temp);
} catch (Exception e) {
e.printStackTrace();
}
}else{
this.saveOrUpdate(jformOrderMain);
}
//===================================================================================
//获取参数
Object id0 = jformOrderMain.getId();
Object id1 = jformOrderMain.getId();
//===================================================================================
//1.查询出数据库的明细数据-JformOrderMain子表
String hql0 = "from JformOrderCustomerEntity where 1 = 1 AND fK_ID = ? ";
List<JformOrderCustomerEntity> jformOrderCustomerOldList = this.findHql(hql0,id0);
//2.筛选更新明细数据-JformOrderMain子表
//TODO authorXueLin for: 客户数据全删完size == 0
if(jformOrderCustomerList != null){// && jformOrderCustomerList.size() > 0
for(JformOrderCustomerEntity oldE : jformOrderCustomerOldList){
boolean isUpdate = false;
for(JformOrderCustomerEntity sendE : jformOrderCustomerList){
//需要更新的明细数据-JformOrderMain子表
if(oldE.getId().equals(sendE.getId())){
try {
MyBeanUtils.copyBeanNotNull2Bean(sendE,oldE);
this.saveOrUpdate(oldE);
} catch (Exception e) {
e.printStackTrace();
throw new BusinessException(e.getMessage());
}
isUpdate = true;
break;
}
}
if(!isUpdate){
//如果数据库存在的明细,前台没有传递过来则是删除-JformOrderMain子表
super.delete(oldE);
}
}
//3.持久化新增的数据-JformOrderMain子表
for(JformOrderCustomerEntity jformOrderCustomer:jformOrderCustomerList){
if(oConvertUtils.isEmpty(jformOrderCustomer.getId())){
//外键设置
jformOrderCustomer.setFkId(jformOrderMain.getId());
this.save(jformOrderCustomer);
}
}
}
//===================================================================================
//1.查询出数据库的明细数据-JformOrderMain子表
String hql1 = "from JformOrderTicketEntity where 1 = 1 AND fCK_ID = ? ";
List<JformOrderTicketEntity> jformOrderTicketOldList = this.findHql(hql1,id1);
//2.筛选更新明细数据-JformOrderMain子表
//TODO authorXueLin for: 机票信息全删完 size == 0
if(jformOrderTicketList != null){// && jformOrderTicketList.size() > 0
for(JformOrderTicketEntity oldE : jformOrderTicketOldList){
boolean isUpdate = false;
for(JformOrderTicketEntity sendE : jformOrderTicketList){
//需要更新的明细数据-JformOrderMain子表
if(oldE.getId().equals(sendE.getId())){
try {
MyBeanUtils.copyBeanNotNull2Bean(sendE,oldE);
this.saveOrUpdate(oldE);
} catch (Exception e) {
e.printStackTrace();
throw new BusinessException(e.getMessage());
}
isUpdate= true;
break;
}
}
if(!isUpdate){
//如果数据库存在的明细,前台没有传递过来则是删除-JformOrderMain子表
super.delete(oldE);
}
}
//3.持久化新增的数据-JformOrderMain子表
for(JformOrderTicketEntity jformOrderTicket:jformOrderTicketList){
if(oConvertUtils.isEmpty(jformOrderTicket.getId())){
//外键设置
jformOrderTicket.setFckId(jformOrderMain.getId());
this.save(jformOrderTicket);
}
}
}
//执行更新操作配置的sql增强
this.doUpdateSql(jformOrderMain);
}
public void delMain(JformOrderMainEntity jformOrderMain) {
//删除主表信息
this.delete(jformOrderMain);
//===================================================================================
//获取参数
Object id0 = jformOrderMain.getId();
Object id1 = jformOrderMain.getId();
//===================================================================================
//删除-JformOrderMain子表
String hql0 = "from JformOrderCustomerEntity where 1 = 1 AND fK_ID = ? ";
List<JformOrderCustomerEntity> jformOrderCustomerOldList = this.findHql(hql0,id0);
this.deleteAllEntitie(jformOrderCustomerOldList);
//===================================================================================
//删除-JformOrderMain子表
String hql1 = "from JformOrderTicketEntity where 1 = 1 AND fCK_ID = ? ";
List<JformOrderTicketEntity> jformOrderTicketOldList = this.findHql(hql1,id1);
this.deleteAllEntitie(jformOrderTicketOldList);
}
/**
* -sql-
* @param id
* @return
*/
public boolean doAddSql(JformOrderMainEntity t){
return true;
}
/**
* -sql-
* @param id
* @return
*/
public boolean doUpdateSql(JformOrderMainEntity t){
return true;
}
/**
* -sql-
* @param id
* @return
*/
public boolean doDelSql(JformOrderMainEntity t){
return true;
}
/**
* sql
* @param sql
* @return
*/
public String replaceVal(String sql,JformOrderMainEntity t){
sql = sql.replace("#{id}",String.valueOf(t.getId()));
sql = sql.replace("#{order_code}",String.valueOf(t.getOrderCode()));
sql = sql.replace("#{order_date}",String.valueOf(t.getOrderDate()));
sql = sql.replace("#{order_money}",String.valueOf(t.getOrderMoney()));
sql = sql.replace("#{content}",String.valueOf(t.getContent()));
sql = sql.replace("#{ctype}",String.valueOf(t.getCtype()));
sql = sql.replace("#{UUID}",UUID.randomUUID().toString());
return sql;
}
/**
*
* @param jformOrderCustomerList
*/
public void updateCustomers(List<JformOrderCustomerEntity> jformOrderCustomerList){
for(JformOrderCustomerEntity jformOrderCustomer:jformOrderCustomerList){
this.saveOrUpdate(jformOrderCustomer);
}
}
}

@ -0,0 +1,169 @@
package com.jeecg.demo.service.impl;
import com.jeecg.demo.service.JfromOrderServiceI;
import org.jeecgframework.core.common.service.impl.CommonServiceImpl;
import com.jeecg.demo.entity.JfromOrderEntity;
import com.jeecg.demo.entity.JfromOrderLineEntity;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
import org.jeecgframework.core.common.exception.BusinessException;
import org.jeecgframework.core.common.service.impl.CommonServiceImpl;
import org.jeecgframework.core.util.MyBeanUtils;
import org.jeecgframework.core.util.StringUtil;
import org.jeecgframework.core.util.oConvertUtils;
import java.util.ArrayList;
import java.util.UUID;
import java.io.Serializable;
@Service("jfromOrderService")
@Transactional
public class JfromOrderServiceImpl extends CommonServiceImpl implements JfromOrderServiceI {
public <T> void delete(T entity) {
super.delete(entity);
//执行删除操作配置的sql增强
this.doDelSql((JfromOrderEntity)entity);
}
public void addMain(JfromOrderEntity jfromOrder,
List<JfromOrderLineEntity> jfromOrderLineList){
//保存主信息
this.save(jfromOrder);
/**保存-订单表体*/
for(JfromOrderLineEntity jfromOrderLine:jfromOrderLineList){
//外键设置
jfromOrderLine.setOrderid(jfromOrder.getId());
this.save(jfromOrderLine);
}
//执行新增操作配置的sql增强
this.doAddSql(jfromOrder);
}
public void updateMain(JfromOrderEntity jfromOrder,
List<JfromOrderLineEntity> jfromOrderLineList) {
//保存主表信息
if(StringUtil.isNotEmpty(jfromOrder.getId())){
try {
JfromOrderEntity temp = findUniqueByProperty(JfromOrderEntity.class, "id", jfromOrder.getId());
MyBeanUtils.copyBeanNotNull2Bean(jfromOrder, temp);
this.saveOrUpdate(temp);
} catch (Exception e) {
e.printStackTrace();
}
}else{
this.saveOrUpdate(jfromOrder);
}
//===================================================================================
//获取参数
Object id0 = jfromOrder.getId();
//===================================================================================
//1.查询出数据库的明细数据-订单表体
String hql0 = "from JfromOrderLineEntity where 1 = 1 AND oRDERID = ? ";
List<JfromOrderLineEntity> jfromOrderLineOldList = this.findHql(hql0,id0);
//2.筛选更新明细数据-订单表体
if(jfromOrderLineList!=null&&jfromOrderLineList.size()>0){
for(JfromOrderLineEntity oldE:jfromOrderLineOldList){
boolean isUpdate = false;
for(JfromOrderLineEntity sendE:jfromOrderLineList){
//需要更新的明细数据-订单表体
if(oldE.getId().equals(sendE.getId())){
try {
MyBeanUtils.copyBeanNotNull2Bean(sendE,oldE);
this.saveOrUpdate(oldE);
} catch (Exception e) {
e.printStackTrace();
throw new BusinessException(e.getMessage());
}
isUpdate= true;
break;
}
}
if(!isUpdate){
//如果数据库存在的明细,前台没有传递过来则是删除-订单表体
super.delete(oldE);
}
}
//3.持久化新增的数据-订单表体
for(JfromOrderLineEntity jfromOrderLine:jfromOrderLineList){
if(oConvertUtils.isEmpty(jfromOrderLine.getId())){
//外键设置
jfromOrderLine.setOrderid(jfromOrder.getId());
this.save(jfromOrderLine);
}
}
}
//执行更新操作配置的sql增强
this.doUpdateSql(jfromOrder);
}
public void delMain(JfromOrderEntity jfromOrder) {
//删除主表信息
this.delete(jfromOrder);
//===================================================================================
//获取参数
Object id0 = jfromOrder.getId();
//===================================================================================
//删除-订单表体
String hql0 = "from JfromOrderLineEntity where 1 = 1 AND oRDERID = ? ";
List<JfromOrderLineEntity> jfromOrderLineOldList = this.findHql(hql0,id0);
this.deleteAllEntitie(jfromOrderLineOldList);
}
/**
* -sql-
* @param id
* @return
*/
public boolean doAddSql(JfromOrderEntity t){
return true;
}
/**
* -sql-
* @param id
* @return
*/
public boolean doUpdateSql(JfromOrderEntity t){
return true;
}
/**
* -sql-
* @param id
* @return
*/
public boolean doDelSql(JfromOrderEntity t){
return true;
}
/**
* sql
* @param sql
* @return
*/
public String replaceVal(String sql,JfromOrderEntity t){
sql = sql.replace("#{id}",String.valueOf(t.getId()));
sql = sql.replace("#{create_name}",String.valueOf(t.getCreateName()));
sql = sql.replace("#{create_by}",String.valueOf(t.getCreateBy()));
sql = sql.replace("#{create_date}",String.valueOf(t.getCreateDate()));
sql = sql.replace("#{update_name}",String.valueOf(t.getUpdateName()));
sql = sql.replace("#{update_by}",String.valueOf(t.getUpdateBy()));
sql = sql.replace("#{update_date}",String.valueOf(t.getUpdateDate()));
sql = sql.replace("#{sys_org_code}",String.valueOf(t.getSysOrgCode()));
sql = sql.replace("#{sys_company_code}",String.valueOf(t.getSysCompanyCode()));
sql = sql.replace("#{bpm_status}",String.valueOf(t.getBpmStatus()));
sql = sql.replace("#{receiver_name}",String.valueOf(t.getReceiverName()));
sql = sql.replace("#{receiver_mobile}",String.valueOf(t.getReceiverMobile()));
sql = sql.replace("#{receiver_state}",String.valueOf(t.getReceiverState()));
sql = sql.replace("#{receiver_city}",String.valueOf(t.getReceiverCity()));
sql = sql.replace("#{receiver_district}",String.valueOf(t.getReceiverDistrict()));
sql = sql.replace("#{receiver_address}",String.valueOf(t.getReceiverAddress()));
sql = sql.replace("#{UUID}",UUID.randomUUID().toString());
return sql;
}
}

@ -0,0 +1,128 @@
package com.jeecg.demo.service.impl;
import com.jeecg.demo.entity.MultiUploadEntity;
import com.jeecg.demo.service.MultiUploadServiceI;
import org.jeecgframework.core.common.service.impl.CommonServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
import java.io.Serializable;
import org.jeecgframework.core.util.ApplicationContextUtil;
import org.jeecgframework.core.util.MyClassLoader;
import org.jeecgframework.core.util.StringUtil;
import org.jeecgframework.web.cgform.enhance.CgformEnhanceJavaInter;
@Service("multiUploadService")
@Transactional
public class MultiUploadServiceImpl extends CommonServiceImpl implements MultiUploadServiceI {
public void delete(MultiUploadEntity entity) throws Exception{
super.delete(entity);
//执行删除操作增强业务
this.doDelBus(entity);
}
public Serializable save(MultiUploadEntity entity) throws Exception{
Serializable t = super.save(entity);
//执行新增操作增强业务
this.doAddBus(entity);
return t;
}
public void saveOrUpdate(MultiUploadEntity entity) throws Exception{
super.saveOrUpdate(entity);
//执行更新操作增强业务
this.doUpdateBus(entity);
}
/**
*
* @param t
* @return
*/
private void doAddBus(MultiUploadEntity t) throws Exception{
}
/**
*
* @param t
* @return
*/
private void doUpdateBus(MultiUploadEntity t) throws Exception{
}
/**
*
* @param id
* @return
*/
private void doDelBus(MultiUploadEntity t) throws Exception{
}
private Map<String,Object> populationMap(MultiUploadEntity t){
Map<String,Object> map = new HashMap<String,Object>();
map.put("id", t.getId());
map.put("create_name", t.getCreateName());
map.put("create_by", t.getCreateBy());
map.put("create_date", t.getCreateDate());
map.put("update_name", t.getUpdateName());
map.put("update_by", t.getUpdateBy());
map.put("update_date", t.getUpdateDate());
map.put("sys_org_code", t.getSysOrgCode());
map.put("sys_company_code", t.getSysCompanyCode());
map.put("bpm_status", t.getBpmStatus());
map.put("test_file_1", t.getTestFile1());
map.put("test_file_2", t.getTestFile2());
map.put("test_file_3", t.getTestFile3());
return map;
}
/**
* sql
* @param sql
* @param t
* @return
*/
public String replaceVal(String sql,MultiUploadEntity t){
sql = sql.replace("#{id}",String.valueOf(t.getId()));
sql = sql.replace("#{create_name}",String.valueOf(t.getCreateName()));
sql = sql.replace("#{create_by}",String.valueOf(t.getCreateBy()));
sql = sql.replace("#{create_date}",String.valueOf(t.getCreateDate()));
sql = sql.replace("#{update_name}",String.valueOf(t.getUpdateName()));
sql = sql.replace("#{update_by}",String.valueOf(t.getUpdateBy()));
sql = sql.replace("#{update_date}",String.valueOf(t.getUpdateDate()));
sql = sql.replace("#{sys_org_code}",String.valueOf(t.getSysOrgCode()));
sql = sql.replace("#{sys_company_code}",String.valueOf(t.getSysCompanyCode()));
sql = sql.replace("#{bpm_status}",String.valueOf(t.getBpmStatus()));
sql = sql.replace("#{test_file_1}",String.valueOf(t.getTestFile1()));
sql = sql.replace("#{test_file_2}",String.valueOf(t.getTestFile2()));
sql = sql.replace("#{test_file_3}",String.valueOf(t.getTestFile3()));
sql = sql.replace("#{UUID}",UUID.randomUUID().toString());
return sql;
}
/**
* JAVA
*/
private void executeJavaExtend(String cgJavaType,String cgJavaValue,Map<String,Object> data) throws Exception {
if(StringUtil.isNotEmpty(cgJavaValue)){
Object obj = null;
try {
if("class".equals(cgJavaType)){
//因新增时已经校验了实例化是否可以成功,所以这块就不需要再做一次判断
obj = MyClassLoader.getClassByScn(cgJavaValue).newInstance();
}else if("spring".equals(cgJavaType)){
obj = ApplicationContextUtil.getContext().getBean(cgJavaValue);
}
if(obj instanceof CgformEnhanceJavaInter){
CgformEnhanceJavaInter javaInter = (CgformEnhanceJavaInter) obj;
javaInter.execute("multi_upload",data);
}
} catch (Exception e) {
e.printStackTrace();
throw new Exception("执行JAVA增强出现异常");
}
}
}
}

@ -0,0 +1,32 @@
SELECT * FROM jeecg_demo WHERE 1=1
<#if jeecgDemo.name ?exists && jeecgDemo.name ?length gt 0>
and name = :jeecgDemo.name
</#if>
<#if jeecgDemo.age ?exists && jeecgDemo.age ?length gt 0>
and age = :jeecgDemo.age
</#if>
<#if jeecgDemo.depId ?exists && jeecgDemo.depId ?length gt 0>
and dep_id = :jeecgDemo.depId
</#if>
<#if jeecgDemo.email ?exists && jeecgDemo.email ?length gt 0>
and email = :jeecgDemo.email
</#if>
<#if jeecgDemo.phone ?exists && jeecgDemo.phone ?length gt 0>
and phone = :jeecgDemo.phone
</#if>
<#if jeecgDemo.salary ?exists && jeecgDemo.salary ?length gt 0>
and salary = :jeecgDemo.salary
</#if>
<#if jeecgDemo.sex ?exists && jeecgDemo.sex ?length gt 0>
and sex = :jeecgDemo.sex
</#if>
<#if jeecgDemo.status ?exists && jeecgDemo.status ?length gt 0>
and status = :jeecgDemo.status
</#if>
<#if authSql ?exists && authSql ?length gt 0>
${authSql}
</#if>
<#if sort ?exists && sort ?length gt 0>
ORDER BY ${sort} ${order}
</#if>

@ -0,0 +1,15 @@
SELECT
broswer as name,
count(1) as 'value',
CASE
WHEN broswer = 'Firefox' THEN
'#FF00FF'
WHEN broswer = 'IE' THEN
'#FFFF00'
ELSE
'#43CD80'
END as color
FROM
t_s_log
GROUP BY
broswer;

@ -0,0 +1,34 @@
SELECT
a.userid as id,
b.username as name,
count(*) as ct,
sum(
CASE
WHEN RIGHT (logcontent, 4) IN ('登录成功', 'cess') THEN
1
ELSE
0
END
) as loginct,
sum(
CASE
WHEN RIGHT (logcontent, 2) = '退出' THEN
1
ELSE
0
END
) as outct,
sum(
CASE
WHEN RIGHT (logcontent, 4) IN ('删除成功', '更新成功','录入成功') THEN
1
ELSE
0
END
) as xgct
FROM
t_s_log a join t_s_base_user b on b.id=a.userid
GROUP BY
a.userid,b.username
ORDER BY
ct DESC

@ -0,0 +1,99 @@
package com.jeecg.demo.util;
import java.io.File;
import java.io.IOException;
import java.io.PrintWriter;
import java.net.URLEncoder;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import freemarker.template.Configuration;
import freemarker.template.DefaultObjectWrapper;
import freemarker.template.Template;
import freemarker.template.TemplateException;
public class FreemarkerUtil {
private static final Object LOCK = new Object();
/**
* word
*/
public static final int WORD_FILE = 1;
/**
* excel
*/
public static final int EXCEL_FILE = 2;
private static Configuration cfg;
private static FreemarkerUtil ftl ;
private FreemarkerUtil(String templateFolder) throws IOException {
cfg = new Configuration();
cfg.setDirectoryForTemplateLoading(new File(templateFolder));
cfg.setObjectWrapper(new DefaultObjectWrapper());
}
private static void check(HttpServletRequest request) {
if (ftl == null) {
synchronized (LOCK) {
try {
ftl = new FreemarkerUtil(request.getServletContext().getRealPath("/")+"export/template");
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
/**
* word
* response
* @throws IOException
*/
public static void createFile(String templateName,String docFileName, Map<String,Object> rootMap,HttpServletRequest request, HttpServletResponse response,int fileType) throws IOException {
// response.resetBuffer();
//设置导出
response.addHeader("Cache-Control","no-cache");
response.setCharacterEncoding("UTF-8");
if( WORD_FILE == fileType){
response.setContentType("application/vnd.ms-word;charset=UTF-8");
}else if(EXCEL_FILE == fileType){
response.setContentType("application/octet-stream;charset=UTF-8");
}else{
response.setContentType("application/octet-stream");
}
String ua = request.getHeader("user-agent");
ua = ua == null ? null : ua.toLowerCase();
if(ua != null && (ua.indexOf("firefox") > 0 || ua.indexOf("safari")>0)){
try {
docFileName = new String(docFileName.getBytes(),"ISO8859-1");
response.addHeader("Content-Disposition","attachment;filename=" + docFileName);
} catch (Exception e) {
}
}else{
try {
docFileName = URLEncoder.encode(docFileName, "utf-8");
response.addHeader("Content-Disposition","attachment;filename=" + docFileName);
} catch (Exception e) {
}
}
check(request);
//解析模版
Template temp = cfg.getTemplate(templateName, "UTF-8");
PrintWriter write = response.getWriter();
try {
temp.process(rootMap, write);
} catch (TemplateException e) {
e.printStackTrace();
}finally {
if(write != null){
write.flush();
write.close();
}
}
}
}

@ -21,6 +21,7 @@ public @interface Ehcache {
// 增加缓存还是删除缓存,默认为增加缓存
boolean addOrdel() default true;
//临时缓存还是永久缓存,默认为永久缓存
//临时缓存还是永久缓存,默认为缓存缓存
//TODO 默认临时缓存,不支持永久缓存(可根据实际情况拓展)
boolean eternal() default true;
}

@ -0,0 +1,20 @@
package org.jeecgframework.core.annotation;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import org.jeecgframework.core.enums.Permission;
/**
*jeecg
*/
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.TYPE,ElementType.METHOD})
@Documented
public @interface JAuth {
String value() default "";
Permission auth() default Permission.SKIP_AUTH;
}

@ -1,117 +1,97 @@
package org.jeecgframework.core.aop;
import java.io.Serializable;
import java.lang.reflect.Method;
import net.sf.ehcache.Cache;
import net.sf.ehcache.CacheManager;
import net.sf.ehcache.Element;
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.jeecgframework.web.system.service.CacheServiceI;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
import com.alibaba.fastjson.JSON;
/**
*
* @author
*
* @TODO -
* Ehcache
*/
@Component
@Aspect
//@Component
//@Aspect
public class EhcacheAspect {
private static Cache dictCache;
private static Cache eternalCache;
private static final Logger logger = LoggerFactory.getLogger(EhcacheAspect.class);
private static Cache SYSTEM_BASE_CACHE = CacheManager.getInstance().getCache(CacheServiceI.SYSTEM_BASE_CACHE);
private static Cache SYS_AUTH_CACHE = CacheManager.getInstance().getCache(CacheServiceI.SYS_AUTH_CACHE);
static {
if (eternalCache == null) {
eternalCache = CacheManager.getInstance().getCache("eternalCache");
}
if (dictCache == null) {
dictCache = CacheManager.getInstance().getCache("dictCache");
}
}
@Pointcut("@annotation(org.jeecgframework.core.annotation.Ehcache)")
public void simplePointcut() {
}
@AfterReturning(pointcut = "simplePointcut()")
public void simpleAdvice() {
}
@Around("simplePointcut()")
public Object aroundLogCalls(ProceedingJoinPoint joinPoint)
throws Throwable {
String targetName = joinPoint.getTarget().getClass().toString();
@Around("simplePointcut() && @annotation(ehcache)")
public Object aroundLogCalls(ProceedingJoinPoint joinPoint,Ehcache ehcache)throws Throwable {
String targetName = joinPoint.getTarget().getClass().getName();
String methodName = joinPoint.getSignature().getName();
Object[] arguments = joinPoint.getArgs();
Object[] arguments = joinPoint.getArgs();
//试图得到标注的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;
}
}
}
if(flag==null){
return null;
}
//Ehcache flag =joinPoint.getTarget().getClass().getMethod(methodName).getAnnotation(Ehcache.class);
logger.debug("-------ehcache[aspect]-----------targetclass:[{}] , methodName:[{}] , arguments:[{}] ", new Object[] {targetName,methodName,arguments});
Cache cache = null;
Object result;
String cacheKey = getCacheKey(targetName, methodName, arguments);
Element element = null;
if(flag.eternal()){
//永久缓存
element = dictCache.get(cacheKey);
if(oConvertUtils.isNotEmpty(ehcache.cacheName()) && CacheServiceI.SYS_AUTH_CACHE.equals(ehcache.cacheName())){
//自定义缓存对象
cache = this.SYS_AUTH_CACHE;
}else{
//临时缓存
element = eternalCache.get(cacheKey);
//默认缓存对象
cache = this.SYSTEM_BASE_CACHE;
}
//获取缓存
element = cache.get(cacheKey);
if (element == null) {
if ((arguments != null) && (arguments.length != 0)) {
if ((arguments != null && arguments.length != 0)) {
result = joinPoint.proceed(arguments);
} else {
result = joinPoint.proceed();
}
element = new Element(cacheKey, (Serializable) result);
if(flag.eternal()){
//永久缓存
dictCache.put(element);
}else{
//临时缓存
eternalCache.put(element);
}
//设置缓存
cache.put(element);
logger.debug("-------ehcache[aspect]----------设置缓存成功---");
}
return element.getValue();
}
/**
* cache keycache keyCacheElement cache key
* ++com.co.cache.service.UserServiceImpl.getAllUser
* cache key
* cache key: ++
* com.co.cache.service.UserServiceImpl.getAllUser
*/
private String getCacheKey(String targetName, String methodName,
Object[] arguments) {
private String getCacheKey(String targetName, String methodName, Object[] arguments) {
StringBuffer sb = new StringBuffer();
sb.append(targetName).append(".").append(methodName);
if ((arguments != null) && (arguments.length != 0)) {
if ((arguments != null && arguments.length != 0)) {
for (int i = 0; i < arguments.length; i++) {
sb.append(".").append(JSON.toJSONString(arguments[i]));
if (arguments[i] instanceof String[]) {
String[] strArray = (String[]) arguments[i];
sb.append(".");
for (String str : strArray) {
sb.append(str);
}
} else {
sb.append(".").append(arguments[i]);
}
}
}
return sb.toString();

@ -28,9 +28,9 @@ public boolean onSave(Object entity, Serializable id, Object[] state,
String[] propertyNames, Type[] types) {
TSUser currentUser = null;
try {
currentUser = ResourceUtil.getSessionUserName();
currentUser = ResourceUtil.getSessionUser();
} catch (RuntimeException e) {
logger.warn("当前session为空,无法获取用户");
//logger.warn("当前session为空,无法获取用户");
}
if(currentUser==null){
return true;
@ -94,6 +94,15 @@ public boolean onSave(Object entity, Serializable id, Object[] state,
}
continue;
}
/*找到名为"流程状态"的属性*/
else if (DataBaseConstant.BPM_STATUS.equals(propertyNames[index]))
{
/*使用拦截器将对象的"流程状态"属性赋上值*/
if(oConvertUtils.isEmpty(state[index])){
state[index] = String.valueOf(1);//1未提交
}
continue;
}
}
} catch (RuntimeException e) {
e.printStackTrace();
@ -107,9 +116,9 @@ public boolean onFlushDirty(Object entity, Serializable id,
String[] propertyNames, Type[] types) {
TSUser currentUser = null;
try {
currentUser = ResourceUtil.getSessionUserName();
currentUser = ResourceUtil.getSessionUser();
} catch (RuntimeException e1) {
logger.warn("当前session为空,无法获取用户");
//logger.warn("当前session为空,无法获取用户");
}
if(currentUser==null){
return true;

@ -0,0 +1,96 @@
package org.jeecgframework.core.aop;
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.data.redis.core.BoundValueOperations;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Component;
/**
* redisAOP
* @author Yandong
*/
//@Component
//@Aspect
public class RedisCacheAspect {
//TODO ?
@Resource
private RedisTemplate redisTemplate;
@Pointcut("@annotation(org.jeecgframework.core.annotation.Ehcache)")
public void simplePointcut() {}
@Around("simplePointcut() && @annotation(ehcache)")
public Object aroundLogCalls(ProceedingJoinPoint joinPoint,Ehcache ehcache)throws Throwable {
String targetName = joinPoint.getTarget().getClass().getName();
String methodName = joinPoint.getSignature().getName();
Object[] arguments = joinPoint.getArgs();
String cacheKey ="";
if(StringUtils.isNotBlank(ehcache.cacheName())){
cacheKey=ehcache.cacheName();
}else{
cacheKey=getCacheKey(targetName, methodName, arguments);
}
Object result=null;
BoundValueOperations<String,Object> valueOps = redisTemplate.boundValueOps(cacheKey);
if(ehcache.eternal()){
//永久缓存
result = valueOps.get();
}else{
//临时缓存
result = valueOps.get();
valueOps.expire(20, TimeUnit.MINUTES);
}
if (result == null) {
if ((arguments != null) && (arguments.length != 0)) {
result = joinPoint.proceed(arguments);
} else {
result = joinPoint.proceed();
}
if(ehcache.eternal()){
//永久缓存
valueOps.set(result);
}else{
//临时缓存
valueOps.set(result,20, TimeUnit.MINUTES);
}
}
return result;
}
/**
* cache key
* cache key: ++
* com.co.cache.service.UserServiceImpl.getAllUser
*/
private String getCacheKey(String targetName, String methodName,Object[] arguments) {
StringBuffer sb = new StringBuffer();
sb.append(targetName).append(".").append(methodName);
if ((arguments != null) && (arguments.length != 0)) {
for (int i = 0; i < arguments.length; i++) {
if (arguments[i] instanceof String[]) {
String[] strArray = (String[]) arguments[i];
sb.append(".");
for (String str : strArray) {
sb.append(str);
}
} else {
sb.append(".").append(arguments[i]);
}
}
}
return sb.toString();
}
}

@ -0,0 +1,45 @@
package org.jeecgframework.core.common.controller;
import java.io.IOException;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import org.codehaus.jackson.JsonParser;
import org.codehaus.jackson.JsonProcessingException;
import org.codehaus.jackson.map.DeserializationContext;
import org.codehaus.jackson.map.JsonDeserializer;
import org.springframework.util.StringUtils;
/**
* @RequestBodyjsonJackson Date
* @author scott
*
*/
public class CustomJsonDateDeserializer extends JsonDeserializer<Date> {
private SimpleDateFormat datetimeFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
private SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
@Override
public Date deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException {
String text = jp.getText();
if (StringUtils.hasText(text)) {
try {
if (text.indexOf(":") == -1 && text.length() == 10) {
return this.dateFormat.parse(text);
} else if (text.indexOf(":") > 0 && text.length() == 19) {
return this.datetimeFormat.parse(text);
} else {
throw new IllegalArgumentException("Could not parse date, date format is error ");
}
} catch (ParseException ex) {
IllegalArgumentException iae = new IllegalArgumentException("Could not parse date: " + ex.getMessage());
iae.initCause(ex);
throw iae;
}
} else {
return null;
}
}
}

@ -0,0 +1,38 @@
package org.jeecgframework.core.common.controller;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.Date;
import org.codehaus.jackson.JsonGenerator;
import org.codehaus.jackson.JsonProcessingException;
import org.codehaus.jackson.map.JsonSerializer;
import org.codehaus.jackson.map.ObjectMapper;
import org.codehaus.jackson.map.SerializerProvider;
import org.codehaus.jackson.map.ser.CustomSerializerFactory;
/**
* @description @ResponseBodyjsonDATE
* @author scott
* @date 2013-5-28
*/
public class CustomObjectMapper extends ObjectMapper {
public CustomObjectMapper() {
CustomSerializerFactory factory = new CustomSerializerFactory();
factory.addGenericMapping(Date.class, new JsonSerializer<Date>() {
@Override
public void serialize(Date value, JsonGenerator jsonGenerator, SerializerProvider provider) throws IOException, JsonProcessingException {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String dateStr = sdf.format(value);
if (dateStr.endsWith(" 00:00:00")) {
dateStr = dateStr.substring(0, 10);
} else if (dateStr.endsWith(":00")) {
dateStr = dateStr.substring(0, 16);
}
jsonGenerator.writeString(dateStr);
}
});
this.setSerializerFactory(factory);
}
}

@ -29,6 +29,7 @@ public interface ICommonDao extends IGenericBaseCommonDao{
*
* */
public TSUser getUserByUserIdAndUserNameExits(TSUser user);
public TSUser findUserByAccountAndPassword(String username,String password);
public String getUserRole(TSUser user);
/**
*
@ -54,6 +55,7 @@ public interface ICommonDao extends IGenericBaseCommonDao{
*/
public void parserXml(String fileName);
public List<ComboTree> comTree(List<TSDepart> all,ComboTree comboTree);
/**
* ComboTree JSON
*
@ -64,6 +66,7 @@ public interface ICommonDao extends IGenericBaseCommonDao{
* @return List<ComboTree>
*/
public List<ComboTree> ComboTree(List all, ComboTreeModel comboTreeModel, List in, boolean recursive);
public List<TreeGrid> treegrid(List all,TreeGridModel treeGridModel);
public List<TreeGrid> treegrid(List<?> all,TreeGridModel treeGridModel);
}

@ -236,9 +236,11 @@ public interface IGenericBaseCommonDao {
* @param isOffset
* @return
*/
public DataGridReturn getDataGridReturn(final CriteriaQuery cq,
public void getDataGridReturn(CriteriaQuery cq,
final boolean isOffset);
/**
* SQL
*/
@ -322,9 +324,11 @@ public interface IGenericBaseCommonDao {
int maxResult);
public <T> List<T> findByDetached(DetachedCriteria dc);
/**
*
* @param execute
*/
public <T> List<T> executeProcedure(String procedureSql,Object... params);
}

@ -53,6 +53,33 @@ public class CommonDao extends GenericBaseCommonDao implements ICommonDao, IGene
queryObject.setParameter("username", user.getUserName());
queryObject.setParameter("passowrd", password);
List<TSUser> users = queryObject.list();
if (users != null && users.size() > 0) {
return users.get(0);
} else {
queryObject = getSession().createQuery(query);
queryObject.setParameter("username", user.getUserName());
queryObject.setParameter("passowrd", user.getPassword());
users = queryObject.list();
if(users != null && users.size() > 0){
return users.get(0);
}
}
return null;
}
/**
*
* */
public TSUser findUserByAccountAndPassword(String username,String inpassword) {
String password = PasswordUtil.encrypt(username, inpassword, PasswordUtil.getStaticSalt());
String query = "from TSUser u where u.userName = :username and u.password=:passowrd";
Query queryObject = getSession().createQuery(query);
queryObject.setParameter("username", username);
queryObject.setParameter("passowrd", password);
@SuppressWarnings("unchecked")
List<TSUser> users = queryObject.list();
if (users != null && users.size() > 0) {
return users.get(0);
}
@ -172,7 +199,9 @@ public class CommonDao extends GenericBaseCommonDao implements ICommonDao, IGene
}
if (uploadFile.getByteField() != null) {
// 二进制文件保存在数据库中
reflectHelper.setMethodValue(uploadFile.getByteField(), StreamUtils.InputStreamTOByte(mf.getInputStream()));
// reflectHelper.setMethodValue(uploadFile.getByteField(), StreamUtils.InputStreamTOByte(mf.getInputStream()));
}
File savefile = new File(savePath);
if (uploadFile.getRealPath() != null) {
@ -181,15 +210,16 @@ public class CommonDao extends GenericBaseCommonDao implements ICommonDao, IGene
}
saveOrUpdate(object);
// 文件拷贝到指定硬盘目录
if("txt".equals(extend)){
//利用utf-8字符集的固定首行隐藏编码原理
//Unicode:FF FE UTF-8:EF BB
byte[] allbytes = mf.getBytes();
try{
String head1 = toHexString(allbytes[0]);
System.out.println(head1);
//System.out.println(head1);
String head2 = toHexString(allbytes[1]);
System.out.println(head2);
//System.out.println(head2);
if("ef".equals(head1) && "bb".equals(head2)){
//UTF-8
String contents = new String(mf.getBytes(),"UTF-8");
@ -199,11 +229,13 @@ public class CommonDao extends GenericBaseCommonDao implements ICommonDao, IGene
out.close();
}
} else {
//GBK
String contents = new String(mf.getBytes(),"GBK");
OutputStream out = new FileOutputStream(savePath);
out.write(contents.getBytes());
out.close();
}
} catch(Exception e){
String contents = new String(mf.getBytes(),"UTF-8");
@ -216,6 +248,7 @@ public class CommonDao extends GenericBaseCommonDao implements ICommonDao, IGene
} else {
FileCopyUtils.copy(mf.getBytes(), savefile);
}
// if (uploadFile.getSwfpath() != null) {
// // 转SWF
@ -223,12 +256,16 @@ public class CommonDao extends GenericBaseCommonDao implements ICommonDao, IGene
// SwfToolsUtil.convert2SWF(savePath);
// }
// FileCopyUtils.copy(mf.getBytes(), savefile);
if (uploadFile.getSwfpath() != null) {
//默认上传文件是否转换为swf实现在线预览功能开关
String globalSwfTransformFlag = ResourceUtil.getConfigByName("swf.transform.flag");
if ( "true".equals(globalSwfTransformFlag) && uploadFile.getSwfpath() != null) {
// 转SWF
reflectHelper.setMethodValue(uploadFile.getSwfpath(), path + FileUtils.getFilePrefix(myfilename) + ".swf");
SwfToolsUtil.convert2SWF(savePath);
}
}
} catch (Exception e1) {
}
@ -262,20 +299,21 @@ public class CommonDao extends GenericBaseCommonDao implements ICommonDao, IGene
String ctxPath = request.getSession().getServletContext().getRealPath("/");
String downLoadPath = "";
long fileLength = 0;
if (uploadFile.getRealPath() != null&&uploadFile.getContent() == null) {
downLoadPath = ctxPath + uploadFile.getRealPath();
fileLength = new File(downLoadPath).length();
try {
bis = new BufferedInputStream(new FileInputStream(downLoadPath));
} catch (FileNotFoundException e) {
e.printStackTrace();
}
} else {
if (uploadFile.getContent() != null)
bis = new ByteArrayInputStream(uploadFile.getContent());
fileLength = uploadFile.getContent().length;
}
try {
if (uploadFile.getRealPath() != null&&uploadFile.getContent() == null) {
downLoadPath = ctxPath + uploadFile.getRealPath();
fileLength = new File(downLoadPath).length();
try {
bis = new BufferedInputStream(new FileInputStream(downLoadPath));
} catch (FileNotFoundException e) {
e.printStackTrace();
}
} else {
if (uploadFile.getContent() != null)
bis = new ByteArrayInputStream(uploadFile.getContent());
fileLength = uploadFile.getContent().length;
}
if (!uploadFile.isView() && uploadFile.getExtend() != null) {
if (uploadFile.getExtend().equals("text")) {
response.setContentType("text/plain;");
@ -480,6 +518,9 @@ public class CommonDao extends GenericBaseCommonDao implements ICommonDao, IGene
for (Object obj : all) {
trees.add(comboTree(obj, comboTreeModel, in, recursive));
}
all.clear();
return trees;
}
@ -515,6 +556,7 @@ public class CommonDao extends GenericBaseCommonDao implements ICommonDao, IGene
}
}
}
List curChildList = (List) reflectHelper.getMethodValue(comboTreeModel.getChildField());
if (curChildList != null && curChildList.size() > 0) {
tree.setState("closed");
@ -531,12 +573,16 @@ public class CommonDao extends GenericBaseCommonDao implements ICommonDao, IGene
}
}
if(curChildList!=null){
curChildList.clear();
}
return tree;
}
/**
*
*/
public List<TreeGrid> treegrid(List all, TreeGridModel treeGridModel) {
public List<TreeGrid> treegrid(List<?> all, TreeGridModel treeGridModel) {
List<TreeGrid> treegrid = new ArrayList<TreeGrid>();
for (Object obj : all) {
ReflectHelper reflectHelper = new ReflectHelper(obj);
@ -629,6 +675,12 @@ public class CommonDao extends GenericBaseCommonDao implements ICommonDao, IGene
String functionType = oConvertUtils.getString(reflectHelper.getMethodValue(treeGridModel.getFunctionType()));
tg.setFunctionType(functionType);
}
if(treeGridModel.getIconStyle() != null){
String iconStyle = oConvertUtils.getString(reflectHelper.getMethodValue(treeGridModel.getIconStyle()));
tg.setIconStyle(iconStyle);
}
treegrid.add(tg);
}
return treegrid;

@ -5,6 +5,7 @@ import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
@ -33,17 +34,16 @@ 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;
import org.jeecgframework.core.util.oConvertUtils;
import org.jeecgframework.tag.vo.datatable.DataTableReturn;
import org.jeecgframework.tag.vo.datatable.SortDirection;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.dao.DataAccessException;
@ -74,8 +74,7 @@ public abstract class GenericBaseCommonDao<T, PK extends Serializable>
/**
* Log4j
*/
private static final Logger logger = Logger
.getLogger(GenericBaseCommonDao.class);
private static final Logger logger = Logger.getLogger(GenericBaseCommonDao.class);
/**
* sessionFactory,(HibernateDaoSupport)
* **/
@ -173,7 +172,7 @@ public abstract class GenericBaseCommonDao<T, PK extends Serializable>
public <T> Serializable save(T entity) {
try {
Serializable id = getSession().save(entity);
getSession().flush();
//getSession().flush();
if (logger.isDebugEnabled()) {
logger.debug("保存实体成功," + entity.getClass().getName());
}
@ -195,13 +194,13 @@ public abstract class GenericBaseCommonDao<T, PK extends Serializable>
public <T> void batchSave(List<T> entitys) {
for (int i = 0; i < entitys.size(); i++) {
getSession().save(entitys.get(i));
if (i % 20 == 0) {
// 20个对象后才清理缓存写入数据库
if (i % 1000 == 0) {
// 1000个对象批量写入数据库后才清理缓存
getSession().flush();
getSession().clear();
}
}
// 最后清理一下----防止大于20小于40的不保存
//最后页面的数据,进行提交手工清理
getSession().flush();
getSession().clear();
}
@ -217,7 +216,7 @@ public abstract class GenericBaseCommonDao<T, PK extends Serializable>
public <T> void saveOrUpdate(T entity) {
try {
getSession().saveOrUpdate(entity);
getSession().flush();
//getSession().flush();
if (logger.isDebugEnabled()) {
logger.debug("添加或更新成功," + entity.getClass().getName());
}
@ -233,7 +232,7 @@ public abstract class GenericBaseCommonDao<T, PK extends Serializable>
public <T> void delete(T entity) {
try {
getSession().delete(entity);
getSession().flush();
//getSession().flush();
if (logger.isDebugEnabled()) {
logger.debug("删除成功," + entity.getClass().getName());
}
@ -251,7 +250,7 @@ public abstract class GenericBaseCommonDao<T, PK extends Serializable>
*/
public <T> void deleteEntityById(Class entityName, Serializable id) {
delete(get(entityName, id));
getSession().flush();
//getSession().flush();
}
/**
@ -264,7 +263,7 @@ public abstract class GenericBaseCommonDao<T, PK extends Serializable>
public <T> void deleteAllEntitie(Collection<T> entitys) {
for (Object entity : entitys) {
getSession().delete(entity);
getSession().flush();
//getSession().flush();
}
}
@ -290,7 +289,7 @@ public abstract class GenericBaseCommonDao<T, PK extends Serializable>
T t = (T) getSession().get(entityName, id);
if (t != null) {
getSession().flush();
//getSession().flush();
}
return t;
}
@ -303,7 +302,7 @@ public abstract class GenericBaseCommonDao<T, PK extends Serializable>
*/
public <T> void updateEntitie(T pojo) {
getSession().update(pojo);
getSession().flush();
//getSession().flush();
}
/**
@ -314,7 +313,7 @@ public abstract class GenericBaseCommonDao<T, PK extends Serializable>
*/
public <T> void updateEntitie(String className, Object id) {
getSession().update(className, id);
getSession().flush();
//getSession().flush();
}
/**
@ -335,9 +334,9 @@ public abstract class GenericBaseCommonDao<T, PK extends Serializable>
Query queryObject = getSession().createQuery(query);
List<T> list = queryObject.list();
if (list.size() > 0) {
getSession().flush();
}
// if (list.size() > 0) {
//getSession().flush();
// }
return list;
}
@ -354,7 +353,7 @@ public abstract class GenericBaseCommonDao<T, PK extends Serializable>
Query queryObject = getSession().createQuery(hql);
List<T> list = queryObject.list();
if (list.size() == 1) {
getSession().flush();
//getSession().flush();
t = list.get(0);
} else if (list.size() > 0) {
throw new BusinessException("查询结果数:" + list.size() + "大于1");
@ -682,39 +681,76 @@ public abstract class GenericBaseCommonDao<T, PK extends Serializable>
} else {
pageSize = allCounts;
}
DetachedCriteriaUtil.selectColumn(cq.getDetachedCriteria(), cq
.getField().split(","), cq.getEntityClass(), false);
return new DataTableReturn(allCounts, allCounts, cq.getDataTables()
.getEcho(), criteria.list());
//DetachedCriteriaUtil.selectColumn(cq.getDetachedCriteria(), cq.getField().split(","), cq.getEntityClass(), false);
return new DataTableReturn(allCounts, allCounts, cq.getDataTables().getEcho(), criteria.list());
}
/**
* easyui datagrid DataGridReturn
*/
public DataGridReturn getDataGridReturn(final CriteriaQuery cq,
final boolean isOffset) {
Criteria criteria = cq.getDetachedCriteria().getExecutableCriteria(
getSession());
public void getDataGridReturn(CriteriaQuery cq,final boolean isOffset) {
Criteria criteria = cq.getDetachedCriteria().getExecutableCriteria(getSession());
CriteriaImpl impl = (CriteriaImpl) criteria;
// 先把Projection和OrderBy条件取出来,清空两者来执行Count操作
Projection projection = impl.getProjection();
final int allCounts = ((Long) criteria.setProjection(
Projections.rowCount()).uniqueResult()).intValue();
// final int allCounts = ((Long) criteria.setProjection(Projections.rowCount()).uniqueResult()).intValue();
Object allCountsObj = criteria.setProjection(Projections.rowCount()).uniqueResult();
final int allCounts;
if(allCountsObj==null){
allCounts = 0;
}else{
allCounts = ((Long) allCountsObj).intValue();
}
criteria.setProjection(projection);
if (projection == null) {
criteria.setResultTransformer(CriteriaSpecification.ROOT_ENTITY);
}
if (StringUtils.isNotBlank(cq.getDataGrid().getSort())) {
cq.addOrder(cq.getDataGrid().getSort(), cq.getDataGrid().getOrder());
Map<String, Object> ordermap = cq.getOrdermap();
if(ordermap==null){
ordermap = new LinkedHashMap<String, Object>();
}
String sort = cq.getDataGrid().getSort();
if (StringUtils.isNotBlank(sort)) {
String []sortArr = sort.split(",");
String []orderArr = cq.getDataGrid().getOrder().split(",");
if(sortArr.length != orderArr.length && orderArr.length > 0){
for (int i = 0; i < sortArr.length; i++) {
if(SortDirection.asc.equals(SortDirection.toEnum(orderArr[0]))){
ordermap.put(sortArr[i], SortDirection.asc);
}else{
ordermap.put(sortArr[i], SortDirection.desc);
}
}
}else if(sortArr.length == orderArr.length){
for (int i = 0; i < sortArr.length; i++) {
if(SortDirection.asc.equals(SortDirection.toEnum(orderArr[i]))){
ordermap.put(sortArr[i], SortDirection.asc);
}else{
ordermap.put(sortArr[i], SortDirection.desc);
}
}
}
}
if(!ordermap.isEmpty() && ordermap.size()>0){
cq.setOrder(ordermap);
}
// 判断是否有排序字段
if (!cq.getOrdermap().isEmpty()) {
cq.setOrder(cq.getOrdermap());
}
// if (!cq.getOrdermap().isEmpty()) {
// cq.setOrder(cq.getOrdermap());
// }
int pageSize = cq.getPageSize();// 每页显示数
int curPageNO = PagerUtil.getcurPageNo(allCounts, cq.getCurPage(),
pageSize);// 当前页
int curPageNO = PagerUtil.getcurPageNo(allCounts, cq.getCurPage(),pageSize);// 当前页
int offset = PagerUtil.getOffset(allCounts, curPageNO, pageSize);
if (isOffset) {// 是否分页
criteria.setFirstResult(offset);
@ -724,10 +760,15 @@ public abstract class GenericBaseCommonDao<T, PK extends Serializable>
}
// DetachedCriteriaUtil.selectColumn(cq.getDetachedCriteria(),
// cq.getField().split(","), cq.getClass1(), false);
List list = criteria.list();
List<?> list = criteria.list();
cq.getDataGrid().setResults(list);
cq.getDataGrid().setTotal(allCounts);
return new DataGridReturn(allCounts, list);
cq.clear();
cq = null;
//return new DataGridReturn(allCounts, list);
}
/**
@ -875,7 +916,7 @@ public abstract class GenericBaseCommonDao<T, PK extends Serializable>
* 使For JDBC
*/
public Long getCountForJdbc(String sql) {
return this.jdbcTemplate.queryForLong(sql);
return this.jdbcTemplate.queryForObject(sql,Long.class);
}
/**
@ -883,7 +924,10 @@ public abstract class GenericBaseCommonDao<T, PK extends Serializable>
*
*/
public Long getCountForJdbcParam(String sql, Object[] objs) {
return this.jdbcTemplate.queryForLong(sql, objs);
return this.jdbcTemplate.queryForObject(sql, objs,Long.class);
}
public List<Map<String, Object>> findForJdbc(String sql, Object... objs) {
@ -907,6 +951,9 @@ public abstract class GenericBaseCommonDao<T, PK extends Serializable>
SqlParameterSource sqlp = new MapSqlParameterSource(param);
if (StringUtil.isNotEmpty(param.get("id"))) {//表示已经生成过id(UUID),则表示是非序列或数据库自增的形式
this.namedParameterJdbcTemplate.update(sql,sqlp);
//--authorzhoujf---start------date:20170216--------for:自定义表单保存数据格sqlserver报错问题
}else if (StringUtil.isNotEmpty(param.get("ID"))) {//表示已经生成过id(UUID),则表示是非序列或数据库自增的形式
this.namedParameterJdbcTemplate.update(sql,sqlp);
}else{//NATIVE or SEQUENCE
keyHolder = new GeneratedKeyHolder();
this.namedParameterJdbcTemplate.update(sql,sqlp, keyHolder, new String[]{"id"});
@ -919,7 +966,10 @@ public abstract class GenericBaseCommonDao<T, PK extends Serializable>
}
public Integer countByJdbc(String sql, Object... param) {
return this.jdbcTemplate.queryForInt(sql, param);
return this.jdbcTemplate.queryForObject(sql, param,Integer.class);
}
public Map<String, Object> findOneForJdbc(String sql, Object... objs) {
@ -973,6 +1023,7 @@ public abstract class GenericBaseCommonDao<T, PK extends Serializable>
public <T> List<T> findByDetached(DetachedCriteria dc) {
return dc.getExecutableCriteria(getSession()).list();
}
/**
*
*/
@ -986,4 +1037,5 @@ public abstract class GenericBaseCommonDao<T, PK extends Serializable>
return sqlQuery.list();
}
}

@ -135,7 +135,16 @@ public class JdbcDao extends SimpleJdbcTemplate{
sql = jeecgCreatePageSql(sql,page,rows);
return this.jdbcTemplate.queryForList(sql);
}
/**
* 使
*/
public List<Map<String, Object>> findForListMap(String sql, Map parameters, int page, int rows) {
//封装分页SQL
sql = jeecgCreatePageSql(sql,page,rows);
return super.findForListMap(sql, parameters);
}
public List<Map<String, Object>> findForJdbc(String sql, Object... objs) {
return this.jdbcTemplate.queryForList(sql,objs);
@ -193,14 +202,18 @@ public class JdbcDao extends SimpleJdbcTemplate{
* 使For JDBC
*/
public Long getCountForJdbc(String sql) {
return jdbcTemplate.queryForLong(sql);
return jdbcTemplate.queryForObject(sql,Long.class);
}
/**
* 使For JDBC-
*
*/
public Long getCountForJdbcParam(String sql,Object... objs) {
return jdbcTemplate.queryForLong(sql, objs);
return jdbcTemplate.queryForObject(sql, objs,Long.class);
}
public Integer executeSql2(String sql,List<Object> param) {
@ -212,7 +225,9 @@ public class JdbcDao extends SimpleJdbcTemplate{
}
public Integer countByJdbc(String sql, Object... param) {
return this.jdbcTemplate.queryForInt(sql, param);
return this.jdbcTemplate.queryForObject(sql, param,Integer.class);
}
/**

@ -7,8 +7,10 @@ import javax.sql.DataSource;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.core.namedparam.BeanPropertySqlParameterSource;
import org.springframework.jdbc.core.simple.ParameterizedBeanPropertyRowMapper;
import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate;
import org.springframework.jdbc.core.simple.SimpleJdbcInsert;
import org.springframework.util.Assert;
/**
@ -17,17 +19,21 @@ import org.springframework.util.Assert;
*
*/
@SuppressWarnings("unchecked")
public class SimpleJdbcTemplate {
public class SimpleJdbcTemplate extends JdbcTemplate{
protected final Log logger = LogFactory.getLog(getClass());
protected JdbcTemplate jdbcTemplate;
protected NamedParameterJdbcTemplate namedJdbcTemplate;
protected org.springframework.jdbc.core.simple.SimpleJdbcTemplate jdbcTemplate;
protected SimpleJdbcInsert simpleJdbcInsert;
public SimpleJdbcTemplate(DataSource dataSource){
jdbcTemplate=new org.springframework.jdbc.core.simple.SimpleJdbcTemplate(dataSource);
jdbcTemplate=new JdbcTemplate(dataSource);
namedJdbcTemplate = new NamedParameterJdbcTemplate(dataSource);
simpleJdbcInsert=new SimpleJdbcInsert(dataSource);
}
/**
* sql
* @param sql(select * from tb where id=:id)
@ -40,7 +46,10 @@ public class SimpleJdbcTemplate {
Assert.hasText(sql,"sql语句不正确!");
Assert.notNull(clazz,"集合中对象类型不能为空!");
if(parameters!=null){
return jdbcTemplate.query(sql, resultBeanMapper(clazz),parameters);
// return jdbcTemplate.query(sql, resultBeanMapper(clazz),parameters);
return namedJdbcTemplate.query(sql, parameters, resultBeanMapper(clazz));
}else{
return jdbcTemplate.query(sql, resultBeanMapper(clazz));
}
@ -61,9 +70,15 @@ public class SimpleJdbcTemplate {
Assert.hasText(sql,"sql语句不正确!");
Assert.notNull(clazz,"集合中对象类型不能为空!");
if(parameters!=null){
return jdbcTemplate.queryForObject(sql, resultBeanMapper(clazz), parameters);
// return jdbcTemplate.queryForObject(sql, resultBeanMapper(clazz), parameters);
return namedJdbcTemplate.queryForObject(sql, parameters, resultBeanMapper(clazz));
}else{
return jdbcTemplate.queryForLong(sql, resultBeanMapper(clazz));
return jdbcTemplate.queryForObject(sql, resultBeanMapper(clazz),Long.class);
}
}catch (Exception e) {
return null;
@ -79,11 +94,13 @@ public class SimpleJdbcTemplate {
public long findForLong(final String sql,Map parameters){
try{
Assert.hasText(sql,"sql语句不正确!");
if(parameters!=null){
return jdbcTemplate.queryForLong(sql, parameters);
return namedJdbcTemplate.queryForObject(sql, parameters,Long.class);
}else{
return jdbcTemplate.queryForLong(sql);
return jdbcTemplate.queryForObject(sql,Long.class);
}
}catch (Exception e) {
return 0;
}
@ -99,7 +116,10 @@ public class SimpleJdbcTemplate {
try{
Assert.hasText(sql,"sql语句不正确!");
if(parameters!=null){
return jdbcTemplate.queryForMap(sql, parameters);
// return jdbcTemplate.queryForMap(sql, parameters);
return namedJdbcTemplate.queryForMap(sql, parameters);
}else{
return jdbcTemplate.queryForMap(sql);
}
@ -119,7 +139,10 @@ public class SimpleJdbcTemplate {
try{
Assert.hasText(sql,"sql语句不正确!");
if(parameters!=null){
return jdbcTemplate.queryForList(sql, parameters);
// return jdbcTemplate.queryForList(sql, parameters);
return namedJdbcTemplate.queryForList(sql, parameters);
}else{
return jdbcTemplate.queryForList(sql);
}
@ -138,7 +161,10 @@ public class SimpleJdbcTemplate {
public int executeForObject(final String sql,Object bean){
Assert.hasText(sql,"sql语句不正确!");
if(bean!=null){
return jdbcTemplate.update(sql, paramBeanMapper(bean));
// return jdbcTemplate.update(sql, paramBeanMapper(bean));
return namedJdbcTemplate.update(sql, paramBeanMapper(bean));
}else{
return jdbcTemplate.update(sql);
}
@ -154,7 +180,10 @@ public class SimpleJdbcTemplate {
public int executeForMap(final String sql,Map parameters){
Assert.hasText(sql,"sql语句不正确!");
if(parameters!=null){
return jdbcTemplate.update(sql, parameters);
// return jdbcTemplate.update(sql, parameters);
return namedJdbcTemplate.update(sql, parameters);
}else{
return jdbcTemplate.update(sql);
}
@ -178,12 +207,12 @@ public class SimpleJdbcTemplate {
int[] updateCounts = jdbcTemplate.batchUpdate(sql,batch);
return updateCounts;
}
protected ParameterizedBeanPropertyRowMapper resultBeanMapper(Class clazz) {
return ParameterizedBeanPropertyRowMapper.newInstance(clazz);
protected BeanPropertyRowMapper resultBeanMapper(Class clazz) {
return BeanPropertyRowMapper.newInstance(clazz);
}
protected BeanPropertySqlParameterSource paramBeanMapper(Object object) {
return new BeanPropertySqlParameterSource(object);
}

@ -7,7 +7,10 @@ import javax.persistence.MappedSuperclass;
import org.hibernate.annotations.GenericGenerator;
@MappedSuperclass
public abstract class IdEntity {
public abstract class IdEntity implements java.io.Serializable {
private static final long serialVersionUID = 1L;
private String id;
@Id

@ -105,7 +105,7 @@ public class GlobalExceptionResolver implements HandlerExceptionResolver {
exceptionMessage = exceptionMessage.substring(0,WIRTE_DB_MAX_LENGTH);
}
}
systemService.addLog(exceptionMessage, LOG_LEVEL, LOG_OPT);
systemService.addLog(exceptionMessage, LOG_OPT,LOG_LEVEL);
}
/**
* ajax.
@ -124,12 +124,18 @@ public class GlobalExceptionResolver implements HandlerExceptionResolver {
AjaxJson json = new AjaxJson();
json.setSuccess(true);
json.setMsg(deepestException.getMessage());
PrintWriter pw = null;
try {
PrintWriter pw=response.getWriter();
pw=response.getWriter();
pw.write(JSONHelper.bean2json(json));
pw.flush();
} catch (IOException e) {
e.printStackTrace();
}finally{
try {
pw.close();
} catch (Exception e2) {
}
}
empty.clear();
return empty;

@ -0,0 +1,27 @@
/**
* @Title: MySQLServer2008Dialect.java
* @Package org.jeecgframework.core.common.hibernate.dialect
* @Description: TODO
* @author yokoboy
* @date 2016-6-7
*/
package org.jeecgframework.core.common.hibernate.dialect;
import java.sql.Types;
import org.hibernate.dialect.SQLServer2008Dialect;
import org.hibernate.type.StringType;
/**
* ClassName: MySQLServer2008Dialect
* @Description: TODO
* @author yokoboy
* @date 2016-6-7
*/
public class MySQLServer2008Dialect extends SQLServer2008Dialect {
public MySQLServer2008Dialect() {
super();
registerHibernateType(Types.NVARCHAR, StringType.INSTANCE.getName());
}
}

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

@ -1,8 +1,8 @@
package org.jeecgframework.core.common.hibernate.qbc;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
@ -15,6 +15,7 @@ import org.hibernate.transform.Transformers;
import org.hibernate.type.Type;
import org.jeecgframework.core.common.model.json.DataGrid;
import org.jeecgframework.core.util.StringUtil;
import org.jeecgframework.core.util.oConvertUtils;
import org.jeecgframework.tag.vo.datatable.DataTables;
import org.jeecgframework.tag.vo.datatable.SortDirection;
import org.jeecgframework.tag.vo.datatable.SortInfo;
@ -26,8 +27,7 @@ import org.jeecgframework.tag.vo.datatable.SortInfo;
*@date 2012-12-7 10:22:15
*@version 1.0
*/
@SuppressWarnings({"rawtypes","static-access"})
public class CriteriaQuery implements Serializable {
public class CriteriaQuery {
public CriteriaQuery() {
}
@ -41,19 +41,22 @@ public class CriteriaQuery implements Serializable {
private CriterionList jqcriterionList=new CriterionList();//jquery datatable控件生成查询条件集合
private int isUseimage = 0;// 翻页工具条样式
private DetachedCriteria detachedCriteria;
private static Map<String, Object> map;
private static Map<String, Object> ordermap;//排序字段
private Map<String, Object> map;
private Map<String, Object> ordermap;//排序字段
private boolean flag = true;// 对同一字段进行第二次重命名查询时值设置FASLE不保存重命名查询条件
private String field="";//查询需要显示的字段
private Class entityClass;//POJO
private List results;// 结果集
private Class<?> entityClass;//POJO
private List<?> results;// 结果集
private int total;
private List<String> alias = new ArrayList<String>();//保存创建的aliasName 防止重复创建
public List getResults() {
private DataGrid dataGrid;
private DataTables dataTables;
public List<?> getResults() {
return results;
}
public void setResults(List results) {
public void setResults(List<?> results) {
this.results = results;
}
@ -65,9 +68,6 @@ public class CriteriaQuery implements Serializable {
this.total = total;
}
private DataGrid dataGrid;
private DataTables dataTables;
public DataTables getDataTables() {
return dataTables;
}
@ -84,11 +84,11 @@ public class CriteriaQuery implements Serializable {
this.dataGrid = dataGrid;
}
public Class getEntityClass() {
public Class<?> getEntityClass() {
return entityClass;
}
public void setEntityClass(Class entityClass) {
public void setEntityClass(Class<?> entityClass) {
this.entityClass = entityClass;
}
public CriterionList getJqcriterionList() {
@ -99,33 +99,37 @@ public class CriteriaQuery implements Serializable {
this.jqcriterionList = jqcriterionList;
}
public CriteriaQuery(Class c) {
public CriteriaQuery(Class<?> c) {
this.detachedCriteria = DetachedCriteria.forClass(c);
this.map = new HashMap<String, Object>();
this.ordermap = new HashMap<String, Object>();
this.ordermap = new LinkedHashMap<String, Object>();
}
public CriteriaQuery(Class c, int curPage, String myAction, String myForm) {
public CriteriaQuery(Class<?> c, int curPage, String myAction, String myForm) {
this.curPage = curPage;
this.myAction = myAction;
this.myForm = myForm;
this.detachedCriteria = DetachedCriteria.forClass(c);
}
public CriteriaQuery(Class c, int curPage, String myAction) {
public CriteriaQuery(Class<?> c, int curPage, String myAction) {
this.myAction = myAction;
this.curPage = curPage;
this.detachedCriteria = DetachedCriteria.forClass(c);
this.map = new HashMap<String, Object>();
this.ordermap = new HashMap<String, Object>();
this.ordermap = new LinkedHashMap<String, Object>();
}
public CriteriaQuery(Class entityClass, int curPage) {
public CriteriaQuery(Class<?> entityClass, int curPage) {
this.curPage = curPage;
this.detachedCriteria = DetachedCriteria.forClass(entityClass);
this.map = new HashMap<String, Object>();
}
public CriteriaQuery(Class entityClass,DataGrid dg) {
public CriteriaQuery(Class<?> entityClass,DataGrid dg) {
this.curPage = dg.getPage();
//String[] fieldstring=dg.getField().split(",");
//this.detachedCriteria = DetachedCriteriaUtil
@ -138,20 +142,28 @@ public class CriteriaQuery implements Serializable {
this.dataGrid=dg;
this.pageSize=dg.getRows();
this.map = new HashMap<String, Object>();
this.ordermap = new HashMap<String, Object>();
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;
this.pageSize=dataTables.getDisplayLength();
this.map = new HashMap<String, Object>();
this.ordermap = new HashMap<String, Object>();
this.ordermap = new LinkedHashMap<String, Object>();
addJqCriteria(dataTables);
}
@ -235,7 +247,7 @@ public class CriteriaQuery implements Serializable {
}
}
public void setResultTransformer(Class class1) {
public void setResultTransformer(Class<?> class1) {
detachedCriteria.setResultTransformer(Transformers.aliasToBean(class1));
}
@ -398,12 +410,12 @@ public class CriteriaQuery implements Serializable {
}
}
public static Map<String, Object> getOrdermap() {
public Map<String, Object> getOrdermap() {
return ordermap;
}
public static void setOrdermap(Map<String, Object> ordermap) {
CriteriaQuery.ordermap = ordermap;
public void setOrdermap(Map<String, Object> ordermap) {
this.ordermap = ordermap;
}
/**
@ -585,11 +597,11 @@ public class CriteriaQuery implements Serializable {
public void between(String keyname, Object keyvalue1, Object keyvalue2) {
Criterion c = null;// 写入between查询条件
if (!keyvalue1.equals(null) && !keyvalue2.equals(null)) {
if (oConvertUtils.isNotEmpty(keyvalue1) && oConvertUtils.isNotEmpty(keyvalue2)) {
c = Restrictions.between(keyname, keyvalue1, keyvalue2);
} else if (!keyvalue1.equals(null)) {
} else if (oConvertUtils.isNotEmpty(keyvalue1)) {
c = Restrictions.ge(keyname, keyvalue1);
} else if (!keyvalue2.equals(null)) {
} else if (oConvertUtils.isNotEmpty(keyvalue2)) {
c = Restrictions.le(keyname, keyvalue2);
}
criterionList.add(c);
@ -702,4 +714,24 @@ public class CriteriaQuery implements Serializable {
this.flag = flag;
}
public void clear(){
criterionList.clear();
jqcriterionList.clear();
alias.clear();
if(map!=null){map.clear();}
if(ordermap!=null){ordermap.clear();}
entityClass=null;
dataGrid = null;
dataTables = null;
detachedCriteria = null;
criterionList = null;
jqcriterionList = null;
jqcriterionList = null;
map = null;
ordermap = null;
alias = null;
field = null;
}
}

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

@ -49,7 +49,9 @@ public class PagerUtil {
int offset = 0;
try {
if (curPageNO > (int) Math.ceil((double) rowCounts / pageSize))
curPageNO = (int) Math.ceil((double) rowCounts / pageSize);
curPageNO = (int) Math.ceil((double) rowCounts / pageSize) + 1;
// 得到第几页
if (curPageNO <= 1)
curPageNO = 1;
@ -65,7 +67,9 @@ public class PagerUtil {
try {
// 得到第几页
if (curPageNO > (int) Math.ceil((double) rowCounts / pageSize))
curPageNO = (int) Math.ceil((double) rowCounts / pageSize);
curPageNO = (int) Math.ceil((double) rowCounts / pageSize) + 1;
if (curPageNO <= 1)
curPageNO = 1;
} catch (Exception e) {

@ -2,8 +2,6 @@ package org.jeecgframework.core.common.model.common;
import java.io.Serializable;
import java.util.List;
import com.thoughtworks.xstream.annotations.XStreamAlias;
/**
*
* @author Hank

@ -1,11 +1,13 @@
package org.jeecgframework.web.demo.entity.test;
package org.jeecgframework.core.common.model.common;
import java.util.List;
import org.jeecgframework.core.util.PropertiesUtil;
import org.jeecgframework.web.cgform.common.CgAutoListConstant;
public class QueryCondition {
Integer id;
String state;
String field;
String type;
String condition;
@ -49,7 +51,25 @@ public class QueryCondition {
public void setRelation(String relation) {
this.relation = relation;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getState() {
return state;
}
public void setState(String state) {
this.state = state;
}
public String toString(){
if(field == null || "".equals(field)){
return "";
}
StringBuffer sb =new StringBuffer();
sb.append(this.relation).append(" ");
sb.append(this.field).append(" ")

@ -0,0 +1,34 @@
package org.jeecgframework.core.common.model.common;
/**
*
*
* @authorzhoujf
* @since2017-3-15 04:29:56
* @version:1.0
*/
public class TreeChildCount {
private String parentId;
private Long count;
public TreeChildCount(String parentId, Long count) {
this.parentId = parentId;
this.count = count;
}
public String getParentId() {
return parentId;
}
public void setParentId(String parentId) {
this.parentId = parentId;
}
public Long getCount() {
return count;
}
public void setCount(Long count) {
this.count = count;
}
}

@ -22,7 +22,7 @@ public class UploadFile {
private String extend = "extend";// 扩展名
private boolean view = false;// 是否是预览
private boolean rename =true;// 是否重命名
private String swfpath;// 转换SWF
private String swfpath;// 转换SWF(不设值则不转换)
private String cusPath;// 文件物理路径自定义子目录
private byte[] content;// 预览或下载时传入的文件二进制内容
private Object object;// 文件对应实体对象

@ -4,7 +4,6 @@ import java.util.List;
import org.jeecgframework.core.util.ContextHolderUtils;
import org.jeecgframework.core.util.ResourceUtil;
import org.jeecgframework.tag.vo.datatable.SortDirection;
/**
@ -18,19 +17,39 @@ public class DataGrid {
private int page = 1;// 当前页
private int rows = 10;// 每页显示记录数
private String sort = null;// 排序字段名
private SortDirection order = SortDirection.asc;// 按什么排序(asc,desc)
private String order = "asc";// 按什么排序(asc,desc)
private String field;//字段
private String treefield;//树形数据表文本字段
private List results;// 结果集
private int total;//总记录数
private String footer;//合计列
private String sqlbuilder;//合计列
//数据格式
private String dataStyle = "easyui";
public String getDataStyle() {
return dataStyle;
}
public void setDataStyle(String dataStyle) {
this.dataStyle = dataStyle;
}
public String getSqlbuilder() {
return sqlbuilder;
}
public void setSqlbuilder(String sqlbuilder) {
if(sqlbuilder.indexOf("≤") > 0) {
sqlbuilder = sqlbuilder.replace("≤", "<=");
}
this.sqlbuilder = sqlbuilder;
}
@ -85,13 +104,22 @@ public class DataGrid {
this.sort = sort;
}
public SortDirection getOrder() {
// public SortDirection getOrder() {
// return order;
// }
//
// public void setOrder(SortDirection order) {
// this.order = order;
// }
public String getOrder() {
return order;
}
public void setOrder(SortDirection order) {
public void setOrder(String order) {
this.order = order;
}
public String getTreefield() {
return treefield;
}
@ -108,4 +136,14 @@ public class DataGrid {
this.footer = footer;
}
public void clear(){
if(results!=null){
results.clear();
results = null;
}
field = null;
treefield = null;
}
}

@ -10,15 +10,15 @@ import java.util.List;
*/
public class DataGridReturn {
private Integer total;// 总记录数
private List rows;// 每行记录
private List footer;
public DataGridReturn(Integer total, List rows) {
this.total = total;
this.rows = rows;
}
private Integer total;// 总记录数
private List rows;// 每行记录
private List footer;
public Integer getTotal() {
return total;
}

@ -19,6 +19,9 @@ public class TreeGrid implements java.io.Serializable {
private String order;//排序
private Map<String, Object> fieldMap; // 存储实体字段信息容器: key-字段名称value-字段值
private String functionType;// 其他参数
private String iconStyle;//菜单图表样式
public String getFunctionType() {
return functionType;
@ -116,20 +119,31 @@ public class TreeGrid implements java.io.Serializable {
", 'operations':'" + operations + '\'' +
", 'state':'" + state + '\'' +
", 'order':'" + order + '\'' +
", 'iconStyle':'" + iconStyle + '\'' +
assembleFieldsJson() +
'}';
}
private String assembleFieldsJson() {
String fieldsJson = ", 'fieldMap':" + fieldMap;
String fieldsJson = ", 'fieldMap':" + JSON.toJSON(fieldMap);
if (fieldMap != null && fieldMap.size() > 0) {
Map<String, Object> resultMap = new HashMap<String, Object>();
for (Map.Entry<String, Object> entry : fieldMap.entrySet()) {
resultMap.put("fieldMap." + entry.getKey(), entry.getValue());
}
fieldsJson = ", " + JSON.toJSON(resultMap).toString().replace("{", "").replace("}", "");
fieldsJson += ", " + JSON.toJSON(resultMap).toString().replace("{", "").replace("}", "");
}
return fieldsJson;
}
public String getIconStyle() {
return iconStyle;
}
public void setIconStyle(String iconStyle) {
this.iconStyle = iconStyle;
}
}

@ -0,0 +1,24 @@
package org.jeecgframework.core.common.service;
import java.util.Collection;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
/**
*
* @Title:CgReportExcelServiceI
* @description:excel
* @author
* @date Aug 1, 2013 8:53:54 AM
* @version V1.0
*/
public interface CommonExcelServiceI extends CommonService{
/**
*
* @param title
* @param titleSet
* @param dataSet
* @return
*/
public HSSFWorkbook exportExcel(String title, Collection<?> titleSet,Collection<?> dataSet);
}

@ -181,9 +181,11 @@ public interface CommonService {
* @param isOffset
* @return
*/
public DataGridReturn getDataGridReturn(final CriteriaQuery cq,
public void getDataGridReturn(CriteriaQuery cq,
final boolean isOffset);
/**
*
* hqlQuery
@ -247,6 +249,7 @@ public interface CommonService {
public void parserXml(String fileName);
public List<ComboTree> comTree(List<TSDepart> all, ComboTree comboTree);
/**
* JSON
*
@ -257,6 +260,7 @@ public interface CommonService {
*/
public List<ComboTree> ComboTree(List all, ComboTreeModel comboTreeModel, List in, boolean recursive);
/**
*
*
@ -264,7 +268,7 @@ public interface CommonService {
* @param treeGridModel
* @return
*/
public List<TreeGrid> treegrid(List all, TreeGridModel treeGridModel);
public List<TreeGrid> treegrid(List<?> all, TreeGridModel treeGridModel);
/**
*
@ -334,7 +338,7 @@ public interface CommonService {
* 使For JDBC-
*
*/
public Long getCountForJdbcParam(String sql, Object[] objs);
public Long getCountForJdbcParam(String sql, Object... objs);
/**
* hql
@ -349,6 +353,7 @@ public interface CommonService {
int maxResult);
public <T> List<T> findByDetached(DetachedCriteria dc);
/**
*
* @param executeSql
@ -356,4 +361,5 @@ public interface CommonService {
* @return
*/
public <T> List<T> executeProcedure(String procedureSql,Object... params);
}

@ -0,0 +1,140 @@
package org.jeecgframework.core.common.service.impl;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import org.apache.poi.hssf.usermodel.HSSFCellStyle;
import org.apache.poi.hssf.usermodel.HSSFRichTextString;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.hssf.util.HSSFColor;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.CellStyle;
import org.apache.poi.ss.usermodel.RichTextString;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.jeecgframework.core.common.service.CommonExcelServiceI;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@Service(value="cgReportExcelService")
@Transactional
public class CommonExcelServiceImpl extends CommonServiceImpl implements
CommonExcelServiceI {
@SuppressWarnings("unchecked")
public HSSFWorkbook exportExcel(String title, Collection<?> titleSet,
Collection<?> dataSet) {
// 声明一个工作薄
HSSFWorkbook workbook = null;
try {
// 首先检查数据看是否是正确的
if (titleSet == null || titleSet.size() == 0) {
throw new Exception("读取表头失败!");
}
if (title == null) {
title = "";
}
// 声明一个工作薄
workbook = new HSSFWorkbook();
// 生成一个表格
Sheet sheet = workbook.createSheet(title);
int rindex = 0;
int cindex = 0;
// 产生表格标题行
Row row = sheet.createRow(rindex);
row.setHeight((short) 450);
CellStyle titleStyle = getTitleStyle(workbook);
// Iterator itTitle = titleSet.iterator();
List<Map> titleList = (List<Map>) titleSet;
Iterator itData = dataSet.iterator();
//遍历标题行
for(Map titleM : titleList){
String titleContent = (String) titleM.get("field_txt");
Cell cell = row.createCell(cindex);
RichTextString text = new HSSFRichTextString(titleContent);
cell.setCellValue(text);
cell.setCellStyle(titleStyle);
cindex++;
}
HSSFCellStyle bodyStyle = getOneStyle(workbook);
//遍历内容
while (itData.hasNext()) {
cindex = 0;
rindex++;
row = sheet.createRow(rindex);
Map dataM = (Map) itData.next();//获取每一行的内容
for(Map titleM : titleList){
String field = (String) titleM.get("field_name");
String content = dataM.get(field)==null?"":dataM.get(field).toString();
Cell cell = row.createCell(cindex);
RichTextString text = new HSSFRichTextString(content);
cell.setCellStyle(bodyStyle);
cell.setCellValue(text);
cindex++;
}
}
for(int i=0; i<titleList.size(); i++){
sheet.autoSizeColumn(i);
}
} catch (Exception e) {
e.printStackTrace();
}
return workbook;
}
/**
* exce
* @param workbook
* @return
*/
public static HSSFCellStyle getTitleStyle(HSSFWorkbook workbook) {
// 产生Excel表头
HSSFCellStyle titleStyle = workbook.createCellStyle();
titleStyle.setBorderLeft(HSSFCellStyle.BORDER_THIN); // 左边框
titleStyle.setBorderRight(HSSFCellStyle.BORDER_THIN); // 右边框
titleStyle.setBorderBottom(HSSFCellStyle.BORDER_THIN); // 底边框
titleStyle.setBorderTop(HSSFCellStyle.BORDER_THIN); // 顶边框
titleStyle.setAlignment(HSSFCellStyle.ALIGN_CENTER);
titleStyle.setFillForegroundColor(HSSFColor.GREY_25_PERCENT.index); // 填充的背景颜色
titleStyle.setFillPattern(HSSFCellStyle.SOLID_FOREGROUND); // 填充图案
return titleStyle;
}
//生成多少行的带有比边框的空行
public static void setBlankRows(int rows,int columns,HSSFWorkbook workbook){
//得到第一页
Sheet sheet = workbook.getSheetAt(0);
//样式
CellStyle cellStyle = getOneStyle(workbook);
for (int i = 1; i <=rows; i++) {
Row row = sheet.createRow(i);
for (int j = 0; j < columns; j++) {
row.createCell(j).setCellStyle(cellStyle);
}
}
}
public static HSSFCellStyle getTwoStyle(HSSFWorkbook workbook) {
// 产生Excel表头
HSSFCellStyle style = workbook.createCellStyle();
style.setBorderLeft((short) 1); // 左边框
style.setBorderRight((short) 1); // 右边框
style.setBorderBottom((short) 1);
style.setBorderTop((short) 1);
style.setFillForegroundColor(HSSFColor.LIGHT_TURQUOISE.index); // 填充的背景颜色
style.setFillPattern(HSSFCellStyle.SOLID_FOREGROUND); // 填充图案
return style;
}
public static HSSFCellStyle getOneStyle(HSSFWorkbook workbook) {
// 产生Excel表头
HSSFCellStyle style = workbook.createCellStyle();
style.setBorderLeft((short) 1); // 左边框
style.setBorderRight((short) 1); // 右边框
style.setBorderBottom((short) 1);
style.setBorderTop((short) 1);
return style;
}
}

@ -8,7 +8,6 @@ import java.util.Map;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import org.jeecgframework.web.system.pojo.base.TSDepart;
import org.hibernate.Session;
import org.hibernate.criterion.DetachedCriteria;
import org.jeecgframework.core.common.dao.ICommonDao;
@ -18,7 +17,6 @@ import org.jeecgframework.core.common.hibernate.qbc.PageList;
import org.jeecgframework.core.common.model.common.DBTable;
import org.jeecgframework.core.common.model.common.UploadFile;
import org.jeecgframework.core.common.model.json.ComboTree;
import org.jeecgframework.core.common.model.json.DataGridReturn;
import org.jeecgframework.core.common.model.json.ImportFile;
import org.jeecgframework.core.common.model.json.TreeGrid;
import org.jeecgframework.core.common.service.CommonService;
@ -26,6 +24,7 @@ import org.jeecgframework.tag.vo.datatable.DataTableReturn;
import org.jeecgframework.tag.vo.easyui.Autocomplete;
import org.jeecgframework.tag.vo.easyui.ComboTreeModel;
import org.jeecgframework.tag.vo.easyui.TreeGridModel;
import org.jeecgframework.web.system.pojo.base.TSDepart;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -39,10 +38,12 @@ public class CommonServiceImpl implements CommonService {
*
* @return
*/
@Transactional(readOnly = true)
public List<DBTable> getAllDbTableName() {
return commonDao.getAllDbTableName();
}
@Transactional(readOnly = true)
public Integer getAllDbTableSize() {
return commonDao.getAllDbTableSize();
}
@ -82,6 +83,7 @@ public class CommonServiceImpl implements CommonService {
/**
*
*/
@Transactional(readOnly = true)
public <T> T get(Class<T> class1, Serializable id) {
return commonDao.get(class1, id);
}
@ -94,6 +96,7 @@ public class CommonServiceImpl implements CommonService {
* @param size
* @return
*/
@Transactional(readOnly = true)
public <T> List<T> getList(Class clas) {
return commonDao.loadAll(clas);
}
@ -101,6 +104,7 @@ public class CommonServiceImpl implements CommonService {
/**
*
*/
@Transactional(readOnly = true)
public <T> T getEntity(Class entityName, Serializable id) {
return commonDao.getEntity(entityName, id);
}
@ -114,6 +118,7 @@ public class CommonServiceImpl implements CommonService {
* @param value
* @return
*/
@Transactional(readOnly = true)
public <T> T findUniqueByProperty(Class<T> entityClass,
String propertyName, Object value) {
return commonDao.findUniqueByProperty(entityClass, propertyName, value);
@ -122,6 +127,7 @@ public class CommonServiceImpl implements CommonService {
/**
* .
*/
@Transactional(readOnly = true)
public <T> List<T> findByProperty(Class<T> entityClass,
String propertyName, Object value) {
@ -135,10 +141,12 @@ public class CommonServiceImpl implements CommonService {
* @param entityClass
* @return
*/
@Transactional(readOnly = true)
public <T> List<T> loadAll(final Class<T> entityClass) {
return commonDao.loadAll(entityClass);
}
@Transactional(readOnly = true)
public <T> T singleResult(String hql) {
return commonDao.singleResult(hql);
}
@ -171,6 +179,7 @@ public class CommonServiceImpl implements CommonService {
* @param query
* @return
*/
@Transactional(readOnly = true)
public <T> List<T> findByQueryString(String hql) {
return commonDao.findByQueryString(hql);
}
@ -192,6 +201,7 @@ public class CommonServiceImpl implements CommonService {
* @param query
* @return
*/
@Transactional(readOnly = true)
public <T> List<T> findListbySql(String query) {
return commonDao.findListbySql(query);
}
@ -203,6 +213,7 @@ public class CommonServiceImpl implements CommonService {
* @param clas
* @return
*/
@Transactional(readOnly = true)
public <T> List<T> findByPropertyisOrder(Class<T> entityClass,
String propertyName, Object value, boolean isAsc) {
return commonDao.findByPropertyisOrder(entityClass, propertyName,
@ -217,6 +228,7 @@ public class CommonServiceImpl implements CommonService {
* @param isOffset
* @return
*/
@Transactional(readOnly = true)
public PageList getPageList(final CriteriaQuery cq, final boolean isOffset) {
return commonDao.getPageList(cq, isOffset);
}
@ -228,6 +240,7 @@ public class CommonServiceImpl implements CommonService {
* @param isOffset
* @return
*/
@Transactional(readOnly = true)
public DataTableReturn getDataTableReturn(final CriteriaQuery cq,
final boolean isOffset) {
return commonDao.getDataTableReturn(cq, isOffset);
@ -240,9 +253,12 @@ public class CommonServiceImpl implements CommonService {
* @param isOffset
* @return
*/
public DataGridReturn getDataGridReturn(final CriteriaQuery cq,
@Transactional(readOnly = true)
public void getDataGridReturn(final CriteriaQuery cq,
final boolean isOffset) {
return commonDao.getDataGridReturn(cq, isOffset);
commonDao.getDataGridReturn(cq, isOffset);
}
/**
@ -253,6 +269,7 @@ public class CommonServiceImpl implements CommonService {
* @param isOffset
* @return
*/
@Transactional(readOnly = true)
public PageList getPageList(final HqlQuery hqlQuery,
final boolean needParameter) {
return commonDao.getPageList(hqlQuery, needParameter);
@ -266,6 +283,7 @@ public class CommonServiceImpl implements CommonService {
* @param isOffset
* @return
*/
@Transactional(readOnly = true)
public PageList getPageListBySql(final HqlQuery hqlQuery,
final boolean isToEntity) {
return commonDao.getPageListBySql(hqlQuery, isToEntity);
@ -277,6 +295,7 @@ public class CommonServiceImpl implements CommonService {
return commonDao.getSession();
}
@Transactional(readOnly = true)
public List findByExample(final String entityName,
final Object exampleEntity) {
return commonDao.findByExample(entityName, exampleEntity);
@ -289,6 +308,7 @@ public class CommonServiceImpl implements CommonService {
* @param cq
* @return
*/
@Transactional(readOnly = true)
public <T> List<T> getListByCriteriaQuery(final CriteriaQuery cq,
Boolean ispage) {
return commonDao.getListByCriteriaQuery(cq, ispage);
@ -303,6 +323,7 @@ public class CommonServiceImpl implements CommonService {
return commonDao.uploadFile(uploadFile);
}
@Transactional(readOnly = true)
public HttpServletResponse viewOrDownloadFile(UploadFile uploadFile)
{
@ -330,10 +351,12 @@ public class CommonServiceImpl implements CommonService {
commonDao.parserXml(fileName);
}
@Transactional(readOnly = true)
public List<ComboTree> comTree(List<TSDepart> all, ComboTree comboTree) {
return commonDao.comTree(all, comboTree);
}
@Transactional(readOnly = true)
public List<ComboTree> ComboTree(List all, ComboTreeModel comboTreeModel, List in, boolean recursive) {
return commonDao.ComboTree(all, comboTreeModel, in, recursive);
}
@ -341,7 +364,8 @@ public class CommonServiceImpl implements CommonService {
/**
*
*/
public List<TreeGrid> treegrid(List all, TreeGridModel treeGridModel) {
@Transactional(readOnly = true)
public List<TreeGrid> treegrid(List<?> all, TreeGridModel treeGridModel) {
return commonDao.treegrid(all, treeGridModel);
}
@ -351,17 +375,14 @@ public class CommonServiceImpl implements CommonService {
* @param <T>
* @return
*/
@Transactional(readOnly = true)
public <T> List<T> getAutoList(Autocomplete autocomplete) {
StringBuffer sb = new StringBuffer("");
for (String searchField : autocomplete.getSearchField().split(",")) {
sb.append(" or " + searchField + " like '%"
+ autocomplete.getTrem() + "%' ");
sb.append(" or " + searchField + " like '%"+ autocomplete.getTrem() + "%' ");
}
String hql = "from " + autocomplete.getEntityName() + " where 1!=1 "
+ sb.toString();
return commonDao.getSession().createQuery(hql)
.setFirstResult(autocomplete.getCurPage() - 1)
.setMaxResults(autocomplete.getMaxRows()).list();
String hql = "from " + autocomplete.getEntityName() + " where 1!=1 "+ sb.toString();
return commonDao.getSession().createQuery(hql).setFirstResult(autocomplete.getCurPage() - 1).setMaxResults(autocomplete.getMaxRows()).list();
}
@ -383,37 +404,39 @@ public class CommonServiceImpl implements CommonService {
return commonDao.executeSqlReturnKey(sql, param);
}
@Transactional(readOnly = true)
public List<Map<String, Object>> findForJdbc(String sql, int page, int rows) {
return commonDao.findForJdbc(sql, page, rows);
}
@Transactional(readOnly = true)
public List<Map<String, Object>> findForJdbc(String sql, Object... objs) {
return commonDao.findForJdbc(sql, objs);
}
@Transactional(readOnly = true)
public List<Map<String, Object>> findForJdbcParam(String sql, int page,
int rows, Object... objs) {
return commonDao.findForJdbcParam(sql, page, rows, objs);
}
@Transactional(readOnly = true)
public <T> List<T> findObjForJdbc(String sql, int page, int rows,
Class<T> clazz) {
return commonDao.findObjForJdbc(sql, page, rows, clazz);
}
@Transactional(readOnly = true)
public Map<String, Object> findOneForJdbc(String sql, Object... objs) {
return commonDao.findOneForJdbc(sql, objs);
}
@Transactional(readOnly = true)
public Long getCountForJdbc(String sql) {
return commonDao.getCountForJdbc(sql);
}
public Long getCountForJdbcParam(String sql, Object[] objs) {
@Transactional(readOnly = true)
public Long getCountForJdbcParam(String sql, Object... objs) {
return commonDao.getCountForJdbcParam(sql,objs);
}
@ -429,22 +452,27 @@ public class CommonServiceImpl implements CommonService {
* @param query
* @return
*/
@Transactional(readOnly = true)
public <T> List<T> findHql(String hql, Object... param) {
return this.commonDao.findHql(hql, param);
}
@Transactional(readOnly = true)
public <T> List<T> pageList(DetachedCriteria dc, int firstResult,
int maxResult) {
return this.commonDao.pageList(dc, firstResult, maxResult);
}
@Transactional(readOnly = true)
public <T> List<T> findByDetached(DetachedCriteria dc) {
return this.commonDao.findByDetached(dc);
}
/**
*
*/
public <T> List<T> executeProcedure(String procedureSql,Object... params) {
return this.commonDao.executeProcedure(procedureSql, params);
}
}

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

@ -127,6 +127,15 @@ public interface DataBaseConstant {
*
*/
public static final String UPDATE_TIME_TABLE = "update_time";
/**
*
*/
public static final String BPM_STATUS = "bpmStatus";
/**
*
*/
public static final String BPM_STATUS_TABLE = "bpm_status";
//*********系统建表标准字段****************************************
//****************************************************************************************
}

@ -15,84 +15,115 @@ public final class Globals {
/**
* SESSION
*/
public static String USER_SESSION="USER_SESSION";
public static final String USER_SESSION="USER_SESSION";
/**
*
*/
public static Short User_Normal=1;//正常
public static Short User_Forbidden=0;//禁用
public static Short User_ADMIN=-1;//超级管理员
public static final Short User_Normal=1;//正常
public static final Short User_Forbidden=0;//禁用
public static final Short User_ADMIN=-1;//超级管理员
/**
* 1
*/
public static final String USER_TYPE_SYSTEM = "1";
/**
* 2
*
*/
public static final String USER_TYPE_INTERFACE = "2";
/**
*
*/
/**
*
*/
public static final Short Delete_Forbidden=1;
/**
*
*/
public static final Short Delete_Normal=0;
/**
*
*/
public static Short Log_Leavel_INFO=1;
public static Short Log_Leavel_WARRING=2;
public static Short Log_Leavel_ERROR=3;
public static final Short Log_Leavel_INFO=1;
public static final Short Log_Leavel_WARRING=2;
public static final Short Log_Leavel_ERROR=3;
/**
*
*/
public static Short Log_Type_LOGIN=1; //登陆
public static Short Log_Type_EXIT=2; //退出
public static Short Log_Type_INSERT=3; //插入
public static Short Log_Type_DEL=4; //删除
public static Short Log_Type_UPDATE=5; //更新
public static Short Log_Type_UPLOAD=6; //上传
public static Short Log_Type_OTHER=7; //其他
public static final Short Log_Type_LOGIN=1; //登陆
public static final Short Log_Type_EXIT=2; //退出
public static final Short Log_Type_INSERT=3; //插入
public static final Short Log_Type_DEL=4; //删除
public static final Short Log_Type_UPDATE=5; //更新
public static final Short Log_Type_UPLOAD=6; //上传
public static final Short Log_Type_OTHER=7; //其他
/**
*
*/
public static String TypeGroup_Database="database";//数据表分类
public static final String TypeGroup_Database="database";//数据表分类
/**
*
*/
public static Short Function_Leave_ONE=0;//一级权限
public static Short Function_Leave_TWO=1;//二级权限
public static final Short Function_Leave_ONE=0;//一级权限
public static final Short Function_Leave_TWO=1;//二级权限
/**
*
*/
public static String Function_Order_ONE="ofun";//一级权限
public static String Function_Order_TWO="tfun";//二级权限
public static final String Function_Order_ONE="ofun";//一级权限
public static final String Function_Order_TWO="tfun";//二级权限
/**
*
*/
public static Short Function_TYPE_PAGE=0;//页面(菜单:菜单类型
public static Short Function_TYPE_FROM=1;//表单/或者弹出(菜单:访问类型)
public static final Short Function_TYPE_PAGE=0;//菜单:菜单类型
public static final Short Function_TYPE_FROM=1;//菜单:权限类型(权限使用,不作为菜单首页加载)
/**
* code
*/
public static String NOAUTO_OPERATIONCODES ="noauto_operationCodes";
public static final String NOAUTO_OPERATIONCODES ="noauto_operationCodes";
/**
* code
*/
public static String OPERATIONCODES ="operationCodes";
public static final String OPERATIONCODES ="operationCodes";
/**
*
*/
public static Short OPERATION_TYPE_HIDE = 0;//页面
public static Short OPERATION_TYPE_DISABLED = 1;//表单/或者弹出
public static final Short OPERATION_TYPE_HIDE = 0;//页面
public static final Short OPERATION_TYPE_DISABLED = 1;//表单/或者弹出
/**
* -
*/
public static String MENU_DATA_AUTHOR_RULES ="MENU_DATA_AUTHOR_RULES";
public static final String MENU_DATA_AUTHOR_RULES ="MENU_DATA_AUTHOR_RULES";
/**
* - sql
*/
public static String MENU_DATA_AUTHOR_RULE_SQL ="MENU_DATA_AUTHOR_RULE_SQL";
public static final String MENU_DATA_AUTHOR_RULE_SQL ="MENU_DATA_AUTHOR_RULE_SQL";
/**
*
*/
public static Short Document_NEW=0; //新建
public static Short Document_PUBLICH=0; //发布
public static final Short Document_NEW=0; //新建
public static final Short Document_PUBLICH=0; //发布
/**
*
*/
public static final String MAIL_STATUS_UNSEND ="00"; //草稿
public static final String MAIL_STATUS_SEND ="01"; //已发送
public static final String MAIL_STATUS_DEL ="02"; //删除 已发送的邮件不能真正删除,不然接收人就看不到邮件了。
public static final String MAILRECEIVER_STATUS_UNREAD ="00"; //未读
public static final String MAILRECEIVER_STATUS_READ ="01";//已读
/**
*

@ -0,0 +1,106 @@
package org.jeecgframework.core.enums;
import org.jeecgframework.core.util.oConvertUtils;
/**
* ,code (add addOne)
*
* @author taoYan
* @since 20171225
*/
//addSingle,editSingle,batchDel,save,reject,template,importe,export,filter
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")
,addSingle("addSingle","新增","iframeGoAdd","fa fa-plus")
,editSingle("editSingle","编辑","iframeGoUpdate","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;
String title;
String fun;
String icon;
MenuButtonsEnum(String code, String title, String fun, String icon) {
this.code = code;
this.title = title;
this.fun = fun;
this.icon = icon;
}
public static MenuButtonsEnum getMenuByCode(String code){
if(oConvertUtils.isNotEmpty(code)){
for (MenuButtonsEnum e : MenuButtonsEnum.values()) {
if(code.equals(e.code)){
return e;
}
}
}
return null;
}
/**
* @return the code
*/
public String getCode() {
return code;
}
/**
* @param code the code to set
*/
public void setCode(String code) {
this.code = code;
}
/**
* @return the title
*/
public String getTitle() {
return title;
}
/**
* @param title the title to set
*/
public void setTitle(String title) {
this.title = title;
}
/**
* @return the fun
*/
public String getFun() {
return fun;
}
/**
* @param fun the fun to set
*/
public void setFun(String fun) {
this.fun = fun;
}
/**
* @return the icon
*/
public String getIcon() {
return icon;
}
/**
* @param icon the icon to set
*/
public void setIcon(String icon) {
this.icon = icon;
}
}

@ -0,0 +1,174 @@
package org.jeecgframework.core.enums;
import org.jeecgframework.core.util.StringUtil;
/**
*
*
* @author zhoujf
*/
public enum OnlineGenerateEnum {
/**
* ext
* code src/main/resources/jeecg/ext-template/{code:}
* code = default.single -> src/main/resources/jeecg/ext-template/default/single
*/
// ONLINE_COMMON_TABLE_SINGLE("table.single","可自定义TABLE风格模板","single","ext-common"),
// ONLINE_COMMON_TABLE_ONETOMANY("table.onetomany","可自定义TABLE风格模板","onetomany","ext-common"),
//***********{新一代代码生成器模板}**********************************************
ONLINE_COMMON_BOOTSTRAP_SINGLE("bootstrap.single","Bootstrap表单+EasyUI标签列表","single","ext-common",false),
ONLINE_COMMON_BOOTSTRAP_ONETOMANY("bootstrap.onetomany","Bootstrap表单+EasyUI标签列表","onetomany","ext-common",false),
ONLINE_COMMON_NATUREBT_SINGLE("naturebt.single","Bootstrap表单+EasyUI原生列表","single","ext-common",false),
ONLINE_COMMON_NATUREBT_ONETOMANY("naturebt.onetomany","ElementUI表单+EasyUI原生列表","onetomany","ext-common",false),
ONLINE_COMMON_BOOTSTRAPTABLEUI_SINGLE("bootstraptableUI.single","Boostrap表单+BootstapTable标签列表","single","ext-common",false),
ONLINE_COMMON_BOOTSTRAPTABLEUI_ONETOMANY("bootstraptableUI.onetomany","Boostrap表单+BootstapTable标签列表","onetomany","ext-common",false),
ONLINE_COMMON_BOOTSTRAPTABLE_SINGLE("bootstraptable.single","Bootstrap表单+BootstrapTable原生列表","single","ext-common",false),
ONLINE_COMMON_BOOTSTRAPTABLE_ONETOMANY("bootstraptable.onetomany","Bootstrap表单+BootstrapTable原生列表","onetomany","ext-common",false),
//船舶订制版本
ONLINE_MULTI_TABLE_ONETOMANY("multitable.onetomany","Table风格表单+EasyUI标签列表(ERP上下布局风格)","onetomany","ext-common",false),
//ElementUI风格(VUE)
ONLINE_COMMON_ELEMENT_SINGLE("element.single","VUE+ElementUI风格","single","ext-common",false),
ONLINE_COMMON_ELEMENT_ONETOMANY("element.onetomany","VUE+ElementUI风格","onetomany","ext-common",false),
//***********{老版本代码生成器模板}**********************************************
ONLINE_TABLE_SINGLE("table.single","TABLE风格表单","single","ext",true),
ONLINE_TABLE_ONETOMANY("table.onetomany","TABLE风格表单","onetomany","ext",false),
ONLINE_ACE_SINGLE("ace.single","ACE风格表单","single","ext",true),
ONLINE_ACE_ONETOMANY("ace.onetomany","ACE风格表单","onetomany","ext",false),
ONLINE_DIV_SINGLE("div.single","DIV风格表单","single","ext",true),
ONLINE_NOPOP_SINGLE("nopop.single","NOPOP风格表单","single","ext",false),
ONLINE_ROW_SINGLE("rowedit.single","行编辑风格表单","single","ext",false),
ONLINE_TAB_ONETOMANY("tab.onetomany","TAB风格表单","onetomany","ext",false);
//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");
/**
* system:
*/
// ONLINE_03("03","TABLE风格(form)","onetomany", "system"),
// ONLINE_01("01","TABLE风格(form)","single", "system"),
// ONLINE_02("02","DIV风格(form)","single", "system"),
// ONLINE_05("05","BootStrap风格(form)","single", "system"),
// ONLINE_06("06","BootStrap风格(form)","onetomany","system");
// ONLINE_04("04","自定义模板(form)","single", "system"),
/*ONLINE_07("07","nopopform风格","single","system"),*/
/**
*
*/
private String code;
/**
*
*/
private String desc;
/**
* single onetomany
*/
private String formType;
/**
* system , ext
*/
private String version;
/**
*
*/
private boolean supportTreegrid;
private OnlineGenerateEnum(String code, String desc, String formType, String version,boolean supportTreegrid) {
this.code = code;
this.desc = desc;
this.formType = formType;
this.version = version;
this.supportTreegrid = supportTreegrid;
}
public String getDesc() {
return desc;
}
public void setDesc(String desc) {
this.desc = desc;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getFormType() {
return formType;
}
public void setFormType(String formType) {
this.formType = formType;
}
public String getVersion() {
return version;
}
public void setVersion(String version) {
this.version = version;
}
public boolean isSupportTreegrid() {
return supportTreegrid;
}
public void setSupportTreegrid(boolean supportTreegrid) {
this.supportTreegrid = supportTreegrid;
}
public static OnlineGenerateEnum toEnum(String code) {
if(StringUtil.isEmpty(code)){
return null;
}
for(OnlineGenerateEnum item : OnlineGenerateEnum.values()) {
if(item.getCode().equals(code)) {
return item;
}
}
return null;
}
public static OnlineGenerateEnum toEnum(String code, String version) {
if(StringUtil.isEmpty(code)){
return null;
}
if(StringUtil.isEmpty(version)){
return null;
}
for(OnlineGenerateEnum item : OnlineGenerateEnum.values()) {
if(item.getCode().equals(code)&&item.getVersion().equals(version)) {
return item;
}
}
return null;
}
}

@ -0,0 +1,32 @@
package org.jeecgframework.core.enums;
/**
*
*
*/
public enum Permission {
/**普通权限*/
NORMAL("0","默认"),
/**跳过认证*/
SKIP_AUTH("1","跳过拦截");
private Permission(String key, String desc) {
this.key = key;
this.desc = desc;
}
private String key;
private String desc;
public String getKey() {
return key;
}
public void setKey(String key) {
this.key = key;
}
public String getDesc() {
return desc;
}
public void setDesc(String desc) {
this.desc = desc;
}
}

@ -0,0 +1,54 @@
package org.jeecgframework.core.enums;
import java.io.File;
import org.jeecgframework.core.util.oConvertUtils;
/**
*
* @author sundonghui
*
*/
public enum StoreUploadFilePathEnum {
PHOTOSUCAI("photosucai", "upload"+File.separator+"img"+File.separator+"photosucai"),
DEFAULT("default", "upload"+File.separator+"files");
private String name;
private String path;
// 构造方法
private StoreUploadFilePathEnum(String name, String path) {
this.name = name;
this.path = path;
}
//获取路径
public static String getPath(String name) {
if(oConvertUtils.isNotEmpty(name)){
for (StoreUploadFilePathEnum storePath : StoreUploadFilePathEnum.values()) {
if (storePath.getName().equals(name)) {
return storePath.path;
}
}
}
return DEFAULT.path;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getPath() {
return path;
}
public void setPath(String path) {
this.path = path;
}
}

@ -0,0 +1,86 @@
package org.jeecgframework.core.enums;
import org.jeecgframework.core.util.StringUtil;
/**
* ACE
*
* @author zhoujf
*/
public enum SysACEIconEnum {
default_icon("default","icon-list-alt", "默认"),
back_icon("back","icon-briefcase", "返回"),
pie_icon("pie","icon-bar-chart", "小饼状图"),
pictures_icon("pictures","icon-picture", "图片"),
pencil_icon("pencil","icon-edit", "笔"),
map_icon("map","icon-globe", "小地图"),
group_add_icon("group_add","icon-group", "组"),
calculator_icon("calculator","icon-desktop", "计算器"),
folder_icon("folder","icon-list","文件夹");
/**
*
*/
private String style;
/**
*
*/
private String themes;
/**
*
*/
private String desc;
private SysACEIconEnum(String style, String themes, String desc) {
this.style = style;
this.themes = themes;
this.desc = desc;
}
public String getStyle() {
return style;
}
public void setStyle(String style) {
this.style = style;
}
public String getThemes() {
return themes;
}
public void setThemes(String themes) {
this.themes = themes;
}
public String getDesc() {
return desc;
}
public void setDesc(String desc) {
this.desc = desc;
}
public static SysACEIconEnum toEnum(String style) {
if (StringUtil.isEmpty(style)) {
//默认风格
return default_icon;
}
for(SysACEIconEnum item : SysACEIconEnum.values()) {
if(item.getStyle().equals(style)) {
return item;
}
}
//默认风格
return default_icon;
}
public String toString() {
return "{style: " + style + ", themes: " + themes + ", desc: " + desc +"}";
}
}

@ -1,5 +1,8 @@
package org.jeecgframework.core.enums;
import javax.servlet.http.HttpServletRequest;
import org.jeecgframework.core.util.ContextHolderUtils;
import org.jeecgframework.core.util.StringUtil;
/**
@ -12,8 +15,11 @@ public enum SysThemesEnum {
DEFAULT_STYLE("default","main/main","default", "经典风格"),
SHORTCUT_STYLE("shortcut","main/shortcut_main","default", "ShortCut风格"),
SLIDING_STYLE("sliding","main/sliding_main","default", "Sliding云桌面"),
ACE_STYLE("ace","main/ace_main","metro", "ACE平面风格");
ACE_STYLE("ace","main/ace_main","metro", "ACE平面风格"),
ACE_LE_STYLE("acele","main/ace_main","metrole", "ACE2风格"),
DIY("diy","main/diy","default","diy风格"),
HPLUS("hplus","main/hplus_main","metrole","H+风格"),
FINEUI_STYLE("fineui","main/fineui_main","metrole", "fineUI风格");
/**
*
@ -74,18 +80,47 @@ public enum SysThemesEnum {
}
public static SysThemesEnum toEnum(String style) {
//如果移动端访问自动切换H+首页
if(isMobileDevice()){
return HPLUS;
}
if (StringUtil.isEmpty(style)) {
return SHORTCUT_STYLE;
//默认风格
return FINEUI_STYLE;
}
for(SysThemesEnum item : SysThemesEnum.values()) {
if(item.getStyle().equals(style)) {
return item;
}
}
return SHORTCUT_STYLE;
//默认风格
return FINEUI_STYLE;
}
public String toString() {
return "{style: " + style + ", indexPath: " + indexPath + ", themes: " + themes + ", desc: " + desc +"}";
}
/**
*
* android : android
* mac os : iphone ipad
* windows phone:Nokiawindows
*/
private static boolean isMobileDevice(){
HttpServletRequest request = ContextHolderUtils.getRequest();
String requestHeader = request.getHeader("user-agent");
String[] deviceArray = new String[]{"android","mac os","windows phone"};
if(requestHeader == null)
return false;
requestHeader = requestHeader.toLowerCase();
for(int i=0;i<deviceArray.length;i++){
if(requestHeader.indexOf(deviceArray[i])>0){
return true;
}
}
return false;
}
}

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

Loading…
Cancel
Save