|
|
@@ -1,19 +1,37 @@
|
|
|
package com.jpsoft.employment.modules.job.controller;
|
|
|
|
|
|
import com.github.pagehelper.Page;
|
|
|
+import com.jpsoft.employment.config.OSSConfig;
|
|
|
+import com.jpsoft.employment.modules.base.entity.Company;
|
|
|
+import com.jpsoft.employment.modules.base.service.CompanyService;
|
|
|
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.entity.ResumeDeliver;
|
|
|
-import com.jpsoft.employment.modules.job.service.ResumeDeliverService;
|
|
|
+import com.jpsoft.employment.modules.job.dto.JobUserDTO;
|
|
|
+import com.jpsoft.employment.modules.job.dto.ResumeDeliverDTO;
|
|
|
+import com.jpsoft.employment.modules.job.dto.ResumeDeliverRecordDTO;
|
|
|
+import com.jpsoft.employment.modules.job.entity.*;
|
|
|
+import com.jpsoft.employment.modules.job.service.*;
|
|
|
+import com.jpsoft.employment.modules.sys.entity.DataDictionary;
|
|
|
+import com.jpsoft.employment.modules.sys.entity.User;
|
|
|
+import com.jpsoft.employment.modules.sys.service.DataDictionaryService;
|
|
|
+import com.jpsoft.employment.modules.sys.service.UserService;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
+import org.apache.poi.hssf.usermodel.HSSFWorkbook;
|
|
|
+import org.apache.poi.ss.usermodel.Cell;
|
|
|
+import org.apache.poi.ss.usermodel.Row;
|
|
|
+import org.apache.poi.ss.usermodel.Sheet;
|
|
|
+import org.apache.poi.ss.usermodel.Workbook;
|
|
|
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.*;
|
|
|
|
|
|
@@ -25,19 +43,138 @@ public class ResumeDeliverController {
|
|
|
@Autowired
|
|
|
private ResumeDeliverService resumeDeliverService;
|
|
|
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private JobUserService jobUserService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private RecruitmentService recruitmentService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private ResumeService RsumeService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private PositionCategoryService positionCategoryService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private DataDictionaryService dataDictionaryService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private UserService userService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private CompanyService companyService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private ResumeDeliverRecordService resumeDeliverRecordService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private OSSConfig ossConfig;
|
|
|
+
|
|
|
@ApiOperation(value="添加信息")
|
|
|
@PostMapping("add")
|
|
|
- public MessageResult<ResumeDeliver> add(@ModelAttribute ResumeDeliver resumeDeliver){
|
|
|
- MessageResult<ResumeDeliver> msgResult = new MessageResult<>();
|
|
|
+ public MessageResult<ResumeDeliverRecord> add(@RequestBody ResumeDeliverRecordDTO resumeDeliverRecordDTO,@RequestAttribute String subject){
|
|
|
+ MessageResult<ResumeDeliverRecord> msgResult = new MessageResult<>();
|
|
|
|
|
|
try {
|
|
|
- resumeDeliver.setId(UUID.randomUUID().toString());
|
|
|
+ ResumeDeliverRecord resumeDeliverRecord=new ResumeDeliverRecord();
|
|
|
+ resumeDeliverRecord.setId(UUID.randomUUID().toString());
|
|
|
+ resumeDeliverRecord.setCreateBy(subject);
|
|
|
+ Date now = new Date();
|
|
|
+
|
|
|
+ resumeDeliverRecord.setCreateTime(now);
|
|
|
+
|
|
|
+ resumeDeliverRecord.setDelFlag(false);
|
|
|
+ resumeDeliverRecord.setResumeDeliverId(resumeDeliverRecordDTO.getId());
|
|
|
+
|
|
|
+ String chatStatusN = dataDictionaryService.findNameByCatalogNameAndValue("沟通状态",resumeDeliverRecordDTO.getChatType());
|
|
|
+
|
|
|
+ resumeDeliverRecord.setStep("发送"+chatStatusN);
|
|
|
+
|
|
|
+ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
+
|
|
|
+ String ChatDateStr = "";
|
|
|
+
|
|
|
|
|
|
- int affectCount = resumeDeliverService.insert(resumeDeliver);
|
|
|
+ //邀请沟通
|
|
|
+ if(resumeDeliverRecordDTO.getChatType().equals("2")) {
|
|
|
+
|
|
|
+ String beginTime = "";
|
|
|
+ String endTime = "";
|
|
|
+
|
|
|
+ if (StringUtils.isNotEmpty(resumeDeliverRecordDTO.getChatTime())) {
|
|
|
+ String[] ChatTimeArray = resumeDeliverRecordDTO.getChatTime().split(",");
|
|
|
+ beginTime = ChatTimeArray[0];
|
|
|
+ endTime = ChatTimeArray[1];
|
|
|
+ }
|
|
|
+
|
|
|
+ if (resumeDeliverRecordDTO.getChatDate() != null) {
|
|
|
+ ChatDateStr = sdf.format(resumeDeliverRecordDTO.getChatDate());
|
|
|
+ }
|
|
|
+
|
|
|
+ resumeDeliverRecord.setRemark("沟通时间:" + ChatDateStr + " " + beginTime + "-" + endTime);
|
|
|
+ }
|
|
|
+ else if(resumeDeliverRecordDTO.getChatType().equals("3")){
|
|
|
+ //邀请面试
|
|
|
+ if (resumeDeliverRecordDTO.getChatDate() != null) {
|
|
|
+ ChatDateStr = sdf.format(resumeDeliverRecordDTO.getChatDate());
|
|
|
+ }
|
|
|
+ resumeDeliverRecord.setRemark("面试时间:" + ChatDateStr + " " + resumeDeliverRecordDTO.getChatTime());
|
|
|
+ }
|
|
|
+ else if(resumeDeliverRecordDTO.getChatType().equals("4")){
|
|
|
+ //邀请入职
|
|
|
+ ResumeDeliver resumeDeliver = resumeDeliverService.get(resumeDeliverRecordDTO.getId());
|
|
|
+
|
|
|
+ if (resumeDeliver != null) {
|
|
|
+ JobUser jobUser = jobUserService.get(resumeDeliver.getJobUserId());
|
|
|
+
|
|
|
+ Recruitment recruitment = recruitmentService.get(resumeDeliver.getJobRecruitmentId());
|
|
|
+
|
|
|
+ Company company = companyService.get(recruitment.getCompanyId());
|
|
|
+
|
|
|
+ String entryPosition = "";
|
|
|
+ String entryDepartment = "";
|
|
|
+
|
|
|
+ if (StringUtils.isNotEmpty(resumeDeliverRecordDTO.getChatTime())) {
|
|
|
+ String[] ChatTimeArray = resumeDeliverRecordDTO.getChatTime().split(",");
|
|
|
+ entryPosition = ChatTimeArray[0];
|
|
|
+ entryDepartment = ChatTimeArray[1];
|
|
|
+ }
|
|
|
+
|
|
|
+ resumeDeliverRecord.setRemark("录用人:"+jobUser.getRealName()+",身份证号:"+jobUser.getIdCard()+",入职公司:"+company.getName()+",入职岗位:"+entryPosition+",入职部门:"+entryDepartment+",工作地点:"+recruitment.getArea());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else if(resumeDeliverRecordDTO.getChatType().equals("6")){
|
|
|
+ //拒绝/不合适
|
|
|
+ resumeDeliverRecord.setRemark("拒绝理由:" + resumeDeliverRecordDTO.getRemark());
|
|
|
+ }
|
|
|
+
|
|
|
+ int affectCount = resumeDeliverRecordService.insert(resumeDeliverRecord);
|
|
|
|
|
|
if (affectCount > 0) {
|
|
|
- msgResult.setResult(true);
|
|
|
- msgResult.setData(resumeDeliver);
|
|
|
+ ResumeDeliver resumeDeliver = resumeDeliverService.get(resumeDeliverRecordDTO.getId());
|
|
|
+
|
|
|
+ if(resumeDeliver!=null){
|
|
|
+ resumeDeliver.setChatStatus(resumeDeliverRecordDTO.getChatType());
|
|
|
+ resumeDeliver.setUpdateBy(subject);
|
|
|
+ resumeDeliver.setUpdateTime(now);
|
|
|
+
|
|
|
+ //更改沟通状态
|
|
|
+ int count = resumeDeliverService.update(resumeDeliver);
|
|
|
+
|
|
|
+ if(count>0){
|
|
|
+ msgResult.setResult(true);
|
|
|
+ msgResult.setData(resumeDeliverRecord);
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ msgResult.setResult(false);
|
|
|
+ msgResult.setMessage("数据库添加失败");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ msgResult.setResult(false);
|
|
|
+ msgResult.setMessage("数据库添加失败");
|
|
|
+ }
|
|
|
} else {
|
|
|
msgResult.setResult(false);
|
|
|
msgResult.setMessage("数据库添加失败");
|
|
|
@@ -54,19 +191,76 @@ public class ResumeDeliverController {
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value="获取信息")
|
|
|
- @GetMapping("detail/{id}")
|
|
|
- public MessageResult<ResumeDeliver> detail(@PathVariable("id") String id){
|
|
|
- MessageResult<ResumeDeliver> msgResult = new MessageResult<>();
|
|
|
+ @GetMapping("edit/{id}")
|
|
|
+ public MessageResult<User> edit(@PathVariable("id") String id,@RequestAttribute String subject){
|
|
|
+ MessageResult<User> msgResult = new MessageResult<>();
|
|
|
|
|
|
try {
|
|
|
+ User user = userService.get(subject);
|
|
|
+
|
|
|
+ if (user != null) {
|
|
|
+ Company company = companyService.get(user.getCompanyId());
|
|
|
+ if(company!=null){
|
|
|
+ user.setCompanyName(company.getName());
|
|
|
+ }
|
|
|
+ msgResult.setResult(true);
|
|
|
+ msgResult.setData(user);
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ msgResult.setResult(true);
|
|
|
+ msgResult.setMessage("用户未登录或登录过期,请重新登录!");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ catch(Exception ex){
|
|
|
+ logger.error(ex.getMessage(),ex);
|
|
|
+
|
|
|
+ msgResult.setResult(false);
|
|
|
+ msgResult.setMessage(ex.getMessage());
|
|
|
+ }
|
|
|
+
|
|
|
+ return msgResult;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ @ApiOperation(value="获取录用人信息")
|
|
|
+ @GetMapping("edit3/{id}")
|
|
|
+ public MessageResult<JobUserDTO> edit3(@PathVariable("id") String id){
|
|
|
+ MessageResult<JobUserDTO> msgResult = new MessageResult<>();
|
|
|
+
|
|
|
+ try {
|
|
|
+
|
|
|
ResumeDeliver resumeDeliver = resumeDeliverService.get(id);
|
|
|
|
|
|
if (resumeDeliver != null) {
|
|
|
+ JobUser jobUser = jobUserService.get(resumeDeliver.getJobUserId());
|
|
|
+
|
|
|
+ Recruitment recruitment = recruitmentService.get(resumeDeliver.getJobRecruitmentId());
|
|
|
+
|
|
|
+
|
|
|
+ JobUserDTO dto = new JobUserDTO();
|
|
|
+
|
|
|
+ if(jobUser!=null) {
|
|
|
+ dto.setRealName(jobUser.getRealName());
|
|
|
+ dto.setIdCard(jobUser.getIdCard());
|
|
|
+ }
|
|
|
+
|
|
|
+ if(recruitment!=null){
|
|
|
+ Company company = companyService.get(recruitment.getCompanyId());
|
|
|
+ if(company!=null){
|
|
|
+ dto.setCompanyName(company.getName());
|
|
|
+
|
|
|
+ }
|
|
|
+ dto.setArea(recruitment.getArea());
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
msgResult.setResult(true);
|
|
|
- msgResult.setData(resumeDeliver);
|
|
|
- } else {
|
|
|
- msgResult.setResult(false);
|
|
|
- msgResult.setMessage("数据库不存在该记录!");
|
|
|
+ msgResult.setData(dto);
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ msgResult.setResult(true);
|
|
|
+ msgResult.setMessage("系统错误,投递的简历不存在!");
|
|
|
}
|
|
|
}
|
|
|
catch(Exception ex){
|
|
|
@@ -143,9 +337,9 @@ public class ResumeDeliverController {
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value="列表")
|
|
|
- @RequestMapping(value = "list",method = RequestMethod.POST)
|
|
|
- public MessageResult<Map> list(
|
|
|
- String id,
|
|
|
+ @RequestMapping(value = "pageList",method = RequestMethod.POST)
|
|
|
+ public MessageResult<Map> pageList(
|
|
|
+ String chatStatus,String name,
|
|
|
@RequestParam(value="pageIndex",defaultValue="1") int pageIndex,
|
|
|
@RequestParam(value="pageSize",defaultValue="20") int pageSize,
|
|
|
HttpServletRequest request){
|
|
|
@@ -159,19 +353,315 @@ public class ResumeDeliverController {
|
|
|
Map<String,Object> searchParams = new HashMap<>();
|
|
|
|
|
|
List<Sort> sortList = new ArrayList<>();
|
|
|
- sortList.add(new Sort("id_","asc"));
|
|
|
+ sortList.add(new Sort("a.create_time","desc"));
|
|
|
+
|
|
|
+ if (!"0".equals(chatStatus)) {
|
|
|
+ searchParams.put("chatStatus",chatStatus);
|
|
|
+ }
|
|
|
|
|
|
- if (StringUtils.isNotEmpty(id)) {
|
|
|
- searchParams.put("id","%" + id + "%");
|
|
|
+ if (StringUtils.isNotEmpty(name)) {
|
|
|
+ searchParams.put("name","%" + name + "%");
|
|
|
}
|
|
|
|
|
|
|
|
|
+
|
|
|
Page<ResumeDeliver> page = resumeDeliverService.pageSearch(searchParams,pageIndex,pageSize,true,sortList);
|
|
|
|
|
|
+ Page<ResumeDeliverDTO> pageDto = new Page<>();
|
|
|
+
|
|
|
+ for (ResumeDeliver resumeDeliver:page) {
|
|
|
+ ResumeDeliverDTO dto = new ResumeDeliverDTO();
|
|
|
+
|
|
|
+ dto.setId(resumeDeliver.getId());
|
|
|
+
|
|
|
+ JobUser jobUser = jobUserService.get(resumeDeliver.getJobUserId());
|
|
|
+
|
|
|
+ if(jobUser!=null){
|
|
|
+ dto.setName(jobUser.getRealName());
|
|
|
+ dto.setJobStatus(jobUser.getJobStatus());
|
|
|
+
|
|
|
+ if(StringUtils.isNotEmpty(jobUser.getJobStatus())) {
|
|
|
+ String jobStatusN = dataDictionaryService.findNameByCatalogNameAndValue("工作在职状态", jobUser.getJobStatus());
|
|
|
+ dto.setJobStatusN(jobStatusN);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ Recruitment recruitment = recruitmentService.get(resumeDeliver.getJobRecruitmentId());
|
|
|
+
|
|
|
+ if(recruitment!=null){
|
|
|
+
|
|
|
+ dto.setPositionNumber(recruitment.getPositionNumber());
|
|
|
+
|
|
|
+ PositionCategory positionCategory = positionCategoryService.get(recruitment.getPosition());
|
|
|
+
|
|
|
+ dto.setPosition(positionCategory.getName());
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ Resume resume = RsumeService.get(resumeDeliver.getJobResumeId());
|
|
|
+
|
|
|
+ if(resume!=null){
|
|
|
+ dto.setDreamMoney(resume.getDreamMoney());
|
|
|
+ dto.setWorkExp(resume.getWorkExp());
|
|
|
+ dto.setEducation(resume.getEducation());
|
|
|
+ dto.setBirthday(resume.getBirthday());
|
|
|
+ }
|
|
|
+
|
|
|
+ dto.setChatStatus(resumeDeliver.getChatStatus());
|
|
|
+
|
|
|
+ if(StringUtils.isNotEmpty(resumeDeliver.getChatStatus())) {
|
|
|
+ String chatStatusN = dataDictionaryService.findNameByCatalogNameAndValue("沟通状态", resumeDeliver.getChatStatus());
|
|
|
+ dto.setChatStatusN(chatStatusN);
|
|
|
+
|
|
|
+ String curChatStatus = resumeDeliver.getChatStatus();
|
|
|
+
|
|
|
+ List<DataDictionary> dataDictionaryList = dataDictionaryService.findByCatalogName("沟通状态");
|
|
|
+
|
|
|
+ List<DataDictionary> newDataDictionaryList = new ArrayList<>();
|
|
|
+
|
|
|
+ for (DataDictionary dataDictionary:dataDictionaryList) {
|
|
|
+ if(Integer.parseInt(dataDictionary.getValue())>Integer.parseInt(curChatStatus)&&!dataDictionary.getName().equals("接受入职")){
|
|
|
+ newDataDictionaryList.add(dataDictionary);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ dto.setChatStatusList(newDataDictionaryList);
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ pageDto.add(dto);
|
|
|
+ }
|
|
|
+
|
|
|
+ pageDto.setPages(page.getPages());
|
|
|
+ pageDto.setTotal(page.getTotal());
|
|
|
+ pageDto.setPageNum(page.getPageNum());
|
|
|
+
|
|
|
|
|
|
msgResult.setResult(true);
|
|
|
- msgResult.setData(PojoUtils.pageWrapper(page));
|
|
|
+ msgResult.setData(PojoUtils.pageWrapper(pageDto));
|
|
|
|
|
|
return msgResult;
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ @ApiOperation(value = "导出")
|
|
|
+ @PostMapping(value = "exportXls")
|
|
|
+ public MessageResult<Object> exportXls(
|
|
|
+ String name,
|
|
|
+ @RequestParam(value="pageIndex",defaultValue="1") int pageIndex,
|
|
|
+ @RequestParam(value="pageSize",defaultValue="10000") int pageSize,
|
|
|
+ @RequestAttribute String subject) {
|
|
|
+
|
|
|
+ MessageResult<Object> messageResult = new MessageResult<>();
|
|
|
+
|
|
|
+ List<List<Map>> totalMapList = new ArrayList<>();
|
|
|
+
|
|
|
+ List<Map> mapList = getMap(subject, name, "0", pageIndex, pageSize);
|
|
|
+ List<Map> mapList2 = getMap(subject, name, "1", pageIndex, pageSize);
|
|
|
+ List<Map> mapList3 = getMap(subject, name, "2", pageIndex, pageSize);
|
|
|
+ List<Map> mapList4 = getMap(subject, name, "3", pageIndex, pageSize);
|
|
|
+ List<Map> mapList5 = getMap(subject, name, "4", pageIndex, pageSize);
|
|
|
+ List<Map> mapList6 = getMap(subject, name, "5", pageIndex, pageSize);
|
|
|
+ List<Map> mapList7 = getMap(subject, name, "6", pageIndex, pageSize);
|
|
|
+
|
|
|
+ totalMapList.add(mapList);
|
|
|
+ totalMapList.add(mapList2);
|
|
|
+ totalMapList.add(mapList3);
|
|
|
+ totalMapList.add(mapList4);
|
|
|
+ totalMapList.add(mapList5);
|
|
|
+ totalMapList.add(mapList6);
|
|
|
+ totalMapList.add(mapList7);
|
|
|
+
|
|
|
+ String downloadUrl = "";
|
|
|
+
|
|
|
+ Workbook workbook = new HSSFWorkbook();
|
|
|
+
|
|
|
+ for (int j=0;j<totalMapList.size();j++) {
|
|
|
+
|
|
|
+ Sheet sheet;
|
|
|
+
|
|
|
+ if(j==1){
|
|
|
+ sheet = workbook.createSheet("已投递");
|
|
|
+ }
|
|
|
+ else if(j==2){
|
|
|
+ sheet = workbook.createSheet("邀请沟通");
|
|
|
+ }
|
|
|
+ else if(j==3){
|
|
|
+ sheet = workbook.createSheet("邀请面试");
|
|
|
+ }
|
|
|
+ else if(j==4){
|
|
|
+ sheet = workbook.createSheet("邀请入职");
|
|
|
+ }
|
|
|
+ else if(j==5){
|
|
|
+ sheet = workbook.createSheet("接受入职");
|
|
|
+ }
|
|
|
+ else if(j==6){
|
|
|
+ sheet = workbook.createSheet("拒绝或者不合适");
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ sheet = workbook.createSheet("全部");
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ //表头
|
|
|
+ Row rowTitle = sheet.createRow(0);
|
|
|
+
|
|
|
+ String[] titles = new String[]{"姓名","应聘岗位","招聘人数",
|
|
|
+ "期望薪资","工作经历","学历","出生年月","工作状态","沟通状态"};
|
|
|
+
|
|
|
+ for (int i=0;i<titles.length;i++) {
|
|
|
+ Cell cell = rowTitle.createCell(i);
|
|
|
+ cell.setCellValue(titles[i]);
|
|
|
+ }
|
|
|
+
|
|
|
+ for (int i=0;i<totalMapList.get(j).size();i++){
|
|
|
+ Map<String,Object> map = totalMapList.get(j).get(i);
|
|
|
+
|
|
|
+ Row row = sheet.createRow(i+1);
|
|
|
+
|
|
|
+ int colIndex = 0;
|
|
|
+ row.createCell(colIndex++).setCellValue(com.jpsoft.employment.modules.common.utils.StringUtils.strValue(map.get("name"),""));
|
|
|
+ row.createCell(colIndex++).setCellValue(com.jpsoft.employment.modules.common.utils.StringUtils.strValue(map.get("position"),""));
|
|
|
+ row.createCell(colIndex++).setCellValue(com.jpsoft.employment.modules.common.utils.StringUtils.strValue(map.get("positionNumber"),""));
|
|
|
+ row.createCell(colIndex++).setCellValue(com.jpsoft.employment.modules.common.utils.StringUtils.strValue(map.get("dreamMoney"),""));
|
|
|
+ row.createCell(colIndex++).setCellValue(com.jpsoft.employment.modules.common.utils.StringUtils.strValue(map.get("workExp"),""));
|
|
|
+ row.createCell(colIndex++).setCellValue(com.jpsoft.employment.modules.common.utils.StringUtils.strValue(map.get("education"),""));
|
|
|
+ row.createCell(colIndex++).setCellValue(com.jpsoft.employment.modules.common.utils.StringUtils.strValue(map.get("birthday"),""));
|
|
|
+ row.createCell(colIndex++).setCellValue(com.jpsoft.employment.modules.common.utils.StringUtils.strValue(map.get("jobStatusN"),""));
|
|
|
+ row.createCell(colIndex++).setCellValue(com.jpsoft.employment.modules.common.utils.StringUtils.strValue(map.get("chatStatusN"),""));
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ ByteArrayOutputStream output = new ByteArrayOutputStream();
|
|
|
+
|
|
|
+ try {
|
|
|
+
|
|
|
+ workbook.write(output);
|
|
|
+
|
|
|
+ byte[] buffer = output.toByteArray();
|
|
|
+
|
|
|
+ ByteArrayInputStream input = new ByteArrayInputStream(buffer);
|
|
|
+
|
|
|
+ downloadUrl = OSSUtil.upload(ossConfig,"resumeDeliver","求职管理.xls",input);
|
|
|
+
|
|
|
+ messageResult.setData(downloadUrl);
|
|
|
+ messageResult.setResult(true);
|
|
|
+ }
|
|
|
+ catch (Exception ex){
|
|
|
+ logger.error(ex.getMessage(),ex);
|
|
|
+ messageResult.setResult(false);
|
|
|
+ }
|
|
|
+
|
|
|
+ return messageResult;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ private List<Map> getMap(String subject,String name,String chatStatus,int pageIndex,int pageSize){
|
|
|
+
|
|
|
+ //当前用户ID
|
|
|
+ System.out.println(subject);
|
|
|
+
|
|
|
+ MessageResult<Map> msgResult = new MessageResult<>();
|
|
|
+
|
|
|
+ Map<String,Object> searchParams = new HashMap<>();
|
|
|
+
|
|
|
+ List<Sort> sortList = new ArrayList<>();
|
|
|
+ sortList.add(new Sort("a.create_time","desc"));
|
|
|
+
|
|
|
+ if (!"0".equals(chatStatus)) {
|
|
|
+ searchParams.put("chatStatus",chatStatus);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (StringUtils.isNotEmpty(name)) {
|
|
|
+ searchParams.put("name","%" + name + "%");
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ Page<ResumeDeliver> page = resumeDeliverService.pageSearch(searchParams,pageIndex,pageSize,true,sortList);
|
|
|
+
|
|
|
+ List<Map> mapList = new ArrayList<>();
|
|
|
+
|
|
|
+ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
+
|
|
|
+ for (ResumeDeliver resumeDeliver:page) {
|
|
|
+
|
|
|
+ Map map = new HashMap();
|
|
|
+
|
|
|
+ map.put("id",resumeDeliver.getId());
|
|
|
+
|
|
|
+ JobUser jobUser = jobUserService.get(resumeDeliver.getJobUserId());
|
|
|
+
|
|
|
+ if(jobUser!=null){
|
|
|
+ map.put("name",jobUser.getRealName());
|
|
|
+ map.put("jobStatus",jobUser.getJobStatus());
|
|
|
+
|
|
|
+ if(StringUtils.isNotEmpty(jobUser.getJobStatus())) {
|
|
|
+ String jobStatusN = dataDictionaryService.findNameByCatalogNameAndValue("工作在职状态", jobUser.getJobStatus());
|
|
|
+ map.put("jobStatusN",jobStatusN);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ Recruitment recruitment = recruitmentService.get(resumeDeliver.getJobRecruitmentId());
|
|
|
+
|
|
|
+ if(recruitment!=null){
|
|
|
+
|
|
|
+ map.put("positionNumber",recruitment.getPositionNumber());
|
|
|
+
|
|
|
+ PositionCategory positionCategory = positionCategoryService.get(recruitment.getPosition());
|
|
|
+
|
|
|
+ map.put("position",positionCategory.getName());
|
|
|
+ }
|
|
|
+
|
|
|
+ Resume resume = RsumeService.get(resumeDeliver.getJobResumeId());
|
|
|
+
|
|
|
+ if(resume!=null){
|
|
|
+ map.put("dreamMoney",resume.getDreamMoney());
|
|
|
+ map.put("workExp",resume.getWorkExp());
|
|
|
+ map.put("education",resume.getEducation());
|
|
|
+
|
|
|
+ String birthday="";
|
|
|
+
|
|
|
+ if(resume.getBirthday()!=null){
|
|
|
+ birthday = sdf.format(resume.getBirthday());
|
|
|
+ }
|
|
|
+
|
|
|
+ map.put("birthday",birthday);
|
|
|
+ }
|
|
|
+
|
|
|
+ map.put("chatStatus",resumeDeliver.getChatStatus());
|
|
|
+
|
|
|
+ if(StringUtils.isNotEmpty(resumeDeliver.getChatStatus())) {
|
|
|
+ String chatStatusN = dataDictionaryService.findNameByCatalogNameAndValue("沟通状态", resumeDeliver.getChatStatus());
|
|
|
+
|
|
|
+ map.put("chatStatusN",chatStatusN);
|
|
|
+
|
|
|
+ String curChatStatus = resumeDeliver.getChatStatus();
|
|
|
+
|
|
|
+ List<DataDictionary> dataDictionaryList = dataDictionaryService.findByCatalogName("沟通状态");
|
|
|
+
|
|
|
+ List<DataDictionary> newDataDictionaryList = new ArrayList<>();
|
|
|
+
|
|
|
+ for (DataDictionary dataDictionary:dataDictionaryList) {
|
|
|
+ if(Integer.parseInt(dataDictionary.getValue())>Integer.parseInt(curChatStatus)&&!dataDictionary.getName().equals("接受入职")){
|
|
|
+ newDataDictionaryList.add(dataDictionary);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ map.put("chatStatusList",newDataDictionaryList);
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ mapList.add(map);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ return mapList;
|
|
|
+ }
|
|
|
}
|