|
@@ -2,6 +2,7 @@ package com.ym.mec.web.controller;
|
|
|
|
|
|
import com.ym.mec.biz.dal.dto.StudentApplyDetailDto;
|
|
|
import com.ym.mec.biz.dal.dto.TeacherSalaryDto;
|
|
|
+import com.ym.mec.biz.dal.dto.musicalListDetailDto;
|
|
|
import com.ym.mec.biz.dal.entity.Goods;
|
|
|
import com.ym.mec.biz.dal.page.CourseScheduleTeacherSalaryQueryInfo;
|
|
|
import com.ym.mec.biz.dal.page.StudentRegistrationQueryInfo;
|
|
@@ -46,25 +47,36 @@ public class ExportController extends BaseController {
|
|
|
if(musicalList == null || musicalList.size() < 1){
|
|
|
throw new BizException("数据为空");
|
|
|
}
|
|
|
- OutputStream outputStream = null;
|
|
|
try {
|
|
|
HSSFWorkbook workbook = POIUtil.exportExcel(new String[] {"乐团","分部","商品类型", "商品名称", "型号", "数量"}, new String[] {
|
|
|
"brief","memo","type.desc","name","specification","sellCount"}, musicalList);
|
|
|
- response.setContentType("application/msexcel");
|
|
|
- response.setHeader("Content-disposition", "attachment;filename=lender-" + DateUtil.getDate(new Date()) + ".xls");
|
|
|
- outputStream = response.getOutputStream();
|
|
|
- workbook.write(outputStream);
|
|
|
- outputStream.flush();
|
|
|
+ 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();
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value = "导出学员采购清单明细")
|
|
|
+ @PostMapping("order/musicalListDetailExport")
|
|
|
+ public void musicalListDetailExport(HttpServletResponse response, String musicGroupId){
|
|
|
+ List<musicalListDetailDto> musicalList = studentPaymentOrderDetailService.getMusicalListDetail(musicGroupId);
|
|
|
+ if(musicalList == null || musicalList.size() < 1){
|
|
|
+ throw new BizException("数据为空");
|
|
|
+ }
|
|
|
+ try {
|
|
|
+ HSSFWorkbook workbook = POIUtil.exportExcel(new String[] {"乐团","学员编号","购买商品","学员姓名", "分部", "采购方式", "乐器金额", "教辅金额", "课程金额", "订单总价"}, new String[] {
|
|
|
+ "musicGroupName","userId","goodsNames","username","organName","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();
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
- } finally {
|
|
|
- if (outputStream != null) {
|
|
|
- try {
|
|
|
- outputStream.close();
|
|
|
- } catch (IOException e) {
|
|
|
- e.printStackTrace();
|
|
|
- }
|
|
|
- }
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -93,25 +105,16 @@ public class ExportController extends BaseController {
|
|
|
@RequestMapping("courseScheduleTeacherSalary/export")
|
|
|
public void export(CourseScheduleTeacherSalaryQueryInfo queryInfo, HttpServletResponse response) {
|
|
|
List<TeacherSalaryDto> teacherSalaries = courseScheduleTeacherSalaryService.querySalaries(queryInfo).getRows();
|
|
|
- OutputStream ouputStream = null;
|
|
|
try {
|
|
|
HSSFWorkbook workbook = POIUtil.exportExcel(new String[] { "用户编号","用户名", "手机号", "课程类型", "实际薪水", "补助", "结算时间", "教师角色"}, new String[] {
|
|
|
"userId","username", "phone", "type.msg", "name", "actualSalary", "subsidy", "settlementTime", "teacherRole.msg"}, teacherSalaries);
|
|
|
- response.setContentType("application/vnd.ms-excel");
|
|
|
- response.setHeader("Content-disposition", "attachment;filename=lender-" + DateUtil.getDate(new Date()) + ".xls");
|
|
|
- ouputStream = response.getOutputStream();
|
|
|
- workbook.write(ouputStream);
|
|
|
- ouputStream.flush();
|
|
|
+ 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();
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
- } finally {
|
|
|
- if (ouputStream != null) {
|
|
|
- try {
|
|
|
- ouputStream.close();
|
|
|
- } catch (IOException e) {
|
|
|
- e.printStackTrace();
|
|
|
- }
|
|
|
- }
|
|
|
}
|
|
|
}
|
|
|
|