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
32d0725b
Commit
32d0725b
authored
Jul 04, 2022
by
fangxinjiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
续签代码-定时任务
parent
624bbbf0
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
214 additions
and
6 deletions
+214
-6
TEmpContractAlert.java
...cloud/plus/v1/yifu/archives/entity/TEmpContractAlert.java
+1
-1
TEmpContractAlertController.java
...yifu/archives/controller/TEmpContractAlertController.java
+15
-1
TEmpContractAlertMapper.java
...plus/v1/yifu/archives/mapper/TEmpContractAlertMapper.java
+1
-0
TEmpContractAlertService.java
...us/v1/yifu/archives/service/TEmpContractAlertService.java
+9
-0
TEmpContractAlertServiceImpl.java
...u/archives/service/impl/TEmpContractAlertServiceImpl.java
+90
-4
TEmpContractAlertMapper.xml
...biz/src/main/resources/mapper/TEmpContractAlertMapper.xml
+3
-0
CommonConstants.java
...ud.plus.v1/yifu/common/core/constant/CommonConstants.java
+18
-0
DaprArchivesProperties.java
...us/v1/yifu/common/dapr/config/DaprArchivesProperties.java
+39
-0
CreateContractAlertTask.java
...fu/cloud/plus/v1/job/compont/CreateContractAlertTask.java
+38
-0
No files found.
yifu-archives/yifu-archives-api/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/entity/TEmpContractAlert.java
View file @
32d0725b
...
...
@@ -203,7 +203,7 @@ public class TEmpContractAlert extends BaseEntity {
private
String
alertPerson
;
/**
* 处理状态
* 处理状态
0 待处理 1 处理重
*/
@ExcelAttribute
(
name
=
"处理状态"
)
@Schema
(
description
=
"处理状态"
)
...
...
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/controller/TEmpContractAlertController.java
View file @
32d0725b
...
...
@@ -24,16 +24,19 @@ 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.util.R
;
import
com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog
;
import
com.yifu.cloud.plus.v1.yifu.common.security.annotation.Inner
;
import
io.swagger.v3.oas.annotations.Operation
;
import
io.swagger.v3.oas.annotations.security.SecurityRequirement
;
import
io.swagger.v3.oas.annotations.tags.Tag
;
import
lombok.RequiredArgsConstructor
;
import
lombok.extern.java.Log
;
import
org.springframework.http.HttpHeaders
;
import
org.springframework.security.access.prepost.PreAuthorize
;
import
org.springframework.web.bind.annotation.*
;
import
javax.servlet.http.HttpServletResponse
;
import
java.util.List
;
import
java.util.Map
;
/**
...
...
@@ -138,5 +141,16 @@ public class TEmpContractAlertController {
public
void
export
(
HttpServletResponse
response
,
@RequestBody
ContractAlertSearchVo
searchVo
)
{
tEmpContractAlertService
.
listExport
(
response
,
searchVo
);
}
/**
* 定时任务生成合同续签代码信息
* @return R<List>
* @Author FXJ
* @Date 2022-07-4
**/
@SysLog
(
"定时任务生成合同续签代码信息"
)
@Inner
@PostMapping
(
"/inner/taskCreateContractAlert"
)
public
R
<
Boolean
>
taskCreateContractAlert
()
{
return
tEmpContractAlertService
.
taskCreateContractAlert
();
}
}
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/mapper/TEmpContractAlertMapper.java
View file @
32d0725b
...
...
@@ -30,4 +30,5 @@ import org.apache.ibatis.annotations.Mapper;
@Mapper
public
interface
TEmpContractAlertMapper
extends
BaseMapper
<
TEmpContractAlert
>
{
void
truncate
();
}
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/service/TEmpContractAlertService.java
View file @
32d0725b
...
...
@@ -22,6 +22,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.TEmpContractAlert
;
import
com.yifu.cloud.plus.v1.yifu.archives.vo.ContractAlertSearchVo
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.R
;
import
javax.servlet.http.HttpServletResponse
;
import
java.util.List
;
...
...
@@ -39,4 +40,12 @@ public interface TEmpContractAlertService extends IService<TEmpContractAlert> {
List
<
TEmpContractAlert
>
listDiy
(
ContractAlertSearchVo
searchVo
);
void
listExport
(
HttpServletResponse
response
,
ContractAlertSearchVo
searchVo
);
/**
* 定时任务生成合同续签代码信息
* @return R<List>
* @Author FXJ
* @Date 2022-07-4
**/
R
<
Boolean
>
taskCreateContractAlert
();
}
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/service/impl/TEmpContractAlertServiceImpl.java
View file @
32d0725b
...
...
@@ -29,23 +29,25 @@ 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.TEmpFamily
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeContractInfo
;
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.service.TEmpContractAlertService
;
import
com.yifu.cloud.plus.v1.yifu.archives.vo.ContractAlertSearchVo
;
import
com.yifu.cloud.plus.v1.yifu.archives.vo.FamilySearchVO
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.Common
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.ExcelUtil
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.*
;
import
com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity
;
import
lombok.RequiredArgsConstructor
;
import
org.springframework.stereotype.Service
;
import
javax.servlet.ServletOutputStream
;
import
javax.servlet.http.HttpServletResponse
;
import
java.io.IOException
;
import
java.net.URLEncoder
;
import
java.time.LocalDate
;
import
java.time.LocalDateTime
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.*
;
/**
* 员工合同续签待办
...
...
@@ -53,9 +55,12 @@ import java.util.List;
* @author fxj
* @date 2022-07-01 14:15:05
*/
@RequiredArgsConstructor
@Service
public
class
TEmpContractAlertServiceImpl
extends
ServiceImpl
<
TEmpContractAlertMapper
,
TEmpContractAlert
>
implements
TEmpContractAlertService
{
private
final
TEmployeeContractInfoMapper
contractInfoMapper
;
@Override
public
IPage
<
TEmpContractAlert
>
pageDiy
(
Page
page
,
ContractAlertSearchVo
searchVo
)
{
LambdaQueryWrapper
<
TEmpContractAlert
>
wrapper
=
buildQueryWrapper
(
searchVo
);
...
...
@@ -190,4 +195,85 @@ public class TEmpContractAlertServiceImpl extends ServiceImpl<TEmpContractAlertM
}
return
wrapper
;
}
/**
* 定时任务生成合同续签代码信息
* @return R<List>
* @Author FXJ
* @Date 2022-07-4
**/
@Override
public
R
<
Boolean
>
taskCreateContractAlert
()
{
baseMapper
.
truncate
();
// 获取合同为在档、员工类型为“派遣”、“外包”、最近一次合同审核通过、过期或离过期还有3个月的数据
List
<
TEmployeeContractInfo
>
alertList
=
contractInfoMapper
.
selectList
(
Wrappers
.<
TEmployeeContractInfo
>
query
()
.
lambda
().
eq
(
TEmployeeContractInfo:
:
getAuditStatus
,
CommonConstants
.
TWO_STRING
)
.
isNotNull
(
TEmployeeContractInfo:
:
getAuditTimeLast
)
.
eq
(
TEmployeeContractInfo:
:
getWorkFlag
,
CommonConstants
.
ZERO_STRING
)
.
ge
(
TEmployeeContractInfo:
:
getAuditTimeLast
,
DateUtil
.
dateIncreaseByMonth
(
DateUtil
.
getCurrentDateTime
(),
CommonConstants
.
THREE_INT_NEGATE
))
.
eq
(
TEmployeeContractInfo:
:
getDeleteFlag
,
CommonConstants
.
ZERO_STRING
));
// 获取所有未审核通过的合同数据
List
<
TEmployeeContractInfo
>
notAccessList
=
contractInfoMapper
.
selectList
(
Wrappers
.<
TEmployeeContractInfo
>
query
()
.
lambda
().
ne
(
TEmployeeContractInfo:
:
getAuditStatus
,
CommonConstants
.
TWO_STRING
)
.
eq
(
TEmployeeContractInfo:
:
getWorkFlag
,
CommonConstants
.
ZERO_STRING
)
.
eq
(
TEmployeeContractInfo:
:
getDeleteFlag
,
CommonConstants
.
ZERO_STRING
));
Map
<
String
,
TEmpContractAlert
>
alertMap
=
new
HashMap
<>();
if
(
Common
.
isNotNull
(
alertList
)){
LocalDate
now
=
LocalDate
.
now
();
Date
nowDate
=
new
Date
();
for
(
TEmployeeContractInfo
contract:
alertList
){
extracted
(
now
,
nowDate
,
contract
,
alertMap
);
}
}
if
(
Common
.
isNotNull
(
notAccessList
)
&&
Common
.
isNotNull
(
alertMap
)){
TEmpContractAlert
exist
;
for
(
TEmployeeContractInfo
contract:
notAccessList
){
exist
=
alertMap
.
get
(
contract
.
getEmpIdcard
());
if
(
Common
.
isNotNull
(
exist
)){
exist
.
setHandleStatus
(
CommonConstants
.
ONE_STRING
);
alertMap
.
put
(
exist
.
getEmpIdcard
(),
exist
);
}
}
}
if
(
Common
.
isNotNull
(
alertMap
)){
this
.
saveBatch
(
alertMap
.
values
());
}
return
R
.
ok
();
}
private
void
extracted
(
LocalDate
now
,
Date
nowDate
,
TEmployeeContractInfo
contract
,
Map
<
String
,
TEmpContractAlert
>
alertMap
)
{
TEmpContractAlert
alert
=
alertMap
.
get
(
contract
.
getEmpIdcard
());
// 存在多个审核通过的数据 用最新的审核通过的合同覆盖已有的
if
(
Common
.
isNotNull
(
alert
)
&&
alert
.
getContractEnd
().
after
(
LocalDateTimeUtils
.
convertLDToDate
(
contract
.
getContractEnd
()))){
return
;
}
alert
=
new
TEmpContractAlert
();
alert
.
setAlertPerson
(
contract
.
getCreateName
());
alert
.
setEmpName
(
contract
.
getEmpName
());
alert
.
setEmpId
(
contract
.
getEmpId
());
alert
.
setProject
(
contract
.
getSubjectDepart
());
alert
.
setProjectNo
(
contract
.
getDeptNo
());
alert
.
setEmpIdcard
(
contract
.
getEmpIdcard
());
alert
.
setContractStart
(
LocalDateTimeUtils
.
convertLDToDate
(
contract
.
getContractStart
()));
alert
.
setContractEnd
(
LocalDateTimeUtils
.
convertLDToDate
(
contract
.
getContractEnd
()));
alert
.
setFileProvince
(
Integer
.
toString
(
contract
.
getFileProvince
()));
alert
.
setFileCity
(
Integer
.
toString
(
contract
.
getFileCity
()));
alert
.
setFileTown
(
Integer
.
toString
(
contract
.
getFileTown
()));
alert
.
setEmpType
(
contract
.
getEmpNatrue
());
alert
.
setContractTerm
(
contract
.
getContractType
());
alert
.
setContractTerm
(
contract
.
getContractTerm
());
if
(
Common
.
isNotNull
(
contract
.
getContractEnd
())
&&
contract
.
getContractEnd
().
isBefore
(
now
)){
alert
.
setDueFlag
(
CommonConstants
.
ONE_STRING
);
alert
.
setDaysOver
(
DateUtil
.
daysBetween
(
nowDate
,
alert
.
getContractEnd
()));
}
else
{
alert
.
setDaysDue
(
DateUtil
.
daysBetween
(
alert
.
getContractEnd
(),
nowDate
));
alert
.
setDueFlag
(
CommonConstants
.
ZERO_STRING
);
}
alert
.
setFirstAlertTime
(
DateUtil
.
dateIncreaseByMonth
(
alert
.
getContractEnd
(),
CommonConstants
.
THREE_INT_NEGATE
));
alert
.
setHandleStatus
(
CommonConstants
.
ZERO_STRING
);
alertMap
.
put
(
alert
.
getEmpIdcard
(),
alert
);
}
}
yifu-archives/yifu-archives-biz/src/main/resources/mapper/TEmpContractAlertMapper.xml
View file @
32d0725b
...
...
@@ -51,4 +51,7 @@
<result
property=
"createTime"
column=
"CREATE_TIME"
/>
<result
property=
"updateTime"
column=
"UPDATE_TIME"
/>
</resultMap>
<update
id=
"truncate"
>
TRUNCATE t_emp_contract_alert
</update>
</mapper>
yifu-common/yifu-common-core/src/main/java/com/yifu.cloud.plus.v1/yifu/common/core/constant/CommonConstants.java
View file @
32d0725b
...
...
@@ -299,4 +299,22 @@ public interface CommonConstants {
* 失败颜色
*/
String
RED
=
"red"
;
/**
* 数字int -1
* @author fxj
*/
int
ONE_INT_NEGATE
=
-
1
;
/**
* 数字int -1
* @author fxj
*/
int
TWO_INT_NEGATE
=
-
2
;
/**
* 数字int -1
* @author fxj
*/
int
THREE_INT_NEGATE
=
-
3
;
}
yifu-common/yifu-common-dapr/src/main/java/com/yifu/cloud/plus/v1/yifu/common/dapr/config/DaprArchivesProperties.java
0 → 100644
View file @
32d0725b
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
common
.
dapr
.
config
;
import
lombok.Data
;
import
org.springframework.boot.context.properties.ConfigurationProperties
;
import
org.springframework.context.annotation.PropertySource
;
import
org.springframework.stereotype.Component
;
/**
* @Author fxj
* @Date 2022/7/4
* @Description
* @Version 1.0
*/
@Data
@Component
@PropertySource
(
"classpath:daprConfig.properties"
)
@ConfigurationProperties
(
value
=
"dapr.archives"
,
ignoreInvalidFields
=
false
)
public
class
DaprArchivesProperties
{
/*
* @author fxj
* @date 14:34
* @Description dapr sidercar url 如:http://localhost:3005/v1.0/invoke/
**/
String
appUrl
;
/*
* @author fxj
* @date 14:35
* @decription app_id 如:"yifu_upms_sider"
**/
String
appId
;
String
appPort
;
String
httpPort
;
String
grpcPort
;
String
metricsPort
;
}
yifu-job/yifu-job-api/src/main/java/com/yifu/cloud/plus/v1/job/compont/CreateContractAlertTask.java
0 → 100644
View file @
32d0725b
package
com
.
yifu
.
cloud
.
plus
.
v1
.
job
.
compont
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysUser
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.SecurityConstants
;
import
com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprArchivesProperties
;
import
com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprUpmsProperties
;
import
com.yifu.cloud.plus.v1.yifu.common.dapr.util.HttpDaprUtil
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.context.properties.EnableConfigurationProperties
;
import
org.springframework.stereotype.Component
;
/**
* @Author fxj
* @Date 2022/7/4
* @Description 定时任务生成续签代办提醒
* @Version 1.0
*/
@Component
(
value
=
"createContractAlertTask"
)
@Slf4j
@EnableConfigurationProperties
(
DaprArchivesProperties
.
class
)
public
class
CreateContractAlertTask
{
@Autowired
private
DaprArchivesProperties
daprArchivesProperties
;
/**
* @Author fxj
* @Description
* @Date 10:49 2022/6/15
* @Param
* @return
**/
public
void
createContractAlertTask
()
{
log
.
info
(
"------------定时任务生成续签代办提醒-定时任务开始------------"
);
HttpDaprUtil
.
invokeMethodPost
(
daprArchivesProperties
.
getAppUrl
(),
daprArchivesProperties
.
getAppId
(),
"/tempcontractalert/inner/taskCreateContractAlert"
,
""
,
Object
.
class
,
SecurityConstants
.
FROM_IN
);
log
.
info
(
"------------定时任务生成续签代办提醒-定时任务结束------------"
);
}
}
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