Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
J
jy_jfb
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Administrator
jy_jfb
Commits
08c4671b
提交
08c4671b
authored
1月 15, 2026
作者:
wangmenglong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
增加重新发布功能
上级
2f13c164
显示空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
162 行增加
和
24 行删除
+162
-24
ImportRecruitController.java
...m/jfb/recruit/controller/api/ImportRecruitController.java
+91
-3
RecruitService.java
...src/main/java/com/jfb/recruit/service/RecruitService.java
+4
-0
OrgServiceImpl.java
...ain/java/com/jfb/recruit/service/impl/OrgServiceImpl.java
+4
-3
RecruitServiceImpl.java
...java/com/jfb/recruit/service/impl/RecruitServiceImpl.java
+63
-18
没有找到文件。
jfb-recruit/src/main/java/com/jfb/recruit/controller/api/ImportRecruitController.java
浏览文件 @
08c4671b
...
...
@@ -4,12 +4,14 @@ import base.controller.BaseController;
import
base.result.BaseResult
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.jfb.recruit.bean.auth.UserContext
;
import
com.jfb.recruit.service.OrgService
;
import
com.jfb.recruit.service.RecruitService
;
import
com.jfb.recruit.util.Excelutils.ExcelAppendUtil
;
import
com.jfb.recruit.util.Excelutils.JobsExcel
;
import
com.jfb.recruit.util.Excelutils.OrgExcel
;
import
com.jfb.recruit.util.Excelutils.OrgExcelAppendUtil
;
import
com.jfb.recruit.util.auth.UserUtils
;
import
com.jfb.recruit.xsnowflake.SnowFlakeFactory
;
import
data.recruit.Org
;
import
data.recruit.Recruit
;
...
...
@@ -275,6 +277,11 @@ public class ImportRecruitController extends BaseController {
@PostMapping
(
value
=
"/upload/51job/org/json"
,
consumes
=
MediaType
.
MULTIPART_FORM_DATA_VALUE
)
public
BaseResult
uploadJsonOrgFile
(
HttpServletRequest
req
,
@RequestParam
(
"file"
)
MultipartFile
file
)
{
UserContext
userContext
=
UserUtils
.
getUserContext
();
String
userId
=
userContext
.
getUserId
();
String
baseCode
=
userContext
.
getBaseCode
();
String
userName
=
userContext
.
getUsername
();
// 1. 提交异步任务到线程池(后台执行)
taskExecutor
.
execute
(()
->
{
...
...
@@ -318,18 +325,19 @@ public class ImportRecruitController extends BaseController {
for
(
int
i
=
0
;
i
<
jsonArray
.
size
();
i
++)
{
try
{
Thread
.
sleep
(
5
00
);
Thread
.
sleep
(
1
00
);
}
catch
(
Exception
e
){
System
.
out
.
println
(
"上传失败------------------------------------------------------"
);
}
JSONObject
jsonObject
=
jsonArray
.
getJSONObject
(
i
);
Org
orgDetails
=
orgService
.
getName
(
jsonObject
.
getString
(
"
fullCompanyN
ame"
));
Org
orgDetails
=
orgService
.
getName
(
jsonObject
.
getString
(
"
n
ame"
));
if
(
orgDetails
==
null
)
{
Org
org
=
new
Org
();
org
.
setId
(
snowFlakeFactory
.
nextId
());
org
.
setName
(
jsonObject
.
getString
(
"name"
));
org
.
setDescr
(
jsonObject
.
getString
(
"intro"
));
org
.
setAddress
(
jsonObject
.
getString
(
"address"
));
...
...
@@ -337,7 +345,11 @@ public class ImportRecruitController extends BaseController {
org
.
setRegion
(
region
);
org
.
setProvince
(
province
);
org
.
setCity
(
city
);
org
.
setBaseCode
(
baseCode
);
org
.
setUserId
(
userId
);
org
.
setUserName
(
userName
);
orgService
.
create
(
org
);
System
.
out
.
println
(
"开始创建------------------------------------------------------第"
+
i
+
"条,总共"
+
jsonArray
.
size
()+
"条"
);
}
}
...
...
@@ -363,6 +375,11 @@ public class ImportRecruitController extends BaseController {
@PostMapping
(
value
=
"/upload/51job/json"
,
consumes
=
MediaType
.
MULTIPART_FORM_DATA_VALUE
)
public
BaseResult
uploadJsonFile
(
HttpServletRequest
req
,
@RequestParam
(
"file"
)
MultipartFile
file
)
{
UserContext
userContext
=
UserUtils
.
getUserContext
();
String
userId
=
userContext
.
getUserId
();
String
baseCode
=
userContext
.
getBaseCode
();
String
userName
=
userContext
.
getUsername
();
// 1. 提交异步任务到线程池(后台执行)
taskExecutor
.
execute
(()
->
{
...
...
@@ -386,6 +403,8 @@ public class ImportRecruitController extends BaseController {
String
towIndustryId
=
req
.
getParameter
(
"towIndustryId"
);
String
industryCode
=
req
.
getParameter
(
"industryCode"
);
String
regionCode
=
req
.
getParameter
(
"regionCode"
);
String
industryName
=
req
.
getParameter
(
"industryName"
);
String
times
=
req
.
getParameter
(
"times"
);
// 1. 校验文件是否为空
if
(
file
.
isEmpty
())
{
...
...
@@ -434,12 +453,19 @@ public class ImportRecruitController extends BaseController {
orgDetails
.
setProvince
(
province
);
orgDetails
.
setCity
(
city
);
orgDetails
.
setId
(
snowFlakeFactory
.
nextId
());
orgDetails
.
setBaseCode
(
baseCode
);
orgDetails
.
setUserId
(
userId
);
orgDetails
.
setUserName
(
userName
);
orgService
.
create
(
orgDetails
);
}
if
(
orgDetails
!=
null
&&
StringUtils
.
isNotBlank
(
orgDetails
.
getId
())){
Recruit
recruit
=
new
Recruit
();
recruit
.
setId
(
snowFlakeFactory
.
nextId
());
recruit
.
setBaseCode
(
baseCode
);
recruit
.
setUserId
(
userId
);
recruit
.
setUserName
(
userName
);
recruit
.
setRecruitType
(
recruitType
);
recruit
.
setRecruitTypeId
(
recruitTypeId
);
recruit
.
setExperience
(
experience
);
...
...
@@ -458,7 +484,10 @@ public class ImportRecruitController extends BaseController {
recruit
.
setOneIndustryId
(
oneIndustryId
);
recruit
.
setTowIndustryName
(
towIndustryName
);
recruit
.
setTowIndustryId
(
towIndustryId
);
recruit
.
setIndustryName
(
industryName
);
recruit
.
setIndustryCode
(
industryCode
);
recruit
.
setTimes
(
Integer
.
parseInt
(
times
));
recruit
.
setAddress
(
orgDetails
.
getProvince
()+
orgDetails
.
getCity
()+
orgDetails
.
getRegion
()+
orgDetails
.
getAddress
());
recruit
.
setName
(
jsonObject
.
getString
(
"jobName"
));
recruit
.
setDetails
(
jsonObject
.
getString
(
"jobDescribe"
));
recruit
.
setSalaryMax
(
jsonObject
.
getInteger
(
"jobSalaryMax"
));
...
...
@@ -468,10 +497,17 @@ public class ImportRecruitController extends BaseController {
recruit
.
setBatch
(
"1"
);
recruit
.
setBatchSend
(
"0"
);
recruit
.
setStatus
(
"up"
);
if
(
StringUtils
.
isBlank
(
jsonObject
.
getString
(
"jobSalaryMax"
))||
StringUtils
.
isBlank
(
jsonObject
.
getString
(
"jobSalaryMin"
))){
recruit
.
setSalaryMax
(
5000
);
recruit
.
setSalaryMin
(
4000
);
}
recruitService
.
create
(
recruit
);
try
{
Thread
.
sleep
(
1000
);
Thread
.
sleep
(
500
);
System
.
out
.
println
(
"开始发送------------------------------------------------------第"
+
i
+
"条,总共"
+
jsonArray
.
size
()+
"条"
);
recruitService
.
sendAli
(
recruit
);
}
catch
(
Exception
e
){
e
.
printStackTrace
();
...
...
@@ -493,6 +529,58 @@ public class ImportRecruitController extends BaseController {
return
BaseResult
.
success
();
// 优化:确保返回字符串类型
}
/**
* 保存信息
* @return: base.result.BaseResult
* @Author: wml
* @Date 2026/1/12 15:33
*/
@PostMapping
(
value
=
"/repeat/recruit"
,
consumes
=
MediaType
.
MULTIPART_FORM_DATA_VALUE
)
public
BaseResult
repeatRecruit
(
HttpServletRequest
req
)
{
// 1. 提交异步任务到线程池(后台执行)
taskExecutor
.
execute
(()
->
{
String
batch
=
req
.
getParameter
(
"batch"
);
String
startDate
=
req
.
getParameter
(
"startDate"
);
String
expiredDate
=
req
.
getParameter
(
"expiredDate"
);
Recruit
recruit
=
new
Recruit
();
recruit
.
setBatch
(
batch
);
List
<
Recruit
>
list
=
recruitService
.
listAll
(
recruit
);
recruitService
.
updateSendAll
(
batch
);
for
(
int
i
=
0
;
i
<
list
.
size
();
i
++)
{
Recruit
data
=
list
.
get
(
i
);
data
.
setStartDate
(
startDate
);
data
.
setExpiredDate
(
expiredDate
);
data
.
setBatchSend
(
"0"
);
data
.
setStatus
(
"up"
);
data
.
setId
(
snowFlakeFactory
.
nextId
());
recruitService
.
create
(
data
);
try
{
Thread
.
sleep
(
500
);
System
.
out
.
println
(
"开始发送------------------------------------------------------第"
+
i
+
"条"
);
recruitService
.
sendAli
(
data
);
}
catch
(
Exception
e
){
e
.
printStackTrace
();
}
}
System
.
out
.
println
(
"完成发送------------------------------------------------------"
);
});
return
BaseResult
.
success
();
// 优化:确保返回字符串类型
}
public
static
void
main
(
String
[]
args
)
{
// 原始带重复元素的字符串数组
String
[]
originalArray
=
{
...
...
jfb-recruit/src/main/java/com/jfb/recruit/service/RecruitService.java
浏览文件 @
08c4671b
...
...
@@ -21,6 +21,8 @@ public interface RecruitService {
List
<
Recruit
>
list
(
int
pageNum
,
int
pageSize
,
Recruit
recruit
);
List
<
Recruit
>
listAll
(
Recruit
recruit
);
boolean
create
(
Recruit
recruit
);
boolean
update
(
Recruit
recruit
);
...
...
@@ -33,4 +35,6 @@ public interface RecruitService {
boolean
updateStatus
(
Recruit
recruit
);
boolean
updateSendAll
(
String
batch
);
}
jfb-recruit/src/main/java/com/jfb/recruit/service/impl/OrgServiceImpl.java
浏览文件 @
08c4671b
...
...
@@ -66,13 +66,14 @@ public class OrgServiceImpl extends ServiceImpl<OrgMapper, Org> implements OrgSe
@Override
public
boolean
create
(
Org
org
)
{
if
(
StringUtils
.
isBlank
(
org
.
getId
())){
UserContext
userContext
=
UserUtils
.
getUserContext
();
String
baseCode
=
userContext
.
getBaseCode
();
if
(
StringUtils
.
isBlank
(
org
.
getId
())){
org
.
setId
(
snowFlakeFactory
.
nextId
());
}
org
.
setBaseCode
(
baseCode
);
org
.
setUserId
(
userContext
.
getUserId
());
org
.
setUserName
(
userContext
.
getUsername
());
}
org
.
setDel
(
false
);
org
.
setCreateTime
(
DateUtil
.
now
());
...
...
jfb-recruit/src/main/java/com/jfb/recruit/service/impl/RecruitServiceImpl.java
浏览文件 @
08c4671b
...
...
@@ -155,6 +155,7 @@ public class RecruitServiceImpl extends ServiceImpl<RecruitMapper, Recruit> impl
.
like
(
StringUtils
.
isNotBlank
(
recruit
.
getIndustryName
()),
Recruit:
:
getIndustryName
,
recruit
.
getIndustryName
())
.
and
(
StringUtils
.
isNotBlank
(
recruit
.
getSelTitle
()),
qw1
->
qw1
.
like
(
Recruit:
:
getName
,
recruit
.
getSelTitle
()).
or
().
like
(
Recruit:
:
getOrgName
,
recruit
.
getSelTitle
()))
.
orderByAsc
(
Recruit:
:
getBatch
)
.
orderByDesc
(
Recruit:
:
getCreateTime
);
List
<
Recruit
>
orgList
=
super
.
list
(
qw
);
...
...
@@ -166,6 +167,42 @@ public class RecruitServiceImpl extends ServiceImpl<RecruitMapper, Recruit> impl
return
orgList
;
}
/**
* @description: 获取招聘列表
* @author: wangmenglong
* @date; 2023/12/11 16:46
* @param: [pageNum, pageSize]
* @return: java.util.List<data.recruit.Recruit>
**/
@Override
public
List
<
Recruit
>
listAll
(
Recruit
recruit
)
{
//创建查询条件
LambdaQueryWrapper
<
Recruit
>
qw
=
new
LambdaQueryWrapper
<>();
qw
.
like
(
StringUtils
.
isNotBlank
(
recruit
.
getName
()),
Recruit:
:
getName
,
recruit
.
getName
())
.
eq
(
StringUtils
.
isNotBlank
(
recruit
.
getRecruitTypeId
()),
Recruit:
:
getRecruitTypeId
,
recruit
.
getRecruitTypeId
())
.
eq
(
StringUtils
.
isNotBlank
(
recruit
.
getOrgId
()),
Recruit:
:
getOrgId
,
recruit
.
getOrgId
())
.
eq
(
StringUtils
.
isNotBlank
(
recruit
.
getCity
()),
Recruit:
:
getCity
,
recruit
.
getCity
())
.
eq
(
StringUtils
.
isNotBlank
(
recruit
.
getUserName
()),
Recruit:
:
getUserName
,
recruit
.
getUserName
())
.
eq
(
StringUtils
.
isNotBlank
(
recruit
.
getProvince
()),
Recruit:
:
getProvince
,
recruit
.
getProvince
())
.
eq
(
StringUtils
.
isNotBlank
(
recruit
.
getExperienceId
()),
Recruit:
:
getExperienceId
,
recruit
.
getExperienceId
())
.
eq
(
StringUtils
.
isNotBlank
(
recruit
.
getStatus
()),
Recruit:
:
getStatus
,
recruit
.
getStatus
())
.
eq
(
StringUtils
.
isNotBlank
(
recruit
.
getQualificationId
()),
Recruit:
:
getQualificationId
,
recruit
.
getQualificationId
())
.
eq
(
Recruit:
:
getDel
,
false
)
.
eq
(
StringUtils
.
isNotBlank
(
recruit
.
getBaseCode
()),
Recruit:
:
getBaseCode
,
recruit
.
getBaseCode
())
.
like
(
StringUtils
.
isNotBlank
(
recruit
.
getIndustryName
()),
Recruit:
:
getIndustryName
,
recruit
.
getIndustryName
())
.
and
(
StringUtils
.
isNotBlank
(
recruit
.
getSelTitle
()),
qw1
->
qw1
.
like
(
Recruit:
:
getName
,
recruit
.
getSelTitle
()).
or
().
like
(
Recruit:
:
getOrgName
,
recruit
.
getSelTitle
()))
.
orderByAsc
(
Recruit:
:
getCreateTime
);
List
<
Recruit
>
orgList
=
super
.
list
(
qw
);
orgList
.
stream
().
forEach
(
returnRecruit
->
{
returnRecruit
.
setOrg
(
orgService
.
getDetails
(
returnRecruit
.
getOrgId
()));
});
//返回查询结果
return
orgList
;
}
/**
* @description: 新增招聘
...
...
@@ -177,31 +214,19 @@ public class RecruitServiceImpl extends ServiceImpl<RecruitMapper, Recruit> impl
@Override
public
boolean
create
(
Recruit
recruit
)
{
if
(
StringUtils
.
isBlank
(
recruit
.
getId
())){
UserContext
userContext
=
UserUtils
.
getUserContext
();
String
baseCode
=
userContext
.
getBaseCode
();
recruit
.
setId
(
snowFlakeFactory
.
nextId
());
recruit
.
setBaseCode
(
baseCode
);
recruit
.
setDel
(
false
);
recruit
.
setCreateTime
(
DateUtil
.
now
());
recruit
.
setStatus
(
"down"
);
recruit
.
setLaunch
(
"0"
);
recruit
.
setUserId
(
userContext
.
getUserId
());
recruit
.
setUserName
(
userContext
.
getUsername
());
try
{
Industry
industry
=
industryService
.
getDetails
(
recruit
.
getIndustryId
());
recruit
.
setIndustryCode
(
industry
.
getCode
());
Org
org
=
orgService
.
getDetails
(
recruit
.
getOrgId
());
recruit
.
setOrg
(
org
);
}
catch
(
Exception
e
){
e
.
printStackTrace
();
recruit
.
setBaseCode
(
baseCode
);
recruit
.
setStatus
(
"down"
);
}
recruit
.
setDel
(
false
);
recruit
.
setCreateTime
(
DateUtil
.
now
());
recruit
.
setLaunch
(
"0"
);
return
super
.
save
(
recruit
);
}
...
...
@@ -399,4 +424,24 @@ public class RecruitServiceImpl extends ServiceImpl<RecruitMapper, Recruit> impl
return
super
.
saveOrUpdate
(
recruit
);
}
/**
* @description: 编辑招聘
* @author: wangmenglong
* @date; 2023/12/11 16:55
* @param: [org]
* @return: boolean
**/
@Override
public
boolean
updateSendAll
(
String
batch
)
{
//创建查询条件
LambdaUpdateWrapper
<
Recruit
>
qw
=
new
LambdaUpdateWrapper
<>();
qw
.
eq
(
Recruit:
:
getDel
,
false
)
.
eq
(
Recruit:
:
getBatchSend
,
"0"
)
.
eq
(
Recruit:
:
getBatch
,
batch
)
.
set
(
Recruit:
:
getBatchSend
,
"1"
);
return
super
.
update
(
qw
);
}
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论