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
6e16dfb4
Commit
6e16dfb4
authored
Dec 20, 2019
by
高宇强
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gyq
parent
4d5eb10e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
136 additions
and
1 deletions
+136
-1
laowubao/app/base/db/models/operator/userlabour.js
+8
-1
laowubao/app/base/service/impl/operator/userlabourSve.js
+128
-0
No files found.
laowubao/app/base/db/models/operator/userlabour.js
View file @
6e16dfb4
...
...
@@ -3,8 +3,15 @@ const settings = require("../../../../config/settings");
const
uiconfig
=
system
.
getUiConfig2
(
settings
.
appKey
);
module
.
exports
=
(
db
,
DataTypes
)
=>
{
return
db
.
define
(
"userlabour"
,
{
user_id
:
DataTypes
.
STRING
(
50
)
,
user_id
:
DataTypes
.
INTEGER
,
labour_id
:
DataTypes
.
INTEGER
,
recruit_id
:
DataTypes
.
INTEGER
,
labour_user_id
:
DataTypes
.
INTEGER
,
ecid
:
DataTypes
.
INTEGER
,
apply_stauts
:
DataTypes
.
INTEGER
,
interview_time
:
DataTypes
.
DATE
,
sign_at
:
DataTypes
.
DATE
,
contract_url
:
DataTypes
.
STRING
(
300
),
},
{
paranoid
:
true
,
//假的删除
underscored
:
true
,
...
...
laowubao/app/base/service/impl/operator/userlabourSve.js
View file @
6e16dfb4
...
...
@@ -4,6 +4,134 @@ const settings = require("../../../../config/settings");
class
UserlabourService
extends
ServiceBase
{
constructor
()
{
super
(
"operator"
,
ServiceBase
.
getDaoName
(
UserlabourService
));
this
.
userlabourDao
=
system
.
getObject
(
"db.operator.userlabourDao"
);
}
async
SaveRecruitInfo
(
params
){
//添加或更新招聘信息
var
id
=
params
.
id
;
var
userlabour
;
if
(
id
){
userlabour
=
await
this
.
dao
.
findById
(
id
);
userlabour
.
user_id
=
params
.
com_id
;
userlabour
.
labour_id
=
params
.
labour_id
;
userlabour
.
recruit_id
=
params
.
recruit_id
;
userlabour
.
labour_user_id
=
params
.
user_id
;
userlabour
.
ecid
=
params
.
ecid
;
userlabour
.
apply_stauts
==
apply_stauts
;
userlabour
.
interview_time
=
params
.
interview_time
;
userlabour
.
sign_at
=
params
.
sign_at
;
userlabour
.
contract_url
=
params
.
contract_url
;
userlabour
=
await
userlabour
.
save
();
userlabour
=
await
this
.
dao
.
findById
(
id
);
}
else
{
userlabour
=
await
this
.
dao
.
create
(
params
);
}
return
system
.
getResultSuccess
(
userlabour
);
}
async
finduserlabourByWhere
(
obj
){
//根据条件获取应聘信息
var
pageSize
=
obj
.
page_size
||
10
;
var
currentPage
=
obj
.
current_page
||
1
;
var
where
=
{};
if
(
obj
.
id
){
where
.
id
=
obj
.
id
;
}
if
(
obj
.
user_id
){
where
.
user_id
=
obj
.
user_id
;
}
if
(
obj
.
labour_id
){
where
.
labour_id
=
obj
.
labour_id
;
}
if
(
obj
.
recruit_id
){
where
.
recruit_id
=
obj
.
recruit_id
;
}
if
(
obj
.
labour_user_id
){
where
.
labour_user_id
=
obj
.
labour_user_id
;
}
if
(
obj
.
ecid
){
where
.
ecid
=
obj
.
ecid
;
}
if
(
obj
.
apply_stauts
){
if
(
obj
.
apply_stauts
==
"已申请"
){
where
.
apply_stauts
=
10
;
}
else
if
(
obj
.
apply_stauts
==
"邀请面试"
){
where
.
apply_stauts
=
20
;
}
else
if
(
obj
.
apply_stauts
==
"面试成功"
){
where
.
apply_stauts
=
30
;
}
else
if
(
obj
.
apply_stauts
==
"面试失败"
){
where
.
apply_stauts
=
40
;
}
else
if
(
obj
.
apply_stauts
==
"待签约"
){
where
.
apply_stauts
=
50
;
}
else
if
(
obj
.
apply_stauts
==
"签约成功"
){
where
.
apply_stauts
=
60
;
}
}
try
{
var
sqlwhere
=
{
where
:
where
,
//order: [["publish_date", 'desc']],
limit
:
pageSize
,
offset
:
(
currentPage
-
1
)
*
pageSize
,
raw
:
true
};
var
list
=
await
this
.
dao
.
model
.
findAndCountAll
(
sqlwhere
)
||
[];
if
(
list
)
{
return
system
.
getResult
(
list
);
}
else
{
return
system
.
getResult
(
null
,
"没有应聘信息"
);
}
}
catch
(
e
)
{
console
.
log
(
e
);
return
system
.
getResult
(
null
,
"操作失败"
);
}
}
async
updatestatus
(
obj
){
//更新状态信息
try
{
var
whereobj
=
{
where
:{
id
:
obj
.
id
}};
var
setobj
=
{};
if
(
obj
.
apply_stauts
==
"已申请"
){
setobj
.
apply_stauts
=
10
;
}
else
if
(
obj
.
apply_stauts
==
"邀请面试"
){
setobj
.
apply_stauts
=
20
;
}
else
if
(
obj
.
apply_stauts
==
"面试成功"
){
setobj
.
apply_stauts
=
30
;
}
else
if
(
obj
.
apply_stauts
==
"面试失败"
){
setobj
.
apply_stauts
=
40
;
}
else
if
(
obj
.
apply_stauts
==
"待签约"
){
setobj
.
apply_stauts
=
50
;
}
else
if
(
obj
.
apply_stauts
==
"签约成功"
){
setobj
.
apply_stauts
=
60
;
}
var
self
=
this
;
var
v
=
await
this
.
db
.
transaction
(
async
function
(
t
)
{
await
self
.
dao
.
updateByWhere
(
setobj
,
whereobj
,
t
);
});
return
1
;
}
catch
(
e
){
console
.
log
(
e
);
return
0
;
}
}
}
module
.
exports
=
UserlabourService
;
...
...
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