Bladeren bron

解决移动端学生管理查询太慢的问题

dzx 1 jaar geleden
bovenliggende
commit
90a4a208f0

+ 8 - 1
src/main/java/com/xjrsoft/module/student/controller/BaseStudentInfoController.java

@@ -9,10 +9,13 @@ import com.xjrsoft.common.page.PageOutput;
 import com.xjrsoft.module.student.dto.BaseStudentInfoDetailDto;
 import com.xjrsoft.module.student.dto.BaseStudentInfoPageDto;
 import com.xjrsoft.module.student.dto.UpdateBaseStudentInfoDto;
+import com.xjrsoft.module.student.entity.BaseStudentUser;
 import com.xjrsoft.module.student.service.IBaseStudentSchoolRollService;
+import com.xjrsoft.module.student.service.IStudentManagerService;
 import com.xjrsoft.module.student.vo.BaseStudentInfoDetailVo;
 import com.xjrsoft.module.student.vo.BaseStudentInfoPageDataVo;
 import com.xjrsoft.module.student.vo.BaseStudentInfoPageVo;
+import com.xjrsoft.module.student.vo.BaseStudentUserPageVo;
 import com.xjrsoft.module.student.vo.MobileClassStatisticsVo;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
@@ -38,7 +41,7 @@ import javax.validation.Valid;
 @AllArgsConstructor
 public class BaseStudentInfoController {
 
-
+    private final IStudentManagerService studentManagerService;
     private final IBaseStudentSchoolRollService baseStudentSchoolRollService;
 
     @GetMapping(value = "/mobile-page")
@@ -46,6 +49,10 @@ public class BaseStudentInfoController {
     @SaCheckPermission("basestudentpost:detail")
     public RT<PageOutput<BaseStudentInfoPageVo>> mobilePage(@Valid BaseStudentInfoPageDto dto){
         Page<BaseStudentInfoPageVo> mobilePage = baseStudentSchoolRollService.getMobilePage(new Page<>(dto.getLimit(), dto.getSize()), dto);
+        for (BaseStudentInfoPageVo record : mobilePage.getRecords()) {
+            BaseStudentUser user = studentManagerService.getById(record.getId());
+            record.setAvatar(user.getAvatar());
+        }
         PageOutput<BaseStudentInfoPageVo> pageOutput = ConventPage.getPageOutput(mobilePage, BaseStudentInfoPageVo.class);
         return RT.ok(pageOutput);
     }

+ 0 - 1
src/main/resources/mapper/student/BaseStudentSchoolRollMapper.xml

@@ -22,7 +22,6 @@
             t2.gender,
             t10.name AS genderCn,
             t2.birth_date,
-            t2.avatar,
             t6.name AS nation,
             t3.archives_status AS archivesStatusCode,
             t3.stduy_status AS stduyStatusCode,