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
414fd33a
Commit
414fd33a
authored
May 29, 2023
by
zhenbin wang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feature-wzb:合同重复添加bug修复
parent
8fb96f8a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
123 additions
and
116 deletions
+123
-116
TEmployeeContractInfoServiceImpl.java
...chives/service/impl/TEmployeeContractInfoServiceImpl.java
+123
-116
No files found.
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/service/impl/TEmployeeContractInfoServiceImpl.java
View file @
414fd33a
...
...
@@ -191,7 +191,7 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
return
R
.
failed
(
validity
.
getErrorInfo
(),
ResultConstants
.
VALIDITY_FAIL
);
}
return
this
.
saveContractAndAtta
(
tEmployeeContractInfo
,
user
);
return
this
.
saveContractAndAtta
(
tEmployeeContractInfo
,
user
);
}
/**
...
...
@@ -223,7 +223,7 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
if
(
contractInfo
==
null
)
{
return
R
.
failed
(
"无在用合同,无法续签"
);
}
else
if
(
contractInfo
.
getContractEnd
()
==
null
||
!(
DateUtil
.
formatDate
(
DateUtil
.
addDayByDate
(
contractInfo
.
getContractEnd
(),
1
)).
equals
(
DateUtil
.
formatDate
(
tEmployeeContractInfo
.
getContractStart
())))
||
!(
DateUtil
.
formatDate
(
DateUtil
.
addDayByDate
(
contractInfo
.
getContractEnd
(),
1
)).
equals
(
DateUtil
.
formatDate
(
tEmployeeContractInfo
.
getContractStart
())))
)
{
return
R
.
failed
(
"续签请注意上一份合同的截止日期!"
);
}
...
...
@@ -246,39 +246,39 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
}
}
}
if
(!
EmployeeConstants
.
SITUATION_SEVEN
.
equals
(
tEmployeeContractInfo
.
getSituation
())
&&!
EmployeeConstants
.
SITUATION_SIX
.
equals
(
tEmployeeContractInfo
.
getSituation
())){
if
(
CommonConstants
.
TWO_STRING
.
equals
(
tEmployeeContractInfo
.
getContractType
())){
TEmployeeContractInfo
contractInfo
=
this
.
getOne
(
Wrappers
.<
TEmployeeContractInfo
>
query
().
lambda
()
.
eq
(
TEmployeeContractInfo:
:
getEmpIdcard
,
tEmployeeContractInfo
.
getEmpIdcard
())
.
eq
(
TEmployeeContractInfo:
:
getContractStart
,
tEmployeeContractInfo
.
getContractStart
())
.
eq
(
TEmployeeContractInfo:
:
getDeleteFlag
,
CommonConstants
.
ZERO_INT
)
.
eq
(
TEmployeeContractInfo:
:
getInUse
,
CommonConstants
.
ZERO_INT
)
.
and
(
obj
->
obj
.
eq
(
TEmployeeContractInfo:
:
getAuditStatus
,
CommonConstants
.
ONE_INT
)
.
or
()
.
eq
(
TEmployeeContractInfo:
:
getAuditStatus
,
CommonConstants
.
TWO_INT
)
)
.
last
(
CommonConstants
.
LAST_ONE_SQL
));
if
(
contractInfo
!=
null
)
{
return
R
.
failed
(
"该员工已存在相同起始日期的合同,禁止重复添加"
);
if
(!
EmployeeConstants
.
SITUATION_SEVEN
.
equals
(
tEmployeeContractInfo
.
getSituation
())
&&
!
EmployeeConstants
.
SITUATION_SIX
.
equals
(
tEmployeeContractInfo
.
getSituation
()))
{
if
(
CommonConstants
.
TWO_STRING
.
equals
(
tEmployeeContractInfo
.
getContractType
())
||
CommonConstants
.
ZERO_STRING
.
equals
(
tEmployeeContractInfo
.
getContractType
()))
{
TEmployeeContractInfo
contractInfo
=
this
.
getOne
(
Wrappers
.<
TEmployeeContractInfo
>
query
().
lambda
()
.
eq
(
TEmployeeContractInfo:
:
getEmpIdcard
,
tEmployeeContractInfo
.
getEmpIdcard
())
.
eq
(
TEmployeeContractInfo:
:
getContractStart
,
tEmployeeContractInfo
.
getContractStart
())
.
eq
(
TEmployeeContractInfo:
:
getDeleteFlag
,
CommonConstants
.
ZERO_INT
)
.
and
(
obj
->
obj
.
eq
(
TEmployeeContractInfo:
:
getAuditStatus
,
CommonConstants
.
ONE_INT
)
.
or
()
.
eq
(
TEmployeeContractInfo:
:
getAuditStatus
,
CommonConstants
.
TWO_INT
)
.
eq
(
TEmployeeContractInfo:
:
getInUse
,
CommonConstants
.
ZERO_INT
)
)
.
last
(
CommonConstants
.
LAST_ONE_SQL
));
if
(
contractInfo
!=
null
)
{
return
R
.
failed
(
"该员工已存在相同起始日期的合同,禁止重复添加"
);
}
}
}
TEmployeeContractInfo
contractInfo
=
this
.
getOne
(
Wrappers
.<
TEmployeeContractInfo
>
query
().
lambda
()
TEmployeeContractInfo
contractInfo
=
this
.
getOne
(
Wrappers
.<
TEmployeeContractInfo
>
query
().
lambda
()
.
eq
(
TEmployeeContractInfo:
:
getEmpIdcard
,
tEmployeeContractInfo
.
getEmpIdcard
())
.
eq
(
TEmployeeContractInfo:
:
getContractStart
,
tEmployeeContractInfo
.
getContractStart
())
.
eq
(
TEmployeeContractInfo:
:
getContractEnd
,
tEmployeeContractInfo
.
getContractEnd
())
.
eq
(
TEmployeeContractInfo:
:
getDeleteFlag
,
CommonConstants
.
ZERO_INT
)
.
eq
(
TEmployeeContractInfo:
:
getInUse
,
CommonConstants
.
ZERO_INT
)
.
and
(
obj
->
obj
.
eq
(
TEmployeeContractInfo:
:
getAuditStatus
,
CommonConstants
.
ONE_INT
)
.
eq
(
TEmployeeContractInfo:
:
getDeleteFlag
,
CommonConstants
.
ZERO_INT
)
.
and
(
obj
->
obj
.
eq
(
TEmployeeContractInfo:
:
getAuditStatus
,
CommonConstants
.
ONE_INT
)
.
or
()
.
eq
(
TEmployeeContractInfo:
:
getAuditStatus
,
CommonConstants
.
TWO_INT
)
.
eq
(
TEmployeeContractInfo:
:
getAuditStatus
,
CommonConstants
.
TWO_INT
)
.
eq
(
TEmployeeContractInfo:
:
getInUse
,
CommonConstants
.
ZERO_INT
)
)
.
last
(
CommonConstants
.
LAST_ONE_SQL
));
if
(
contractInfo
!=
null
)
{
return
R
.
failed
(
"该员工已存在相同起始和截止日期的合同,禁止重复添加"
);
}
}
}
}
return
null
;
}
...
...
@@ -307,16 +307,16 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
if
(
null
!=
validity
.
getErrorInfo
()
&&
!
validity
.
getErrorInfo
().
isEmpty
())
{
return
R
.
failed
(
validity
.
getErrorInfo
(),
ResultConstants
.
VALIDITY_FAIL
);
}
if
(!
EmployeeConstants
.
SITUATION_SEVEN
.
equals
(
tEmployeeContractInfo
.
getSituation
())
&&!
EmployeeConstants
.
SITUATION_SIX
.
equals
(
tEmployeeContractInfo
.
getSituation
()))
{
if
(
CommonConstants
.
TWO_STRING
.
equals
(
tEmployeeContractInfo
.
getContractType
())
)
{
if
(!
EmployeeConstants
.
SITUATION_SEVEN
.
equals
(
tEmployeeContractInfo
.
getSituation
())
&&
!
EmployeeConstants
.
SITUATION_SIX
.
equals
(
tEmployeeContractInfo
.
getSituation
()))
{
if
(
CommonConstants
.
TWO_STRING
.
equals
(
tEmployeeContractInfo
.
getContractType
())
||
CommonConstants
.
ZERO_STRING
.
equals
(
tEmployeeContractInfo
.
getContractType
()))
{
TEmployeeContractInfo
contractInfo
=
this
.
getOne
(
Wrappers
.<
TEmployeeContractInfo
>
query
().
lambda
()
.
eq
(
TEmployeeContractInfo:
:
getEmpIdcard
,
tEmployeeContractInfo
.
getEmpIdcard
())
.
eq
(
TEmployeeContractInfo:
:
getContractStart
,
tEmployeeContractInfo
.
getContractStart
())
.
eq
(
TEmployeeContractInfo:
:
getDeleteFlag
,
CommonConstants
.
ZERO_INT
)
.
eq
(
TEmployeeContractInfo:
:
getInUse
,
CommonConstants
.
ZERO_INT
)
.
and
(
obj
->
obj
.
eq
(
TEmployeeContractInfo:
:
getAuditStatus
,
CommonConstants
.
ONE_INT
)
.
eq
(
TEmployeeContractInfo:
:
getDeleteFlag
,
CommonConstants
.
ZERO_INT
)
.
and
(
obj
->
obj
.
eq
(
TEmployeeContractInfo:
:
getAuditStatus
,
CommonConstants
.
ONE_INT
)
.
or
()
.
eq
(
TEmployeeContractInfo:
:
getAuditStatus
,
CommonConstants
.
TWO_INT
)
.
eq
(
TEmployeeContractInfo:
:
getAuditStatus
,
CommonConstants
.
TWO_INT
)
.
eq
(
TEmployeeContractInfo:
:
getInUse
,
CommonConstants
.
ZERO_INT
)
)
.
last
(
CommonConstants
.
LAST_ONE_SQL
));
if
(
contractInfo
!=
null
)
{
...
...
@@ -327,11 +327,11 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
.
eq
(
TEmployeeContractInfo:
:
getEmpIdcard
,
tEmployeeContractInfo
.
getEmpIdcard
())
.
eq
(
TEmployeeContractInfo:
:
getContractStart
,
tEmployeeContractInfo
.
getContractStart
())
.
eq
(
TEmployeeContractInfo:
:
getContractEnd
,
tEmployeeContractInfo
.
getContractEnd
())
.
eq
(
TEmployeeContractInfo:
:
getDeleteFlag
,
CommonConstants
.
ZERO_INT
)
.
eq
(
TEmployeeContractInfo:
:
getInUse
,
CommonConstants
.
ZERO_INT
)
.
and
(
obj
->
obj
.
eq
(
TEmployeeContractInfo:
:
getAuditStatus
,
CommonConstants
.
ONE_INT
)
.
eq
(
TEmployeeContractInfo:
:
getDeleteFlag
,
CommonConstants
.
ZERO_INT
)
.
and
(
obj
->
obj
.
eq
(
TEmployeeContractInfo:
:
getAuditStatus
,
CommonConstants
.
ONE_INT
)
.
or
()
.
eq
(
TEmployeeContractInfo:
:
getAuditStatus
,
CommonConstants
.
TWO_INT
)
.
eq
(
TEmployeeContractInfo:
:
getAuditStatus
,
CommonConstants
.
TWO_INT
)
.
eq
(
TEmployeeContractInfo:
:
getInUse
,
CommonConstants
.
ZERO_INT
)
)
.
last
(
CommonConstants
.
LAST_ONE_SQL
));
if
(
contractInfo
!=
null
)
{
...
...
@@ -468,7 +468,7 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
initType
(
tEmployeeContractInfo
);
// 标准合同、劳动派遣合同、其他。————社保公积金都派减,自动审核通过
this
.
judgeAuditStatus
(
tEmployeeContractInfo
,
user
);
this
.
judgeAuditStatus
(
tEmployeeContractInfo
,
user
);
if
(
Common
.
isEmpty
(
tEmployeeContractInfo
.
getId
()))
{
// 针对编码再做一次重复性校验
...
...
@@ -496,27 +496,27 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
/**
* @Author fxj
* @Description
初始化审核类型 审核类型:0派增-社保派单、1派增-无社保新签、2派增-续签、3派减-作废、4派减-终止
* @Description 初始化审核类型 审核类型:0派增-社保派单、1派增-无社保新签、2派增-续签、3派减-作废、4派减-终止
* @Date 15:28 2022/11/7
**/
**/
private
void
initType
(
TEmployeeContractInfo
tEmployeeContractInfo
)
{
// 初始化审核类型 审核类型:0派增-社保派单、1派增-无社保新签、2派增-续签、3派减-作废、4派减-终止
if
(
ArchivesConstants
.
contractSituation
[
0
].
equals
(
tEmployeeContractInfo
.
getSituation
())){
if
(
ArchivesConstants
.
contractSituation
[
0
].
equals
(
tEmployeeContractInfo
.
getSituation
()))
{
// 作废
tEmployeeContractInfo
.
setType
(
CommonConstants
.
THREE_STRING
);
}
if
(
ArchivesConstants
.
contractSituation
[
6
].
equals
(
tEmployeeContractInfo
.
getSituation
())){
if
(
ArchivesConstants
.
contractSituation
[
6
].
equals
(
tEmployeeContractInfo
.
getSituation
()))
{
// 终止
tEmployeeContractInfo
.
setType
(
CommonConstants
.
FOUR_STRING
);
}
if
(
ArchivesConstants
.
contractSituation
[
1
].
equals
(
tEmployeeContractInfo
.
getSituation
())
||
ArchivesConstants
.
contractSituation
[
2
].
equals
(
tEmployeeContractInfo
.
getSituation
())
||
ArchivesConstants
.
contractSituation
[
4
].
equals
(
tEmployeeContractInfo
.
getSituation
())
||
ArchivesConstants
.
contractSituation
[
5
].
equals
(
tEmployeeContractInfo
.
getSituation
())){
||
ArchivesConstants
.
contractSituation
[
5
].
equals
(
tEmployeeContractInfo
.
getSituation
()))
{
// 离职再入职 合同未到期重新签订 商务合同更改 正常续签
tEmployeeContractInfo
.
setType
(
CommonConstants
.
TWO_STRING
);
}
if
(
ArchivesConstants
.
contractSituation
[
3
].
equals
(
tEmployeeContractInfo
.
getSituation
())){
if
(
ArchivesConstants
.
contractSituation
[
3
].
equals
(
tEmployeeContractInfo
.
getSituation
()))
{
//正常签订
tEmployeeContractInfo
.
setType
(
CommonConstants
.
ONE_STRING
);
}
...
...
@@ -647,10 +647,12 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
tEmployeeProjectService
.
updateById
(
tEmployeeProject
);
}
}
@Override
public
boolean
updateInUseStatusById
(
String
empId
,
String
deptNo
,
String
ContractId
)
{
return
baseMapper
.
updateInUseStatusById
(
empId
,
deptNo
,
ContractId
,
CommonConstants
.
ONE_STRING
)
>
0
;
public
boolean
updateInUseStatusById
(
String
empId
,
String
deptNo
,
String
ContractId
)
{
return
baseMapper
.
updateInUseStatusById
(
empId
,
deptNo
,
ContractId
,
CommonConstants
.
ONE_STRING
)
>
0
;
}
@Override
public
R
<
String
>
auditContract
(
TEmployeeContractInfo
tEmployeeContractInfo
,
YifuUser
user
)
{
if
(
tEmployeeContractInfo
!=
null
)
{
...
...
@@ -727,7 +729,7 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
// 判断人员有无审核通过的其他合同
TEmployeeContractInfo
contractInfoInUse
=
this
.
getOne
(
Wrappers
.<
TEmployeeContractInfo
>
query
()
.
lambda
().
eq
(
TEmployeeContractInfo:
:
getEmpId
,
contractInfo
.
getEmpId
())
.
and
(
obj
->
obj
.
ge
(
TEmployeeContractInfo:
:
getContractEnd
,
DateUtil
.
getThisDayByPatten
(
"yyyy-MM-dd"
))
.
and
(
obj
->
obj
.
ge
(
TEmployeeContractInfo:
:
getContractEnd
,
DateUtil
.
getThisDayByPatten
(
"yyyy-MM-dd"
))
.
or
().
isNull
(
TEmployeeContractInfo:
:
getContractEnd
))
.
eq
(
TEmployeeContractInfo:
:
getInUse
,
CommonConstants
.
ZERO_INT
)
.
eq
(
TEmployeeContractInfo:
:
getDeleteFlag
,
CommonConstants
.
ZERO_INT
)
...
...
@@ -1132,16 +1134,17 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
errorInfo
.
append
(
EmployeeConstants
.
WORKING_HOURS_EMPTY
);
}
}
if
(!
EmployeeConstants
.
SITUATION_SEVEN
.
equals
(
insert
.
getSituation
())
&&!
EmployeeConstants
.
SITUATION_SIX
.
equals
(
insert
.
getSituation
()))
{
if
(
CommonConstants
.
TWO_STRING
.
equals
(
insert
.
getContractType
())
)
{
if
(!
EmployeeConstants
.
SITUATION_SEVEN
.
equals
(
insert
.
getSituation
())
&&
!
EmployeeConstants
.
SITUATION_SIX
.
equals
(
insert
.
getSituation
()))
{
if
(
CommonConstants
.
TWO_STRING
.
equals
(
insert
.
getContractType
())
||
CommonConstants
.
ZERO_STRING
.
equals
(
insert
.
getContractType
()))
{
TEmployeeContractInfo
contractInfo
=
this
.
getOne
(
Wrappers
.<
TEmployeeContractInfo
>
query
().
lambda
()
.
eq
(
TEmployeeContractInfo:
:
getEmpIdcard
,
insert
.
getEmpIdcard
())
.
eq
(
TEmployeeContractInfo:
:
getContractStart
,
insert
.
getContractStart
())
.
eq
(
TEmployeeContractInfo:
:
getDeleteFlag
,
CommonConstants
.
ZERO_INT
)
.
eq
(
TEmployeeContractInfo:
:
getInUse
,
CommonConstants
.
ZERO_INT
)
.
and
(
obj
->
obj
.
eq
(
TEmployeeContractInfo:
:
getAuditStatus
,
CommonConstants
.
ONE_INT
)
.
eq
(
TEmployeeContractInfo:
:
getDeleteFlag
,
CommonConstants
.
ZERO_INT
)
.
and
(
obj
->
obj
.
eq
(
TEmployeeContractInfo:
:
getAuditStatus
,
CommonConstants
.
ONE_INT
)
.
or
()
.
eq
(
TEmployeeContractInfo:
:
getAuditStatus
,
CommonConstants
.
TWO_INT
)
.
eq
(
TEmployeeContractInfo:
:
getInUse
,
CommonConstants
.
ZERO_INT
)
.
eq
(
TEmployeeContractInfo:
:
getAuditStatus
,
CommonConstants
.
TWO_INT
)
)
.
last
(
CommonConstants
.
LAST_ONE_SQL
));
if
(
contractInfo
!=
null
)
{
...
...
@@ -1153,11 +1156,12 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
.
eq
(
TEmployeeContractInfo:
:
getEmpIdcard
,
insert
.
getEmpIdcard
())
.
eq
(
TEmployeeContractInfo:
:
getContractStart
,
insert
.
getContractStart
())
.
eq
(
TEmployeeContractInfo:
:
getContractEnd
,
insert
.
getContractEnd
())
.
eq
(
TEmployeeContractInfo:
:
getDeleteFlag
,
CommonConstants
.
ZERO_INT
)
.
eq
(
TEmployeeContractInfo:
:
getInUse
,
CommonConstants
.
ZERO_INT
)
.
and
(
obj
->
obj
.
eq
(
TEmployeeContractInfo:
:
getAuditStatus
,
CommonConstants
.
ONE_INT
)
.
eq
(
TEmployeeContractInfo:
:
getDeleteFlag
,
CommonConstants
.
ZERO_INT
)
.
and
(
obj
->
obj
.
eq
(
TEmployeeContractInfo:
:
getAuditStatus
,
CommonConstants
.
ONE_INT
)
.
or
()
.
eq
(
TEmployeeContractInfo:
:
getAuditStatus
,
CommonConstants
.
TWO_INT
)
.
eq
(
TEmployeeContractInfo:
:
getInUse
,
CommonConstants
.
ZERO_INT
)
.
eq
(
TEmployeeContractInfo:
:
getAuditStatus
,
CommonConstants
.
TWO_INT
)
)
.
last
(
CommonConstants
.
LAST_ONE_SQL
));
if
(
contractInfo
!=
null
)
{
...
...
@@ -1204,7 +1208,7 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
/**
* @Description: 标准合同、劳动派遣合同、其他。————社保公积金都派减,自动审核通过,
*
判断同项目的社保公积金都已派减,则无需审核
* 判断同项目的社保公积金都已派减,则无需审核
* @Author: hgw
* @Date: 2022/11/28 10:05
* @return: void
...
...
@@ -1214,14 +1218,14 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
private
void
judgeAuditStatus
(
TEmployeeContractInfo
insert
,
YifuUser
user
)
{
if
(
insert
.
getAuditStatus
()
==
CommonConstants
.
ONE_INT
&&
(
EmployeeConstants
.
CONTRACT_NAME
[
0
].
equals
(
insert
.
getContractName
())
||
EmployeeConstants
.
CONTRACT_NAME
[
1
].
equals
(
insert
.
getContractName
())
||
EmployeeConstants
.
CONTRACT_NAME
[
2
].
equals
(
insert
.
getContractName
())))
{
||
EmployeeConstants
.
CONTRACT_NAME
[
1
].
equals
(
insert
.
getContractName
())
||
EmployeeConstants
.
CONTRACT_NAME
[
2
].
equals
(
insert
.
getContractName
())))
{
TSocialFundInfo
sf
=
new
TSocialFundInfo
();
sf
.
setEmpIdcard
(
insert
.
getEmpIdcard
());
sf
.
setSettleDomain
(
insert
.
getSettleDomain
());
R
<
Integer
>
socialFundR
=
HttpDaprUtil
.
invokeMethodPost
(
socialProperties
.
getAppUrl
(),
socialProperties
.
getAppId
()
,
"/tsocialfundinfo/inner/selectSocialFoundByContract"
,
sf
,
Integer
.
class
,
SecurityConstants
.
FROM_IN
);
if
(
CommonConstants
.
ONE_STRING
.
equals
(
insert
.
getSituation
())
||
CommonConstants
.
TWO_STRING
.
equals
(
insert
.
getSituation
())
||
CommonConstants
.
THREE_STRING
.
equals
(
insert
.
getSituation
())
||
CommonConstants
.
FOUR_STRING
.
equals
(
insert
.
getSituation
()))
{
,
"/tsocialfundinfo/inner/selectSocialFoundByContract"
,
sf
,
Integer
.
class
,
SecurityConstants
.
FROM_IN
);
if
(
CommonConstants
.
ONE_STRING
.
equals
(
insert
.
getSituation
())
||
CommonConstants
.
TWO_STRING
.
equals
(
insert
.
getSituation
())
||
CommonConstants
.
THREE_STRING
.
equals
(
insert
.
getSituation
())
||
CommonConstants
.
FOUR_STRING
.
equals
(
insert
.
getSituation
()))
{
if
(
socialFundR
!=
null
&&
socialFundR
.
getData
()
!=
null
&&
socialFundR
.
getData
()
>
0
)
{
insert
.
setAuditStatus
(
CommonConstants
.
TWO_INT
);
insert
.
setAuditUserName
(
user
.
getNickname
());
...
...
@@ -1249,12 +1253,12 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
response
.
setCharacterEncoding
(
CommonConstants
.
UTF8
);
response
.
setHeader
(
CommonConstants
.
CONTENT_DISPOSITION
,
CommonConstants
.
ATTACHMENT_FILENAME
+
URLEncoder
.
encode
(
fileName
,
CommonConstants
.
UTF8
));
// 获取所有字典type
Map
<
String
,
String
>
nameAndDicTypeMap
=
util
.
getConverterDicType
();
Map
<
String
,
String
>
nameAndDicTypeMap
=
util
.
getConverterDicType
();
// 获取所有字典对应的值
Map
<
String
,
String
>
redisLabelMap
=
(
Map
<
String
,
String
>)
RedisUtil
.
redis
.
opsForValue
().
get
(
CacheConstants
.
REDIS_DICT_LABLE
);
Map
<
String
,
String
>
redisLabelMap
=
(
Map
<
String
,
String
>)
RedisUtil
.
redis
.
opsForValue
().
get
(
CacheConstants
.
REDIS_DICT_LABLE
);
// 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭
ExcelWriter
excelWriter
=
EasyExcel
.
write
(
out
,
EmployeeContractExportVO
.
class
)
.
registerConverter
(
new
DictConverter
(
nameAndDicTypeMap
,
redisLabelMap
))
.
registerConverter
(
new
DictConverter
(
nameAndDicTypeMap
,
redisLabelMap
))
.
includeColumnFieldNames
(
contractInfo
.
getExportFields
()).
build
();
int
index
=
0
;
if
(
count
>
CommonConstants
.
ZERO_INT
)
{
...
...
@@ -1311,12 +1315,12 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
response
.
setCharacterEncoding
(
CommonConstants
.
UTF8
);
response
.
setHeader
(
CommonConstants
.
CONTENT_DISPOSITION
,
CommonConstants
.
ATTACHMENT_FILENAME
+
URLEncoder
.
encode
(
fileName
,
CommonConstants
.
UTF8
));
// 获取所有字典type
Map
<
String
,
String
>
nameAndDicTypeMap
=
util
.
getConverterDicType
();
Map
<
String
,
String
>
nameAndDicTypeMap
=
util
.
getConverterDicType
();
// 获取所有字典对应的值
Map
<
String
,
String
>
redisLabelMap
=
(
Map
<
String
,
String
>)
RedisUtil
.
redis
.
opsForValue
().
get
(
CacheConstants
.
REDIS_DICT_LABLE
);
Map
<
String
,
String
>
redisLabelMap
=
(
Map
<
String
,
String
>)
RedisUtil
.
redis
.
opsForValue
().
get
(
CacheConstants
.
REDIS_DICT_LABLE
);
// 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭
ExcelWriter
excelWriter
=
EasyExcel
.
write
(
out
,
EmployeeContractExportVO
.
class
)
.
registerConverter
(
new
DictConverter
(
nameAndDicTypeMap
,
redisLabelMap
))
.
registerConverter
(
new
DictConverter
(
nameAndDicTypeMap
,
redisLabelMap
))
.
includeColumnFieldNames
(
contractInfo
.
getExportFields
()).
build
();
int
index
=
0
;
if
(
count
>
CommonConstants
.
ZERO_INT
)
{
...
...
@@ -1370,12 +1374,12 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
out
=
response
.
getOutputStream
();
response
.
setContentType
(
CommonConstants
.
MULTIPART_FORM_DATA
);
response
.
setCharacterEncoding
(
"utf-8"
);
response
.
setHeader
(
CommonConstants
.
CONTENT_DISPOSITION
,
CommonConstants
.
ATTACHMENT_FILENAME
+
URLEncoder
.
encode
(
fileName
,
"UTF-8"
));
response
.
setHeader
(
CommonConstants
.
CONTENT_DISPOSITION
,
CommonConstants
.
ATTACHMENT_FILENAME
+
URLEncoder
.
encode
(
fileName
,
"UTF-8"
));
// 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭
//EasyExcel.write(out, TEmpBadRecord.class).sheet("不良记录").doWrite(list);
ExcelWriter
excelWriter
=
EasyExcel
.
write
(
out
,
EmployeeContractExportAuditVO
.
class
).
build
();
int
index
=
0
;
if
(
count
>
CommonConstants
.
ZERO_INT
)
{
if
(
count
>
CommonConstants
.
ZERO_INT
)
{
Field
[]
allFields
=
EmployeeContractExportAuditVO
.
class
.
getDeclaredFields
();
WriteSheet
writeSheet
;
ExcelUtil
<
EmployeeContractExportAuditVO
>
util
;
...
...
@@ -1384,34 +1388,34 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
searchVo
.
setLimitStart
(
i
);
searchVo
.
setLimitEnd
(
CommonConstants
.
EXCEL_EXPORT_LIMIT
);
list
=
noPageDiy
(
searchVo
);
if
(
Common
.
isNotNull
(
list
)){
if
(
Common
.
isNotNull
(
list
))
{
util
=
new
ExcelUtil
<>(
EmployeeContractExportAuditVO
.
class
);
for
(
EmployeeContractExportAuditVO
vo
:
list
)
{
util
.
convertEntityAsso
(
vo
,
null
,
null
,
null
,
allFields
);
for
(
EmployeeContractExportAuditVO
vo
:
list
)
{
util
.
convertEntityAsso
(
vo
,
null
,
null
,
null
,
allFields
);
}
}
if
(
Common
.
isNotNull
(
list
)){
writeSheet
=
EasyExcel
.
writerSheet
(
"合同审核批量导出"
+
index
).
build
();
excelWriter
.
write
(
list
,
writeSheet
);
if
(
Common
.
isNotNull
(
list
))
{
writeSheet
=
EasyExcel
.
writerSheet
(
"合同审核批量导出"
+
index
).
build
();
excelWriter
.
write
(
list
,
writeSheet
);
index
++;
}
i
=
i
+
CommonConstants
.
EXCEL_EXPORT_LIMIT
;
if
(
Common
.
isNotNull
(
list
)){
if
(
Common
.
isNotNull
(
list
))
{
list
.
clear
();
}
}
}
else
{
WriteSheet
writeSheet
=
EasyExcel
.
writerSheet
(
"合同审核批量导出"
+
index
).
build
();
excelWriter
.
write
(
list
,
writeSheet
);
}
else
{
WriteSheet
writeSheet
=
EasyExcel
.
writerSheet
(
"合同审核批量导出"
+
index
).
build
();
excelWriter
.
write
(
list
,
writeSheet
);
}
if
(
Common
.
isNotNull
(
list
)){
if
(
Common
.
isNotNull
(
list
))
{
list
.
clear
();
}
out
.
flush
();
excelWriter
.
finish
();
}
catch
(
Exception
e
)
{
log
.
error
(
"执行异常"
,
e
);
}
finally
{
}
catch
(
Exception
e
)
{
log
.
error
(
"执行异常"
,
e
);
}
finally
{
try
{
if
(
null
!=
out
)
{
out
.
close
();
...
...
@@ -1432,13 +1436,13 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
/**
* @Author fxj
* @Description
批量审核合同
* @Description 批量审核合同
* @Date 16:45 2022/12/12
**/
**/
@Override
public
R
<
List
<
ErrorMessage
>>
auditContractBatch
(
EmpContractAuditVo
contractAuditVo
,
YifuUser
user
)
{
List
<
TEmployeeContractInfo
>
contractInfos
=
baseMapper
.
selectBatchIds
(
contractAuditVo
.
getIds
());
if
(
Common
.
isEmpty
(
contractInfos
)){
List
<
TEmployeeContractInfo
>
contractInfos
=
baseMapper
.
selectBatchIds
(
contractAuditVo
.
getIds
());
if
(
Common
.
isEmpty
(
contractInfos
))
{
return
R
.
failed
(
CommonConstants
.
NO_DATA_TO_HANDLE
);
}
...
...
@@ -1447,12 +1451,12 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
TEmployeeContractInfo
contractInfoInUse
;
TEmployeeProject
tEmployeeProject
;
TEmployeeInfo
tEmployeeInfo
;
int
i
=
1
;
int
errorCount
=
0
;
for
(
TEmployeeContractInfo
contract
:
contractInfos
)
{
int
i
=
1
;
int
errorCount
=
0
;
for
(
TEmployeeContractInfo
contract
:
contractInfos
)
{
i
++;
if
(
contract
.
getAuditStatus
()
!=
CommonConstants
.
ONE_INT
)
{
errorMessages
.
add
(
new
ErrorMessage
(
i
,
"不是待审核状态!"
,
CommonConstants
.
RED
,
contract
.
getApplyNo
()));
errorMessages
.
add
(
new
ErrorMessage
(
i
,
"不是待审核状态!"
,
CommonConstants
.
RED
,
contract
.
getApplyNo
()));
errorCount
++;
continue
;
}
...
...
@@ -1496,7 +1500,7 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
TEmployeeContractInfo
old
=
this
.
getById
(
contract
.
getOldContractId
());
if
(
old
!=
null
&&
Common
.
isNotNull
(
old
.
getId
()))
{
if
(!
CommonConstants
.
ZERO_STRING
.
equals
(
old
.
getInUse
()))
{
errorMessages
.
add
(
new
ErrorMessage
(
i
,
"关联的原合同已不在用!"
,
CommonConstants
.
RED
,
contract
.
getApplyNo
()));
errorMessages
.
add
(
new
ErrorMessage
(
i
,
"关联的原合同已不在用!"
,
CommonConstants
.
RED
,
contract
.
getApplyNo
()));
errorCount
++;
continue
;
}
else
{
...
...
@@ -1504,12 +1508,12 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
this
.
updateById
(
old
);
}
}
else
{
errorMessages
.
add
(
new
ErrorMessage
(
i
,
"未找到关联的原合同!"
,
CommonConstants
.
RED
,
contract
.
getApplyNo
()));
errorMessages
.
add
(
new
ErrorMessage
(
i
,
"未找到关联的原合同!"
,
CommonConstants
.
RED
,
contract
.
getApplyNo
()));
errorCount
++;
continue
;
}
}
else
{
errorMessages
.
add
(
new
ErrorMessage
(
i
,
"未找到关联的原合同!"
,
CommonConstants
.
RED
,
contract
.
getApplyNo
()));
errorMessages
.
add
(
new
ErrorMessage
(
i
,
"未找到关联的原合同!"
,
CommonConstants
.
RED
,
contract
.
getApplyNo
()));
errorCount
++;
continue
;
}
...
...
@@ -1533,7 +1537,7 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
// 判断人员有无审核通过的其他合同
contractInfoInUse
=
this
.
getOne
(
Wrappers
.<
TEmployeeContractInfo
>
query
()
.
lambda
().
eq
(
TEmployeeContractInfo:
:
getEmpId
,
contract
.
getEmpId
())
.
and
(
obj
->
obj
.
ge
(
TEmployeeContractInfo:
:
getContractEnd
,
DateUtil
.
getThisDayByPatten
(
"yyyy-MM-dd"
))
.
and
(
obj
->
obj
.
ge
(
TEmployeeContractInfo:
:
getContractEnd
,
DateUtil
.
getThisDayByPatten
(
"yyyy-MM-dd"
))
.
or
().
isNull
(
TEmployeeContractInfo:
:
getContractEnd
))
.
eq
(
TEmployeeContractInfo:
:
getInUse
,
CommonConstants
.
ZERO_INT
)
.
eq
(
TEmployeeContractInfo:
:
getDeleteFlag
,
CommonConstants
.
ZERO_INT
)
...
...
@@ -1550,9 +1554,9 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
// 不是待提交,记录审核记录
this
.
setAuditInfo
(
tEmployeeContractInfo
);
this
.
updateById
(
tEmployeeContractInfo
);
errorMessages
.
add
(
new
ErrorMessage
(
i
,
"审核成功!"
,
CommonConstants
.
GREEN
,
contract
.
getApplyNo
()));
errorMessages
.
add
(
new
ErrorMessage
(
i
,
"审核成功!"
,
CommonConstants
.
GREEN
,
contract
.
getApplyNo
()));
}
if
(
errorCount
==
CommonConstants
.
ZERO_INT
){
if
(
errorCount
==
CommonConstants
.
ZERO_INT
)
{
return
R
.
ok
();
}
return
R
.
ok
(
errorMessages
);
...
...
@@ -1560,40 +1564,41 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
/**
* B端合同列表查询接口
* @Author fxj
* @Date 2020-08-25
*
* @param page
* @param contractBusinessPageVo
* @param flag 0 按3个月内到期提醒 1 不安提醒查询
* @param flag
0 按3个月内到期提醒 1 不安提醒查询
* @return
* @Author fxj
* @Date 2020-08-25
**/
@Override
public
IPage
<
EmpContractBusinessPageVo
>
getContractBusinessPage
(
Page
<
EmpContractBusinessPageVo
>
page
,
EmpContractBusinessPageVo
contractBusinessPageVo
,
List
<
String
>
settleDomainIds
,
Integer
flag
)
{
IPage
<
EmpContractBusinessPageVo
>
pageVoList
=
baseMapper
.
getContractBusinessPage
(
page
,
contractBusinessPageVo
,
settleDomainIds
,
flag
);
IPage
<
EmpContractBusinessPageVo
>
pageVoList
=
baseMapper
.
getContractBusinessPage
(
page
,
contractBusinessPageVo
,
settleDomainIds
,
flag
);
List
<
EmpContractBusinessPageVo
>
voList
=
pageVoList
.
getRecords
();
List
<
TEmployeeContractInfo
>
contractInfoList
=
null
;
List
<
String
>
empIds
=
new
ArrayList
<>();
if
(
Common
.
isNotNull
(
voList
)){
for
(
EmpContractBusinessPageVo
vo
:
voList
)
{
if
(
Common
.
isNotNull
(
voList
))
{
for
(
EmpContractBusinessPageVo
vo
:
voList
)
{
empIds
.
add
(
vo
.
getEmpId
());
}
}
if
(
Common
.
isNotNull
(
empIds
)){
if
(
Common
.
isNotNull
(
empIds
))
{
contractInfoList
=
baseMapper
.
selectList
(
Wrappers
.<
TEmployeeContractInfo
>
query
().
lambda
()
.
eq
(
TEmployeeContractInfo:
:
getIsObsolete
,
CommonConstants
.
ZERO_STRING
)
.
in
(
TEmployeeContractInfo:
:
getEmpId
,
empIds
));
.
eq
(
TEmployeeContractInfo:
:
getIsObsolete
,
CommonConstants
.
ZERO_STRING
)
.
in
(
TEmployeeContractInfo:
:
getEmpId
,
empIds
));
}
HashMap
<
String
,
Integer
>
countMap
=
new
HashMap
<>();
if
(
Common
.
isNotNull
(
contractInfoList
)){
HashMap
<
String
,
Integer
>
countMap
=
new
HashMap
<>();
if
(
Common
.
isNotNull
(
contractInfoList
))
{
Integer
count
;
for
(
TEmployeeContractInfo
contractInfo
:
contractInfoList
)
{
for
(
TEmployeeContractInfo
contractInfo
:
contractInfoList
)
{
count
=
countMap
.
get
(
contractInfo
.
getEmpId
());
count
=
null
==
count
?
1
:(
count
+
1
);
countMap
.
put
(
contractInfo
.
getEmpId
(),
count
);
count
=
null
==
count
?
1
:
(
count
+
1
);
countMap
.
put
(
contractInfo
.
getEmpId
(),
count
);
}
}
if
(
Common
.
isNotNull
(
voList
)){
for
(
EmpContractBusinessPageVo
pageVo
:
voList
)
{
if
(
Common
.
isNotNull
(
voList
))
{
for
(
EmpContractBusinessPageVo
pageVo
:
voList
)
{
pageVo
.
setRenewCount
(
countMap
.
get
(
pageVo
.
getEmpId
()));
}
}
...
...
@@ -1603,30 +1608,32 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
/**
* B端查询合同到期提醒数(查询3个月内到期的合同)
* @Author fxj
* @Date 2020-08-25
*
* @param
* @return
* @Author fxj
* @Date 2020-08-25
**/
@Override
public
Integer
getContractBusinessAlertCount
(
List
<
String
>
settleDomainIds
)
{
EmpContractBusinessPageVo
contractBusinessPageVo
=
new
EmpContractBusinessPageVo
();
contractBusinessPageVo
.
setInUse
(
CommonConstants
.
ZERO_STRING
);
contractBusinessPageVo
.
setIsObsolete
(
CommonConstants
.
ZERO_STRING
);
return
baseMapper
.
getContractBusinessAlertCount
(
contractBusinessPageVo
,
settleDomainIds
,
CommonConstants
.
THREE_INT
);
return
baseMapper
.
getContractBusinessAlertCount
(
contractBusinessPageVo
,
settleDomainIds
,
CommonConstants
.
THREE_INT
);
}
/**
* B端查询对应员工指定合同ID之外的其他合同信息
* @Author fxj
* @Date 2020-08-25
*
* @param empId
* @param contractId
* @return
* @Author fxj
* @Date 2020-08-25
**/
@Override
public
List
<
EmpContractBusinessPageVo
>
getOtherContractBusinessInfo
(
String
empId
,
String
contractId
)
{
return
baseMapper
.
getOtherContractBusinessInfo
(
empId
,
contractId
);
return
baseMapper
.
getOtherContractBusinessInfo
(
empId
,
contractId
);
}
@Override
...
...
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