diff --git a/.settings/org.eclipse.core.resources.prefs b/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 0000000..9ffca25 --- /dev/null +++ b/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +encoding//WebRoot/html/report.html=UTF-8 diff --git a/WebRoot/WEB-INF/classes/.gitignore b/WebRoot/WEB-INF/classes/.gitignore new file mode 100644 index 0000000..24dec09 --- /dev/null +++ b/WebRoot/WEB-INF/classes/.gitignore @@ -0,0 +1,4 @@ +/a_little_config.txt +/com/ +/log4j.properties +/report.json diff --git a/WebRoot/WEB-INF/classes/com/jinshan/common/RunConfig.class b/WebRoot/WEB-INF/classes/com/jinshan/common/RunConfig.class index 5844811..db25e10 100644 Binary files a/WebRoot/WEB-INF/classes/com/jinshan/common/RunConfig.class and b/WebRoot/WEB-INF/classes/com/jinshan/common/RunConfig.class differ diff --git a/WebRoot/WEB-INF/classes/com/jinshan/controller/ReportController.class b/WebRoot/WEB-INF/classes/com/jinshan/controller/ReportController.class index 6c8b8ae..1d84681 100644 Binary files a/WebRoot/WEB-INF/classes/com/jinshan/controller/ReportController.class and b/WebRoot/WEB-INF/classes/com/jinshan/controller/ReportController.class differ diff --git a/WebRoot/WEB-INF/classes/com/jinshan/model/Report$1.class b/WebRoot/WEB-INF/classes/com/jinshan/model/Report$1.class index 7f5267e..f89c81e 100644 Binary files a/WebRoot/WEB-INF/classes/com/jinshan/model/Report$1.class and b/WebRoot/WEB-INF/classes/com/jinshan/model/Report$1.class differ diff --git a/WebRoot/WEB-INF/classes/com/jinshan/model/Report$2.class b/WebRoot/WEB-INF/classes/com/jinshan/model/Report$2.class index 4070480..8d52ce0 100644 Binary files a/WebRoot/WEB-INF/classes/com/jinshan/model/Report$2.class and b/WebRoot/WEB-INF/classes/com/jinshan/model/Report$2.class differ diff --git a/WebRoot/WEB-INF/classes/com/jinshan/model/Report.class b/WebRoot/WEB-INF/classes/com/jinshan/model/Report.class index a77994d..f7aa779 100644 Binary files a/WebRoot/WEB-INF/classes/com/jinshan/model/Report.class and b/WebRoot/WEB-INF/classes/com/jinshan/model/Report.class differ diff --git a/WebRoot/css/table_report.css b/WebRoot/css/table_report.css new file mode 100644 index 0000000..4be8f14 --- /dev/null +++ b/WebRoot/css/table_report.css @@ -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; +} \ No newline at end of file diff --git a/WebRoot/html/report.html b/WebRoot/html/report.html new file mode 100644 index 0000000..0608cad --- /dev/null +++ b/WebRoot/html/report.html @@ -0,0 +1,45 @@ + + + + + + + + + + +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ Remember me + +
+ +
+ + + + + \ No newline at end of file diff --git a/WebRoot/html/reportList.html b/WebRoot/html/reportList.html new file mode 100644 index 0000000..c2b2d34 --- /dev/null +++ b/WebRoot/html/reportList.html @@ -0,0 +1,31 @@ + + + + + + + + + + +
+

       安全检查信息列表

+ +
+ + + +
+ + + + + + \ No newline at end of file diff --git a/WebRoot/js/app/ReportApp.js b/WebRoot/js/app/ReportApp.js new file mode 100644 index 0000000..2d569ad --- /dev/null +++ b/WebRoot/js/app/ReportApp.js @@ -0,0 +1 @@ +var app = angular.module("LoginApp", []); \ No newline at end of file diff --git a/WebRoot/js/app/ReportListApp.js b/WebRoot/js/app/ReportListApp.js new file mode 100644 index 0000000..8c5d78c --- /dev/null +++ b/WebRoot/js/app/ReportListApp.js @@ -0,0 +1 @@ +var app = angular.module("ReportListApp", []); \ No newline at end of file diff --git a/WebRoot/js/controller/ReportController.js b/WebRoot/js/controller/ReportController.js new file mode 100644 index 0000000..02bfd2b --- /dev/null +++ b/WebRoot/js/controller/ReportController.js @@ -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"); + } + }); +}); \ No newline at end of file diff --git a/WebRoot/js/controller/ReportListController.js b/WebRoot/js/controller/ReportListController.js new file mode 100644 index 0000000..2b314c0 --- /dev/null +++ b/WebRoot/js/controller/ReportListController.js @@ -0,0 +1,7 @@ +app.controller("ReportListController", function($scope, $http) { + $http.get("http://localhost/report/reportList").success(function(response) { + + $scope.reportList = response.reportList; + + }); +}); \ No newline at end of file diff --git a/doc/database/README.md b/doc/database/README.md index 95da985..0f30461 100644 --- a/doc/database/README.md +++ b/doc/database/README.md @@ -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 diff --git a/doc/database/jinshan.sql b/doc/database/jinshan.sql index 408f64f..cc4a049 100644 --- a/doc/database/jinshan.sql +++ b/doc/database/jinshan.sql @@ -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'); diff --git a/src/com/jinshan/common/RunConfig.java b/src/com/jinshan/common/RunConfig.java index 79777df..dc65cf4 100644 --- a/src/com/jinshan/common/RunConfig.java +++ b/src/com/jinshan/common/RunConfig.java @@ -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); } diff --git a/src/com/jinshan/controller/ReportController.java b/src/com/jinshan/controller/ReportController.java index fb88c29..06533ea 100644 --- a/src/com/jinshan/controller/ReportController.java +++ b/src/com/jinshan/controller/ReportController.java @@ -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 contents = Report.dao.query(report_id); - setAttr("contents", contents); + setAttr("contents", Report.dao.query(report_id)); } renderJson(); } diff --git a/src/com/jinshan/model/Report.java b/src/com/jinshan/model/Report.java index ad49757..5339f33 100644 --- a/src/com/jinshan/model/Report.java +++ b/src/com/jinshan/model/Report.java @@ -28,12 +28,13 @@ public class Report extends Model { 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(); diff --git a/zhongchou.log b/zhongchou.log index c5fe321..92651f3 100644 --- a/zhongchou.log +++ b/zhongchou.log @@ -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.()]: 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