@RequestMapping(value = "/exportDoc")public void exportDoc(String resumeId,HttpServletResponse response,HttpServletRequest request) throwsException{
User u=SessionUtils.getUser(request.getSession());
Map dataMap = new HashMap();//要填入模本的数据文件
ResumeBasicInformationQueryParam resumeParam=newResumeBasicInformationQueryParam();
resumeParam.setUuid(resumeId);
WorkExperienceParam workExperienceParam=newWorkExperienceParam();
workExperienceParam.setResumeId(resumeId);
EducationBackgroundParam educationParam=newEducationBackgroundParam();
educationParam.setResumeId(resumeId);
SkillEvaluationParam skillParam=newSkillEvaluationParam();
skillParam.setResumeId(resumeId);
ProjectExperienceParam projectParam=newProjectExperienceParam();
projectParam.setResumeId(resumeId);
LanguageabilityParam languageParam=newLanguageabilityParam();
languageParam.setResumeId(resumeId);
TrainingExperienceParam trainParam=newTrainingExperienceParam();
trainParam.setResumeId(resumeId);//验证导出用户是否可以看到简历姓名
ResumeHandleParam handleParam=newResumeHandleParam();
handleParam.setResumeIds("'"+resumeParam.getUuid()+"'");
handleParam.setCorpId(SessionUtils.getCorpId(request.getSession()));int count = 0;
count=resumeHandleService.checkEnshrine(handleParam);
ResumeBasicInformationResp rbIfonResp= newResumeBasicInformationResp();//查询当前登录用户的简历基本信息
List resumeBasicList =resumeBasicInformationService.getResumeBasic(resumeParam);if(resumeBasicList.size()>0){
rbIfonResp= resumeBasicList.get(0);//性别
if("1".equals(rbIfonResp.getGender())){
rbIfonResp.setGender("男");
}else{
rbIfonResp.setGender("女");
}//婚姻状况
if("1".equals(rbIfonResp.getMaritalStatus())){
rbIfonResp.setGender("已婚");
}else if("2".equals(rbIfonResp.getMaritalStatus())){
rbIfonResp.setGender("未婚");
}else{
rbIfonResp.setGender("保密");
}//姓名、邮箱、电话是否可见
if(count==0){ //没有将该简历放入简历库、没有投递该企业,若简历设置了不可见,则企业看不到
if("1".equals(rbIfonResp.getNamePrivacy()) && rbIfonResp.getName()!=""){
String name= rbIfonResp.getName().substring(0, 1)+" *";
rbIfonResp.setName(name);
}if("1".equals(rbIfonResp.getEmailPrivacy()) && rbIfonResp.getEmail()!=""){int pos = rbIfonResp.getEmail().indexOf("@");
String result=rbIfonResp.getEmail().substring(pos, rbIfonResp.getEmail().length());
rbIfonResp.setEmail("****"+result);
}if("1".equals(rbIfonResp.getTelPrivacy()) && rbIfonResp.getTelephone()!=""){
String telephone= rbIfonResp.getTelephone().substring(0, 3) + "****" + rbIfonResp.getTelephone().substring(7, 11) ;
rbIfonResp.setTelephone(telephone);
}
}
}
dataMap.put("rbIfonResp", rbIfonResp);//dataMap.put("resumeList", resumeBasicList);//工作经历信息
List workExperienceList=workExperienceService.selectWorkExperience(workExperienceParam);
dataMap.put("workExperienceList", workExperienceList);//教育经历信息
List educationList=educationService.selectEducation(educationParam);
dataMap.put("educationList", educationList);//技能评价信息
List skillList=skillService.selectSkillEvaluation(skillParam);
dataMap.put("skillList", skillList);//项目经验信息
List projectList=projectService.selectProject(projectParam);
dataMap.put("projectList", projectList);//语言能力信息
List languageList=languageService.selectLanguage(languageParam);
dataMap.put("languageList", languageList);//培训经历
List trainList=trainingService.selectTrainingExperience(trainParam);
dataMap.put("trainList", trainList);//作品展示
WorkAttachmentParam waParam = newWorkAttachmentParam();
waParam.setResumeId(resumeId);
waParam.setWorkType("1"); //类型:1-作品;2-附件
List workAttachemntList =workAttachmentService.selectWorkAttachment(waParam);//作品路径
String resourceUrl = "";//项目路径
String url = FileManagerUtils.getFilePath(null) + "/";if(workAttachemntList!=null && workAttachemntList.size()>0){for(int i=0;i
resourceUrl= url +workAttachemntList.get(i).getResourceUrl();//先将网络图片下载到本地,再将本地图片转换成BASE64字符串
workAttachemntList.get(i).setResourceUrl(getImageString(resourceUrl));
workAttachemntList.get(i).setIndex(i);
}
}
dataMap.put("workAttachemntList", workAttachemntList);
ExportDoc exportDoc= newExportDoc();
exportDoc.create(dataMap,response);
}