Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Z
zhichan
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
蒋勇
zhichan
Commits
e4be0630
Commit
e4be0630
authored
Nov 27, 2019
by
孙亚楠
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加定时任务
parent
97970c58
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
46 additions
and
1 deletions
+46
-1
laowubao/app/base/api/impl/operator/laoActionApi.js
+12
-1
laowubao/app/base/service/impl/operator/recruitSve.js
+34
-0
No files found.
laowubao/app/base/api/impl/operator/laoActionApi.js
View file @
e4be0630
...
...
@@ -283,7 +283,7 @@ class LaoActionApi extends APIBase {
// parm.curStatus=this.trim(obj.curStatus);
// }
if
(
obj
.
curType
){
parm
.
cur
Status
=
this
.
trim
(
obj
.
curType
);
parm
.
cur
Type
=
this
.
trim
(
obj
.
curType
);
}
if
(
find_type
==
0
)
{
temp_info
=
await
this
.
recruitSve
.
findAllList
(
parm
);
...
...
@@ -564,6 +564,17 @@ class LaoActionApi extends APIBase {
}
}
/**
* 定时更新招聘信息
*/
async
UpdateRecruitExpired
(){
try
{
await
this
.
recruitSve
.
UpdateRecruitExpired
();
}
catch
(
error
)
{
console
.
log
(
`系统错误 错误信息
${
error
}
`
);
}
}
async
getOssConfig
()
{
var
policyText
=
{
"expiration"
:
"2119-12-31T16:00:00.000Z"
,
...
...
laowubao/app/base/service/impl/operator/recruitSve.js
View file @
e4be0630
...
...
@@ -112,8 +112,20 @@ class RecruitService extends ServiceBase {
let
cur_type
=
params
.
curType
;
let
id
=
Number
(
params
.
id
);
let
data
=
{};
//1:展示中、2:已下架、3:已过期、4:审核未通过
if
(
cur_type
){
data
.
cur_type
=
cur_type
;
if
(
cur_type
==
1
){
data
.
cur_status
=
'展示中'
;
}
else
if
(
cur_type
==
2
){
data
.
cur_status
=
'已下架'
;
}
else
if
(
cur_type
==
3
){
data
.
cur_status
=
'已过期、4'
;
}
else
if
(
cur_type
==
4
){
data
.
cur_status
=
'审核未通过'
;
}
else
{
return
system
.
getResult
(
"参数错误 状态码不存在"
);
}
}
let
res
=
await
this
.
dao
.
model
.
update
(
data
,{
where
:{
id
:
id
}});
return
system
.
getResult
(
res
);
...
...
@@ -279,6 +291,28 @@ class RecruitService extends ServiceBase {
return
system
.
getResult
(
-
1
,
`系统错误 错误信息
${
error
}
`
);
}
}
/**
* 定时刷新招聘
*/
async
UpdateRecruitExpired
(){
try
{
let
nowTime
=
new
Date
();
await
this
.
dao
.
model
.
update
({
cur_type
:
3
,
cur_status
:
"已过期"
},{
where
:{
end_date
:{
[
this
.
db
.
Op
.
between
]:
[
"1970-01-02"
,
nowTime
],
}
}
});
console
.
log
(
`定时更新成功`
);
}
catch
(
error
)
{
console
.
log
(
`系统错误 错误信息
${
error
}
`
);
}
}
}
module
.
exports
=
RecruitService
;
...
...
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