|
@@ -1,16 +1,23 @@
|
|
package com.zhongzheng.controller.grade;
|
|
package com.zhongzheng.controller.grade;
|
|
|
|
|
|
-import java.util.ArrayList;
|
|
|
|
-import java.util.List;
|
|
|
|
-import java.util.Arrays;
|
|
|
|
-
|
|
|
|
|
|
+import java.io.FileOutputStream;
|
|
|
|
+import java.time.LocalDateTime;
|
|
|
|
+import java.time.format.DateTimeFormatter;
|
|
|
|
+import java.util.*;
|
|
|
|
+
|
|
|
|
+import cn.afterturn.easypoi.excel.ExcelExportUtil;
|
|
|
|
+import cn.afterturn.easypoi.excel.entity.ExportParams;
|
|
|
|
+import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
|
|
import com.zhongzheng.common.utils.ServletUtils;
|
|
import com.zhongzheng.common.utils.ServletUtils;
|
|
|
|
+import com.zhongzheng.modules.base.bo.UserProfileQueryBo;
|
|
|
|
+import com.zhongzheng.modules.base.vo.UserProfileExportGaiVo;
|
|
import com.zhongzheng.modules.grade.bo.*;
|
|
import com.zhongzheng.modules.grade.bo.*;
|
|
import com.zhongzheng.modules.grade.service.*;
|
|
import com.zhongzheng.modules.grade.service.*;
|
|
import com.zhongzheng.modules.grade.vo.*;
|
|
import com.zhongzheng.modules.grade.vo.*;
|
|
import com.zhongzheng.modules.user.entity.ClientLoginUser;
|
|
import com.zhongzheng.modules.user.entity.ClientLoginUser;
|
|
import io.swagger.models.auth.In;
|
|
import io.swagger.models.auth.In;
|
|
import lombok.RequiredArgsConstructor;
|
|
import lombok.RequiredArgsConstructor;
|
|
|
|
+import org.springframework.boot.SpringBootVersion;
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
@@ -30,6 +37,8 @@ import com.zhongzheng.common.core.page.TableDataInfo;
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.ApiOperation;
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
|
|
|
|
|
+import javax.servlet.ServletOutputStream;
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 班级Controller
|
|
* 班级Controller
|
|
*
|
|
*
|
|
@@ -134,6 +143,44 @@ public class ClassGradeController extends BaseController {
|
|
return getDataTable(list);
|
|
return getDataTable(list);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 导出资料审核列表
|
|
|
|
+ */
|
|
|
|
+ @ApiOperation("导出学员学时列表")
|
|
|
|
+ @PreAuthorize("@ss.hasPermi('system:profile:export')")
|
|
|
|
+ @Log(title = "导出学员学时列表", businessType = BusinessType.EXPORT)
|
|
|
|
+ @GetMapping("/export")
|
|
|
|
+ public AjaxResult<UserProfileExportGaiVo> export(ClassGradeUserQueryBo bo) {
|
|
|
|
+
|
|
|
|
+ String fileName = "";
|
|
|
|
+ if(bo.getStudyStatus()==0){
|
|
|
|
+ fileName="全部";
|
|
|
|
+ }
|
|
|
|
+ if(bo.getStudyStatus()==1){
|
|
|
|
+ fileName="未完成学习";
|
|
|
|
+ }
|
|
|
|
+ if(bo.getStudyStatus()==2){
|
|
|
|
+ fileName="完成学习";
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ startPage();
|
|
|
|
+
|
|
|
|
+ List<ClassPeriodStudentExportVo> list = iClassGradeUserService.exportPo(bo);
|
|
|
|
+ ExcelUtil<ClassPeriodStudentExportVo> util = new ExcelUtil<ClassPeriodStudentExportVo>(ClassPeriodStudentExportVo.class);
|
|
|
|
+ ExportParams deptExportParams = new ExportParams();
|
|
|
|
+ // 设置sheet得名称
|
|
|
|
+ deptExportParams.setSheetName("表1");
|
|
|
|
+ String timeStr= LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
|
|
|
|
+ Map<String, Object> deptExportMap = new HashMap<>();
|
|
|
|
+ deptExportMap.put("title", deptExportParams);
|
|
|
|
+ deptExportMap.put("entity", ClassPeriodStudentExportVo.class);
|
|
|
|
+ // sheet中要填充得数据
|
|
|
|
+ deptExportMap.put("data", list);
|
|
|
|
+ List<Map<String, Object>> sheetsList = new ArrayList<>();
|
|
|
|
+ sheetsList.add(deptExportMap);
|
|
|
|
+ return util.exportEasyExcel(sheetsList, "填写盖章审核-"+fileName+"-学员学习记录-"+timeStr);
|
|
|
|
+ }
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 查询学员学时信息列表
|
|
* 查询学员学时信息列表
|
|
*/
|
|
*/
|