Pārlūkot izejas kodu

Merge remote-tracking branch 'origin/master'

周箭河 5 gadi atpakaļ
vecāks
revīzija
072099f43e

+ 19 - 6
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/CourseSchedule.java

@@ -1,12 +1,6 @@
 package com.ym.mec.biz.dal.entity;
 package com.ym.mec.biz.dal.entity;
 
 
-import com.fasterxml.jackson.annotation.JsonInclude;
-import com.ym.mec.biz.dal.enums.CourseStatusEnum;
-import com.ym.mec.biz.dal.enums.TeachModeEnum;
-import com.ym.mec.common.enums.BaseEnum;
 import io.swagger.annotations.ApiModelProperty;
 import io.swagger.annotations.ApiModelProperty;
-import org.apache.commons.lang3.StringUtils;
-import org.apache.commons.lang3.builder.ToStringBuilder;
 
 
 import java.math.BigDecimal;
 import java.math.BigDecimal;
 import java.text.ParseException;
 import java.text.ParseException;
@@ -14,6 +8,15 @@ import java.text.SimpleDateFormat;
 import java.util.List;
 import java.util.List;
 import java.util.Objects;
 import java.util.Objects;
 
 
+import org.apache.commons.lang3.StringUtils;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.ym.mec.auth.api.entity.SysUser;
+import com.ym.mec.biz.dal.enums.CourseStatusEnum;
+import com.ym.mec.biz.dal.enums.TeachModeEnum;
+import com.ym.mec.common.enums.BaseEnum;
+
 /**
 /**
  * 对应数据库表(course_schedule):
  * 对应数据库表(course_schedule):
  */
  */
@@ -114,6 +117,8 @@ public class CourseSchedule {
 
 
 	/** 主教是否不需要重新生成课酬 */
 	/** 主教是否不需要重新生成课酬 */
 	private boolean bishopTeacherSalaryNotCreate;
 	private boolean bishopTeacherSalaryNotCreate;
+	
+	private SysUser teacher = new SysUser();
 
 
 	public boolean isBishopTeacherSalaryNotCreate() {
 	public boolean isBishopTeacherSalaryNotCreate() {
 		return bishopTeacherSalaryNotCreate;
 		return bishopTeacherSalaryNotCreate;
@@ -311,6 +316,14 @@ public class CourseSchedule {
 		this.schoolId = schoolId;
 		this.schoolId = schoolId;
 	}
 	}
 
 
+	public SysUser getTeacher() {
+		return teacher;
+	}
+
+	public void setTeacher(SysUser teacher) {
+		this.teacher = teacher;
+	}
+
 	@Override
 	@Override
 	public String toString() {
 	public String toString() {
 		return ToStringBuilder.reflectionToString(this);
 		return ToStringBuilder.reflectionToString(this);

+ 14 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/CourseScheduleComplaints.java

@@ -1,9 +1,12 @@
 package com.ym.mec.biz.dal.entity;
 package com.ym.mec.biz.dal.entity;
 
 
-import com.ym.mec.biz.dal.enums.AuditStatusEnum;
 import io.swagger.annotations.ApiModelProperty;
 import io.swagger.annotations.ApiModelProperty;
+
 import org.apache.commons.lang3.builder.ToStringBuilder;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 
 
+import com.ym.mec.auth.api.entity.SysUser;
+import com.ym.mec.biz.dal.enums.AuditStatusEnum;
+
 /**
 /**
  * 对应数据库表(course_schedule_complaints):
  * 对应数据库表(course_schedule_complaints):
  */
  */
@@ -40,6 +43,8 @@ public class CourseScheduleComplaints {
 	
 	
 	private Double studentLiabilityRatio;
 	private Double studentLiabilityRatio;
 	
 	
+	private SysUser user = new SysUser();
+	
 	public void setId(Long id){
 	public void setId(Long id){
 		this.id = id;
 		this.id = id;
 	}
 	}
@@ -128,6 +133,14 @@ public class CourseScheduleComplaints {
 		this.teacherLiabilityRatio = teacherLiabilityRatio;
 		this.teacherLiabilityRatio = teacherLiabilityRatio;
 	}
 	}
 
 
+	public SysUser getUser() {
+		return user;
+	}
+
+	public void setUser(SysUser user) {
+		this.user = user;
+	}
+
 	@Override
 	@Override
 	public String toString() {
 	public String toString() {
 		return ToStringBuilder.reflectionToString(this);
 		return ToStringBuilder.reflectionToString(this);

+ 22 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/MusicGroupQuit.java

@@ -2,6 +2,8 @@ package com.ym.mec.biz.dal.entity;
 
 
 import org.apache.commons.lang3.builder.ToStringBuilder;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 
 
+import com.ym.mec.auth.api.entity.SysUser;
+
 /**
 /**
  * 对应数据库表(music_group_quit):
  * 对应数据库表(music_group_quit):
  */
  */
@@ -29,6 +31,10 @@ public class MusicGroupQuit {
 	private String reason;
 	private String reason;
 
 
 	private ApprovalStatus status;
 	private ApprovalStatus status;
+	
+	private SysUser user = new SysUser();
+	
+	private MusicGroup musicGroup = new MusicGroup();
 
 
 	public void setId(Long id) {
 	public void setId(Long id) {
 		this.id = id;
 		this.id = id;
@@ -94,6 +100,22 @@ public class MusicGroupQuit {
 		this.status = status;
 		this.status = status;
 	}
 	}
 
 
+	public SysUser getUser() {
+		return user;
+	}
+
+	public void setUser(SysUser user) {
+		this.user = user;
+	}
+
+	public MusicGroup getMusicGroup() {
+		return musicGroup;
+	}
+
+	public void setMusicGroup(MusicGroup musicGroup) {
+		this.musicGroup = musicGroup;
+	}
+
 	@Override
 	@Override
 	public String toString() {
 	public String toString() {
 		return ToStringBuilder.reflectionToString(this);
 		return ToStringBuilder.reflectionToString(this);

+ 13 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/TeacherLeaveRecord.java

@@ -1,6 +1,8 @@
 package com.ym.mec.biz.dal.entity;
 package com.ym.mec.biz.dal.entity;
 
 
+import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.biz.dal.enums.AuditStatusEnum;
 import com.ym.mec.biz.dal.enums.AuditStatusEnum;
+
 import org.apache.commons.lang3.builder.ToStringBuilder;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 
 
 /**
 /**
@@ -77,6 +79,8 @@ public class TeacherLeaveRecord {
      * 流程实例
      * 流程实例
      */
      */
     private String wfOrderId;
     private String wfOrderId;
+    
+    private SysUser user = new SysUser();
 
 
     public String getLeaveCategoryName() {
     public String getLeaveCategoryName() {
         return leaveCategoryName;
         return leaveCategoryName;
@@ -190,7 +194,15 @@ public class TeacherLeaveRecord {
         return this.wfOrderId;
         return this.wfOrderId;
     }
     }
 
 
-    @Override
+    public SysUser getUser() {
+		return user;
+	}
+
+	public void setUser(SysUser user) {
+		this.user = user;
+	}
+
+	@Override
     public String toString() {
     public String toString() {
         return ToStringBuilder.reflectionToString(this);
         return ToStringBuilder.reflectionToString(this);
     }
     }

+ 634 - 0
mec-util/src/main/java/com/ym/mec/util/excel/POIUtil.java

@@ -0,0 +1,634 @@
+package com.ym.mec.util.excel;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.lang.reflect.InvocationTargetException;
+import java.security.cert.CertificateException;
+import java.security.cert.X509Certificate;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+
+import org.apache.commons.beanutils.ConvertUtils;
+import org.apache.commons.beanutils.NestedNullException;
+import org.apache.commons.beanutils.PropertyUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.http.HttpEntity;
+import org.apache.http.HttpResponse;
+import org.apache.http.NameValuePair;
+import org.apache.http.client.entity.UrlEncodedFormEntity;
+import org.apache.http.client.methods.HttpPost;
+import org.apache.http.conn.ssl.SSLConnectionSocketFactory;
+import org.apache.http.impl.client.BasicCookieStore;
+import org.apache.http.impl.client.CloseableHttpClient;
+import org.apache.http.impl.client.HttpClients;
+import org.apache.http.message.BasicNameValuePair;
+import org.apache.http.ssl.SSLContextBuilder;
+import org.apache.http.ssl.TrustStrategy;
+import org.apache.http.util.EntityUtils;
+import org.apache.poi.hssf.usermodel.HSSFCell;
+import org.apache.poi.hssf.usermodel.HSSFCellStyle;
+import org.apache.poi.hssf.usermodel.HSSFFont;
+import org.apache.poi.hssf.usermodel.HSSFRow;
+import org.apache.poi.hssf.usermodel.HSSFSheet;
+import org.apache.poi.hssf.usermodel.HSSFWorkbook;
+import org.apache.poi.ss.usermodel.Cell;
+import org.apache.poi.ss.usermodel.CellStyle;
+import org.apache.poi.ss.usermodel.Font;
+import org.apache.poi.ss.usermodel.Row;
+import org.apache.poi.ss.usermodel.Sheet;
+import org.apache.poi.ss.usermodel.Workbook;
+import org.apache.poi.xssf.streaming.SXSSFWorkbook;
+import org.apache.poi.xssf.usermodel.XSSFWorkbook;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import com.ym.mec.util.exception.UtilException;
+
+public class POIUtil {
+
+	private final static Logger LOGGER = LoggerFactory.getLogger(POIUtil.class);
+
+	// 能导出的最大数据条数
+	private final static int MAX_DATA_SIZE = 50000;
+
+	private static SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+
+	/**
+	 * 将数据集dataset导出到fileName文件中(只支持.xlsx格式)
+	 * @param headColumns 导出文件的列名
+	 * @param dataset 数据源
+	 * @return
+	 * @throws IOException 
+	 */
+	public static SXSSFWorkbook exportBigExcel(String[] headColumns, List<Map<String, Object>> dataset) throws IOException {
+		if (headColumns == null) {
+			throw new UtilException("excel列名不能为空");
+		}
+		if (dataset == null) {
+			throw new UtilException("数据集不能为空");
+		}
+		SXSSFWorkbook workbook = new SXSSFWorkbook();
+		CellStyle style = workbook.createCellStyle(); // 获取单元格样式
+		/************** 设置单元格样式 *************/
+		style.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER); // 垂直
+		style.setAlignment(HSSFCellStyle.ALIGN_CENTER); // 水平
+		style.setWrapText(true);
+		Font font = workbook.createFont();
+		font.setColor(HSSFFont.COLOR_NORMAL);
+		font.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);
+		style.setFont(font);
+
+		Sheet sheet = workbook.createSheet(); // 创建sheet
+		// 设置表头
+		// 创建第一行
+		Row row1 = sheet.createRow(0);
+		Cell cell = null;
+		for (int i = 0; i < headColumns.length; i++) {
+			// 创建列
+			cell = row1.createCell(i);
+			// 定义单元格为字符串类型
+			cell.setCellType(HSSFCell.CELL_TYPE_STRING);
+			// 设置单元格的样式
+			cell.setCellStyle(style);
+			// 设置单元格的值
+			cell.setCellValue(headColumns[i]);
+		}
+		Row row = null;
+		// 添加数据
+		Map<String, Object> data = null;
+		for (int i = 1; i <= dataset.size(); i++) {
+			data = dataset.get(i - 1);
+			if (data != null) {
+				row = sheet.createRow(i);
+				int index = 0;
+				for (Entry<String, Object> entry : data.entrySet()) {
+					row.createCell(index).setCellValue(entry.getValue().toString());
+					index++;
+				}
+			}
+		}
+		return workbook;
+	}
+
+	/**
+	 * 将数据集dataset导出到fileName文件中
+	 * @param headColumns 导出文件的列名
+	 * @param dataset 数据源
+	 * @return
+	 * @throws IOException 
+	 */
+	public static HSSFWorkbook exportExcel(String[] headColumns, List<Map<String, Object>> dataset) throws IOException {
+		if (headColumns == null) {
+			throw new UtilException("excel列名不能为空");
+		}
+		if (dataset == null) {
+			throw new UtilException("数据集不能为空");
+		}
+		if (dataset.size() > MAX_DATA_SIZE) {
+			throw new UtilException("数据集太大,不能导出.最大数据集不能超过" + MAX_DATA_SIZE);
+		}
+		HSSFWorkbook workbook = new HSSFWorkbook();
+		HSSFCellStyle style = workbook.createCellStyle(); // 获取单元格样式
+		/************** 设置单元格样式 *************/
+		style.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER); // 垂直
+		style.setAlignment(HSSFCellStyle.ALIGN_CENTER); // 水平
+		style.setWrapText(true);
+		HSSFFont font = workbook.createFont();
+		font.setColor(HSSFFont.COLOR_NORMAL);
+		font.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);
+		style.setFont(font);
+
+		HSSFSheet sheet = workbook.createSheet(); // 创建sheet
+		// 设置表头
+		// 创建第一行
+		HSSFRow row1 = sheet.createRow(0);
+		HSSFCell cell = null;
+		for (int i = 0; i < headColumns.length; i++) {
+			// 创建列
+			cell = row1.createCell(i);
+			// 定义单元格为字符串类型
+			cell.setCellType(HSSFCell.CELL_TYPE_STRING);
+			// 设置单元格的样式
+			cell.setCellStyle(style);
+			// 设置单元格的值
+			cell.setCellValue(headColumns[i]);
+		}
+		HSSFRow row = null;
+		// 添加数据
+		Map<String, Object> data = null;
+		for (int i = 1; i <= dataset.size(); i++) {
+			data = dataset.get(i - 1);
+			if (data != null) {
+				row = sheet.createRow(i);
+				int index = 0;
+				for (Entry<String, Object> entry : data.entrySet()) {
+					row.createCell(index).setCellValue(entry.getValue().toString());
+					index++;
+				}
+			}
+		}
+		return workbook;
+	}
+
+	/**
+	 * 将数据集dataset导出到fileName文件中
+	 * @param headColumns 导出文件的列名
+	 * @param fieldColumns 
+	 * @param dataset 数据源
+	 * @return
+	 * @throws IOException 
+	 * @throws NoSuchMethodException 
+	 * @throws InvocationTargetException 
+	 * @throws IllegalAccessException 
+	 */
+	public static <T> HSSFWorkbook exportExcel(String[] headColumns, String[] fieldColumns, List<T> dataset) throws IOException, IllegalAccessException,
+			InvocationTargetException, NoSuchMethodException {
+		if (headColumns == null) {
+			throw new UtilException("excel列名不能为空");
+		}
+		if (dataset == null) {
+			throw new UtilException("数据集不能为空");
+		}
+		if (dataset.size() > MAX_DATA_SIZE) {
+			throw new UtilException("数据集太大,不能导出.最大数据集不能超过" + MAX_DATA_SIZE);
+		}
+		HSSFWorkbook workbook = new HSSFWorkbook();
+		HSSFCellStyle style = workbook.createCellStyle(); // 获取单元格样式
+		/************** 设置单元格样式 *************/
+		style.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER); // 垂直
+		style.setAlignment(HSSFCellStyle.ALIGN_CENTER); // 水平
+		style.setWrapText(true);
+		HSSFFont font = workbook.createFont();
+		font.setColor(HSSFFont.COLOR_NORMAL);
+		font.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);
+		style.setFont(font);
+
+		HSSFSheet sheet = workbook.createSheet(); // 创建sheet
+		// 设置表头
+		// 创建第一行
+		HSSFRow row1 = sheet.createRow(0);
+		HSSFCell cell = null;
+		for (int i = 0; i < headColumns.length; i++) {
+			// 创建列
+			cell = row1.createCell(i);
+			// 定义单元格为字符串类型
+			cell.setCellType(HSSFCell.CELL_TYPE_STRING);
+			// 设置单元格的样式
+			cell.setCellStyle(style);
+			// 设置单元格的值
+			cell.setCellValue(headColumns[i]);
+		}
+		HSSFRow row = null;
+		// 添加数据
+		T data = null;
+		Object obj = null;
+		for (int i = 1; i <= dataset.size(); i++) {
+			data = dataset.get(i - 1);
+			if (data != null) {
+				row = sheet.createRow(i);
+				for (int j = 0; j < fieldColumns.length; j++) {
+					cell = row.createCell(j);
+					try {
+						obj = PropertyUtils.getNestedProperty(data, fieldColumns[j]);
+						if (obj instanceof Date) {
+							obj = sdf.format(obj);
+						}
+					} catch (NestedNullException e) {
+						LOGGER.warn(e.getMessage());
+						obj = null;
+					}
+					if (obj != null) {
+						cell.setCellValue(obj.toString());
+					} else {
+						cell.setCellValue("");
+					}
+				}
+			}
+		}
+		return workbook;
+	}
+
+	/**
+	 * 将数据集dataset导出到fileName文件中(只支持.xlsx格式)
+	 * @param headColumns 导出文件的列名
+	 * @param fieldColumns 
+	 * @param dataset 数据源
+	 * @return
+	 * @throws IOException 
+	 * @throws NoSuchMethodException 
+	 * @throws InvocationTargetException 
+	 * @throws IllegalAccessException 
+	 */
+	public static <T> SXSSFWorkbook exportBigExcel(String[] headColumns, String[] fieldColumns, List<T> dataset) throws IOException, IllegalAccessException,
+			InvocationTargetException, NoSuchMethodException {
+		if (headColumns == null) {
+			throw new UtilException("excel列名不能为空");
+		}
+		if (dataset == null) {
+			throw new UtilException("数据集不能为空");
+		}
+		SXSSFWorkbook workbook = new SXSSFWorkbook();
+		CellStyle style = workbook.createCellStyle(); // 获取单元格样式
+		/************** 设置单元格样式 *************/
+		style.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER); // 垂直
+		style.setAlignment(HSSFCellStyle.ALIGN_CENTER); // 水平
+		style.setWrapText(true);
+		Font font = workbook.createFont();
+		font.setColor(HSSFFont.COLOR_NORMAL);
+		font.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);
+		style.setFont(font);
+
+		Sheet sheet = workbook.createSheet(); // 创建sheet
+		// 设置表头
+		// 创建第一行
+		Row row1 = sheet.createRow(0);
+		Cell cell = null;
+		for (int i = 0; i < headColumns.length; i++) {
+			// 创建列
+			cell = row1.createCell(i);
+			// 定义单元格为字符串类型
+			cell.setCellType(HSSFCell.CELL_TYPE_STRING);
+			// 设置单元格的样式
+			cell.setCellStyle(style);
+			// 设置单元格的值
+			cell.setCellValue(headColumns[i]);
+		}
+		Row row = null;
+		// 添加数据
+		T data = null;
+		Object obj = null;
+		for (int i = 1; i <= dataset.size(); i++) {
+			data = dataset.get(i - 1);
+			if (data != null) {
+				row = sheet.createRow(i);
+				for (int j = 0; j < fieldColumns.length; j++) {
+					cell = row.createCell(j);
+					try {
+						obj = PropertyUtils.getNestedProperty(data, fieldColumns[j]);
+						if (obj instanceof Date) {
+							obj = sdf.format(obj);
+						}
+					} catch (NestedNullException e) {
+						LOGGER.warn(e.getMessage());
+						obj = null;
+					}
+					if (obj != null) {
+						cell.setCellValue(obj.toString());
+					} else {
+						cell.setCellValue("");
+					}
+				}
+			}
+		}
+		return workbook;
+	}
+
+	/**
+	 * 导入指定的excel文件
+	 * @param excelFile excel文件
+	 * @param startRowNum 从第几行数据开始导入
+	 * @return
+	 * @throws IOException
+	 */
+	public static Map<String, List<Map<String, Object>>> importExcel(File excelFile, int startRowNum) throws IOException {
+		Map<String, List<Map<String, Object>>> result = new HashMap<String, List<Map<String, Object>>>();
+
+		if (!excelFile.exists()) {
+			LOGGER.error("文件" + excelFile.getAbsolutePath() + "不存在");
+			return result;
+		}
+
+		Workbook workbook = null;
+		FileInputStream fis = new FileInputStream(excelFile);
+		int index = excelFile.getName().lastIndexOf('.');
+		if (index <= 0) {
+			fis.close();
+			throw new UtilException("excel文件的扩展名是.xls or .xlsx!");
+		}
+		String ext = excelFile.getName().substring(index).toLowerCase();
+		try {
+			if (".xlsx".equals(ext.toLowerCase())) {
+				// 支持excel2007 xlsx格式
+				workbook = new XSSFWorkbook(fis);
+			} else if (".xls".equals(ext)) {
+				// 支持excel2003以前 xls格式
+				workbook = new HSSFWorkbook(fis);
+			} else {
+				throw new UtilException("excel文件的扩展名是.xls or .xlsx!");
+			}
+		} catch (Exception ex) {
+			LOGGER.error("excel open error.", ex);
+			return result;
+		} finally {
+			if (fis != null) {
+				fis.close();
+			}
+		}
+		int sheetCount = workbook.getNumberOfSheets();
+		Sheet sheet = null;
+		Row row = null;
+		Cell cell = null;
+		int currentRowNum = 0, currentCellNum = 0;
+		// Object fieldValue = null;
+		Iterator<Row> rowIter = null;
+		Iterator<Cell> cellIter = null;
+
+		for (int i = 0; i < sheetCount; i++) {
+			String fieldsName[] = null;
+			// 行号清零
+			currentRowNum = 0;
+			// 顺序取sheet
+			sheet = workbook.getSheetAt(i);
+			List<Map<String, Object>> datas = new ArrayList<Map<String, Object>>();
+			rowIter = sheet.iterator();
+			while (rowIter.hasNext()) {
+				Map<String, Object> obj = null;
+				// 获取当前行
+				row = rowIter.next();
+				if (row != null) {
+					currentRowNum++;
+
+					if (currentRowNum == 1) {// 第一列表示英文名称对应表字段
+						cellIter = row.iterator();
+						// 列号清零
+						currentCellNum = 0;
+						List<String> names = new ArrayList<String>();
+						while (cellIter.hasNext()) {
+							cell = cellIter.next();
+							names.add(cell.getStringCellValue());
+						}
+						fieldsName = names.toArray(new String[names.size()]);
+						continue;
+					}
+
+					// 跳过指定的行
+					if (currentRowNum < startRowNum) {
+						continue;
+					}
+
+					// 实例化对象
+					obj = new HashMap<String, Object>();// clazz.newInstance();
+
+					cellIter = row.iterator();
+					// 列号清零
+					currentCellNum = 0;
+					while (cellIter.hasNext()) {
+						cell = cellIter.next();
+						cell.setCellType(Cell.CELL_TYPE_STRING);
+						String fieldValue = cell.getStringCellValue();
+						obj.put(fieldsName[currentCellNum], fieldValue);
+						currentCellNum++;
+					}
+				}
+				if (obj != null)
+					datas.add(obj);
+
+			}
+			if (!datas.isEmpty())
+				result.put(sheet.getSheetName(), datas);
+		}
+		if (workbook != null) {
+			workbook.close();
+		}
+		return result;
+	}
+
+	/**
+	 * 导入指定的excel文件
+	 * @param inputStream excel文件流
+	 * @param startRowNum 从第几行数据开始导入
+	 * @param extName 文件扩展名,仅支持.xls 或 .xlsx
+	 * @return
+	 * @throws IOException
+	 */
+	public static Map<String, List<Map<String, Object>>> importExcel(InputStream inputStream, int startRowNum, String extName) throws IOException {
+
+		Map<String, List<Map<String, Object>>> result = new HashMap<String, List<Map<String, Object>>>();
+
+		Workbook workbook = null;
+
+		try {
+			if (".xlsx".equals(extName.toLowerCase())) {
+				// 支持excel2007 xlsx格式
+				workbook = new XSSFWorkbook(inputStream);
+			} else if (".xls".equals(extName)) {
+				// 支持excel2003以前 xls格式
+				workbook = new HSSFWorkbook(inputStream);
+			} else {
+				throw new UtilException("excel文件的扩展名是.xls or .xlsx!");
+			}
+		} catch (Exception ex) {
+			LOGGER.error("excel open error.", ex);
+			return result;
+		} finally {
+			if (inputStream != null) {
+				inputStream.close();
+			}
+		}
+
+		int sheetCount = workbook.getNumberOfSheets();
+		Sheet sheet = null;
+		Row row = null;
+		Cell cell = null;
+		int currentRowNum = 0, currentCellNum = 0;
+		// Object fieldValue = null;
+		Iterator<Row> rowIter = null;
+		Iterator<Cell> cellIter = null;
+
+		for (int i = 0; i < sheetCount; i++) {
+			String fieldsName[] = null;
+			// 行号清零
+			currentRowNum = 0;
+			// 顺序取sheet
+			sheet = workbook.getSheetAt(i);
+			List<Map<String, Object>> datas = new ArrayList<Map<String, Object>>();
+			rowIter = sheet.iterator();
+			while (rowIter.hasNext()) {
+				Map<String, Object> obj = null;
+				// 获取当前行
+				row = rowIter.next();
+				if (row != null) {
+					currentRowNum++;
+
+					if (currentRowNum == 1) {// 第一列表示英文名称对应表字段
+						cellIter = row.iterator();
+						// 列号清零
+						currentCellNum = 0;
+						List<String> names = new ArrayList<String>();
+						while (cellIter.hasNext()) {
+							cell = cellIter.next();
+							names.add(cell.getStringCellValue());
+						}
+						fieldsName = names.toArray(new String[names.size()]);
+						continue;
+					}
+
+					// 跳过指定的行
+					if (currentRowNum < startRowNum) {
+						continue;
+					}
+
+					// 实例化对象
+					obj = new HashMap<String, Object>();// clazz.newInstance();
+
+					cellIter = row.iterator();
+					// 列号清零
+					currentCellNum = 0;
+					while (cellIter.hasNext()) {
+						cell = cellIter.next();
+						cell.setCellType(Cell.CELL_TYPE_STRING);
+						String fieldValue = cell.getStringCellValue();
+						obj.put(fieldsName[currentCellNum], fieldValue);
+						currentCellNum++;
+					}
+				}
+				if (obj != null)
+					datas.add(obj);
+
+			}
+			if (!datas.isEmpty())
+				result.put(sheet.getSheetName(), datas);
+		}
+		if (workbook != null) {
+			workbook.close();
+		}
+		return result;
+	}
+
+	public static void main(String[] args) {
+		File file = new File("e:/reward.xlsx");
+		String sheetName = "reward";
+		Map<String, List<Map<String, Object>>> map = null;
+		try {
+			map = POIUtil.importExcel(file, 1);
+		} catch (IOException e) {
+			e.printStackTrace();
+			return;
+		}
+		if (map != null) {
+			// Map<String, Object> loginParam = new HashMap<String, Object>();
+
+			SSLContextBuilder builder = new SSLContextBuilder();
+			try {
+				builder.loadTrustMaterial(null, new TrustStrategy() {
+
+					@Override
+					public boolean isTrusted(X509Certificate[] chain, String authType) throws CertificateException {
+						return true;
+					}
+				});
+			} catch (Exception e) {
+				e.printStackTrace();
+				return;
+			}
+
+			HttpPost httpPost = null;
+			CloseableHttpClient httpClient = null;
+			try {
+				SSLConnectionSocketFactory sslsf = new SSLConnectionSocketFactory(builder.build());
+				httpClient = HttpClients.custom().setSSLSocketFactory(sslsf).setDefaultCookieStore(new BasicCookieStore()).build();
+				// 登陆
+				httpPost = new HttpPost("https://ehjinrong.com/manage/admin/login.do?userName=sadmin&password=Hello@ehjr&captcha=411049");
+
+				HttpResponse httpResponse = httpClient.execute(httpPost);
+				HttpEntity httpEntity = httpResponse.getEntity();
+				String str = EntityUtils.toString(httpEntity);
+				System.out.println("--------" + str);
+				EntityUtils.consume(httpEntity);
+
+				// 发放奖励
+				for (Map<String, Object> row : map.get(sheetName)) {
+					try {
+						Long arg0 = Long.parseLong(row.get("user_id_").toString());
+						double arg1 = Double.parseDouble(row.get("reward").toString());
+						//String arg2 = row.get("tender_id_").toString();
+
+						Map<String, Object> parameterMap = new HashMap<String, Object>();
+						parameterMap.put("userId", arg0);
+						parameterMap.put("amount", arg1);
+						parameterMap.put("memo", "结清");
+
+						List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>();
+						if (parameterMap != null) {
+							for (Entry<String, Object> entry : parameterMap.entrySet()) {
+								String name = entry.getKey();
+								String value = ConvertUtils.convert(entry.getValue());
+								if (StringUtils.isNotEmpty(name)) {
+									nameValuePairs.add(new BasicNameValuePair(name, value));
+								}
+							}
+						}
+						httpPost = new HttpPost("https://ehjinrong.com/manage/sysAccount/fundAllocate.do");
+						httpPost.setEntity(new UrlEncodedFormEntity(nameValuePairs, "UTF-8"));
+						httpResponse = httpClient.execute(httpPost);
+						httpEntity = httpResponse.getEntity();
+						EntityUtils.toString(httpEntity);
+						EntityUtils.consume(httpEntity);
+
+						System.out.println("  userId:" + arg0 + "  reward:" + arg1);
+					} catch (Exception e) {
+						e.printStackTrace();
+					}
+				}
+			} catch (Exception e) {
+				e.printStackTrace();
+			} finally {
+				httpPost.releaseConnection();
+				try {
+					httpClient.close();
+				} catch (IOException e) {
+					e.printStackTrace();
+				}
+			}
+
+		}
+	}
+}

+ 53 - 12
mec-web/src/main/java/com/ym/mec/web/controller/CourseScheduleController.java

@@ -1,31 +1,46 @@
 package com.ym.mec.web.controller;
 package com.ym.mec.web.controller;
 
 
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+
+import java.math.BigDecimal;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.stream.Collectors;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.MediaType;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.ui.ModelMap;
+import org.springframework.util.CollectionUtils;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
 import com.ym.mec.auth.api.client.SysUserFeignService;
 import com.ym.mec.auth.api.client.SysUserFeignService;
 import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.biz.dal.dao.ClassGroupTeacherMapperDao;
 import com.ym.mec.biz.dal.dao.ClassGroupTeacherMapperDao;
 import com.ym.mec.biz.dal.dto.CreateCourseScheduleDto;
 import com.ym.mec.biz.dal.dto.CreateCourseScheduleDto;
 import com.ym.mec.biz.dal.entity.ClassGroupTeacherMapper;
 import com.ym.mec.biz.dal.entity.ClassGroupTeacherMapper;
 import com.ym.mec.biz.dal.entity.CourseSchedule;
 import com.ym.mec.biz.dal.entity.CourseSchedule;
+import com.ym.mec.biz.dal.entity.CourseScheduleComplaints;
 import com.ym.mec.biz.dal.entity.MusicGroup;
 import com.ym.mec.biz.dal.entity.MusicGroup;
 import com.ym.mec.biz.dal.enums.AuditStatusEnum;
 import com.ym.mec.biz.dal.enums.AuditStatusEnum;
 import com.ym.mec.biz.dal.page.StudentAttendanceQueryInfo;
 import com.ym.mec.biz.dal.page.StudentAttendanceQueryInfo;
+import com.ym.mec.biz.service.CourseScheduleComplaintsService;
 import com.ym.mec.biz.service.CourseScheduleService;
 import com.ym.mec.biz.service.CourseScheduleService;
 import com.ym.mec.biz.service.MusicGroupService;
 import com.ym.mec.biz.service.MusicGroupService;
 import com.ym.mec.biz.service.StudentAttendanceService;
 import com.ym.mec.biz.service.StudentAttendanceService;
 import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.exception.BizException;
 import com.ym.mec.common.exception.BizException;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import io.swagger.annotations.ApiParam;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.MediaType;
-import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.util.CollectionUtils;
-import org.springframework.web.bind.annotation.*;
-
-import java.math.BigDecimal;
-import java.util.*;
-import java.util.stream.Collectors;
 
 
 /**
 /**
  * @Author Joburgess
  * @Author Joburgess
@@ -42,6 +57,9 @@ public class CourseScheduleController extends BaseController {
     private StudentAttendanceService studentAttendanceService;
     private StudentAttendanceService studentAttendanceService;
     @Autowired
     @Autowired
     private ClassGroupTeacherMapperDao classGroupTeacherMapperDao;
     private ClassGroupTeacherMapperDao classGroupTeacherMapperDao;
+    
+    @Autowired
+    private CourseScheduleComplaintsService courseScheduleComplaintsService;
 
 
     @Autowired
     @Autowired
     private SysUserFeignService sysUserFeignService;
     private SysUserFeignService sysUserFeignService;
@@ -187,5 +205,28 @@ public class CourseScheduleController extends BaseController {
 	public Object findCourseScheduleByClassGroup(Integer classGroupId){
 	public Object findCourseScheduleByClassGroup(Integer classGroupId){
         return succeed(scheduleService.findCourseScheduleByClassGroup(classGroupId));
         return succeed(scheduleService.findCourseScheduleByClassGroup(classGroupId));
     }
     }
+    
+    @ApiOperation(value = "查询课程投诉详情")
+	@GetMapping("/queryCourseScheduleComplaintsDetail")
+    @PreAuthorize("@pcs.hasPermissions('course/queryCourseScheduleComplaintsDetail')")
+    public Object queryCourseScheduleComplaintsDetail(Long courseScheduleComplaintsId){
+    	CourseScheduleComplaints complaints = courseScheduleComplaintsService.get(courseScheduleComplaintsId);
+    	if(complaints == null){
+    		return failed("参数输入不正确");
+    	}
+    	
+    	SysUser user = sysUserFeignService.queryUserById(complaints.getUserId());
+    	complaints.getUser().setUsername(user.getUsername());
+    	
+    	CourseSchedule courseSchedule = scheduleService.get(complaints.getCourseScheduleId());
+    	SysUser teacher = sysUserFeignService.queryUserById(courseSchedule.getActualTeacherId());
+    	courseSchedule.getTeacher().setUsername(teacher.getUsername());
+    	
+    	ModelMap model = new ModelMap();
+    	model.put("complaints", complaints);
+    	model.put("courseSchedule", courseSchedule);
+    	
+    	return succeed(model);
+    }
 
 
 }
 }

+ 15 - 1
mec-web/src/main/java/com/ym/mec/web/controller/MusicGroupQuitController.java

@@ -13,7 +13,10 @@ import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 import org.springframework.web.bind.annotation.RestController;
 
 
 import com.ym.mec.auth.api.client.SysUserFeignService;
 import com.ym.mec.auth.api.client.SysUserFeignService;
+import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.biz.dal.entity.ApprovalStatus;
 import com.ym.mec.biz.dal.entity.ApprovalStatus;
+import com.ym.mec.biz.dal.entity.MusicGroup;
+import com.ym.mec.biz.dal.entity.MusicGroupQuit;
 import com.ym.mec.biz.service.MusicGroupQuitService;
 import com.ym.mec.biz.service.MusicGroupQuitService;
 import com.ym.mec.biz.service.MusicGroupService;
 import com.ym.mec.biz.service.MusicGroupService;
 import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.controller.BaseController;
@@ -45,7 +48,18 @@ public class MusicGroupQuitController extends BaseController {
 	@GetMapping("/query")
 	@GetMapping("/query")
 	@PreAuthorize("@pcs.hasPermissions('musicGroupQuit/query')")
 	@PreAuthorize("@pcs.hasPermissions('musicGroupQuit/query')")
 	public HttpResponseResult query(Long id) throws Exception {
 	public HttpResponseResult query(Long id) throws Exception {
-		return succeed(musicGroupQuitService.get(id));
+		MusicGroupQuit musicGroupQuit = musicGroupQuitService.get(id);
+		if (musicGroupQuit == null) {
+			return failed("参数不正确");
+		}
+
+		SysUser user = sysUserFeignService.queryUserById(musicGroupQuit.getUserId());
+		musicGroupQuit.getUser().setUsername(user.getUsername());
+
+		MusicGroup musicGroup = musicGroupService.get(musicGroupQuit.getMusicGroupId());
+		musicGroupQuit.setMusicGroup(musicGroup);
+
+		return succeed(musicGroupQuit);
 	}
 	}
 
 
 	@ApiOperation(value = "退团")
 	@ApiOperation(value = "退团")

+ 27 - 4
mec-web/src/main/java/com/ym/mec/web/controller/TeacherLeaveRecordController.java

@@ -1,17 +1,21 @@
 package com.ym.mec.web.controller;
 package com.ym.mec.web.controller;
 
 
-import com.ym.mec.biz.dal.dto.TeacherLeaveRecordDto;
-import com.ym.mec.biz.dal.entity.TeacherLeaveRecord;
-import com.ym.mec.biz.service.TeacherLeaveRecordService;
-import com.ym.mec.common.controller.BaseController;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiOperation;
+
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 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;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 import org.springframework.web.bind.annotation.RestController;
 
 
+import com.ym.mec.auth.api.client.SysUserFeignService;
+import com.ym.mec.auth.api.entity.SysUser;
+import com.ym.mec.biz.dal.dto.TeacherLeaveRecordDto;
+import com.ym.mec.biz.dal.entity.TeacherLeaveRecord;
+import com.ym.mec.biz.service.TeacherLeaveRecordService;
+import com.ym.mec.common.controller.BaseController;
+
 @RequestMapping("teacherLeaveRecord")
 @RequestMapping("teacherLeaveRecord")
 @Api(tags = "教师请假记录服务")
 @Api(tags = "教师请假记录服务")
 @RestController
 @RestController
@@ -20,6 +24,9 @@ public class TeacherLeaveRecordController extends BaseController {
     @Autowired
     @Autowired
     private TeacherLeaveRecordService teacherLeaveRecordService;
     private TeacherLeaveRecordService teacherLeaveRecordService;
 
 
+    @Autowired
+    private SysUserFeignService sysUserFeignService;
+
     @ApiOperation(value = "新增教师请假记录")
     @ApiOperation(value = "新增教师请假记录")
     @PostMapping("/add")
     @PostMapping("/add")
     public Object add(TeacherLeaveRecord teacherLeaveRecord){
     public Object add(TeacherLeaveRecord teacherLeaveRecord){
@@ -32,4 +39,20 @@ public class TeacherLeaveRecordController extends BaseController {
     public Object queryPage(TeacherLeaveRecordDto queryInfo){
     public Object queryPage(TeacherLeaveRecordDto queryInfo){
         return succeed(teacherLeaveRecordService.queryPage(queryInfo));
         return succeed(teacherLeaveRecordService.queryPage(queryInfo));
     }
     }
+
+    @ApiOperation(value = "分页查询教师请假记录列表")
+    @GetMapping("/queryDetail")
+    public Object queryDetail(Long id){
+    	
+    	TeacherLeaveRecord teacherLeaveRecord = teacherLeaveRecordService.get(id);
+    	
+    	if(teacherLeaveRecord == null){
+    		return failed("参数不正确");
+    	}
+    	
+    	SysUser user = sysUserFeignService.queryUserById(teacherLeaveRecord.getUserId());
+    	teacherLeaveRecord.getUser().setUsername(user.getUsername());
+    	
+        return succeed(teacherLeaveRecord);
+    }
 }
 }

+ 35 - 13
mec-web/src/main/java/com/ym/mec/web/controller/VipGroupManageController.java

@@ -1,5 +1,24 @@
 package com.ym.mec.web.controller;
 package com.ym.mec.web.controller;
 
 
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+
+import java.math.BigDecimal;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpStatus;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
 import com.ym.mec.auth.api.client.SysUserFeignService;
 import com.ym.mec.auth.api.client.SysUserFeignService;
 import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.biz.dal.dao.EmployeeDao;
 import com.ym.mec.biz.dal.dao.EmployeeDao;
@@ -8,27 +27,16 @@ import com.ym.mec.biz.dal.dto.VipGroupApplyBaseInfoDto;
 import com.ym.mec.biz.dal.dto.VipGroupApplyDto;
 import com.ym.mec.biz.dal.dto.VipGroupApplyDto;
 import com.ym.mec.biz.dal.entity.CourseSchedule;
 import com.ym.mec.biz.dal.entity.CourseSchedule;
 import com.ym.mec.biz.dal.entity.Employee;
 import com.ym.mec.biz.dal.entity.Employee;
+import com.ym.mec.biz.dal.entity.StudentApplyRefunds;
 import com.ym.mec.biz.dal.enums.AuditStatusEnum;
 import com.ym.mec.biz.dal.enums.AuditStatusEnum;
 import com.ym.mec.biz.dal.page.VipGroupAttendanceQueryInfo;
 import com.ym.mec.biz.dal.page.VipGroupAttendanceQueryInfo;
 import com.ym.mec.biz.dal.page.VipGroupQueryInfo;
 import com.ym.mec.biz.dal.page.VipGroupQueryInfo;
 import com.ym.mec.biz.dal.page.VipGroupSalaryQueryInfo;
 import com.ym.mec.biz.dal.page.VipGroupSalaryQueryInfo;
 import com.ym.mec.biz.dal.page.VipGroupTeachingRecordQueryInfo;
 import com.ym.mec.biz.dal.page.VipGroupTeachingRecordQueryInfo;
 import com.ym.mec.biz.service.CourseScheduleService;
 import com.ym.mec.biz.service.CourseScheduleService;
+import com.ym.mec.biz.service.StudentApplyRefundsService;
 import com.ym.mec.biz.service.VipGroupService;
 import com.ym.mec.biz.service.VipGroupService;
 import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.controller.BaseController;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import org.apache.commons.lang3.StringUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.HttpStatus;
-import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.web.bind.annotation.*;
-
-import java.math.BigDecimal;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-import java.util.Objects;
 
 
 /**
 /**
  * @Author Joburgess
  * @Author Joburgess
@@ -48,6 +56,9 @@ public class VipGroupManageController extends BaseController {
     @Autowired
     @Autowired
     private EmployeeDao employeeDao;
     private EmployeeDao employeeDao;
 
 
+    @Autowired
+    private StudentApplyRefundsService studentApplyRefundsService;
+    
     @ApiOperation(value = "vip课申请")
     @ApiOperation(value = "vip课申请")
     @PostMapping("/vipGroupApply")
     @PostMapping("/vipGroupApply")
     @PreAuthorize("@pcs.hasPermissions('vipGroupManage/vipGroupApply')")
     @PreAuthorize("@pcs.hasPermissions('vipGroupManage/vipGroupApply')")
@@ -113,6 +124,17 @@ public class VipGroupManageController extends BaseController {
 		return succeed();
 		return succeed();
 	}
 	}
 
 
+    @ApiOperation(value = "查询退费详情")
+    @GetMapping("/queryApplyRefundDetail")
+    @PreAuthorize("@pcs.hasPermissions('vipGroupManage/queryApplyRefundDetail')")
+	public Object queryApplyRefundDetail(Long id) {
+    	StudentApplyRefunds studentApplyRefunds = studentApplyRefundsService.get(id);
+    	if(studentApplyRefunds == null){
+    		return failed("");
+    	}
+		return succeed();
+	}
+
     @ApiOperation(value = "获取VIP课教学记录")
     @ApiOperation(value = "获取VIP课教学记录")
     @GetMapping("/findVipGroupTeachingRecord")
     @GetMapping("/findVipGroupTeachingRecord")
     @PreAuthorize("@pcs.hasPermissions('vipGroupManage/findVipGroupTeachingRecord')")
     @PreAuthorize("@pcs.hasPermissions('vipGroupManage/findVipGroupTeachingRecord')")