add reportList
This commit is contained in:
2
.settings/org.eclipse.core.resources.prefs
Normal file
2
.settings/org.eclipse.core.resources.prefs
Normal file
@@ -0,0 +1,2 @@
|
||||
eclipse.preferences.version=1
|
||||
encoding//WebRoot/html/report.html=UTF-8
|
||||
4
WebRoot/WEB-INF/classes/.gitignore
vendored
Normal file
4
WebRoot/WEB-INF/classes/.gitignore
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
/a_little_config.txt
|
||||
/com/
|
||||
/log4j.properties
|
||||
/report.json
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
45
WebRoot/css/table_report.css
Normal file
45
WebRoot/css/table_report.css
Normal file
@@ -0,0 +1,45 @@
|
||||
.table {
|
||||
width: 100%;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
th {
|
||||
font: bold 12px "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif;
|
||||
color: #4f6b72;
|
||||
border-right: 1px solid #C1DAD7;
|
||||
border-bottom: 1px solid #C1DAD7;
|
||||
border-top: 1px solid #C1DAD7;
|
||||
letter-spacing: 2px;
|
||||
text-transform: uppercase;
|
||||
text-align: left;
|
||||
padding: 6px 6px 6px 12px;
|
||||
background: #CAE8EA no-repeat;
|
||||
}
|
||||
|
||||
td {
|
||||
border-right: 1px solid #C1DAD7;
|
||||
border-bottom: 1px solid #C1DAD7;
|
||||
background: #fff;
|
||||
font-size: 14px;
|
||||
padding: 6px 6px 6px 12px;
|
||||
color: #4f6b72;
|
||||
}
|
||||
|
||||
td.alt {
|
||||
background: #F5FAFA;
|
||||
color: #797268;
|
||||
}
|
||||
|
||||
th.spec, td.spec {
|
||||
border-left: 1px solid #C1DAD7;
|
||||
}
|
||||
/*---------for IE 5.x bug*/
|
||||
html>body td {
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
tr.select th, tr.select td {
|
||||
background-color: #CAE8EA;
|
||||
color: #797268;
|
||||
}
|
||||
45
WebRoot/html/report.html
Normal file
45
WebRoot/html/report.html
Normal file
@@ -0,0 +1,45 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd";>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
|
||||
<html ng-app="LoginApp">
|
||||
<head>
|
||||
<link rel="stylesheet"
|
||||
href="http://apps.bdimg.com/libs/bootstrap/3.2.0/css/bootstrap.min.css">
|
||||
<script src="http://apps.bdimg.com/libs/angular.js/1.3.9/angular.min.js"></script>
|
||||
</head>
|
||||
|
||||
<body ng-controller="LoginController">
|
||||
|
||||
<div align="center">
|
||||
|
||||
<div>
|
||||
<img src="/img/logo.png" width="196" height="46">
|
||||
</div>
|
||||
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control" placeholder="Username"
|
||||
ng-model="user_name">
|
||||
</div>
|
||||
|
||||
<br>
|
||||
|
||||
<div class="input-group">
|
||||
<input type="password" class="form-control" placeholder="password"
|
||||
ng-model="password">
|
||||
</div>
|
||||
|
||||
<br>
|
||||
|
||||
<div>
|
||||
<input type="checkbox"> Remember me
|
||||
<button class="btn btn-success" ng-disabled="incomplete"
|
||||
type="submit" ng-click="login()">
|
||||
<span class="glyphicon glyphicon-hand-right"></span> SIGN-IN
|
||||
</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<script src="/js/app/LoginApp.js"></script>
|
||||
<script src="/js/controller/LoginController.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
31
WebRoot/html/reportList.html
Normal file
31
WebRoot/html/reportList.html
Normal file
@@ -0,0 +1,31 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd";>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
|
||||
<html ng-app="ReportListApp">
|
||||
<head>
|
||||
<link rel="stylesheet"
|
||||
href="http://apps.bdimg.com/libs/bootstrap/3.2.0/css/bootstrap.min.css">
|
||||
<script src="http://apps.bdimg.com/libs/angular.js/1.3.9/angular.min.js"></script>
|
||||
</head>
|
||||
|
||||
<body ng-controller="ReportListController">
|
||||
|
||||
<br>
|
||||
<h4> <EFBFBD><EFBFBD>ȫ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD>б<EFBFBD></h3>
|
||||
|
||||
<hr>
|
||||
|
||||
<ul>
|
||||
<div ng-repeat="report in reportList">
|
||||
<a
|
||||
href="http://localhost/report/query?report_id={{report.report_id}}"><ui>{{report.report_name}}</ui></a>
|
||||
</div>
|
||||
|
||||
</ul>
|
||||
|
||||
<hr>
|
||||
|
||||
|
||||
<script src="/js/app/ReportListApp.js"></script>
|
||||
<script src="/js/controller/ReportListController.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
1
WebRoot/js/app/ReportApp.js
Normal file
1
WebRoot/js/app/ReportApp.js
Normal file
@@ -0,0 +1 @@
|
||||
var app = angular.module("LoginApp", []);
|
||||
1
WebRoot/js/app/ReportListApp.js
Normal file
1
WebRoot/js/app/ReportListApp.js
Normal file
@@ -0,0 +1 @@
|
||||
var app = angular.module("ReportListApp", []);
|
||||
13
WebRoot/js/controller/ReportController.js
Normal file
13
WebRoot/js/controller/ReportController.js
Normal file
@@ -0,0 +1,13 @@
|
||||
app.controller("ReportListController", function($scope, $http) {
|
||||
$http.get("http://localhost/summaryPlan/reportList").success(
|
||||
function(response) {
|
||||
if (response.status == "SUCCESS") {
|
||||
|
||||
$scope.reportList = response.data;
|
||||
|
||||
}
|
||||
else{
|
||||
// $http.get("http://localhost/summaryPlan/reportlist");
|
||||
}
|
||||
});
|
||||
});
|
||||
7
WebRoot/js/controller/ReportListController.js
Normal file
7
WebRoot/js/controller/ReportListController.js
Normal file
@@ -0,0 +1,7 @@
|
||||
app.controller("ReportListController", function($scope, $http) {
|
||||
$http.get("http://localhost/report/reportList").success(function(response) {
|
||||
|
||||
$scope.reportList = response.reportList;
|
||||
|
||||
});
|
||||
});
|
||||
@@ -22,7 +22,8 @@ report_content |varchar(200) | 无 | 检查内容
|
||||
#### 检查项表 check_item
|
||||
字段 |类型 |约束 | 说明
|
||||
------------|------------|------------|------------
|
||||
report_item |varchar(200) |主键 | 检查项
|
||||
report_item_id |int(11) |主键 | 检查项id
|
||||
report_item |varchar(200) | | 检查项
|
||||
table_sequence |int(11) | 无 | 所在检查内容中具体序号
|
||||
check_content_id |int(11) | 无 | 所属检查内容的id
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ SET FOREIGN_KEY_CHECKS=0;
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `check_content`;
|
||||
CREATE TABLE `check_content` (
|
||||
`check_content_id` int(11) NOT NULL,
|
||||
`check_content_id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`check_content` varchar(200) NOT NULL,
|
||||
PRIMARY KEY (`check_content_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
@@ -40,10 +40,11 @@ INSERT INTO `check_content` VALUES ('6', '消防设施');
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `check_item`;
|
||||
CREATE TABLE `check_item` (
|
||||
`check_item_id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`check_item` varchar(200) NOT NULL,
|
||||
`table_sequence` int(11) unsigned NOT NULL,
|
||||
`check_content_id` int(11) NOT NULL,
|
||||
PRIMARY KEY (`check_item`),
|
||||
PRIMARY KEY (`check_item_id`),
|
||||
KEY `check_content_id` (`check_content_id`),
|
||||
CONSTRAINT `check_content_id` FOREIGN KEY (`check_content_id`) REFERENCES `check_content` (`check_content_id`) ON DELETE CASCADE ON UPDATE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
@@ -51,34 +52,34 @@ CREATE TABLE `check_item` (
|
||||
-- ----------------------------
|
||||
-- Records of check_item
|
||||
-- ----------------------------
|
||||
INSERT INTO `check_item` VALUES ('严禁人员携带火种、通讯工具、易燃易爆物品进入库区', '2', '3');
|
||||
INSERT INTO `check_item` VALUES ('仓库门窗无破损,库内通风良好', '4', '4');
|
||||
INSERT INTO `check_item` VALUES ('喷淋设施完好且水源充足', '6', '6');
|
||||
INSERT INTO `check_item` VALUES ('外来人员应有人带领,实行严格登记手续', '1', '3');
|
||||
INSERT INTO `check_item` VALUES ('库内安全通道无杂物堆放,畅通无阻', '2', '4');
|
||||
INSERT INTO `check_item` VALUES ('库内温度保持在35度以下,湿度计保持在85%以下', '1', '4');
|
||||
INSERT INTO `check_item` VALUES ('库区夜间照明充足(固定、移动照明)并设有应急照明', '7', '4');
|
||||
INSERT INTO `check_item` VALUES ('库区有足够的消防通道并保持畅通(不小于4米,且形成环形通道)', '3', '4');
|
||||
INSERT INTO `check_item` VALUES ('库区范围内无山火', '9', '4');
|
||||
INSERT INTO `check_item` VALUES ('库房值班室应装有两部与外界联系的固定电话', '6', '3');
|
||||
INSERT INTO `check_item` VALUES ('库房围墙、电网无破损', '10', '4');
|
||||
INSERT INTO `check_item` VALUES ('库房无破损,屋顶无漏雨', '5', '4');
|
||||
INSERT INTO `check_item` VALUES ('按规定穿戴安全帽、工作服、劳保鞋等劳保用品,并保持整洁', '1', '1');
|
||||
INSERT INTO `check_item` VALUES ('按规定进行防雷防静电检测,并提供检测记录', '1', '2');
|
||||
INSERT INTO `check_item` VALUES ('接地线、网无破损、断裂', '2', '2');
|
||||
INSERT INTO `check_item` VALUES ('消防栓闸阀灵敏、可靠 ', '4', '6');
|
||||
INSERT INTO `check_item` VALUES ('消防水池蓄满水,消防沙定期翻动 ', '3', '6');
|
||||
INSERT INTO `check_item` VALUES ('消防水管、水泵完好并保证双回路供电 ', '2', '6');
|
||||
INSERT INTO `check_item` VALUES ('消防水袋齐全、完好?确定数量 ', '5', '6');
|
||||
INSERT INTO `check_item` VALUES ('火工器材出入帐目清楚,帐物相符', '3', '3');
|
||||
INSERT INTO `check_item` VALUES ('火工器材箱子条码与货物条码一致', '5', '3');
|
||||
INSERT INTO `check_item` VALUES ('灭火器插销完好并在有效期内使用,指针显示在绿色区域', '1', '6');
|
||||
INSERT INTO `check_item` VALUES ('炸药堆高不超过1.8米、雷管堆高不超过1.6米', '2', '5');
|
||||
INSERT INTO `check_item` VALUES ('炸药库周围无杂草及其它易燃物', '8', '4');
|
||||
INSERT INTO `check_item` VALUES ('炸药库设双门双锁,门无变形、破损;标识牌、警示牌齐全、规范', '6', '4');
|
||||
INSERT INTO `check_item` VALUES ('爆破器材要按类分存,严禁混存', '1', '5');
|
||||
INSERT INTO `check_item` VALUES ('禁止车辆未熄火时进行装卸;装卸时必须轻拿轻放', '4', '3');
|
||||
INSERT INTO `check_item` VALUES ('通道宽不少于1.3米,堆垛距离边墙不少于0.3米', '3', '5');
|
||||
INSERT INTO `check_item` VALUES ('1','严禁人员携带火种、通讯工具、易燃易爆物品进入库区', '2', '3');
|
||||
INSERT INTO `check_item` VALUES ('2','仓库门窗无破损,库内通风良好', '4', '4');
|
||||
INSERT INTO `check_item` VALUES ('3','喷淋设施完好且水源充足', '6', '6');
|
||||
INSERT INTO `check_item` VALUES ('4','外来人员应有人带领,实行严格登记手续', '1', '3');
|
||||
INSERT INTO `check_item` VALUES ('5','库内安全通道无杂物堆放,畅通无阻', '2', '4');
|
||||
INSERT INTO `check_item` VALUES ('6','库内温度保持在35度以下,湿度计保持在85%以下', '1', '4');
|
||||
INSERT INTO `check_item` VALUES ('7','库区夜间照明充足(固定、移动照明)并设有应急照明', '7', '4');
|
||||
INSERT INTO `check_item` VALUES ('8','库区有足够的消防通道并保持畅通(不小于4米,且形成环形通道)', '3', '4');
|
||||
INSERT INTO `check_item` VALUES ('9','库区范围内无山火', '9', '4');
|
||||
INSERT INTO `check_item` VALUES ('10','库房值班室应装有两部与外界联系的固定电话', '6', '3');
|
||||
INSERT INTO `check_item` VALUES ('11','库房围墙、电网无破损', '10', '4');
|
||||
INSERT INTO `check_item` VALUES ('12','库房无破损,屋顶无漏雨', '5', '4');
|
||||
INSERT INTO `check_item` VALUES ('13','按规定穿戴安全帽、工作服、劳保鞋等劳保用品,并保持整洁', '1', '1');
|
||||
INSERT INTO `check_item` VALUES ('14','按规定进行防雷防静电检测,并提供检测记录', '1', '2');
|
||||
INSERT INTO `check_item` VALUES ('15','接地线、网无破损、断裂', '2', '2');
|
||||
INSERT INTO `check_item` VALUES ('16','消防栓闸阀灵敏、可靠 ', '4', '6');
|
||||
INSERT INTO `check_item` VALUES ('17','消防水池蓄满水,消防沙定期翻动 ', '3', '6');
|
||||
INSERT INTO `check_item` VALUES ('18','消防水管、水泵完好并保证双回路供电 ', '2', '6');
|
||||
INSERT INTO `check_item` VALUES ('19','消防水袋齐全、完好?确定数量 ', '5', '6');
|
||||
INSERT INTO `check_item` VALUES ('20','火工器材出入帐目清楚,帐物相符', '3', '3');
|
||||
INSERT INTO `check_item` VALUES ('21','火工器材箱子条码与货物条码一致', '5', '3');
|
||||
INSERT INTO `check_item` VALUES ('22','灭火器插销完好并在有效期内使用,指针显示在绿色区域', '1', '6');
|
||||
INSERT INTO `check_item` VALUES ('23','炸药堆高不超过1.8米、雷管堆高不超过1.6米', '2', '5');
|
||||
INSERT INTO `check_item` VALUES ('24','炸药库周围无杂草及其它易燃物', '8', '4');
|
||||
INSERT INTO `check_item` VALUES ('25','炸药库设双门双锁,门无变形、破损;标识牌、警示牌齐全、规范', '6', '4');
|
||||
INSERT INTO `check_item` VALUES ('26','爆破器材要按类分存,严禁混存', '1', '5');
|
||||
INSERT INTO `check_item` VALUES ('27','禁止车辆未熄火时进行装卸;装卸时必须轻拿轻放', '4', '3');
|
||||
INSERT INTO `check_item` VALUES ('28','通道宽不少于1.3米,堆垛距离边墙不少于0.3米', '3', '5');
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for `check_record`
|
||||
@@ -87,23 +88,23 @@ DROP TABLE IF EXISTS `check_record`;
|
||||
CREATE TABLE `check_record` (
|
||||
`record_id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`report_id` int(11) NOT NULL,
|
||||
`check_item` varchar(200) NOT NULL,
|
||||
`check_item_id` int(11) NOT NULL,
|
||||
`passed` varchar(1) NOT NULL,
|
||||
`pic_url` varchar(200) DEFAULT '""',
|
||||
`note` varchar(200) DEFAULT '""',
|
||||
PRIMARY KEY (`record_id`),
|
||||
KEY `check_item` (`check_item`),
|
||||
KEY `check_item_id` (`check_item_id`),
|
||||
KEY `report_id` (`report_id`),
|
||||
CONSTRAINT `check_item` FOREIGN KEY (`check_item`) REFERENCES `check_item` (`check_item`) ON DELETE CASCADE ON UPDATE CASCADE,
|
||||
CONSTRAINT `check_item_id` FOREIGN KEY (`check_item_id`) REFERENCES `check_item` (`check_item_id`) ON DELETE CASCADE ON UPDATE CASCADE,
|
||||
CONSTRAINT `report_id` FOREIGN KEY (`report_id`) REFERENCES `report` (`report_id`) ON DELETE CASCADE ON UPDATE CASCADE
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of check_record
|
||||
-- ----------------------------
|
||||
INSERT INTO `check_record` VALUES ('1', '1', '按规定穿戴安全帽、工作服、劳保鞋等劳保用品,并保持整洁', '1', '', '备注1');
|
||||
INSERT INTO `check_record` VALUES ('2', '1', '按规定进行防雷防静电检测,并提供检测记录', '1', '', '备注2');
|
||||
INSERT INTO `check_record` VALUES ('3', '1', '接地线、网无破损、断裂', '0', '', '备注3');
|
||||
INSERT INTO `check_record` VALUES ('1', '1', '13', '1', '', '备注1');
|
||||
INSERT INTO `check_record` VALUES ('2', '1', '14', '1', '', '备注2');
|
||||
INSERT INTO `check_record` VALUES ('3', '1', '15', '0', '', '备注3');
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for `report`
|
||||
@@ -121,3 +122,8 @@ CREATE TABLE `report` (
|
||||
-- Records of report
|
||||
-- ----------------------------
|
||||
INSERT INTO `report` VALUES ('1', 'AH-H001-01 2015年3月11日18点测试表', '黄金定', '2015-11-14 11:46:10');
|
||||
INSERT INTO `report` VALUES ('2', 'AH-H001-02 2015年3月12日18点测试表', '杜佳佳', '2015-11-14 11:46:10');
|
||||
INSERT INTO `report` VALUES ('3', 'AH-H001-03 2015年3月12日18点测试表', '杜佳佳', '2015-11-14 11:46:10');
|
||||
INSERT INTO `report` VALUES ('4', 'AH-H001-04 2015年3月12日18点测试表', '杜佳佳', '2015-11-14 11:46:10');
|
||||
INSERT INTO `report` VALUES ('5', 'AH-H001-05 2015年3月12日18点测试表', '杜佳佳', '2015-11-14 11:46:10');
|
||||
INSERT INTO `report` VALUES ('6', 'AH-H001-06 2015年3月12日18点测试表', '杜佳佳', '2015-11-14 11:46:10');
|
||||
|
||||
@@ -44,7 +44,7 @@ public class RunConfig extends JFinalConfig {
|
||||
ActiveRecordPlugin arp = new ActiveRecordPlugin(c3p0Plugin);
|
||||
me.add(arp);
|
||||
arp.addMapping("check_content", "check_content_id", CheckContent.class);
|
||||
arp.addMapping("check_item", "check_item", CheckItem.class);
|
||||
arp.addMapping("check_item", "check_item_id", CheckItem.class);
|
||||
arp.addMapping("check_record", "record_id", CheckRecord.class);
|
||||
arp.addMapping("report", "report_id", Report.class);
|
||||
}
|
||||
|
||||
@@ -2,7 +2,6 @@ package com.jinshan.controller;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
@@ -14,6 +13,17 @@ import com.jinshan.model.Report;
|
||||
|
||||
public class ReportController extends Controller {
|
||||
|
||||
public void index() {
|
||||
redirect("/html/reportList.html");
|
||||
}
|
||||
|
||||
public void reportList() {
|
||||
|
||||
setAttr("reportList", Report.dao.find("select * from report"));
|
||||
|
||||
renderJson();
|
||||
}
|
||||
|
||||
public void query() {
|
||||
Integer report_id = getParaToInt("report_id");
|
||||
|
||||
@@ -26,8 +36,7 @@ public class ReportController extends Controller {
|
||||
setAttr("report_name", report_name);
|
||||
setAttr("report_creator", report_creator);
|
||||
setAttr("report_create_time", report_create_time);
|
||||
List<Object> contents = Report.dao.query(report_id);
|
||||
setAttr("contents", contents);
|
||||
setAttr("contents", Report.dao.query(report_id));
|
||||
}
|
||||
renderJson();
|
||||
}
|
||||
|
||||
@@ -28,12 +28,13 @@ public class Report extends Model<Report> {
|
||||
|
||||
for (int i = 0; i < check_records.size(); i++) {
|
||||
CheckRecord check_record = check_records.get(i);
|
||||
String check_item = check_record.getStr("check_item");
|
||||
Integer check_item_id = check_record.get("check_item_id");
|
||||
String passed = check_record.getStr("passed");
|
||||
String pic_url = check_record.getStr("pic_url");
|
||||
String note = check_record.getStr("note");
|
||||
|
||||
CheckItem checkItem = CheckItem.dao.findById(check_item);
|
||||
CheckItem checkItem = CheckItem.dao.findById(check_item_id);
|
||||
String check_item = checkItem.get("check_item");
|
||||
int check_content_id = checkItem.getInt("check_content_id");
|
||||
int table_sequence = checkItem.getLong("table_sequence").intValue();
|
||||
|
||||
|
||||
@@ -4099,3 +4099,9 @@ org.json.JSONException: A JSONObject text must begin with '{' at 1 [character 2
|
||||
|
||||
2015-11-14 17:44:46
|
||||
[WARN]-[Thread: qtp1549409129-27]-[com.jfinal.core.ActionHandler.handle()]: 404 Action Not Found: /report/
|
||||
|
||||
2015-11-24 22:50:27
|
||||
[WARN]-[Thread: qtp1549409129-22]-[com.jfinal.core.ActionException.<init>()]: Can not parse the parameter "report.report_id" to Integer value.
|
||||
|
||||
2015-11-24 22:50:27
|
||||
[WARN]-[Thread: qtp1549409129-22]-[com.jfinal.core.ActionHandler.handle()]: 404 Not Found: /report/query?report_id=report.report_id
|
||||
|
||||
Reference in New Issue
Block a user