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
0f9215cd
Commit
0f9215cd
authored
Jul 25, 2022
by
fangxinjiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
合同待办
parent
c8f291dd
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
47 additions
and
35 deletions
+47
-35
TEmpContractAlert.java
...cloud/plus/v1/yifu/archives/entity/TEmpContractAlert.java
+1
-1
TEmpContractAlertServiceImpl.java
...u/archives/service/impl/TEmpContractAlertServiceImpl.java
+46
-34
No files found.
yifu-archives/yifu-archives-api/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/entity/TEmpContractAlert.java
View file @
0f9215cd
...
...
@@ -205,7 +205,7 @@ public class TEmpContractAlert extends BaseEntity {
private
String
alertPerson
;
/**
* 处理状态 0 待处理 1 处理
重
* 处理状态 0 待处理 1 处理
中
*/
@ExcelAttribute
(
name
=
"处理状态"
)
@Schema
(
description
=
"处理状态"
)
...
...
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/service/impl/TEmpContractAlertServiceImpl.java
View file @
0f9215cd
...
...
@@ -26,13 +26,11 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.yifu.cloud.plus.v1.yifu.archives.constants.ArchivesConstants
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.TEmpBadRecord
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.TEmpContractAlert
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeContractInfo
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeInfo
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.*
;
import
com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmpContractAlertMapper
;
import
com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmployeeContractInfoMapper
;
import
com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmployeeInfoMapper
;
import
com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmployeeProjectMapper
;
import
com.yifu.cloud.plus.v1.yifu.archives.service.TEmpContractAlertService
;
import
com.yifu.cloud.plus.v1.yifu.archives.vo.ContractAlertSearchVo
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants
;
...
...
@@ -62,6 +60,8 @@ public class TEmpContractAlertServiceImpl extends ServiceImpl<TEmpContractAlertM
private
final
TEmployeeInfoMapper
employeeInfoMapper
;
private
final
TEmployeeProjectMapper
projectMapper
;
@Override
public
IPage
<
TEmpContractAlert
>
pageDiy
(
Page
page
,
ContractAlertSearchVo
searchVo
)
{
LambdaQueryWrapper
<
TEmpContractAlert
>
wrapper
=
buildQueryWrapper
(
searchVo
);
...
...
@@ -210,28 +210,31 @@ public class TEmpContractAlertServiceImpl extends ServiceImpl<TEmpContractAlertM
**/
@Override
public
R
<
Boolean
>
taskCreateContractAlert
()
{
baseMapper
.
truncate
();
// 获取合同为在档、员工类型为“0外包”、“1派遣”、最近一次合同审核通过、过期或离过期还有3个月的数据
List
<
TEmployeeContractInfo
>
alertList
=
contractInfoMapper
.
selectList
(
Wrappers
.<
TEmployeeContractInfo
>
query
()
.
lambda
().
eq
(
TEmployeeContractInfo:
:
getAuditStatus
,
CommonConstants
.
TWO_STRING
)
.
isNotNull
(
TEmployeeContractInfo:
:
getAuditTimeLast
)
.
eq
(
TEmployeeContractInfo:
:
getContractType
,
"1"
)
.
eq
(
TEmployeeContractInfo:
:
getIsObsolete
,
CommonConstants
.
ZERO_STRING
)
.
eq
(
TEmployeeContractInfo:
:
getContractType
,
CommonConstants
.
ONE_STRING
)
.
eq
(
TEmployeeContractInfo:
:
getWorkFlag
,
CommonConstants
.
ZERO_STRING
)
.
ne
(
TEmployeeContractInfo:
:
getSituation
,
"续签 "
)
.
ne
(
TEmployeeContractInfo:
:
getSituation
,
"终止"
)
.
le
(
TEmployeeContractInfo:
:
getContractEnd
,
DateUtil
.
dateIncreaseByDay
(
DateUtil
.
dateIncreaseByMonth
(
DateUtil
.
getCurrentDateTime
(),
CommonConstants
.
dingleDigitIntArray
[
3
]),
CommonConstants
.
dingleDigitIntArray
[
1
]))
.
eq
(
TEmployeeContractInfo:
:
getDeleteFlag
,
CommonConstants
.
ZERO_STRING
));
// 获取所有未审核通过的合同数据
List
<
TEmployeeContractInfo
>
notAccessList
=
contractInfoMapper
.
selectList
(
Wrappers
.<
TEmployeeContractInfo
>
query
()
.
lambda
().
ne
(
TEmployeeContractInfo:
:
getAuditStatus
,
CommonConstants
.
TWO_STRING
)
.
eq
(
TEmployeeContractInfo:
:
getContractType
,
"1"
)
List
<
TEmployeeContractInfo
>
notAccessList
=
contractInfoMapper
.
selectList
(
Wrappers
.<
TEmployeeContractInfo
>
query
().
lambda
()
.
and
(
obj
->
obj
.
eq
(
TEmployeeContractInfo:
:
getAuditStatus
,
CommonConstants
.
ZERO_STRING
)
.
or
().
eq
(
TEmployeeContractInfo:
:
getAuditStatus
,
CommonConstants
.
ONE_STRING
))
.
eq
(
TEmployeeContractInfo:
:
getIsObsolete
,
CommonConstants
.
ZERO_STRING
)
.
eq
(
TEmployeeContractInfo:
:
getWorkFlag
,
CommonConstants
.
ZERO_STRING
)
.
eq
(
TEmployeeContractInfo:
:
getDeleteFlag
,
CommonConstants
.
ZERO_STRING
));
Map
<
String
,
TEmpContractAlert
>
alertMap
=
new
HashMap
<>();
Map
<
String
,
TEmpContractAlert
>
existMap
=
new
HashMap
<>();
initExistMap
(
existMap
);
if
(
Common
.
isNotNull
(
alertList
)){
Date
nowDate
=
DateUtil
.
dateIncreaseByDay
(
new
Date
(),
CommonConstants
.
ONE_INT
);
Date
nowDate
=
new
Date
(
);
for
(
TEmployeeContractInfo
contract:
alertList
){
extracted
(
nowDate
,
contract
,
alertMap
,
existMap
);
}
...
...
@@ -239,14 +242,14 @@ public class TEmpContractAlertServiceImpl extends ServiceImpl<TEmpContractAlertM
if
(
Common
.
isNotNull
(
notAccessList
)
&&
Common
.
isNotNull
(
alertMap
)){
TEmpContractAlert
exist
;
for
(
TEmployeeContractInfo
contract:
notAccessList
){
exist
=
alertMap
.
get
(
contract
.
getEmpIdcard
());
exist
=
alertMap
.
get
(
contract
.
getEmpIdcard
()
+
CommonConstants
.
DOWN_LINE_STRING
+
contract
.
getDeptNo
()
);
if
(
Common
.
isNotNull
(
exist
)){
exist
.
setHandleStatus
(
CommonConstants
.
ONE_STRING
);
alertMap
.
put
(
exist
.
getEmpIdcard
(),
exist
);
alertMap
.
put
(
contract
.
getEmpIdcard
()+
CommonConstants
.
DOWN_LINE_STRING
+
contract
.
getDeptNo
(),
exist
);
}
}
}
baseMapper
.
truncate
();
if
(
Common
.
isNotNull
(
alertMap
)){
this
.
saveBatch
(
alertMap
.
values
());
}
...
...
@@ -257,37 +260,44 @@ public class TEmpContractAlertServiceImpl extends ServiceImpl<TEmpContractAlertM
List
<
TEmpContractAlert
>
exists
=
baseMapper
.
selectList
(
Wrappers
.<
TEmpContractAlert
>
query
());
if
(
Common
.
isNotNull
(
exists
)){
for
(
TEmpContractAlert
alert:
exists
){
existMap
.
put
(
alert
.
getEmpIdcard
()
+
CommonConstants
.
DOWN_LINE_STRING
+
alert
.
getProjectNo
()
+
CommonConstants
.
DOWN_LINE_STRING
+
alert
.
getContractId
(),
alert
);
existMap
.
put
(
alert
.
getContractId
(),
alert
);
}
}
}
private
void
extracted
(
Date
nowDate
,
TEmployeeContractInfo
contract
,
Map
<
String
,
TEmpContractAlert
>
alertMap
,
Map
<
String
,
TEmpContractAlert
>
existMap
)
{
Map
<
String
,
TEmpContractAlert
>
alertMap
,
Map
<
String
,
TEmpContractAlert
>
existMap
)
{
TEmployeeInfo
employeeInfo
=
employeeInfoMapper
.
selectById
(
contract
.
getEmpId
());
if
(
Common
.
isNotNull
(
employeeInfo
)
&&
!
CommonConstants
.
ZERO_STRING
.
equals
(
employeeInfo
.
getEmpNatrue
())
&&
!
CommonConstants
.
ONE_STRING
.
equals
(
employeeInfo
.
getEmpNatrue
())){
return
;
if
(
Common
.
isNotNull
(
employeeInfo
)){
TEmployeeProject
project
=
projectMapper
.
selectOne
(
Wrappers
.<
TEmployeeProject
>
query
().
lambda
()
.
eq
(
TEmployeeProject:
:
getEmpIdcard
,
employeeInfo
.
getEmpIdcard
())
.
eq
(
TEmployeeProject:
:
getDeleteFlag
,
CommonConstants
.
ZERO_STRING
)
.
eq
(
TEmployeeProject:
:
getDeptNo
,
contract
.
getDeptNo
())
.
last
(
CommonConstants
.
LAST_ONE_SQL
));
if
(
Common
.
isNotNull
(
project
)
&&
((
Common
.
isNotNull
(
project
.
getProjectStatus
())
&&
project
.
getProjectStatus
().
intValue
()==
CommonConstants
.
ONE_INT
)
||
(
!
CommonConstants
.
ZERO_STRING
.
equals
(
project
.
getEmpNatrue
())
&&
!
CommonConstants
.
ONE_STRING
.
equals
(
project
.
getEmpNatrue
()))
)){
return
;
}
}
TEmpContractAlert
alert
=
alertMap
.
get
(
contract
.
getEmpIdcard
()+
CommonConstants
.
DOWN_LINE_STRING
+
contract
.
getDeptNo
());
// 存在多个审核通过的数据 用最新的审核通过的合同覆盖已有的
if
(
Common
.
isNotNull
(
alert
)
&&
Common
.
isNotNull
(
alert
.
get
ContractEnd
())
&&
Common
.
isNotNull
(
contract
.
get
ContractEnd
())
&&
alert
.
getAuditTime
().
after
(
contract
.
getContractEnd
(
))){
&&
Common
.
isNotNull
(
alert
.
get
AuditTime
())
&&
Common
.
isNotNull
(
contract
.
get
AuditTimeLast
())
&&
alert
.
getAuditTime
().
after
(
LocalDateTimeUtils
.
convertLDTToDate
(
contract
.
getAuditTimeLast
()
))){
return
;
}
TEmpContractAlert
exist
=
existMap
.
get
(
alert
.
getEmpIdcard
()
+
CommonConstants
.
DOWN_LINE_STRING
+
alert
.
getProjectNo
()
+
CommonConstants
.
DOWN_LINE_STRING
+
alert
.
getContractId
());
TEmpContractAlert
exist
=
null
;
if
(
Common
.
isNotNull
(
contract
)){
exist
=
existMap
.
get
(
contract
.
getId
());
}
alert
=
new
TEmpContractAlert
();
if
(
Common
.
isNotNull
(
exist
)
&&
Common
.
isNotNull
(
exist
.
getFirstAlertTime
())){
alert
.
setFirstAlertTime
(
exist
.
getFirstAlertTime
());
...
...
@@ -318,12 +328,14 @@ public class TEmpContractAlertServiceImpl extends ServiceImpl<TEmpContractAlertM
alert
.
setContractType
(
contract
.
getContractName
());
alert
.
setContractTerm
(
contract
.
getContractType
());
if
(
Common
.
isNotNull
(
alert
.
getContractEnd
())){
if
(
Common
.
isNotNull
(
contract
.
getContractEnd
())
&&
contract
.
getContractEnd
().
before
(
nowDate
)){
alert
.
setDueFlag
(
CommonConstants
.
ONE_STRING
);
if
(
Common
.
isNotNull
(
contract
.
getContractEnd
())
&&
DateUtil
.
daysBetween
(
alert
.
getContractEnd
(),
nowDate
)
>
0
){
alert
.
setDaysOver
(
DateUtil
.
daysBetween
(
alert
.
getContractEnd
(),
nowDate
));
alert
.
setDueFlag
(
CommonConstants
.
ONE_STRING
);
alert
.
setDaysDue
(
null
);
}
else
{
alert
.
setDaysDue
(
DateUtil
.
daysBetween
(
nowDate
,
alert
.
getContractEnd
()));
alert
.
setDaysDue
(
DateUtil
.
daysBetween
(
nowDate
,
alert
.
getContractEnd
()));
alert
.
setDueFlag
(
CommonConstants
.
ZERO_STRING
);
alert
.
setDaysOver
(
null
);
}
}
alert
.
setHandleStatus
(
CommonConstants
.
ZERO_STRING
);
...
...
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