|  | @@ -28,6 +28,7 @@ import com.ym.mec.util.ini.IniFileUtil;
 | 
	
		
			
				|  |  |  import com.ym.mec.util.upload.UploadUtil;
 | 
	
		
			
				|  |  |  import org.apache.commons.lang3.StringUtils;
 | 
	
		
			
				|  |  |  import org.apache.poi.hssf.usermodel.HSSFWorkbook;
 | 
	
		
			
				|  |  | +import org.apache.poi.ss.formula.functions.T;
 | 
	
		
			
				|  |  |  import org.springframework.beans.factory.annotation.Autowired;
 | 
	
		
			
				|  |  |  import org.springframework.beans.factory.annotation.Value;
 | 
	
		
			
				|  |  |  import org.springframework.boot.system.ApplicationHome;
 | 
	
	
		
			
				|  | @@ -39,6 +40,7 @@ import org.springframework.util.CollectionUtils;
 | 
	
		
			
				|  |  |  import javax.annotation.PostConstruct;
 | 
	
		
			
				|  |  |  import javax.servlet.http.HttpServletResponse;
 | 
	
		
			
				|  |  |  import java.io.*;
 | 
	
		
			
				|  |  | +import java.lang.reflect.InvocationTargetException;
 | 
	
		
			
				|  |  |  import java.math.BigDecimal;
 | 
	
		
			
				|  |  |  import java.util.*;
 | 
	
		
			
				|  |  |  import java.util.concurrent.CompletableFuture;
 | 
	
	
		
			
				|  | @@ -1599,7 +1601,7 @@ public class ExportServiceImpl implements ExportService {
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      @Override
 | 
	
		
			
				|  |  | -    public void orderList(Map<String, Object> params, ManagerDownload managerDownload,List<String> headColumns) throws FileNotFoundException {
 | 
	
		
			
				|  |  | +    public void orderList(Map<String, Object> params, ManagerDownload managerDownload,List<String> headColumns) throws IOException, NoSuchMethodException, IllegalAccessException, InvocationTargetException {
 | 
	
		
			
				|  |  |          List<StudentPaymentOrderExportDto> studentPaymentOrderExportDtos = studentPaymentOrderService.ExportQueryPage(params);
 | 
	
		
			
				|  |  |          long i = 1;
 | 
	
		
			
				|  |  |          Map<Integer, String> cooperationOrganMap = new HashMap<>();
 | 
	
	
		
			
				|  | @@ -2021,42 +2023,12 @@ public class ExportServiceImpl implements ExportService {
 | 
	
		
			
				|  |  |              row.setOrderAmount(row.getExpectAmount().add(row.getCouponRemitFee()));
 | 
	
		
			
				|  |  |              i++;
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -        String basePath = new ApplicationHome(this.getClass()).getSource().getParentFile().getPath();
 | 
	
		
			
				|  |  | -        File file = new File(basePath + "/" + managerDownload.getName());
 | 
	
		
			
				|  |  | -        FileOutputStream fileOutputStream = new FileOutputStream(file);
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -        HSSFWorkbook workbook = null;
 | 
	
		
			
				|  |  | -        try {
 | 
	
		
			
				|  |  | -            Map<String, String> headMap = getExportMap(new ExportDto(ExportEnum.ORDER_LIST1, headColumns));
 | 
	
		
			
				|  |  | -            String[] header = headMap.keySet().toArray(new String[headMap.keySet().size()]);
 | 
	
		
			
				|  |  | -            String[] body = headMap.values().toArray(new String[headMap.keySet().size()]);
 | 
	
		
			
				|  |  | -            workbook = POIUtil.exportExcel(header, body, studentPaymentOrderExportDtos);
 | 
	
		
			
				|  |  | -            workbook.write(fileOutputStream);
 | 
	
		
			
				|  |  | -            fileOutputStream.getFD().sync();
 | 
	
		
			
				|  |  | -            fileOutputStream.close();
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -            String folder = "download/" + UploadUtil.getFileFloder();
 | 
	
		
			
				|  |  | -            String url = storagePluginContext.uploadFile(KS3StoragePlugin.PLUGIN_NAME, folder, file);
 | 
	
		
			
				|  |  | -            //把记录插入下载表
 | 
	
		
			
				|  |  | -            managerDownload.setFileUrl(url);
 | 
	
		
			
				|  |  | -            managerDownload.setStatus(1);
 | 
	
		
			
				|  |  | -            managerDownloadDao.update(managerDownload);
 | 
	
		
			
				|  |  | -        } catch (Exception e) {
 | 
	
		
			
				|  |  | -            e.printStackTrace();
 | 
	
		
			
				|  |  | -        } finally {
 | 
	
		
			
				|  |  | -            try {
 | 
	
		
			
				|  |  | -                fileOutputStream.close();
 | 
	
		
			
				|  |  | -                workbook.close();
 | 
	
		
			
				|  |  | -                file.delete();
 | 
	
		
			
				|  |  | -            } catch (IOException e) {
 | 
	
		
			
				|  |  | -                e.printStackTrace();
 | 
	
		
			
				|  |  | -            }
 | 
	
		
			
				|  |  | -        }
 | 
	
		
			
				|  |  | +        HSSFWorkbook workbook = getHSSFWorkbook(studentPaymentOrderExportDtos,headColumns,ExportEnum.ORDER_LIST1);
 | 
	
		
			
				|  |  | +        exportManagerDownload(workbook,managerDownload);
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      @Override
 | 
	
		
			
				|  |  | -    public void orderListSum(Map<String, Object> params, ManagerDownload managerDownload,List<String> headColumns) throws FileNotFoundException {
 | 
	
		
			
				|  |  | +    public void orderListSum(Map<String, Object> params, ManagerDownload managerDownload,List<String> headColumns) throws IOException, NoSuchMethodException, IllegalAccessException, InvocationTargetException {
 | 
	
		
			
				|  |  |          List<StudentPaymentOrderExportDto> studentPaymentOrderExportDtos = studentPaymentOrderService.ExportQueryPage(params);
 | 
	
		
			
				|  |  |          //获取机构费率
 | 
	
		
			
				|  |  |          Integer tenantId = (Integer) params.get("tenantId");
 | 
	
	
		
			
				|  | @@ -2314,41 +2286,12 @@ public class ExportServiceImpl implements ExportService {
 | 
	
		
			
				|  |  |              exportDtoList.add(exportDto);
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -        String basePath = new ApplicationHome(this.getClass()).getSource().getParentFile().getPath();
 | 
	
		
			
				|  |  | -        File file = new File(basePath + "/" + managerDownload.getName());
 | 
	
		
			
				|  |  | -        FileOutputStream fileOutputStream = new FileOutputStream(file);
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -        HSSFWorkbook workbook = null;
 | 
	
		
			
				|  |  | -        try {
 | 
	
		
			
				|  |  | -            Map<String, String> headMap = getExportMap(new ExportDto(ExportEnum.ORDER_LIST_SUM, headColumns));
 | 
	
		
			
				|  |  | -            String[] header = headMap.keySet().toArray(new String[headMap.keySet().size()]);
 | 
	
		
			
				|  |  | -            String[] body = headMap.values().toArray(new String[headMap.keySet().size()]);
 | 
	
		
			
				|  |  | -            workbook = POIUtil.exportExcel(header, body, exportDtoList);
 | 
	
		
			
				|  |  | -            workbook.write(fileOutputStream);
 | 
	
		
			
				|  |  | -            fileOutputStream.getFD().sync();
 | 
	
		
			
				|  |  | -            fileOutputStream.close();
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -            String folder = "download/" + UploadUtil.getFileFloder();
 | 
	
		
			
				|  |  | -            String url = storagePluginContext.uploadFile(KS3StoragePlugin.PLUGIN_NAME, folder, file);
 | 
	
		
			
				|  |  | -            //把记录插入下载表
 | 
	
		
			
				|  |  | -            managerDownload.setFileUrl(url);
 | 
	
		
			
				|  |  | -            managerDownload.setStatus(1);
 | 
	
		
			
				|  |  | -            managerDownloadDao.update(managerDownload);
 | 
	
		
			
				|  |  | -        } catch (Exception e) {
 | 
	
		
			
				|  |  | -            e.printStackTrace();
 | 
	
		
			
				|  |  | -        } finally {
 | 
	
		
			
				|  |  | -            try {
 | 
	
		
			
				|  |  | -                fileOutputStream.close();
 | 
	
		
			
				|  |  | -                workbook.close();
 | 
	
		
			
				|  |  | -                file.delete();
 | 
	
		
			
				|  |  | -            } catch (IOException e) {
 | 
	
		
			
				|  |  | -                e.printStackTrace();
 | 
	
		
			
				|  |  | -            }
 | 
	
		
			
				|  |  | -        }
 | 
	
		
			
				|  |  | +        HSSFWorkbook workbook = getHSSFWorkbook(exportDtoList,headColumns,ExportEnum.ORDER_LIST_SUM);
 | 
	
		
			
				|  |  | +        exportManagerDownload(workbook,managerDownload);
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      @Override
 | 
	
		
			
				|  |  | -    public void routeOrderList(Map<String, Object> params, ManagerDownload managerDownload,List<String> headColumns) throws FileNotFoundException {
 | 
	
		
			
				|  |  | +    public void routeOrderList(Map<String, Object> params, ManagerDownload managerDownload,List<String> headColumns) throws IOException, NoSuchMethodException, IllegalAccessException, InvocationTargetException {
 | 
	
		
			
				|  |  |          List<StudentPaymentOrderExportDto> studentPaymentOrderExportDtos = studentPaymentRouteOrderDao.ExportQueryPage(params);
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |          Map<Integer, String> cooperationOrganMap = new HashMap<>();
 | 
	
	
		
			
				|  | @@ -2869,82 +2812,26 @@ public class ExportServiceImpl implements ExportService {
 | 
	
		
			
				|  |  |              List<String> organIds = Arrays.asList(organIdArr);
 | 
	
		
			
				|  |  |              studentPaymentOrderExportDtos.removeIf(order -> !organIds.contains(order.getOrganId().toString()));
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -        String basePath = new ApplicationHome(this.getClass()).getSource().getParentFile().getPath();
 | 
	
		
			
				|  |  | -        File file = new File(basePath + "/" + managerDownload.getName());
 | 
	
		
			
				|  |  | -        FileOutputStream fileOutputStream = new FileOutputStream(file);
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -        HSSFWorkbook workbook = null;
 | 
	
		
			
				|  |  | -        try {
 | 
	
		
			
				|  |  | -            Map<String, String> headMap = getExportMap(new ExportDto(ExportEnum.ROUTE_ORDER_LIST1, headColumns));
 | 
	
		
			
				|  |  | -            String[] header = headMap.keySet().toArray(new String[headMap.keySet().size()]);
 | 
	
		
			
				|  |  | -            String[] body = headMap.values().toArray(new String[headMap.keySet().size()]);
 | 
	
		
			
				|  |  | -            workbook = POIUtil.exportExcel(header, body, studentPaymentOrderExportDtos);
 | 
	
		
			
				|  |  | -            workbook.write(fileOutputStream);
 | 
	
		
			
				|  |  | -            fileOutputStream.getFD().sync();
 | 
	
		
			
				|  |  | -            fileOutputStream.close();
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -            String folder = "download/" + UploadUtil.getFileFloder();
 | 
	
		
			
				|  |  | -            String url = storagePluginContext.uploadFile(KS3StoragePlugin.PLUGIN_NAME, folder, file);
 | 
	
		
			
				|  |  | -            //把记录插入下载表
 | 
	
		
			
				|  |  | -            managerDownload.setFileUrl(url);
 | 
	
		
			
				|  |  | -            managerDownload.setStatus(1);
 | 
	
		
			
				|  |  | -            managerDownloadDao.update(managerDownload);
 | 
	
		
			
				|  |  | -        } catch (Exception e) {
 | 
	
		
			
				|  |  | -            e.printStackTrace();
 | 
	
		
			
				|  |  | -        } finally {
 | 
	
		
			
				|  |  | -            try {
 | 
	
		
			
				|  |  | -                fileOutputStream.close();
 | 
	
		
			
				|  |  | -                workbook.close();
 | 
	
		
			
				|  |  | -                file.delete();
 | 
	
		
			
				|  |  | -            } catch (IOException e) {
 | 
	
		
			
				|  |  | -                e.printStackTrace();
 | 
	
		
			
				|  |  | -            }
 | 
	
		
			
				|  |  | -        }
 | 
	
		
			
				|  |  | +        HSSFWorkbook workbook = getHSSFWorkbook(studentPaymentOrderExportDtos,headColumns,ExportEnum.ROUTE_ORDER_LIST1);
 | 
	
		
			
				|  |  | +        exportManagerDownload(workbook,managerDownload);
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      @Override
 | 
	
		
			
				|  |  | -    public void superFindCourseSchedules(EndCourseScheduleQueryInfo queryInfo, ManagerDownload managerDownload) throws FileNotFoundException {
 | 
	
		
			
				|  |  | +    public void superFindCourseSchedules(EndCourseScheduleQueryInfo queryInfo, ManagerDownload managerDownload) throws IOException, InvocationTargetException, NoSuchMethodException, IllegalAccessException {
 | 
	
		
			
				|  |  |          List<CourseScheduleEndDto> rows = courseScheduleService.endFindCourseSchedules(queryInfo).getRows();
 | 
	
		
			
				|  |  |          for (CourseScheduleEndDto row : rows) {
 | 
	
		
			
				|  |  |              row.setIsComplaints(StringUtils.equals(row.getIsComplaints(), "1") ? "有" : "无");
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  | -        String basePath = new ApplicationHome(this.getClass()).getSource().getParentFile().getPath();
 | 
	
		
			
				|  |  | -        File file = new File(basePath + "/" + managerDownload.getName());
 | 
	
		
			
				|  |  | -        FileOutputStream fileOutputStream = new FileOutputStream(file);
 | 
	
		
			
				|  |  | -        OutputStream ouputStream = null;
 | 
	
		
			
				|  |  | -        try {
 | 
	
		
			
				|  |  | -            HSSFWorkbook workbook = POIUtil.exportExcel(new String[]{"分部名称", "乐团主管", "课程编号", "开始时间", "结束时间",
 | 
	
		
			
				|  |  | -                    "班级名称", "班级声部", "课程名称", "课程类型", "教学模式",
 | 
	
		
			
				|  |  | -                    "教学点", "课程状态", "指导老师", "学员编号", "是否点名", "是否有考勤申诉", "预计上课人数"}, new String[]{
 | 
	
		
			
				|  |  | -                    "organName", "educationTeacherName", "id", "startClassTime", "endClassTime", "classGroupName", "subjectName", "name",
 | 
	
		
			
				|  |  | -                    "groupType.desc", "teachMode.msg", "schoolName", "status.msg", "teacherName", "studentId", "isCallNames.msg", "isComplaints", "studentNum"}, rows);
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -            workbook.write(fileOutputStream);
 | 
	
		
			
				|  |  | -            fileOutputStream.getFD().sync();
 | 
	
		
			
				|  |  | -            fileOutputStream.close();
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -            String folder = "download/" + UploadUtil.getFileFloder();
 | 
	
		
			
				|  |  | -            String url = storagePluginContext.uploadFile(KS3StoragePlugin.PLUGIN_NAME, folder, file);
 | 
	
		
			
				|  |  | -            //把记录插入下载表
 | 
	
		
			
				|  |  | -            managerDownload.setFileUrl(url);
 | 
	
		
			
				|  |  | -            managerDownload.setStatus(1);
 | 
	
		
			
				|  |  | -            managerDownloadDao.update(managerDownload);
 | 
	
		
			
				|  |  | -        } catch (Exception e) {
 | 
	
		
			
				|  |  | -            e.printStackTrace();
 | 
	
		
			
				|  |  | -        } finally {
 | 
	
		
			
				|  |  | -            if (ouputStream != null) {
 | 
	
		
			
				|  |  | -                try {
 | 
	
		
			
				|  |  | -                    ouputStream.close();
 | 
	
		
			
				|  |  | -                } catch (IOException e) {
 | 
	
		
			
				|  |  | -                    e.printStackTrace();
 | 
	
		
			
				|  |  | -                }
 | 
	
		
			
				|  |  | -            }
 | 
	
		
			
				|  |  | -        }
 | 
	
		
			
				|  |  | +        HSSFWorkbook workbook = POIUtil.exportExcel(new String[]{"分部名称", "乐团主管", "课程编号", "开始时间", "结束时间",
 | 
	
		
			
				|  |  | +                "班级名称", "班级声部", "课程名称", "课程类型", "教学模式",
 | 
	
		
			
				|  |  | +                "教学点", "课程状态", "指导老师", "学员编号", "是否点名", "是否有考勤申诉", "预计上课人数"}, new String[]{
 | 
	
		
			
				|  |  | +                "organName", "educationTeacherName", "id", "startClassTime", "endClassTime", "classGroupName", "subjectName", "name",
 | 
	
		
			
				|  |  | +                "groupType.desc", "teachMode.msg", "schoolName", "status.msg", "teacherName", "studentId", "isCallNames.msg", "isComplaints", "studentNum"}, rows);
 | 
	
		
			
				|  |  | +        exportManagerDownload(workbook,managerDownload);
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      @Override
 | 
	
		
			
				|  |  | -    public void studentVipPractice(String organId, ManagerDownload managerDownload, Integer tenantId,List<String> headColumns) throws FileNotFoundException {
 | 
	
		
			
				|  |  | +    public void studentVipPractice(String organId, ManagerDownload managerDownload, Integer tenantId,List<String> headColumns) throws IOException, NoSuchMethodException, IllegalAccessException, InvocationTargetException {
 | 
	
		
			
				|  |  |          List<StudentVipPracticeExportDto> studentVipPracticeExportDtos = courseScheduleStudentPaymentDao.exportStudentVipPractice(organId, tenantId);
 | 
	
		
			
				|  |  |          if(studentVipPracticeExportDtos != null && studentVipPracticeExportDtos.size() > 0){
 | 
	
		
			
				|  |  |              List<Integer> studentIds = studentVipPracticeExportDtos.stream().map(e -> e.getUserId()).distinct().collect(Collectors.toList());
 | 
	
	
		
			
				|  | @@ -3011,171 +2898,68 @@ public class ExportServiceImpl implements ExportService {
 | 
	
		
			
				|  |  |                  }
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  | -        String basePath = new ApplicationHome(this.getClass()).getSource().getParentFile().getPath();
 | 
	
		
			
				|  |  | -        File file = new File(basePath + "/" + managerDownload.getName());
 | 
	
		
			
				|  |  | -        FileOutputStream fileOutputStream = new FileOutputStream(file);
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -        HSSFWorkbook workbook = null;
 | 
	
		
			
				|  |  | -        try {
 | 
	
		
			
				|  |  | -            Map<String, String> headMap = getExportMap(new ExportDto(ExportEnum.STUDENT_VIP_PRACTICE, headColumns));
 | 
	
		
			
				|  |  | -            String[] header = headMap.keySet().toArray(new String[headMap.keySet().size()]);
 | 
	
		
			
				|  |  | -            String[] body = headMap.values().toArray(new String[headMap.keySet().size()]);
 | 
	
		
			
				|  |  | -            workbook = POIUtil.exportExcel(header, body, studentVipPracticeExportDtos);
 | 
	
		
			
				|  |  | -            workbook.write(fileOutputStream);
 | 
	
		
			
				|  |  | -            fileOutputStream.getFD().sync();
 | 
	
		
			
				|  |  | -            fileOutputStream.close();
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -            String folder = "download/" + UploadUtil.getFileFloder();
 | 
	
		
			
				|  |  | -            String url = storagePluginContext.uploadFile(KS3StoragePlugin.PLUGIN_NAME, folder, file);
 | 
	
		
			
				|  |  | -            //把记录插入下载表
 | 
	
		
			
				|  |  | -            managerDownload.setFileUrl(url);
 | 
	
		
			
				|  |  | -            managerDownload.setStatus(1);
 | 
	
		
			
				|  |  | -            managerDownloadDao.update(managerDownload);
 | 
	
		
			
				|  |  | -        } catch (Exception e) {
 | 
	
		
			
				|  |  | -            e.printStackTrace();
 | 
	
		
			
				|  |  | -        } finally {
 | 
	
		
			
				|  |  | -            try {
 | 
	
		
			
				|  |  | -                fileOutputStream.close();
 | 
	
		
			
				|  |  | -                workbook.close();
 | 
	
		
			
				|  |  | -                file.delete();
 | 
	
		
			
				|  |  | -            } catch (IOException e) {
 | 
	
		
			
				|  |  | -                e.printStackTrace();
 | 
	
		
			
				|  |  | -            }
 | 
	
		
			
				|  |  | -        }
 | 
	
		
			
				|  |  | +        HSSFWorkbook workbook = getHSSFWorkbook(studentVipPracticeExportDtos,headColumns,ExportEnum.STUDENT_VIP_PRACTICE);
 | 
	
		
			
				|  |  | +        exportManagerDownload(workbook,managerDownload);
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      @Override
 | 
	
		
			
				|  |  | -    public void queryStudentCourseInfo(String organId, Integer tenantId, String groupType, ManagerDownload managerDownload, List<String> headColumns,ExportEnum exportEnum) throws FileNotFoundException {
 | 
	
		
			
				|  |  | -        List<ExportStudentCourseInfoDto> studentCourseInfoDtos = courseScheduleStudentPaymentDao.queryStudentCourseInfo(organId,tenantId,groupType);
 | 
	
		
			
				|  |  | -        String basePath = new ApplicationHome(this.getClass()).getSource().getParentFile().getPath();
 | 
	
		
			
				|  |  | -        File file = new File(basePath + "/" + managerDownload.getName());
 | 
	
		
			
				|  |  | -        FileOutputStream fileOutputStream = new FileOutputStream(file);
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -        HSSFWorkbook workbook = null;
 | 
	
		
			
				|  |  | -        try {
 | 
	
		
			
				|  |  | -            Map<String, String> headMap = getExportMap(new ExportDto(exportEnum, headColumns));
 | 
	
		
			
				|  |  | -            String[] header = headMap.keySet().toArray(new String[headMap.keySet().size()]);
 | 
	
		
			
				|  |  | -            String[] body = headMap.values().toArray(new String[headMap.keySet().size()]);
 | 
	
		
			
				|  |  | -            workbook = POIUtil.exportExcel(header, body, studentCourseInfoDtos);
 | 
	
		
			
				|  |  | -            workbook.write(fileOutputStream);
 | 
	
		
			
				|  |  | -            fileOutputStream.getFD().sync();
 | 
	
		
			
				|  |  | -            fileOutputStream.close();
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -            String folder = "download/" + UploadUtil.getFileFloder();
 | 
	
		
			
				|  |  | -            String url = storagePluginContext.uploadFile(KS3StoragePlugin.PLUGIN_NAME, folder, file);
 | 
	
		
			
				|  |  | -            //把记录插入下载表
 | 
	
		
			
				|  |  | -            managerDownload.setFileUrl(url);
 | 
	
		
			
				|  |  | -            managerDownload.setStatus(1);
 | 
	
		
			
				|  |  | -            managerDownloadDao.update(managerDownload);
 | 
	
		
			
				|  |  | -        } catch (Exception e) {
 | 
	
		
			
				|  |  | -            e.printStackTrace();
 | 
	
		
			
				|  |  | -        } finally {
 | 
	
		
			
				|  |  | -            try {
 | 
	
		
			
				|  |  | -                fileOutputStream.close();
 | 
	
		
			
				|  |  | -                workbook.close();
 | 
	
		
			
				|  |  | -                file.delete();
 | 
	
		
			
				|  |  | -            } catch (IOException e) {
 | 
	
		
			
				|  |  | -                e.printStackTrace();
 | 
	
		
			
				|  |  | -            }
 | 
	
		
			
				|  |  | -        }
 | 
	
		
			
				|  |  | +    public void queryStudentCourseInfo(String organId, Integer tenantId, String groupType, ManagerDownload managerDownload, List<String> headColumns,ExportEnum exportEnum) throws IOException, InvocationTargetException, NoSuchMethodException, IllegalAccessException {
 | 
	
		
			
				|  |  | +        List<ExportStudentCourseInfoDto> rows = courseScheduleStudentPaymentDao.queryStudentCourseInfo(organId,tenantId,groupType);
 | 
	
		
			
				|  |  | +        HSSFWorkbook workbook = getHSSFWorkbook(rows,headColumns,exportEnum);
 | 
	
		
			
				|  |  | +        exportManagerDownload(workbook,managerDownload);
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      @Override
 | 
	
		
			
				|  |  | -    public void queryVipStudentCourseManage(String organId, Integer tenantId, ManagerDownload managerDownload, List<String> headColumns, ExportEnum exportEnum) throws FileNotFoundException {
 | 
	
		
			
				|  |  | -        List<ExportVipStudentCourseManageDto> studentCourseInfoDtos = courseScheduleStudentPaymentDao.queryVipStudentCourseManage(organId,tenantId);
 | 
	
		
			
				|  |  | -        String basePath = new ApplicationHome(this.getClass()).getSource().getParentFile().getPath();
 | 
	
		
			
				|  |  | -        File file = new File(basePath + "/" + managerDownload.getName());
 | 
	
		
			
				|  |  | -        FileOutputStream fileOutputStream = new FileOutputStream(file);
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -        HSSFWorkbook workbook = null;
 | 
	
		
			
				|  |  | -        try {
 | 
	
		
			
				|  |  | -            Map<String, String> headMap = getExportMap(new ExportDto(exportEnum, headColumns));
 | 
	
		
			
				|  |  | -            String[] header = headMap.keySet().toArray(new String[headMap.keySet().size()]);
 | 
	
		
			
				|  |  | -            String[] body = headMap.values().toArray(new String[headMap.keySet().size()]);
 | 
	
		
			
				|  |  | -            workbook = POIUtil.exportExcel(header, body, studentCourseInfoDtos);
 | 
	
		
			
				|  |  | -            workbook.write(fileOutputStream);
 | 
	
		
			
				|  |  | -            fileOutputStream.getFD().sync();
 | 
	
		
			
				|  |  | -            fileOutputStream.close();
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -            String folder = "download/" + UploadUtil.getFileFloder();
 | 
	
		
			
				|  |  | -            String url = storagePluginContext.uploadFile(KS3StoragePlugin.PLUGIN_NAME, folder, file);
 | 
	
		
			
				|  |  | -            //把记录插入下载表
 | 
	
		
			
				|  |  | -            managerDownload.setFileUrl(url);
 | 
	
		
			
				|  |  | -            managerDownload.setStatus(1);
 | 
	
		
			
				|  |  | -            managerDownloadDao.update(managerDownload);
 | 
	
		
			
				|  |  | -        } catch (Exception e) {
 | 
	
		
			
				|  |  | -            e.printStackTrace();
 | 
	
		
			
				|  |  | -        } finally {
 | 
	
		
			
				|  |  | -            try {
 | 
	
		
			
				|  |  | -                fileOutputStream.close();
 | 
	
		
			
				|  |  | -                workbook.close();
 | 
	
		
			
				|  |  | -                file.delete();
 | 
	
		
			
				|  |  | -            } catch (IOException e) {
 | 
	
		
			
				|  |  | -                e.printStackTrace();
 | 
	
		
			
				|  |  | -            }
 | 
	
		
			
				|  |  | -        }
 | 
	
		
			
				|  |  | +    public void queryVipStudentCourseManage(String organId, Integer tenantId, ManagerDownload managerDownload, List<String> headColumns, ExportEnum exportEnum) throws IOException, IllegalAccessException, NoSuchMethodException, InvocationTargetException {
 | 
	
		
			
				|  |  | +        List<ExportVipStudentCourseManageDto> rows = courseScheduleStudentPaymentDao.queryVipStudentCourseManage(organId,tenantId);
 | 
	
		
			
				|  |  | +        HSSFWorkbook workbook = getHSSFWorkbook(rows,headColumns,exportEnum);
 | 
	
		
			
				|  |  | +        exportManagerDownload(workbook,managerDownload);
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      @Override
 | 
	
		
			
				|  |  | -    public void exportStudentSmallClassStatisticsSum(StudentStatisticsQueryInfo queryInfo, ManagerDownload managerDownload) throws FileNotFoundException {
 | 
	
		
			
				|  |  | +    public void exportStudentSmallClassStatisticsSum(StudentStatisticsQueryInfo queryInfo, ManagerDownload managerDownload) throws IOException, InvocationTargetException, NoSuchMethodException, IllegalAccessException {
 | 
	
		
			
				|  |  |          List<StudentStatisticsDto> rows = studentStatisticsService.queryStatisticsPage(queryInfo).getRows();
 | 
	
		
			
				|  |  | -        String basePath = new ApplicationHome(this.getClass()).getSource().getParentFile().getPath();
 | 
	
		
			
				|  |  | -        File file = new File(basePath + "/" + managerDownload.getName());
 | 
	
		
			
				|  |  | -        FileOutputStream fileOutputStream = new FileOutputStream(file);
 | 
	
		
			
				|  |  | -        OutputStream ouputStream = null;
 | 
	
		
			
				|  |  | -        try {
 | 
	
		
			
				|  |  | -            HSSFWorkbook workbook = POIUtil.exportExcel(new String[]{"分部", "学生姓名", "学员编号","联系电话", "声部", "学校", "年级", "学员状态", "未排课时", "总课时", "已完成课时",
 | 
	
		
			
				|  |  | -                    "剩余课时","预收金额","第一次课时间","最近上课时间","指导老师编号","指导老师","乐团主管编号","乐团主管","声部课老师编号","声部课老师","近30天课耗","回访次数",
 | 
	
		
			
				|  |  | -                    "回访状态","原因","回访日期"},
 | 
	
		
			
				|  |  | -            new String[]{"studentBasicInfo.organName", "studentBasicInfo.userName", "studentBasicInfo.userId",
 | 
	
		
			
				|  |  | -                    "studentBasicInfo.phone","studentBasicInfo.subjectName", "studentBasicInfo.cooperationOrganName", "studentBasicInfo.grade",
 | 
	
		
			
				|  |  | -                    "studentBasicInfo.studentStatus",
 | 
	
		
			
				|  |  | -                    "noScheduleNum","totalCourseNum", "overCourseNum", "subCourseNum","preCourseFee","firstCourseTime","lastCourseTime","teacherId","teacherName","musicDirectorId","musicDirectorName",
 | 
	
		
			
				|  |  | -                    "studentBasicInfo.subjectTeacherId","studentBasicInfo.subjectTeacherName","latelyCourseConsumer","visitNum",
 | 
	
		
			
				|  |  | -                    "lastVisitStatus == null?'':lastVisitStatus == 'LOST' ? '流失':lastVisitStatus == 'THINKING' ? '考虑中':" +
 | 
	
		
			
				|  |  | -                    "lastVisitStatus == 'PENDING_PAYMENT' ? '确认缴费待缴费':lastVisitStatus == 'PAUSE' ? '暂停':lastVisitStatus == 'OTHER' ? '其他':''"
 | 
	
		
			
				|  |  | -                    ,"visitReason","lastVisitTime"}, rows);
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -            workbook.write(fileOutputStream);
 | 
	
		
			
				|  |  | -            fileOutputStream.getFD().sync();
 | 
	
		
			
				|  |  | -            fileOutputStream.close();
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -            String folder = "download/" + UploadUtil.getFileFloder();
 | 
	
		
			
				|  |  | -            String url = storagePluginContext.uploadFile(KS3StoragePlugin.PLUGIN_NAME, folder, file);
 | 
	
		
			
				|  |  | -            //把记录插入下载表
 | 
	
		
			
				|  |  | -            managerDownload.setFileUrl(url);
 | 
	
		
			
				|  |  | -            managerDownload.setStatus(1);
 | 
	
		
			
				|  |  | -            managerDownloadDao.update(managerDownload);
 | 
	
		
			
				|  |  | -        } catch (Exception e) {
 | 
	
		
			
				|  |  | -            e.printStackTrace();
 | 
	
		
			
				|  |  | -        } finally {
 | 
	
		
			
				|  |  | -            if (ouputStream != null) {
 | 
	
		
			
				|  |  | -                try {
 | 
	
		
			
				|  |  | -                    ouputStream.close();
 | 
	
		
			
				|  |  | -                } catch (IOException e) {
 | 
	
		
			
				|  |  | -                    e.printStackTrace();
 | 
	
		
			
				|  |  | -                }
 | 
	
		
			
				|  |  | -            }
 | 
	
		
			
				|  |  | -        }
 | 
	
		
			
				|  |  | +        HSSFWorkbook workbook = POIUtil.exportExcel(new String[]{"分部", "学生姓名", "学员编号","联系电话", "声部", "学校", "年级", "学员状态", "未排课时", "总课时", "已完成课时",
 | 
	
		
			
				|  |  | +                        "剩余课时","预收金额","第一次课时间","最近上课时间","指导老师编号","指导老师","乐团主管编号","乐团主管","声部课老师编号","声部课老师","近30天课耗","回访次数",
 | 
	
		
			
				|  |  | +                        "回访状态","原因","回访日期"},
 | 
	
		
			
				|  |  | +                new String[]{"studentBasicInfo.organName", "studentBasicInfo.userName", "studentBasicInfo.userId",
 | 
	
		
			
				|  |  | +                        "studentBasicInfo.phone","studentBasicInfo.subjectName", "studentBasicInfo.cooperationOrganName", "studentBasicInfo.grade",
 | 
	
		
			
				|  |  | +                        "studentBasicInfo.studentStatus",
 | 
	
		
			
				|  |  | +                        "noScheduleNum","totalCourseNum", "overCourseNum", "subCourseNum","preCourseFee","firstCourseTime","lastCourseTime","teacherId","teacherName","musicDirectorId","musicDirectorName",
 | 
	
		
			
				|  |  | +                        "studentBasicInfo.subjectTeacherId","studentBasicInfo.subjectTeacherName","latelyCourseConsumer","visitNum",
 | 
	
		
			
				|  |  | +                        "lastVisitStatus == null?'':lastVisitStatus == 'LOST' ? '流失':lastVisitStatus == 'THINKING' ? '考虑中':" +
 | 
	
		
			
				|  |  | +                                "lastVisitStatus == 'PENDING_PAYMENT' ? '确认缴费待缴费':lastVisitStatus == 'PAUSE' ? '暂停':lastVisitStatus == 'OTHER' ? '其他':''"
 | 
	
		
			
				|  |  | +                        ,"visitReason","lastVisitTime"}, rows);
 | 
	
		
			
				|  |  | +        exportManagerDownload(workbook,managerDownload);
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      @Override
 | 
	
		
			
				|  |  | -    public void exportMusicGroupCourseScheduleDetail(queryMusicGroupCourseScheduleQueryInfo queryInfo, ManagerDownload managerDownload) throws FileNotFoundException {
 | 
	
		
			
				|  |  | +    public void exportMusicGroupCourseScheduleDetail(queryMusicGroupCourseScheduleQueryInfo queryInfo, ManagerDownload managerDownload) throws IOException, InvocationTargetException, NoSuchMethodException, IllegalAccessException {
 | 
	
		
			
				|  |  |          List<MusicGroupCourseScheduleDto> rows = classGroupService.queryMusicGroupCourseScheduleDetail(queryInfo).getRows();
 | 
	
		
			
				|  |  | +        HSSFWorkbook workbook = POIUtil.exportExcel(new String[]{"课程编号", "课程开始时间", "课程结束时间", "课程名称","课程类型", "课程状态", "老师签到", "老师签退", "指导老师",
 | 
	
		
			
				|  |  | +                        "出勤率", "达标率", "是否服务", "是否布置课后作业", "作业提交率", "结算状态", "是否点名", "备注"},
 | 
	
		
			
				|  |  | +                new String[]{"courseScheduleId", "classDate + ' ' + startClassTime", "classDate + ' ' + endClassTime",
 | 
	
		
			
				|  |  | +                        "courseScheduleName","courseScheduleType.msg", "courseScheduleStatus.msg", "signInStatus.msg",
 | 
	
		
			
				|  |  | +                        "signOutStatus.msg","masterTeacherName",
 | 
	
		
			
				|  |  | +                        "courseScheduleStatistics.attendanceRate","courseScheduleStatistics.standardRate",
 | 
	
		
			
				|  |  | +                        "courseScheduleStatistics.serviceFlag == false ? '否':'是'","courseScheduleStatistics.homeworkFlag == false ? '否':'是'","courseScheduleStatistics.homeworkCommitRate",
 | 
	
		
			
				|  |  | +                        "settlementTime == null?'未结算':'已结算'", "isCallNames.msg", "remark"}, rows);
 | 
	
		
			
				|  |  | +        exportManagerDownload(workbook,managerDownload);
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    public HSSFWorkbook getHSSFWorkbook(List rows, List<String> headColumns, ExportEnum exportEnum) throws InvocationTargetException, NoSuchMethodException, IllegalAccessException, IOException {
 | 
	
		
			
				|  |  | +        Map<String, String> headMap = getExportMap(new ExportDto(exportEnum, headColumns));
 | 
	
		
			
				|  |  | +        String[] header = headMap.keySet().toArray(new String[headMap.keySet().size()]);
 | 
	
		
			
				|  |  | +        String[] body = headMap.values().toArray(new String[headMap.keySet().size()]);
 | 
	
		
			
				|  |  | +        return POIUtil.exportExcel(header, body, rows);
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    public void exportManagerDownload(HSSFWorkbook workbook, ManagerDownload managerDownload) throws FileNotFoundException {
 | 
	
		
			
				|  |  |          String basePath = new ApplicationHome(this.getClass()).getSource().getParentFile().getPath();
 | 
	
		
			
				|  |  |          File file = new File(basePath + "/" + managerDownload.getName());
 | 
	
		
			
				|  |  |          FileOutputStream fileOutputStream = new FileOutputStream(file);
 | 
	
		
			
				|  |  |          OutputStream ouputStream = null;
 | 
	
		
			
				|  |  |          try {
 | 
	
		
			
				|  |  | -            HSSFWorkbook workbook = POIUtil.exportExcel(new String[]{"课程编号", "课程开始时间", "课程结束时间", "课程名称","课程类型", "课程状态", "老师签到", "老师签退", "指导老师",
 | 
	
		
			
				|  |  | -                            "出勤率", "达标率", "是否服务", "是否布置课后作业", "作业提交率", "结算状态", "是否点名", "备注"},
 | 
	
		
			
				|  |  | -                    new String[]{"courseScheduleId", "classDate + ' ' + startClassTime", "classDate + ' ' + endClassTime",
 | 
	
		
			
				|  |  | -                            "courseScheduleName","courseScheduleType.msg", "courseScheduleStatus.msg", "signInStatus.msg",
 | 
	
		
			
				|  |  | -                            "signOutStatus.msg","masterTeacherName",
 | 
	
		
			
				|  |  | -                            "courseScheduleStatistics.attendanceRate","courseScheduleStatistics.standardRate",
 | 
	
		
			
				|  |  | -                            "courseScheduleStatistics.serviceFlag == false ? '否':'是'","courseScheduleStatistics.homeworkFlag == false ? '否':'是'","courseScheduleStatistics.homeworkCommitRate",
 | 
	
		
			
				|  |  | -                            "settlementTime == null?'未结算':'已结算'", "isCallNames.msg", "remark"}, rows);
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  |              workbook.write(fileOutputStream);
 | 
	
		
			
				|  |  |              fileOutputStream.getFD().sync();
 | 
	
		
			
				|  |  |              fileOutputStream.close();
 | 
	
	
		
			
				|  | @@ -3198,4 +2982,14 @@ public class ExportServiceImpl implements ExportService {
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    @Override
 | 
	
		
			
				|  |  | +    public void exportMusicGroupCourseList(ManagerDownload managerDownload, List<MusicGroupExportDto> rows) throws InvocationTargetException, NoSuchMethodException, IllegalAccessException, IOException {
 | 
	
		
			
				|  |  | +        HSSFWorkbook workbook = POIUtil.exportExcel(new String[]{"分部", "乐团编号", "乐团名称", "乐团主管","出勤率", "达标率", "作业提交率", "成团人数", "新增人数",
 | 
	
		
			
				|  |  | +                        "退团人数", "在读人数","流失率"},
 | 
	
		
			
				|  |  | +                new String[]{"organName", "musicGroupId", "musicGroupName",
 | 
	
		
			
				|  |  | +                        "eduName","attendanceRate", "standardRate", "homeworkCommitRate",
 | 
	
		
			
				|  |  | +                        "groupMemberNum","addStuNum","quitStuNum","normalNum","lostRate"}, rows);
 | 
	
		
			
				|  |  | +        exportManagerDownload(workbook,managerDownload);
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  |  }
 |