Procházet zdrojové kódy

fix,全卷复核选做题查询bug

xiatian před 1 rokem
rodič
revize
c541ccc1b3

+ 3 - 2
install/mysql/init/stmms_ft.sql

@@ -543,8 +543,9 @@ CREATE TABLE `eb_selective_student`
     `student_id`          int(11) 	  NOT NULL COMMENT '考生ID',
     `exam_id`             int(11)     NOT NULL COMMENT '考试ID',
     `subject_code`        varchar(32) NOT NULL COMMENT '科目代码',
-	`muti_selective`		  tinyint (1) NOT NULL COMMENT '是否多选做',
-	`less_selective`		  tinyint (1) NOT NULL COMMENT '是否少选做',
+	`muti_selective`		  tinyint(1) NOT NULL COMMENT '是否多选做',
+	`less_selective`		  tinyint(1) NOT NULL COMMENT '是否少选做',
+	`not_selective`		  tinyint(1) NOT NULL COMMENT '是否未选做',
     PRIMARY KEY (`student_id`)
 ) ENGINE = InnoDB
   DEFAULT CHARSET = utf8mb4 COMMENT ='选做题考生状态表';

+ 1 - 0
install/mysql/upgrade/1.3.15.sql

@@ -6,3 +6,4 @@ ALTER TABLE m_reject_history ADD INDEX index2(`library_id`);
 ALTER TABLE eb_inspect_history MODIFY column inspector_id INT (11) NOT NULL COMMENT '复核人ID';
 ALTER TABLE eb_inspect_history MODIFY column  student_id INT (11) NOT NULL COMMENT '考生ID';
 ALTER TABLE eb_selective_group MODIFY column score_policy	varchar(64) NOT NULL COMMENT '合分方式';
+ALTER TABLE eb_selective_student ADD COLUMN `not_selective`	tinyint(1) NOT NULL COMMENT '是否未选做';

+ 11 - 1
stmms-biz/src/main/java/cn/com/qmth/stmms/biz/exam/model/SelectiveStudent.java

@@ -40,7 +40,9 @@ public class SelectiveStudent implements Serializable {
 
     @Column(name = "less_selective", nullable = false)
     private Boolean lessSelective;
-
+    @Column(name = "not_selective", nullable = false)
+    private Boolean notSelective;
+    
     public Integer getStudentId() {
         return studentId;
     }
@@ -81,4 +83,12 @@ public class SelectiveStudent implements Serializable {
         this.lessSelective = lessSelective;
     }
 
+	public Boolean getNotSelective() {
+		return notSelective;
+	}
+
+	public void setNotSelective(Boolean notSelective) {
+		this.notSelective = notSelective;
+	}
+
 }

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

@@ -173,10 +173,11 @@ public class InspectedServiceImpl extends BaseQueryService<ExamStudent> implemen
         // +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");
+//            whereSql.append(" and 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");
+            whereSql.append(" and exists (select ss.student_id from eb_selective_student ss where ss.student_id = s.id and ss.not_selective=1)");
         }
         // 选做题多选做
         // if (selectiveStatus != null &&

+ 7 - 2
stmms-biz/src/main/java/cn/com/qmth/stmms/biz/mark/service/Impl/MarkServiceImpl.java

@@ -1040,6 +1040,7 @@ public class MarkServiceImpl implements MarkService {
         BigDecimal totalScore = BigDecimal.ZERO;
         boolean lessSelective = false;
         boolean mutiSelective = false;
+        boolean notSelective = false;
         Map<Integer, List<SelectiveGroup>> indexMap = selectiveGroupService.findGroupByExamIdAndSubjectCode(examId,
                 subjectCode);
         for (Integer index : indexMap.keySet()) {
@@ -1120,12 +1121,15 @@ public class MarkServiceImpl implements MarkService {
                     }
                 }
             }
-            if (partScoreList.size() < selectiveCount) {
+            if (partScoreList.size()>0&&partScoreList.size() < selectiveCount) {
                 lessSelective = true;
             }
-            if (partScoreList.size() > selectiveCount) {
+            if (partScoreList.size()>0&&partScoreList.size() > selectiveCount) {
                 mutiSelective = true;
             }
+            if(partScoreList.size()==0) {
+            	notSelective = true;
+            }
         }
         // 统一更新得分详情
         for (Integer mainNumber : mainScoreMap.keySet()) {
@@ -1141,6 +1145,7 @@ public class MarkServiceImpl implements MarkService {
         selectiveStudent.setStudentId(studentId);
         selectiveStudent.setLessSelective(lessSelective);
         selectiveStudent.setMutiSelective(mutiSelective);
+        selectiveStudent.setNotSelective(notSelective);
         selectiveStudentDao.saveAndFlush(selectiveStudent);
         // 计算非选做题总分
         for (Integer mainNumber : scoreMap.keySet()) {