update downloadTemplate

This commit is contained in:
fumeiai 2020-05-21 18:14:46 +08:00
parent 4b2db66e0c
commit e50cc47591
3 changed files with 39 additions and 19 deletions

15
.idea/workspace.xml generated
View File

@ -5,13 +5,6 @@
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/com/lz/common/utils/ExcelUtil.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/lz/common/utils/ExcelUtil.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/com/lz/modules/app/controller/StaffController.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/lz/modules/app/controller/StaffController.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/target/classes/com/lz/common/utils/DateUtils.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/com/lz/common/utils/DateUtils.class" afterDir="false" />
<change beforePath="$PROJECT_DIR$/target/classes/com/lz/modules/app/controller/StaffController.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/com/lz/modules/app/controller/StaffController.class" afterDir="false" />
<change beforePath="$PROJECT_DIR$/target/classes/com/lz/modules/app/service/StaffService.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/com/lz/modules/app/service/StaffService.class" afterDir="false" />
<change beforePath="$PROJECT_DIR$/target/classes/com/lz/modules/app/service/impl/StaffServiceImpl.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/com/lz/modules/app/service/impl/StaffServiceImpl.class" afterDir="false" />
<change beforePath="$PROJECT_DIR$/target/classes/com/lz/modules/job/task/GetFeishuDepartmentsJob.class" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/target/test-classes/com/lz/FumeiaiTest$1.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/test-classes/com/lz/FumeiaiTest$1.class" afterDir="false" />
<change beforePath="$PROJECT_DIR$/target/test-classes/com/lz/FumeiaiTest.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/test-classes/com/lz/FumeiaiTest.class" afterDir="false" />
</list>
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
<option name="SHOW_DIALOG" value="false" />
@ -163,7 +156,7 @@
<workItem from="1588161274115" duration="1691000" />
<workItem from="1588163384182" duration="74761000" />
<workItem from="1588936950753" duration="95758000" />
<workItem from="1590038091791" duration="9006000" />
<workItem from="1590038091791" duration="10294000" />
</task>
<servers />
</component>
@ -218,17 +211,17 @@
</line-breakpoint>
<line-breakpoint enabled="true" type="java-line">
<url>file://$PROJECT_DIR$/src/main/java/com/lz/modules/app/controller/StaffController.java</url>
<line>109</line>
<line>106</line>
<option name="timeStamp" value="69" />
</line-breakpoint>
<line-breakpoint enabled="true" type="java-line">
<url>file://$PROJECT_DIR$/src/main/java/com/lz/modules/app/controller/StaffController.java</url>
<line>136</line>
<line>133</line>
<option name="timeStamp" value="70" />
</line-breakpoint>
<line-breakpoint enabled="true" type="java-line">
<url>file://$PROJECT_DIR$/src/main/java/com/lz/modules/app/controller/StaffController.java</url>
<line>215</line>
<line>212</line>
<option name="timeStamp" value="74" />
</line-breakpoint>
</breakpoints>

View File

@ -1196,5 +1196,33 @@ public class ExcelUtil {
return data;
}
/**
* 获取模板列表
*
* @return
*/
public static Map<String, String> getExcelSheet2HeaderMap() {
LinkedHashMap<String, String> map = new LinkedHashMap<>();
map.put(ExcelStaffHeardEnum.findFieldByName("姓名"), "姓名");
map.put(ExcelStaffHeardEnum.findFieldByName("项目名称"), "项目名称");
map.put(ExcelStaffHeardEnum.findFieldByName("项目工作内容"), "项目工作内容");
map.put(ExcelStaffHeardEnum.findFieldByName("项目时间起"), "项目时间起");
map.put(ExcelStaffHeardEnum.findFieldByName("项目时间止"), "项目时间止");
return map;
}
/**
* 获取模板列表
*
* @return
*/
public static Map<String, String> getExcelSheet3HeaderMap() {
LinkedHashMap<String, String> map = new LinkedHashMap<>();
map.put(ExcelStaffHeardEnum.findFieldByName("姓名"), "姓名");
map.put(ExcelStaffHeardEnum.findFieldByName("工作调转时间"), "工作调转时间");
map.put(ExcelStaffHeardEnum.findFieldByName("调转记录"), "调转记录");
map.put(ExcelStaffHeardEnum.findFieldByName("调转类型"), "调转类型");
return map;
}
}

View File

@ -1,6 +1,5 @@
package com.lz.modules.app.controller;
import cn.hutool.core.date.DateUtil;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.google.common.collect.Lists;
@ -11,8 +10,6 @@ import com.lz.modules.app.entity.DepartmentsEntity;
import com.lz.modules.app.entity.StaffEntity;
import com.lz.modules.app.enums.ExcelStaffHeardEnum;
import com.lz.modules.app.service.*;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.ss.usermodel.WorkbookFactory;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@ -263,23 +260,25 @@ public class StaffController {
sheet.setDataset(dataList);
list.add(sheet);
ExcelSheet<HashMap<String, Object>> sheet2 = new ExcelSheet<>();
sheet2.setSheetName("员工档案表-离职");
sheet2.setHeaders(ExcelUtil.getExcelHeaderMap());
Map<String, String> headMap = ExcelUtil.getExcelHeaderMap();
headMap.put(ExcelStaffHeardEnum.findFieldByName("离职日期"), "离职日期");
headMap.put(ExcelStaffHeardEnum.findFieldByName("离职原因"), "离职原因");
sheet2.setHeaders(headMap);
list.add(sheet2);
ExcelSheet<HashMap<String, Object>> sheet3 = new ExcelSheet<>();
sheet3.setSheetName("员工项目经历");
sheet3.setHeaders(ExcelUtil.getExcelHeaderMap());
sheet3.setHeaders(ExcelUtil.getExcelSheet2HeaderMap());
list.add(sheet3);
ExcelSheet<HashMap<String, Object>> sheet4 = new ExcelSheet<>();
sheet4.setSheetName("工作调转记录");
sheet4.setHeaders(ExcelUtil.getExcelHeaderMap());
sheet4.setHeaders(ExcelUtil.getExcelSheet3HeaderMap());
list.add(sheet4);
ExcelUtil.exportExcel(list,"员工信息模版"+DateUtils.format(new Date(), DateUtils.DATE_TIME_PATTERN),response);
ExcelUtil.exportExcel(list, "员工信息模版" + DateUtils.format(new Date(), DateUtils.DATE_TIME_PATTERN), response);
} catch (IOException e) {
e.printStackTrace();
}