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的浏览器来连接到它.设备控制台包含了很多 ...
随机推荐
- Docker学习一篇就够了
Docker 1.简介 Docker是一个开源的应用容器引擎:是一个轻量级容器技术: Docker支持将软件编译成一个镜像:然后在镜像中各种软件做好配置,将镜像发布出去,其他使用者可以直接使用这个镜像 ...
- 刷题76. Minimum Window Substring
一.题目说明 题目76. Minimum Window Substring,求字符串S中最小连续字符串,包括字符串T中的所有字符,复杂度要求是O(n).难度是Hard! 二.我的解答 先说我的思路: ...
- vue 中的路由为什么 采用 hash 路由模式,而不是href超链接模式(Hypertext,Reference)?
1. vue中路由模式的种类有两种 1. 一种是 hash 模式. 2. 一种是 h5 的 history 模式. 2. hash 和 history 都是来自 bom 对象 bom 来自 windo ...
- git&github 的使用
git(/ɡɪt/[5], 音频(帮助·信息))是一个分布式版本控制软件,最初由林纳斯·托瓦兹(Linus Torvalds)创作,于2005年以GPL发布.最初目的是为更好地管理Linux内核开发而 ...
- 动态规划(Dynamic Programming, DP)---- 最大连续子序列和
动态规划(Dynamic Programming, DP)是一种用来解决一类最优化问题的算法思想,简单来使,动态规划是将一个复杂的问题分解成若干个子问题,或者说若干个阶段,下一个阶段通过上一个阶段的结 ...
- 使用acme.sh签发Let's Encrypt的免费数字证书
--------------安装----------------curl https://get.acme.sh | sh#让alias生效source ~/.bashrc ------------- ...
- 2019牛客多校第五场 F maximum clique 1 状压dp+最大独立集
maximum clique 1 题意 给出一个集合s,求每个子集的最大独立集的权值和(权值是独立集的点个数) 分析 n比较小,一股浓浓的暴力枚举每一个子集的感觉,但是暴力枚举模拟肯定会T,那么想一想 ...
- js - 子节点
子节点数量:this.wdlgLossInfo.childNodes.length
- 剑指offer 面试题43. 1~n整数中1出现的次数
leetcode上也见过一样的题,当时不会做 看了一下解法是纯数学解法就没看,结果剑指offer上也出现了这道题,那还是认真看下吧 对于数字abcde,如果第一位是1,比如12345,即计算f(123 ...
- 本地cmd连接远程mysql数据库
一.登录远程mysql 输入mysql -h要远程的IP地址 -u设置的MySQL用户名 -p登录用户密码 例如:mysql -h 192.168.1.139 -u root -p dorlocald ...