Revert "1"

This reverts commit 5738e9042e.
master
erzhongxmu 2023-10-17 17:09:30 +08:00
parent 5738e9042e
commit 07985f7ccb
13 changed files with 1678 additions and 52 deletions

11
pom.xml
View File

@ -948,7 +948,18 @@
<artifactId>HslCommunication</artifactId> <artifactId>HslCommunication</artifactId>
<version>3.3.0</version> <version>3.3.0</version>
</dependency> </dependency>
<dependency>
<groupId>com.nimbusds</groupId>
<artifactId>nimbus-jose-jwt</artifactId>
<version>6.0</version>
</dependency>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy</artifactId>
<version>${groovy.version}</version>
</dependency>
</dependencies> </dependencies>
<organization> <organization>

View File

@ -0,0 +1,215 @@
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;
/**
* @author jeecg
* @ClassName: JeecgFormDemoController
* @Description: TODO()
*/
@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");
List<ComboTree> 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='')");
List<TSDepart> 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 response
*/
@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) {
}
}
}
}

View File

@ -0,0 +1,612 @@
package com.jeecg.demo.controller;
import java.io.IOException;
import java.text.ParseException;
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.commons.collections.CollectionUtils;
import org.apache.log4j.Logger;
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.DateUtils;
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.p3.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.system.pojo.base.TSDepart;
import org.jeecgframework.web.system.pojo.base.TSLog;
import org.jeecgframework.web.system.service.SystemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.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.github.abel533.echarts.Option;
import com.github.abel533.echarts.axis.CategoryAxis;
import com.github.abel533.echarts.axis.ValueAxis;
import com.github.abel533.echarts.code.Trigger;
import com.github.abel533.echarts.data.PieData;
import com.github.abel533.echarts.series.Bar;
import com.github.abel533.echarts.series.Pie;
import com.jeecg.demo.dao.JeecgMinidaoDao;
import com.jeecg.demo.entity.JeecgDemoEntity;
import com.jeecg.demo.entity.JeecgDemoPage;
import com.jeecg.demo.entity.JeecgLogReport;
import com.jeecg.demo.service.JeecgDemoServiceI;
/**
* @Title: Controller
* @Description: jeecg_demo
* @author onlineGenerator
* @date 2017-03-22 20:11:23
* @version V1.0
*
*/
@Controller
@RequestMapping("/jeecgListDemoController")
public class JeecgListDemoController extends BaseController {
/**
* Logger for this class
*/
private static final Logger logger = Logger.getLogger(JeecgListDemoController.class);
@Autowired
private JeecgDemoServiceI jeecgDemoService;
@Autowired
private SystemService systemService;
@Autowired
private JeecgMinidaoDao jeecgMinidaoDao;
/**
* minidao
* @param request
* @return
*/
//JeecgListDemoController.do?minidaoListDemo
@RequestMapping(params = "minidaoListDemo")
public ModelAndView minidaoListDemo(HttpServletRequest request) {
return new ModelAndView("com/jeecg/demo/taglist_minidao");
}
/**
*
*/
//JeecgListDemoController.do?rowListDemo
@RequestMapping(params = "rowListDemo")
public ModelAndView rowListDemo(HttpServletRequest request) {
return new ModelAndView("com/jeecg/demo/list_rowedtior");
}
/**
* jeecg_demo
*
* @return
*/
@RequestMapping(params = "list")
public ModelAndView list(HttpServletRequest request) {
return new ModelAndView("com/jeecg/demo/jeecgDemoList");
}
/**
*
*/
//JeecgListDemoController.do?mysearchListDemo
@RequestMapping(params = "mysearchListDemo")
public ModelAndView mysearchListDemo(HttpServletRequest request) {
return new ModelAndView("com/jeecg/demo/taglist_mysearch");
}
@RequestMapping(params = "minidaoDatagrid")
public void minidaoDatagrid(JeecgDemoEntity jeecgDemo,HttpServletRequest request, HttpServletResponse response, DataGrid dataGrid) {
/**
* minidaospringjdbc线
* {USER_NAME}
* {userName}
*/
List<JeecgDemoEntity> list = jeecgMinidaoDao.getAllEntities(jeecgDemo, dataGrid.getPage(), dataGrid.getRows());
Integer count = jeecgMinidaoDao.getCount();
dataGrid.setTotal(count);
dataGrid.setResults(list);
String total_salary = String.valueOf(jeecgMinidaoDao.getSumSalary());
/*
* :() ,
*/
dataGrid.setFooter("salary:"+(total_salary.equalsIgnoreCase("null")?"0.0":total_salary)+",age,email:合计");
TagUtil.datagrid(response, dataGrid);
}
/**
* easyui AJAX
*
* @param request
* @param response
* @param dataGrid
*/
@RequestMapping(params = "datagrid")
public void datagrid(JeecgDemoEntity jeecgDemo,HttpServletRequest request, HttpServletResponse response, DataGrid dataGrid) {
CriteriaQuery cq = new CriteriaQuery(JeecgDemoEntity.class, dataGrid);
//查询条件组装器
org.jeecgframework.core.extend.hqlsearch.HqlGenerateUtil.installHql(cq, jeecgDemo, request.getParameterMap());
try{
//自定义追加查询条件
}catch (Exception e) {
throw new BusinessException(e.getMessage());
}
cq.add();
this.jeecgDemoService.getDataGridReturn(cq, true);
//String total_salary = String.valueOf(jeecgMinidaoDao.getSumSalary());
/*
* :() ,
*/
//dataGrid.setFooter("salary:"+(total_salary.equalsIgnoreCase("null")?"0.0":total_salary)+",age,email:合计");
List<JeecgDemoEntity> list=dataGrid.getResults();
Map<String,Map<String,Object>> extMap = new HashMap<String, Map<String,Object>>();
for(JeecgDemoEntity temp:list){
//此为针对原来的行数据,拓展的新字段
Map m = new HashMap();
m.put("extField",this.jeecgMinidaoDao.getOrgCode(temp.getDepId()));
extMap.put(temp.getId(), m);
}
//dataGrid.setFooter("extField,salary,age,name:合计");
TagUtil.datagrid(response, dataGrid,extMap);
dataGrid.setFooter("salary,age,name:合计");
TagUtil.datagrid(response, dataGrid);
}
@RequestMapping(params = "addTab")
public ModelAndView addTab(HttpServletRequest request) {
//String type = oConvertUtils.getString(request.getParameter("type"));
return new ModelAndView("com/jeecg/demo/demoTab");
}
@RequestMapping(params = "goCheck")
public ModelAndView goCheck( HttpServletRequest request) {
logger.info("----审核-----");
String id=request.getParameter("id");
if (StringUtil.isNotEmpty(id)) {
JeecgDemoEntity jeecgDemo = jeecgDemoService.getEntity(JeecgDemoEntity.class, id);
request.setAttribute("jeecgDemoPage", jeecgDemo);
}
return new ModelAndView("com/jeecg/demo/jeecgDemo-check");
}
@RequestMapping(params = "doCheck")
@ResponseBody
public AjaxJson doCheck(String content,String id,String status) {
logger.info("-------审核意见:"+content);//demo简单作打印,实际项目可酌情处理
String message = null;
AjaxJson j = new AjaxJson();
JeecgDemoEntity jeecgDemo = systemService.getEntity(JeecgDemoEntity.class, id);
message = "审核成功";
try{
jeecgDemo.setStatus(status);
this.jeecgDemoService.updateEntitie(jeecgDemo);
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 = "addWithbtn")
public ModelAndView addWithbtn(HttpServletRequest request) {
return new ModelAndView("com/jeecg/demo/jeecgDemo-add-btn");
}
/**
* JeecgDemo
* @param jeecgDemo
* @param req
* @return
*/
@RequestMapping(params = "print")
public ModelAndView print(JeecgDemoEntity jeecgDemo, HttpServletRequest req) {
// 获取部门信息
List<TSDepart> departList = systemService.getList(TSDepart.class);
req.setAttribute("departList", departList);
if (StringUtil.isNotEmpty(jeecgDemo.getId())) {
jeecgDemo = jeecgDemoService.getEntity(JeecgDemoEntity.class, jeecgDemo.getId());
req.setAttribute("jgDemo", jeecgDemo);
if ("0".equals(jeecgDemo.getSex())) {
req.setAttribute("sex", "男");
}
if ("1".equals(jeecgDemo.getSex())) {
req.setAttribute("sex", "女");
}
}
return new ModelAndView("com/jeecg/demo/jeecgDemo-print");
}
/**
* jeecg_demo
*
* @return
*/
@RequestMapping(params = "doDel")
@ResponseBody
public AjaxJson doDel(JeecgDemoEntity jeecgDemo, HttpServletRequest request) {
String message = null;
AjaxJson j = new AjaxJson();
jeecgDemo = systemService.getEntity(JeecgDemoEntity.class, jeecgDemo.getId());
message = "删除成功";
try{
jeecgDemoService.delete(jeecgDemo);
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;
}
/**
* jeecg_demo
*
* @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(",")){
JeecgDemoEntity jeecgDemo = systemService.getEntity(JeecgDemoEntity.class,
id
);
jeecgDemoService.delete(jeecgDemo);
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;
}
/**
* jeecg_demo
*
* @param jeecgDemo
* @return
*/
@RequestMapping(params = "doAdd")
@ResponseBody
public AjaxJson doAdd(JeecgDemoEntity jeecgDemo, HttpServletRequest request) {
String message = null;
AjaxJson j = new AjaxJson();
message = "添加成功";
try{
jeecgDemoService.save(jeecgDemo);
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;
}
/**
* jeecg_demo
*
* @param jeecgDemo
* @return
*/
@RequestMapping(params = "doUpdate")
@ResponseBody
public AjaxJson doUpdate(JeecgDemoEntity jeecgDemo, HttpServletRequest request) {
String message = null;
AjaxJson j = new AjaxJson();
message = "更新成功";
JeecgDemoEntity t = jeecgDemoService.get(JeecgDemoEntity.class, jeecgDemo.getId());
try {
MyBeanUtils.copyBeanNotNull2Bean(jeecgDemo, t);
jeecgDemoService.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;
}
/**
* jeecg_demo
*
* @return
*/
@RequestMapping(params = "goAdd")
public ModelAndView goAdd(JeecgDemoEntity jeecgDemo, HttpServletRequest req) {
if (StringUtil.isNotEmpty(jeecgDemo.getId())) {
jeecgDemo = jeecgDemoService.getEntity(JeecgDemoEntity.class, jeecgDemo.getId());
req.setAttribute("jeecgDemoPage", jeecgDemo);
}
return new ModelAndView("com/jeecg/demo/jeecgDemo-add");
}
/**
* jeecg_demo
*
* @return
*/
@RequestMapping(params = "goUpdate")
public ModelAndView goUpdate(JeecgDemoEntity jeecgDemo, HttpServletRequest req) {
if (StringUtil.isNotEmpty(jeecgDemo.getId())) {
jeecgDemo = jeecgDemoService.getEntity(JeecgDemoEntity.class, jeecgDemo.getId());
req.setAttribute("jeecgDemoPage", jeecgDemo);
}
return new ModelAndView("com/jeecg/demo/jeecgDemo-update");
}
/**
*
*
* @return
*/
@RequestMapping(params = "upload")
public ModelAndView upload(HttpServletRequest req) {
req.setAttribute("controller_name","JeecgListDemoController");
return new ModelAndView("common/upload/pub_excel_upload");
}
/**
* excel
*
* @param request
* @param response
*/
@RequestMapping(params = "exportXls")
public String exportXls(JeecgDemoEntity jeecgDemo,HttpServletRequest request,HttpServletResponse response
, DataGrid dataGrid,ModelMap modelMap) {
CriteriaQuery cq = new CriteriaQuery(JeecgDemoEntity.class, dataGrid);
org.jeecgframework.core.extend.hqlsearch.HqlGenerateUtil.installHql(cq, jeecgDemo, request.getParameterMap());
List<JeecgDemoEntity> jeecgDemos = this.jeecgDemoService.getListByCriteriaQuery(cq,false);
modelMap.put(NormalExcelConstants.FILE_NAME,"jeecg_demo");
modelMap.put(NormalExcelConstants.CLASS,JeecgDemoEntity.class);
modelMap.put(NormalExcelConstants.PARAMS,new ExportParams("jeecg_demo列表", "导出人:"+ResourceUtil.getSessionUserName().getRealName(),"导出信息"));
modelMap.put(NormalExcelConstants.DATA_LIST,jeecgDemos);
return NormalExcelConstants.JEECG_EXCEL_VIEW;
}
/**
* excel 使
*
* @param request
* @param response
*/
@RequestMapping(params = "exportXlsByT")
public String exportXlsByT(JeecgDemoEntity jeecgDemo,HttpServletRequest request,HttpServletResponse response
, DataGrid dataGrid,ModelMap modelMap) {
modelMap.put(NormalExcelConstants.FILE_NAME,"jeecg_demo");
modelMap.put(NormalExcelConstants.CLASS,JeecgDemoEntity.class);
modelMap.put(NormalExcelConstants.PARAMS,new ExportParams("jeecg_demo列表", "导出人:"+ResourceUtil.getSessionUserName().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<JeecgDemoEntity> listJeecgDemoEntitys = ExcelImportUtil.importExcel(file.getInputStream(),JeecgDemoEntity.class,params);
for (JeecgDemoEntity jeecgDemo : listJeecgDemoEntitys) {
jeecgDemoService.save(jeecgDemo);
}
j.setMsg("文件导入成功!");
} catch (Exception e) {
j.setMsg("文件导入失败!");
logger.error(ExceptionUtil.getExceptionMessage(e));
}finally{
try {
file.getInputStream().close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
return j;
}
@RequestMapping(method = RequestMethod.GET)
@ResponseBody
public List<JeecgDemoEntity> list() {
List<JeecgDemoEntity> listJeecgDemos=jeecgDemoService.getList(JeecgDemoEntity.class);
return listJeecgDemos;
}
/**
* /
* @param page
* @return
*/
@RequestMapping(params = "saveRows")
@ResponseBody
public AjaxJson saveRows(JeecgDemoPage page){
String message = null;
List<JeecgDemoEntity> demos=page.getDemos();
AjaxJson j = new AjaxJson();
if(CollectionUtils.isNotEmpty(demos)){
for(JeecgDemoEntity jeecgDemo:demos){
if (StringUtil.isNotEmpty(jeecgDemo.getId())) {
JeecgDemoEntity t =jeecgDemoService.get(JeecgDemoEntity.class, jeecgDemo.getId());
try {
message = "JeecgDemo例子: " + jeecgDemo.getName() + "被更新成功";
MyBeanUtils.copyBeanNotNull2Bean(jeecgDemo, t);
jeecgDemoService.saveOrUpdate(t);
systemService.addLog(message, Globals.Log_Type_UPDATE, Globals.Log_Leavel_INFO);
} catch (Exception e) {
e.printStackTrace();
}
} else {
try {
message = "JeecgDemo例子: " + jeecgDemo.getName() + "被添加成功";
//jeecgDemo.setStatus("0");
jeecgDemoService.save(jeecgDemo);
systemService.addLog(message, Globals.Log_Type_INSERT, Globals.Log_Leavel_INFO);
} catch (Exception e) {
e.printStackTrace();
}
}
}
}
return j;
}
//jeecgListDemoController.do?log
@RequestMapping(params = "log")
public ModelAndView log() {
return new ModelAndView("com/jeecg/demo/logList");
}
//jeecgListDemoController.do?logDatagrid
@RequestMapping(params = "logDatagrid")
public void logDatagrid(HttpServletRequest request, HttpServletResponse response, DataGrid dataGrid) {
CriteriaQuery cq = new CriteriaQuery(TSLog.class, dataGrid);
//日志级别查询条件
String loglevel = request.getParameter("loglevel");
if (loglevel != null && !"0".equals(loglevel)) {
cq.eq("loglevel", org.jeecgframework.core.util.oConvertUtils.getShort(loglevel));
cq.add();
}
//时间范围查询条件
String operatetime_begin = request.getParameter("operatetime_begin");
String operatetime_end = request.getParameter("operatetime_end");
if(oConvertUtils.isNotEmpty(operatetime_begin)){
try {
cq.ge("operatetime", DateUtils.parseDate(operatetime_begin, "yyyy-MM-dd hh:mm:ss"));
} catch (ParseException e) {
logger.error(e);
}
cq.add();
}
if(oConvertUtils.isNotEmpty(operatetime_end)){
try {
cq.le("operatetime", DateUtils.parseDate(operatetime_end, "yyyy-MM-dd hh:mm:ss"));
} catch (ParseException e) {
logger.error(e);
}
cq.add();
}
this.systemService.getDataGridReturn(cq, true);
TagUtil.datagrid(response, dataGrid);
}
@RequestMapping(params = "goOnlyData")
public ModelAndView goOnlyData(HttpServletRequest req,JeecgLogReport log) {
return new ModelAndView("com/jeecg/demo/logrp-onlyData");
}
@RequestMapping(params = "logrpDatagrid")
public void logrpDatagrid(HttpServletResponse response,JeecgLogReport log, DataGrid dataGrid) {
//CriteriaQuery cq = new CriteriaQuery(JeecgLogReport.class, dataGrid);
List<JeecgLogReport> list=this.jeecgMinidaoDao.getLogReportData(log);
dataGrid.setResults(list);
TagUtil.datagrid(response, dataGrid);
}
@RequestMapping(params = "goChart")
public ModelAndView goChart(HttpServletRequest req,JeecgLogReport log) {
List<Map<String, Object>> list=this.jeecgMinidaoDao.getLogChartData(log);
net.sf.json.JSONArray arr=net.sf.json.JSONArray.fromObject(list);
req.setAttribute("logs",arr);
return new ModelAndView("com/jeecg/demo/logrp-chart");
}
@RequestMapping(params = "goEchart")
public ModelAndView goEchart(HttpServletRequest req,JeecgLogReport log) {
return new ModelAndView("com/jeecg/demo/echart");
}
@RequestMapping(params = "doEchart",method ={RequestMethod.GET, RequestMethod.POST})
@ResponseBody
public AjaxJson doEchart(HttpServletRequest req,JeecgLogReport log) {
//创建Option
Option option = new Option();
option.title("日志").tooltip(Trigger.axis).legend("登录次数");
//横轴为值轴
option.xAxis(new ValueAxis().boundaryGap(0d, 0.01));
//创建类目轴
CategoryAxis category = new CategoryAxis();
//柱状数据
Bar bar = new Bar("登录次数");
//饼图数据
Pie pie = new Pie("登录次数");
//循环数据
List<Map<String, Object>> list=this.jeecgMinidaoDao.getLogChartData(log);
for (Map<String, Object> objectMap : list) {
//设置类目
category.data(objectMap.get("name"));
//类目对应的柱状图
bar.data(objectMap.get("value"));
//饼图数据
System.out.println("value************"+objectMap.get("value"));
pie.data(new PieData(objectMap.get("name").toString(), objectMap.get("value")));
}
//设置类目轴
option.yAxis(category);
//饼图的圆心和半径
pie.center(900,380).radius(100);
//设置数据
option.series(bar, pie);
AjaxJson j = new AjaxJson();
j.setObj(option);
System.out.println(j.toString());
return j;
}
}

View File

@ -0,0 +1,91 @@
package com.jeecg.demo.dao;
import java.util.List;
import java.util.Map;
import com.zzjee.ba.entity.BaGoodsCategoryEntity;
import com.zzjee.ba.vo.BaGoodsCategoryVoo;
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 {
/**
* @Description
* @Author xushanchang
* @Date 2021/7/411:08
* @Param
* @return
**/
@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();
@Sql("select ID,category_name as categoryName,PID,category_level categoryLevel from ba_goods_category ")
List<BaGoodsCategoryVoo> getAllBaGoodsCategorys();
@Arguments("pid")
@Sql("select ID,category_name as categoryName,PID from ba_goods_category where pid=:pid")
List<BaGoodsCategoryVoo> getAllBaGoodsCategorys(String pid);
@Arguments({"jeecgDemo", "page", "rows"})
@ResultType(JeecgDemoEntity.class)
public List<JeecgDemoEntity> getAllEntities(JeecgDemoEntity jeecgDemo, int page, int rows);
@Arguments({"baGoodsCategory", "page", "rows"})
@ResultType(BaGoodsCategoryEntity.class)
public List<BaGoodsCategoryEntity> getAllEntities(BaGoodsCategoryEntity baGoodsCategory, 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);
}

View File

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

View File

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

View File

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

View File

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

View File

@ -0,0 +1,140 @@
package com.jeecg.demo.service.impl;
import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
import org.jeecgframework.core.common.service.impl.CommonServiceImpl;
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;
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 {
@Override
public void delete(JeecgDemoEntity entity) throws Exception{
super.delete(entity);
//执行删除操作增强业务
this.doDelBus(entity);
}
@Override
public Serializable save(JeecgDemoEntity entity) throws Exception{
Serializable t = super.save(entity);
//执行新增操作增强业务
this.doAddBus(entity);
return t;
}
@Override
public void saveOrUpdate(JeecgDemoEntity entity) throws Exception{
super.saveOrUpdate(entity);
//执行更新操作增强业务
this.doUpdateBus(entity);
}
/**
*
* @param t
* @return
*/
private void doAddBus(JeecgDemoEntity t) throws Exception{
}
/**
*
* @param t
* @return
*/
private void doUpdateBus(JeecgDemoEntity t) throws Exception{
}
/**
*
* @param t
* @return
*/
private void doDelBus(JeecgDemoEntity t) throws Exception{
}
private Map<String,Object> populationMap(JeecgDemoEntity t){
Map<String,Object> map = new HashMap<String,Object>();
map.put("id", t.getId());
map.put("name", t.getName());
map.put("age", t.getAge());
map.put("birthday", t.getBirthday());
map.put("content", t.getContent());
map.put("dep_id", t.getDepId());
map.put("email", t.getEmail());
map.put("phone", t.getPhone());
map.put("salary", t.getSalary());
map.put("sex", t.getSex());
map.put("status", t.getStatus());
map.put("create_date", t.getCreateDate());
map.put("create_by", t.getCreateBy());
map.put("create_name", t.getCreateName());
map.put("update_by", t.getUpdateBy());
map.put("update_date", t.getUpdateDate());
map.put("update_name", t.getUpdateName());
return map;
}
/**
* sql
* @param sql
* @param t
* @return
*/
public String replaceVal(String sql,JeecgDemoEntity t){
sql = sql.replace("#{id}",String.valueOf(t.getId()));
sql = sql.replace("#{name}",String.valueOf(t.getName()));
sql = sql.replace("#{age}",String.valueOf(t.getAge()));
sql = sql.replace("#{birthday}",String.valueOf(t.getBirthday()));
sql = sql.replace("#{content}",String.valueOf(t.getContent()));
sql = sql.replace("#{dep_id}",String.valueOf(t.getDepId()));
sql = sql.replace("#{email}",String.valueOf(t.getEmail()));
sql = sql.replace("#{phone}",String.valueOf(t.getPhone()));
sql = sql.replace("#{salary}",String.valueOf(t.getSalary()));
sql = sql.replace("#{sex}",String.valueOf(t.getSex()));
sql = sql.replace("#{status}",String.valueOf(t.getStatus()));
sql = sql.replace("#{create_date}",String.valueOf(t.getCreateDate()));
sql = sql.replace("#{create_by}",String.valueOf(t.getCreateBy()));
sql = sql.replace("#{create_name}",String.valueOf(t.getCreateName()));
sql = sql.replace("#{update_by}",String.valueOf(t.getUpdateBy()));
sql = sql.replace("#{update_date}",String.valueOf(t.getUpdateDate()));
sql = sql.replace("#{update_name}",String.valueOf(t.getUpdateName()));
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("jeecg_demo",data);
}
} catch (Exception e) {
e.printStackTrace();
throw new Exception("执行JAVA增强出现异常");
}
}
}
}

View File

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

View File

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

View File

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

View File

@ -1,77 +1,52 @@
package com.zzjee.ba.controller; package com.zzjee.ba.controller;
import com.alibaba.fastjson.JSON;
import com.jeecg.demo.dao.JeecgMinidaoDao; import com.jeecg.demo.dao.JeecgMinidaoDao;
import com.zzjee.ba.entity.BaGoodsCategoryEntity; import com.zzjee.ba.entity.BaGoodsCategoryEntity;
import com.zzjee.ba.entity.BaGoodsTypeEntity;
import com.zzjee.ba.service.BaGoodsCategoryServiceI; import com.zzjee.ba.service.BaGoodsCategoryServiceI;
import java.util.ArrayList;
import java.util.List;
import java.text.SimpleDateFormat;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.zzjee.ba.vo.BaGoodsCategoryVoo; import com.zzjee.ba.vo.BaGoodsCategoryVoo;
import org.apache.log4j.Logger; import org.apache.log4j.Logger;
import org.jeecgframework.core.common.model.json.ComboTree; import org.jeecgframework.core.beanvalidator.BeanValidators;
import org.jeecgframework.core.common.model.json.TreeGrid;
import org.jeecgframework.tag.vo.easyui.ComboTreeModel;
import org.jeecgframework.tag.vo.easyui.TreeGridModel;
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.controller.BaseController;
import org.jeecgframework.core.common.exception.BusinessException; import org.jeecgframework.core.common.exception.BusinessException;
import org.jeecgframework.core.common.hibernate.qbc.CriteriaQuery; 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.AjaxJson;
import org.jeecgframework.core.common.model.json.ComboTree;
import org.jeecgframework.core.common.model.json.DataGrid; import org.jeecgframework.core.common.model.json.DataGrid;
import org.jeecgframework.core.constant.Globals; import org.jeecgframework.core.constant.Globals;
import org.jeecgframework.core.util.StringUtil; import org.jeecgframework.core.util.ExceptionUtil;
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 org.jeecgframework.core.util.MyBeanUtils;
import org.jeecgframework.core.util.ResourceUtil;
import java.io.OutputStream; import org.jeecgframework.core.util.StringUtil;
import org.jeecgframework.core.util.BrowserUtils;
import org.jeecgframework.poi.excel.ExcelExportUtil;
import org.jeecgframework.poi.excel.ExcelImportUtil; import org.jeecgframework.poi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.entity.ExportParams; import org.jeecgframework.poi.excel.entity.ExportParams;
import org.jeecgframework.poi.excel.entity.ImportParams; 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.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.vo.TemplateExcelConstants; import org.jeecgframework.tag.core.easyui.TagUtil;
import org.apache.poi.hssf.usermodel.HSSFWorkbook; import org.jeecgframework.web.system.service.SystemService;
import org.jeecgframework.core.util.ResourceUtil; import org.springframework.beans.factory.annotation.Autowired;
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.HttpHeaders;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
import org.jeecgframework.core.beanvalidator.BeanValidators; import org.springframework.http.MediaType;
import java.util.Set; import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.*;
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 javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.validation.ConstraintViolation; import javax.validation.ConstraintViolation;
import javax.validation.Validator; import javax.validation.Validator;
import java.io.IOException;
import java.net.URI; import java.net.URI;
import org.springframework.http.MediaType; import java.text.SimpleDateFormat;
import org.springframework.web.util.UriComponentsBuilder; import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Set;
/** /**
* @Title: Controller * @Title: Controller