Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
Y
yifu-mvp
Project
Project
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
fangxinjiang
yifu-mvp
Commits
028d9827
Commit
028d9827
authored
Dec 23, 2022
by
hongguangwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
合同申请提交拦截
parent
9ee6a40c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
66 additions
and
0 deletions
+66
-0
EmployeeConstants.java
...ud/plus/v1/yifu/archives/constants/EmployeeConstants.java
+6
-0
TEmployeeContractInfoServiceImpl.java
...chives/service/impl/TEmployeeContractInfoServiceImpl.java
+60
-0
No files found.
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/constants/EmployeeConstants.java
View file @
028d9827
...
...
@@ -33,6 +33,12 @@ public class EmployeeConstants {
public
static
final
String
DEPT_NO_EXIST
=
"未找到对应的项目或者项目已停止合作,请核实"
;
public
static
final
String
CHECK_ERROR
=
"校验服务错误,请联系管理员!"
;
public
static
final
String
CHECK_NO_RESPONSE
=
"校验服务器未返回,请联系管理员!"
;
// 拦截合同使用
public
static
final
String
SITUATION_ONE
=
"正常签订"
;
public
static
final
String
SITUATION_TWO
=
"正常续签"
;
public
static
final
String
SITUATION_THREE
=
"离职再入职"
;
public
static
final
String
SITUATION_SIX
=
"作废"
;
public
static
final
String
SITUATION_SEVEN
=
"终止"
;
public
static
final
String
EMPID_NOT_EMPTY
=
"员工ID、项目ID不可为空;"
;
...
...
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/service/impl/TEmployeeContractInfoServiceImpl.java
View file @
028d9827
...
...
@@ -137,6 +137,7 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
}
private
R
<
List
<
ErrorMessage
>>
setBaseInfo
(
TEmployeeContractInfo
tEmployeeContractInfo
,
TEmployeeProject
tEmployeeProject
)
{
// 获取人员档案
TEmployeeInfo
tEmployeeInfo
=
tEmployeeInfoMapper
.
selectById
(
tEmployeeContractInfo
.
getEmpId
());
// 获取项目
...
...
@@ -162,6 +163,11 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
if
(
user
==
null
||
Common
.
isEmpty
(
user
.
getId
()))
{
return
R
.
failed
(
CommonConstants
.
PLEASE_LOG_IN
);
}
// 新增合同拦截:
R
<
List
<
ErrorMessage
>>
failed
=
judgeRule
(
tEmployeeContractInfo
);
if
(
failed
!=
null
)
return
failed
;
// 初始化
this
.
initEmployeeContract
(
tEmployeeContractInfo
,
tEmployeeInfo
,
tEmployeeProject
,
user
);
...
...
@@ -180,6 +186,60 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
return
this
.
saveContractAndAtta
(
tEmployeeContractInfo
,
user
);
}
/**
* @param tEmployeeContractInfo
* @Description: 合同新增前的拦截
* @Author: hgw
* @Date: 2022/12/23 14:54
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.util.List < com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage>>
**/
private
R
<
List
<
ErrorMessage
>>
judgeRule
(
TEmployeeContractInfo
tEmployeeContractInfo
)
{
if
(
Common
.
isEmpty
(
tEmployeeContractInfo
.
getSituation
()))
{
// "新签合同(正常签订): 同一项目针对合同存在 在用的禁止发起;
if
(
EmployeeConstants
.
SITUATION_ONE
.
equals
(
tEmployeeContractInfo
.
getSituation
()))
{
TEmployeeContractInfo
contractInfo
=
this
.
getOne
(
Wrappers
.<
TEmployeeContractInfo
>
query
().
lambda
()
.
eq
(
TEmployeeContractInfo:
:
getEmpIdcard
,
tEmployeeContractInfo
.
getEmpIdcard
())
.
eq
(
TEmployeeContractInfo:
:
getDeptNo
,
tEmployeeContractInfo
.
getDeptNo
())
.
eq
(
TEmployeeContractInfo:
:
getDeleteFlag
,
CommonConstants
.
ZERO_INT
)
.
eq
(
TEmployeeContractInfo:
:
getInUse
,
CommonConstants
.
ZERO_STRING
).
last
(
CommonConstants
.
LAST_ONE_SQL
));
if
(
contractInfo
!=
null
)
{
return
R
.
failed
(
"该项目已存在在用合同,禁止新签!"
);
}
}
else
if
(
EmployeeConstants
.
SITUATION_TWO
.
equals
(
tEmployeeContractInfo
.
getSituation
()))
{
// "正常续签(正常续签): 要求后一份合同的开始时间要等于上一份合同的结束日期+1天(限制)"
TEmployeeContractInfo
contractInfo
=
this
.
getOne
(
Wrappers
.<
TEmployeeContractInfo
>
query
().
lambda
()
.
eq
(
TEmployeeContractInfo:
:
getEmpIdcard
,
tEmployeeContractInfo
.
getEmpIdcard
())
.
eq
(
TEmployeeContractInfo:
:
getDeptNo
,
tEmployeeContractInfo
.
getDeptNo
())
.
eq
(
TEmployeeContractInfo:
:
getDeleteFlag
,
CommonConstants
.
ZERO_INT
)
.
eq
(
TEmployeeContractInfo:
:
getInUse
,
CommonConstants
.
ZERO_STRING
).
last
(
CommonConstants
.
LAST_ONE_SQL
));
if
(
contractInfo
!=
null
&&
(
contractInfo
.
getContractEnd
()
==
null
||
!(
DateUtil
.
formatDate
(
DateUtil
.
addDayByDate
(
contractInfo
.
getContractEnd
(),
1
)).
equals
(
DateUtil
.
formatDate
(
tEmployeeContractInfo
.
getContractStart
())))
))
{
return
R
.
failed
(
"续签请注意上一份合同的截止日期!"
);
}
}
else
if
(
EmployeeConstants
.
SITUATION_THREE
.
equals
(
tEmployeeContractInfo
.
getSituation
()))
{
// 离职再入职: 同一项目存在可用禁止发起,存在审核通过且不可用允许发起
TEmployeeContractInfo
contractInfo
=
this
.
getOne
(
Wrappers
.<
TEmployeeContractInfo
>
query
().
lambda
()
.
eq
(
TEmployeeContractInfo:
:
getEmpIdcard
,
tEmployeeContractInfo
.
getEmpIdcard
())
.
eq
(
TEmployeeContractInfo:
:
getDeptNo
,
tEmployeeContractInfo
.
getDeptNo
())
.
eq
(
TEmployeeContractInfo:
:
getDeleteFlag
,
CommonConstants
.
ZERO_INT
)
.
eq
(
TEmployeeContractInfo:
:
getInUse
,
CommonConstants
.
ZERO_STRING
).
last
(
CommonConstants
.
LAST_ONE_SQL
));
if
(
contractInfo
!=
null
)
{
return
R
.
failed
(
"该项目已存在在用合同,禁止离职再入职!"
);
}
else
{
contractInfo
=
this
.
getOne
(
Wrappers
.<
TEmployeeContractInfo
>
query
().
lambda
()
.
eq
(
TEmployeeContractInfo:
:
getEmpIdcard
,
tEmployeeContractInfo
.
getEmpIdcard
())
.
eq
(
TEmployeeContractInfo:
:
getDeleteFlag
,
CommonConstants
.
ZERO_INT
)
.
isNotNull
(
TEmployeeContractInfo:
:
getAuditTimeLast
).
last
(
CommonConstants
.
LAST_ONE_SQL
));
if
(
contractInfo
==
null
)
{
return
R
.
failed
(
"该人员不存在审核通过一次的合同,禁止离职再入职!"
);
}
}
}
}
return
null
;
}
@Override
public
R
<
List
<
ErrorMessage
>>
updateContract
(
TEmployeeContractInfo
tEmployeeContractInfo
)
{
try
{
...
...
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