Explorar o código

酷乐秀优化

zouxuan hai 6 meses
pai
achega
dfb83dc5dd

+ 5 - 0
cooleshow-app/src/main/java/com/yonge/cooleshow/teacher/controller/TeacherHomeController.java

@@ -2,6 +2,7 @@ package com.yonge.cooleshow.teacher.controller;
 
 import com.alibaba.excel.EasyExcel;
 import com.alibaba.fastjson.JSON;
+import com.microsvc.toolkit.common.webportal.exception.BizException;
 import com.microsvc.toolkit.middleware.oss.OssPluginContext;
 import com.microsvc.toolkit.middleware.oss.impl.TencentOssPlugin;
 import com.yonge.cooleshow.biz.dal.service.*;
@@ -18,6 +19,7 @@ import com.yonge.toolset.utils.easyexcel.ExcelUtils;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.Data;
+import org.apache.commons.collections.CollectionUtils;
 import org.apache.commons.io.FileUtils;
 import org.springframework.web.bind.annotation.*;
 
@@ -159,6 +161,9 @@ public class TeacherHomeController extends BaseController {
         studentSearch.setTeacherId(sysUserService.getUserId());
         studentSearch.setLimit(10000);
         List<TeacherIndexWrapper.StudentPracticeSummaryDto> teacherHomeStudent = homeService.getTeacherHomeStudent(studentSearch);
+        if (CollectionUtils.isEmpty(teacherHomeStudent)) {
+            throw new BizException("暂无学员练习记录");
+        }
         List<TeacherIndexWrapper.StudentPracticeSummaryExportDto> list =
                 JSON.parseArray(JSON.toJSONString(teacherHomeStudent), TeacherIndexWrapper.StudentPracticeSummaryExportDto.class);
         DateFormat dateFormat1 = new SimpleDateFormat("yyMMddHHmmss");