|
@@ -4,6 +4,8 @@ import cn.dev33.satoken.annotation.SaCheckPermission;
|
|
|
import cn.dev33.satoken.secure.BCrypt;
|
|
|
import cn.dev33.satoken.stp.StpUtil;
|
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
|
+import com.alibaba.excel.EasyExcel;
|
|
|
+import com.alibaba.excel.support.ExcelTypeEnum;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
@@ -35,6 +37,7 @@ import com.xjrsoft.module.student.entity.BaseNewStudent;
|
|
|
import com.xjrsoft.module.student.entity.BaseStudentFamilyMember;
|
|
|
import com.xjrsoft.module.student.service.IBaseNewStudentService;
|
|
|
import com.xjrsoft.module.student.service.IBaseStudentFamilyMemberService;
|
|
|
+import com.xjrsoft.module.student.vo.BaseNewStudentExportVo;
|
|
|
import com.xjrsoft.module.student.vo.BaseNewStudentPageVo;
|
|
|
import com.xjrsoft.module.student.vo.BaseNewStudentScoreExcelVo;
|
|
|
import com.xjrsoft.module.student.vo.BaseNewStudentTreeVo;
|
|
@@ -44,6 +47,7 @@ import com.xjrsoft.module.student.vo.EnrollmentPlanTreeVo;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import lombok.AllArgsConstructor;
|
|
|
+import org.springframework.http.ResponseEntity;
|
|
|
import org.springframework.web.bind.annotation.DeleteMapping;
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
@@ -55,6 +59,7 @@ import org.springframework.web.bind.annotation.RestController;
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
import javax.validation.Valid;
|
|
|
+import java.io.ByteArrayOutputStream;
|
|
|
import java.io.IOException;
|
|
|
import java.time.LocalDateTime;
|
|
|
import java.util.ArrayList;
|
|
@@ -113,7 +118,7 @@ public class BaseNewStudentController {
|
|
|
dto.setBaseSemesterId(semesterList.get(0).getId());
|
|
|
}
|
|
|
}
|
|
|
- Page<BaseNewStudentPageVo> page = baseNewStudentService.getPage(new Page<>(dto.getLimit(), dto.getSize()), dto);
|
|
|
+ Page<BaseNewStudentPageVo> page = baseNewStudentService.getReportPage(new Page<>(dto.getLimit(), dto.getSize()), dto);
|
|
|
PageOutput<BaseNewStudentPageVo> pageOutput = ConventPage.getPageOutput(page, BaseNewStudentPageVo.class);
|
|
|
return RT.ok(pageOutput);
|
|
|
}
|
|
@@ -347,4 +352,24 @@ public class BaseNewStudentController {
|
|
|
return RT.ok(true);
|
|
|
}
|
|
|
|
|
|
+ @GetMapping("/report-export")
|
|
|
+ @ApiOperation(value = "导出")
|
|
|
+ public ResponseEntity<byte[]> exportData(@Valid BaseNewStudentPageDto dto) {
|
|
|
+ List<BaseNewStudentPageVo> reportList = baseNewStudentService.getReportList(dto);
|
|
|
+ List<BaseNewStudentExportVo> exportVos = new ArrayList<>();
|
|
|
+
|
|
|
+ for (BaseNewStudentPageVo el : reportList) {
|
|
|
+ BaseNewStudentExportVo vo = BeanUtil.toBean(el, BaseNewStudentExportVo.class);
|
|
|
+ if(el.getIsAdjust() == 1){
|
|
|
+ vo.setReportStatus("是");
|
|
|
+ }else if(el.getIsAdjust() == 0){
|
|
|
+ vo.setReportStatus("否");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ByteArrayOutputStream bot = new ByteArrayOutputStream();
|
|
|
+ EasyExcel.write(bot, BaseNewStudentExportVo.class).automaticMergeHead(false).excelType(ExcelTypeEnum.XLSX).sheet().doWrite(exportVos);
|
|
|
+
|
|
|
+ return RT.fileStream(bot.toByteArray(), "RoomBed" + ExcelTypeEnum.XLSX.getValue());
|
|
|
+ }
|
|
|
+
|
|
|
}
|