Browse Source

Merge branch 'dev_200331_openapi' of http://git.qmth.com.cn/luoshi/stmms-ft into dev_200331_openapi

# Conflicts:
#	stmms-web/src/main/webapp/WEB-INF/views/modules/exam/markerList.jsp
luoshi 4 years ago
parent
commit
3983bd38f6

+ 2 - 1
stmms-biz/src/main/java/cn/com/qmth/stmms/biz/exam/dao/ExamStudentDao.java

@@ -184,7 +184,8 @@ public interface ExamStudentDao extends PagingAndSortingRepository<ExamStudent,
 
     @Query("select s from ExamStudent s where s.studentCode=?2 and s.name=?3 and s.examId "
             + "in (select e.id from Exam e where e.schoolId=?1)")
-    public List<ExamStudent> findBySchoolIdAndStudentCodeAndName(Integer schoolId, String studentCode, String name);
+    public List<ExamStudent> findBySchoolIdAndStudentCodeAndName(Integer schoolId, String studentCode, String name,
+            Pageable page);
 
     @Query("select s.className from ExamStudent s where s.examId=?1 group by s.className")
     public List<String> findDistinctClassName(Integer examId);

+ 4 - 1
stmms-biz/src/main/java/cn/com/qmth/stmms/biz/exam/service/ExamStudentService.java

@@ -12,6 +12,8 @@ import java.util.Date;
 import java.util.List;
 import java.util.Map;
 
+import org.springframework.data.domain.Pageable;
+
 public interface ExamStudentService {
 
     public ExamStudent findById(int id);
@@ -136,7 +138,8 @@ public interface ExamStudentService {
 
     public List<String> findDistinctClassName(Integer examId, String subjectCode);
 
-    public List<ExamStudent> findBySchoolIdAndStudentCodeAndName(Integer schoolId, String studentCode, String name);
+    public List<ExamStudent> findBySchoolIdAndStudentCodeAndName(Integer schoolId, String studentCode, String name,
+            Pageable page);
 
     public List<String> findDistinctClassName(Integer examId);
 

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

@@ -22,6 +22,7 @@ import org.apache.commons.lang.StringUtils;
 import org.apache.commons.lang.math.RandomUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.data.domain.Page;
+import org.springframework.data.domain.Pageable;
 import org.springframework.data.domain.Sort;
 import org.springframework.data.domain.Sort.Direction;
 import org.springframework.data.jpa.domain.Specification;
@@ -979,8 +980,9 @@ public class ExamStudentServiceImpl extends BaseQueryService<ExamStudent> implem
     }
 
     @Override
-    public List<ExamStudent> findBySchoolIdAndStudentCodeAndName(Integer schoolId, String studentCode, String name) {
-        return studentDao.findBySchoolIdAndStudentCodeAndName(schoolId, studentCode, name);
+    public List<ExamStudent> findBySchoolIdAndStudentCodeAndName(Integer schoolId, String studentCode, String name,
+            Pageable page) {
+        return studentDao.findBySchoolIdAndStudentCodeAndName(schoolId, studentCode, name, page);
     }
 
     @Override

+ 6 - 4
stmms-web/src/main/java/cn/com/qmth/stmms/student/StudentScoreController.java

@@ -12,9 +12,9 @@ import org.springframework.ui.Model;
 import org.springframework.web.bind.annotation.PathVariable;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.RequestParam;
 
 import cn.com.qmth.stmms.biz.exam.model.ExamStudent;
+import cn.com.qmth.stmms.biz.exam.query.ExamStudentSearchQuery;
 import cn.com.qmth.stmms.biz.exam.service.ExamStudentService;
 import cn.com.qmth.stmms.biz.school.model.School;
 import cn.com.qmth.stmms.biz.school.service.SchoolService;
@@ -44,10 +44,12 @@ public class StudentScoreController {
 
     @RequestMapping(value = "/{schoolId}/query", method = RequestMethod.POST)
     public String getSubject(Model model, HttpServletRequest request, @PathVariable Integer schoolId,
-            @RequestParam String studentCode, @RequestParam String name) {
-        List<ExamStudent> list = studentService.findBySchoolIdAndStudentCodeAndName(schoolId, studentCode.trim(),
-                name.trim());
+            ExamStudentSearchQuery query) {
+        List<ExamStudent> list = studentService.findBySchoolIdAndStudentCodeAndName(schoolId, query.getStudentCode(),
+                query.getName(), query);
+        model.addAttribute("school", schoolService.findById(schoolId));
         model.addAttribute("list", list);
+        model.addAttribute("query", query);
         return "modules/student/list";
     }
 

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

@@ -60,11 +60,11 @@
             padding: 13px 0 0 13px;
             float: left;
         }
-        
+
         .task-count, .password-value {
             width: 150px;
         }
-        
+
         .btn-info {
             height: 25px;
             margin-left: 320px;
@@ -255,11 +255,11 @@
         var id = $(this).attr('data-id');
         $.post('${ctx}/admin/exam/marker/reset', {id: id}, function (result) {
             if (result.success == true) {
-                alert('开始重置');
+                alert('重置成功');
+                $("#searchForm").submit();
             } else {
                 alert(result.message);
             }
-            $("#searchForm").submit();
         });
     });
     $('.toggle-button').click(function () {

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

@@ -28,8 +28,8 @@
     <div id="importClassBox" class="hide">
         <form id="importClassForm" action="${ctx}/admin/user/class/import" method="post" enctype="multipart/form-data"
               style="padding-left:20px;text-align:center;" class="form-search" onsubmit="loading('正在导入,请稍等...');"><br/>
-            <input id="uploadFile" name="file" type="file" style="width:330px"/><br/><br/>  
-            <input id="btnImportSubmit" class="btn btn-primary" type="submit" value="  导    入  "/>
+            <input id="uploadClassFile" name="file" type="file" style="width:330px"/><br/><br/>  
+            <input id="btnImportClassSubmit" class="btn btn-primary" type="submit" value="  导    入  "/>
             <a href="${ctx}/admin/user/class/template">下载模板</a>
         </form>
     </div>