xiatian hai 1 ano
pai
achega
6e4b1e6449

+ 26 - 27
stmms-biz/src/main/java/cn/com/qmth/stmms/biz/exam/service/impl/InspectedServiceImpl.java

@@ -23,16 +23,12 @@ import cn.com.qmth.stmms.biz.exam.bean.ExamStudentVo;
 import cn.com.qmth.stmms.biz.exam.model.ExamStudent;
 import cn.com.qmth.stmms.biz.exam.model.ExamSubject;
 import cn.com.qmth.stmms.biz.exam.model.InspectHistory;
-import cn.com.qmth.stmms.biz.exam.model.MarkGroup;
-import cn.com.qmth.stmms.biz.exam.model.SelectiveGroup;
 import cn.com.qmth.stmms.biz.exam.query.ExamStudentSearchQuery;
 import cn.com.qmth.stmms.biz.exam.query.InspectQuery;
 import cn.com.qmth.stmms.biz.exam.service.ExamStudentService;
 import cn.com.qmth.stmms.biz.exam.service.ExamSubjectService;
 import cn.com.qmth.stmms.biz.exam.service.InspectHistoryService;
 import cn.com.qmth.stmms.biz.exam.service.InspectedService;
-import cn.com.qmth.stmms.biz.exam.service.MarkGroupService;
-import cn.com.qmth.stmms.biz.exam.service.SelectiveGroupService;
 import cn.com.qmth.stmms.biz.utils.TaskLock;
 import cn.com.qmth.stmms.biz.utils.TaskLockUtil;
 import cn.com.qmth.stmms.common.enums.SelectiveStatus;
@@ -50,12 +46,6 @@ public class InspectedServiceImpl extends BaseQueryService<ExamStudent> implemen
     @Autowired
     private ExamSubjectService examSubjectService;
 
-    @Autowired
-    private MarkGroupService groupService;
-
-    @Autowired
-    private SelectiveGroupService selectiveGroupService;
-
     @Autowired
     private InspectHistoryService inspectHistoryService;
 
@@ -162,29 +152,38 @@ public class InspectedServiceImpl extends BaseQueryService<ExamStudent> implemen
             whereSql.append(" ) ");
         }
         // 全部选做题为未选做
-        List<MarkGroup> groups = groupService
-                .findByExamAndSubjectAndSelective(query.getExamId(), query.getSubjectCode(), true);
-        List<SelectiveGroup> selectiveGroups = selectiveGroupService
-                .findByExamIdAndSubjectCode(query.getExamId(), query.getSubjectCode());
-        if (selectiveStatus != null && SelectiveStatus.UN_SELECTIVE.equals(selectiveStatus) && !groups.isEmpty()
-                && !selectiveGroups.isEmpty()) {
-            List<Integer> groupNumbers = new ArrayList<Integer>();
-            for (int i = 0; i < groups.size(); i++) {
-                groupNumbers.add(groups.get(i).getNumber());
-            }
-            whereSql.append(
-            " and not exists (select e.student_id from eb_subjective_score e where e.student_id = s.id and e.group_number in ("
-            +StringUtils.join(groupNumbers,",")+") and e.group_score != -1 )");
+//        List<MarkGroup> groups = groupService
+//                .findByExamAndSubjectAndSelective(query.getExamId(), query.getSubjectCode(), true);
+//        List<SelectiveGroup> selectiveGroups = selectiveGroupService
+//                .findByExamIdAndSubjectCode(query.getExamId(), query.getSubjectCode());
+//        if (selectiveStatus != null && SelectiveStatus.UN_SELECTIVE.equals(selectiveStatus) && !groups.isEmpty()
+//                && !selectiveGroups.isEmpty()) {
+//            List<Integer> groupNumbers = new ArrayList<Integer>();
+//            for (int i = 0; i < groups.size(); i++) {
+//                groupNumbers.add(groups.get(i).getNumber());
+//            }
+//            whereSql.append(
+//            " and not exists (select e.student_id from eb_subjective_score e where e.student_id = s.id and e.group_number in ("
+//            +StringUtils.join(groupNumbers,",")+") and e.group_score != -1 )");
+//        }
+        if (SelectiveStatus.UN_SELECTIVE.equals(selectiveStatus)) {
+          whereSql.append(
+          " and not exists (select 1 from eb_subjective_score e left join eb_mark_group mg "
+          + " on e.exam_id=mg.exam_id and e.subject_code=mg.subject_code and e.group_number=mg.number"
+          + " where e.student_id = s.id  and e.group_score != -1 and mg.is_selective=1)"
+          +" and es.selective=1");
         }
         // 选做题多选做
-        if (selectiveStatus != null && SelectiveStatus.MUTI_SELECTIVE.equals(selectiveStatus) && !groups.isEmpty()
-                && !selectiveGroups.isEmpty()) {
+//        if (selectiveStatus != null && SelectiveStatus.MUTI_SELECTIVE.equals(selectiveStatus) && !groups.isEmpty()
+//                && !selectiveGroups.isEmpty()) {
+        if (SelectiveStatus.MUTI_SELECTIVE.equals(selectiveStatus)) {
             whereSql.append(
                     " and exists (select ss.student_id from eb_selective_student ss where ss.student_id = s.id and ss.muti_selective=1)");
         }
         // 选做题少选做
-        if (selectiveStatus != null && SelectiveStatus.LESS_SELECTIVE.equals(selectiveStatus) && !groups.isEmpty()
-                && !selectiveGroups.isEmpty()) {
+//        if (selectiveStatus != null && SelectiveStatus.LESS_SELECTIVE.equals(selectiveStatus) && !groups.isEmpty()
+//                && !selectiveGroups.isEmpty()) {
+        if (SelectiveStatus.LESS_SELECTIVE.equals(selectiveStatus)) {
             whereSql.append(
                     " and exists (select ss.student_id from eb_selective_student ss where ss.student_id = s.id and ss.less_selective=1) ");
         }

+ 7 - 7
stmms-web/src/main/webapp/WEB-INF/views/modules/basic/rolePrivilege.jsp

@@ -10,7 +10,7 @@
 		var tree, setting = {
 				check:{
 					enable:true,
-					chkboxType:{"Y":"p","N":"s"}
+					chkboxType:{"Y":"ps","N":"s"}
 				},
 				data: {
 		            simpleData: {
@@ -27,26 +27,26 @@
 				},
 				callback:{
 					onCheck:function(ev,id, node){
-						if('exam_mark'==node.code&&node.enable){
+						/* if('exam_mark'==node.code&&node.enable){
 							var node = tree.getNodeByParam("code", "exam_mark-mark");
 							tree.checkNode(node, true, true, true);
-						}
+						} */
 						if('exam_mark-mark'==node.code&&!node.enable){
 							var node = tree.getNodeByParam("code", "exam_mark");
 							tree.checkNode(node, false, true, true);
 						}
-						if('exam_reject_list'==node.code&&node.enable){
+						/* if('exam_reject_list'==node.code&&node.enable){
 							var node = tree.getNodeByParam("code", "exam_reject_list-paper");
 							tree.checkNode(node, true, true, true);
-						}
+						} */
 						if('exam_reject_list-paper'==node.code&&!node.enable){
 							var node = tree.getNodeByParam("code", "exam_reject_list");
 							tree.checkNode(node, false, true, true);
 						}
-						if('exam_inspected_info'==node.code&&node.enable){
+						/* if('exam_inspected_info'==node.code&&node.enable){
 							var node = tree.getNodeByParam("code", "exam_inspected_info-info");
 							tree.checkNode(node, true, true, true);
-						}
+						} */
 						if('exam_inspected_info-info'==node.code&&!node.enable){
 							var node = tree.getNodeByParam("code", "exam_inspected_info");
 							tree.checkNode(node, false, true, true);

+ 5 - 0
stmms-web/src/main/webapp/WEB-INF/views/modules/exam/groupList.jsp

@@ -86,7 +86,12 @@
             <td>${result.scoreList}</td>
             <td>${result.selectiveIndex}</td>
             <td>
+            <c:if test="${fn:contains(role_privilege_codes, 'exam_mark-marker')}">
                 <a href="${ctx}/admin/exam/marker?subjectCode=${result.subjectCode}&groupNumber=${result.number}">${result.markerCount}</a>
+            </c:if>
+            <c:if test="${!fn:contains(role_privilege_codes, 'exam_mark-marker')}">
+            ${result.markerCount}
+            </c:if>
             </td>
             <td>${result.libraryCount}</td>
             <td>${result.markedCount}</td>

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

@@ -92,8 +92,14 @@
 				<td>
 				    <fmt:formatNumber type="number" value="${result.subject.subjectiveScore}" pattern="###.###"/>
 				</td>
-				<td><a href="${ctx}/admin/exam/group?subjectCode=${result.subject.code}">
+				<td>
+				<c:if test="${fn:contains(role_privilege_codes, 'exam_mark-group')}">
+				<a href="${ctx}/admin/exam/group?subjectCode=${result.subject.code}">
 					${result.groupCount}</a>
+					</c:if>
+					<c:if test="${!fn:contains(role_privilege_codes, 'exam_mark-group')}">
+					${result.groupCount}
+					</c:if>
 				</td>
 				<td>${result.percent}</td>
 				<td>${result.markedCount}</td>

+ 1 - 1
stmms-web/src/main/webapp/WEB-INF/views/modules/exam/scoreList.jsp

@@ -72,7 +72,7 @@
         &nbsp;
         <input id="btnSubmit" class="btn btn-primary" type="button" value="查询" onclick="goSearch()"/>
         &nbsp;
-        <c:if test="${fn:contains(role_privilege_codes, 'exam_score-export') || forbiddenInfo==false}">
+        <c:if test="${fn:contains(role_privilege_codes, 'exam_score-export')}">
             <input id="export-button" class="btn" type="button" value="导出" onclick="goExport()"
                    <c:if test="${!enableExport}">disabled</c:if> title="${exportMessage}"/>
         </c:if>