JEECG开发第一个菜单显示设备列表
一、新建设备表(t_base_device)
SET FOREIGN_KEY_CHECKS=0; -- ----------------------------
-- Table structure for t_base_device
-- ----------------------------
DROP TABLE IF EXISTS `t_base_device`;
CREATE TABLE `t_base_device` (
`deviceid` int(10) NOT NULL,
`devicecode` varchar(50) DEFAULT NULL,
`devicename` varchar(50) DEFAULT NULL,
`deviceclassno` varchar(10) DEFAULT NULL,
`status` varchar(10) DEFAULT NULL,
`username` varchar(50) DEFAULT NULL,
`userdept` varchar(200) DEFAULT NULL,
PRIMARY KEY (`deviceid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- ----------------------------
-- Records of t_base_device
-- ----------------------------
INSERT INTO `t_base_device` VALUES ('', 'STPC201711001', '华硕X550', '', '使用中', '谢红卫', '软件研发部');
INSERT INTO `t_base_device` VALUES ('', 'STPC201711002', '联想T440P', '', '库存', null, null);
二、实体类(BaseDevice.java)
package net.xhw.device.entity; import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table; @SuppressWarnings("serial")
@Entity
@Table(name = "t_base_device")
public class BaseDevice implements java.io.Serializable{ private int deviceid;
private String devicecode;
private String devicename;
private String deviceclassno;
private String status;
private String username;
private String userdept; @Id
@Column(name = "deviceid", length = 10)
public int getDeviceid() {
return deviceid;
} @Column(name = "devicecode", length = 50)
public String getDevicecode() {
return devicecode;
} @Column(name = "devicename", length = 50)
public String getDevicename() {
return devicename;
} @Column(name = "deviceclassno", length = 10)
public String getDeviceclassno() {
return deviceclassno;
} @Column(name = "status", length = 10)
public String getStatus() {
return status;
} @Column(name = "username", length = 50)
public String getUsername() {
return username;
} @Column(name = "userdept", length = 200)
public String getUserdept() {
return userdept;
} public void setDeviceid(int deviceid) {
this.deviceid = deviceid;
} public void setDevicecode(String devicecode) {
this.devicecode = devicecode;
} public void setDevicename(String devicename) {
this.devicename = devicename;
} public void setDeviceclassno(String deviceclassno) {
this.deviceclassno = deviceclassno;
} public void setStatus(String status) {
this.status = status;
} public void setUsername(String username) {
this.username = username;
} public void setUserdept(String userdept) {
this.userdept = userdept;
} }
三、action控制类(DeviceController.java)
package net.xhw.device.ctrl; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.jeecgframework.core.common.controller.BaseController;
import org.jeecgframework.core.common.hibernate.qbc.CriteriaQuery;
import org.jeecgframework.core.common.model.json.DataGrid;
import org.jeecgframework.tag.core.easyui.TagUtil;
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.servlet.ModelAndView;
import net.xhw.device.entity.BaseDevice; @Controller
@RequestMapping("/deviceController")
public class DeviceController extends BaseController { private SystemService systemService; @Autowired
public void setSystemService(SystemService systemService) {
this.systemService = systemService;
} @RequestMapping(params = "deviceList")
public ModelAndView deviceList(HttpServletRequest request) {
return new ModelAndView("device/deviceList");
} @RequestMapping(params = "datagrid")
public void datagrid(BaseDevice basedevice, HttpServletRequest request, HttpServletResponse response, DataGrid dataGrid) {
CriteriaQuery cq = new CriteriaQuery(BaseDevice.class, dataGrid);
this.systemService.getDataGridReturn(cq, true);
TagUtil.datagrid(response, dataGrid);
} }
四、页面文件(deviceList.jsp)
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/context/mytags.jsp"%>
<t:base type="jquery,easyui,tools,DatePicker"></t:base> <t:datagrid name="deviceList" title="设备信息列表" actionUrl="deviceController.do?datagrid"
fit="true" fitColumns="true" idField="deviceid" queryMode="group">
<t:dgCol title="设备ID" field="deviceid" hidden="true"></t:dgCol>
<t:dgCol title="设备编码" field="devicecode" query="false" width="100"></t:dgCol>
<t:dgCol title="设备名称" field="devicename" query="false" width="100"></t:dgCol>
<t:dgCol title="状态" field="status" query="false" width="100"></t:dgCol>
<t:dgCol title="使用人" field="username" query="false" width="100"></t:dgCol>
</t:datagrid>
五、修改配置文件
1、修改spring-mvc.xml,添加扫描控制类包
<context:component-scan base-package="org.jeecgframework.web.*,com.jeecg.*,net.xhw.*">
<context:exclude-filter type="annotation"
expression="org.springframework.stereotype.Service" />
</context:component-scan>
2、修改spring-mvc-hibernate.xml,添加注解方式配置
<!-- 注解方式配置 -->
<property name="packagesToScan">
<list>
<value>org.jeecgframework.web.system.pojo.*</value>
<value>org.jeecgframework.web.test.entity.*</value>
<value>org.jeecgframework.web.autoform.*</value>
<value>org.jeecgframework.web.cgform.entity.*</value>
<value>org.jeecgframework.web.cgreport.entity.*</value>
<value>org.jeecgframework.web.cgdynamgraph.entity.*</value>
<value>org.jeecgframework.web.graphreport.entity.*</value>
<value>org.jeecgframework.web.system.sms.*</value>
<value>com.jeecg.*</value>
<value>net.xhw.*</value>
</list>
</property>
六、菜单配置及结果


JEECG开发第一个菜单显示设备列表的更多相关文章
- wxPython制作跑monkey工具(python3)-带显示设备列表界面
一. wxPython制作跑monkey工具(python3)-带显示设备列表界面 源代码 Run Monkey.py #!/usr/bin/env python import wx import ...
- 解决Genymotion无法创建新设备或无法显示设备列表问题
准备工作: 链接: https://pan.baidu.com/s/1i5v4IBN 密码: jc3m 用2.8的和最新VirtualBox-5.1.10-112026-Win 注意事项: 1.笔记本 ...
- Winform开发主界面菜单的动态树形列表展示
我在之前很多文章里面,介绍过Winform主界面的开发,基本上都是标准的界面,在顶部放置工具栏,中间区域则放置多文档的内容,但是在顶部菜单比较多的时候,就需要把菜单分为几级处理,如可以在顶部菜单放置一 ...
- (android 地图实战开发)2 创建MapActivity,根据设备当前位置,显示地图
(android 地图实战开发)2 创建MapActivity,根据设备当前位置,显示地图 http://www.cnblogs.com/macroxu-1982/archive/2011/09/13 ...
- odoo开发笔记--一个模块显示两个一级菜单
场景描述: 在已启动开发的模块中,odoo顶部一级菜单只有一个“会员管理”,需求是:在同一级顶部菜单,增加新菜单“产品管理”.举例如图: 处理方式: 按照odoo的机制,实现这种效果,可以 ...
- dedecms 列表 用分页标签 判断 当第一页则显示,第二页以上不显示 土办法!
arc.listview.class.php function GetPageListST($list_len,$listitem="index,end,pre,next,pageno,sp ...
- XE7 & IOS开发之开发账号(1):开发证书、AppID、设备、开发授权profile的申请使用,附Debug真机调试演示(XCode所有版本通用,有图有真相)
网上能找到的关于Delphi XE系列的移动开发的相关文章甚少,本文尽量以详细的图文内容.傻瓜式的表达来告诉你想要的答案. 原创作品,请尊重作者劳动成果,转载请注明出处!!! 注意,以下讨论都是以&q ...
- 【React Native开发】React Native应用设备执行(Running)以及调试(Debugging)(3)
),React Native技术交流4群(458982758),请不要反复加群.欢迎各位大牛,React Native技术爱好者加入交流!同一时候博客左側欢迎微信扫描关注订阅号,移动技术干货,精彩文章 ...
- HoloLens开发手记 - 使用Windows设备控制台 Using Windows Device Portal
Windows设备控制台允许你通过Wi-Fi或USB来远程控制你的HoloLens设备.设备控制台是HoloLens上的一个Web Server,你可以通过PC的浏览器来连接到它.设备控制台包含了很多 ...
随机推荐
- 剖析Javascript中sort()使用方法,以及重写sort()里的排序方法,实现自定义排序
语法:arrayObject.sort([compareFunction]):参数compareFunction可选.规定排序顺序,必须是函数. sort() 方法用于对数组的元素进行排序,并返回数组 ...
- day06_类与对象、封装、构造方法
02_面向对象与常用类 01_面向对象思想的概述 面向过程:当需要实现一个功能的时候,每个具体的步骤都需要亲力亲为,详细处理每一个细节. 面向对象:当需要实现一个功能的时候,不关心具体步骤,而是找一个 ...
- HCTF2018-admin[flask session 伪造]
知识点:flask session 伪造 flask中session是存储在客户端cookie中的,也就是存储在本地.flask仅仅对数据进行了签名.众所周知的是,签名的作用是防篡改,而无法防止被读取 ...
- Qt VS Tools插件官方下载及安装
下载 官方下载地址:https://download.qt.io/development_releases/vsaddin/(国外网站直接打开超级慢) 找到对应的VS版本下载 安装 下载完成后安装,打 ...
- 利用Marshal来管理非托管资源
void MarshalChartDemo() { string name = "xuwei"; IntPtr pName = Marshal.AllocHGlobal(name. ...
- git&github 的使用
git(/ɡɪt/[5], 音频(帮助·信息))是一个分布式版本控制软件,最初由林纳斯·托瓦兹(Linus Torvalds)创作,于2005年以GPL发布.最初目的是为更好地管理Linux内核开发而 ...
- 题解【洛谷P5658】[CSP-S 2019]括号树
题面 一道简单的栈与\(\text{DP}\)的结合. 首先介绍一下序列上的括号匹配问题,也就是此题在序列上的做法: 设 \(dp_i\) 表示以 \(i\) 结尾的合法的括号序列个数, \(ss_i ...
- 题解【洛谷P1948】[USACO08JAN]电话线Telephone Lines
题面 题解 很显然,答案满足单调性. 因此,可以使用二分答案求解. 考虑\(check\)的实现. 贪心地想,免费的\(k\)对电话线一定都要用上. 每次\(check\)时将小于\(mid\)的边权 ...
- t-SNE
Don't look back. Don't hesitate, just do it. t-SNE原理 from here. 1. tsne is strictly used for visuali ...
- OpenCV的视频读取
现在找一个能拍摄视频的设备真是太容易了.结果大家都用视频来代替以前的序列图像.视频可能由两种形式得到,一个是像网络摄像头那样实时视频流,或者由其他设备产生的压缩编码后的视频文件.幸运的是,OpenCV ...