|
@@ -29,6 +29,7 @@ import org.springframework.web.bind.annotation.PostMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
+import javax.servlet.ServletOutputStream;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
import java.io.IOException;
|
|
|
import java.io.OutputStream;
|
|
@@ -83,7 +84,7 @@ public class ExportController extends BaseController {
|
|
|
@ApiOperation(value = "网管课购买列表")
|
|
|
@PostMapping("export/studentBuyPractice")
|
|
|
@PreAuthorize("@pcs.hasPermissions('export/studentBuyPractice')")
|
|
|
- public void studentBuyPractice(HttpServletResponse response, StudentBuyPracticeQueryInfo queryInfo) {
|
|
|
+ public void studentBuyPractice(HttpServletResponse response, StudentBuyPracticeQueryInfo queryInfo) throws IOException {
|
|
|
queryInfo.setRows(49999);
|
|
|
SysUser sysUser = sysUserFeignService.queryUserInfo();
|
|
|
if (sysUser == null) {
|
|
@@ -103,6 +104,7 @@ public class ExportController extends BaseController {
|
|
|
}
|
|
|
}
|
|
|
List<StudentBuyPracticeDto> rows = practiceGroupService.studentBuys(queryInfo).getRows();
|
|
|
+ OutputStream outputStream = response.getOutputStream();
|
|
|
try {
|
|
|
HSSFWorkbook workbook = POIUtil.exportExcel(new String[]{"学员编号", "学员名称", "所属分部","老师名称", "购买网管课",
|
|
|
"免费课结束日期", "首次购买日期", "时间差"}, new String[]{
|
|
@@ -111,23 +113,33 @@ public class ExportController extends BaseController {
|
|
|
response.setContentType("application/octet-stream");
|
|
|
response.setHeader("Content-Disposition", "attachment;filename=lender-" + DateUtil.getDate(new Date()) + ".xls");
|
|
|
response.flushBuffer();
|
|
|
- workbook.write(response.getOutputStream());
|
|
|
- workbook.close();
|
|
|
+ outputStream = response.getOutputStream();
|
|
|
+ workbook.write(outputStream);
|
|
|
+ outputStream.flush();
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
+ } finally {
|
|
|
+ if (outputStream != null) {
|
|
|
+ try {
|
|
|
+ outputStream.close();
|
|
|
+ } catch (IOException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "导出对外订单列表")
|
|
|
@PostMapping("export/tenantPaymentOrder")
|
|
|
@PreAuthorize("@pcs.hasPermissions('export/tenantPaymentOrder')")
|
|
|
- public void tenantPaymentOrder(HttpServletResponse response, TenantPaymentOrderQueryInfo queryInfo) {
|
|
|
+ public void tenantPaymentOrder(HttpServletResponse response, TenantPaymentOrderQueryInfo queryInfo) throws IOException {
|
|
|
queryInfo.setRows(49999);
|
|
|
SysUser sysUser = sysUserFeignService.queryUserInfo();
|
|
|
if (sysUser == null) {
|
|
|
throw new BizException("用户信息获取失败");
|
|
|
}
|
|
|
List<TenantPaymentOrder> paymentOrders = tenantPaymentOrderService.queryPage(queryInfo).getRows();
|
|
|
+ OutputStream outputStream = response.getOutputStream();
|
|
|
try {
|
|
|
HSSFWorkbook workbook = POIUtil.exportExcel(new String[]{"交易流水号", "订单号", "订单日期", "交易类型", "应付金额", "实付金额", "用户姓名", "手机号码", "交易方式", "收款账户", "交易状态",
|
|
|
"备注", "交易方式"}, new String[]{"transNo", "orderNo", "createTime", "type.desc", "expectAmount", "actualAmount", "user.username",
|
|
@@ -135,17 +147,26 @@ public class ExportController extends BaseController {
|
|
|
response.setContentType("application/octet-stream");
|
|
|
response.setHeader("Content-Disposition", "attachment;filename=lender-" + DateUtil.getDate(new Date()) + ".xls");
|
|
|
response.flushBuffer();
|
|
|
- workbook.write(response.getOutputStream());
|
|
|
- workbook.close();
|
|
|
+ outputStream = response.getOutputStream();
|
|
|
+ workbook.write(outputStream);
|
|
|
+ outputStream.flush();
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
+ } finally {
|
|
|
+ if (outputStream != null) {
|
|
|
+ try {
|
|
|
+ outputStream.close();
|
|
|
+ } catch (IOException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "导出老师课酬")
|
|
|
@PostMapping("export/teacherSalary")
|
|
|
@PreAuthorize("@pcs.hasPermissions('export/teacherSalary')")
|
|
|
- public void teacherSalary(HttpServletResponse response, ExportTeacherSalaryQueryInfo queryInfo) {
|
|
|
+ public void teacherSalary(HttpServletResponse response, ExportTeacherSalaryQueryInfo queryInfo) throws IOException {
|
|
|
queryInfo.setRows(99999);
|
|
|
SysUser sysUser = sysUserFeignService.queryUserInfo();
|
|
|
if (sysUser == null) {
|
|
@@ -153,6 +174,7 @@ public class ExportController extends BaseController {
|
|
|
}
|
|
|
queryInfo.setIsExport(true);
|
|
|
List<ExportTeacherSalaryDto> rows = courseScheduleTeacherSalaryService.exportTeacherSalary(queryInfo);
|
|
|
+ OutputStream outputStream = response.getOutputStream();
|
|
|
try {
|
|
|
HSSFWorkbook workbook = POIUtil.exportExcel(new String[]{"课时编号", "老师编号", "老师姓名", "老师分部", "工作类别",
|
|
|
"课程分部", "课程组编号", "课程班名称", "乐团模式", "vip活动名称", "阶梯奖励名称", "线上课/线下课", "线上课单价", "线下课单价",
|
|
@@ -166,10 +188,19 @@ public class ExportController extends BaseController {
|
|
|
response.setContentType("application/octet-stream");
|
|
|
response.setHeader("Content-Disposition", "attachment;filename=lender-" + DateUtil.getDate(new Date()) + ".xls");
|
|
|
response.flushBuffer();
|
|
|
- workbook.write(response.getOutputStream());
|
|
|
- workbook.close();
|
|
|
+ outputStream = response.getOutputStream();
|
|
|
+ workbook.write(outputStream);
|
|
|
+ outputStream.flush();
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
+ } finally {
|
|
|
+ if (outputStream != null) {
|
|
|
+ try {
|
|
|
+ outputStream.close();
|
|
|
+ } catch (IOException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -177,7 +208,7 @@ public class ExportController extends BaseController {
|
|
|
@ApiOperation(value = "导出学员列表")
|
|
|
@PostMapping("export/studentHasCourse")
|
|
|
@PreAuthorize("@pcs.hasPermissions('export/studentHasCourse')")
|
|
|
- public void studentHasCourse(HttpServletResponse response, StudentManageQueryInfo queryInfo) {
|
|
|
+ public void studentHasCourse(HttpServletResponse response, StudentManageQueryInfo queryInfo) throws IOException {
|
|
|
queryInfo.setRows(99999);
|
|
|
SysUser sysUser = sysUserFeignService.queryUserInfo();
|
|
|
if (sysUser == null) {
|
|
@@ -198,6 +229,7 @@ public class ExportController extends BaseController {
|
|
|
}
|
|
|
queryInfo.setIsExport(true);
|
|
|
List<StudentManageListDto> rows = studentManageService.findStudentsByOrganId(queryInfo).getRows();
|
|
|
+ OutputStream outputStream = response.getOutputStream();
|
|
|
try {
|
|
|
HSSFWorkbook workbook = POIUtil.exportExcel(new String[]{"分部", "学员编号", "学员姓名", "性别", "家长姓名",
|
|
|
"家长联系电话", "是否激活", "是否有课", "是否预约网管课", "是否有网管课", "课程余额(元)",
|
|
@@ -208,10 +240,19 @@ public class ExportController extends BaseController {
|
|
|
response.setContentType("application/octet-stream");
|
|
|
response.setHeader("Content-Disposition", "attachment;filename=lender-" + DateUtil.getDate(new Date()) + ".xls");
|
|
|
response.flushBuffer();
|
|
|
- workbook.write(response.getOutputStream());
|
|
|
- workbook.close();
|
|
|
+ outputStream = response.getOutputStream();
|
|
|
+ workbook.write(outputStream);
|
|
|
+ outputStream.flush();
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
+ } finally {
|
|
|
+ if (outputStream != null) {
|
|
|
+ try {
|
|
|
+ outputStream.close();
|
|
|
+ } catch (IOException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -219,7 +260,7 @@ public class ExportController extends BaseController {
|
|
|
@ApiOperation(value = "导出陪练课列表")
|
|
|
@GetMapping("export/practiceGroupList")
|
|
|
@PreAuthorize("@pcs.hasPermissions('export/practiceGroupList')")
|
|
|
- public void queryAll(HttpServletResponse response, PracticeGroupQueryInfo queryInfo) {
|
|
|
+ public void queryAll(HttpServletResponse response, PracticeGroupQueryInfo queryInfo) throws IOException {
|
|
|
queryInfo.setIsExport(true);
|
|
|
queryInfo.setRows(999999999);
|
|
|
SysUser sysUser = sysUserFeignService.queryUserInfo();
|
|
@@ -240,6 +281,7 @@ public class ExportController extends BaseController {
|
|
|
}
|
|
|
}
|
|
|
List<PracticeGroupDto> rows = practiceGroupService.findPracticeGroups(queryInfo).getRows();
|
|
|
+ OutputStream outputStream = response.getOutputStream();
|
|
|
if (rows != null && rows.size() > 0) {
|
|
|
rows.forEach(e -> {
|
|
|
e.setSubClassTimes(e.getTotalClassTimes() == null ? 0 : e.getTotalClassTimes() - (e.getCurrentClassTimes() == null ? 0 : e.getCurrentClassTimes()));
|
|
@@ -253,17 +295,26 @@ public class ExportController extends BaseController {
|
|
|
response.setContentType("application/octet-stream");
|
|
|
response.setHeader("Content-Disposition", "attachment;filename=lender-" + DateUtil.getDate(new Date()) + ".xls");
|
|
|
response.flushBuffer();
|
|
|
- workbook.write(response.getOutputStream());
|
|
|
- workbook.close();
|
|
|
+ outputStream = response.getOutputStream();
|
|
|
+ workbook.write(outputStream);
|
|
|
+ outputStream.flush();
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
+ } finally {
|
|
|
+ if (outputStream != null) {
|
|
|
+ try {
|
|
|
+ outputStream.close();
|
|
|
+ } catch (IOException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "导出VIP课管理")
|
|
|
@GetMapping("export/vipGroupList")
|
|
|
@PreAuthorize("@pcs.hasPermissions('export/vipGroupList')")
|
|
|
- public void queryAll(HttpServletResponse response, VipGroupQueryInfo queryInfo) {
|
|
|
+ public void queryAll(HttpServletResponse response, VipGroupQueryInfo queryInfo) throws IOException {
|
|
|
queryInfo.setRows(999999999);
|
|
|
queryInfo.setIsExport(true);
|
|
|
SysUser sysUser = sysUserFeignService.queryUserInfo();
|
|
@@ -284,6 +335,7 @@ public class ExportController extends BaseController {
|
|
|
}
|
|
|
}
|
|
|
List<VipGroup> rows = vipGroupService.findVipGroups(queryInfo).getRows();
|
|
|
+ OutputStream outputStream = response.getOutputStream();
|
|
|
if (rows != null && rows.size() > 0) {
|
|
|
rows.forEach(e -> {
|
|
|
e.setSubClassTimes(e.getTotalClassTimes() == null ? 0 : e.getTotalClassTimes() - (e.getCurrentClassTimes() == null ? 0 : e.getCurrentClassTimes()));
|
|
@@ -298,17 +350,26 @@ public class ExportController extends BaseController {
|
|
|
response.setContentType("application/octet-stream");
|
|
|
response.setHeader("Content-Disposition", "attachment;filename=lender-" + DateUtil.getDate(new Date()) + ".xls");
|
|
|
response.flushBuffer();
|
|
|
- workbook.write(response.getOutputStream());
|
|
|
- workbook.close();
|
|
|
+ outputStream = response.getOutputStream();
|
|
|
+ workbook.write(outputStream);
|
|
|
+ outputStream.flush();
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
+ } finally {
|
|
|
+ if (outputStream != null) {
|
|
|
+ try {
|
|
|
+ outputStream.close();
|
|
|
+ } catch (IOException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "终课表列表导出")
|
|
|
@GetMapping("export/superFindCourseSchedules")
|
|
|
@PreAuthorize("@pcs.hasPermissions('export/superFindCourseSchedules')")
|
|
|
- public void superFindCourseSchedules(EndCourseScheduleQueryInfo queryInfo, HttpServletResponse response) {
|
|
|
+ public void superFindCourseSchedules(EndCourseScheduleQueryInfo queryInfo, HttpServletResponse response) throws IOException {
|
|
|
queryInfo.setRows(999999999);
|
|
|
queryInfo.setIsExport(true);
|
|
|
SysUser sysUser = sysUserFeignService.queryUserInfo();
|
|
@@ -359,7 +420,7 @@ public class ExportController extends BaseController {
|
|
|
@ApiOperation(value = "导出零星收费列表")
|
|
|
@GetMapping("export/sporadicChargeInfo")
|
|
|
@PreAuthorize("@pcs.hasPermissions('export/sporadicChargeInfo')")
|
|
|
- public void queryPage(SporadicChargeInfoQueryInfo queryInfo, HttpServletResponse response) {
|
|
|
+ public void queryPage(SporadicChargeInfoQueryInfo queryInfo, HttpServletResponse response) throws IOException {
|
|
|
queryInfo.setRows(999999999);
|
|
|
queryInfo.setIsExport(true);
|
|
|
SysUser sysUser = sysUserFeignService.queryUserInfo();
|
|
@@ -380,16 +441,26 @@ public class ExportController extends BaseController {
|
|
|
}
|
|
|
}
|
|
|
List<SporadicChargeInfo> rows = sporadicChargeInfoService.queryDetailPage(queryInfo).getRows();
|
|
|
+ OutputStream outputStream = response.getOutputStream();
|
|
|
try {
|
|
|
HSSFWorkbook workbook = POIUtil.exportExcel(new String[]{"分部", "收费类型", "标题", "金额", "时间", "学生姓名", "创建人"}, new String[]{
|
|
|
"organName", "chargeType.msg", "title", "amount", "updateTime", "userName", "operatorName"}, rows);
|
|
|
response.setContentType("application/octet-stream");
|
|
|
response.setHeader("Content-Disposition", "attachment;filename=lender-" + DateUtil.getDate(new Date()) + ".xls");
|
|
|
response.flushBuffer();
|
|
|
- workbook.write(response.getOutputStream());
|
|
|
- workbook.close();
|
|
|
+ outputStream = response.getOutputStream();
|
|
|
+ workbook.write(outputStream);
|
|
|
+ outputStream.flush();
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
+ } finally {
|
|
|
+ if (outputStream != null) {
|
|
|
+ try {
|
|
|
+ outputStream.close();
|
|
|
+ } catch (IOException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -397,7 +468,7 @@ public class ExportController extends BaseController {
|
|
|
@ApiOperation(value = "导出乐器采购清单")
|
|
|
@PostMapping("order/musicalListExport")
|
|
|
@PreAuthorize("@pcs.hasPermissions('order/musicalListExport')")
|
|
|
- public void musicalListExport(HttpServletResponse response, String musicGroupId) {
|
|
|
+ public void musicalListExport(HttpServletResponse response, String musicGroupId) throws IOException {
|
|
|
List<Goods> musicalList = studentPaymentOrderDetailService.getMusicalList(musicGroupId);
|
|
|
if (musicalList == null) {
|
|
|
throw new BizException("数据集为空");
|
|
@@ -405,82 +476,122 @@ public class ExportController extends BaseController {
|
|
|
if (musicalList.size() > 50000) {
|
|
|
throw new BizException("数据集太大,不能导出.最大数据集不能超过50000");
|
|
|
}
|
|
|
+ OutputStream outputStream = response.getOutputStream();
|
|
|
try {
|
|
|
HSSFWorkbook workbook = POIUtil.exportExcel(new String[]{"分部", "乐团", "商品类型", "商品名称", "型号", "数量"}, new String[]{
|
|
|
"brief", "memo", "type.desc", "name", "specification", "sellCount"}, musicalList);
|
|
|
response.setContentType("application/octet-stream");
|
|
|
response.setHeader("Content-Disposition", "attachment;filename=lender-" + DateUtil.getDate(new Date()) + ".xls");
|
|
|
response.flushBuffer();
|
|
|
- workbook.write(response.getOutputStream());
|
|
|
- workbook.close();
|
|
|
+ outputStream = response.getOutputStream();
|
|
|
+ workbook.write(outputStream);
|
|
|
+ outputStream.flush();
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
+ } finally {
|
|
|
+ if (outputStream != null) {
|
|
|
+ try {
|
|
|
+ outputStream.close();
|
|
|
+ } catch (IOException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "导出学员采购清单明细")
|
|
|
@PostMapping("order/musicalListDetailExport")
|
|
|
@PreAuthorize("@pcs.hasPermissions('order/musicalListDetailExport')")
|
|
|
- public void musicalListDetailExport(HttpServletResponse response, String musicGroupId) {
|
|
|
+ public void musicalListDetailExport(HttpServletResponse response, String musicGroupId) throws IOException {
|
|
|
List<musicalListDetailDto> musicalList = studentPaymentOrderDetailService.getMusicalListDetail(musicGroupId);
|
|
|
if (musicalList.size() > 50000) {
|
|
|
throw new BizException("数据集太大,不能导出.最大数据集不能超过50000");
|
|
|
}
|
|
|
+ OutputStream outputStream = response.getOutputStream();
|
|
|
try {
|
|
|
HSSFWorkbook workbook = POIUtil.exportExcel(new String[]{"分部", "乐团", "学员编号", "学员姓名", "购买商品", "采购方式", "乐器金额", "教辅金额", "课程金额", "订单总价"}, new String[]{
|
|
|
"organName", "musicGroupName", "userId", "username", "goodsNames", "kitGroupPurchaseTypeEnum.msg", "musicalAmount", "accessoriesAmount", "courseAmount", "orderAmount"}, musicalList);
|
|
|
response.setContentType("application/octet-stream");
|
|
|
response.setHeader("Content-Disposition", "attachment;filename=lender-" + DateUtil.getDate(new Date()) + ".xls");
|
|
|
response.flushBuffer();
|
|
|
- workbook.write(response.getOutputStream());
|
|
|
- workbook.close();
|
|
|
+ outputStream = response.getOutputStream();
|
|
|
+ workbook.write(outputStream);
|
|
|
+ outputStream.flush();
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
+ } finally {
|
|
|
+ if (outputStream != null) {
|
|
|
+ try {
|
|
|
+ outputStream.close();
|
|
|
+ } catch (IOException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "乐团【报名中、缴费中】 学生详情列表导出")
|
|
|
@PostMapping(value = "studentRegistration/queryStudentApplyDetailExport")
|
|
|
@PreAuthorize("@pcs.hasPermissions('studentRegistration/queryStudentApplyDetailExport')")
|
|
|
- public void queryStudentApplyDetailExport(StudentRegistrationQueryInfo queryInfo, HttpServletResponse response) {
|
|
|
+ public void queryStudentApplyDetailExport(StudentRegistrationQueryInfo queryInfo, HttpServletResponse response) throws IOException {
|
|
|
queryInfo.setIsExport(true);
|
|
|
List<StudentApplyDetailDto> studentApplyDetail = studentRegistrationService.queryStudentDetailPage(queryInfo).getRows();
|
|
|
+ OutputStream outputStream = response.getOutputStream();
|
|
|
try {
|
|
|
HSSFWorkbook workbook = POIUtil.exportExcel(new String[]{"学生姓名", "家长姓名", "年级", "班级", "性别", "服从调剂", "报名专业", "实际专业", "联系电话", "学员缴费状态", "乐器购买方式"}, new String[]{
|
|
|
"studentName", "parentsName", "currentGrade", "currentClass", "gender.description", "isAllowAdjust.msg", "subjectName", "actualSubjectName", "parentsPhone", "paymentStatus.desc", "kitGroupPurchaseTypeEnum.msg"}, studentApplyDetail);
|
|
|
response.setContentType("application/octet-stream");
|
|
|
response.setHeader("Content-Disposition", "attachment;filename=lender-" + DateUtil.getDate(new Date()) + ".xls");
|
|
|
response.flushBuffer();
|
|
|
- workbook.write(response.getOutputStream());
|
|
|
- workbook.close();
|
|
|
+ outputStream = response.getOutputStream();
|
|
|
+ workbook.write(outputStream);
|
|
|
+ outputStream.flush();
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
+ } finally {
|
|
|
+ if (outputStream != null) {
|
|
|
+ try {
|
|
|
+ outputStream.close();
|
|
|
+ } catch (IOException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "分页导出教师薪酬列表")
|
|
|
@RequestMapping("courseScheduleTeacherSalary/export")
|
|
|
@PreAuthorize("@pcs.hasPermissions('courseScheduleTeacherSalary/export')")
|
|
|
- public void export(CourseScheduleTeacherSalaryQueryInfo queryInfo, HttpServletResponse response) {
|
|
|
+ public void export(CourseScheduleTeacherSalaryQueryInfo queryInfo, HttpServletResponse response) throws IOException {
|
|
|
queryInfo.setIsExport(true);
|
|
|
List<TeacherSalaryDto> teacherSalaries = courseScheduleTeacherSalaryService.querySalaries(queryInfo).getRows();
|
|
|
+ OutputStream outputStream = response.getOutputStream();
|
|
|
try {
|
|
|
HSSFWorkbook workbook = POIUtil.exportExcel(new String[]{"用户编号", "用户名", "手机号", "课程类型", "实际薪水", "补助", "结算时间", "教师角色"}, new String[]{
|
|
|
"userId", "username", "phone", "type.msg", "name", "actualSalary", "subsidy", "settlementTime", "teacherRole.msg"}, teacherSalaries);
|
|
|
response.setContentType("application/octet-stream");
|
|
|
response.setHeader("Content-Disposition", "attachment;filename=lender-" + DateUtil.getDate(new Date()) + ".xls");
|
|
|
response.flushBuffer();
|
|
|
- workbook.write(response.getOutputStream());
|
|
|
- workbook.close();
|
|
|
+ outputStream = response.getOutputStream();
|
|
|
+ workbook.write(outputStream);
|
|
|
+ outputStream.flush();
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
+ } finally {
|
|
|
+ if (outputStream != null) {
|
|
|
+ try {
|
|
|
+ outputStream.close();
|
|
|
+ } catch (IOException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "订单列表导出")
|
|
|
@RequestMapping("export/orderList")
|
|
|
@PreAuthorize("@pcs.hasPermissions('export/orderList')")
|
|
|
- public void orderList(StudentPaymentOrderQueryInfo queryInfo, HttpServletResponse response) {
|
|
|
+ public void orderList(StudentPaymentOrderQueryInfo queryInfo, HttpServletResponse response) throws IOException {
|
|
|
SysUser sysUser = sysUserFeignService.queryUserInfo();
|
|
|
if (!sysUser.getIsSuperAdmin()) {
|
|
|
Employee employee = employeeDao.get(sysUser.getId());
|
|
@@ -498,7 +609,7 @@ public class ExportController extends BaseController {
|
|
|
if (studentPaymentOrderExportDtos.size() > 50000) {
|
|
|
throw new BizException("数据集太大,不能导出.最大数据集不能超过50000");
|
|
|
}
|
|
|
-
|
|
|
+ OutputStream outputStream = response.getOutputStream();
|
|
|
long i = 1;
|
|
|
for (StudentPaymentOrderExportDto row : studentPaymentOrderExportDtos) {
|
|
|
if (queryInfo.getOrderType().equals("1")) {
|
|
@@ -618,10 +729,19 @@ public class ExportController extends BaseController {
|
|
|
response.setContentType("application/octet-stream");
|
|
|
response.setHeader("Content-Disposition", "attachment;filename=lender-" + DateUtil.getDate(new Date()) + ".xls");
|
|
|
response.flushBuffer();
|
|
|
- workbook.write(response.getOutputStream());
|
|
|
- workbook.close();
|
|
|
+ outputStream = response.getOutputStream();
|
|
|
+ workbook.write(outputStream);
|
|
|
+ outputStream.flush();
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
+ } finally {
|
|
|
+ if (outputStream != null) {
|
|
|
+ try {
|
|
|
+ outputStream.close();
|
|
|
+ } catch (IOException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -629,10 +749,11 @@ public class ExportController extends BaseController {
|
|
|
@ApiOperation(value = "乐团管理--乐团详情-导出学员列表")
|
|
|
@RequestMapping("export/musicGroupStudent")
|
|
|
@PreAuthorize("@pcs.hasPermissions('export/musicGroupStudent')")
|
|
|
- public void queryMusicGroupStudent(MusicGroupStudentQueryInfo queryInfo, HttpServletResponse response) {
|
|
|
+ public void queryMusicGroupStudent(MusicGroupStudentQueryInfo queryInfo, HttpServletResponse response) throws IOException {
|
|
|
queryInfo.setIsExport(true);
|
|
|
queryInfo.setRows(99999);
|
|
|
PageInfo<MusicGroupStudentsDto> musicGroupStudentsDtoPageInfo = studentManageService.queryMusicGroupStudent(queryInfo);
|
|
|
+ OutputStream outputStream = response.getOutputStream();
|
|
|
try {
|
|
|
for (MusicGroupStudentsDto row : musicGroupStudentsDtoPageInfo.getRows()) {
|
|
|
if (row.getGender() != null) {
|
|
@@ -678,10 +799,19 @@ public class ExportController extends BaseController {
|
|
|
response.setContentType("application/octet-stream");
|
|
|
response.setHeader("Content-Disposition", "attachment;filename=lender-" + DateUtil.getDate(new Date()) + ".xls");
|
|
|
response.flushBuffer();
|
|
|
- workbook.write(response.getOutputStream());
|
|
|
- workbook.close();
|
|
|
+ outputStream = response.getOutputStream();
|
|
|
+ workbook.write(outputStream);
|
|
|
+ outputStream.flush();
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
+ } finally {
|
|
|
+ if (outputStream != null) {
|
|
|
+ try {
|
|
|
+ outputStream.close();
|
|
|
+ } catch (IOException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -704,6 +834,7 @@ public class ExportController extends BaseController {
|
|
|
response.flushBuffer();
|
|
|
return;
|
|
|
}
|
|
|
+ OutputStream outputStream = response.getOutputStream();
|
|
|
try {
|
|
|
for (CourseReviewDto row : practiceGroupReviews.getRows()) {
|
|
|
row.setClassDateStr(DateUtil.dateToString(row.getClassDate(), "yyyy-MM-dd"));
|
|
@@ -749,10 +880,19 @@ public class ExportController extends BaseController {
|
|
|
response.setContentType("application/octet-stream");
|
|
|
response.setHeader("Content-Disposition", "attachment;filename=lender-" + DateUtil.getDate(new Date()) + ".xls");
|
|
|
response.flushBuffer();
|
|
|
- workbook.write(response.getOutputStream());
|
|
|
- workbook.close();
|
|
|
+ outputStream = response.getOutputStream();
|
|
|
+ workbook.write(outputStream);
|
|
|
+ outputStream.flush();
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
+ } finally {
|
|
|
+ if (outputStream != null) {
|
|
|
+ try {
|
|
|
+ outputStream.close();
|
|
|
+ } catch (IOException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -776,6 +916,7 @@ public class ExportController extends BaseController {
|
|
|
response.flushBuffer();
|
|
|
return;
|
|
|
}
|
|
|
+ OutputStream outputStream = response.getOutputStream();
|
|
|
Set<Integer> studentIds = practiceGroupExports.stream().map(CourseGroupExportDto::getStudentId).collect(Collectors.toSet());
|
|
|
List<CourseGroupExportDto> studentCourseInfos = courseScheduleDao.getStudentCourseInfo(studentIds, GroupType.PRACTICE);
|
|
|
|
|
@@ -806,16 +947,25 @@ public class ExportController extends BaseController {
|
|
|
}
|
|
|
|
|
|
try {
|
|
|
- String[] header = {"分部", "学生编号", "学生姓名", "网管课老师id", "网管课老师", "有效期截止时间", "课程截止时间", "总课时", "剩余课时"};
|
|
|
- String[] body = {"organName", "studentId", "studentName", "teacherIds", "teacherName", "expireDate", "classEndDate", "totalClassTimes", "noStartClassTimes"};
|
|
|
+ String[] header = {"分部", "学生编号", "学生姓名", "网管课老师id", "网管课老师", "有效期截止时间", "课程截止时间", "总课时", "剩余课时", "是否购买"};
|
|
|
+ String[] body = {"organName", "studentId", "studentName", "teacherIds", "teacherName", "expireDate", "classEndDate", "totalClassTimes", "noStartClassTimes","buyPractice.msg"};
|
|
|
HSSFWorkbook workbook = POIUtil.exportExcel(header, body, practiceGroupExports);
|
|
|
response.setContentType("application/octet-stream");
|
|
|
response.setHeader("Content-Disposition", "attachment;filename=lender-" + DateUtil.getDate(new Date()) + ".xls");
|
|
|
response.flushBuffer();
|
|
|
- workbook.write(response.getOutputStream());
|
|
|
- workbook.close();
|
|
|
+ outputStream = response.getOutputStream();
|
|
|
+ workbook.write(outputStream);
|
|
|
+ outputStream.flush();
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
+ } finally {
|
|
|
+ if (outputStream != null) {
|
|
|
+ try {
|
|
|
+ outputStream.close();
|
|
|
+ } catch (IOException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -838,6 +988,7 @@ public class ExportController extends BaseController {
|
|
|
response.flushBuffer();
|
|
|
return;
|
|
|
}
|
|
|
+ OutputStream outputStream = response.getOutputStream();
|
|
|
Set<Integer> studentIds = vipGroupExports.stream().map(CourseGroupExportDto::getStudentId).collect(Collectors.toSet());
|
|
|
List<CourseGroupExportDto> studentCourseInfos = courseScheduleDao.getStudentCourseInfo(studentIds, GroupType.VIP);
|
|
|
List<CourseGroupExportDto> totalClassTimes = courseScheduleDao.getStudentCourseScheduleNum(studentIds, GroupType.VIP, null);
|
|
@@ -874,10 +1025,19 @@ public class ExportController extends BaseController {
|
|
|
response.setContentType("application/octet-stream");
|
|
|
response.setHeader("Content-Disposition", "attachment;filename=lender-" + DateUtil.getDate(new Date()) + ".xls");
|
|
|
response.flushBuffer();
|
|
|
- workbook.write(response.getOutputStream());
|
|
|
- workbook.close();
|
|
|
+ outputStream = response.getOutputStream();
|
|
|
+ workbook.write(outputStream);
|
|
|
+ outputStream.flush();
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
+ } finally {
|
|
|
+ if (outputStream != null) {
|
|
|
+ try {
|
|
|
+ outputStream.close();
|
|
|
+ } catch (IOException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|