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
1fbda067
Commit
1fbda067
authored
Jul 06, 2022
by
hongguangwu
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/develop' into develop
parents
e7c8b6d1
e9fe1f76
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
262 additions
and
47 deletions
+262
-47
EmployeeProjectExportVO.java
...oud/plus/v1/yifu/archives/vo/EmployeeProjectExportVO.java
+9
-4
EmployeeProjectUpdateVO.java
...oud/plus/v1/yifu/archives/vo/EmployeeProjectUpdateVO.java
+131
-0
EmployeeProjectVO.java
...ifu/cloud/plus/v1/yifu/archives/vo/EmployeeProjectVO.java
+2
-5
TEmpChangeInfoVO.java
...yifu/cloud/plus/v1/yifu/archives/vo/TEmpChangeInfoVO.java
+2
-1
TCertRecordServiceImpl.java
...v1/yifu/archives/service/impl/TCertRecordServiceImpl.java
+36
-8
TEmpChangeInfoServiceImpl.java
...yifu/archives/service/impl/TEmpChangeInfoServiceImpl.java
+16
-3
TEmpContractAlertServiceImpl.java
...u/archives/service/impl/TEmpContractAlertServiceImpl.java
+1
-1
TEmployeeProjectServiceImpl.java
...fu/archives/service/impl/TEmployeeProjectServiceImpl.java
+28
-12
TElecEmployeeInfoMapper.xml
...biz/src/main/resources/mapper/TElecEmployeeInfoMapper.xml
+3
-0
TEmployeeProjectMapper.xml
...-biz/src/main/resources/mapper/TEmployeeProjectMapper.xml
+1
-0
CacheConstants.java
...oud.plus.v1/yifu/common/core/constant/CacheConstants.java
+10
-0
CommonConstants.java
...ud.plus.v1/yifu/common/core/constant/CommonConstants.java
+1
-1
ExcelUtil.java
...m/yifu.cloud.plus.v1/yifu/common/core/util/ExcelUtil.java
+11
-6
RedisUtil.java
...m/yifu.cloud.plus.v1/yifu/common/core/util/RedisUtil.java
+0
-1
SysDictItemServiceImpl.java
...us.v1/yifu/admin/service/impl/SysDictItemServiceImpl.java
+1
-1
DictItemRedisInit.java
...yifu/cloud/plus/v1/yifu/admin/init/DictItemRedisInit.java
+10
-4
No files found.
yifu-archives/yifu-archives-api/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/vo/EmployeeProjectExportVO.java
View file @
1fbda067
...
...
@@ -17,14 +17,15 @@
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
archives
.
vo
;
import
com.alibaba.excel.annotation.ExcelProperty
;
import
com.alibaba.excel.annotation.format.DateTimeFormat
;
import
com.alibaba.excel.annotation.write.style.ColumnWidth
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttributeConstants
;
import
lombok.Data
;
import
javax.validation.constraints.Past
;
import
java.time.LocalDate
;
import
java.time.LocalDateTime
;
import
java.util.Date
;
import
java.util.List
;
/**
...
...
@@ -68,13 +69,13 @@ public class EmployeeProjectExportVO{
* 身份证有效期起
*/
@ExcelProperty
(
value
=
"身份证开始日期"
)
private
Local
Date
validityStart
;
private
Date
validityStart
;
/**
* 身份证有效期止
*/
@ExcelProperty
(
value
=
"身份证截止日期"
)
private
Local
Date
validityEnd
;
private
Date
validityEnd
;
/**
* 婚姻状况
...
...
@@ -188,12 +189,14 @@ public class EmployeeProjectExportVO{
* 入学时间
*/
@ExcelProperty
(
value
=
"入学时间"
)
@DateTimeFormat
(
"yyyy-MM-dd"
)
private
LocalDateTime
admissionDate
;
/**
* 毕业时间
*/
@ExcelProperty
(
value
=
"毕业时间"
)
@DateTimeFormat
(
"yyyy-MM-dd"
)
private
LocalDateTime
gradutionDate
;
/**
...
...
@@ -233,6 +236,7 @@ public class EmployeeProjectExportVO{
* 创建时间
*/
@ExcelProperty
(
value
=
"人员档案创建时间"
)
@DateTimeFormat
(
"yyyy-MM-dd"
)
private
LocalDateTime
proCreateTime
;
...
...
@@ -285,7 +289,7 @@ public class EmployeeProjectExportVO{
*/
@ExcelProperty
(
value
=
"入职日期"
)
@Past
private
Local
Date
enjoinDate
;
private
Date
enjoinDate
;
/**
* 试用期(单位月)
...
...
@@ -400,6 +404,7 @@ public class EmployeeProjectExportVO{
* 项目档案创建时间
*/
@ExcelProperty
(
value
=
"项目档案创建时间"
)
@DateTimeFormat
(
"yyyy-MM-dd"
)
private
LocalDateTime
createTime
;
private
List
<
String
>
idList
;
...
...
yifu-archives/yifu-archives-api/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/vo/EmployeeProjectUpdateVO.java
0 → 100644
View file @
1fbda067
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
archives
.
vo
;
import
com.alibaba.excel.annotation.ExcelProperty
;
import
com.alibaba.excel.annotation.format.DateTimeFormat
;
import
com.alibaba.excel.annotation.write.style.ColumnWidth
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttributeConstants
;
import
lombok.Data
;
import
javax.validation.constraints.NotNull
;
import
javax.validation.constraints.Past
;
import
java.io.Serializable
;
import
java.util.Date
;
/**
* 项目档案表excel对应的实体
*
* @author huyc
* @date 2022-06-20 17:54:40
*/
@Data
@ColumnWidth
(
30
)
public
class
EmployeeProjectUpdateVO
extends
RowIndex
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* 员工类型(字典值,0外包1派遣2代理)
*/
@ExcelProperty
(
value
=
"员工类型"
)
@ExcelAttribute
(
name
=
"员工类型"
,
maxLength
=
2
,
isDataId
=
true
,
dataType
=
ExcelAttributeConstants
.
EMP_NATRUE
)
private
String
empNatrue
;
/**
* 员工姓名
*/
@ExcelAttribute
(
name
=
"员工姓名"
,
maxLength
=
20
)
@ExcelProperty
(
value
=
"员工姓名"
)
private
String
empName
;
/**
* 身份证号码
*/
@NotNull
(
message
=
"身份证号不能为空"
)
@ExcelAttribute
(
name
=
"身份证号"
,
isNotEmpty
=
true
,
errorInfo
=
"身份证号不能为空"
,
maxLength
=
20
)
@ExcelProperty
(
value
=
"身份证号"
)
private
String
empIdcard
;
/**
* 开户行
*/
@ExcelAttribute
(
name
=
"开户行"
)
@ExcelProperty
(
value
=
"开户行"
)
private
String
bankName
;
/**
* 支行
*/
@ExcelAttribute
(
name
=
"支行"
)
@ExcelProperty
(
value
=
"支行"
)
private
String
bankSubName
;
/**
* 银行卡号
*/
@ExcelAttribute
(
name
=
"银行卡号"
)
@ExcelProperty
(
value
=
"银行卡号"
)
private
String
bankNo
;
/**
* 项目编码
*/
@NotNull
(
message
=
"项目编码不能为空"
)
@ExcelProperty
(
value
=
"项目编码"
)
@ExcelAttribute
(
name
=
"项目编码"
,
isNotEmpty
=
true
,
errorInfo
=
"项目编码不能为空"
,
maxLength
=
20
)
private
String
deptNo
;
/**
* 合同类型(字典值)
*/
@ExcelAttribute
(
name
=
"合同类型"
,
maxLength
=
10
,
isDataId
=
true
,
dataType
=
ExcelAttributeConstants
.
PERSONNEL_TYPE
)
@ExcelProperty
(
value
=
"合同类型"
)
private
String
contractType
;
/**
* 工时制
*/
@ExcelAttribute
(
name
=
"工时制"
,
maxLength
=
10
,
isDataId
=
true
,
dataType
=
ExcelAttributeConstants
.
WORKING_HOURS
)
@ExcelProperty
(
value
=
"工时制"
)
private
String
workingHours
;
/**
* 就职岗位
*/
@ExcelAttribute
(
name
=
"就职岗位"
,
maxLength
=
20
)
@ExcelProperty
(
value
=
"就职岗位"
)
private
String
post
;
/**
* 入职日期
*/
@ExcelAttribute
(
name
=
"入职日期"
,
maxLength
=
4
)
@ExcelProperty
(
value
=
"入职日期"
)
@Past
@DateTimeFormat
(
"yyyy-MM-dd"
)
private
Date
enjoinDate
;
/**
* 试用期(单位月)
*/
@ExcelAttribute
(
name
=
"试用期"
,
maxLength
=
4
)
@ExcelProperty
(
value
=
"试用期"
)
private
String
tryPeriod
;
}
yifu-archives/yifu-archives-api/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/vo/EmployeeProjectVO.java
View file @
1fbda067
...
...
@@ -102,9 +102,8 @@ public class EmployeeProjectVO extends RowIndex implements Serializable {
/**
* 工时制
*/
@NotNull
(
message
=
"工时制不能为空"
)
@ExcelProperty
(
value
=
"工时制"
)
@ExcelAttribute
(
name
=
"工时制"
,
isNotEmpty
=
true
,
errorInfo
=
"工时制不能为空"
,
maxLength
=
10
,
isDataId
=
true
,
dataType
=
ExcelAttributeConstants
.
WORKING_HOURS
)
@ExcelAttribute
(
name
=
"工时制"
,
maxLength
=
10
,
isDataId
=
true
,
dataType
=
ExcelAttributeConstants
.
WORKING_HOURS
)
private
String
workingHours
;
/**
...
...
@@ -119,7 +118,6 @@ public class EmployeeProjectVO extends RowIndex implements Serializable {
* 入职日期
*/
@ExcelProperty
(
value
=
"入职日期"
)
@NotNull
(
message
=
"入职日期不能为空"
)
@Past
@DateTimeFormat
(
"yyyy-MM-dd"
)
private
Date
enjoinDate
;
...
...
@@ -128,8 +126,7 @@ public class EmployeeProjectVO extends RowIndex implements Serializable {
* 试用期(单位月)
*/
@ExcelProperty
(
value
=
"试用期"
)
@NotNull
(
message
=
"试用期不能为空"
)
@ExcelAttribute
(
name
=
"试用期"
,
isNotEmpty
=
true
,
errorInfo
=
"试用期不能为空"
,
maxLength
=
4
)
@ExcelAttribute
(
name
=
"试用期"
,
maxLength
=
4
)
private
String
tryPeriod
;
}
yifu-archives/yifu-archives-api/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/vo/TEmpChangeInfoVO.java
View file @
1fbda067
...
...
@@ -19,6 +19,7 @@ package com.yifu.cloud.plus.v1.yifu.archives.vo;
import
com.alibaba.excel.annotation.ExcelProperty
;
import
com.alibaba.excel.annotation.write.style.ColumnWidth
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.ValidityConstants
;
import
lombok.Data
;
import
javax.validation.constraints.NotNull
;
...
...
@@ -79,7 +80,7 @@ public class TEmpChangeInfoVO implements Serializable {
* 划转起始月
*/
@ExcelProperty
(
value
=
"划转起始月"
)
@ExcelAttribute
(
name
=
"划转起始月"
,
maxLength
=
6
,
isInteger
=
true
)
@ExcelAttribute
(
name
=
"划转起始月"
,
maxLength
=
6
,
errorInfo
=
"划转起始月不能超过6位"
,
isInteger
=
true
)
private
String
changeStartMonth
;
}
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/service/impl/TCertRecordServiceImpl.java
View file @
1fbda067
...
...
@@ -23,9 +23,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.entity.TCertRecord
;
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.TEmployeeProject
;
import
com.yifu.cloud.plus.v1.yifu.archives.mapper.TCertRecordMapper
;
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.TCertRecordService
;
...
...
@@ -33,6 +35,7 @@ import com.yifu.cloud.plus.v1.yifu.archives.vo.CertRecordSearchVo;
import
com.yifu.cloud.plus.v1.yifu.archives.vo.TCertRecordVo
;
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.LocalDateTimeUtils
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.R
;
import
com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity
;
import
lombok.RequiredArgsConstructor
;
...
...
@@ -53,6 +56,9 @@ public class TCertRecordServiceImpl extends ServiceImpl<TCertRecordMapper, TCert
private
final
TEmployeeProjectMapper
projectMapper
;
private
final
TEmployeeInfoMapper
employeeInfoMapper
;
private
final
TEmployeeContractInfoMapper
contractInfoMapper
;
@Override
public
R
<
TCertRecordVo
>
getCertRecordInfo
(
String
id
)
{
TEmployeeProject
project
=
projectMapper
.
selectById
(
id
);
...
...
@@ -63,6 +69,21 @@ public class TCertRecordServiceImpl extends ServiceImpl<TCertRecordMapper, TCert
if
(!
Common
.
isNotNull
(
employeeInfo
)){
return
R
.
failed
(
CommonConstants
.
PARAM_IS_NOT_ERROR
);
}
// 取值最早的合同
TEmployeeContractInfo
last
=
contractInfoMapper
.
selectOne
(
Wrappers
.<
TEmployeeContractInfo
>
query
().
lambda
()
.
eq
(
TEmployeeContractInfo:
:
getDeleteFlag
,
CommonConstants
.
ZERO_STRING
)
.
eq
(
TEmployeeContractInfo:
:
getAuditStatus
,
CommonConstants
.
TWO_STRING
)
.
eq
(
TEmployeeContractInfo:
:
getIsObsolete
,
CommonConstants
.
ZERO_STRING
)
.
orderByDesc
(
TEmployeeContractInfo:
:
getAuditTimeLast
)
.
last
(
CommonConstants
.
LAST_ONE_SQL
));
// 取值最早的合同
TEmployeeContractInfo
first
=
contractInfoMapper
.
selectOne
(
Wrappers
.<
TEmployeeContractInfo
>
query
().
lambda
()
.
eq
(
TEmployeeContractInfo:
:
getDeleteFlag
,
CommonConstants
.
ZERO_STRING
)
.
eq
(
TEmployeeContractInfo:
:
getAuditStatus
,
CommonConstants
.
TWO_STRING
)
.
eq
(
TEmployeeContractInfo:
:
getIsObsolete
,
CommonConstants
.
ZERO_STRING
)
.
orderByAsc
(
TEmployeeContractInfo:
:
getAuditTimeLast
)
.
last
(
CommonConstants
.
LAST_ONE_SQL
));
TCertRecordVo
vo
=
new
TCertRecordVo
();
vo
.
setEmpIdcard
(
project
.
getEmpIdcard
());
vo
.
setEmpId
(
project
.
getEmpId
());
...
...
@@ -70,17 +91,24 @@ public class TCertRecordServiceImpl extends ServiceImpl<TCertRecordMapper, TCert
vo
.
setPost
(
project
.
getPost
());
vo
.
setProjectName
(
project
.
getDeptName
());
vo
.
setProjectCode
(
project
.
getDeptNo
());
// TODO 最新合同时间
vo
.
setContractStart
(
null
);
vo
.
setContractEnd
(
null
);
// TODO 派减离职时间和原因
// 最新合同时间
if
(
Common
.
isNotNull
(
last
)){
if
(
Common
.
isNotNull
(
last
.
getContractStart
())){
vo
.
setContractStart
(
LocalDateTimeUtils
.
convertDateToLDT
(
last
.
getContractStart
()));
}
if
(
Common
.
isNotNull
(
last
.
getContractEnd
())){
vo
.
setContractEnd
(
LocalDateTimeUtils
.
convertDateToLDT
(
last
.
getContractEnd
()));
}
}
// 派减离职时间和原因
vo
.
setLeaveTime
(
employeeInfo
.
getLeaveTime
());
vo
.
setLeaveReason
(
employeeInfo
.
getLeaveReason
());
// TODO 第一次合同开始截止时间
vo
.
setEntryTime
(
employeeInfo
.
getCreateTime
());
vo
.
setFirstContractTime
(
null
);
// 第一次合同开始时间和创建时间
if
(
Common
.
isNotNull
(
first
)
&&
Common
.
isNotNull
(
first
.
getContractStart
())){
vo
.
setEntryTime
(
LocalDateTimeUtils
.
convertDateToLDT
(
first
.
getContractStart
()));
vo
.
setFirstContractTime
(
LocalDateTimeUtils
.
convertDateToLDT
(
first
.
getContractStart
()));
}
vo
.
setSex
(
employeeInfo
.
getEmpSex
());
vo
.
setIntroductionUnit
(
CommonConstants
.
EMPTY_STRING
);
vo
.
setSeal
(
"安徽皖信人力资源管理有限公司"
);
...
...
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/service/impl/TEmpChangeInfoServiceImpl.java
View file @
1fbda067
...
...
@@ -35,6 +35,7 @@ import org.springframework.stereotype.Service;
import
org.springframework.validation.BindingResult
;
import
java.util.*
;
import
java.util.regex.Pattern
;
/**
* 档案划转日志表
...
...
@@ -54,6 +55,8 @@ public class TEmpChangeInfoServiceImpl extends ServiceImpl<TEmpChangeInfoMapper,
private
final
TEmployeeLogServiceImpl
tEmployeeLogService
;
public
static
final
Pattern
PATTERN
=
Pattern
.
compile
(
"^[-\\+]?[\\d]*$"
);
/**
* @Author huyc
* @Description 档案划转
...
...
@@ -116,13 +119,23 @@ public class TEmpChangeInfoServiceImpl extends ServiceImpl<TEmpChangeInfoMapper,
errorMsg
=
new
HashSet
<>();
TEmpChangeInfoVO
excel
=
excelVOList
.
get
(
i
);
if
(
Common
.
isNotNull
(
excel
.
getChangeStartMonth
())
&&
excel
.
getChangeStartMonth
().
length
()
>
CommonConstants
.
dingleDigitIntArray
[
6
])
{
errorMsg
.
add
(
"第"
+
(
i
+
2
)
+
"行划转起始月长度不能超过6位"
);
errorMsgMap
.
put
((
i
+
2L
),
new
ErrorMessage
(
"第"
+
(
i
+
2
)
+
"行划转起始月长度不能超过6位"
));
}
if
(!
Common
.
isEmpty
(
excel
.
getChangeStartMonth
())
&&
!
PATTERN
.
matcher
(
excel
.
getChangeStartMonth
()).
matches
())
{
errorMsg
.
add
(
"第"
+
(
i
+
2
)
+
"行划转起始月格式错误"
);
errorMsgMap
.
put
((
i
+
2L
),
new
ErrorMessage
(
"第"
+
(
i
+
2
)
+
"行划转起始月格式错误"
));
}
if
(
excel
.
getUnsettleDeal
().
equals
(
CommonConstants
.
IS_CHANGE
))
{
if
(
Common
.
isEmpty
(
excel
.
getChangeStartMonth
()))
{
errorMsg
.
add
(
"第"
+
(
i
+
2
)
+
"行划转起始月不能为空"
);
errorMsgMap
.
put
((
i
+
2L
),
new
ErrorMessage
(
"第"
+
(
i
+
2
)
+
"行划转起始月不能为空"
));
}
else
if
(
Integer
.
parseInt
(
excel
.
getChangeStartMonth
())
>
Integer
.
parseInt
(
DateUtil
.
getThisMonth
()))
{
errorMsg
.
add
(
"第"
+
(
i
+
2
)
+
"行划转起始月要小于等于当前月"
);
errorMsgMap
.
put
((
i
+
2L
),
new
ErrorMessage
(
"第"
+
(
i
+
2
)
+
"行划转起始月要小于等于当前月"
));
}
else
if
(
PATTERN
.
matcher
(
excel
.
getChangeStartMonth
()).
matches
())
{
if
(
Integer
.
parseInt
(
excel
.
getChangeStartMonth
())
>
Integer
.
parseInt
(
DateUtil
.
getThisMonth
()))
{
errorMsg
.
add
(
"第"
+
(
i
+
2
)
+
"行划转起始月要小于等于当前月"
);
errorMsgMap
.
put
((
i
+
2L
),
new
ErrorMessage
(
"第"
+
(
i
+
2
)
+
"行划转起始月要小于等于当前月"
));
}
}
}
...
...
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/service/impl/TEmpContractAlertServiceImpl.java
View file @
1fbda067
...
...
@@ -268,8 +268,8 @@ public class TEmpContractAlertServiceImpl extends ServiceImpl<TEmpContractAlertM
alert
.
setFileTown
(
Integer
.
toString
(
contract
.
getFileTown
()));
}
alert
.
setEmpType
(
contract
.
getEmpNatrue
());
alert
.
setContractType
(
contract
.
getContractName
());
alert
.
setContractTerm
(
contract
.
getContractType
());
alert
.
setContractTerm
(
contract
.
getContractTerm
());
if
(
Common
.
isNotNull
(
alert
.
getContractEnd
())){
if
(
Common
.
isNotNull
(
contract
.
getContractEnd
())
&&
contract
.
getContractEnd
().
before
(
nowDate
)){
alert
.
setDueFlag
(
CommonConstants
.
ONE_STRING
);
...
...
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/service/impl/TEmployeeProjectServiceImpl.java
View file @
1fbda067
...
...
@@ -39,6 +39,7 @@ import com.yifu.cloud.plus.v1.yifu.archives.service.TEmployeeLogService;
import
com.yifu.cloud.plus.v1.yifu.archives.service.TEmployeeProjectService
;
import
com.yifu.cloud.plus.v1.yifu.archives.service.TSettleDomainService
;
import
com.yifu.cloud.plus.v1.yifu.archives.vo.EmployeeProjectExportVO
;
import
com.yifu.cloud.plus.v1.yifu.archives.vo.EmployeeProjectUpdateVO
;
import
com.yifu.cloud.plus.v1.yifu.archives.vo.EmployeeProjectVO
;
import
com.yifu.cloud.plus.v1.yifu.archives.vo.EmployeeXProjectVO
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants
;
...
...
@@ -48,6 +49,7 @@ import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import
com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils
;
import
lombok.RequiredArgsConstructor
;
import
lombok.extern.log4j.Log4j2
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.validation.BindingResult
;
...
...
@@ -455,14 +457,14 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
if
(
excel
.
getEmpNatrue
().
equals
(
CommonConstants
.
ZERO_STRING
)
||
excel
.
getEmpNatrue
().
equals
(
CommonConstants
.
ONE_STRING
))
{
if
(
excel
.
getContractType
().
equals
(
CommonConstants
.
ONE_STRING
))
{
if
(
Common
.
isEmpty
(
excel
.
getWorkingHours
()))
{
errorMessageList
.
add
(
new
ErrorMessage
(
excel
.
getRowIndex
(),
"
第"
+
(
excel
.
getRowIndex
())
+
"
工时制不能为空!"
));
errorMessageList
.
add
(
new
ErrorMessage
(
excel
.
getRowIndex
(),
"工时制不能为空!"
));
}
}
if
(
Common
.
isEmpty
(
excel
.
getEnjoinDate
()))
{
errorMessageList
.
add
(
new
ErrorMessage
(
excel
.
getRowIndex
(),
"
第"
+
(
excel
.
getRowIndex
())
+
"
入职日期不能为空!"
));
errorMessageList
.
add
(
new
ErrorMessage
(
excel
.
getRowIndex
(),
"入职日期不能为空!"
));
}
if
(
Common
.
isEmpty
(
excel
.
getTryPeriod
()))
{
errorMessageList
.
add
(
new
ErrorMessage
(
excel
.
getRowIndex
(),
"
第"
+
(
excel
.
getRowIndex
())
+
"
试用期不能为空!"
));
errorMessageList
.
add
(
new
ErrorMessage
(
excel
.
getRowIndex
(),
"试用期不能为空!"
));
}
}
if
(
idCardMap
.
get
(
idCard
.
concat
(
deptNo
))
!=
null
)
{
...
...
@@ -564,13 +566,13 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
@Transactional
public
R
<
List
<
ErrorMessage
>>
importEmpProjectUpdate
(
InputStream
inputStream
)
{
List
<
ErrorMessage
>
errorMessageList
=
new
ArrayList
<>();
ExcelUtil
<
EmployeeProject
VO
>
util1
=
new
ExcelUtil
<>(
EmployeeProject
VO
.
class
);
ExcelUtil
<
EmployeeProject
UpdateVO
>
util1
=
new
ExcelUtil
<>(
EmployeeProjectUpdate
VO
.
class
);
;
// 写法2:
// 匿名内部类 不用额外写一个DemoDataListener
// 这里 需要指定读用哪个class去读,然后读取第一个sheet 文件流会自动关闭
try
{
EasyExcel
.
read
(
inputStream
,
EmployeeProject
VO
.
class
,
new
ReadListener
<
EmployeeProject
VO
>()
{
EasyExcel
.
read
(
inputStream
,
EmployeeProject
UpdateVO
.
class
,
new
ReadListener
<
EmployeeProjectUpdate
VO
>()
{
/**
* 单次缓存的数据量
*/
...
...
@@ -578,10 +580,10 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
/**
*临时存储
*/
private
List
<
EmployeeProjectVO
>
cachedDataList
=
ListUtils
.
newArrayListWithExpectedSize
(
BATCH_COUNT
);
private
List
<
EmployeeProject
Update
VO
>
cachedDataList
=
ListUtils
.
newArrayListWithExpectedSize
(
BATCH_COUNT
);
@Override
public
void
invoke
(
EmployeeProjectVO
data
,
AnalysisContext
context
)
{
public
void
invoke
(
EmployeeProject
Update
VO
data
,
AnalysisContext
context
)
{
ReadRowHolder
readRowHolder
=
context
.
readRowHolder
();
Integer
rowIndex
=
readRowHolder
.
getRowIndex
();
data
.
setRowIndex
(
rowIndex
+
1
);
...
...
@@ -624,7 +626,7 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
* @Description 批量更新项目档案信息
* @Date 19:25 2022/6/21
**/
public
void
importEmpProjectUpdate
(
List
<
EmployeeProjectVO
>
excelVOList
,
List
<
ErrorMessage
>
errorMessageList
)
{
public
void
importEmpProjectUpdate
(
List
<
EmployeeProject
Update
VO
>
excelVOList
,
List
<
ErrorMessage
>
errorMessageList
)
{
// 通用校验获取失败的数据
Map
<
Long
,
ErrorMessage
>
errorMsgMap
=
new
HashMap
<>();
...
...
@@ -637,7 +639,7 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
if
(
Common
.
isNotNull
(
errorMsgMap
.
get
(
i
+
2
)))
{
continue
;
}
EmployeeProjectVO
excel
=
excelVOList
.
get
(
i
);
EmployeeProject
Update
VO
excel
=
excelVOList
.
get
(
i
);
String
checkCount
=
excel
.
getEmpIdcard
().
concat
(
excel
.
getDeptNo
());
if
(
Common
.
isNotNull
(
checkCountMap
.
get
(
checkCount
)))
{
...
...
@@ -656,7 +658,8 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
// 数据合法情况
if
(
CollUtil
.
isEmpty
(
errorMessageList
))
{
updateExcelPro
(
excel
,
updateList
,
tEmployeeProject
);
updateExcelProj
(
excel
,
updateList
,
tEmployeeProject
);
if
(!
excel
.
getEmpNatrue
().
equals
(
tEmployeeProject
.
getEmpNatrue
()))
{
TEmployeeInfo
tEmployeeInfo
=
tEmployeeInfoMapper
.
selectOne
(
Wrappers
.<
TEmployeeInfo
>
query
().
lambda
()
.
eq
(
TEmployeeInfo:
:
getEmpIdcard
,
excel
.
getEmpIdcard
())
...
...
@@ -778,7 +781,7 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
@Override
public
void
listExportProject
(
HttpServletResponse
response
,
EmployeeProjectExportVO
projectDTO
,
String
idstr
,
List
<
String
>
exportFields
)
{
String
fileName
=
"项目档案批量导出"
+
LocalDateTime
.
now
()
+
".xlsx"
;
String
fileName
=
"项目档案批量导出"
+
DateUtil
.
getThisTime
()
+
".xlsx"
;
// 根据用户传入确定要导出的字段
Set
<
String
>
includeColumnFiledNames
=
new
HashSet
<
String
>();
for
(
String
exportField
:
exportFields
)
{
...
...
@@ -804,7 +807,7 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
out
=
response
.
getOutputStream
();
response
.
setContentType
(
"multipart/form-data"
);
response
.
setCharacterEncoding
(
"utf-8"
);
response
.
setHeader
(
"Content-Disposition"
,
"attachment;filename
*=utf-8'zh_cn'
"
+
URLEncoder
.
encode
(
fileName
,
"UTF-8"
));
response
.
setHeader
(
"Content-Disposition"
,
"attachment;filename
=
"
+
URLEncoder
.
encode
(
fileName
,
"UTF-8"
));
// 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭
EasyExcel
.
write
(
out
,
EmployeeProjectExportVO
.
class
).
includeColumnFiledNames
(
includeColumnFiledNames
).
sheet
(
"项目档案"
)
.
doWrite
(
list
);
...
...
@@ -908,6 +911,19 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
tEmployeeLogService
.
saveModificationRecord
(
CommonConstants
.
dingleDigitIntArray
[
1
],
""
,
tEmployeeProject
.
getId
(),
tEmployeeProjectOld
,
tEmployeeProject
);
}
/**
* 更新项目档案
*/
private
void
updateExcelProj
(
EmployeeProjectUpdateVO
excel
,
List
<
TEmployeeProject
>
proupdateList
,
TEmployeeProject
tEmployeeProject
)
{
BeanUtil
.
copyProperties
(
excel
,
tEmployeeProject
);
YifuUser
user
=
SecurityUtils
.
getUser
();
tEmployeeProject
.
setUpdateBy
(
user
.
getId
());
proupdateList
.
add
(
tEmployeeProject
);
// 记录变更日志
TEmployeeProject
tEmployeeProjectOld
=
this
.
getById
(
tEmployeeProject
.
getId
());
tEmployeeLogService
.
saveModificationRecord
(
CommonConstants
.
dingleDigitIntArray
[
1
],
""
,
tEmployeeProject
.
getId
(),
tEmployeeProjectOld
,
tEmployeeProject
);
}
@Override
public
List
<
TEmployeeProject
>
getListByEmpId
(
String
empId
,
int
projectStatus
)
{
TEmployeeProject
project
=
new
TEmployeeProject
();
...
...
yifu-archives/yifu-archives-biz/src/main/resources/mapper/TElecEmployeeInfoMapper.xml
View file @
1fbda067
...
...
@@ -74,6 +74,9 @@
<if
test=
"tElecEmployeeInfo.deptName != null and tElecEmployeeInfo.deptName.trim() != ''"
>
AND b.DEPT_NAME like concat('%',#{tElecEmployeeInfo.deptName},'%')
</if>
<if
test=
"tElecEmployeeInfo.empNo != null and tElecEmployeeInfo.empNo.trim() != ''"
>
AND b.EMP_NO like = #{tElecEmployeeInfo.empNo}
</if>
<if
test=
"tElecEmployeeInfo.deptNo != null and tElecEmployeeInfo.deptNo.trim() != ''"
>
AND b.DEPT_NO like concat('%',#{tElecEmployeeInfo.deptNo},'%')
</if>
...
...
yifu-archives/yifu-archives-biz/src/main/resources/mapper/TEmployeeProjectMapper.xml
View file @
1fbda067
...
...
@@ -220,6 +220,7 @@
a.STATUS,
a.CREATE_NAME,
a.CREATE_TIME,
b.EMP_EMAIL,
b.EMP_NATRUE AS PROEMP_NATRUE
</sql>
...
...
yifu-common/yifu-common-core/src/main/java/com/yifu.cloud.plus.v1/yifu/common/core/constant/CacheConstants.java
View file @
1fbda067
...
...
@@ -91,4 +91,14 @@ public interface CacheConstants {
**/
String
EVERYDAY_EMP_CONTRACT_CODE
=
"everyday_emp_contract_code"
;
/**
* 区域数据--标签
*/
String
AREA_LABEL
=
"area_label:"
;
/**
* 区域数据--值
*/
String
AREA_VALUE
=
"area_value:"
;
}
yifu-common/yifu-common-core/src/main/java/com/yifu.cloud.plus.v1/yifu/common/core/constant/CommonConstants.java
View file @
1fbda067
...
...
@@ -192,7 +192,7 @@ public interface CommonConstants {
//- 横
char
DOWN_LINE_CHAR
=
'_'
;
// 冒号 :
String
COLON_STRING
=
"
:
"
;
String
COLON_STRING
=
"
:
"
;
// - 横 分割线 中
String
CENTER_SPLIT_LINE_STRING
=
"-"
;
// 斜杠
...
...
yifu-common/yifu-common-core/src/main/java/com/yifu.cloud.plus.v1/yifu/common/core/util/ExcelUtil.java
View file @
1fbda067
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
common
.
core
.
util
;
import
com.alibaba.fastjson.JSONObject
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.CacheConstants
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.ValidityConstants
;
...
...
@@ -46,8 +47,6 @@ public class ExcelUtil <T> implements Serializable {
private
Field
[]
fields
;
public
void
convertEntity
(
T
vo
,
String
[]
exportFields
,
Map
<
String
,
String
>
diyDicMap
,
String
dateFormat
)
{
String
provinceTemp
;
String
cityTemp
;
// 得到所有定义字段
Field
[]
allFields
=
clazz
.
getDeclaredFields
();
List
<
Field
>
fields
=
new
ArrayList
<>();
...
...
@@ -171,7 +170,10 @@ public class ExcelUtil <T> implements Serializable {
}
// 默认字典获取不到 去 缓存获取
if
(
Common
.
isEmpty
(
tempValue
)
&&
Common
.
isNotNull
(
attr
.
dataType
())){
Map
<
String
,
String
>
dicObj
=
(
Map
<
String
,
String
>)
RedisUtil
.
redis
.
opsForValue
().
get
(
attr
.
dataType
());
Map
<
String
,
String
>
dicObj
=
(
Map
<
String
,
String
>)
RedisUtil
.
redis
.
opsForValue
()
.
get
(
CacheConstants
.
DICT_DETAILS
+
CommonConstants
.
COLON_STRING
+
attr
.
dataType
());
if
(
dicObj
!=
null
)
{
for
(
Map
.
Entry
<
String
,
String
>
entry
:
dicObj
.
entrySet
())
{
if
(
Common
.
isNotNull
(
entry
.
getKey
())
&&
entry
.
getKey
().
equals
(
value
.
trim
()))
{
...
...
@@ -447,11 +449,11 @@ public class ExcelUtil <T> implements Serializable {
return
propertyValue
;
}
private
String
getAreaLabel
(
String
c
)
{
return
(
String
)
RedisUtil
.
redis
.
opsForValue
().
get
(
c
);
return
(
String
)
RedisUtil
.
redis
.
opsForValue
().
get
(
CacheConstants
.
AREA_VALUE
+
c
);
}
private
String
getAreaValue
(
String
c
,
String
tempStr
,
ExcelAttribute
attr
,
Integer
rowNum
,
ErrorMessage
errorTemp
)
{
tempStr
=
String
.
valueOf
(
RedisUtil
.
redis
.
opsForValue
().
get
(
c
));
tempStr
=
String
.
valueOf
(
RedisUtil
.
redis
.
opsForValue
().
get
(
CacheConstants
.
AREA_LABEL
+
c
));
if
(
Common
.
isEmpty
(
tempStr
)){
errorMessageHashMap
=
initErrorMessage
(
errorMessageHashMap
,
new
ErrorMessage
(
rowNum
,
attr
.
name
()
+
":"
+
c
.
trim
()
+
"校验异常,请联系管理人员"
),
errorTemp
);
return
CommonConstants
.
EMPTY_STRING
;
...
...
@@ -465,7 +467,10 @@ public class ExcelUtil <T> implements Serializable {
}
private
String
getDicValue
(
String
c
,
String
tempStr
,
ExcelAttribute
attr
,
Integer
rowNum
,
ErrorMessage
errorTemp
)
{
Map
<
String
,
String
>
dicObj
=
(
Map
<
String
,
String
>)
RedisUtil
.
redis
.
opsForValue
().
get
(
attr
.
dataType
());
Map
<
String
,
String
>
dicObj
=
(
Map
<
String
,
String
>)
RedisUtil
.
redis
.
opsForValue
()
.
get
(
CacheConstants
.
DICT_DETAILS
+
CommonConstants
.
COLON_STRING
+
attr
.
dataType
());
boolean
flag
=
true
;
for
(
Map
.
Entry
<
String
,
String
>
entry:
dicObj
.
entrySet
()){
if
(
Common
.
isNotNull
(
entry
.
getValue
())
&&
entry
.
getValue
().
equals
(
c
.
trim
())){
...
...
yifu-common/yifu-common-core/src/main/java/com/yifu.cloud.plus.v1/yifu/common/core/util/RedisUtil.java
View file @
1fbda067
...
...
@@ -96,7 +96,6 @@ public class RedisUtil {
}
return
result
;
}
/**
* 写入缓存
* @param key
...
...
yifu-upms/yifu-upms-biz/src/main/java/com/yifu.cloud.plus.v1/yifu/admin/service/impl/SysDictItemServiceImpl.java
View file @
1fbda067
...
...
@@ -112,7 +112,7 @@ public class SysDictItemServiceImpl extends ServiceImpl<SysDictItemMapper, SysDi
private
void
extractedRedis
(
SysDictItem
item
)
{
Map
<
String
,
Object
>
resultMap
=
new
HashMap
<>();
updateDictItem
(
item
.
getType
(),
resultMap
);
updateDictItem
(
CacheConstants
.
DICT_DETAILS
+
CommonConstants
.
COLON_STRING
+
item
.
getType
(),
resultMap
);
redisUtil
.
set
(
item
.
getType
(),
resultMap
);
}
...
...
yifu-upms/yifu-upms-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/admin/init/DictItemRedisInit.java
View file @
1fbda067
...
...
@@ -3,6 +3,7 @@ package com.yifu.cloud.plus.v1.yifu.admin.init;
import
com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysArea
;
import
com.yifu.cloud.plus.v1.yifu.admin.service.SysAreaService
;
import
com.yifu.cloud.plus.v1.yifu.admin.service.SysDictItemService
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.CacheConstants
;
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.RedisUtil
;
...
...
@@ -39,7 +40,9 @@ public class DictItemRedisInit {
Map
<
String
,
Object
>
dictItem
=
dictItemService
.
getAllDictItemSub
();
if
(
Common
.
isNotNull
(
dictItem
)){
for
(
Map
.
Entry
<
String
,
Object
>
entry:
dictItem
.
entrySet
()){
redisUtil
.
set
(
entry
.
getKey
(),
entry
.
getValue
());
redisUtil
.
set
(
CacheConstants
.
DICT_DETAILS
+
CommonConstants
.
COLON_STRING
+
entry
.
getKey
(),
entry
.
getValue
());
}
}
log
.
info
(
"字典数据加入缓存初始化结束..."
);
...
...
@@ -49,18 +52,21 @@ public class DictItemRedisInit {
if
(
Common
.
isNotNull
(
allAreas
)){
Map
<
String
,
SysArea
>
areaMap
=
new
HashMap
<>();
for
(
SysArea
area:
allAreas
){
redisUtil
.
set
(
"area_"
+
area
.
getId
(),
area
.
getAreaName
());
redisUtil
.
set
(
CacheConstants
.
AREA_LABEL
+
area
.
getId
(),
area
.
getAreaName
());
areaMap
.
put
(
area
.
getId
().
toString
(),
area
);
}
SysArea
temp
;
for
(
SysArea
area:
allAreas
){
if
(
Common
.
isNotNull
(
area
.
getParentId
())
&&
area
.
getParentId
().
intValue
()
>
0
){
temp
=
areaMap
.
get
(
area
.
getParentId
().
toString
());
redisUtil
.
set
(
"area_"
+
area
.
getAreaName
()
redisUtil
.
set
(
CacheConstants
.
AREA_VALUE
+
area
.
getAreaName
()
+
CommonConstants
.
DOWN_LINE_STRING
+(
Common
.
isNotNull
(
temp
)?
temp
.
getAreaName
():
""
),
area
.
getId
());
}
else
{
redisUtil
.
set
(
"area_"
+
area
.
getAreaName
(),
area
.
getId
());
redisUtil
.
set
(
CacheConstants
.
AREA_VALUE
+
area
.
getAreaName
(),
area
.
getId
());
}
}
}
...
...
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