|
|
@@ -2,9 +2,12 @@ package com.jpsoft.employment.modules.job.controller;
|
|
|
|
|
|
import cn.hutool.core.util.IdcardUtil;
|
|
|
import com.github.pagehelper.Page;
|
|
|
+import com.jpsoft.employment.config.OSSConfig;
|
|
|
import com.jpsoft.employment.modules.common.dto.MessageResult;
|
|
|
import com.jpsoft.employment.modules.common.dto.Sort;
|
|
|
+import com.jpsoft.employment.modules.common.utils.OSSUtil;
|
|
|
import com.jpsoft.employment.modules.common.utils.PojoUtils;
|
|
|
+import com.jpsoft.employment.modules.job.dto.JobUserXlsDTO;
|
|
|
import com.jpsoft.employment.modules.job.dto.TalentPoolDTO;
|
|
|
import com.jpsoft.employment.modules.job.entity.*;
|
|
|
import com.jpsoft.employment.modules.job.service.*;
|
|
|
@@ -12,12 +15,18 @@ import com.jpsoft.employment.modules.sys.entity.DataDictionary;
|
|
|
import com.jpsoft.employment.modules.sys.service.DataDictionaryService;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
+import org.apache.poi.hssf.usermodel.HSSFCellStyle;
|
|
|
+import org.apache.poi.hssf.usermodel.HSSFWorkbook;
|
|
|
+import org.apache.poi.ss.usermodel.*;
|
|
|
+import org.apache.poi.ss.util.CellRangeAddress;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
+import java.io.ByteArrayInputStream;
|
|
|
+import java.io.ByteArrayOutputStream;
|
|
|
import java.text.SimpleDateFormat;
|
|
|
import java.util.*;
|
|
|
|
|
|
@@ -45,6 +54,13 @@ public class JobUserController {
|
|
|
@Autowired
|
|
|
private ResumeWorkExperienceService resumeWorkExperienceService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private ResumeEducationExperienceService resumeEducationExperienceService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private OSSConfig ossConfig;
|
|
|
+
|
|
|
+
|
|
|
|
|
|
@ApiOperation(value="列表")
|
|
|
@RequestMapping(value = "pageList",method = RequestMethod.POST)
|
|
|
@@ -246,6 +262,8 @@ public class JobUserController {
|
|
|
List<ResumeWorkExperience> resumeWorkExperienceList = new ArrayList<>();
|
|
|
|
|
|
if(resume!=null){
|
|
|
+ dto.setResumeId(resume.getId());
|
|
|
+
|
|
|
DataDictionary dataDictionary = dataDictionaryService.get(resume.getWorkExp());
|
|
|
|
|
|
if(dataDictionary!=null){
|
|
|
@@ -322,4 +340,638 @@ public class JobUserController {
|
|
|
return msgResult;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ @ApiOperation(value = "单个人员简历导出")
|
|
|
+ @PostMapping(value = "exportXls")
|
|
|
+ public MessageResult<Object> exportXls(String id, @RequestAttribute String subject) {
|
|
|
+
|
|
|
+ MessageResult<Object> messageResult = new MessageResult<>();
|
|
|
+
|
|
|
+ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
+
|
|
|
+ String downloadUrl = "";
|
|
|
+
|
|
|
+ List<JobUserXlsDTO> list = new ArrayList<>();
|
|
|
+
|
|
|
+ JobUser jobUser = jobUserService.get(id);
|
|
|
+
|
|
|
+ Resume resume = resumeService.findByUserId(jobUser.getId());
|
|
|
+
|
|
|
+ JobUserXlsDTO dto = new JobUserXlsDTO();
|
|
|
+
|
|
|
+ dto.setRealName(jobUser.getRealName());
|
|
|
+
|
|
|
+ String sexN ="";
|
|
|
+
|
|
|
+ if(StringUtils.isNotEmpty(jobUser.getSex())){
|
|
|
+ sexN = dataDictionaryService.getName(resume.getSex());
|
|
|
+ }
|
|
|
+ dto.setSexN(sexN);
|
|
|
+
|
|
|
+ int age = 0;
|
|
|
+
|
|
|
+ if(StringUtils.isNotEmpty(jobUser.getIdCard())){
|
|
|
+ age = IdcardUtil.getAgeByIdCard(jobUser.getIdCard());
|
|
|
+ }
|
|
|
+
|
|
|
+ dto.setAge(age);
|
|
|
+
|
|
|
+ String birthday="";
|
|
|
+
|
|
|
+ if(jobUser.getBirthday()!=null){
|
|
|
+ birthday = sdf.format(jobUser.getBirthday());
|
|
|
+ }
|
|
|
+ dto.setBirthday(birthday);
|
|
|
+
|
|
|
+ String positionCategoryName="";
|
|
|
+ WorkCategory workCategory = workCategoryService.get(resume.getPositionCategoryId());
|
|
|
+ if(workCategory!=null){
|
|
|
+ positionCategoryName = workCategory.getName();
|
|
|
+ }
|
|
|
+ dto.setPositionCategoryName(positionCategoryName);
|
|
|
+
|
|
|
+ dto.setDreamAdd(resume.getDreamAdd());
|
|
|
+
|
|
|
+ String dreamMoneyName="";
|
|
|
+
|
|
|
+ DataDictionary dataDictionary1 = dataDictionaryService.get(resume.getDreamMoney());
|
|
|
+ if(dataDictionary1!=null){
|
|
|
+ dreamMoneyName = dataDictionary1.getName();
|
|
|
+ }
|
|
|
+ dto.setDreamMoneyName(dreamMoneyName);
|
|
|
+
|
|
|
+ String workExpName="";
|
|
|
+ DataDictionary dataDictionary = dataDictionaryService.get(resume.getWorkExp());
|
|
|
+
|
|
|
+ if(dataDictionary!=null){
|
|
|
+ workExpName = dataDictionary.getName();
|
|
|
+ }
|
|
|
+ dto.setWorkExpName(workExpName);
|
|
|
+ dto.setTel(resume.getUserTel());
|
|
|
+ dto.setAddress(jobUser.getAddress());
|
|
|
+ dto.setCurCompany("");
|
|
|
+
|
|
|
+ String educationName="";
|
|
|
+ DataDictionary dataDictionary2 = dataDictionaryService.get(resume.getEducation());
|
|
|
+
|
|
|
+ if(dataDictionary2!=null){
|
|
|
+ educationName = dataDictionary2.getName();
|
|
|
+ }
|
|
|
+ dto.setEducationName(educationName);
|
|
|
+ dto.setIntroduction(resume.getIntroduction());
|
|
|
+ dto.setSchoolName("");
|
|
|
+ dto.setMajor("");
|
|
|
+
|
|
|
+ List<ResumeWorkExperience> resumeWorkExperienceList = resumeWorkExperienceService.findByResumeId(resume.getId());
|
|
|
+ dto.setWorkList(resumeWorkExperienceList);
|
|
|
+
|
|
|
+ List<ResumeEducationExperience> resumeEducationExperienceList = resumeEducationExperienceService.findByResumeId(resume.getId());
|
|
|
+ dto.setEducateList(resumeEducationExperienceList);
|
|
|
+
|
|
|
+ list.add(dto);
|
|
|
+
|
|
|
+ HSSFWorkbook workbook = new HSSFWorkbook();
|
|
|
+
|
|
|
+ for (int j=0;j<2;j++) {
|
|
|
+
|
|
|
+ Sheet sheet;
|
|
|
+
|
|
|
+ String[] titles;
|
|
|
+
|
|
|
+ if(j==0){
|
|
|
+ sheet = workbook.createSheet("应聘的简历列表");
|
|
|
+
|
|
|
+ titles = new String[]{"姓名","性别","年龄",
|
|
|
+ "应聘职位","期望工作地","期望薪资","工作经验","手机","现居住地","现工作单位","最高学历","学校名称","专业","应聘日期"};
|
|
|
+
|
|
|
+ //表头
|
|
|
+ Row rowTitle = sheet.createRow(0);
|
|
|
+
|
|
|
+
|
|
|
+ for (int i=0;i<titles.length;i++) {
|
|
|
+ Cell cell = rowTitle.createCell(i);
|
|
|
+ cell.setCellValue(titles[i]);
|
|
|
+ }
|
|
|
+
|
|
|
+ for (int i=0;i<list.size();i++){
|
|
|
+
|
|
|
+ Row row = sheet.createRow(i+1);
|
|
|
+
|
|
|
+ int colIndex = 0;
|
|
|
+
|
|
|
+ JobUserXlsDTO item = list.get(i);
|
|
|
+
|
|
|
+ row.createCell(colIndex++).setCellValue(com.jpsoft.employment.modules.common.utils.StringUtils.strValue(item.getRealName(),""));
|
|
|
+ row.createCell(colIndex++).setCellValue(com.jpsoft.employment.modules.common.utils.StringUtils.strValue(item.getSexN(),""));
|
|
|
+ row.createCell(colIndex++).setCellValue(com.jpsoft.employment.modules.common.utils.StringUtils.strValue(item.getAge(),""));
|
|
|
+ row.createCell(colIndex++).setCellValue(com.jpsoft.employment.modules.common.utils.StringUtils.strValue(item.getPositionCategoryName(),""));
|
|
|
+ row.createCell(colIndex++).setCellValue(com.jpsoft.employment.modules.common.utils.StringUtils.strValue(item.getDreamAdd(),""));
|
|
|
+ row.createCell(colIndex++).setCellValue(com.jpsoft.employment.modules.common.utils.StringUtils.strValue(item.getDreamMoneyName(),""));
|
|
|
+ row.createCell(colIndex++).setCellValue(com.jpsoft.employment.modules.common.utils.StringUtils.strValue(item.getWorkExpName(),""));
|
|
|
+ row.createCell(colIndex++).setCellValue(com.jpsoft.employment.modules.common.utils.StringUtils.strValue(item.getTel(),""));
|
|
|
+ row.createCell(colIndex++).setCellValue(com.jpsoft.employment.modules.common.utils.StringUtils.strValue(item.getAddress(),""));
|
|
|
+ row.createCell(colIndex++).setCellValue(com.jpsoft.employment.modules.common.utils.StringUtils.strValue("",""));
|
|
|
+ row.createCell(colIndex++).setCellValue(com.jpsoft.employment.modules.common.utils.StringUtils.strValue(item.getEducationName(),""));
|
|
|
+ row.createCell(colIndex++).setCellValue(com.jpsoft.employment.modules.common.utils.StringUtils.strValue("",""));
|
|
|
+ row.createCell(colIndex++).setCellValue(com.jpsoft.employment.modules.common.utils.StringUtils.strValue("",""));
|
|
|
+ row.createCell(colIndex++).setCellValue(com.jpsoft.employment.modules.common.utils.StringUtils.strValue("",""));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ JobUserXlsDTO item = list.get(0);
|
|
|
+
|
|
|
+ sheet = workbook.createSheet(item.getRealName());
|
|
|
+
|
|
|
+ Row row = sheet.createRow(0);
|
|
|
+ int colIndex = 0;
|
|
|
+ Cell cell0 = row.createCell(colIndex++);
|
|
|
+
|
|
|
+ HSSFCellStyle style = workbook.createCellStyle();
|
|
|
+
|
|
|
+ style.setFillForegroundColor(IndexedColors.ORANGE.getIndex());
|
|
|
+ style.setFillPattern(FillPatternType.SOLID_FOREGROUND);
|
|
|
+
|
|
|
+ cell0.setCellValue("个人基本信息");
|
|
|
+ cell0.setCellStyle(style);
|
|
|
+
|
|
|
+
|
|
|
+ Row row1 = sheet.createRow(1);
|
|
|
+ int colIndex1 = 0;
|
|
|
+ row1.createCell(colIndex1++).setCellValue("姓名");
|
|
|
+ row1.createCell(colIndex1++).setCellValue(item.getRealName());
|
|
|
+
|
|
|
+
|
|
|
+ Row row2 = sheet.createRow(2);
|
|
|
+ int colIndex2 = 0;
|
|
|
+ row2.createCell(colIndex2++).setCellValue("性别");
|
|
|
+ row2.createCell(colIndex2++).setCellValue(item.getSexN());
|
|
|
+
|
|
|
+ Row row4 = sheet.createRow(3);
|
|
|
+ int colIndex4 = 0;
|
|
|
+ row4.createCell(colIndex4++).setCellValue("出生年月");
|
|
|
+ row4.createCell(colIndex4++).setCellValue(item.getBirthday());
|
|
|
+
|
|
|
+ Row row5 = sheet.createRow(4);
|
|
|
+ int colIndex5 = 0;
|
|
|
+ row5.createCell(colIndex5++).setCellValue("现居住地");
|
|
|
+ row5.createCell(colIndex5++).setCellValue(item.getAddress());
|
|
|
+
|
|
|
+ Row row6 = sheet.createRow(5);
|
|
|
+ int colIndex6 = 0;
|
|
|
+ row6.createCell(colIndex6++).setCellValue("工作经验");
|
|
|
+ row6.createCell(colIndex6++).setCellValue(item.getWorkExpName());
|
|
|
+
|
|
|
+ Row row7 = sheet.createRow(6);
|
|
|
+ int colIndex7 = 0;
|
|
|
+ row7.createCell(colIndex7++).setCellValue("手机");
|
|
|
+ row7.createCell(colIndex7++).setCellValue(item.getTel());
|
|
|
+
|
|
|
+ Row row8 = sheet.createRow(7);
|
|
|
+ int colIndex8 = 0;
|
|
|
+ Cell cell8 = row8.createCell(colIndex8++);
|
|
|
+ cell8.setCellValue("求职意向");
|
|
|
+ cell8.setCellStyle(style);
|
|
|
+
|
|
|
+ Row row9 = sheet.createRow(8);
|
|
|
+ int colIndex9 = 0;
|
|
|
+ row9.createCell(colIndex9++).setCellValue("应聘职位");
|
|
|
+ row9.createCell(colIndex9++).setCellValue(item.getPositionCategoryName());
|
|
|
+
|
|
|
+ Row row10 = sheet.createRow(9);
|
|
|
+ int colIndex10 = 0;
|
|
|
+ row10.createCell(colIndex10++).setCellValue("期望工作地点");
|
|
|
+ row10.createCell(colIndex10++).setCellValue(item.getDreamAdd());
|
|
|
+
|
|
|
+ Row row11 = sheet.createRow(10);
|
|
|
+ int colIndex11 = 0;
|
|
|
+ row11.createCell(colIndex11++).setCellValue("期望薪资");
|
|
|
+ row11.createCell(colIndex11++).setCellValue(item.getDreamMoneyName());
|
|
|
+
|
|
|
+ Row row12 = sheet.createRow(11);
|
|
|
+ int colIndex12 = 0;
|
|
|
+ Cell cell12 = row12.createCell(colIndex12++);
|
|
|
+ cell12.setCellValue("自我评价");
|
|
|
+ cell12.setCellStyle(style);
|
|
|
+ row12.createCell(colIndex12++).setCellValue("");
|
|
|
+
|
|
|
+ Row row13 = sheet.createRow(12);
|
|
|
+ int colIndex13 = 0;
|
|
|
+ row13.createCell(colIndex13++).setCellValue("");
|
|
|
+ row13.createCell(colIndex13++).setCellValue(item.getIntroduction());
|
|
|
+
|
|
|
+
|
|
|
+ Row row14 = sheet.createRow(13);
|
|
|
+ int colIndex14 = 0;
|
|
|
+ Cell cell14 = row14.createCell(colIndex14++);
|
|
|
+ cell14.setCellValue("工作经历");
|
|
|
+ cell14.setCellStyle(style);
|
|
|
+
|
|
|
+ for (int u=0;u<item.getWorkList().size();u++) {
|
|
|
+ Row rowWorkExp = sheet.createRow(13+u*6+1);
|
|
|
+ int colIndexWorkExp = 0;
|
|
|
+ rowWorkExp.createCell(colIndexWorkExp++).setCellValue("工作单位");
|
|
|
+ rowWorkExp.createCell(colIndexWorkExp++).setCellValue(item.getWorkList().get(u).getCompanyName());
|
|
|
+
|
|
|
+ Row rowWorkTime = sheet.createRow(13+u*6+2);
|
|
|
+ int colIndexWorkTime = 0;
|
|
|
+ rowWorkTime.createCell(colIndexWorkTime++).setCellValue("工作时间");
|
|
|
+ rowWorkTime.createCell(colIndexWorkTime++).setCellValue(item.getWorkList().get(u).getStartTime()+"--"+item.getWorkList().get(u).getEndTime());
|
|
|
+
|
|
|
+ Row rowWorkXinZi = sheet.createRow(13+u*6+3);
|
|
|
+ int colIndexXinZi = 0;
|
|
|
+ rowWorkXinZi.createCell(colIndexXinZi++).setCellValue("薪资水平");
|
|
|
+ rowWorkXinZi.createCell(colIndexXinZi++).setCellValue("保密");
|
|
|
+
|
|
|
+ Row rowWorkZhiWei = sheet.createRow(13+u*6+4);
|
|
|
+ int colIndexZhiWei = 0;
|
|
|
+ rowWorkZhiWei.createCell(colIndexZhiWei++).setCellValue("在职职位");
|
|
|
+ rowWorkZhiWei.createCell(colIndexZhiWei++).setCellValue(item.getWorkList().get(u).getJob());
|
|
|
+
|
|
|
+ Row rowWorkZhiZe = sheet.createRow(13+u*6+5);
|
|
|
+ int colIndexZhiZe = 0;
|
|
|
+ rowWorkZhiZe.createCell(colIndexZhiZe++).setCellValue("工作职责");
|
|
|
+ rowWorkZhiZe.createCell(colIndexZhiZe++).setCellValue(item.getWorkList().get(u).getContent());
|
|
|
+ }
|
|
|
+
|
|
|
+ int num = 14 + item.getWorkList().size() * 6;
|
|
|
+
|
|
|
+ Row row15 = sheet.createRow(num);
|
|
|
+ int colIndex15 = 0;
|
|
|
+ Cell cell15 = row15.createCell(colIndex15++);
|
|
|
+ cell15.setCellValue("教育背景");
|
|
|
+ cell15.setCellStyle(style);
|
|
|
+
|
|
|
+ for (int u=0;u<item.getEducateList().size();u++) {
|
|
|
+ Row rowWorkExp = sheet.createRow(num+u*5+1);
|
|
|
+ int colIndexWorkExp = 0;
|
|
|
+ rowWorkExp.createCell(colIndexWorkExp++).setCellValue("就读学校");
|
|
|
+ rowWorkExp.createCell(colIndexWorkExp++).setCellValue(item.getEducateList().get(u).getSchoolName());
|
|
|
+
|
|
|
+ Row rowWorkTime = sheet.createRow(num+u*5+2);
|
|
|
+ int colIndexWorkTime = 0;
|
|
|
+ rowWorkTime.createCell(colIndexWorkTime++).setCellValue("就读时间");
|
|
|
+ rowWorkTime.createCell(colIndexWorkTime++).setCellValue(item.getEducateList().get(u).getStartTime()+"--"+item.getWorkList().get(u).getEndTime());
|
|
|
+
|
|
|
+ Row rowWorkXinZi = sheet.createRow(num+u*5+3);
|
|
|
+ int colIndexXinZi = 0;
|
|
|
+ rowWorkXinZi.createCell(colIndexXinZi++).setCellValue("学校学历");
|
|
|
+ rowWorkXinZi.createCell(colIndexXinZi++).setCellValue(item.getEducateList().get(u).getEducation());
|
|
|
+
|
|
|
+ Row rowWorkZhiWei = sheet.createRow(num+u*5+4);
|
|
|
+ int colIndexZhiWei = 0;
|
|
|
+ rowWorkZhiWei.createCell(colIndexZhiWei++).setCellValue("专业");
|
|
|
+ rowWorkZhiWei.createCell(colIndexZhiWei++).setCellValue(item.getEducateList().get(u).getMajor());
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ sheet.addMergedRegion(new CellRangeAddress(0,0,0,10));
|
|
|
+ sheet.addMergedRegion(new CellRangeAddress(7,7,0,10));
|
|
|
+ sheet.addMergedRegion(new CellRangeAddress(11,11,0,10));
|
|
|
+ sheet.addMergedRegion(new CellRangeAddress(13,13,0,10));
|
|
|
+ sheet.addMergedRegion(new CellRangeAddress(num,num,0,10));
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ ByteArrayOutputStream output = new ByteArrayOutputStream();
|
|
|
+
|
|
|
+ try {
|
|
|
+
|
|
|
+ workbook.write(output);
|
|
|
+
|
|
|
+ byte[] buffer = output.toByteArray();
|
|
|
+
|
|
|
+ ByteArrayInputStream input = new ByteArrayInputStream(buffer);
|
|
|
+
|
|
|
+ downloadUrl = OSSUtil.upload(ossConfig,"jobUser","导出人员简历.xls",input);
|
|
|
+
|
|
|
+ messageResult.setData(downloadUrl);
|
|
|
+ messageResult.setResult(true);
|
|
|
+ }
|
|
|
+ catch (Exception ex){
|
|
|
+ logger.error(ex.getMessage(),ex);
|
|
|
+ messageResult.setResult(false);
|
|
|
+ }
|
|
|
+
|
|
|
+ return messageResult;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value="批量下载")
|
|
|
+ @PostMapping("batchExportXls")
|
|
|
+ public MessageResult<Object> batchExportXls(@RequestBody List<String> idList,@RequestAttribute String subject){
|
|
|
+
|
|
|
+ MessageResult<Object> messageResult = new MessageResult<>();
|
|
|
+
|
|
|
+ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
+
|
|
|
+ String downloadUrl = "";
|
|
|
+
|
|
|
+ List<JobUserXlsDTO> list = new ArrayList<>();
|
|
|
+
|
|
|
+ for (String id:idList) {
|
|
|
+ JobUser jobUser = jobUserService.get(id);
|
|
|
+
|
|
|
+ Resume resume = resumeService.findByUserId(jobUser.getId());
|
|
|
+
|
|
|
+ JobUserXlsDTO dto = new JobUserXlsDTO();
|
|
|
+
|
|
|
+ dto.setRealName(jobUser.getRealName());
|
|
|
+
|
|
|
+ String sexN ="";
|
|
|
+
|
|
|
+ if(StringUtils.isNotEmpty(jobUser.getSex())){
|
|
|
+ sexN = dataDictionaryService.getName(resume.getSex());
|
|
|
+ }
|
|
|
+ dto.setSexN(sexN);
|
|
|
+
|
|
|
+ int age = 0;
|
|
|
+
|
|
|
+ if(StringUtils.isNotEmpty(jobUser.getIdCard())){
|
|
|
+ age = IdcardUtil.getAgeByIdCard(jobUser.getIdCard());
|
|
|
+ }
|
|
|
+
|
|
|
+ dto.setAge(age);
|
|
|
+
|
|
|
+ String birthday="";
|
|
|
+
|
|
|
+ if(jobUser.getBirthday()!=null){
|
|
|
+ birthday = sdf.format(jobUser.getBirthday());
|
|
|
+ }
|
|
|
+ dto.setBirthday(birthday);
|
|
|
+
|
|
|
+ String positionCategoryName="";
|
|
|
+ WorkCategory workCategory = workCategoryService.get(resume.getPositionCategoryId());
|
|
|
+ if(workCategory!=null){
|
|
|
+ positionCategoryName = workCategory.getName();
|
|
|
+ }
|
|
|
+ dto.setPositionCategoryName(positionCategoryName);
|
|
|
+
|
|
|
+ dto.setDreamAdd(resume.getDreamAdd());
|
|
|
+
|
|
|
+ String dreamMoneyName="";
|
|
|
+
|
|
|
+ DataDictionary dataDictionary1 = dataDictionaryService.get(resume.getDreamMoney());
|
|
|
+ if(dataDictionary1!=null){
|
|
|
+ dreamMoneyName = dataDictionary1.getName();
|
|
|
+ }
|
|
|
+ dto.setDreamMoneyName(dreamMoneyName);
|
|
|
+
|
|
|
+ String workExpName="";
|
|
|
+ DataDictionary dataDictionary = dataDictionaryService.get(resume.getWorkExp());
|
|
|
+
|
|
|
+ if(dataDictionary!=null){
|
|
|
+ workExpName = dataDictionary.getName();
|
|
|
+ }
|
|
|
+ dto.setWorkExpName(workExpName);
|
|
|
+ dto.setTel(resume.getUserTel());
|
|
|
+ dto.setAddress(jobUser.getAddress());
|
|
|
+ dto.setCurCompany("");
|
|
|
+
|
|
|
+ String educationName="";
|
|
|
+ DataDictionary dataDictionary2 = dataDictionaryService.get(resume.getEducation());
|
|
|
+
|
|
|
+ if(dataDictionary2!=null){
|
|
|
+ educationName = dataDictionary2.getName();
|
|
|
+ }
|
|
|
+ dto.setEducationName(educationName);
|
|
|
+ dto.setIntroduction(resume.getIntroduction());
|
|
|
+ dto.setSchoolName("");
|
|
|
+ dto.setMajor("");
|
|
|
+
|
|
|
+ List<ResumeWorkExperience> resumeWorkExperienceList = resumeWorkExperienceService.findByResumeId(resume.getId());
|
|
|
+ dto.setWorkList(resumeWorkExperienceList);
|
|
|
+
|
|
|
+ List<ResumeEducationExperience> resumeEducationExperienceList = resumeEducationExperienceService.findByResumeId(resume.getId());
|
|
|
+ dto.setEducateList(resumeEducationExperienceList);
|
|
|
+
|
|
|
+ list.add(dto);
|
|
|
+ }
|
|
|
+
|
|
|
+ HSSFWorkbook workbook = new HSSFWorkbook();
|
|
|
+
|
|
|
+ for (int j=0;j < list.size() + 1;j++) {
|
|
|
+
|
|
|
+ Sheet sheet;
|
|
|
+
|
|
|
+ String[] titles;
|
|
|
+
|
|
|
+ if(j==0){
|
|
|
+ sheet = workbook.createSheet("应聘的简历列表");
|
|
|
+
|
|
|
+ titles = new String[]{"姓名","性别","年龄",
|
|
|
+ "应聘职位","期望工作地","期望薪资","工作经验","手机","现居住地","现工作单位","最高学历","学校名称","专业","应聘日期"};
|
|
|
+
|
|
|
+ //表头
|
|
|
+ Row rowTitle = sheet.createRow(0);
|
|
|
+
|
|
|
+
|
|
|
+ for (int i=0;i<titles.length;i++) {
|
|
|
+ Cell cell = rowTitle.createCell(i);
|
|
|
+ cell.setCellValue(titles[i]);
|
|
|
+ }
|
|
|
+
|
|
|
+ for (int i=0;i<list.size();i++){
|
|
|
+
|
|
|
+ Row row = sheet.createRow(i+1);
|
|
|
+
|
|
|
+ int colIndex = 0;
|
|
|
+
|
|
|
+ JobUserXlsDTO item = list.get(i);
|
|
|
+
|
|
|
+ row.createCell(colIndex++).setCellValue(com.jpsoft.employment.modules.common.utils.StringUtils.strValue(item.getRealName(),""));
|
|
|
+ row.createCell(colIndex++).setCellValue(com.jpsoft.employment.modules.common.utils.StringUtils.strValue(item.getSexN(),""));
|
|
|
+ row.createCell(colIndex++).setCellValue(com.jpsoft.employment.modules.common.utils.StringUtils.strValue(item.getAge(),""));
|
|
|
+ row.createCell(colIndex++).setCellValue(com.jpsoft.employment.modules.common.utils.StringUtils.strValue(item.getPositionCategoryName(),""));
|
|
|
+ row.createCell(colIndex++).setCellValue(com.jpsoft.employment.modules.common.utils.StringUtils.strValue(item.getDreamAdd(),""));
|
|
|
+ row.createCell(colIndex++).setCellValue(com.jpsoft.employment.modules.common.utils.StringUtils.strValue(item.getDreamMoneyName(),""));
|
|
|
+ row.createCell(colIndex++).setCellValue(com.jpsoft.employment.modules.common.utils.StringUtils.strValue(item.getWorkExpName(),""));
|
|
|
+ row.createCell(colIndex++).setCellValue(com.jpsoft.employment.modules.common.utils.StringUtils.strValue(item.getTel(),""));
|
|
|
+ row.createCell(colIndex++).setCellValue(com.jpsoft.employment.modules.common.utils.StringUtils.strValue(item.getAddress(),""));
|
|
|
+ row.createCell(colIndex++).setCellValue(com.jpsoft.employment.modules.common.utils.StringUtils.strValue("",""));
|
|
|
+ row.createCell(colIndex++).setCellValue(com.jpsoft.employment.modules.common.utils.StringUtils.strValue(item.getEducationName(),""));
|
|
|
+ row.createCell(colIndex++).setCellValue(com.jpsoft.employment.modules.common.utils.StringUtils.strValue("",""));
|
|
|
+ row.createCell(colIndex++).setCellValue(com.jpsoft.employment.modules.common.utils.StringUtils.strValue("",""));
|
|
|
+ row.createCell(colIndex++).setCellValue(com.jpsoft.employment.modules.common.utils.StringUtils.strValue("",""));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ JobUserXlsDTO item = list.get(j-1);
|
|
|
+
|
|
|
+ sheet = workbook.createSheet(item.getRealName());
|
|
|
+
|
|
|
+ Row row = sheet.createRow(0);
|
|
|
+ int colIndex = 0;
|
|
|
+ Cell cell0 = row.createCell(colIndex++);
|
|
|
+
|
|
|
+ HSSFCellStyle style = workbook.createCellStyle();
|
|
|
+
|
|
|
+ style.setFillForegroundColor(IndexedColors.ORANGE.getIndex());
|
|
|
+ style.setFillPattern(FillPatternType.SOLID_FOREGROUND);
|
|
|
+
|
|
|
+ cell0.setCellValue("个人基本信息");
|
|
|
+ cell0.setCellStyle(style);
|
|
|
+
|
|
|
+
|
|
|
+ Row row1 = sheet.createRow(1);
|
|
|
+ int colIndex1 = 0;
|
|
|
+ row1.createCell(colIndex1++).setCellValue("姓名");
|
|
|
+ row1.createCell(colIndex1++).setCellValue(item.getRealName());
|
|
|
+
|
|
|
+
|
|
|
+ Row row2 = sheet.createRow(2);
|
|
|
+ int colIndex2 = 0;
|
|
|
+ row2.createCell(colIndex2++).setCellValue("性别");
|
|
|
+ row2.createCell(colIndex2++).setCellValue(item.getSexN());
|
|
|
+
|
|
|
+ Row row4 = sheet.createRow(3);
|
|
|
+ int colIndex4 = 0;
|
|
|
+ row4.createCell(colIndex4++).setCellValue("出生年月");
|
|
|
+ row4.createCell(colIndex4++).setCellValue(item.getBirthday());
|
|
|
+
|
|
|
+ Row row5 = sheet.createRow(4);
|
|
|
+ int colIndex5 = 0;
|
|
|
+ row5.createCell(colIndex5++).setCellValue("现居住地");
|
|
|
+ row5.createCell(colIndex5++).setCellValue(item.getAddress());
|
|
|
+
|
|
|
+ Row row6 = sheet.createRow(5);
|
|
|
+ int colIndex6 = 0;
|
|
|
+ row6.createCell(colIndex6++).setCellValue("工作经验");
|
|
|
+ row6.createCell(colIndex6++).setCellValue(item.getWorkExpName());
|
|
|
+
|
|
|
+ Row row7 = sheet.createRow(6);
|
|
|
+ int colIndex7 = 0;
|
|
|
+ row7.createCell(colIndex7++).setCellValue("手机");
|
|
|
+ row7.createCell(colIndex7++).setCellValue(item.getTel());
|
|
|
+
|
|
|
+ Row row8 = sheet.createRow(7);
|
|
|
+ int colIndex8 = 0;
|
|
|
+ Cell cell8 = row8.createCell(colIndex8++);
|
|
|
+ cell8.setCellValue("求职意向");
|
|
|
+ cell8.setCellStyle(style);
|
|
|
+
|
|
|
+ Row row9 = sheet.createRow(8);
|
|
|
+ int colIndex9 = 0;
|
|
|
+ row9.createCell(colIndex9++).setCellValue("应聘职位");
|
|
|
+ row9.createCell(colIndex9++).setCellValue(item.getPositionCategoryName());
|
|
|
+
|
|
|
+ Row row10 = sheet.createRow(9);
|
|
|
+ int colIndex10 = 0;
|
|
|
+ row10.createCell(colIndex10++).setCellValue("期望工作地点");
|
|
|
+ row10.createCell(colIndex10++).setCellValue(item.getDreamAdd());
|
|
|
+
|
|
|
+ Row row11 = sheet.createRow(10);
|
|
|
+ int colIndex11 = 0;
|
|
|
+ row11.createCell(colIndex11++).setCellValue("期望薪资");
|
|
|
+ row11.createCell(colIndex11++).setCellValue(item.getDreamMoneyName());
|
|
|
+
|
|
|
+ Row row12 = sheet.createRow(11);
|
|
|
+ int colIndex12 = 0;
|
|
|
+ Cell cell12 = row12.createCell(colIndex12++);
|
|
|
+ cell12.setCellValue("自我评价");
|
|
|
+ cell12.setCellStyle(style);
|
|
|
+ row12.createCell(colIndex12++).setCellValue("");
|
|
|
+
|
|
|
+ Row row13 = sheet.createRow(12);
|
|
|
+ int colIndex13 = 0;
|
|
|
+ row13.createCell(colIndex13++).setCellValue("");
|
|
|
+ row13.createCell(colIndex13++).setCellValue(item.getIntroduction());
|
|
|
+
|
|
|
+
|
|
|
+ Row row14 = sheet.createRow(13);
|
|
|
+ int colIndex14 = 0;
|
|
|
+ Cell cell14 = row14.createCell(colIndex14++);
|
|
|
+ cell14.setCellValue("工作经历");
|
|
|
+ cell14.setCellStyle(style);
|
|
|
+
|
|
|
+ for (int u=0;u<item.getWorkList().size();u++) {
|
|
|
+ Row rowWorkExp = sheet.createRow(13+u*6+1);
|
|
|
+ int colIndexWorkExp = 0;
|
|
|
+ rowWorkExp.createCell(colIndexWorkExp++).setCellValue("工作单位");
|
|
|
+ rowWorkExp.createCell(colIndexWorkExp++).setCellValue(item.getWorkList().get(u).getCompanyName());
|
|
|
+
|
|
|
+ Row rowWorkTime = sheet.createRow(13+u*6+2);
|
|
|
+ int colIndexWorkTime = 0;
|
|
|
+ rowWorkTime.createCell(colIndexWorkTime++).setCellValue("工作时间");
|
|
|
+ rowWorkTime.createCell(colIndexWorkTime++).setCellValue(item.getWorkList().get(u).getStartTime()+"--"+item.getWorkList().get(u).getEndTime());
|
|
|
+
|
|
|
+ Row rowWorkXinZi = sheet.createRow(13+u*6+3);
|
|
|
+ int colIndexXinZi = 0;
|
|
|
+ rowWorkXinZi.createCell(colIndexXinZi++).setCellValue("薪资水平");
|
|
|
+ rowWorkXinZi.createCell(colIndexXinZi++).setCellValue("保密");
|
|
|
+
|
|
|
+ Row rowWorkZhiWei = sheet.createRow(13+u*6+4);
|
|
|
+ int colIndexZhiWei = 0;
|
|
|
+ rowWorkZhiWei.createCell(colIndexZhiWei++).setCellValue("在职职位");
|
|
|
+ rowWorkZhiWei.createCell(colIndexZhiWei++).setCellValue(item.getWorkList().get(u).getJob());
|
|
|
+
|
|
|
+ Row rowWorkZhiZe = sheet.createRow(13+u*6+5);
|
|
|
+ int colIndexZhiZe = 0;
|
|
|
+ rowWorkZhiZe.createCell(colIndexZhiZe++).setCellValue("工作职责");
|
|
|
+ rowWorkZhiZe.createCell(colIndexZhiZe++).setCellValue(item.getWorkList().get(u).getContent());
|
|
|
+ }
|
|
|
+
|
|
|
+ int num = 14 + item.getWorkList().size() * 6;
|
|
|
+
|
|
|
+ Row row15 = sheet.createRow(num);
|
|
|
+ int colIndex15 = 0;
|
|
|
+ Cell cell15 = row15.createCell(colIndex15++);
|
|
|
+ cell15.setCellValue("教育背景");
|
|
|
+ cell15.setCellStyle(style);
|
|
|
+
|
|
|
+ for (int u=0;u<item.getEducateList().size();u++) {
|
|
|
+ Row rowWorkExp = sheet.createRow(num+u*5+1);
|
|
|
+ int colIndexWorkExp = 0;
|
|
|
+ rowWorkExp.createCell(colIndexWorkExp++).setCellValue("就读学校");
|
|
|
+ rowWorkExp.createCell(colIndexWorkExp++).setCellValue(item.getEducateList().get(u).getSchoolName());
|
|
|
+
|
|
|
+ Row rowWorkTime = sheet.createRow(num+u*5+2);
|
|
|
+ int colIndexWorkTime = 0;
|
|
|
+ rowWorkTime.createCell(colIndexWorkTime++).setCellValue("就读时间");
|
|
|
+ rowWorkTime.createCell(colIndexWorkTime++).setCellValue(item.getEducateList().get(u).getStartTime()+"--"+item.getWorkList().get(u).getEndTime());
|
|
|
+
|
|
|
+ Row rowWorkXinZi = sheet.createRow(num+u*5+3);
|
|
|
+ int colIndexXinZi = 0;
|
|
|
+ rowWorkXinZi.createCell(colIndexXinZi++).setCellValue("学校学历");
|
|
|
+ rowWorkXinZi.createCell(colIndexXinZi++).setCellValue(item.getEducateList().get(u).getEducation());
|
|
|
+
|
|
|
+ Row rowWorkZhiWei = sheet.createRow(num+u*5+4);
|
|
|
+ int colIndexZhiWei = 0;
|
|
|
+ rowWorkZhiWei.createCell(colIndexZhiWei++).setCellValue("专业");
|
|
|
+ rowWorkZhiWei.createCell(colIndexZhiWei++).setCellValue(item.getEducateList().get(u).getMajor());
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ sheet.addMergedRegion(new CellRangeAddress(0,0,0,10));
|
|
|
+ sheet.addMergedRegion(new CellRangeAddress(7,7,0,10));
|
|
|
+ sheet.addMergedRegion(new CellRangeAddress(11,11,0,10));
|
|
|
+ sheet.addMergedRegion(new CellRangeAddress(13,13,0,10));
|
|
|
+ sheet.addMergedRegion(new CellRangeAddress(num,num,0,10));
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ ByteArrayOutputStream output = new ByteArrayOutputStream();
|
|
|
+
|
|
|
+ try {
|
|
|
+
|
|
|
+ workbook.write(output);
|
|
|
+
|
|
|
+ byte[] buffer = output.toByteArray();
|
|
|
+
|
|
|
+ ByteArrayInputStream input = new ByteArrayInputStream(buffer);
|
|
|
+
|
|
|
+ downloadUrl = OSSUtil.upload(ossConfig,"batchJobUser","批量下载人员简历.xls",input);
|
|
|
+
|
|
|
+ messageResult.setData(downloadUrl);
|
|
|
+ messageResult.setResult(true);
|
|
|
+ }
|
|
|
+ catch (Exception ex){
|
|
|
+ logger.error(ex.getMessage(),ex);
|
|
|
+ messageResult.setResult(false);
|
|
|
+ }
|
|
|
+
|
|
|
+ return messageResult;
|
|
|
+ }
|
|
|
+
|
|
|
}
|