Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
8
8timerapiv200
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
8timerv2
8timerapiv200
Commits
3fc684ce
Commit
3fc684ce
authored
Mar 31, 2022
by
284718418@qq.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
导入简历,同步人才信息 教育资讯 基本信息 其他信息 项目信息 工作信息
parent
ff02c0b1
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
105 additions
and
18 deletions
+105
-18
src/main/java/cn/timer/api/controller/zpgl/ZpglController.java
+11
-1
src/main/java/cn/timer/api/controller/zpgl/sevice/ZpglServiceImpl.java
+69
-6
src/main/java/cn/timer/api/dto/baidu/BasicInfo.java
+23
-10
src/main/java/cn/timer/api/dto/zpgl/ImportCandidateDto.java
+2
-1
No files found.
src/main/java/cn/timer/api/controller/zpgl/ZpglController.java
View file @
3fc684ce
...
...
@@ -435,8 +435,14 @@ public class ZpglController {
@PostMapping
(
"/resume_import_candidate"
)
@ApiOperation
(
value
=
"招聘-导入候选人简历"
,
httpMethod
=
"POST"
,
notes
=
"招聘-导入候选人简历"
)
public
Result
<
Object
>
resumeImportCandidate
(
@CurrentUser
UserBean
userBean
,
@RequestParam
(
required
=
true
)
MultipartFile
file
,
@RequestBody
ImportCandidateDto
importCandidateDto
,
HttpServletRequest
request
)
{
@ApiParam
(
"招聘渠道ID"
)
@RequestParam
(
required
=
false
)
Integer
zpglZpqdId
,
@ApiParam
(
"职位信息Id"
)
@RequestParam
(
required
=
true
)
Integer
zpglZwxxId
,
@ApiParam
(
"状态"
)
@RequestParam
(
required
=
true
)
Integer
status
,
HttpServletRequest
request
)
{
try
{
ImportCandidateDto
importCandidateDto
=
new
ImportCandidateDto
();
importCandidateDto
.
setStatus
(
status
);
importCandidateDto
.
setZpglZpqdId
(
zpglZpqdId
);
importCandidateDto
.
setZpglZwxxId
(
zpglZwxxId
);
// 获取文件 文档类型,目前支持pdf,doc,docx,wps,txt,jpg,jpeg,png,bmp,tif格式
String
suffix
=
file
.
getOriginalFilename
().
substring
(
file
.
getOriginalFilename
().
lastIndexOf
(
"."
)+
1
);
if
(
StringUtils
.
isEmpty
(
suffix
)){
...
...
@@ -445,8 +451,12 @@ public class ZpglController {
if
(
"pdf,doc,docx,wps,txt,jpg,jpeg,png,bmp,tif"
.
indexOf
(
suffix
)
==
-
1
){
return
ResultUtil
.
error
(
"导入简历失败,目前支持pdf,doc,docx,wps,txt,jpg,jpeg,png,bmp,tif格式~"
);
}
importCandidateDto
.
setSuffix
(
suffix
);
boolean
flag
=
zpglService
.
addResumeImportCandidate
(
userBean
,
file
,
importCandidateDto
);
return
flag
?
ResultUtil
.
success
(
"操作成功"
):
ResultUtil
.
error
(
"操作失败"
);
}
catch
(
CustomException
e
)
{
e
.
printStackTrace
();
throw
e
;
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
throw
new
CustomException
(
"招聘-导入候选人简历失败"
);
...
...
src/main/java/cn/timer/api/controller/zpgl/sevice/ZpglServiceImpl.java
View file @
3fc684ce
...
...
@@ -8,14 +8,16 @@ import cn.timer.api.bean.zpgl.ZpglRcxx;
import
cn.timer.api.config.annotation.UserBean
;
import
cn.timer.api.config.enuminterface.JxglEnumInterface
;
import
cn.timer.api.config.exception.CustomException
;
import
cn.timer.api.controller.kqgl.ClockInTool
;
import
cn.timer.api.dto.baidu.BaiduTicResumeDto
;
import
cn.timer.api.dto.baidu.ResumeExtract
;
import
cn.timer.api.bean.clazz.NationClass
;
import
cn.timer.api.dto.zpgl.ImportCandidateDto
;
import
cn.timer.api.dto.zpgl.ZpglRcxxDto
;
import
cn.timer.api.utils.ResultUtil
;
import
cn.timer.api.utils.ZpglMessageTemplate
;
import
cn.timer.api.utils.baidu.BaiduTicUtil
;
import
cn.timer.api.utils.baidu.Base64
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
lombok.extern.slf4j.Slf4j
;
...
...
@@ -159,16 +161,77 @@ public class ZpglServiceImpl implements ZpglService {
ResponseEntity
<
String
>
resumeString
=
baiduTicUtil
.
getResumeByCvParser
(
baiduTicResumeDto
);
JSONObject
json
=
(
JSONObject
)
JSONObject
.
parse
(
resumeString
.
getBody
());
log
.
info
(
"招聘-导入候选人简历{}"
,
resumeString
.
getBody
());
ResumeExtract
resumeExtract
=
null
;
if
(
"success"
.
equals
(
json
.
get
(
"error_msg"
))){
if
(
"results"
.
equals
(
json
.
get
(
"results"
))){
JSONObject
jsonObject
=
(
JSONObject
)
JSONObject
.
parse
(
json
.
get
(
"results"
).
toString
());
ResumeExtract
resumeExtract
=
JSONObject
.
toJavaObject
(
jsonObject
,
ResumeExtract
.
class
);
}
else
{
if
(
StringUtils
.
isEmpty
(
json
.
get
(
"results"
))){
log
.
info
(
"招聘-导入候选人简历:results is null"
);
throw
new
CustomException
(
"导入简历失败,请检查是否为简历文件~"
);
}
JSONArray
array
=
(
JSONArray
)
json
.
get
(
"results"
);
if
(
StringUtils
.
isEmpty
(
array
.
get
(
0
))){
log
.
info
(
"招聘-导入候选人简历:results is null"
);
throw
new
CustomException
(
"导入简历失败,请检查是否为简历文件~"
);
}
JSONObject
resultsJsonObject
=
(
JSONObject
)
array
.
get
(
0
);
resumeExtract
=
JSONObject
.
toJavaObject
((
JSONObject
)
resultsJsonObject
.
get
(
"extract"
),
ResumeExtract
.
class
);
}
else
{
throw
new
CustomException
(
"导入简历失败,请检查是否为简历文件~"
);
}
return
false
;
if
(
StringUtils
.
isEmpty
(
resumeExtract
)
||
StringUtils
.
isEmpty
(
resumeExtract
.
getBasic_infos
())){
throw
new
CustomException
(
"导入简历失败,请检查是否为简历文件~"
);
}
this
.
addZpglRcxx
(
userBean
,
resumeExtract
,
importCandidateDto
);
return
true
;
}
/**
* 导入简历
* 同步人才信息 教育资讯 基本信息 其他信息 项目信息 工作信息
* @param resumeExtract
* @param importCandidateDto
*/
private
void
addZpglRcxx
(
UserBean
userBean
,
ResumeExtract
resumeExtract
,
ImportCandidateDto
importCandidateDto
){
ZpglRcxx
zpglRcxx
=
ZpglRcxx
.
builder
().
build
();
zpglRcxx
.
setZpglZwxxId
(
importCandidateDto
.
getZpglZwxxId
());
zpglRcxx
.
setStatus
(
importCandidateDto
.
getStatus
());
zpglRcxx
.
setZpglZpqdId
(
importCandidateDto
.
getZpglZpqdId
());
zpglRcxx
.
setOrgCode
(
userBean
.
getOrgCode
().
toString
());
if
(!
StringUtils
.
isEmpty
(
resumeExtract
.
getBasic_infos
())){
zpglRcxx
.
setName
(
resumeExtract
.
getBasic_infos
().
getName
());
zpglRcxx
.
setMobile
(
resumeExtract
.
getBasic_infos
().
getPhone_numbers
());
zpglRcxx
.
setMail
(
resumeExtract
.
getBasic_infos
().
getEmail_address
());
zpglRcxx
.
setWeixin
(
resumeExtract
.
getBasic_infos
().
getWechat
());
zpglRcxx
.
setIdCard
(
resumeExtract
.
getBasic_infos
().
getId_number
());
if
(!
StringUtils
.
isEmpty
(
resumeExtract
.
getBasic_infos
().
getGender
())){
zpglRcxx
.
setSex
(
resumeExtract
.
getBasic_infos
().
getGender
().
indexOf
(
"男"
)
!=
-
1
?
0
:
1
);
}
//出生日期,格式化为 年-月,如2000-01,若只有年,则只显示年,如2000
if
(!
StringUtils
.
isEmpty
(
resumeExtract
.
getBasic_infos
().
getBirth_date
())&&
resumeExtract
.
getBasic_infos
().
getBirth_date
().
length
()
>
0
){
String
datebirth
=
""
;
String
[]
num
=
resumeExtract
.
getBasic_infos
().
getBirth_date
().
split
(
"-"
);
if
(
num
.
length
==
1
){
datebirth
=
num
[
0
]+
"-1-1"
;
}
else
if
(
num
.
length
==
2
){
datebirth
=
num
[
0
]+
"-"
+
num
[
1
]+
"-1"
;
}
if
(
datebirth
.
length
()>
0
){
zpglRcxx
.
setDatebirth
(
ClockInTool
.
strToDateLong
(
datebirth
));
}
}
//nation_class_id
if
(!
StringUtils
.
isEmpty
(
resumeExtract
.
getBasic_infos
().
getNation
())){
NationClass
nationClass
=
NationClass
.
builder
().
build
().
selectOne
(
new
QueryWrapper
<
NationClass
>().
lambda
().
like
(
NationClass:
:
getName
,
resumeExtract
.
getBasic_infos
().
getNation
()));
if
(!
StringUtils
.
isEmpty
(
nationClass
)){
zpglRcxx
.
setNationClassId
(
nationClass
.
getId
());
}
}
zpglRcxx
.
setAddress
(
resumeExtract
.
getBasic_infos
().
getHome_location
());
zpglRcxx
.
setUniversitie
(
resumeExtract
.
getBasic_infos
().
getSchool
());
if
(!
StringUtils
.
isEmpty
(
resumeExtract
.
getBasic_infos
().
getCur_duration
())){
zpglRcxx
.
setWorkyears
(
Integer
.
parseInt
(
resumeExtract
.
getBasic_infos
().
getCur_duration
()));
}
zpglRcxx
.
setCompany
(
resumeExtract
.
getBasic_infos
().
getCur_company
());
zpglRcxx
.
insert
();
}
}
}
src/main/java/cn/timer/api/dto/baidu/BasicInfo.java
View file @
3fc684ce
...
...
@@ -20,20 +20,31 @@ import java.io.Serializable;
@AllArgsConstructor
public
class
BasicInfo
implements
Serializable
{
private
String
name
;
// 姓名:中文姓名
private
String
gender
;
// 性别:男/女
// 姓名:中文姓名
private
String
name
;
// 性别:男/女
private
String
gender
;
private
String
age
;
// 年龄:当前年龄,整数
private
String
cur_duration
;
// 工作年限:当前工作年限,整数,多段工作年限会累加并向下取整
// 工作年限:当前工作年限,整数,多段工作年限会累加并向下取整
private
String
cur_duration
;
private
String
highest_degree
;
// 学历:最高学历(包括在读),格式统一为博士/硕士/学士
private
String
work_begin_year
;
// 开始工作年限:第一份工作的开始年份,四位数年份,如2013
private
String
id_number
;
// 身份证号:中国居民身份证号码,纯数字
private
String
birth_date
;
// 生日:出生日期,格式化为 年-月,如2000-01,若只有年,则只显示年,如2000
private
String
nation
;
// 民族:中国56个民族, 如 汉族,壮族
// 生日:出生日期,格式化为 年-月,如2000-01,若只有年,则只显示年,如2000
private
String
birth_date
;
// 民族:中国56个民族, 如 汉族,壮族
private
String
nation
;
private
String
location
;
// 所在地:所在地城市或区域,如 深圳市,深圳市南山区
private
String
home_location
;
// 详细地址:具体家庭居住地,如 深圳市南山区华联花园6栋2-224
private
String
cur_company
;
// 当前公司
// 详细地址:具体家庭居住地,如 深圳市南山区华联花园6栋2-224
private
String
home_location
;
// 当前公司
private
String
cur_company
;
private
String
cur_job
;
// 当前职位
private
String
school
;
// 毕业学校:最高学历学校
// 毕业学校:最高学历学校
private
String
school
;
private
String
major
;
// 专业:最高学历对应的专业
private
String
job_intention
;
// 求职意向
private
String
cur_package
;
// 当前薪水:当前工资或当前工资范围,如10-20万人民币等,以简历为准
...
...
@@ -45,9 +56,11 @@ public class BasicInfo implements Serializable {
private
String
birth_place
;
// 籍贯:籍贯地区,如 广东汕头,上海,江苏南通。以简历描述为准,输出为原文
private
String
desire_loc
;
// 期望工作地区:期望工作城市或区域,多个地区则以英文逗号分隔,如 北京,上海,广州,深圳,输出为原文
private
String
phone_numbers
;
// 联系方式:国内11位手机号,格式化为纯数字
private
String
email_address
;
// 邮箱:合格邮箱地址
// 邮箱:合格邮箱地址
private
String
email_address
;
private
String
landline
;
// 固定电话:国内8位座机号
private
String
qq
;
// QQ号:QQ号码
private
String
wechat
;
// 微信号:微信账号
// 微信号:微信账号
private
String
wechat
;
}
src/main/java/cn/timer/api/dto/zpgl/ImportCandidateDto.java
View file @
3fc684ce
...
...
@@ -29,11 +29,12 @@ public class ImportCandidateDto implements Serializable{
*/
@NotNull
(
message
=
ValidationMsg
.
NOTNULL
)
@ApiModelProperty
(
value
=
"职位信息Id"
)
private
Integer
i
d
;
private
Integer
zpglZwxxI
d
;
/**
* 状态 1:待初筛 2:初筛通过 3:已安排面试 4:已面试 5:面试通过 6:拟录用 7:已发Offer 8:待入职 9已淘汰 10已入职
*/
@NotNull
(
message
=
ValidationMsg
.
NOTNULL
)
@ApiModelProperty
(
value
=
"状态 1:待初筛 2:初筛通过 3:已安排面试 4:已面试 5:面试通过 6:拟录用 7:已发Offer 8:待入职 9已淘汰 10已入职"
)
private
Integer
status
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment