Commit 948f30cb authored by hongguangwu's avatar hongguangwu

优化人员档案

parent e3f75496
...@@ -1864,7 +1864,7 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T ...@@ -1864,7 +1864,7 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
out = response.getOutputStream(); out = response.getOutputStream();
response.setContentType("multipart/form-data"); response.setContentType("multipart/form-data");
response.setCharacterEncoding("utf-8"); response.setCharacterEncoding("utf-8");
response.setHeader("Content-Disposition", "attachment;filename*=utf-8'zh_cn'" + URLEncoder.encode(fileName, "UTF-8")); response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(fileName, "UTF-8"));
// 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭 // 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭
EasyExcel.write(out, EmployeeExportVO.class).includeColumnFiledNames(employeeInfo.getExportFields()) EasyExcel.write(out, EmployeeExportVO.class).includeColumnFiledNames(employeeInfo.getExportFields())
.sheet("离职档案").doWrite(list); .sheet("离职档案").doWrite(list);
......
...@@ -76,6 +76,7 @@ public class DateUtil { ...@@ -76,6 +76,7 @@ public class DateUtil {
* yyyyMMddHHmmss * yyyyMMddHHmmss
*/ */
public static final String DATE_PATTERN = "yyyyMMddHHmmss"; public static final String DATE_PATTERN = "yyyyMMddHHmmss";
public static final String EXPORT_PATTERN = "yyyyMMdd-HHmmss";
protected static final float normalizedJulian(float jd) { protected static final float normalizedJulian(float jd) {
...@@ -1407,7 +1408,7 @@ public class DateUtil { ...@@ -1407,7 +1408,7 @@ public class DateUtil {
* @return: java.lang.String * @return: java.lang.String
**/ **/
public static String getThisTime(){ public static String getThisTime(){
SimpleDateFormat sf = new SimpleDateFormat(DateUtil.DATE_PATTERN); SimpleDateFormat sf = new SimpleDateFormat(DateUtil.EXPORT_PATTERN);
return sf.format(new Date()); return sf.format(new Date());
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment