wangliang 4 년 전
부모
커밋
0282740177

+ 4 - 4
themis-backend/src/main/java/com/qmth/themis/backend/api/SysController.java

@@ -258,14 +258,14 @@ public class SysController {
     @RequestMapping(value = "/exam/query", method = RequestMethod.POST)
     @ApiResponses({@ApiResponse(code = 200, message = "角色信息", response = TEExamQueryDto.class)})
     public Result examQuery(@ApiParam(value = "用户id", required = false) @RequestParam(required = false) Long userId) {
+        TBUser tbUser = (TBUser) ServletUtil.getRequestAccount();
         List<TEExam> teExamList = null;
         if (Objects.nonNull(userId) && !Objects.equals(userId, "")) {
             teExamList = teExamService.examPrivilegeQuery(userId);
         } else {
-            teExamList = teExamService.list();
-            Collections.sort(teExamList, (o1, o2) -> {
-                return o2.getCreateTime().toString().compareTo(o1.getCreateTime().toString());
-            });
+            QueryWrapper<TEExam> teExamQueryWrapper = new QueryWrapper<>();
+            teExamQueryWrapper.lambda().eq(TEExam::getOrgId, tbUser.getOrgId()).orderByDesc(TEExam::getCreateTime);
+            teExamList = teExamService.list(teExamQueryWrapper);
         }
         List<TEExamQueryDto> teExamQueryDtoList = null;
         if (Objects.nonNull(teExamList)) {

+ 4 - 5
themis-business/src/main/java/com/qmth/themis/business/templete/service/impl/TempleteLogicServiceImpl.java

@@ -181,12 +181,11 @@ public class TempleteLogicServiceImpl implements TempleteLogicService {
                         teStudentUpdateWrapper.lambda().set(TEStudent::getName, examStudentImportDto.getName())
                                 .eq(TEStudent::getIdentity, examStudentImportDto.getIdentity());
                         teStudentService.update(teStudentUpdateWrapper);
-
-                        UpdateWrapper<TEExamStudent> teExamStudentUpdateWrapper = new UpdateWrapper<>();
-                        teExamStudentUpdateWrapper.lambda().set(TEExamStudent::getName, examStudentImportDto.getName())
-                                .eq(TEExamStudent::getIdentity, examStudentImportDto.getIdentity());
-                        teExamStudentService.update(teExamStudentUpdateWrapper);
                     }
+                    UpdateWrapper<TEExamStudent> teExamStudentUpdateWrapper = new UpdateWrapper<>();
+                    teExamStudentUpdateWrapper.lambda().set(TEExamStudent::getName, examStudentImportDto.getName())
+                            .eq(TEExamStudent::getIdentity, examStudentImportDto.getIdentity());
+                    teExamStudentService.update(teExamStudentUpdateWrapper);
                     teExamStudentService.saveOrUpdate(teExamStudent);
                     roomCodeAndNameSet.add(teExamStudent.getRoomCode() + ":" + teExamStudent.getRoomName());
                     teExamStudentList.add(teExamStudent);

+ 1 - 1
themis-business/src/main/resources/mapper/TEExamMapper.xml

@@ -92,7 +92,7 @@
             <if test="enable != null and enable != '' or enable == 0">
                 and t.enable = #{enable}
             </if>
-        </where> ) t order by t.code
+        </where> ) t order by t.createTime desc
     </select>
 
     <select id="getWaitingExam" resultType="com.qmth.themis.business.dto.response.TEExamDto">