|
@@ -3,6 +3,7 @@ package com.xjrsoft.module.banding.controller;
|
|
import cn.dev33.satoken.annotation.SaCheckPermission;
|
|
import cn.dev33.satoken.annotation.SaCheckPermission;
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
import com.alibaba.excel.EasyExcel;
|
|
import com.alibaba.excel.EasyExcel;
|
|
|
|
+import com.alibaba.excel.support.ExcelTypeEnum;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.xjrsoft.common.model.result.RT;
|
|
import com.xjrsoft.common.model.result.RT;
|
|
import com.xjrsoft.module.banding.dto.AddBandingTaskClassDto;
|
|
import com.xjrsoft.module.banding.dto.AddBandingTaskClassDto;
|
|
@@ -14,7 +15,9 @@ import com.xjrsoft.module.banding.dto.UpdateBandingClassDto;
|
|
import com.xjrsoft.module.banding.entity.BandingTaskClass;
|
|
import com.xjrsoft.module.banding.entity.BandingTaskClass;
|
|
import com.xjrsoft.module.banding.service.IBandingTaskClassService;
|
|
import com.xjrsoft.module.banding.service.IBandingTaskClassService;
|
|
import com.xjrsoft.module.banding.service.IBandingTaskClassStudentService;
|
|
import com.xjrsoft.module.banding.service.IBandingTaskClassStudentService;
|
|
|
|
+import com.xjrsoft.module.banding.vo.BandingTaskClassExcelVo;
|
|
import com.xjrsoft.module.banding.vo.BandingTaskClassPageVo;
|
|
import com.xjrsoft.module.banding.vo.BandingTaskClassPageVo;
|
|
|
|
+import com.xjrsoft.module.banding.vo.BandingTaskClassStudentListVo;
|
|
import com.xjrsoft.module.banding.vo.BandingTaskClassSureListVo;
|
|
import com.xjrsoft.module.banding.vo.BandingTaskClassSureListVo;
|
|
import com.xjrsoft.module.banding.vo.BandingTaskClassVo;
|
|
import com.xjrsoft.module.banding.vo.BandingTaskClassVo;
|
|
import com.xjrsoft.module.banding.vo.BandingTaskPageVo;
|
|
import com.xjrsoft.module.banding.vo.BandingTaskPageVo;
|
|
@@ -22,6 +25,7 @@ import com.xjrsoft.module.student.dto.BaseNewStudentPageDto;
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.ApiOperation;
|
|
import io.swagger.annotations.ApiOperation;
|
|
import lombok.AllArgsConstructor;
|
|
import lombok.AllArgsConstructor;
|
|
|
|
+import org.springframework.http.ResponseEntity;
|
|
import org.springframework.web.bind.annotation.DeleteMapping;
|
|
import org.springframework.web.bind.annotation.DeleteMapping;
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
@@ -33,6 +37,7 @@ import org.springframework.web.bind.annotation.RestController;
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
import javax.validation.Valid;
|
|
import javax.validation.Valid;
|
|
|
|
+import java.io.ByteArrayOutputStream;
|
|
import java.io.IOException;
|
|
import java.io.IOException;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
|
|
@@ -64,8 +69,8 @@ public class BandingTaskClassController {
|
|
@GetMapping(value = "/class-student")
|
|
@GetMapping(value = "/class-student")
|
|
@ApiOperation(value="分班后的学生列表")
|
|
@ApiOperation(value="分班后的学生列表")
|
|
@SaCheckPermission("bandingtask:detail")
|
|
@SaCheckPermission("bandingtask:detail")
|
|
- public RT<List<BandingTaskClassPageVo>> classStudent(@Valid BandingTaskClassStudentPageDto dto){
|
|
|
|
- List<BandingTaskClassPageVo> list = bandingTaskClassService.classStudent(dto);
|
|
|
|
|
|
+ public RT<List<BandingTaskClassStudentListVo>> classStudent(@Valid BandingTaskClassStudentPageDto dto){
|
|
|
|
+ List<BandingTaskClassStudentListVo> list = bandingTaskClassService.classStudent(dto);
|
|
return RT.ok(list);
|
|
return RT.ok(list);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -142,6 +147,17 @@ public class BandingTaskClassController {
|
|
return RT.ok(result);
|
|
return RT.ok(result);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @GetMapping("/export")
|
|
|
|
+ @ApiOperation(value = "导出学生列表")
|
|
|
|
+ public ResponseEntity<byte[]> exportData(@Valid BandingTaskClassStudentPageDto dto, @RequestParam(defaultValue = "false") Boolean isTemplate) {
|
|
|
|
+ List<BandingTaskClassStudentListVo> listVos = bandingTaskClassService.classStudent(dto);
|
|
|
|
+ List<BandingTaskClassExcelVo> list = BeanUtil.copyToList(listVos, BandingTaskClassExcelVo.class);
|
|
|
|
+ ByteArrayOutputStream bot = new ByteArrayOutputStream();
|
|
|
|
+ EasyExcel.write(bot, BandingTaskClassExcelVo.class).automaticMergeHead(false).excelType(ExcelTypeEnum.XLSX).sheet().doWrite(list);
|
|
|
|
+
|
|
|
|
+ return RT.fileStream(bot.toByteArray(), "学生分班情况" + ExcelTypeEnum.XLSX.getValue());
|
|
|
|
+ }
|
|
|
|
+
|
|
@PostMapping("/reset")
|
|
@PostMapping("/reset")
|
|
@ApiOperation(value = "重置功能")
|
|
@ApiOperation(value = "重置功能")
|
|
@SaCheckPermission("bandingTaskClass:add")
|
|
@SaCheckPermission("bandingTaskClass:add")
|