Bladeren bron

新增批量功能:用户管理、科目管理—试卷结构、评卷管理-科目进度列表批量关闭、评卷管理-评卷员管理(批量任务重置、禁用、启用、回收、设置评卷数、密码)

ting.yin 3 jaren geleden
bovenliggende
commit
d0d2b6e5b3

+ 46 - 0
stmms-web/src/main/java/cn/com/qmth/stmms/admin/exam/MarkController.java

@@ -17,6 +17,7 @@ import org.springframework.stereotype.Controller;
 import org.springframework.ui.Model;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.servlet.mvc.support.RedirectAttributes;
 
 import cn.com.qmth.stmms.admin.dto.MarkGroupDTO;
@@ -31,13 +32,18 @@ import cn.com.qmth.stmms.biz.exam.service.ExamSubjectService;
 import cn.com.qmth.stmms.biz.exam.service.MarkGroupService;
 import cn.com.qmth.stmms.biz.exam.service.MarkerService;
 import cn.com.qmth.stmms.biz.exam.service.query.ExamSubjectSearchQuery;
+import cn.com.qmth.stmms.biz.lock.LockService;
 import cn.com.qmth.stmms.biz.mark.query.MarkLibrarySearchQuery;
 import cn.com.qmth.stmms.biz.mark.service.MarkLibraryService;
 import cn.com.qmth.stmms.biz.user.service.UserService;
 import cn.com.qmth.stmms.common.annotation.Logging;
+import cn.com.qmth.stmms.common.annotation.RoleRequire;
 import cn.com.qmth.stmms.common.domain.WebUser;
 import cn.com.qmth.stmms.common.enums.LibraryStatus;
+import cn.com.qmth.stmms.common.enums.LockType;
 import cn.com.qmth.stmms.common.enums.LogType;
+import cn.com.qmth.stmms.common.enums.MarkStatus;
+import cn.com.qmth.stmms.common.enums.Role;
 import cn.com.qmth.stmms.common.utils.ExportExcel;
 import cn.com.qmth.stmms.common.utils.RequestUtils;
 
@@ -68,6 +74,9 @@ public class MarkController extends BaseExamController {
     @Autowired
     private MarkLibraryService libraryService;
 
+    @Autowired
+    private LockService lockService;
+
     /**
      * 评卷进度
      *
@@ -208,4 +217,41 @@ public class MarkController extends BaseExamController {
         }
     }
 
+    @Logging(menu = "大题关闭", type = LogType.QUERY)
+    @RequestMapping("/finish")
+    @RoleRequire({ Role.SCHOOL_ADMIN, Role.SUBJECT_HEADER })
+    public String finish(HttpServletRequest request, Model model, RedirectAttributes redirectAttributes,
+            @RequestParam String[] codes) {
+        int examId = getSessionExamId(request);
+        for (String code : codes) {
+            MarkLibrarySearchQuery mQuery = new MarkLibrarySearchQuery();
+            mQuery.setExamId(examId);
+            mQuery.setSubjectCode(code);
+            long libraryCount = libraryService.countByQuery(mQuery);
+            mQuery.addStatus(LibraryStatus.MARKED);
+            mQuery.addStatus(LibraryStatus.ARBITRATED);
+            mQuery.addStatus(LibraryStatus.INSPECTED);
+            long markedCount = libraryService.countByQuery(mQuery);
+            if (markedCount != libraryCount) {
+                continue;
+            }
+            List<MarkGroup> groups = groupService.findByExamAndSubject(examId, code);
+            for (MarkGroup group : groups) {
+                if (group == null) {
+                    continue;
+                }
+                try {
+                    lockService.waitlock(LockType.GROUP, group.getExamId(), group.getSubjectCode(), group.getNumber());
+                    if (group.getStatus() == MarkStatus.FORMAL && group.getLeftCount() == 0) {
+                        groupService
+                                .updateStatus(examId, code, group.getNumber(), MarkStatus.FINISH, group.getStatus());
+                    }
+                } finally {
+                    lockService.unlock(LockType.GROUP, group.getExamId(), group.getSubjectCode(), group.getNumber());
+                }
+            }
+        }
+        return "redirect:/admin/exam/mark";
+    }
+
 }

+ 41 - 44
stmms-web/src/main/java/cn/com/qmth/stmms/admin/exam/MarkerController.java

@@ -137,23 +137,22 @@ public class MarkerController extends BaseExamController {
     @RequestMapping("/release")
     @ResponseBody
     @RoleRequire(Role.SCHOOL_ADMIN)
-    public JSONObject release(@RequestParam Integer id) {
-        JSONObject result = new JSONObject();
-        Marker marker = markerService.findById(id);
-        if (marker != null) {
-            try {
-                lockService.waitlock(LockType.MARKER, marker.getId());
-                markService.releaseByMarker(marker);
-            } catch (Exception e) {
-                log.error("release marker error", e);
-            } finally {
-                lockService.unlock(LockType.MARKER, marker.getId());
+    public JSONObject release(@RequestParam Integer[] ids) {
+        for (Integer id : ids) {
+            Marker marker = markerService.findById(id);
+            if (marker != null) {
+                try {
+                    lockService.waitlock(LockType.MARKER, marker.getId());
+                    markService.releaseByMarker(marker);
+                } catch (Exception e) {
+                    log.error("release marker error", e);
+                } finally {
+                    lockService.unlock(LockType.MARKER, marker.getId());
+                }
             }
-            result.accumulate("success", true);
-        } else {
-            result.accumulate("success", false);
-            result.accumulate("message", "评卷员不存在");
         }
+        JSONObject result = new JSONObject();
+        result.accumulate("success", true);
         return result;
     }
 
@@ -247,17 +246,16 @@ public class MarkerController extends BaseExamController {
     @RequestMapping(value = "/toggle", method = RequestMethod.POST)
     @ResponseBody
     @RoleRequire(Role.SCHOOL_ADMIN)
-    public JSONObject toggle(@RequestParam Integer id, @RequestParam Boolean enable) {
-        Marker marker = markerService.findById(id);
-        JSONObject obj = new JSONObject();
-        if (marker != null) {
-            marker.setEnable(enable);
-            markerService.save(marker);
-            obj.accumulate("success", true);
-        } else {
-            obj.accumulate("success", false);
-            obj.accumulate("message", "该评卷员不存在");
+    public JSONObject toggle(@RequestParam Integer[] ids, @RequestParam Boolean enable) {
+        for (Integer id : ids) {
+            Marker marker = markerService.findById(id);
+            if (marker != null) {
+                marker.setEnable(enable);
+                markerService.save(marker);
+            }
         }
+        JSONObject obj = new JSONObject();
+        obj.accumulate("success", true);
         return obj;
     }
 
@@ -308,36 +306,35 @@ public class MarkerController extends BaseExamController {
     @Logging(menu = "评卷员重置密码", type = LogType.UPDATE)
     @RequestMapping(value = "/reSetPassword", method = RequestMethod.POST)
     @ResponseBody
-    public JSONObject reSetPassword(@RequestParam Integer id, @RequestParam String password) {
-        Marker marker = markerService.findById(id);
-        User user = userService.findById(marker.getUserId());
-        JSONObject obj = new JSONObject();
-        if (user != null) {
+    public JSONObject reSetPassword(@RequestParam Integer[] ids, @RequestParam String password) {
+        for (Integer id : ids) {
+            Marker marker = markerService.findById(id);
+            User user = userService.findById(marker.getUserId());
+            if (user == null) {
+                continue;
+            }
             password = StringEscapeUtils.unescapeHtml(password);
             user.setPassword(EncryptUtils.md5(password));
             user = userService.save(user);
-            obj.accumulate("success", true);
-        } else {
-            obj.accumulate("success", false);
-            obj.accumulate("message", "该评卷员不存在");
         }
+        JSONObject obj = new JSONObject();
+        obj.accumulate("success", true);
         return obj;
     }
 
     @Logging(menu = "评卷员设置任务数量", type = LogType.UPDATE)
     @RequestMapping(value = "/setTaskCount", method = RequestMethod.POST)
     @ResponseBody
-    public JSONObject setTaskCount(@RequestParam Integer id, @RequestParam Integer taskCount) {
-        Marker marker = markerService.findById(id);
-        JSONObject obj = new JSONObject();
-        if (marker != null) {
-            marker.setTopCount(taskCount);
-            marker = markerService.save(marker);
-            obj.accumulate("success", true);
-        } else {
-            obj.accumulate("success", false);
-            obj.accumulate("message", "该评卷员不存在");
+    public JSONObject setTaskCount(@RequestParam Integer[] ids, @RequestParam Integer taskCount) {
+        for (Integer id : ids) {
+            Marker marker = markerService.findById(id);
+            if (marker != null) {
+                marker.setTopCount(taskCount);
+                marker = markerService.save(marker);
+            }
         }
+        JSONObject obj = new JSONObject();
+        obj.accumulate("success", true);
         return obj;
     }
 

+ 14 - 0
stmms-web/src/main/java/cn/com/qmth/stmms/admin/exam/PaperController.java

@@ -542,4 +542,18 @@ public class PaperController extends BaseExamController {
         }
         return array;
     }
+
+    @Logging(menu = "删除题目", type = LogType.DELETE)
+    @RequestMapping("/question/delete")
+    @RoleRequire({ Role.SCHOOL_ADMIN, Role.SUBJECT_HEADER })
+    public String delete(HttpServletRequest request, Model model, RedirectAttributes redirectAttributes,
+            @RequestParam Integer[] ids) {
+        String subjectCode = "";
+        for (Integer id : ids) {
+            ExamQuestion question = questionService.findById(id);
+            subjectCode = question.getSubjectCode();
+            markService.deleteByQuestion(question);
+        }
+        return "redirect:/admin/exam/paper/detail?subjectCode=" + subjectCode;
+    }
 }

+ 38 - 0
stmms-web/src/main/java/cn/com/qmth/stmms/admin/user/UserController.java

@@ -2,11 +2,14 @@ package cn.com.qmth.stmms.admin.user;
 
 import java.util.Date;
 import java.util.HashSet;
+import java.util.List;
 import java.util.Set;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
+import net.sf.json.JSONObject;
+
 import org.apache.commons.lang.StringEscapeUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -15,6 +18,7 @@ import org.springframework.ui.Model;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.ResponseBody;
 import org.springframework.web.servlet.ModelAndView;
 import org.springframework.web.servlet.mvc.support.RedirectAttributes;
 
@@ -200,4 +204,38 @@ public class UserController extends BaseExamController {
         }
         return "redirect:/admin/exam/student";
     }
+
+    @Logging(menu = "用户启用/禁用", type = LogType.UPDATE)
+    @RequestMapping("/toggle")
+    @RoleRequire({ Role.SCHOOL_ADMIN, Role.SUBJECT_HEADER })
+    public String toggle(HttpServletRequest request, Model model, RedirectAttributes redirectAttributes,
+            @RequestParam Integer[] ids, @RequestParam Boolean enable) {
+        for (Integer id : ids) {
+            User user = userService.findById(id);
+            if (user == null) {
+                continue;
+            }
+            user.setEnable(enable);
+            userService.save(user);
+        }
+        return "redirect:/admin/user/list";
+    }
+
+    @Logging(menu = "用户重置密码", type = LogType.UPDATE)
+    @RequestMapping(value = "/resetPassword", method = RequestMethod.POST)
+    @ResponseBody
+    public JSONObject reSetPassword(@RequestParam Integer[] ids, @RequestParam String password) {
+        for (Integer id : ids) {
+            User user = userService.findById(id);
+            if (user == null) {
+                continue;
+            }
+            password = StringEscapeUtils.unescapeHtml(password);
+            user.setPassword(EncryptUtils.md5(password));
+            user = userService.save(user);
+        }
+        JSONObject obj = new JSONObject();
+        obj.accumulate("success", true);
+        return obj;
+    }
 }

+ 36 - 3
stmms-web/src/main/webapp/WEB-INF/views/modules/exam/markInfo.jsp

@@ -43,6 +43,8 @@
 			&nbsp;
 			<input id="btnSubmit" class="btn btn-primary" type="button" value="查询" onclick="goSearch()"/>
 			&nbsp;
+            <input id="btnFinish" class="btn" type="button" value="关闭" onclick="goFinish()"/>
+			&nbsp;
 			<div class="btn-group">
 				<a class="btn dropdown-toggle" data-toggle="dropdown" href="#">
 					导出<span class="caret"></span>
@@ -55,10 +57,11 @@
 		</div>
 	</form>
 	<tags:message content="${message}"/>
+	<form id="checkForm" action="${ctx}/admin/exam/mark/finish" method="post" class="breadcrumb form-search">
 	<table id="contentTable" class="table table-striped table-bordered table-condensed">
 		<thead>
 			<tr>
-				<th>科目</th>
+				<th><input type="checkbox" id="codes">科目</th>
 				<th>上传人数</th>
 				<th>主观总分</th>
 				<th>分组总数</th>
@@ -69,7 +72,8 @@
 		<tbody>
 		<c:forEach items="${resultList}" var="result">
 			<tr>
-				<td>${result.subject.code}-${result.subject.name}&nbsp;${result.subject.remark}
+				<td><input type="checkbox" class="codes" name="codes" value="${result.subject.code}">
+				${result.subject.code}-${result.subject.name}&nbsp;${result.subject.remark}
 				<c:if test="${!result.groupFinish}"><i class="icon-info-sign" title="主观分未完成分组"></i></c:if>
 				</td>
 				<td>${result.subject.uploadCount}</td>
@@ -85,6 +89,7 @@
 		</c:forEach>
 		</tbody>
 	</table>
+	</form>
 	<div class="pagination">${query}</div>
 <script type="text/javascript">
 function page(n,s){
@@ -177,7 +182,35 @@ myChart.setOption({
         color:["#7CB5EC",'#FE8463']
     }]
 })
-
+	$("#codes").change(function () {
+        if ($("#codes").is(':checked')) {
+            $(".codes").attr("checked", true);
+        } else {
+        	$(".codes").attr("checked", false);
+        }
+    });
+    
+    $(".codes").change(function () {
+    	var all = true;
+    	$("input[name='codes']").each(function(){
+    		if(!$(this).is(':checked')){
+    			all = false;
+    		}
+    	})
+		 $("#codes").attr("checked", all);
+    });
+    function goFinish() {
+    	var check_list = []
+    	$("input[name='codes']:checked").each(function(){
+    		check_list.push($(this).val())
+    	})
+        if(check_list.length==0) {
+            alert('请选择');
+            return false;
+        }
+        $("#checkForm").submit();
+        return false;
+    }
 </script>	
 </body>
 </html>

+ 172 - 37
stmms-web/src/main/webapp/WEB-INF/views/modules/exam/markerList.jsp

@@ -142,16 +142,26 @@
 		&nbsp;<input id="btnImport" class="btn" type="button" value="导入"/>
 		&nbsp;<a href="###" class="btn hide" id="save-button"">绑定评卷员</a>
         <!--     <input id="btnExport" class="btn" type="button" value="导出"/> -->
+        &nbsp;
+		<input id="btnEnable" class="btn" type="button" value="启用" onclick="goEnable(true)"/>
+		&nbsp;
+		<input id="btnEnable" class="btn" type="button" value="禁用" onclick="goEnable(false)"/>
+		&nbsp;
+		<input id="btnRelease" class="btn" type="button" value="回收" onclick="goRelease()"/>
+		&nbsp;
+		<input id="btnTaskCount" class="btn" type="button" value="设置评卷数" onclick="goTaskCount()"/>
+		&nbsp;
+		<input id="btnResetPassword" class="btn" type="button" value="重置密码" onclick="goResetPassword()"/>
     </div>
 </form>
 <tags:message content="${message}"/>
 <table id="contentTable" class="table table-striped table-bordered table-condensed">
     <thead>
     <tr>
+        <th><input type="checkbox" id="ids">登录名</th>
+        <th>姓名</th>
         <th>科目</th>
         <th>分组</th>
-        <th>登录名</th>
-        <th>姓名</th>
         <th>状态</th>
         <th>已评数量</th>
         <th>正在评卷</th>
@@ -163,6 +173,8 @@
     <tbody>
     <c:forEach items="${query.result}" var="marker">
         <tr>
+            <td><input type="checkbox" class="ids" name="ids" value="${marker.id}">${marker.user.loginName}</td>
+            <td>${marker.user.name}</td>
             <td>
                 <c:if test="${marker.subject!=null}">
                     ${marker.subject.code}-${marker.subject.name}
@@ -173,8 +185,6 @@
                     ${marker.group.number}-${marker.group.title}
                 </c:if>
             </td>
-            <td>${marker.user.loginName}</td>
-            <td>${marker.user.name}</td>
             <td>${marker.enable eq true ? "启用" : "禁用"}</td>
             <td>${marker.markedCount}</td>
             <td>${marker.currentCount}</td>
@@ -224,7 +234,7 @@
 <script type="text/javascript">
     var searchSubjectCode = '${query.subjectCode}';
     var searchGroupNumber = '${query.groupNumber}';
-    var markerId;
+    var check_list;
     $(document).ready(function () {
         $('#cover').hide();
     });
@@ -266,24 +276,40 @@
     $('.toggle-button').click(function () {
         var id = $(this).attr('data-id');
         var enable = $(this).attr('data-value');
-        $.post('${ctx}/admin/exam/marker/toggle', {id: id, enable: enable}, function (result) {
-            if (result.success == true) {
-                alert('修改成功');
-                $("#searchForm").submit();
-            } else {
-                alert(result.message);
-            }
+        var check_list =[];
+        check_list.push(id);
+        $.ajax({
+        	url:"${ctx}/admin/exam/marker/toggle",
+        	data:{ids: check_list, enable: enable},
+        	traditional:true,
+        	type:"post",
+        	success:function (result) {
+                if (result.success == true) {
+                    alert('修改成功');
+                    $("#searchForm").submit();
+                } else {
+                    alert(result.message);
+                }
+        	}
         });
     });
     $('.release-button').click(function () {
         var id = $(this).attr('data-id');
-        $.post('${ctx}/admin/exam/marker/release', {id: id}, function (result) {
-            if (result.success == true) {
-                alert('回收成功');
-                $("#searchForm").submit();
-            } else {
-                alert(result.message);
-            }
+        var check_list =[];
+        check_list.push(id);
+        $.ajax({
+        	url:"${ctx}/admin/exam/marker/release",
+        	data:{ids: check_list},
+        	traditional:true,
+        	type:"post",
+        	success:function (result) {
+                if (result.success == true) {
+                    alert('回收成功');
+                    $("#searchForm").submit();
+                } else {
+                    alert(result.message);
+                }
+        	}
         });
     });
     $('#subject-select').change(function () {
@@ -329,7 +355,8 @@
         $('.task-count').val('');
         $('.taskWindow').show();
         $('#cover').show();
-        markerId = obj;
+        check_list =[];
+        check_list.push(obj);
     }
 
     function reSetPassword(obj) {
@@ -337,7 +364,8 @@
         $('.password-value').val('');
         $('.reSetPasswordWin').show();
         $('#cover').show();
-        markerId = obj;
+        check_list =[];
+        check_list.push(obj);
     }
 
     $('.image-close').click(function () {
@@ -348,7 +376,21 @@
         $('.reSetPasswordWin').hide();
         $('#cover').hide();
     });
-
+    function goTaskCount() {
+    	check_list = [];
+    	$("input[name='ids']:checked").each(function(){
+    		check_list.push($(this).val())
+    	})
+        if(check_list.length==0) {
+            alert('请选择');
+            return false;
+        }
+        $('.wrong').html('');
+        $('.task-count').val('');
+        $('.taskWindow').show();
+        $('#cover').show();
+        return false;
+    }
     $('.task-btn').click(function () {
         var taskCount = $('.task-count').val();
         var wrongMessage = $('.wrong');
@@ -366,15 +408,37 @@
                 return false;
             }
         }
-        $.post('${ctx}/admin/exam/marker/setTaskCount', {id: markerId, taskCount: taskCount}, function (result) {
-            if (result.success == true) {
-                $("#searchForm").submit();
-            } else {
-                alert(result.message);
-            }
-            $('.taskWindow').hide();
+        $.ajax({
+        	url:"${ctx}/admin/exam/marker/setTaskCount",
+        	data:{ids: check_list, taskCount: taskCount},
+        	traditional:true,
+        	type:"post",
+        	success:function (result) {
+                if (result.success == true) {
+                    alert('设置成功');
+                    $("#searchForm").submit();
+                } else {
+                    alert(result.message);
+                }
+	            $('.taskWindow').hide();
+        	}
         });
     });
+    function goResetPassword() {
+    	check_list = [];
+    	$("input[name='ids']:checked").each(function(){
+    		check_list.push($(this).val())
+    	})
+        if(check_list.length==0) {
+            alert('请选择');
+            return false;
+        }
+    	$('.passwordWrong').html('');
+        $('.password-value').val('');
+        $('.reSetPasswordWin').show();
+        $('#cover').show();
+        return false;
+    }
     $('.password-btn').click(function () {
         var password = $('.password-value').val();
         var wrongMessage = $('.passwordWrong');
@@ -386,14 +450,20 @@
             wrongMessage.html('密码至少4位!');
             return false;
         }
-        $.post('${ctx}/admin/exam/marker/reSetPassword', {id: markerId, password: password}, function (result) {
-            if (result.success == true) {
-                alert('修改成功');
-                $("#searchForm").submit();
-            } else {
-                alert(result.message);
-            }
-            $('.reSetPasswordWin').hide();
+        $.ajax({
+        	url:"${ctx}/admin/exam/marker/reSetPassword",
+        	data:{ids: check_list, password: password},
+        	traditional:true,
+        	type:"post",
+        	success:function (result) {
+                if (result.success == true) {
+                    alert('修改成功');
+                    $("#searchForm").submit();
+                } else {
+                    alert(result.message);
+                }
+                $('.reSetPasswordWin').hide();
+        	}
         });
     });
     $('#save-button').click(function () {
@@ -414,6 +484,71 @@
     		 $('#save-button').show();
     	 }
     });
+    $("#ids").change(function () {
+        if ($("#ids").is(':checked')) {
+            $(".ids").attr("checked", true);
+        } else {
+        	$(".ids").attr("checked", false);
+        }
+    });
+    
+    $(".ids").change(function () {
+    	var all = true;
+    	$("input[name='ids']").each(function(){
+    		if(!$(this).is(':checked')){
+    			all = false;
+    		}
+    	})
+		 $("#ids").attr("checked", all);
+    });
+    function goEnable(enable) {
+    	var check_list = []
+    	$("input[name='ids']:checked").each(function(){
+    		check_list.push($(this).val())
+    	})
+        if(check_list.length==0) {
+            alert('请选择');
+            return false;
+        }
+        $.ajax({
+        	url:"${ctx}/admin/exam/marker/toggle",
+        	data:{ids: check_list, enable: enable},
+        	traditional:true,
+        	type:"post",
+        	success:function (result) {
+                if (result.success == true) {
+                    alert('修改成功');
+                    $("#searchForm").submit();
+                } else {
+                    alert(result.message);
+                }
+        	}
+        });
+    }
+    function goRelease() {
+    	var check_list = []
+    	$("input[name='ids']:checked").each(function(){
+    		check_list.push($(this).val())
+    	})
+        if(check_list.length==0) {
+            alert('请选择');
+            return false;
+        }
+        $.ajax({
+        	url:"${ctx}/admin/exam/marker/release",
+        	data:{ids: check_list},
+        	traditional:true,
+        	type:"post",
+        	success:function (result) {
+                if (result.success == true) {
+                    alert('回收成功');
+                    $("#searchForm").submit();
+                } else {
+                    alert(result.message);
+                }
+        	}
+        });
+    }
 </script>
 
 </body>

+ 38 - 2
stmms-web/src/main/webapp/WEB-INF/views/modules/exam/paperDetail.jsp

@@ -23,14 +23,17 @@
 				<option value="false" <c:if test="${objective!=null && objective==false}">selected</c:if>>主观题</option>
 			</select>
 			&nbsp;		
+			<input id="btnDelete" class="btn" type="button" value="删除" onclick="goDelete()"/>
+			&nbsp;		
 			<a class="btn" href="javascript:" onclick="history.go(-1);" >返回</a>
 		</div>
 	</form>
+	<form id="checkForm" action="${ctx}/admin/exam/paper/question/delete" method="post" class="breadcrumb form-search">
 	<tags:message content="${message}"/>
 	<table id="contentTable" class="table table-striped table-bordered table-condensed">
 		<thead>
 			<tr>
-			    <th>试卷类型</th>
+			    <th><input type="checkbox" id="ids">试卷类型</th>
 				<th>大题名称</th>
 				<th>大题号</th>
 				<th>小题号</th>
@@ -45,7 +48,10 @@
 		<tbody>
 		<c:forEach items="${questionList}" var="question">
 			<tr>
-			    <td>${question.paperType}</td>
+			    <td><c:if test="${question.groupNumber==null ||question.groupNumber==0}">
+			    		<input type="checkbox" class="ids" name="ids" value="${question.id}">
+			    	</c:if>${question.paperType}
+			    </td>
 				<td>${question.mainTitle}</td>
 				<td>${question.mainNumber}</td>
 				<td>${question.subNumber}</td>
@@ -68,6 +74,7 @@
 		</c:forEach>
 		</tbody>
 	</table>
+	</form>
 <script type="text/javascript">
 $('#type-select').change(function(){
 	$('#searchForm').submit();
@@ -75,6 +82,35 @@ $('#type-select').change(function(){
 $('.delete-button').click(function () {
     return confirm('确定要删除吗?');
 });
+$("#ids").change(function () {
+    if ($("#ids").is(':checked')) {
+        $(".ids").attr("checked", true);
+    } else {
+    	$(".ids").attr("checked", false);
+    }
+});
+
+$(".ids").change(function () {
+	var all = true;
+	$("input[name='ids']").each(function(){
+		if(!$(this).is(':checked')){
+			all = false;
+		}
+	})
+	 $("#ids").attr("checked", all);
+});
+function goDelete() {
+	var check_list = []
+	$("input[name='ids']:checked").each(function(){
+		check_list.push($(this).val())
+	})
+    if(check_list.length==0) {
+        alert('请选择');
+        return false;
+    }
+    $("#checkForm").submit();
+    return false;
+}
 </script>	
 </body>
 </html>

+ 187 - 2
stmms-web/src/main/webapp/WEB-INF/views/modules/user/userList.jsp

@@ -93,14 +93,22 @@
             <input id="btnImportClass" class="btn" type="button" value="导入评卷员班级"/>
             &nbsp;
             <input id="export-button" class="btn" type="button" value="导出"/>
+            &nbsp;
+            <input id="btnEnable" class="btn" type="button" value="启用" onclick="goEnable(true)"/>
+            &nbsp;
+            <input id="btnEnable" class="btn" type="button" value="禁用" onclick="goEnable(false)"/>
+            &nbsp;
+            <input id="btnReset" class="btn" type="button" value="重置密码" onclick="goReset()"/>
         </c:if>
     </div>
 </form>
 <tags:message content="${message}"/>
+<form id="checkForm" action="${ctx}/admin/user/toggle" method="post" class="breadcrumb form-search">
+<input type="hidden" id="enable" name="enable" value=""/>
 <table id="contentTable" class="table table-striped table-bordered table-condensed">
     <thead>
     <tr>
-        <th>登录名</th>
+        <th><input type="checkbox" id="ids">登录名</th>
         <th>名称</th>
         <th>来源</th>
         <th>角色</th>
@@ -112,7 +120,7 @@
     <tbody>
     <c:forEach items="${query.result}" var="user">
         <tr>
-            <td>${user.loginName}</td>
+            <td><input type="checkbox" class="ids" name="ids" value="${user.id}">${user.loginName}</td>
             <td>${user.name}</td>
             <td>${user.source.name}</td>
             <td>${user.role.name}</td>
@@ -128,13 +136,104 @@
             <td>
                 <c:if test="${web_user.schoolAdmin==true && user.source.value==1}">
                     <a href="${ctx}/admin/user/edit?id=${user.id}">修改</a>
+                    <a href="javascript:void(0)" class="reSetPassword-button" data-id="${user.id}"
+                       onclick="reSetPassword('${user.id}');">重置密码</a>
                 </c:if>
             </td>
         </tr>
     </c:forEach>
     </tbody>
 </table>
+<div class="reSetPasswordWin" style="display:none">
+    <div class="password-header">
+        <p class="title">重置密码</p>
+        <p class="image-close password-close"><img src="${ctxStatic}/mark-new/images/images-close.png"/></p></div>
+    <div class="password-content"><input type="text" class="password-value" placeholder="请输入新的密码"/><i class="passwordWrong"></i></div>
+    <a href="#" class="btn btn-small btn-info password-btn">确定</a>
+</div>
+</form>
 <div class="pagination">${query}</div>
+<style type="text/css">
+        .sort {
+            color: #0663A2;
+            cursor: pointer;
+        }
+        
+        .taskWindow, .reSetPasswordWin {
+            width: 400px;
+            min-height: 150px;
+            background: #fff;
+            font-family: "微软雅黑", Fixedsys;
+            border: #5d6d7d solid 1px;
+            position: absolute;
+            left: 50%;
+            top: 50%;
+            margin: -150px 0 0 -200px;
+            text-align: center;
+            z-index: 99999;
+        }
+        
+        .task-header, .password-header {
+            width: 100%;
+            height: 46px;
+            background: #5d6d7d;
+            color: #fff;
+        }
+        
+        .task-content, .password-content {
+            font-size: 18px;
+            color: #005277;
+            text-align: left;
+            padding: 15px;
+            line-height: 30px;
+            word-wrap: break-word;
+        }
+        
+        .image-close {
+            margin-top: 15px;
+            margin-right: 15px;
+            cursor: pointer;
+            float: right;
+        }
+        
+        .title {
+            font-size: 22px;
+            font-weight: bold;
+            color: #fff;
+            margin: 0px;
+            padding: 13px 0 0 13px;
+            float: left;
+        }
+
+        .task-count, .password-value {
+            width: 150px;
+        }
+
+        .btn-info {
+            height: 25px;
+            margin-left: 320px;
+            margin-bottom: 20px;
+        }
+        
+        .wrong, .passwordWrong {
+            font-size: 12px;
+            color: #f00;
+            line-height: 30px;
+            padding-left: 20px;
+        }
+        
+        #cover {
+            position: fixed;
+            z-index: 9999;
+            top: 0px;
+            left: 0px;
+            display: none;
+            width: 100%;
+            height: 100%;
+            opacity: 0.5;
+            background: #000 none repeat scroll 0% 0%;
+        }
+    </style>
 <script type="text/javascript">
     function page(n, s) {
         $("#pageNumber").val(n);
@@ -167,6 +266,92 @@
         $("#searchForm").attr("action", "${ctx}/admin/user/export");
         $("#searchForm").submit();
     });
+    $("#ids").change(function () {
+        if ($("#ids").is(':checked')) {
+            $(".ids").attr("checked", true);
+        } else {
+        	$(".ids").attr("checked", false);
+        }
+    });
+    
+    $(".ids").change(function () {
+    	var all = true;
+    	$("input[name='ids']").each(function(){
+    		if(!$(this).is(':checked')){
+    			all = false;
+    		}
+    	})
+		 $("#ids").attr("checked", all);
+    });
+    function goEnable(enable) {
+    	var check_list = []
+    	$("input[name='ids']:checked").each(function(){
+    		check_list.push($(this).val())
+    	})
+        if(check_list.length==0) {
+            alert('请选择');
+            return false;
+        }
+    	$("#enable").attr("value", enable);
+        $("#checkForm").submit();
+        return false;
+    }
+    
+    var check_list;
+    function reSetPassword(obj) {
+        $('.passwordWrong').html('');
+        $('.password-value').val('');
+        $('.reSetPasswordWin').show();
+        $('#cover').show();
+        check_list = [];
+        check_list.push(obj);
+    }
+    $('.password-close').click(function () {
+        $('.reSetPasswordWin').hide();
+        $('#cover').hide();
+    });
+    $('.password-btn').click(function () {
+        var password = $('.password-value').val();
+        var wrongMessage = $('.passwordWrong');
+        password = password.replace(/(^\s*)|(\s*$)/g, "");
+        if (password.length == 0) {
+            wrongMessage.html('密码不能为空!');
+            return false;
+        } else if (password.length < 4) {
+            wrongMessage.html('密码至少4位!');
+            return false;
+        }
+        $.ajax({
+        	url:"${ctx}/admin/user/resetPassword",
+        	data:{ids: check_list, password: password},
+        	traditional:true,
+        	type:"post",
+        	success:function (result) {
+                if (result.success == true) {
+                    alert('修改成功');
+                    $("#searchForm").submit();
+                } else {
+                    alert(result.message);
+                }
+                $('.reSetPasswordWin').hide();
+        	}
+        });
+    });
+    function goReset() {
+    	check_list = [];
+    	$("input[name='ids']:checked").each(function(){
+    		check_list.push($(this).val())
+    	})
+        if(check_list.length==0) {
+            alert('请选择');
+            return false;
+        }
+    	$('.passwordWrong').html('');
+        $('.password-value').val('');
+        $('.reSetPasswordWin').show();
+        $('#cover').show();
+        return false;
+    }
 </script>
 </body>
 </html>

+ 5 - 5
stmms-web/src/main/webapp/sql/stmms_ft.sql

@@ -502,7 +502,7 @@ CREATE TABLE `m_arbitrate_history`
     `status`        varchar(16) NOT NULL COMMENT '状态',
     `user_id`       int(11)      DEFAULT NULL COMMENT '处理人ID',
     `total_score`   double       DEFAULT NULL COMMENT '总分',
-    `score_list`    varchar(255) DEFAULT NULL COMMENT '给分明细',
+    `score_list`    text		 DEFAULT NULL COMMENT '给分明细',
     `create_time`   datetime    NOT NULL COMMENT '创建时间',
     `update_time`   datetime     DEFAULT NULL COMMENT '处理时间',
     PRIMARY KEY (`id`),
@@ -532,12 +532,12 @@ CREATE TABLE `m_library`
     `marker_id`         int(11)      DEFAULT NULL COMMENT '评卷员ID',
     `marker_time`       datetime     DEFAULT NULL COMMENT '评卷时间',
     `marker_score`      double       DEFAULT NULL COMMENT '评卷总分',
-    `marker_score_list` varchar(255) DEFAULT NULL COMMENT '评卷给分明细',
+    `marker_score_list` text		 DEFAULT NULL COMMENT '评卷给分明细',
     `marker_spent`      int(11)      DEFAULT NULL COMMENT '评卷时长',
     `header_id`         int(11)      DEFAULT NULL COMMENT '科组长ID',
     `header_time`       datetime     DEFAULT NULL COMMENT '科组长评卷时间',
     `header_score`      double       DEFAULT NULL COMMENT '科组长总分',
-    `header_score_list` varchar(255) DEFAULT NULL COMMENT '科组长给分明细',
+    `header_score_list` text		 DEFAULT NULL COMMENT '科组长给分明细',
     PRIMARY KEY (`id`),
     KEY `index1` (`exam_id`, `subject_code`, `group_number`, `status`),
     UNIQUE KEY `index2` (`student_id`, `group_number`, `task_number`),
@@ -631,7 +631,7 @@ CREATE TABLE `m_problem_history`
     `status`        varchar(16)  DEFAULT NULL COMMENT '状态',
     `user_id`       int(11)      DEFAULT NULL COMMENT '处理人ID',
     `total_score`   double       DEFAULT NULL COMMENT '总分',
-    `score_list`    varchar(255) DEFAULT NULL COMMENT '给分明细',
+    `score_list`    text		 DEFAULT NULL COMMENT '给分明细',
     `create_time`   datetime    NOT NULL COMMENT '创建时间',
     `update_time`   datetime     DEFAULT NULL COMMENT '处理时间',
     PRIMARY KEY (`id`),
@@ -658,7 +658,7 @@ CREATE TABLE `m_trial_library`
 	`marker_id`         int(11)      DEFAULT NULL COMMENT '评卷员ID',
     `marker_time`       datetime     DEFAULT NULL COMMENT '评卷时间',
     `marker_score`      double       DEFAULT NULL COMMENT '评卷总分',
-    `marker_score_list` varchar(255) DEFAULT NULL COMMENT '评卷给分明细',
+    `marker_score_list` text		 DEFAULT NULL COMMENT '评卷给分明细',
     PRIMARY KEY (`id`),
     KEY `index1` (`exam_id`, `subject_code`, `group_number`),
     UNIQUE KEY `index2` (`student_id`, `group_number`)