Преглед изворни кода

修复因精度问题引起的成绩分析问题;评卷员管理优化没有选中分组就隐藏“绑定评卷员”功能

ting.yin пре 3 година
родитељ
комит
85ebfb068d

+ 16 - 12
stmms-biz/src/main/java/cn/com/qmth/stmms/biz/exam/dao/ExamStudentDao.java

@@ -1,15 +1,17 @@
 package cn.com.qmth.stmms.biz.exam.dao;
 
-import cn.com.qmth.stmms.biz.exam.model.ExamStudent;
-import cn.com.qmth.stmms.common.enums.SubjectiveStatus;
+import java.math.BigDecimal;
+import java.util.Date;
+import java.util.List;
+
 import org.springframework.data.domain.Pageable;
 import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
 import org.springframework.data.jpa.repository.Modifying;
 import org.springframework.data.jpa.repository.Query;
 import org.springframework.data.repository.PagingAndSortingRepository;
 
-import java.util.Date;
-import java.util.List;
+import cn.com.qmth.stmms.biz.exam.model.ExamStudent;
+import cn.com.qmth.stmms.common.enums.SubjectiveStatus;
 
 public interface ExamStudentDao extends PagingAndSortingRepository<ExamStudent, Integer>,
         JpaSpecificationExecutor<ExamStudent> {
@@ -170,18 +172,20 @@ public interface ExamStudentDao extends PagingAndSortingRepository<ExamStudent,
     @Query("select s.className from ExamStudent s where s.examId=?1 and s.subjectCode=?2 group by s.className")
     public List<String> findDistinctClassName(Integer examId, String subjectCode);
 
-    @Query(value = "select cast(s.objective_score as decimal(10,3))+cast(s.subjective_score as decimal(10,3)) from eb_exam_student s where s.exam_id=?1 and s.subject_code=?2 and s.is_upload =true and s.is_absent=false and s.is_breach=false order by cast(s.objective_score as decimal)+cast(s.subjective_score as decimal) desc limit ?3 ", nativeQuery = true)
-    public List<Double> findHighCountTotalSocreByExamIdAndSubjectCode(Integer examId, String subjectCode, int highCount);
+    @Query(value = "select cast(s.objective_score as decimal(10,3))+cast(s.subjective_score as decimal(10,3)) from eb_exam_student s where s.exam_id=?1 and s.subject_code=?2 and s.is_upload =true and s.is_absent=false and s.is_breach=false order by cast(s.objective_score as decimal(10,3))+cast(s.subjective_score as decimal(10,3)) desc limit ?3 ", nativeQuery = true)
+    public List<BigDecimal> findHighCountTotalSocreByExamIdAndSubjectCode(Integer examId, String subjectCode,
+            int highCount);
 
-    @Query(value = "select cast(s.objective_score as decimal(10,3))+cast(s.subjective_score as decimal(10,3)) from eb_exam_student s where s.exam_id=?1 and s.subject_code=?2 and s.is_upload =true and s.is_absent=false and s.is_breach=false order by cast(s.objective_score as decimal)+cast(s.subjective_score as decimal) asc limit ?3 ", nativeQuery = true)
-    public List<Double> findLowCountTotalSocreByExamIdAndSubjectCode(Integer examId, String subjectCode, int lowCount);
+    @Query(value = "select cast(s.objective_score as decimal(10,3))+cast(s.subjective_score as decimal(10,3)) from eb_exam_student s where s.exam_id=?1 and s.subject_code=?2 and s.is_upload =true and s.is_absent=false and s.is_breach=false order by cast(s.objective_score as decimal(10,3))+cast(s.subjective_score as decimal(10,3)) asc limit ?3 ", nativeQuery = true)
+    public List<BigDecimal> findLowCountTotalSocreByExamIdAndSubjectCode(Integer examId, String subjectCode,
+            int lowCount);
 
-    @Query(value = "select cast(s.objective_score as decimal(10,3))+cast(s.subjective_score as decimal(10,3)) from eb_exam_student s where s.exam_id=?1 and s.subject_code=?2 and s.class_name=?3 and s.is_upload =true and s.is_absent=false and s.is_breach=false order by cast(s.objective_score as decimal)+cast(s.subjective_score as decimal) desc limit ?4 ", nativeQuery = true)
-    public List<Double> findHighCountTotalSocreByExamIdAndSubjectCodeAndClass(Integer examId, String subjectCode,
+    @Query(value = "select cast(s.objective_score as decimal(10,3))+cast(s.subjective_score as decimal(10,3)) from eb_exam_student s where s.exam_id=?1 and s.subject_code=?2 and s.class_name=?3 and s.is_upload =true and s.is_absent=false and s.is_breach=false order by cast(s.objective_score as decimal(10,3))+cast(s.subjective_score as decimal(10,3)) desc limit ?4 ", nativeQuery = true)
+    public List<BigDecimal> findHighCountTotalSocreByExamIdAndSubjectCodeAndClass(Integer examId, String subjectCode,
             String className, int highCount);
 
-    @Query(value = "select cast(s.objective_score as decimal(10,3))+cast(s.subjective_score as decimal(10,3)) from eb_exam_student s where s.exam_id=?1 and s.subject_code=?2 and s.class_name=?3 and s.is_upload =true and s.is_absent=false and s.is_breach=false order by cast(s.objective_score as decimal)+cast(s.subjective_score as decimal) asc limit ?4 ", nativeQuery = true)
-    public List<Double> findLowCountTotalSocreByExamIdAndSubjectCodeAndClass(Integer examId, String subjectCode,
+    @Query(value = "select cast(s.objective_score as decimal(10,3))+cast(s.subjective_score as decimal(10,3)) from eb_exam_student s where s.exam_id=?1 and s.subject_code=?2 and s.class_name=?3 and s.is_upload =true and s.is_absent=false and s.is_breach=false order by cast(s.objective_score as decimal(10,3))+cast(s.subjective_score as decimal(10,3)) asc limit ?4 ", nativeQuery = true)
+    public List<BigDecimal> findLowCountTotalSocreByExamIdAndSubjectCodeAndClass(Integer examId, String subjectCode,
             String className, int lowCount);
 
     @Query("select s.className from ExamStudent s where s.examId=?1 group by s.className")

+ 7 - 4
stmms-biz/src/main/java/cn/com/qmth/stmms/biz/report/utils/module/SubjectClassRangeModule.java

@@ -1,5 +1,6 @@
 package cn.com.qmth.stmms.biz.report.utils.module;
 
+import java.math.BigDecimal;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -51,12 +52,14 @@ public class SubjectClassRangeModule implements Module {
                 JSONObject rangeLevel = new JSONObject();
                 double highCount = Math.ceil(context.getHighValueConfig() * r.getRealityCount() * 0.01);
                 double lowCount = Math.ceil(context.getLowValueConfig() * r.getRealityCount() * 0.01);
-                List<Double> highScore = studentDao.findHighCountTotalSocreByExamIdAndSubjectCodeAndClass(
+                List<BigDecimal> highScore = studentDao.findHighCountTotalSocreByExamIdAndSubjectCodeAndClass(
                         context.getExamId(), subjectCode, className, (int) highCount);
-                List<Double> lowScore = studentDao.findLowCountTotalSocreByExamIdAndSubjectCodeAndClass(
+                List<BigDecimal> lowScore = studentDao.findLowCountTotalSocreByExamIdAndSubjectCodeAndClass(
                         context.getExamId(), subjectCode, className, (int) lowCount);
-                rangeLevel.accumulate("highScore", highScore.isEmpty() ? 0 : highScore.get(highScore.size() - 1));
-                rangeLevel.accumulate("lowScore", lowScore.isEmpty() ? 0 : lowScore.get(lowScore.size() - 1));
+                rangeLevel.accumulate("highScore", highScore.isEmpty() ? 0 : highScore.get(highScore.size() - 1)
+                        .doubleValue());
+                rangeLevel.accumulate("lowScore", lowScore.isEmpty() ? 0 : lowScore.get(lowScore.size() - 1)
+                        .doubleValue());
                 r.setRangeLevel(rangeLevel.toString());
 
                 JSONObject scoreRange = new JSONObject();

+ 6 - 4
stmms-biz/src/main/java/cn/com/qmth/stmms/biz/report/utils/module/SubjectRangeModule.java

@@ -1,5 +1,6 @@
 package cn.com.qmth.stmms.biz.report.utils.module;
 
+import java.math.BigDecimal;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -71,12 +72,13 @@ public class SubjectRangeModule implements Module {
             JSONObject rangeLevel = new JSONObject();
             double highCount = Math.ceil(context.getHighValueConfig() * subject.getRealityCount() * 0.01);
             double lowCount = Math.ceil(context.getLowValueConfig() * subject.getRealityCount() * 0.01);
-            List<Double> highScore = studentDao.findHighCountTotalSocreByExamIdAndSubjectCode(context.getExamId(),
+            List<BigDecimal> highScore = studentDao.findHighCountTotalSocreByExamIdAndSubjectCode(context.getExamId(),
                     subjectCode, (int) highCount);
-            List<Double> lowScore = studentDao.findLowCountTotalSocreByExamIdAndSubjectCode(context.getExamId(),
+            List<BigDecimal> lowScore = studentDao.findLowCountTotalSocreByExamIdAndSubjectCode(context.getExamId(),
                     subjectCode, (int) lowCount);
-            rangeLevel.accumulate("highScore", highScore.isEmpty() ? 0 : highScore.get(highScore.size() - 1));
-            rangeLevel.accumulate("lowScore", lowScore.isEmpty() ? 0 : lowScore.get(lowScore.size() - 1));
+            rangeLevel.accumulate("highScore", highScore.isEmpty() ? 0 : highScore.get(highScore.size() - 1)
+                    .doubleValue());
+            rangeLevel.accumulate("lowScore", lowScore.isEmpty() ? 0 : lowScore.get(lowScore.size() - 1).doubleValue());
             subject.setRangeLevel(rangeLevel.toString());
 
             JSONObject scoreRange = new JSONObject();

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

@@ -140,7 +140,7 @@
         &nbsp;
         <input id="btnSubmit" class="btn btn-primary" type="button" value="查询" onclick="goSearch()"/>
 		&nbsp;<input id="btnImport" class="btn" type="button" value="导入"/>
-		&nbsp;<a href="###" class="btn" id="save-button"">绑定评卷员</a>
+		&nbsp;<a href="###" class="btn hide" id="save-button"">绑定评卷员</a>
         <!--     <input id="btnExport" class="btn" type="button" value="导出"/> -->
     </div>
 </form>
@@ -406,6 +406,14 @@
         $(this).attr('href', '${ctx}/admin/exam/marker/save?subjectCode=' + subjectCode + '&groupNumber=' + groupNumber);
         return true;
     });
+    $('#group-select').change(function () {
+    	 var groupNumber = $('#group-select').val();
+    	 if(groupNumber==''){
+    		 $('#save-button').hide();
+    	 }else{
+    		 $('#save-button').show();
+    	 }
+    });
 </script>
 
 </body>