Commit 4926e3fd75724808673abbc8de8946259b53549d

Authored by jack
1 parent 5cf10579

1.修复bug

WebRoot/WEB-INF/jsp/sunvote/paper/paper_list4.jsp
@@ -73,7 +73,8 @@ @@ -73,7 +73,8 @@
73 <col style="width: 10%" /> 73 <col style="width: 10%" />
74 <col style="width: 10%" /> 74 <col style="width: 10%" />
75 <col style="width: 10%" /> 75 <col style="width: 10%" />
76 - <col style="width: 20%" /> 76 + <col style="width: 10%" />
  77 + <col style="width: 10%" />
77 <col style="width: 10%" /> 78 <col style="width: 10%" />
78 <col style="width: 10%" /> 79 <col style="width: 10%" />
79 <thead> 80 <thead>
@@ -85,6 +86,7 @@ @@ -85,6 +86,7 @@
85 <th>出卷老师</th> 86 <th>出卷老师</th>
86 <th>创建时间</th> 87 <th>创建时间</th>
87 <th>建议考试时长</th> 88 <th>建议考试时长</th>
  89 + <th>考试次数</th>
88 <th>总分</th> 90 <th>总分</th>
89 <th>操作</th> 91 <th>操作</th>
90 </tr> 92 </tr>
@@ -99,7 +101,8 @@ @@ -99,7 +101,8 @@
99 <col style="width: 10%" /> 101 <col style="width: 10%" />
100 <col style="width: 10%" /> 102 <col style="width: 10%" />
101 <col style="width: 10%" /> 103 <col style="width: 10%" />
102 - <col style="width: 20%" /> 104 + <col style="width: 10%" />
  105 + <col style="width: 10%" />
103 <col style="width: 10%" /> 106 <col style="width: 10%" />
104 <col style="width: 10%" /> 107 <col style="width: 10%" />
105 <tbody> 108 <tbody>
@@ -114,6 +117,7 @@ @@ -114,6 +117,7 @@
114 <td >${myelfun:findTeacherName(var.USER_ID)}</td> 117 <td >${myelfun:findTeacherName(var.USER_ID)}</td>
115 <td >${var.CREATE_DATE}</td> 118 <td >${var.CREATE_DATE}</td>
116 <td >${var.EXAM_TIME}</td> 119 <td >${var.EXAM_TIME}</td>
  120 + <td >${var.TEST_NUM}</td>
117 <td >${var.SCORE}</td> 121 <td >${var.SCORE}</td>
118 <td ><a href="<%=basePath%>paper/paperRep.do?paper_id=${var.PAPER_ID}">查看成绩</a></td> 122 <td ><a href="<%=basePath%>paper/paperRep.do?paper_id=${var.PAPER_ID}">查看成绩</a></td>
119 </tr> 123 </tr>
WebRoot/WEB-INF/jsp/sunvote/paper/paper_list5.jsp
@@ -60,10 +60,11 @@ @@ -60,10 +60,11 @@
60 <col style="width: 10%" /> 60 <col style="width: 10%" />
61 <col style="width: 15%" /> 61 <col style="width: 15%" />
62 <col style="width: 15%" /> 62 <col style="width: 15%" />
63 - <col style="width: 10%" />  
64 - <col style="width: 10%" />  
65 - <col style="width: 15%" />  
66 - <col style="width: 10%" /> 63 + <col style="width: 8%" />
  64 + <col style="width: 8%" />
  65 + <col style="width: 13%" />
  66 + <col style="width: 8%" />
  67 + <col style="width: 8%" />
67 <col style="width: 15%" /> 68 <col style="width: 15%" />
68 <thead> 69 <thead>
69 <tr> 70 <tr>
@@ -73,6 +74,7 @@ @@ -73,6 +74,7 @@
73 <th>年级</th> 74 <th>年级</th>
74 <th>科目</th> 75 <th>科目</th>
75 <th>建议考试时长</th> 76 <th>建议考试时长</th>
  77 + <th>考试次数</th>
76 <th>总分</th> 78 <th>总分</th>
77 <th>操作</th> 79 <th>操作</th>
78 </tr> 80 </tr>
@@ -85,10 +87,11 @@ @@ -85,10 +87,11 @@
85 <col style="width: 10%" /> 87 <col style="width: 10%" />
86 <col style="width: 15%" /> 88 <col style="width: 15%" />
87 <col style="width: 15%" /> 89 <col style="width: 15%" />
88 - <col style="width: 10%" />  
89 - <col style="width: 10%" />  
90 - <col style="width: 15%" />  
91 - <col style="width: 10%" /> 90 + <col style="width: 8%" />
  91 + <col style="width: 8%" />
  92 + <col style="width: 13%" />
  93 + <col style="width: 8%" />
  94 + <col style="width: 8%" />
92 <col style="width: 15%" /> 95 <col style="width: 15%" />
93 <tbody> 96 <tbody>
94 <c:choose> 97 <c:choose>
@@ -101,6 +104,7 @@ @@ -101,6 +104,7 @@
101 <td >${myelfun:findGradeName(var.GRADE_ID)}</td> 104 <td >${myelfun:findGradeName(var.GRADE_ID)}</td>
102 <td >${myelfun:findSubjectCName(var.SUBJECT_ID)}</td> 105 <td >${myelfun:findSubjectCName(var.SUBJECT_ID)}</td>
103 <td >${var.EXAM_TIME}</td> 106 <td >${var.EXAM_TIME}</td>
  107 + <td >${var.TEST_NUM}</td>
104 <td >${var.SCORE}</td> 108 <td >${var.SCORE}</td>
105 <td> 109 <td>
106 <a href="<%=basePath%>paper/paperRep.do?paper_id=${var.PAPER_ID}">查看成绩</a> 110 <a href="<%=basePath%>paper/paperRep.do?paper_id=${var.PAPER_ID}">查看成绩</a>
WebRoot/WEB-INF/jsp/sunvote/paper/test_list1.jsp
@@ -55,8 +55,9 @@ @@ -55,8 +55,9 @@
55 </div> 55 </div>
56 <div class="table_box" style="padding:0 5%;background:#fff;"> 56 <div class="table_box" style="padding:0 5%;background:#fff;">
57 <div style="padding:15px 0;background:#fff;" class="paper_title"> 57 <div style="padding:15px 0;background:#fff;" class="paper_title">
58 - &nbsp;  
59 - 试卷名称:${myelfun:findPaperName(pd.PAPER_ID)} 58 + <b>试卷名称:</b>${myelfun:findPaperName(pd.PAPER_ID)}
  59 + <br/>
  60 + <b>试卷总分:</b>${pd.TOTAL_SCORE}分
60 </div> 61 </div>
61 62
62 <table id="simple-table" 63 <table id="simple-table"
@@ -69,13 +70,13 @@ @@ -69,13 +70,13 @@
69 <th><div style="width:80px">考试时间</div></th> 70 <th><div style="width:80px">考试时间</div></th>
70 <th><div style="width:80px">平均分</div></th> 71 <th><div style="width:80px">平均分</div></th>
71 <th><div style="width:80px">班级总人数</div></th> 72 <th><div style="width:80px">班级总人数</div></th>
72 - <th><div style="width:80px" title="得分>=80%">优秀人数</div></th> 73 + <th><div style="width:80px" title="得分>=80%">优秀人数<img src="../static/images/tip.png" style="width:12px"></div></th>
73 <th><div style="width:80px">优秀率</div></th> 74 <th><div style="width:80px">优秀率</div></th>
74 - <th><div style="width:80px" title="得分>=70%">良好人数</div></th> 75 + <th><div style="width:80px" title="得分>=70%">良好人数<img src="../static/images/tip.png" style="width:12px"></div></th>
75 <th><div style="width:80px">良好率</div></th> 76 <th><div style="width:80px">良好率</div></th>
76 - <th><div style="width:80px" title="得分>=60%">及格人数</div></th> 77 + <th><div style="width:80px" title="得分>=60%">及格人数<img src="../static/images/tip.png" style="width:12px"></div></th>
77 <th><div style="width:80px">及格率</div></th> 78 <th><div style="width:80px">及格率</div></th>
78 - <th><div style="width:80px" title="得分>=30%">低分人数</div></th> 79 + <th><div style="width:80px" title="得分>=30%">低分人数<img src="../static/images/tip.png" style="width:12px"></div></th>
79 <th><div style="width:80px">低分率</div></th> 80 <th><div style="width:80px">低分率</div></th>
80 <th><div style="width:80px">操作</div></th> 81 <th><div style="width:80px">操作</div></th>
81 </tr> 82 </tr>
@@ -174,7 +175,7 @@ @@ -174,7 +175,7 @@
174 <td > 175 <td >
175 176
176 <c:if test="${not empty var.class_id }"> 177 <c:if test="${not empty var.class_id }">
177 - <a href="<%=basePath%>paper/paperRep2.do?CLASS_ID=${var.class_id}&PAPER_ID=${pd.PAPER_ID}&TESTPAPER_ID=${var.testpaper_id}">查看成绩</a> 178 + <a href="<%=basePath%>paper/paperRep2.do?CLASS_ID=${var.class_id}&PAPER_ID=${pd.PAPER_ID}&TESTPAPER_ID=${var.testpaper_id}&CREAT_TIME=${var.creat_time}">查看成绩</a>
178 </c:if> 179 </c:if>
179 <c:if test="${empty var.class_id }"> 180 <c:if test="${empty var.class_id }">
180 <a href="<%=basePath%>paper/paperRep2.do?PAPER_ID=${pd.PAPER_ID}&TESTPAPER_ID=${var.testpaperList}">查看成绩</a> 181 <a href="<%=basePath%>paper/paperRep2.do?PAPER_ID=${pd.PAPER_ID}&TESTPAPER_ID=${var.testpaperList}">查看成绩</a>
WebRoot/WEB-INF/jsp/sunvote/paper/test_list2.jsp
@@ -58,12 +58,14 @@ @@ -58,12 +58,14 @@
58 <div class="table_box" style="padding:0 5%;background:#fff;"> 58 <div class="table_box" style="padding:0 5%;background:#fff;">
59 <div style="padding:15px 0;background:#fff;" class="paper_title"> 59 <div style="padding:15px 0;background:#fff;" class="paper_title">
60 &nbsp; 60 &nbsp;
61 - 试卷名称:${myelfun:findPaperName(pd.PAPER_ID)} 61 + <b>试卷名称:</b>${myelfun:findPaperName(pd.PAPER_ID)}
62 62
63 <c:if test="${not empty pd.CLASS_ID }"> 63 <c:if test="${not empty pd.CLASS_ID }">
64 - 班级名称:${myelfun:findClassName(pd.CLASS_ID)} 64 + &nbsp;&nbsp;&nbsp;&nbsp;<b>班级名称:</b>${myelfun:findClassName(pd.CLASS_ID)}
  65 + &nbsp;&nbsp;&nbsp;&nbsp;<b>考试时间:</b>${pd.CREAT_TIME}
65 </c:if> 66 </c:if>
66 67
  68 +
67 </div> 69 </div>
68 70
69 <table id="simple-table" 71 <table id="simple-table"
@@ -91,6 +93,9 @@ @@ -91,6 +93,9 @@
91 <c:choose> 93 <c:choose>
92 <c:when test="${not empty varList}"> 94 <c:when test="${not empty varList}">
93 <c:forEach items="${varList}" var="var" varStatus="vs"> 95 <c:forEach items="${varList}" var="var" varStatus="vs">
  96 +
  97 + <c:set var="right" value="${var.ANSWERNUM == 0 ? 0: (var.RIGHTNUM / var.ANSWERNUM * 100)}"></c:set>
  98 +
94 <tr> 99 <tr>
95 100
96 <td>${var.QUESTION_RANK}</td> 101 <td>${var.QUESTION_RANK}</td>
@@ -98,9 +103,18 @@ @@ -98,9 +103,18 @@
98 <td >${var.ANSWERNUM}</td> 103 <td >${var.ANSWERNUM}</td>
99 <td >${var.RIGHTNUM}</td> 104 <td >${var.RIGHTNUM}</td>
100 <td > 105 <td >
101 - <fmt:formatNumber type="number"  
102 - value="${var.ANSWERNUM == 0 ? 0: (var.RIGHTNUM / var.ANSWERNUM * 100)}"  
103 - maxFractionDigits="2" />% 106 + <c:if test="${right<=50}">
  107 + <span style="color:red"><fmt:formatNumber type="number"
  108 + value="${right}"
  109 + maxFractionDigits="2" />%</span>
  110 + </c:if>
  111 + <c:if test="${right>50}">
  112 + <span style="color:red"><fmt:formatNumber type="number"
  113 + value="${right}"
  114 + maxFractionDigits="2" />%</span>
  115 + </c:if>
  116 +
  117 +
104 </td> 118 </td>
105 <td >${var.QUESTION_SCORE}</td> 119 <td >${var.QUESTION_SCORE}</td>
106 <td > 120 <td >
WebRoot/WEB-INF/jsp/sunvote/student/student_list2.jsp
@@ -27,6 +27,10 @@ @@ -27,6 +27,10 @@
27 <script src="https://cdn.bootcss.com/html5shiv/3.7.3/html5shiv.min.js"></script> 27 <script src="https://cdn.bootcss.com/html5shiv/3.7.3/html5shiv.min.js"></script>
28 <script src="https://cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script> 28 <script src="https://cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
29 <![endif]--> 29 <![endif]-->
  30 +<style type="text/css">
  31 + #remove{
  32 + background:#ccc}
  33 +</style>
30 </head> 34 </head>
31 <body> 35 <body>
32 36
@@ -44,15 +48,17 @@ @@ -44,15 +48,17 @@
44 <div style="padding:0 5%;background:#fff;"> 48 <div style="padding:0 5%;background:#fff;">
45 <table class="table table-striped"> 49 <table class="table table-striped">
46 <col style="width: 10%" /> 50 <col style="width: 10%" />
47 - <col style="width: 22%" />  
48 - <col style="width: 22%" />  
49 - <col style="width: 23%" />  
50 - <col style="width: 23%" /> 51 + <col style="width: 20%" />
  52 + <col style="width: 20%" />
  53 + <col style="width: 10%" />
  54 + <col style="width: 20%" />
  55 + <col style="width: 20%" />
51 <thead> 56 <thead>
52 <tr> 57 <tr>
53 <th><input type="checkbox" value="0" name='ids' id="ids" />序号</th> 58 <th><input type="checkbox" value="0" name='ids' id="ids" />序号</th>
54 <th>姓名</th> 59 <th>姓名</th>
55 <th>学号</th> 60 <th>学号</th>
  61 + <th>性别</th>
56 <th>键盘ID</th> 62 <th>键盘ID</th>
57 <th>操作</th> 63 <th>操作</th>
58 </tr> 64 </tr>
@@ -64,10 +70,11 @@ @@ -64,10 +70,11 @@
64 <div class="table_box"> 70 <div class="table_box">
65 <table class="table table-striped"> 71 <table class="table table-striped">
66 <col style="width: 10%" /> 72 <col style="width: 10%" />
67 - <col style="width: 22%" />  
68 - <col style="width: 22%" />  
69 - <col style="width: 23%" />  
70 - <col style="width: 23%" /> 73 + <col style="width: 20%" />
  74 + <col style="width: 20%" />
  75 + <col style="width: 10%" />
  76 + <col style="width: 20%" />
  77 + <col style="width: 20%" />
71 <tbody> 78 <tbody>
72 <c:choose> 79 <c:choose>
73 <c:when test="${not empty varList}"> 80 <c:when test="${not empty varList}">
@@ -76,6 +83,14 @@ @@ -76,6 +83,14 @@
76 <td><input type="checkbox" name='ids' id="ids" value="${var.ID}" />${vs.index+1}</td> 83 <td><input type="checkbox" name='ids' id="ids" value="${var.ID}" />${vs.index+1}</td>
77 <td class='center'>${var.NAME}</td> 84 <td class='center'>${var.NAME}</td>
78 <td>${var.NUMBER}</td> 85 <td>${var.NUMBER}</td>
  86 + <td>
  87 + <c:if test="${var.SEX == 0}">
  88 + 女
  89 + </c:if>
  90 + <c:if test="${var.SEX == 1}">
  91 + 男
  92 + </c:if>
  93 + </td>
79 <td>${var.KEYPAD_ID}</td> 94 <td>${var.KEYPAD_ID}</td>
80 <td><a href="#" onclick="edit('${var.ID}');" style="margin-right:10px;"><img src="../static/images/eidtor.png" /></a><a href="#" onclick="del('${var.ID}');"><img src="../static/images/remove.png" /></a></td> 95 <td><a href="#" onclick="edit('${var.ID}');" style="margin-right:10px;"><img src="../static/images/eidtor.png" /></a><a href="#" onclick="del('${var.ID}');"><img src="../static/images/remove.png" /></a></td>
81 96
@@ -106,7 +121,7 @@ @@ -106,7 +121,7 @@
106 <input type="button" onclick="export2();" value="批量导出" /> 121 <input type="button" onclick="export2();" value="批量导出" />
107 </div> 122 </div>
108 <div class="removeAll" > 123 <div class="removeAll" >
109 - <input type="button" onclick="deleteAll();" value="批量删除" /> 124 + <input type="button" onclick="deleteAll();" disabled id="remove" value="批量删除" />
110 </div> 125 </div>
111 <div class="page_box"> 126 <div class="page_box">
112 <div class="pagination" style="float: right;padding-top: 0px;margin-top: 0px;">${page.pageStr}</div> 127 <div class="pagination" style="float: right;padding-top: 0px;margin-top: 0px;">${page.pageStr}</div>
@@ -220,6 +235,22 @@ @@ -220,6 +235,22 @@
220 function export2(){ 235 function export2(){
221 window.open('<%=basePath%>student/excel?class_id=${pd.CLASS_ID}','_blank'); 236 window.open('<%=basePath%>student/excel?class_id=${pd.CLASS_ID}','_blank');
222 } 237 }
  238 + $("input[type=checkbox]").on('click',function(){
  239 + var str = '';
  240 + for(var i=0;i < document.getElementsByName('ids').length;i++){
  241 + if(document.getElementsByName('ids')[i].checked){
  242 + if(str=='') str += document.getElementsByName('ids')[i].value;
  243 + else str += ',' + document.getElementsByName('ids')[i].value;
  244 + }
  245 + }
  246 + if(str==''){
  247 + $("#remove").attr("disabled","disabled");
  248 + $("#remove").css("background","#ccc");
  249 + }else{
  250 + $("#remove").removeAttr("disabled");
  251 + $("#remove").css("background","#f29c9f");
  252 + }
  253 + })
223 254
224 </script> 255 </script>
225 </html> 256 </html>
226 \ No newline at end of file 257 \ No newline at end of file
WebRoot/static/images/tip.png 0 → 100644

378 Bytes

resources/mybatis1/sunvote/StudentMapper.xml
@@ -88,6 +88,17 @@ @@ -88,6 +88,17 @@
88 </select> 88 </select>
89 89
90 <!-- 通过ID获取数据 --> 90 <!-- 通过ID获取数据 -->
  91 + <select id="findByNumberAndKeyPadId" parameterType="pd" resultType="pd">
  92 + select
  93 + <include refid="Field"></include>
  94 + from
  95 + <include refid="tableName"></include>
  96 + where
  97 + NAME = #{NAME}
  98 + and NUMBER = #{NUMBER}
  99 + and KEYPAD_ID = #{KEYPAD_ID}
  100 + </select>
  101 + <!-- 通过ID获取数据 -->
91 <select id="findByClassId" parameterType="pd" resultType="pd"> 102 <select id="findByClassId" parameterType="pd" resultType="pd">
92 select 103 select
93 <include refid="Field"></include> 104 <include refid="Field"></include>
src/com/fh/controller/sunvote/paper/PaperController.java
@@ -199,12 +199,12 @@ public class PaperController extends BaseController { @@ -199,12 +199,12 @@ public class PaperController extends BaseController {
199 List<PageData> templist = new ArrayList<PageData>(); 199 List<PageData> templist = new ArrayList<PageData>();
200 PageData saveData = new PageData(); 200 PageData saveData = new PageData();
201 DecimalFormat decimalFormat=new DecimalFormat("0.00"); 201 DecimalFormat decimalFormat=new DecimalFormat("0.00");
202 - 202 + String total_score = "";
203 ResponseGson<PageData> res = new ResponseGson(); 203 ResponseGson<PageData> res = new ResponseGson();
204 pd = this.getPageData(); 204 pd = this.getPageData();
205 if(pd.containsKey("PAPER_ID")){ 205 if(pd.containsKey("PAPER_ID")){
206 List<PageData> list = testpaperService.listAll(pd); 206 List<PageData> list = testpaperService.listAll(pd);
207 - 207 + total_score = list.get(0).getString("TOTAL_SCORE");
208 pd.put("testpaperlist", list); 208 pd.put("testpaperlist", list);
209 Integer you_sum = 0; //优秀总人数 209 Integer you_sum = 0; //优秀总人数
210 Integer liang_sum = 0; //良好总人数 210 Integer liang_sum = 0; //良好总人数
@@ -283,7 +283,7 @@ public class PaperController extends BaseController { @@ -283,7 +283,7 @@ public class PaperController extends BaseController {
283 283
284 284
285 saveData.put("list", templist); 285 saveData.put("list", templist);
286 - 286 + pd.put("TOTAL_SCORE", total_score);
287 mv.setViewName("sunvote/paper/test_list1"); 287 mv.setViewName("sunvote/paper/test_list1");
288 mv.addObject("varList", templist); 288 mv.addObject("varList", templist);
289 mv.addObject("pd",pd); 289 mv.addObject("pd",pd);
@@ -858,6 +858,9 @@ public class PaperController extends BaseController { @@ -858,6 +858,9 @@ public class PaperController extends BaseController {
858 858
859 for(PageData p:varList){ 859 for(PageData p:varList){
860 String examTime = p.getString("EXAM_TIME"); 860 String examTime = p.getString("EXAM_TIME");
  861 + PageData temp = new PageData();
  862 + temp.put("PAPER_ID", p.getString("PAPER_ID"));
  863 + List<PageData> li = testpaperService.listAll(temp);
861 if(examTime != null){ 864 if(examTime != null){
862 try{ 865 try{
863 int et = Integer.parseInt(examTime); 866 int et = Integer.parseInt(examTime);
@@ -882,6 +885,7 @@ public class PaperController extends BaseController { @@ -882,6 +885,7 @@ public class PaperController extends BaseController {
882 examTime = "0"; 885 examTime = "0";
883 } 886 }
884 p.put("EXAM_TIME", examTime); 887 p.put("EXAM_TIME", examTime);
  888 + p.put("TEST_NUM", li.size());
885 } 889 }
886 890
887 PageData tpd = new PageData(); 891 PageData tpd = new PageData();
@@ -926,6 +930,10 @@ public class PaperController extends BaseController { @@ -926,6 +930,10 @@ public class PaperController extends BaseController {
926 930
927 for(PageData p:varList){ 931 for(PageData p:varList){
928 String examTime = p.getString("EXAM_TIME"); 932 String examTime = p.getString("EXAM_TIME");
  933 + PageData temp = new PageData();
  934 + temp.put("PAPER_ID", p.getString("PAPER_ID"));
  935 + List<PageData> li = testpaperService.listAll(temp);
  936 +
929 if(examTime != null){ 937 if(examTime != null){
930 try{ 938 try{
931 int et = Integer.parseInt(examTime); 939 int et = Integer.parseInt(examTime);
@@ -950,6 +958,7 @@ public class PaperController extends BaseController { @@ -950,6 +958,7 @@ public class PaperController extends BaseController {
950 examTime = "0"; 958 examTime = "0";
951 } 959 }
952 p.put("EXAM_TIME", examTime); 960 p.put("EXAM_TIME", examTime);
  961 + p.put("TEST_NUM", li.size());
953 } 962 }
954 963
955 mv.addObject("varList", varList); 964 mv.addObject("varList", varList);
src/com/fh/controller/sunvote/student/StudentController.java
@@ -147,20 +147,27 @@ public class StudentController extends BaseController { @@ -147,20 +147,27 @@ public class StudentController extends BaseController {
147 for(int i = 1 ; i < listPd.size();i++){ 147 for(int i = 1 ; i < listPd.size();i++){
148 PageData savePd = new PageData(); 148 PageData savePd = new PageData();
149 PageData temp = listPd.get(i); 149 PageData temp = listPd.get(i);
150 - for(int j = 0 ;j<3 ;j++){ 150 +
  151 + for(int j = 0 ;j<4 ;j++){
151 // if(temp.get("var" + j) == null){ 152 // if(temp.get("var" + j) == null){
152 // break ; 153 // break ;
153 // } 154 // }
154 if(temp.get("var" + j) != null && !"".equals(temp.get("var" + j).toString())){ 155 if(temp.get("var" + j) != null && !"".equals(temp.get("var" + j).toString())){
155 savePd.put(pd.getString("var" + j).toUpperCase(), temp.get("var" + j)); 156 savePd.put(pd.getString("var" + j).toUpperCase(), temp.get("var" + j));
156 }else{ 157 }else{
157 - mv.addObject("msg","本次成功导入"+(i-1>=0?i-1:0)+"条数据,第"+i+"行有空数据");  
158 - mv.addObject("state","fail");  
159 - mv.setViewName("save_result2");  
160 - return mv; 158 + if(j==3){
  159 + continue;
  160 + }else{
  161 + mv.addObject("msg","本次成功导入"+(i-1>=0?i-1:0)+"条数据,第"+i+"行有空数据");
  162 + mv.addObject("state","fail");
  163 + mv.setViewName("save_result2");
  164 + return mv;
  165 + }
161 } 166 }
162 } 167 }
163 - if(!savePd.containsKey("ID")){ 168 + List<PageData> lnum = studentService.findByNumberAndKeyPadId(savePd);
  169 +
  170 + if(lnum.size()<1){
164 if (savePd.values().size() > 0) { 171 if (savePd.values().size() > 0) {
165 String studentId = this.get32UUID(); 172 String studentId = this.get32UUID();
166 savePd.put("ID", studentId); 173 savePd.put("ID", studentId);
@@ -178,7 +185,11 @@ public class StudentController extends BaseController { @@ -178,7 +185,11 @@ public class StudentController extends BaseController {
178 } 185 }
179 186
180 }else{ 187 }else{
181 - studentService.edit(savePd); 188 + mv.addObject("msg","本次成功导入"+(i-1>=0?i-1:0)+"条数据,学号不可重复,请检查学生名单后重新导入");
  189 + mv.addObject("state","fail");
  190 + mv.setViewName("save_result2");
  191 + return mv;
  192 +
182 } 193 }
183 } 194 }
184 195
src/com/fh/service/sunvote/student/StudentManager.java
@@ -57,6 +57,8 @@ public interface StudentManager{ @@ -57,6 +57,8 @@ public interface StudentManager{
57 57
58 public List<PageData> findByClassId(PageData pd)throws Exception; 58 public List<PageData> findByClassId(PageData pd)throws Exception;
59 59
  60 +
  61 + public List<PageData> findByNumberAndKeyPadId(PageData pd)throws Exception;
60 /**通过id获取数据 62 /**通过id获取数据
61 * @param pd 63 * @param pd
62 * @throws Exception 64 * @throws Exception
src/com/fh/service/sunvote/student/impl/StudentService.java
@@ -84,6 +84,11 @@ public class StudentService implements StudentManager{ @@ -84,6 +84,11 @@ public class StudentService implements StudentManager{
84 return (List<PageData>)dao.findForList("StudentMapper.findByClassId", pd); 84 return (List<PageData>)dao.findForList("StudentMapper.findByClassId", pd);
85 } 85 }
86 86
  87 + @SuppressWarnings("unchecked")
  88 + public List<PageData> findByNumberAndKeyPadId(PageData pd)throws Exception{
  89 + return (List<PageData>)dao.findForList("StudentMapper.findByNumberAndKeyPadId", pd);
  90 + }
  91 +
87 92
88 @SuppressWarnings("unchecked") 93 @SuppressWarnings("unchecked")
89 public List<PageData> listAllClass(PageData pd)throws Exception{ 94 public List<PageData> listAllClass(PageData pd)throws Exception{