mirror of https://gitee.com/jeecg/jeecg.git
parent
ce5df01692
commit
d9a89d780a
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
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,213 @@
|
||||
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 org.apache.log4j.Logger;
|
||||
import org.jeecgframework.core.common.controller.BaseController;
|
||||
import org.jeecgframework.core.common.hibernate.qbc.CriteriaQuery;
|
||||
import org.jeecgframework.core.common.model.json.AjaxJson;
|
||||
import org.jeecgframework.core.common.model.json.ComboTree;
|
||||
import org.jeecgframework.core.util.JSONHelper;
|
||||
import org.jeecgframework.tag.vo.easyui.ComboTreeModel;
|
||||
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.stereotype.Controller;
|
||||
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.servlet.ModelAndView;
|
||||
|
||||
import com.jeecg.demo.dao.JeecgMinidaoDao;
|
||||
|
||||
import net.sf.json.JSONArray;
|
||||
|
||||
/**
|
||||
* @ClassName: JeecgFormDemoController
|
||||
* @Description: TODO(演示例子处理类)
|
||||
* @author jeecg
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/jeecgFormDemoController")
|
||||
public class JeecgFormDemoController extends BaseController {
|
||||
private static final Logger logger = Logger.getLogger(JeecgFormDemoController.class);
|
||||
|
||||
@Autowired
|
||||
private SystemService systemService;
|
||||
@Autowired
|
||||
private JeecgMinidaoDao jeecgMinidaoDao;
|
||||
|
||||
@RequestMapping(params = "uitag")
|
||||
public ModelAndView uitag(HttpServletRequest request) {
|
||||
return new ModelAndView("com/jeecg/demo/form_uitag");
|
||||
}
|
||||
|
||||
@RequestMapping(params = "formValidDemo")
|
||||
public ModelAndView formValidDemo(HttpServletRequest request) {
|
||||
return new ModelAndView("com/jeecg/demo/form_valid");
|
||||
}
|
||||
|
||||
@RequestMapping(params = "testsubmit=1",method ={RequestMethod.GET, RequestMethod.POST})
|
||||
public ModelAndView testsubmit(HttpServletRequest request) {
|
||||
logger.info("请求成功byebye");
|
||||
return new ModelAndView("com/jeecg/demo/form_valid");
|
||||
}
|
||||
|
||||
@RequestMapping(params = "nature")
|
||||
public ModelAndView easyDemo(HttpServletRequest request) {
|
||||
logger.info("demo-nature");
|
||||
//ztree同步加载
|
||||
JSONArray jsonArray=JSONArray.fromObject(getZtreeData());
|
||||
request.setAttribute("regions", jsonArray.toString().replaceAll("pid","pId"));
|
||||
return new ModelAndView("com/jeecg/demo/form_nature");
|
||||
}
|
||||
|
||||
@RequestMapping(params = "ueditor")
|
||||
public ModelAndView ueditor(HttpServletRequest request) {
|
||||
logger.info("ueditor");
|
||||
return new ModelAndView("com/jeecg/demo/ueditor");
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
*下拉联动数据---省市区
|
||||
*/
|
||||
@RequestMapping(params="regionSelect",method = RequestMethod.GET)
|
||||
@ResponseBody
|
||||
public List<Map<String, String>> cityselect(HttpServletRequest req) throws Exception{
|
||||
logger.info("----省市区联动-----");
|
||||
String pid=req.getParameter("pid");
|
||||
List<Map<String, String>> list=jeecgMinidaoDao.getProCity(pid);
|
||||
return jeecgMinidaoDao.getProCity(pid);
|
||||
}
|
||||
|
||||
/**
|
||||
* Ztree
|
||||
* 获取所有的省市区数据
|
||||
* @return
|
||||
*/
|
||||
public List<Map<String, String>> getZtreeData(){
|
||||
return jeecgMinidaoDao.getAllRegions();
|
||||
}
|
||||
|
||||
/**
|
||||
* 父级DEMO下拉菜单
|
||||
*/
|
||||
@RequestMapping(params = "getComboTreeData")
|
||||
@ResponseBody
|
||||
public List<ComboTree> getComboTreeData(HttpServletRequest request, ComboTree comboTree) {
|
||||
CriteriaQuery cq = new CriteriaQuery(TSDepart.class);
|
||||
if (comboTree.getId() != null) {
|
||||
cq.eq("TSPDepart.id", comboTree.getId());
|
||||
}
|
||||
if (comboTree.getId() == null) {
|
||||
cq.isNull("TSPDepart");
|
||||
}
|
||||
cq.add();
|
||||
List<TSDepart> demoList = systemService.getListByCriteriaQuery(cq, false);
|
||||
List<ComboTree> comboTrees = new ArrayList<ComboTree>();
|
||||
ComboTreeModel comboTreeModel = new ComboTreeModel("id", "departname", "TSDeparts");
|
||||
comboTrees = systemService.ComboTree(demoList, comboTreeModel, null, false);
|
||||
return comboTrees;
|
||||
}
|
||||
|
||||
/**
|
||||
* 加载ztree
|
||||
* @param response
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(params="getTreeData",method ={RequestMethod.GET, RequestMethod.POST})
|
||||
@ResponseBody
|
||||
public AjaxJson getTreeData(TSDepart depatr,HttpServletResponse response,HttpServletRequest request ){
|
||||
AjaxJson j = new AjaxJson();
|
||||
try{
|
||||
List<TSDepart> depatrList = new ArrayList<TSDepart>();
|
||||
StringBuffer hql = new StringBuffer(" from TSDepart t");
|
||||
//hql.append(" and (parent.id is null or parent.id='')");
|
||||
depatrList = this.systemService.findHql(hql.toString());
|
||||
List<Map<String,Object>> dataList = new ArrayList<Map<String,Object>>();
|
||||
Map<String,Object> map = null;
|
||||
for (TSDepart tsdepart : depatrList) {
|
||||
String sqls = null;
|
||||
Object[] paramss = null;
|
||||
map = new HashMap<String,Object>();
|
||||
map.put("id", tsdepart.getId());
|
||||
map.put("name", tsdepart.getDepartname());
|
||||
if (tsdepart.getTSPDepart() != null) {
|
||||
map.put("pId", tsdepart.getTSPDepart().getId());
|
||||
map.put("open",false);
|
||||
}else {
|
||||
map.put("pId", "1");
|
||||
map.put("open",false);
|
||||
}
|
||||
sqls = "select count(1) from t_s_depart t where t.parentdepartid = ?";
|
||||
paramss = new Object[]{tsdepart.getId()};
|
||||
long counts = this.systemService.getCountForJdbcParam(sqls, paramss);
|
||||
if(counts>0){
|
||||
dataList.add(map);
|
||||
}else{
|
||||
TSDepart de = this.systemService.get(TSDepart.class, tsdepart.getId());
|
||||
if (de != null) {
|
||||
map.put("id", de.getId());
|
||||
map.put("name", de.getDepartname());
|
||||
if(tsdepart.getTSPDepart()!=null){
|
||||
map.put("pId", tsdepart.getTSPDepart().getId());
|
||||
map.put("open",false);
|
||||
}else{
|
||||
map.put("pId", "1");
|
||||
map.put("open",false);
|
||||
}
|
||||
dataList.add(map);
|
||||
}else{
|
||||
map.put("open",false);
|
||||
dataList.add(map);
|
||||
}
|
||||
}
|
||||
}
|
||||
j.setObj(dataList);
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
return j;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 自动完成请求返回数据
|
||||
* @param request
|
||||
* @param responss
|
||||
*/
|
||||
@RequestMapping(params = "getAutocompleteData",method ={RequestMethod.GET, RequestMethod.POST})
|
||||
public void getAutocompleteData(HttpServletRequest request, HttpServletResponse response) {
|
||||
String searchVal = request.getParameter("searchVal");
|
||||
String hql = "from TSUser where userName like '%"+searchVal+"%'";
|
||||
List autoList = systemService.findHql(hql);
|
||||
try {
|
||||
response.setContentType("application/json;charset=UTF-8");
|
||||
response.setHeader("Pragma", "No-cache");
|
||||
response.setHeader("Cache-Control", "no-cache");
|
||||
response.setDateHeader("Expires", 0);
|
||||
response.getWriter().write(JSONHelper.listtojson(new String[]{"userName"},1,autoList));
|
||||
response.getWriter().flush();
|
||||
} catch (Exception e1) {
|
||||
e1.printStackTrace();
|
||||
}finally{
|
||||
try {
|
||||
response.getWriter().close();
|
||||
} catch (IOException e) {
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,72 @@
|
||||
package com.jeecg.demo.dao;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.jeecgframework.minidao.annotation.Arguments;
|
||||
import org.jeecgframework.minidao.annotation.MiniDao;
|
||||
import org.jeecgframework.minidao.annotation.ResultType;
|
||||
import org.jeecgframework.minidao.annotation.Sql;
|
||||
|
||||
import com.jeecg.demo.entity.JeecgDemoEntity;
|
||||
import com.jeecg.demo.entity.JeecgLogReport;
|
||||
|
||||
/**
|
||||
* 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();
|
||||
|
||||
|
||||
@Arguments({"jeecgDemo", "page", "rows"})
|
||||
@ResultType(JeecgDemoEntity.class)
|
||||
public List<JeecgDemoEntity> getAllEntities(JeecgDemoEntity jeecgDemo, int page, int rows);
|
||||
|
||||
@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({"jeecgMinidao", "page", "rows"})
|
||||
public List<Map> getAllEntities(JeecgMinidaoEntity jeecgMinidao, int page, int rows);
|
||||
|
||||
@Arguments({"jeecgMinidao", "page", "rows"})
|
||||
@ResultType(JeecgMinidaoEntity.class)
|
||||
public List<JeecgMinidaoEntity> getAllEntities2(JeecgMinidaoEntity jeecgMinidao, int page, int rows);*/
|
||||
|
||||
//@Arguments("id")
|
||||
//JeecgMinidaoEntity getJeecgMinidao(String id);
|
||||
|
||||
/*
|
||||
*/
|
||||
|
||||
/*@Arguments("jeecgMinidao")
|
||||
int update(JeecgMinidaoEntity jeecgMinidao);
|
||||
|
||||
@Arguments("jeecgMinidao")
|
||||
void insert(JeecgMinidaoEntity jeecgMinidao);
|
||||
|
||||
@Arguments("jeecgMinidao")
|
||||
void delete(JeecgMinidaoEntity jeecgMinidao);*/
|
||||
|
||||
@Arguments("log")
|
||||
@ResultType(JeecgLogReport.class)
|
||||
List<JeecgLogReport> getLogReportData(JeecgLogReport log);
|
||||
|
||||
@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.hibernate.annotations.GenericGenerator;
|
||||
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="工资")
|
||||
private java.lang.String 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 生日
|
||||
*/
|
||||
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 java.lang.String getSalary(){
|
||||
return this.salary;
|
||||
}
|
||||
|
||||
/**
|
||||
*方法: 设置java.lang.String
|
||||
*@param: java.lang.String 工资
|
||||
*/
|
||||
public void setSalary(java.lang.String 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
|
||||
*/
|
||||
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,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,17 @@
|
||||
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;
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,25 @@
|
||||
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>
|
||||
@ -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
|
||||
ORDER BY
|
||||
ct DESC
|
||||
@ -0,0 +1,60 @@
|
||||
package org.jeecgframework.core.interceptors;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.jeecgframework.core.common.exception.BusinessException;
|
||||
import org.jeecgframework.core.util.StringUtil;
|
||||
import org.jeecgframework.web.cgform.util.SignatureUtil;
|
||||
import org.springframework.web.servlet.HandlerInterceptor;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Created by dangzhenghui on 2017-4-1.
|
||||
*/
|
||||
public class SignInterceptor implements HandlerInterceptor {
|
||||
private static final String SIGN_KEY = "26F72780372E84B6CFAED6F7B19139CC47B1912B6CAED753";
|
||||
|
||||
@Override
|
||||
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object o) throws Exception {
|
||||
|
||||
JSONObject j=new JSONObject();
|
||||
try {
|
||||
String sign= request.getHeader("X-JEECG-SIGN");
|
||||
String body=request.getParameter("body");
|
||||
if (StringUtil.isEmpty(sign)) {
|
||||
throw new BusinessException("sign不能为空");
|
||||
}
|
||||
if (StringUtil.isEmpty(body)){
|
||||
throw new BusinessException("body不能为空");
|
||||
}
|
||||
Map paramMap =new HashMap();
|
||||
paramMap.put("body",body);
|
||||
if(!SignatureUtil.checkSign(paramMap, SIGN_KEY, sign)){
|
||||
throw new BusinessException("签名验证失败");
|
||||
}
|
||||
} catch (BusinessException e) {
|
||||
j.put("success","false");
|
||||
j.put("msg",e.getMessage());
|
||||
response.getWriter().print(j.toJSONString());
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postHandle(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Object o, ModelAndView modelAndView) throws Exception {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterCompletion(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Object o, Exception e) throws Exception {
|
||||
|
||||
}
|
||||
}
|
||||
@ -1,127 +0,0 @@
|
||||
package org.jeecgframework.tag.core.easyui;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import javax.servlet.jsp.JspTagException;
|
||||
import javax.servlet.jsp.JspWriter;
|
||||
import javax.servlet.jsp.tagext.TagSupport;
|
||||
|
||||
import org.jeecgframework.core.util.StringUtil;
|
||||
|
||||
/**
|
||||
* ckfinder标签
|
||||
*
|
||||
* @author Alexander
|
||||
*
|
||||
*/
|
||||
public class CkfinderTag extends TagSupport {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
protected String name;// 属性名称
|
||||
protected String value;// 默认值
|
||||
protected String width;// 显示图片宽(上传类型为Images时)
|
||||
protected String height;// 显示图片高(上传类型为Images时)
|
||||
protected String buttonClass;// 按钮样式
|
||||
protected String buttonValue;// 按钮名称
|
||||
protected String uploadType;// 上传类型(Images,Files,Flash)
|
||||
|
||||
public String getButtonValue() {
|
||||
return buttonValue;
|
||||
}
|
||||
|
||||
public void setButtonValue(String buttonValue) {
|
||||
this.buttonValue = buttonValue;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public void setValue(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public String getWidth() {
|
||||
return width;
|
||||
}
|
||||
|
||||
public void setWidth(String width) {
|
||||
this.width = width;
|
||||
}
|
||||
|
||||
public String getHeight() {
|
||||
return height;
|
||||
}
|
||||
|
||||
public void setHeight(String height) {
|
||||
this.height = height;
|
||||
}
|
||||
|
||||
public String getButtonClass() {
|
||||
return buttonClass;
|
||||
}
|
||||
|
||||
public void setButtonClass(String buttonClass) {
|
||||
this.buttonClass = buttonClass;
|
||||
}
|
||||
|
||||
public String getUploadType() {
|
||||
return uploadType;
|
||||
}
|
||||
|
||||
public void setUploadType(String uploadType) {
|
||||
this.uploadType = uploadType;
|
||||
}
|
||||
|
||||
public int doStartTag() throws JspTagException {
|
||||
return EVAL_PAGE;
|
||||
}
|
||||
|
||||
public int doEndTag() throws JspTagException {
|
||||
JspWriter out = null;
|
||||
try {
|
||||
out = this.pageContext.getOut();
|
||||
out.print(end().toString());
|
||||
out.flush();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}finally{
|
||||
try {
|
||||
out.clear();
|
||||
out.close();
|
||||
} catch (Exception e2) {
|
||||
}
|
||||
}
|
||||
return EVAL_PAGE;
|
||||
}
|
||||
|
||||
public StringBuffer end() {
|
||||
StringBuffer sb = new StringBuffer();
|
||||
if ("Images".equals(uploadType)) {
|
||||
sb.append("<img src=\"" + value + "\" width=\"" + width
|
||||
+ "\" height=\"" + height + "\" id=\"" + name + "_herf\" ");
|
||||
if (StringUtil.isEmpty(value))
|
||||
sb.append("hidden=\"hidden\"");
|
||||
sb.append(" />");
|
||||
} else {
|
||||
sb.append("<a href=\"" + value + "\" id=\"" + name + "_herf\"></a>");
|
||||
sb.append("<script type=\"text/javascript\">decode(\"" + value
|
||||
+ "\", \"" + name + "_herf\")</script>");
|
||||
}
|
||||
sb.append("<input type=\"hidden\" id=\"" + name + "_input\" name=\""
|
||||
+ name + "\" value=\"" + value + "\">");
|
||||
sb.append("<input class=\"" + buttonClass
|
||||
+ "\" type=\"button\" value=\"" + buttonValue
|
||||
+ "\" onclick=\"browse('" + name + "_input','" + name
|
||||
+ "_herf','" + uploadType + "')\">");
|
||||
return sb;
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,376 +0,0 @@
|
||||
package org.jeecgframework.web.autoform.controller;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.velocity.VelocityContext;
|
||||
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.StringUtil;
|
||||
import org.jeecgframework.p3.core.util.plugin.ViewVelocity;
|
||||
import org.jeecgframework.tag.core.easyui.TagUtil;
|
||||
import org.jeecgframework.web.autoform.entity.AutoFormStyleEntity;
|
||||
import org.jeecgframework.web.autoform.service.AutoFormStyleServiceI;
|
||||
import org.jeecgframework.web.system.service.SystemService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @Title: Controller
|
||||
* @Description: 表单样式表
|
||||
* @author onlineGenerator
|
||||
* @date 2015-06-15 20:58:08
|
||||
* @version V1.0
|
||||
*
|
||||
*/
|
||||
//@Scope("prototype")
|
||||
@Controller
|
||||
@RequestMapping("/autoFormStyleController")
|
||||
public class AutoFormStyleController extends BaseController {
|
||||
/**
|
||||
* Logger for this class
|
||||
*/
|
||||
private static final Logger logger = Logger.getLogger(AutoFormStyleController.class);
|
||||
|
||||
@Autowired
|
||||
private AutoFormStyleServiceI autoFormStyleService;
|
||||
@Autowired
|
||||
private SystemService systemService;
|
||||
|
||||
|
||||
/**
|
||||
* 表单样式表列表 页面跳转
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(params = "autoFormStyle")
|
||||
public ModelAndView autoFormStyle(HttpServletRequest request) {
|
||||
return new ModelAndView("jeecg/autoform/autoFormStyleList");
|
||||
}
|
||||
|
||||
/**
|
||||
* easyui AJAX请求数据
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @param dataGrid
|
||||
* @param user
|
||||
*/
|
||||
|
||||
@RequestMapping(params = "datagrid")
|
||||
public void datagrid(AutoFormStyleEntity autoFormStyle,HttpServletRequest request, HttpServletResponse response, DataGrid dataGrid) {
|
||||
CriteriaQuery cq = new CriteriaQuery(AutoFormStyleEntity.class, dataGrid);
|
||||
//查询条件组装器
|
||||
org.jeecgframework.core.extend.hqlsearch.HqlGenerateUtil.installHql(cq, autoFormStyle, request.getParameterMap());
|
||||
try{
|
||||
//自定义追加查询条件
|
||||
}catch (Exception e) {
|
||||
throw new BusinessException(e.getMessage());
|
||||
}
|
||||
cq.add();
|
||||
this.autoFormStyleService.getDataGridReturn(cq, true);
|
||||
TagUtil.datagrid(response, dataGrid);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除表单样式表
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(params = "doDel")
|
||||
@ResponseBody
|
||||
public AjaxJson doDel(AutoFormStyleEntity autoFormStyle, HttpServletRequest request) {
|
||||
String message;
|
||||
AjaxJson j = new AjaxJson();
|
||||
autoFormStyle = systemService.getEntity(AutoFormStyleEntity.class, autoFormStyle.getId());
|
||||
message = "表单样式表删除成功";
|
||||
try{
|
||||
autoFormStyleService.delete(autoFormStyle);
|
||||
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;
|
||||
AjaxJson j = new AjaxJson();
|
||||
message = "表单样式表删除成功";
|
||||
try{
|
||||
for(String id:ids.split(",")){
|
||||
AutoFormStyleEntity autoFormStyle = systemService.getEntity(AutoFormStyleEntity.class,
|
||||
id
|
||||
);
|
||||
autoFormStyleService.delete(autoFormStyle);
|
||||
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(AutoFormStyleEntity autoFormStyle, HttpServletRequest request) {
|
||||
String message;
|
||||
AjaxJson j = new AjaxJson();
|
||||
message = "表单样式表添加成功";
|
||||
try{
|
||||
autoFormStyleService.save(autoFormStyle);
|
||||
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(AutoFormStyleEntity autoFormStyle, HttpServletRequest request) {
|
||||
String message;
|
||||
AjaxJson j = new AjaxJson();
|
||||
message = "表单样式表更新成功";
|
||||
AutoFormStyleEntity t = autoFormStyleService.get(AutoFormStyleEntity.class, autoFormStyle.getId());
|
||||
try {
|
||||
MyBeanUtils.copyBeanNotNull2Bean(autoFormStyle, t);
|
||||
autoFormStyleService.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(AutoFormStyleEntity autoFormStyle, HttpServletRequest req) {
|
||||
if (StringUtil.isNotEmpty(autoFormStyle.getId())) {
|
||||
autoFormStyle = autoFormStyleService.getEntity(AutoFormStyleEntity.class, autoFormStyle.getId());
|
||||
req.setAttribute("autoFormStylePage", autoFormStyle);
|
||||
}
|
||||
return new ModelAndView("jeecg/autoform/autoFormStyle-add");
|
||||
}
|
||||
/**
|
||||
* 表单样式表编辑页面跳转
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(params = "goUpdate")
|
||||
public ModelAndView goUpdate(AutoFormStyleEntity autoFormStyle, HttpServletRequest req) {
|
||||
if (StringUtil.isNotEmpty(autoFormStyle.getId())) {
|
||||
autoFormStyle = autoFormStyleService.getEntity(AutoFormStyleEntity.class, autoFormStyle.getId());
|
||||
req.setAttribute("autoFormStylePage", autoFormStyle);
|
||||
}
|
||||
return new ModelAndView("jeecg/autoform/autoFormStyle-update");
|
||||
}
|
||||
|
||||
|
||||
@ResponseBody
|
||||
@RequestMapping(params="checkStyleNm")
|
||||
public JSONObject checkStyleNm(AutoFormStyleEntity autoFormStyle,HttpServletRequest req){
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
|
||||
String param = req.getParameter("param");
|
||||
|
||||
List<AutoFormStyleEntity> list = new ArrayList<AutoFormStyleEntity>();
|
||||
String hql = "";
|
||||
if(StringUtils.isNotBlank(autoFormStyle.getId())){
|
||||
hql = "from AutoFormStyleEntity t where t.id != ? and t.styleDesc = ?";
|
||||
list = this.systemService.findHql(hql, autoFormStyle.getId(),param);
|
||||
|
||||
} else {
|
||||
hql = "from AutoFormStyleEntity t where t.styleDesc = ?";
|
||||
list = this.systemService.findHql(hql, param);
|
||||
}
|
||||
|
||||
if(list.size()>0){
|
||||
jsonObject.put("status", "n");
|
||||
jsonObject.put("info", "样式名称重复,请重新输入!");
|
||||
return jsonObject;
|
||||
}
|
||||
jsonObject.put("status", "y");
|
||||
return jsonObject;
|
||||
}
|
||||
|
||||
/**
|
||||
* 导入功能跳转
|
||||
*
|
||||
* @return
|
||||
*
|
||||
@RequestMapping(params = "upload")
|
||||
public ModelAndView upload(HttpServletRequest req) {
|
||||
req.setAttribute("controller_name","autoFormStyleController");
|
||||
return new ModelAndView("common/upload/pub_excel_upload");
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
*
|
||||
@RequestMapping(params = "exportXls")
|
||||
public String exportXls(AutoFormStyleEntity autoFormStyle,HttpServletRequest request,HttpServletResponse response
|
||||
, DataGrid dataGrid,ModelMap modelMap) {
|
||||
CriteriaQuery cq = new CriteriaQuery(AutoFormStyleEntity.class, dataGrid);
|
||||
org.jeecgframework.core.extend.hqlsearch.HqlGenerateUtil.installHql(cq, autoFormStyle, request.getParameterMap());
|
||||
List<AutoFormStyleEntity> autoFormStyles = this.autoFormStyleService.getListByCriteriaQuery(cq,false);
|
||||
modelMap.put(NormalExcelConstants.FILE_NAME,"表单样式表");
|
||||
modelMap.put(NormalExcelConstants.CLASS,AutoFormStyleEntity.class);
|
||||
modelMap.put(NormalExcelConstants.PARAMS,new ExportParams("表单样式表列表", "导出人:"+ResourceUtil.getSessionUserName().getRealName(),
|
||||
"导出信息"));
|
||||
modelMap.put(NormalExcelConstants.DATA_LIST,autoFormStyles);
|
||||
return NormalExcelConstants.JEECG_EXCEL_VIEW;
|
||||
}
|
||||
/**
|
||||
* 导出excel 使模板
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
*
|
||||
@RequestMapping(params = "exportXlsByT")
|
||||
public String exportXlsByT(AutoFormStyleEntity autoFormStyle,HttpServletRequest request,HttpServletResponse response
|
||||
, DataGrid dataGrid,ModelMap modelMap) {
|
||||
modelMap.put(TemplateExcelConstants.FILE_NAME, "表单样式表");
|
||||
modelMap.put(TemplateExcelConstants.PARAMS,new TemplateExportParams("Excel模板地址"));
|
||||
modelMap.put(TemplateExcelConstants.MAP_DATA,null);
|
||||
modelMap.put(TemplateExcelConstants.CLASS,AutoFormStyleEntity.class);
|
||||
modelMap.put(TemplateExcelConstants.LIST_DATA,null);
|
||||
return TemplateExcelConstants.JEECG_TEMPLATE_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<AutoFormStyleEntity> listAutoFormStyleEntitys = ExcelImportUtil.importExcel(file.getInputStream(),AutoFormStyleEntity.class,params);
|
||||
for (AutoFormStyleEntity autoFormStyle : listAutoFormStyleEntitys) {
|
||||
autoFormStyleService.save(autoFormStyle);
|
||||
}
|
||||
j.setMsg("文件导入成功!");
|
||||
} catch (Exception e) {
|
||||
j.setMsg("文件导入失败!");
|
||||
logger.error(ExceptionUtil.getExceptionMessage(e));
|
||||
}finally{
|
||||
try {
|
||||
file.getInputStream().close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
return j;
|
||||
}*/
|
||||
|
||||
/**
|
||||
* 表单样式表新增页面跳转
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(params = "goAdd_vm")
|
||||
public void goAddVM(AutoFormStyleEntity autoFormStyle, HttpServletResponse response, HttpServletRequest request) throws Exception {
|
||||
VelocityContext velocityContext = new VelocityContext();
|
||||
|
||||
if (StringUtil.isNotEmpty(autoFormStyle.getId())) {
|
||||
autoFormStyle = autoFormStyleService.getEntity(AutoFormStyleEntity.class, autoFormStyle.getId());
|
||||
velocityContext.put("autoFormStylePage", autoFormStyle);
|
||||
}
|
||||
String viewName = "autoform/autoFormStyle-add.vm";
|
||||
ViewVelocity.view(request,response,viewName,velocityContext);
|
||||
}
|
||||
|
||||
/**
|
||||
* 表单样式表编辑页面跳转
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(params = "goUpdate_vm")
|
||||
public void goUpdateVM(AutoFormStyleEntity autoFormStyle, HttpServletResponse response, HttpServletRequest request) throws Exception {
|
||||
VelocityContext velocityContext = new VelocityContext();
|
||||
if (StringUtil.isNotEmpty(autoFormStyle.getId())) {
|
||||
autoFormStyle = autoFormStyleService.getEntity(AutoFormStyleEntity.class, autoFormStyle.getId());
|
||||
velocityContext.put("autoFormStylePage", autoFormStyle);
|
||||
}
|
||||
String viewName = "autoform/autoFormStyle-update.vm";
|
||||
ViewVelocity.view(request,response,viewName,velocityContext);
|
||||
}
|
||||
|
||||
/**
|
||||
* 表单样式表列表 页面跳转
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(params = "autoFormStyle_vm")
|
||||
public void autoFormStyleVM(HttpServletResponse response, HttpServletRequest request) throws Exception {
|
||||
VelocityContext velocityContext = new VelocityContext();
|
||||
String viewName = "autoform/autoFormStyleList.vm";
|
||||
ViewVelocity.view(request, response, viewName, velocityContext);
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue