|
|
@@ -2,24 +2,33 @@ package com.xjrsoft.module.student.controller;
|
|
|
|
|
|
import cn.dev33.satoken.annotation.SaCheckPermission;
|
|
|
import cn.dev33.satoken.stp.StpUtil;
|
|
|
+import com.alibaba.excel.EasyExcel;
|
|
|
+import com.alibaba.excel.support.ExcelTypeEnum;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.xjrsoft.common.model.result.RT;
|
|
|
import com.xjrsoft.common.page.ConventPage;
|
|
|
import com.xjrsoft.common.page.PageOutput;
|
|
|
import com.xjrsoft.module.student.dto.BaseStudentInfoPageDto;
|
|
|
+import com.xjrsoft.module.student.dto.PbVXssfdetailExcelDto;
|
|
|
import com.xjrsoft.module.student.dto.PbVXssfdetailPageDto;
|
|
|
import com.xjrsoft.module.student.service.IPbVXssfdetailService;
|
|
|
import com.xjrsoft.module.student.service.IStudentManagerService;
|
|
|
+import com.xjrsoft.module.student.vo.PbVXssfdetailExcelVo;
|
|
|
import com.xjrsoft.module.student.vo.PbVXssfdetailPageVo;
|
|
|
import com.xjrsoft.module.student.vo.StudentPersonalInfoVo;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import lombok.AllArgsConstructor;
|
|
|
+import org.springframework.http.ResponseEntity;
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
|
+import org.springframework.web.bind.annotation.PostMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestBody;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
import javax.validation.Valid;
|
|
|
+import java.io.ByteArrayOutputStream;
|
|
|
+import java.util.List;
|
|
|
|
|
|
/**
|
|
|
* @title: 学生职务设置
|
|
|
@@ -50,4 +59,14 @@ public class ConsumptionController {
|
|
|
PageOutput<PbVXssfdetailPageVo> pageOutput = ConventPage.getPageOutput(page, PbVXssfdetailPageVo.class);
|
|
|
return RT.ok(pageOutput);
|
|
|
}
|
|
|
+
|
|
|
+ @PostMapping("/export")
|
|
|
+ @ApiOperation(value = "导出")
|
|
|
+ public ResponseEntity<byte[]> exportData(@Valid PbVXssfdetailExcelDto dto) {
|
|
|
+ List<PbVXssfdetailExcelVo> dataList = pbVXssfdetailService.getList(dto);
|
|
|
+ ByteArrayOutputStream bot = new ByteArrayOutputStream();
|
|
|
+ EasyExcel.write(bot, PbVXssfdetailExcelVo.class).automaticMergeHead(false).excelType(ExcelTypeEnum.XLSX).sheet().doWrite(dataList);
|
|
|
+
|
|
|
+ return RT.fileStream(bot.toByteArray(), "PbVXssfdetailExcelVo" + ExcelTypeEnum.XLSX.getValue());
|
|
|
+ }
|
|
|
}
|