@@ -156,7 +192,7 @@
}
});
- $(".testpaper").click(function (){
+ $("#qingsongkao_paper").click(function (){
var path = "../paper/list2.do?" ;
//$(".content_r").html('
');
if($("#mainFrame").attr('src') != (path)){
@@ -164,6 +200,14 @@
window.top.loading.show();
}
});
+
+ $("#jishice_paper").click(function (){
+ var path = "../teacher/teach_paper.do?" ;
+ //if($("#mainFrame").attr('src') != (path)){
+ $("#mainFrame").attr('src',path);
+ //window.top.loading.show();
+ //}
+ });
\ No newline at end of file
diff --git a/WebRoot/static/css/paper.css b/WebRoot/static/css/paper.css
new file mode 100644
index 0000000..4b6a1f7
--- /dev/null
+++ b/WebRoot/static/css/paper.css
@@ -0,0 +1,5 @@
+li{list-style:none;}
+.choose_class{border-bottom:1px solid #eee;padding:2% 0 5% 0;}
+.choose_class li{width:20%;margin:0 2.5%;margin-top:2%;float:left;border:1px solid #3c7ae3;text-align:center;border-radius:3px;line-height:50px;font-size:16px;}
+.choose_class li.active{color:#fff;background:#3c7ae3;}
+.screen{border-bottom:1px dashed #eee;padding:3% 0;}
\ No newline at end of file
diff --git a/WebRoot/static/css/paper_view.css b/WebRoot/static/css/paper_view.css
new file mode 100644
index 0000000..d1f280c
--- /dev/null
+++ b/WebRoot/static/css/paper_view.css
@@ -0,0 +1,23 @@
+li{list-style:none;}
+.left_menu li{line-height:50px;border-bottom:1px solid #ccc;text-align:center;}
+.left_menu .active{background:#6691de;color:#fff;}
+.report_info{padding-bottom:30px;border-bottom:1px solid #ccc;}
+.report_info li{width:20%;float:left;margin:0 2.5%;line-height:50px;background:#e7effd;text-align:center;border-radius:25px;}
+.option{padding-bottom:20px;}
+.option li{width:100%;}
+.option li span{vertical-align:middle;margin-right:5px;}
+.resolve_box{padding:20px 0;border-top:1px dashed #ccc;}
+.star_box{border-top:1px dashed #ccc;border-bottom:1px solid #ccc;padding:10px 0;}
+.star li{width:16px;height:16px;float:left;margin-left:5px;}
+.star ul{float:left;padding-left:0;margin-right:20px;}
+.star .off{background:url(../images/off.png) no-repeat;background-size:100%;}
+.star .on{background:url(../images/on.png) no-repeat;background-size:100%;}
+.tab_report_box{padding:20px 0;border-top:1px dashed #ccc;}
+.tab_report_box p{text-align:center;}
+.resolve{display:none;}
+.tab_report_box .round_w_orange{width:100px;height:100px;background:#ffdeb5;position:relative;overflow:hidden;border-radius:50px;margin:0 auto;}
+.tab_report_box .round_n_orange{width:70px;height:70px;background:#ffac47;position:absolute;top:15px;left:15px;overflow:hidden;border-radius:35px;}
+.tab_report_box .round_n_orange span{color:#fff;line-height:70px;text-align:center;display:inline-block;width:100%;}
+.tab_report_box .round_w_red{width:100px;height:100px;background:#ffd0c6;position:relative;overflow:hidden;border-radius:50px;margin:0 auto;}
+.tab_report_box .round_n_red{width:70px;height:70px;background:#ff8a71;position:absolute;top:15px;left:15px;overflow:hidden;border-radius:35px;}
+.tab_report_box .round_n_red span{color:#fff;line-height:70px;text-align:center;display:inline-block;width:100%;}
\ No newline at end of file
diff --git a/WebRoot/static/css/set_quetion.css b/WebRoot/static/css/set_quetion.css
new file mode 100644
index 0000000..3872583
--- /dev/null
+++ b/WebRoot/static/css/set_quetion.css
@@ -0,0 +1,52 @@
+body{width:100%;min-height:100%;height:auto;padding-bottom:80px;box-sizing:border-box;}
+li{list-style:none;}
+.choose_class{height:150px;padding:20px;background:#fff;box-shadow:0 0 10px #ccc;}
+.choose_class .col-md-10 li{width:15%;margin:0 2.5%;float:left;border:1px solid #3c7ae3;text-align:center;border-radius:3px;line-height:50px;font-size:16px;color:#fff;background:#3c7ae3;}
+.left_menu{box-shadow:0 0 10px #ccc;margin-top:10px;}
+.left_menu .tab{border-bottom:1px solid #ccc;}
+.left_menu .tab ul{padding:0;margin:0;}
+.left_menu .tab li{width:50%;box-sizing:border-box;float:left;font-size:26px;text-align:center;padding:10px 0;}
+.left_menu .tab li p{margin:0;}
+.left_menu .tab .active{border-bottom: 2px solid #3c7ae3;}
+.left_menu .tab .active p{color:#3c7ae3;}
+.left_menu .tab li:first-child{border-right:1px solid #ccc;}
+.left_menu .choose_book .book{background:#e9f0ff;padding:0 6px;}
+.left_menu .choose_book .book p{float:left;line-height:34px;margin-bottom:0;}
+.left_menu .choose_book .book img{float:right;width:20px;height:20px;margin-top:4.5px;}
+.left_menu .choose_book .book_box{display:none;}
+.left_menu .choose_book .book_box ul{padding:0;margin:0;}
+.left_menu .choose_book .book_box ul li{border-bottom:1px solid #ccc;position:relative;}
+.left_menu .choose_book .book_box p{float:left;line-height:34px;margin-bottom:0;font-size:14px;}
+.left_menu .choose_book .book_box img{float:right;width:20px;height:20px;margin-top:4.5px;}
+.left_menu .choose_book .gary{width:100%;height:15px;background:#eee;}
+.left_menu .section{padding:20px 0;}
+.left_menu .section ul{padding:0;margin:0;}
+.left_menu .section ul li{padding:10px 0;border-bottom:1px solid #ccc;}
+.left_menu .section ul li img{width:20px;height:20px;margin-right:10px;}
+.left_menu .section ul li ul{padding-left:25px;display:none;}
+.left_menu .section ul li ul li{border:0;}
+.float_box{position:absolute;top:0;background:#e9f0ff;left:100%;width:400px;height:200px;display:none;z-index:99;}
+.float_box li{width:27%;margin:0 2.5%;margin-top:10px;padding:5px 0px;text-align:center;border-radius:3px;border:1px solid #ccc;overflow:hidden;float:left;}
+.screen{width:100%;height:150px;background:#fff;box-shadow: 0 0 10px #ccc;margin-top:10px;padding:10px;}
+.tag dt,dd{display:inline-block;}
+
+.option{padding:10px 0;}
+.option ul{padding:0;}
+.option li{width:100%;padding:10px 0;}
+.option li span{vertical-align:middle;margin-right:5px;}
+.resolve{display:none;}
+.resolve_box{padding:20px 0;border-top:1px dashed #ccc;}
+.star_box{border-top:1px dashed #ccc;border-bottom:1px solid #ccc;padding:10px 0;}
+.star_box .col-md-6{float:right;}
+.star li{width:16px;height:16px;float:left;margin-left:5px;}
+.star ul{float:left;padding-left:0;margin-right:20px;}
+.star .off{background:url(../images/off.png) no-repeat;background-size:100%;}
+.star .on{background:url(../images/on.png) no-repeat;background-size:100%;}
+.check_box{float:right;width:22px;height:22px;border:2px solid #6a9cf0;border-radius:6px;}
+.checked{background:url(../images/checked.png) no-repeat;background-size:100%;border:0;}
+
+.basket{width:100%;height:80px;position:fixed;bottom:0;background:#e9f0ff;}
+.basket .basket_box{width:1200px;margin:0 auto;}
+.basket .basket_box p{display:inline-block;line-height:80px;font-size:25px;text-align:center;}
+.basket .basket_box .btn{font-size:20px;}
+.basket .basket_box .clear_que{margin-right:5%;}
diff --git a/WebRoot/static/css/teach.css b/WebRoot/static/css/teach.css
index 541216b..d582128 100644
--- a/WebRoot/static/css/teach.css
+++ b/WebRoot/static/css/teach.css
@@ -29,10 +29,14 @@ input[type="checkbox"]{margin-right:10px;}
.content .content_l .name p:first-child{font-size:14px;}
.content .content_l .name p:nth-child(2){font-size:20px;}
.content .content_l .name p:nth-child(3){font-size:14px;}
-.content .content_l .tab1{border-bottom:1px solid #80afb4;}
+.content .content_l .tab1{border-bottom:1px solid #80afb4;cursor:pointer}
.content .content_l .tab1 p{width:100%;height:77px;line-height:77px;margin-bottom:0;font-size:24px;color:#fff;padding-left:10%;}
-.content .content_l .tab1 ul{margin-bottom:0;padding:12px 0;padding-left:15%;background:#0b535b;font-size:18px;line-height:64px;display:none;}
+.content .content_l .tab1 ul{margin-bottom:0;padding:0;font-size:18px;line-height:64px;display:none;}
.content .content_l .tab1 ul li{list-style:none;color:#fff;cursor:pointer;}
+.menu_1 li{background:#1b535b;border-bottom: 1px solid #80afb4;}
+.menu_2 li{background:#333333;border-bottom: 1px dashed #80afb4;}
+.content .content_l .tab1 ul li:last-child{border:0;}
+.content .content_l .tab1 ul li p{padding-left:15%;font-size:18px;}
.content .content_r{margin-left:18%;height:100%;overflow-y:hidden;}
diff --git a/WebRoot/static/images/add.png b/WebRoot/static/images/add.png
new file mode 100644
index 0000000..56697ee
--- /dev/null
+++ b/WebRoot/static/images/add.png
diff --git a/WebRoot/static/images/arrow_right.png b/WebRoot/static/images/arrow_right.png
new file mode 100644
index 0000000..8e0da42
--- /dev/null
+++ b/WebRoot/static/images/arrow_right.png
diff --git a/WebRoot/static/images/checked.png b/WebRoot/static/images/checked.png
new file mode 100644
index 0000000..6035da3
--- /dev/null
+++ b/WebRoot/static/images/checked.png
diff --git a/WebRoot/static/images/down_arrow.png b/WebRoot/static/images/down_arrow.png
new file mode 100644
index 0000000..b7dbc6b
--- /dev/null
+++ b/WebRoot/static/images/down_arrow.png
diff --git a/WebRoot/static/images/off.png b/WebRoot/static/images/off.png
new file mode 100644
index 0000000..493bba0
--- /dev/null
+++ b/WebRoot/static/images/off.png
diff --git a/WebRoot/static/images/on.png b/WebRoot/static/images/on.png
new file mode 100644
index 0000000..e9dd77f
--- /dev/null
+++ b/WebRoot/static/images/on.png
diff --git a/WebRoot/static/images/option_1.png b/WebRoot/static/images/option_1.png
new file mode 100644
index 0000000..adad5ff
--- /dev/null
+++ b/WebRoot/static/images/option_1.png
diff --git a/WebRoot/static/images/option_2.png b/WebRoot/static/images/option_2.png
new file mode 100644
index 0000000..4527450
--- /dev/null
+++ b/WebRoot/static/images/option_2.png
diff --git a/WebRoot/static/images/option_3.png b/WebRoot/static/images/option_3.png
new file mode 100644
index 0000000..f039529
--- /dev/null
+++ b/WebRoot/static/images/option_3.png
diff --git a/WebRoot/static/images/option_4.png b/WebRoot/static/images/option_4.png
new file mode 100644
index 0000000..88d8821
--- /dev/null
+++ b/WebRoot/static/images/option_4.png
diff --git a/WebRoot/static/images/reduce.png b/WebRoot/static/images/reduce.png
new file mode 100644
index 0000000..4517abb
--- /dev/null
+++ b/WebRoot/static/images/reduce.png
diff --git a/WebRoot/static/images/title.png b/WebRoot/static/images/title.png
new file mode 100644
index 0000000..7b35490
--- /dev/null
+++ b/WebRoot/static/images/title.png
diff --git a/WebRoot/static/images/up_arrow.png b/WebRoot/static/images/up_arrow.png
new file mode 100644
index 0000000..45e4b98
--- /dev/null
+++ b/WebRoot/static/images/up_arrow.png
diff --git a/WebRoot/static/js/model.js b/WebRoot/static/js/model.js
index 5d6bab2..cbab21c 100644
--- a/WebRoot/static/js/model.js
+++ b/WebRoot/static/js/model.js
@@ -1,7 +1,17 @@
$(".tab1").click(function(){
var _this=$(this);
- _this.find("ul").slideToggle(function(){
- if(_this.find("ul").css("display")=="block")
+ _this.children("ul").slideToggle(function(){
+ if(_this.children("ul").css("display")=="block")
+ _this.find(".right").attr("class","down jiao");
+ else
+ _this.find(".down").attr("class","right jiao");
+ });
+})
+$(".menu_1 li").click(function(event){
+ event.stopPropagation();
+ var _this=$(this);
+ _this.children("ul").slideToggle(function(){
+ if(_this.children("ul").css("display")=="block")
_this.find(".right").attr("class","down jiao");
else
_this.find(".down").attr("class","right jiao");
diff --git a/resources/mybatis1/sunvote/ChapterMapper.xml b/resources/mybatis1/sunvote/ChapterMapper.xml
index 9fa55c1..f445f98 100644
--- a/resources/mybatis1/sunvote/ChapterMapper.xml
+++ b/resources/mybatis1/sunvote/ChapterMapper.xml
@@ -12,7 +12,7 @@
NAME,
CDESCRIPTION,
REMARK,
- TEACHINGMATERIAL_ID,
+ TEXTBOOK_ID,
ID
@@ -21,7 +21,7 @@
#{NAME},
#{CDESCRIPTION},
#{REMARK},
- #{TEACHINGMATERIAL_ID},
+ #{TEXTBOOK_ID},
#{ID}
@@ -33,12 +33,12 @@
NAME,
CDESCRIPTION,
REMARK,
- TEACHINGMATERIAL_ID
+ TEXTBOOK_ID
) values (
#{NAME},
#{CDESCRIPTION},
#{REMARK},
- #{TEACHINGMATERIAL_ID}
+ #{TEXTBOOK_ID}
)
@@ -58,7 +58,7 @@
NAME = #{NAME},
CDESCRIPTION = #{CDESCRIPTION},
REMARK = #{REMARK},
- TEACHINGMATERIAL_ID = #{TEACHINGMATERIAL_ID},
+ TEXTBOOK_ID = #{TEXTBOOK_ID},
ID = #{ID}
where
ID = #{ID}
@@ -119,8 +119,8 @@
-
- and TEACHINGMATERIAL_ID = #{TEACHINGMATERIAL_ID}
+
+ and TEXTBOOK_ID = #{TEXTBOOK_ID}
order by RANK
diff --git a/resources/mybatis1/sunvote/KnowledgeMapper.xml b/resources/mybatis1/sunvote/KnowledgeMapper.xml
index cfcfcdc..cf9378e 100644
--- a/resources/mybatis1/sunvote/KnowledgeMapper.xml
+++ b/resources/mybatis1/sunvote/KnowledgeMapper.xml
@@ -124,6 +124,8 @@
and KNOWLEDGE_FROM = #{KNOWLEDGE_FROM}
+
+ order by RANK
diff --git a/resources/mybatis1/sunvote/PaperMapper.xml b/resources/mybatis1/sunvote/PaperMapper.xml
index 697ed00..a14a8a8 100644
--- a/resources/mybatis1/sunvote/PaperMapper.xml
+++ b/resources/mybatis1/sunvote/PaperMapper.xml
@@ -135,6 +135,10 @@
and CLASS_ID = #{pd.CLASS_ID}
+
+ and PAPER_TYPE = #{pd.PAPER_TYPE}
+
+
order by CREATE_DATE DESC
diff --git a/resources/mybatis1/sunvote/QuestionMapper.xml b/resources/mybatis1/sunvote/QuestionMapper.xml
index d1e404c..5c32f7e 100644
--- a/resources/mybatis1/sunvote/QuestionMapper.xml
+++ b/resources/mybatis1/sunvote/QuestionMapper.xml
@@ -229,6 +229,9 @@
limit ${COUNT}
+
+ limit 30
+
diff --git a/resources/mybatis1/sunvote/TeachingMaterialMapper.xml b/resources/mybatis1/sunvote/TeachingMaterialMapper.xml
index e4776ae..5ac21c0 100644
--- a/resources/mybatis1/sunvote/TeachingMaterialMapper.xml
+++ b/resources/mybatis1/sunvote/TeachingMaterialMapper.xml
@@ -1,30 +1,31 @@
-
+
- SV_TEACHINGMATERIAL
+ SV_TEXTBOOK
- NAME,
- SUBJECT_ID,
- GRADE_ID,
- VERSION_CODE,
- VERSION_NAME,
- ID
+ ID,
+ NAME,
+ SUBJECT_ID,
+ GRADEID,
+ REMARK,
+ TEACHING_MATERIAL_ID
+ #{ID},
#{NAME},
#{SUBJECT_ID},
#{GRADE_ID},
- #{VERSION_CODE},
#{VERSION_NAME},
- #{ID}
+ #{REMARK},
+ #{TEACHING_MATERIAL_ID}
@@ -55,9 +56,9 @@
NAME = #{NAME},
SUBJECT_ID = #{SUBJECT_ID},
GRADE_ID = #{GRADE_ID},
- VERSION_CODE = #{VERSION_CODE},
- VERSION_NAME = #{VERSION_NAME},
- ID = #{ID}
+ REMARK = #{REMARK},
+ TEACHING_MATERIAL_ID = #{TEACHING_MATERIAL_ID},
+ ID = #{ID}
where
ID = #{ID}
diff --git a/resources/mybatis1/sunvote/TestPaperInfoMapper.xml b/resources/mybatis1/sunvote/TestPaperInfoMapper.xml
index a735464..d35229c 100644
--- a/resources/mybatis1/sunvote/TestPaperInfoMapper.xml
+++ b/resources/mybatis1/sunvote/TestPaperInfoMapper.xml
@@ -194,6 +194,53 @@
+
+
+ select
+ QUESTION_ID
+ from
+
+ where 1 =1
+
+ and TEST_ID = #{TEST_ID}
+
+
+ and STUDENT_ID = #{STUDENT_ID}
+
+
+ and PAPER_ID = #{PAPER_ID}
+
+
+ and QUESTION_ID = #{QUESTION_ID}
+
+
+ group by QUESTION_ID
+
+
+
+
+
+ select
+ STUDENT_ID, ANSWER, `RIGHT`, SCORE
+ from
+
+ where 1 =1
+
+ and TEST_ID = #{TEST_ID}
+
+
+ and STUDENT_ID = #{STUDENT_ID}
+
+
+ and PAPER_ID = #{PAPER_ID}
+
+
+ and QUESTION_ID = #{QUESTION_ID}
+
+
+ ORDER BY ANSWER
+
+
SELECT
diff --git a/resources/mybatis1/sunvote/TextbookMapper.xml b/resources/mybatis1/sunvote/TextbookMapper.xml
new file mode 100644
index 0000000..3686226
--- /dev/null
+++ b/resources/mybatis1/sunvote/TextbookMapper.xml
@@ -0,0 +1,127 @@
+
+
+
+
+
+
+ SV_TEACHINGMATERIAL
+
+
+
+
+ NAME,
+ SUBJECT_ID,
+ GRADE_ID,
+ VERSION_CODE,
+ VERSION_NAME,
+ ID
+
+
+
+
+ #{NAME},
+ #{SUBJECT_ID},
+ #{GRADE_ID},
+ #{VERSION_CODE},
+ #{VERSION_NAME},
+ #{ID}
+
+
+
+
+ insert into
+
+ (
+
+
+ ) values (
+
+ )
+
+
+
+
+ delete from
+
+ where
+ ID = #{ID}
+
+
+
+
+ update
+
+ set
+ NAME = #{NAME},
+ SUBJECT_ID = #{SUBJECT_ID},
+ GRADE_ID = #{GRADE_ID},
+ VERSION_CODE = #{VERSION_CODE},
+ VERSION_NAME = #{VERSION_NAME},
+ ID = #{ID}
+ where
+ ID = #{ID}
+
+
+
+
+ select
+
+ from
+
+ where
+ ID = #{ID}
+
+
+
+
+ select
+
+ from
+
+ where 1=1
+
+ and
+ (
+
+ )
+
+
+
+
+
+ select
+
+ from
+
+
+ where 1 = 1
+
+
+ and TEACHING_MATERIAL_ID = #{TEACHING_MATERIAL_ID}
+
+
+ and SUBJECT_ID = #{SUBJECT_ID}
+
+
+ and GRADE_ID = #{GRADE_ID}
+
+
+
+
+
+
+ delete from
+
+ where
+ ID in
+
+ #{item}
+
+
+
+
+
\ No newline at end of file
diff --git a/src/com/fh/Main.java b/src/com/fh/Main.java
new file mode 100644
index 0000000..bf41bb0
--- /dev/null
+++ b/src/com/fh/Main.java
@@ -0,0 +1,81 @@
+package com.fh;
+
+import java.io.BufferedReader;
+import java.io.InputStreamReader;
+import java.net.HttpURLConnection;
+import java.net.URL;
+
+public class Main {
+
+ public static void main(String[] args) {
+
+ String username = "pressure_test" ;
+ String password = "123456" ;
+ String trueName = "" ;
+
+ String url = "http://127.0.0.1:8080/SunvoteEducation/api/v1/tempcreateUser" ;
+ for(int i = 2 ; i <= 100 ; i++){
+ trueName = username + i ;
+ String keypadid = "0000" ;
+ if(i >= 100){
+ keypadid = keypadid + i ;
+ }else if(i > 9){
+ keypadid = keypadid + "0" + i ;
+ }else{
+ keypadid = keypadid + "00" + i ;
+ }
+ post(url + "?ACCOUT=" + trueName + "&password=" + password + "&SCHOOL_ID=4" + "&SEX=1" + "&NAME=" + trueName + "&KEYPAD_ID=" + keypadid);
+ }
+
+ }
+
+
+
+ static void post(String url){
+ try {
+ //请求地址
+ URL urlHttp = new URL(url);
+
+ // 将url 以 open方法返回的urlConnection 连接强转为HttpURLConnection连接 (标识一个url所引用的远程对象连接)
+ HttpURLConnection connection = (HttpURLConnection) urlHttp.openConnection();// 此时cnnection只是为一个连接对象,待连接中
+ // 设置连接输出流为true,默认false (post 请求是以流的方式隐式的传递参数)
+ connection.setDoOutput(true);
+
+ // 设置连接输入流为true
+ connection.setDoInput(true);
+
+ // 设置请求方式为post
+ connection.setRequestMethod("POST");
+
+ // post请求缓存设为false
+ connection.setUseCaches(false);
+
+ // 设置该HttpURLConnection实例是否自动执行重定向
+ connection.setInstanceFollowRedirects(true);
+
+ // 设置请求头里面的各个属性 (以下为设置内容的类型,设置为经过urlEncoded编码过的from参数)
+ // application/x-javascript text/xml->xml数据 application/x-javascript->json对象 application/x-www-form-urlencoded->表单数据
+ // ;charset=utf-8 必须要,不然妙兜那边会出现乱码【★★★★★】
+ connection.setRequestProperty("Content-Type", "application/x-javascript;charset=utf-8");
+
+ connection.connect();
+
+
+ // 连接发起请求,处理服务器响应 (从连接获取到输入流并包装为bufferedReader)
+ BufferedReader bf = new BufferedReader(new InputStreamReader(connection.getInputStream(), "UTF-8"));
+ String line;
+ StringBuilder sb = new StringBuilder(); // 用来存储响应数据
+
+ // 循环读取流,若不到结尾处
+ while ((line = bf.readLine()) != null) {
+ sb.append(line).append(System.getProperty("line.separator"));
+ }
+ bf.close(); // 重要且易忽略步骤 (关闭流,切记!)
+ connection.disconnect(); // 销毁连接
+
+
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+}
diff --git a/src/com/fh/controller/api/V1.java b/src/com/fh/controller/api/V1.java
index 4d7ca6d..e35edb7 100644
--- a/src/com/fh/controller/api/V1.java
+++ b/src/com/fh/controller/api/V1.java
@@ -52,15 +52,19 @@ import com.fh.service.sunvote.questiontype.QuestionTypeManager;
import com.fh.service.sunvote.school.SchoolManager;
import com.fh.service.sunvote.schoolgradesubject.SchoolGradeSubjectManager;
import com.fh.service.sunvote.sclass.SClassManager;
+import com.fh.service.sunvote.sclass.impl.SClassService;
import com.fh.service.sunvote.student.StudentManager;
import com.fh.service.sunvote.studenttest.StudentTestManager;
import com.fh.service.sunvote.subject.SubjectManager;
+import com.fh.service.sunvote.subject.impl.SubjectService;
import com.fh.service.sunvote.teacher.TeacherManager;
import com.fh.service.sunvote.teachingmaterial.TeachingMaterialManager;
import com.fh.service.sunvote.testpaper.TestPaperManager;
import com.fh.service.sunvote.testpaperinfo.TestPaperInfoManager;
+import com.fh.service.sunvote.textbook.TextbookManager;
import com.fh.service.system.user.UserManager;
import com.fh.util.PageData;
+import com.fh.util.SpringBeanFactoryUtils;
import com.fh.util.Tools;
@Controller
@@ -83,7 +87,7 @@ public class V1 extends BaseController {
private ClassRosterManager classrosterService;
@Resource(name = "classtypeService")
- private ClassTypeManager classtypeService;
+ private ClassTypeManager classtypeService;
@Resource(name = "gradeService")
private GradeManager gradeService;
@@ -171,6 +175,9 @@ public class V1 extends BaseController {
@Resource(name = "teachingmaterialService")
private TeachingMaterialManager teachingmaterialService;
+
+ @Resource(name = "textbookService")
+ private TextbookManager textbookService;
@Resource(name = "cacheService")
private CacheManager cacheService;
@@ -237,6 +244,60 @@ public class V1 extends BaseController {
return res.toJson();
}
+
+ /**
+ * 登录
+ * 可以通过账号密码登录、
+ * 可以通过教师卡登录
+ * @return
+ * @throws Exception
+ */
+ @RequestMapping(value = "/userinfo", produces = "application/json;charset=UTF-8")
+ @ResponseBody
+ public Object userinfo() throws Exception {
+ event("userinfo");
+ PageData pd = this.getPageData();
+ ResponseGson res = new ResponseGson();
+ PageData pageData = teacherService.findById(pd);
+ if (pageData != null && pageData.getString("ID") != null) {
+ pageData.put("PASSWORD", "");// 返回参数中不返回密码
+ PageData pt = new PageData();
+ pt.put("TEACHER_ID", pageData.get("ID"));
+ // 在任课表中查找老师教哪些班级,然后查出班级信息
+ List classInfoList = v1Service
+ .getTeacherClassInfo(pt);
+
+ pageData.put("classInfoList", classInfoList);
+ // 在认可表中查找老师教哪些科目,然后查出科目信息
+ List subjectList = v1Service
+ .getTeacherSubjectInfo(pt);
+ // 一个sql语句完成。
+ pageData.put("subjectList", subjectList);
+
+ pageData.remove("SUBJECT_IDS");
+
+ PageData eventPd = new PageData();
+ eventPd.put("EVENT_ID", get32UUID());
+ eventPd.put("EVENT_NAME", "login");
+ eventPd.put("EVENT_USER", pageData.getString("ID"));
+ eventPd.put("EVENT_TYPE", "0");
+ eventPd.put("EVENT_START_TIME", Tools.date2Str(new Date()));
+ if (pd.getString("CLIENT_ID") != null) {
+ eventPd.put("CLIENT_ID", pd.getString("CLIENT_ID"));
+ } else {
+ eventPd.put("CLIENT_ID", "CLIENT");
+ }
+ eventPd.put("EVENT_IP", getRemoteIp());
+ eventService.save(eventPd);
+
+ res.setData(pageData);
+ // 填充数据到返回数据中
+ } else {
+ res.set1Error();
+ }
+
+ return res.toJson();
+ }
/**
* 查询班级
@@ -363,6 +424,29 @@ public class V1 extends BaseController {
logger.info("subject cost time : " + (System.currentTimeMillis() - cur));
return res.toJson();
}
+
+ /**
+ * 科目
+ * @return
+ * @throws Exception
+ */
+ @RequestMapping(value = "/subjectname", produces = "application/json;charset=UTF-8")
+ @ResponseBody
+ public Object subjectName() throws Exception {
+ event("subject");
+ long cur = System.currentTimeMillis();
+ PageData pd = this.getPageData();
+ ResponseGson> res = new ResponseGson();
+ if (!pd.containsKey("SCHOOL_ID")) {
+ List list = subjectService.listAll(pd);
+ res.setData(list);
+ } else {
+ List list = schoolgradesubjectService.listAllSubject(pd);
+ res.setData(list);
+ }
+ logger.info("subject cost time : " + (System.currentTimeMillis() - cur));
+ return res.toJson();
+ }
/**
* 键盘扫描
@@ -546,6 +630,181 @@ public class V1 extends BaseController {
+ (System.currentTimeMillis() - cur));
return res.toJson();
}
+
+ /**
+ * 试卷详细信息
+ * @return
+ * @throws Exception
+ */
+ @RequestMapping(value = "/testpaperinfo", produces = "application/json;charset=UTF-8")
+ @ResponseBody
+ public Object testpaperinfo() throws Exception {
+ event("testpaperinfo");
+ long cur = System.currentTimeMillis();
+ PageData pd = this.getPageData();
+ ResponseGson res = new ResponseGson();
+ String paperId = pd.getString("ID");
+ if (!StringUtils.isEmpty(paperId)) {
+ try {
+ pd.put("TESTPAPER_ID", paperId);
+ PageData testPd = testpaperService.findById(pd);
+ if (testPd != null) {
+ PageData testInfof = new PageData();
+ testInfof.put("PAPER_ID", testPd.getString("PAPER_ID"));
+ testInfof.put("TEST_ID", paperId);
+ List list = testpaperinfoService.listTestPaperQuestionIDs(testInfof);
+ for(PageData pad:list){
+ String optionContent = pad.getString("OPTION_CONTENT");
+ if(optionContent != null && optionContent.startsWith("[") && optionContent.endsWith("]")){
+ String[] options = optionContent.substring(1, optionContent.length() -1).split(",");
+ pad.put("OPTION_CONTENT", options);
+ }else{
+ pad.put("OPTION_CONTENT", new String[]{optionContent});
+ }
+ }
+ for(PageData pqd : list){
+ PageData tpqd = questionService.findById(pqd);
+ pqd.putAll(tpqd);
+ pqd.remove("P_ID");
+ pqd.remove("SUBJECT_ID");
+ pqd.remove("PROBLEM_TYPE_ID");
+ pqd.remove("CHAPTER_ID");
+ pqd.remove("TEACHER_ID");
+ pqd.remove("SCHOOL_ID");
+ pqd.remove("SUG_SCORE");
+ pqd.remove("SUG_PART_SCORE");
+ pqd.remove("USER_ID");
+ pqd.remove("CREATE_DATE");
+ pqd.remove("QUESTION_FROM");
+ pqd.remove("REMARK");
+ pqd.put("TEST_ID", paperId);
+ List listinfo = testpaperinfoService.listTestPaperQuestionIDinfo(pqd);
+ List answerInfos = new ArrayList();
+ for(PageData pid : listinfo){
+ String answer = pid.getString("ANSWER");
+ PageData answerPd = null;
+ if(answerInfos.size() > 0){
+ answerPd = answerInfos.get(answerInfos.size() -1);
+ if(!answer.equals(answerPd.getString("ANSWER"))){
+ answerPd = new PageData();
+ answerPd.put("ANSWER", answer);
+ answerPd.put("ISRIGHT", pid.getString("RIGHT"));
+ answerInfos.add(answerPd);
+ }
+ }else{
+ answerPd = new PageData();
+ answerPd.put("ANSWER", answer);
+ answerPd.put("ISRIGHT", pid.getString("RIGHT"));
+ answerInfos.add(answerPd);
+ }
+ String strCount = answerPd.getString("COUNT");
+ int count = 0 ;
+ if(strCount != null){
+ try{
+ count = Integer.parseInt(strCount);
+ }catch(NumberFormatException ex){}
+ }
+ count ++ ;
+ answerPd.put("COUNT", count);
+ }
+ pqd.put("ANSWERINFO", answerInfos);
+ pqd.remove("TEST_ID");
+ }
+ testPd.put("QUESTIONS", list);
+
+ }
+
+ res.setData(testPd);
+ } catch (Exception e) {
+ e.printStackTrace();
+ res.setError();
+ }
+ }
+ logger.info("testpaperinfo cost time:"
+ + (System.currentTimeMillis() - cur));
+ return res.toJson();
+ }
+
+ /**
+ * 试卷详细信息
+ * @return
+ * @throws Exception
+ */
+ @RequestMapping(value = "/questionintestreportinfo", produces = "application/json;charset=UTF-8")
+ @ResponseBody
+ public Object questionInTestReportInfo() throws Exception {
+ event("testpaperinfo");
+ long cur = System.currentTimeMillis();
+ PageData pd = this.getPageData();
+ ResponseGson res = new ResponseGson();
+ if (pd.getString("QUESTION_ID") != null) {
+ String questionId = pd.getString("QUESTION_ID");
+ PageData pqd = new PageData();
+ pqd.put("QUESTION_ID", questionId);
+ PageData tpqd = questionService.findById(pqd);
+ pqd.putAll(tpqd);
+ pqd.remove("P_ID");
+ pqd.remove("SUBJECT_ID");
+ pqd.remove("PROBLEM_TYPE_ID");
+ pqd.remove("CHAPTER_ID");
+ pqd.remove("TEACHER_ID");
+ pqd.remove("SCHOOL_ID");
+ pqd.remove("SUG_SCORE");
+ pqd.remove("SUG_PART_SCORE");
+ pqd.remove("USER_ID");
+ pqd.remove("CREATE_DATE");
+ pqd.remove("QUESTION_FROM");
+ pqd.remove("REMARK");
+ String optionContent = pqd.getString("OPTION_CONTENT");
+ if(optionContent != null && optionContent.startsWith("[") && optionContent.endsWith("]")){
+ String[] options = optionContent.substring(1, optionContent.length() -1).split(",");
+ pqd.put("OPTION_CONTENT", options);
+ }else{
+ pqd.put("OPTION_CONTENT", new String[]{optionContent});
+ }
+ if(pd.getString("TEST_ID") != null){
+ pqd.put("TEST_ID", pd.getString("TEST_ID"));
+ }
+ List listinfo = testpaperinfoService
+ .listTestPaperQuestionIDinfo(pqd);
+ List answerInfos = new ArrayList();
+ for (PageData pid : listinfo) {
+ String answer = pid.getString("ANSWER");
+ PageData answerPd = null;
+ if (answerInfos.size() > 0) {
+ answerPd = answerInfos.get(answerInfos.size() - 1);
+ if (!answer.equals(answerPd.getString("ANSWER"))) {
+ answerPd = new PageData();
+ answerPd.put("ANSWER", answer);
+ answerPd.put("ISRIGHT", pid.getString("RIGHT"));
+ answerInfos.add(answerPd);
+ }
+ } else {
+ answerPd = new PageData();
+ answerPd.put("ANSWER", answer);
+ answerPd.put("ISRIGHT", pid.getString("RIGHT"));
+ answerInfos.add(answerPd);
+ }
+ String strCount = answerPd.getString("COUNT");
+ int count = 0;
+ if (strCount != null) {
+ try {
+ count = Integer.parseInt(strCount);
+ } catch (NumberFormatException ex) {
+ }
+ }
+ count++;
+ answerPd.put("COUNT", count);
+ }
+ pqd.put("ANSWERINFO", answerInfos);
+ res.setData(pqd);
+ }else{
+ res.setDataError();
+ }
+ logger.info("testpaperinfo cost time:"
+ + (System.currentTimeMillis() - cur));
+ return res.toJson();
+ }
/**
* 试卷简要信息
@@ -655,6 +914,13 @@ public class V1 extends BaseController {
for (String i : id) {
pd.put("QUESTION_ID", i);
PageData data = questionService.findById(pd);
+ String optionContent = data.getString("OPTION_CONTENT");
+ if(optionContent != null && optionContent.startsWith("[") && optionContent.endsWith("]")){
+ String[] options = optionContent.substring(1, optionContent.length() -1).split(",");
+ data.put("OPTION_CONTENT", options);
+ }else{
+ data.put("OPTION_CONTENT", new String[]{optionContent});
+ }
if (data != null) {
list.add(data);
}
@@ -929,6 +1195,7 @@ public class V1 extends BaseController {
pqPd.put("RANK", question.getRank());
pqPd.put("NO_NAME", question.getNo_name());
pqPd.put("PAPERQUESTION_ID", this.get32UUID());
+ pqPd.put("P_ID", "0");
paperquestionService.save(pqPd);
}
@@ -1596,6 +1863,16 @@ public class V1 extends BaseController {
ret.setData(lpd);
return ret.toJson();
}
+
+ @RequestMapping(value = "/textbook", produces = "application/json;charset=UTF-8")
+ @ResponseBody
+ public Object textbook() throws Exception {
+ PageData pd = getPageData();
+ ResponseGson> ret = new ResponseGson>();
+ List list = textbookService.listAll(pd);
+ ret.setData(list);
+ return ret.toJson();
+ }
/**
* 获取教材版本
@@ -1677,6 +1954,15 @@ public class V1 extends BaseController {
pd.remove("KNOWLEDGE_ID");
}
List list = questionService.listAllquestion(pd);
+ for(PageData pad:list){
+ String optionContent = pad.getString("OPTION_CONTENT");
+ if(optionContent != null && optionContent.startsWith("[") && optionContent.endsWith("]")){
+ String[] options = optionContent.substring(1, optionContent.length() -1).split(",");
+ pad.put("OPTION_CONTENT", options);
+ }else{
+ pad.put("OPTION_CONTENT", new String[]{optionContent});
+ }
+ }
res.setData(list);
return res.toJson();
}
@@ -1723,6 +2009,15 @@ public class V1 extends BaseController {
pd.remove("KNOWLEDGE_ID");
}
List list = questionService.listAllRandquestion(pd);
+ for(PageData pad:list){
+ String optionContent = pad.getString("OPTION_CONTENT");
+ if(optionContent != null && optionContent.startsWith("[") && optionContent.endsWith("]")){
+ String[] options = optionContent.substring(1, optionContent.length() -1).split(",");
+ pad.put("OPTION_CONTENT", options);
+ }else{
+ pad.put("OPTION_CONTENT", new String[]{optionContent});
+ }
+ }
res.setData(list);
return res.toJson();
}
@@ -1891,7 +2186,6 @@ public class V1 extends BaseController {
try {
teachingmaterialService.save(pd);
} catch (Exception e) {
- // TODO Auto-generated catch block
e.printStackTrace();
}
}
@@ -2055,4 +2349,82 @@ public class V1 extends BaseController {
return key.toString();
}
+
+
+ /**
+ * 根据ID,获取科目中文名称
+ * @param type
+ * @return
+ * @throws Exception
+ */
+ @RequestMapping(value = "/subjectename", produces = "application/json;charset=UTF-8")
+ @ResponseBody
+ public String findSubjectEName() throws Exception{
+ PageData pageData = this.getPageData();
+ ResponseGson res = new ResponseGson();
+ pageData = subjectService.findById(pageData);
+ if(pageData != null){
+ res.setData(pageData.getString("ENAME"));
+ }else{
+ res.setDataError();
+ }
+ return res.toJson();
+ }
+
+ /**
+ * 根据ID或者科目英文名称
+ * @param type
+ * @return
+ * @throws Exception
+ */
+ @RequestMapping(value = "/subjectcname", produces = "application/json;charset=UTF-8")
+ @ResponseBody
+ public String findSubjectCName() throws Exception{
+ ResponseGson res = new ResponseGson();
+ PageData pageData = new PageData();
+ StringBuilder sb = new StringBuilder();
+ String type = this.getPageData().getString("ID");
+ if(type.contains(",")){
+ String[] types = type.split(",");
+ for (String t : types) {
+ pageData.put("ID", t);
+ pageData = subjectService.findById(pageData);
+ if (pageData != null) {
+ sb.append(pageData.getString("CNAME") + "; ");
+ }
+ }
+ sb.delete(sb.length() -3, sb.length());
+ }else{
+ pageData.put("ID", type);
+ pageData = subjectService.findById(pageData);
+ if (pageData != null) {
+ sb.append(pageData.getString("CNAME"));
+ }
+ }
+ res.setData(sb.toString());
+ return res.toJson();
+ }
+
+ /**
+ * 根据ID班级名称
+ * @param id
+ * @return
+ * @throws Exception
+ */
+ @RequestMapping(value = "/classname", produces = "application/json;charset=UTF-8")
+ @ResponseBody
+ public String findClassName() throws Exception {
+ ResponseGson res = new ResponseGson();
+ PageData pageData = this.getPageData();
+ pageData = sclassService.findById(pageData);
+ String className = "" ;
+ if(pageData != null){
+ className = pageData.getString("CLASS_NAME");
+ }else{
+ res.setDataError();
+ }
+ res.setData(className);
+ return res.toJson();
+
+ }
}
diff --git a/src/com/fh/controller/base/BaseController.java b/src/com/fh/controller/base/BaseController.java
index 8306c78..c1224be 100644
--- a/src/com/fh/controller/base/BaseController.java
+++ b/src/com/fh/controller/base/BaseController.java
@@ -91,6 +91,15 @@ public class BaseController {
return "ERROR";
}
+ public String geTeacherID(){
+ Session session = Jurisdiction.getSession();
+ User user = (User)session.getAttribute(Const.SESSION_USER);
+ if(user != null){
+ return user.getTeacherID();
+ }
+ return "ERROR";
+ }
+
public String getSchoolID(){
Session session = Jurisdiction.getSession();
diff --git a/src/com/fh/controller/sunvote/paper/PaperController.java b/src/com/fh/controller/sunvote/paper/PaperController.java
index acb794e..2bff5ca 100644
--- a/src/com/fh/controller/sunvote/paper/PaperController.java
+++ b/src/com/fh/controller/sunvote/paper/PaperController.java
@@ -271,6 +271,64 @@ public class PaperController extends BaseController {
}
String userID = getUserID();
pd.put("USER_ID", userID);
+ pd.put("PAPER_TYPE","1");
+ page.setPd(pd);
+ List varList = paperService.list(page); //列出Paper列表
+ mv.setViewName("sunvote/paper/paper_list2");
+
+ for(PageData p:varList){
+ String examTime = p.getString("EXAM_TIME");
+ if(examTime != null){
+ try{
+ int et = Integer.parseInt(examTime);
+ String min = (et / 60 ) + "" ;
+ if(min.length() < 2){
+ min = "0" + min ;
+ }
+ String sec = (et % 60 ) + "" ;
+ if(sec.length() < 2){
+ sec = "0" + sec ;
+ }
+ if(et > 60){
+ examTime = min + ":" + sec;
+ }else{
+ examTime = "00:" + sec;
+ }
+ }catch(Exception e){
+ e.printStackTrace();
+ }
+ }
+ if(examTime == null){
+ examTime = "00:00";
+ }
+ p.put("EXAM_TIME", examTime);
+ }
+
+ mv.addObject("varList", varList);
+ mv.addObject("pd", pd);
+ mv.addObject("QX",Jurisdiction.getHC()); //按钮权限
+ return mv;
+ }
+
+
+ /**列表
+ * @param page
+ * @throws Exception
+ */
+ @RequestMapping(value="/list3")
+ public ModelAndView list3(Page page) throws Exception{
+ logBefore(logger, Jurisdiction.getUsername()+"列表Paper");
+ //if(!Jurisdiction.buttonJurisdiction(menuUrl, "cha")){return null;} //校验权限(无权查看时页面会有提示,如果不注释掉这句代码就无法进入列表页面,所以根据情况是否加入本句代码)
+ ModelAndView mv = this.getModelAndView();
+ PageData pd = new PageData();
+ pd = this.getPageData();
+ String keywords = pd.getString("keywords"); //关键词检索条件
+ if(null != keywords && !"".equals(keywords)){
+ pd.put("keywords", keywords.trim());
+ }
+ String userID = getUserID();
+ pd.put("USER_ID", userID);
+ pd.put("PAPER_TYPE","101");
page.setPd(pd);
List varList = paperService.list(page); //列出Paper列表
mv.setViewName("sunvote/paper/paper_list2");
diff --git a/src/com/fh/controller/sunvote/teacher/TeacherController.java b/src/com/fh/controller/sunvote/teacher/TeacherController.java
index c0b927c..eb04a34 100644
--- a/src/com/fh/controller/sunvote/teacher/TeacherController.java
+++ b/src/com/fh/controller/sunvote/teacher/TeacherController.java
@@ -20,8 +20,10 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;
+import com.fh.controller.api.ResponseGson;
import com.fh.controller.base.BaseController;
import com.fh.entity.Page;
+import com.fh.service.api.V1Manager;
import com.fh.service.sunvote.school.SchoolManager;
import com.fh.service.sunvote.teacher.TeacherManager;
import com.fh.service.system.fhlog.FHlogManager;
@@ -30,72 +32,84 @@ import com.fh.util.AppUtil;
import com.fh.util.Jurisdiction;
import com.fh.util.ObjectExcelView;
import com.fh.util.PageData;
+import com.fh.util.Tools;
-/**
- * 说明:教师
- * 创建人:Elvis
- * 创建时间:2018-04-26
+/**
+ * 说明:教师 创建人:Elvis 创建时间:2018-04-26
*/
@Controller
-@RequestMapping(value="/teacher")
+@RequestMapping(value = "/teacher")
public class TeacherController extends BaseController {
-
- String menuUrl = "teacher/list.do"; //菜单地址(权限用)
- @Resource(name="teacherService")
+
+ String menuUrl = "teacher/list.do"; // 菜单地址(权限用)
+ @Resource(name = "teacherService")
private TeacherManager teacherService;
-
- @Resource(name="schoolService")
+
+ @Resource(name = "schoolService")
private SchoolManager schoolService;
-
-
- @Resource(name="userService")
+
+ @Resource(name = "userService")
private UserManager userService;
-
- @Resource(name="fhlogService")
+
+ @Resource(name = "fhlogService")
private FHlogManager FHLOG;
- /**保存
+ @Resource(name = "v1Service")
+ private V1Manager v1Service;
+
+ /**
+ * 保存
+ *
* @param
* @throws Exception
*/
- @RequestMapping(value="/save")
- public ModelAndView save() throws Exception{
- logBefore(logger, Jurisdiction.getUsername()+"新增Teacher");
- if(!Jurisdiction.buttonJurisdiction(menuUrl, "add")){return null;} //校验权限
+ @RequestMapping(value = "/save")
+ public ModelAndView save() throws Exception {
+ logBefore(logger, Jurisdiction.getUsername() + "新增Teacher");
+ if (!Jurisdiction.buttonJurisdiction(menuUrl, "add")) {
+ return null;
+ } // 校验权限
ModelAndView mv = this.getModelAndView();
PageData pd = new PageData();
pd = this.getPageData();
pd.put("ID", this.get32UUID());
teacherService.save(pd);
-
- pd.put("USER_ID", pd.getString("ID")); //ID 主键
- pd.put("LAST_LOGIN", ""); //最后登录时间
- pd.put("IP", ""); //IP
- pd.put("STATUS", "0"); //状态
+
+ pd.put("USER_ID", pd.getString("ID")); // ID 主键
+ pd.put("LAST_LOGIN", ""); // 最后登录时间
+ pd.put("IP", ""); // IP
+ pd.put("STATUS", "0"); // 状态
pd.put("SKIN", "default");
- pd.put("RIGHTS", "");
+ pd.put("RIGHTS", "");
pd.put("USERNAME", pd.getString("ACCOUT"));
- pd.put("ROLE_ID", "57bb1e6f138247a0b05cc721a5da1b64");
- pd.put("PASSWORD", new SimpleHash("SHA-1", pd.getString("ACCOUT"), pd.getString("PASSWORD")).toString()); //密码加密
-
- if(null == userService.findByUsername(pd)){ //判断用户名是否存在
- userService.saveU(pd); //执行保存
- FHLOG.save(Jurisdiction.getUsername(), "新增系统用户:"+pd.getString("USERNAME"));
+ pd.put("ROLE_ID", "57bb1e6f138247a0b05cc721a5da1b64");
+ pd.put("PASSWORD",
+ new SimpleHash("SHA-1", pd.getString("ACCOUT"), pd
+ .getString("PASSWORD")).toString()); // 密码加密
+
+ if (null == userService.findByUsername(pd)) { // 判断用户名是否存在
+ userService.saveU(pd); // 执行保存
+ FHLOG.save(Jurisdiction.getUsername(),
+ "新增系统用户:" + pd.getString("USERNAME"));
}
-
- mv.addObject("msg","success");
+
+ mv.addObject("msg", "success");
mv.setViewName("save_result");
return mv;
}
-
- /**删除
+
+ /**
+ * 删除
+ *
* @param out
* @throws Exception
*/
- @RequestMapping(value="/delete")
- public void delete(PrintWriter out) throws Exception{
- logBefore(logger, Jurisdiction.getUsername()+"删除Teacher");
- if(!Jurisdiction.buttonJurisdiction(menuUrl, "del")){return;} //校验权限
+ @RequestMapping(value = "/delete")
+ public void delete(PrintWriter out) throws Exception {
+ logBefore(logger, Jurisdiction.getUsername() + "删除Teacher");
+ if (!Jurisdiction.buttonJurisdiction(menuUrl, "del")) {
+ return;
+ } // 校验权限
PageData pd = new PageData();
pd = this.getPageData();
pd.put("USER_ID", pd.get("ID"));
@@ -104,177 +118,301 @@ public class TeacherController extends BaseController {
out.write("success");
out.close();
}
-
- /**修改
+
+ /**
+ * 修改
+ *
* @param
* @throws Exception
*/
- @RequestMapping(value="/edit")
- public ModelAndView edit() throws Exception{
- logBefore(logger, Jurisdiction.getUsername()+"修改Teacher");
- if(!Jurisdiction.buttonJurisdiction(menuUrl, "edit")){return null;} //校验权限
+ @RequestMapping(value = "/edit")
+ public ModelAndView edit() throws Exception {
+ logBefore(logger, Jurisdiction.getUsername() + "修改Teacher");
+ if (!Jurisdiction.buttonJurisdiction(menuUrl, "edit")) {
+ return null;
+ } // 校验权限
ModelAndView mv = this.getModelAndView();
PageData pd = new PageData();
pd = this.getPageData();
teacherService.edit(pd);
-
- /*pd.put("USER_ID", pd.getString("ID")); //ID 主键
- pd.put("LAST_LOGIN", ""); //最后登录时间
- pd.put("IP", ""); //IP
- pd.put("STATUS", "0"); //状态
- pd.put("SKIN", "default");
- pd.put("RIGHTS", "");
- pd.put("USERNAME", pd.getString("ACCOUT"));
- pd.put("ROLE_ID", "57bb1e6f138247a0b05cc721a5da1b64");
- pd.put("PASSWORD", new SimpleHash("SHA-1", pd.getString("ACCOUT"), pd.getString("PASSWORD")).toString()); //密码加密
-
- userService.saveU(pd);*/
-
- mv.addObject("msg","success");
+
+ /*
+ * pd.put("USER_ID", pd.getString("ID")); //ID 主键 pd.put("LAST_LOGIN",
+ * ""); //最后登录时间 pd.put("IP", ""); //IP pd.put("STATUS", "0"); //状态
+ * pd.put("SKIN", "default"); pd.put("RIGHTS", ""); pd.put("USERNAME",
+ * pd.getString("ACCOUT")); pd.put("ROLE_ID",
+ * "57bb1e6f138247a0b05cc721a5da1b64"); pd.put("PASSWORD", new
+ * SimpleHash("SHA-1", pd.getString("ACCOUT"),
+ * pd.getString("PASSWORD")).toString()); //密码加密
+ *
+ * userService.saveU(pd);
+ */
+
+ mv.addObject("msg", "success");
mv.setViewName("save_result");
return mv;
}
+
+ /**
+ * 列表
+ *
+ * @param page
+ * @throws Exception
+ */
+ @RequestMapping(value = "/teach_paper")
+ public ModelAndView teach_paper(Page page) throws Exception {
+ logBefore(logger, Jurisdiction.getUsername() + "列表Paper");
+ String userId = this.getUserID();
+ ModelAndView mv = this.getModelAndView();
+ PageData pd = new PageData();
+ pd = this.getPageData();
+ mv.setViewName("sunvote/teacher/teach_paper");
+ mv.addObject("pd", pd);
+ return mv;
+ }
- /**列表
+ /**
+ * 列表
+ *
+ * @param page
+ * @throws Exception
+ */
+ @RequestMapping(value = "/paper_view")
+ public ModelAndView paper_view(Page page) throws Exception {
+ logBefore(logger, Jurisdiction.getUsername() + "列表Paper");
+ String userId = this.getUserID();
+ ModelAndView mv = this.getModelAndView();
+ PageData pd = new PageData();
+ pd = this.getPageData();
+ mv.setViewName("sunvote/teacher/paper_view");
+ mv.addObject("pd", pd);
+ return mv;
+ }
+
+ /**
+ * 列表
+ *
+ * @param page
+ * @throws Exception
+ */
+ @RequestMapping(value = "/set_question")
+ public ModelAndView set_question(Page page) throws Exception {
+ logBefore(logger, Jurisdiction.getUsername() + "列表Paper");
+ ModelAndView mv = this.getModelAndView();
+ PageData pd = new PageData();
+ pd = this.getPageData();
+ mv.setViewName("sunvote/teacher/set_question");
+ mv.addObject("pd", pd);
+ return mv;
+ }
+
+ /**
+ * 列表
+ *
* @param page
* @throws Exception
*/
- @RequestMapping(value="/list")
- public ModelAndView list(Page page) throws Exception{
- logBefore(logger, Jurisdiction.getUsername()+"列表Teacher");
- //if(!Jurisdiction.buttonJurisdiction(menuUrl, "cha")){return null;} //校验权限(无权查看时页面会有提示,如果不注释掉这句代码就无法进入列表页面,所以根据情况是否加入本句代码)
+ @RequestMapping(value = "/list")
+ public ModelAndView list(Page page) throws Exception {
+ logBefore(logger, Jurisdiction.getUsername() + "列表Teacher");
+ // if(!Jurisdiction.buttonJurisdiction(menuUrl, "cha")){return null;}
+ // //校验权限(无权查看时页面会有提示,如果不注释掉这句代码就无法进入列表页面,所以根据情况是否加入本句代码)
ModelAndView mv = this.getModelAndView();
PageData pd = new PageData();
pd = this.getPageData();
- String keywords = pd.getString("keywords"); //关键词检索条件
- if(null != keywords && !"".equals(keywords)){
+ String keywords = pd.getString("keywords"); // 关键词检索条件
+ if (null != keywords && !"".equals(keywords)) {
pd.put("keywords", keywords.trim());
}
page.setPd(pd);
- List varList = teacherService.list(page); //列出Teacher列表
+ List varList = teacherService.list(page); // 列出Teacher列表
mv.setViewName("sunvote/teacher/teacher_list");
mv.addObject("varList", varList);
-
+
List schools = schoolService.listAll(pd);
- mv.addObject("schools",schools);
-
+ mv.addObject("schools", schools);
+
mv.addObject("pd", pd);
- mv.addObject("QX",Jurisdiction.getHC()); //按钮权限
+ mv.addObject("QX", Jurisdiction.getHC()); // 按钮权限
return mv;
}
-
- /**去新增页面
+
+ /**
+ * 去新增页面
+ *
* @param
* @throws Exception
*/
- @RequestMapping(value="/goAdd")
- public ModelAndView goAdd()throws Exception{
+ @RequestMapping(value = "/goAdd")
+ public ModelAndView goAdd() throws Exception {
ModelAndView mv = this.getModelAndView();
PageData pd = new PageData();
pd = this.getPageData();
mv.setViewName("sunvote/teacher/teacher_edit");
-
+
List schools = schoolService.listAll(pd);
- mv.addObject("schools",schools);
-
+ mv.addObject("schools", schools);
+
mv.addObject("msg", "save");
mv.addObject("pd", pd);
return mv;
- }
-
- /**去修改页面
+ }
+
+ /**
+ * 去修改页面
+ *
* @param
* @throws Exception
*/
- @RequestMapping(value="/goEdit")
- public ModelAndView goEdit()throws Exception{
+ @RequestMapping(value = "/goEdit")
+ public ModelAndView goEdit() throws Exception {
ModelAndView mv = this.getModelAndView();
PageData pd = new PageData();
pd = this.getPageData();
- pd = teacherService.findById(pd); //根据ID读取
+ pd = teacherService.findById(pd); // 根据ID读取
mv.setViewName("sunvote/teacher/teacher_edit");
List schools = schoolService.listAll(pd);
- mv.addObject("schools",schools);
+ mv.addObject("schools", schools);
mv.addObject("msg", "edit");
mv.addObject("pd", pd);
return mv;
- }
-
- /**批量删除
+ }
+
+ /**
+ * 批量删除
+ *
* @param
* @throws Exception
*/
- @RequestMapping(value="/deleteAll")
+ @RequestMapping(value = "/deleteAll")
@ResponseBody
- public Object deleteAll() throws Exception{
- logBefore(logger, Jurisdiction.getUsername()+"批量删除Teacher");
- if(!Jurisdiction.buttonJurisdiction(menuUrl, "del")){return null;} //校验权限
- PageData pd = new PageData();
- Map map = new HashMap();
+ public Object deleteAll() throws Exception {
+ logBefore(logger, Jurisdiction.getUsername() + "批量删除Teacher");
+ if (!Jurisdiction.buttonJurisdiction(menuUrl, "del")) {
+ return null;
+ } // 校验权限
+ PageData pd = new PageData();
+ Map map = new HashMap();
pd = this.getPageData();
List pdList = new ArrayList();
String DATA_IDS = pd.getString("DATA_IDS");
- if(null != DATA_IDS && !"".equals(DATA_IDS)){
+ if (null != DATA_IDS && !"".equals(DATA_IDS)) {
String ArrayDATA_IDS[] = DATA_IDS.split(",");
teacherService.deleteAll(ArrayDATA_IDS);
pd.put("msg", "ok");
- }else{
+ } else {
pd.put("msg", "no");
}
pdList.add(pd);
map.put("list", pdList);
return AppUtil.returnObject(pd, map);
}
-
- /**导出到excel
+
+ /**
+ * 导出到excel
+ *
* @param
* @throws Exception
*/
- @RequestMapping(value="/excel")
- public ModelAndView exportExcel() throws Exception{
- logBefore(logger, Jurisdiction.getUsername()+"导出Teacher到excel");
- if(!Jurisdiction.buttonJurisdiction(menuUrl, "cha")){return null;}
+ @RequestMapping(value = "/excel")
+ public ModelAndView exportExcel() throws Exception {
+ logBefore(logger, Jurisdiction.getUsername() + "导出Teacher到excel");
+ if (!Jurisdiction.buttonJurisdiction(menuUrl, "cha")) {
+ return null;
+ }
ModelAndView mv = new ModelAndView();
PageData pd = new PageData();
pd = this.getPageData();
- Map dataMap = new HashMap();
+ Map dataMap = new HashMap();
List titles = new ArrayList();
- titles.add("所在学校"); //1
- titles.add("姓名"); //2
- titles.add("电话"); //3
- titles.add("座机电话"); //4
- titles.add("证件号"); //5
- titles.add("账号"); //6
- titles.add("密码"); //7
- titles.add("性别"); //8
- titles.add("科目列表"); //9
- titles.add("教师卡编号"); //10
+ titles.add("所在学校"); // 1
+ titles.add("姓名"); // 2
+ titles.add("电话"); // 3
+ titles.add("座机电话"); // 4
+ titles.add("证件号"); // 5
+ titles.add("账号"); // 6
+ titles.add("密码"); // 7
+ titles.add("性别"); // 8
+ titles.add("科目列表"); // 9
+ titles.add("教师卡编号"); // 10
dataMap.put("titles", titles);
List varOList = teacherService.listAll(pd);
List varList = new ArrayList();
- for(int i=0;i res = new ResponseGson();
+ pd.put("ID", this.geTeacherID());
+ PageData pageData = teacherService.findById(pd);
+ if (pageData != null && pageData.getString("ID") != null) {
+ pageData.put("PASSWORD", "");// 返回参数中不返回密码
+ PageData pt = new PageData();
+ pt.put("TEACHER_ID", pageData.get("ID"));
+ // 在任课表中查找老师教哪些班级,然后查出班级信息
+ List classInfoList = v1Service
+ .getTeacherClassInfo(pt);
+
+ pageData.put("classInfoList", classInfoList);
+ // 在认可表中查找老师教哪些科目,然后查出科目信息
+ List subjectList = v1Service
+ .getTeacherSubjectInfo(pt);
+ // 一个sql语句完成。
+ pageData.put("subjectList", subjectList);
+
+ pageData.remove("SUBJECT_IDS");
+
+ PageData eventPd = new PageData();
+ eventPd.put("EVENT_ID", get32UUID());
+ eventPd.put("EVENT_NAME", "login");
+ eventPd.put("EVENT_USER", pageData.getString("ID"));
+ eventPd.put("EVENT_TYPE", "0");
+ eventPd.put("EVENT_START_TIME", Tools.date2Str(new Date()));
+ if (pd.getString("CLIENT_ID") != null) {
+ eventPd.put("CLIENT_ID", pd.getString("CLIENT_ID"));
+ } else {
+ eventPd.put("CLIENT_ID", "CLIENT");
+ }
+ res.setData(pageData);
+ // 填充数据到返回数据中
+ } else {
+ res.set1Error();
+ }
+
+ return res.toJson();
+ }
+
}
diff --git a/src/com/fh/controller/system/login/LoginController.java b/src/com/fh/controller/system/login/LoginController.java
index 4f5dc11..7a43732 100644
--- a/src/com/fh/controller/system/login/LoginController.java
+++ b/src/com/fh/controller/system/login/LoginController.java
@@ -153,6 +153,13 @@ public class LoginController extends BaseController {
if ("57bb1e6f138247a0b05cc721a5da1b64".equals(pd
.getString("ROLE_ID"))) {
map.put("teacher", pd.getString("RIGHTS"));
+ PageData tpd = new PageData();
+ tpd.put("ACCOUT", pd.get("USERNAME"));
+ tpd.put("PASSWORD", PASSWORD);
+ PageData pageData = teacherService.getUserInfo(tpd);
+ if(pageData != null){
+ user.setTeacherID(pageData.getString("ID"));
+ }
}
user.setLAST_LOGIN(pd.getString("LAST_LOGIN"));
user.setIP(pd.getString("IP"));
diff --git a/src/com/fh/entity/system/User.java b/src/com/fh/entity/system/User.java
index 3b95d6d..7a1cc4c 100644
--- a/src/com/fh/entity/system/User.java
+++ b/src/com/fh/entity/system/User.java
@@ -17,6 +17,7 @@ public class User {
private Role role; //角色对象
private Page page; //分页对象
private String SKIN; //皮肤
+ private String teacherID ; // 教师ID
public String getSKIN() {
return SKIN;
@@ -100,5 +101,13 @@ public class User {
public void setPage(Page page) {
this.page = page;
}
+ public String getTeacherID() {
+ return teacherID;
+ }
+ public void setTeacherID(String teacherID) {
+ this.teacherID = teacherID;
+ }
+
+
}
diff --git a/src/com/fh/service/sunvote/testpaperinfo/TestPaperInfoManager.java b/src/com/fh/service/sunvote/testpaperinfo/TestPaperInfoManager.java
index 6b9195b..b7ddb8a 100644
--- a/src/com/fh/service/sunvote/testpaperinfo/TestPaperInfoManager.java
+++ b/src/com/fh/service/sunvote/testpaperinfo/TestPaperInfoManager.java
@@ -66,5 +66,25 @@ public interface TestPaperInfoManager{
*/
public void deleteAll(String[] ArrayDATA_IDS)throws Exception;
+
+ /**
+ * 根据测验id,试题id,查询该问题,在该答卷的答题情况
+ * 可以根据试卷id,试题id,查询试卷在所有测验中答题情况
+ * 可以根据学生id,试题id,查询试题在学生下面的答题情况
+ * @param pd
+ * @return
+ * @throws Exception
+ */
+ public List listTestPaperQuestionIDinfo(PageData pd)throws Exception;
+
+
+ /**
+ * 查询测验下面的所有试题ID列表
+ * @param pd
+ * @return
+ * @throws Exception
+ */
+ public List listTestPaperQuestionIDs(PageData pd)throws Exception;
+
}
diff --git a/src/com/fh/service/sunvote/testpaperinfo/impl/TestPaperInfoService.java b/src/com/fh/service/sunvote/testpaperinfo/impl/TestPaperInfoService.java
index 83e502e..6911f71 100644
--- a/src/com/fh/service/sunvote/testpaperinfo/impl/TestPaperInfoService.java
+++ b/src/com/fh/service/sunvote/testpaperinfo/impl/TestPaperInfoService.java
@@ -73,6 +73,22 @@ public class TestPaperInfoService implements TestPaperInfoManager{
* @throws Exception
*/
@SuppressWarnings("unchecked")
+ public List listTestPaperQuestionIDinfo(PageData pd)throws Exception{
+ return (List)dao.findForList("TestPaperInfoMapper.listTestPaperQuestionIDinfo", pd);
+ }
+ /**列表(全部)
+ * @param pd
+ * @throws Exception
+ */
+ @SuppressWarnings("unchecked")
+ public List listTestPaperQuestionIDs(PageData pd)throws Exception{
+ return (List)dao.findForList("TestPaperInfoMapper.listTestPaperQuestionIDs", pd);
+ }
+ /**列表(全部)
+ * @param pd
+ * @throws Exception
+ */
+ @SuppressWarnings("unchecked")
public List reportPaperDetail(PageData pd)throws Exception{
return (List)dao.findForList("TestPaperInfoMapper.reportPaperDetail", pd);
}
diff --git a/src/com/fh/service/sunvote/textbook/TextbookManager.java b/src/com/fh/service/sunvote/textbook/TextbookManager.java
new file mode 100644
index 0000000..8bc9e0c
--- /dev/null
+++ b/src/com/fh/service/sunvote/textbook/TextbookManager.java
@@ -0,0 +1,52 @@
+package com.fh.service.sunvote.textbook;
+
+import java.util.List;
+
+import com.fh.entity.Page;
+import com.fh.util.PageData;
+
+public interface TextbookManager {
+
+ /**新增
+ * @param pd
+ * @throws Exception
+ */
+ public void save(PageData pd)throws Exception;
+
+ /**删除
+ * @param pd
+ * @throws Exception
+ */
+ public void delete(PageData pd)throws Exception;
+
+ /**修改
+ * @param pd
+ * @throws Exception
+ */
+ public void edit(PageData pd)throws Exception;
+
+ /**列表
+ * @param page
+ * @throws Exception
+ */
+ public List list(Page page)throws Exception;
+
+ /**列表(全部)
+ * @param pd
+ * @throws Exception
+ */
+ public List listAll(PageData pd)throws Exception;
+
+ /**通过id获取数据
+ * @param pd
+ * @throws Exception
+ */
+ public PageData findById(PageData pd)throws Exception;
+
+ /**批量删除
+ * @param ArrayDATA_IDS
+ * @throws Exception
+ */
+ public void deleteAll(String[] ArrayDATA_IDS)throws Exception;
+
+}
diff --git a/src/com/fh/service/sunvote/textbook/impl/TextbookService.java b/src/com/fh/service/sunvote/textbook/impl/TextbookService.java
new file mode 100644
index 0000000..9920578
--- /dev/null
+++ b/src/com/fh/service/sunvote/textbook/impl/TextbookService.java
@@ -0,0 +1,78 @@
+package com.fh.service.sunvote.textbook.impl;
+
+import java.util.List;
+
+import javax.annotation.Resource;
+
+import org.springframework.stereotype.Service;
+
+import com.fh.dao.DaoSupport;
+import com.fh.entity.Page;
+import com.fh.service.sunvote.textbook.TextbookManager;
+import com.fh.util.PageData;
+
+@Service("textbookService")
+public class TextbookService implements TextbookManager {
+
+ @Resource(name = "daoSupport")
+ private DaoSupport dao;
+
+ /**新增
+ * @param pd
+ * @throws Exception
+ */
+ public void save(PageData pd)throws Exception{
+ dao.save("TextbookMapper.save", pd);
+ }
+
+ /**删除
+ * @param pd
+ * @throws Exception
+ */
+ public void delete(PageData pd)throws Exception{
+ dao.delete("TextbookMapper.delete", pd);
+ }
+
+ /**修改
+ * @param pd
+ * @throws Exception
+ */
+ public void edit(PageData pd)throws Exception{
+ dao.update("TextbookMapper.edit", pd);
+ }
+
+ /**列表
+ * @param page
+ * @throws Exception
+ */
+ @SuppressWarnings("unchecked")
+ public List list(Page page)throws Exception{
+ return (List)dao.findForList("TextbookMapper.datalistPage", page);
+ }
+
+ /**列表(全部)
+ * @param pd
+ * @throws Exception
+ */
+ @SuppressWarnings("unchecked")
+ public List listAll(PageData pd)throws Exception{
+ return (List)dao.findForList("TextbookMapper.listAll", pd);
+ }
+
+ /**通过id获取数据
+ * @param pd
+ * @throws Exception
+ */
+ public PageData findById(PageData pd)throws Exception{
+ return (PageData)dao.findForObject("TextbookMapper.findById", pd);
+ }
+
+ /**批量删除
+ * @param ArrayDATA_IDS
+ * @throws Exception
+ */
+ public void deleteAll(String[] ArrayDATA_IDS)throws Exception{
+ dao.delete("TextbookMapper.deleteAll", ArrayDATA_IDS);
+ }
+
+}