|
|
@@ -37,6 +37,7 @@ import com.xjrsoft.module.student.entity.StudentReportPlanClassRelation;
|
|
|
import com.xjrsoft.module.student.entity.StudentReportRecord;
|
|
|
import com.xjrsoft.module.student.service.IStudentReportPlanService;
|
|
|
import com.xjrsoft.module.student.service.IStudentReportRecordService;
|
|
|
+import com.xjrsoft.module.student.vo.StudentReportRecordExcelVo;
|
|
|
import com.xjrsoft.module.student.vo.StudentReportRecordItemVo;
|
|
|
import com.xjrsoft.module.student.vo.StudentReportRecordPageVo;
|
|
|
import com.xjrsoft.module.student.vo.StudentReportRecordPlanPageVo;
|
|
|
@@ -60,6 +61,7 @@ import javax.validation.Valid;
|
|
|
import java.io.ByteArrayOutputStream;
|
|
|
import java.math.BigDecimal;
|
|
|
import java.math.RoundingMode;
|
|
|
+import java.text.SimpleDateFormat;
|
|
|
import java.time.LocalDateTime;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.Date;
|
|
|
@@ -456,8 +458,16 @@ public class StudentReportRecordController {
|
|
|
@SaCheckPermission("studentreportrecord:detail")
|
|
|
public ResponseEntity<byte[]> exportQuerty(@Valid @RequestBody StudentReportRecordPageDto dto){
|
|
|
List<StudentReportRecordPlanPageVo> planPageList = studentReportRecordService.getPlanPageList(dto);
|
|
|
+
|
|
|
+ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
+ List<StudentReportRecordExcelVo> dataList = new ArrayList<>();
|
|
|
+ for (StudentReportRecordPlanPageVo pageVo : planPageList) {
|
|
|
+ StudentReportRecordExcelVo excelVo = BeanUtil.toBean(pageVo, StudentReportRecordExcelVo.class);
|
|
|
+ excelVo.setReportTime(sdf.format(pageVo.getReportTime()));
|
|
|
+ dataList.add(excelVo);
|
|
|
+ }
|
|
|
ByteArrayOutputStream bot = new ByteArrayOutputStream();
|
|
|
- EasyExcel.write(bot, StudentReportRecordPlanPageVo.class).automaticMergeHead(false).excelType(ExcelTypeEnum.XLSX).sheet().doWrite(planPageList);
|
|
|
+ EasyExcel.write(bot, StudentReportRecordExcelVo.class).automaticMergeHead(false).excelType(ExcelTypeEnum.XLSX).sheet().doWrite(dataList);
|
|
|
String fileName = "exportQuerty" + ExcelTypeEnum.XLSX.getValue();
|
|
|
return RT.fileStream(bot.toByteArray(), fileName);
|
|
|
}
|