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
d485a2ef
Commit
d485a2ef
authored
Jul 11, 2022
by
fangxinjiang
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/develop' into develop
parents
cd960e54
4fd48bde
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
313 additions
and
160 deletions
+313
-160
TEmployeeInfo.java
...ifu/cloud/plus/v1/yifu/archives/entity/TEmployeeInfo.java
+4
-4
EmployeeExportVO.java
...yifu/cloud/plus/v1/yifu/archives/vo/EmployeeExportVO.java
+1
-1
EmployeeVO.java
...a/com/yifu/cloud/plus/v1/yifu/archives/vo/EmployeeVO.java
+1
-0
EmployeeXProjectVO.java
...fu/cloud/plus/v1/yifu/archives/vo/EmployeeXProjectVO.java
+2
-2
EmployeeConstants.java
...ud/plus/v1/yifu/archives/constants/EmployeeConstants.java
+2
-0
TElecEmployeeInfoController.java
...yifu/archives/controller/TElecEmployeeInfoController.java
+1
-1
TElecEmployeeInfoService.java
...us/v1/yifu/archives/service/TElecEmployeeInfoService.java
+1
-1
TEmployeeProjectService.java
...lus/v1/yifu/archives/service/TEmployeeProjectService.java
+35
-0
TElecEmployeeInfoServiceImpl.java
...u/archives/service/impl/TElecEmployeeInfoServiceImpl.java
+19
-11
TEmployeeInfoServiceImpl.java
.../yifu/archives/service/impl/TEmployeeInfoServiceImpl.java
+61
-12
TEmployeeProjectServiceImpl.java
...fu/archives/service/impl/TEmployeeProjectServiceImpl.java
+153
-115
DoJointTask.java
...m/yifu/cloud/plus/v1/yifu/archives/utils/DoJointTask.java
+12
-6
application-test.yml
...yifu-archives-biz/src/main/resources/application-test.yml
+18
-6
TEmployeeInfoMapper.xml
...ves-biz/src/main/resources/mapper/TEmployeeInfoMapper.xml
+1
-0
DateUtil.java
...om/yifu.cloud.plus.v1/yifu/common/core/util/DateUtil.java
+2
-1
No files found.
yifu-archives/yifu-archives-api/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/entity/TEmployeeInfo.java
View file @
d485a2ef
...
...
@@ -311,28 +311,28 @@ public class TEmployeeInfo extends BaseEntity {
/**
* 减档操作人姓名
*/
@Schema
(
description
=
"
离职操作姓名
"
)
@Schema
(
description
=
"
减档人
"
)
@TableField
(
updateStrategy
=
FieldStrategy
.
IGNORED
)
private
String
leaveUserName
;
/**
* 离职时间
*/
@Schema
(
description
=
"
离职
时间"
)
@Schema
(
description
=
"
减档
时间"
)
@TableField
(
updateStrategy
=
FieldStrategy
.
IGNORED
)
private
Date
leaveTime
;
/**
* 离职原因
*/
@Schema
(
description
=
"
离职
原因"
)
@Schema
(
description
=
"
减档
原因"
)
@TableField
(
updateStrategy
=
FieldStrategy
.
IGNORED
)
private
String
leaveReason
;
/**
* 离职备注
*/
@Schema
(
description
=
"
离职
备注"
)
@Schema
(
description
=
"
减档
备注"
)
@TableField
(
updateStrategy
=
FieldStrategy
.
IGNORED
)
private
String
leaveRemark
;
...
...
yifu-archives/yifu-archives-api/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/vo/EmployeeExportVO.java
View file @
d485a2ef
...
...
@@ -189,7 +189,7 @@ public class EmployeeExportVO extends BaseEntity {
@ExcelProperty
(
value
=
"近3个月发薪"
)
private
String
salaryStatus
;
@ExcelProperty
(
value
=
"减档
操作
人"
)
@ExcelProperty
(
value
=
"减档人"
)
private
String
leaveUserName
;
@ExcelProperty
(
value
=
"减档时间"
)
...
...
yifu-archives/yifu-archives-api/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/vo/EmployeeVO.java
View file @
d485a2ef
...
...
@@ -215,6 +215,7 @@ public class EmployeeVO extends RowIndex implements Serializable {
* 通信地址
*/
@Schema
(
description
=
"通信地址"
)
@ExcelProperty
(
value
=
"通信地址"
)
private
String
contactAddress
;
}
yifu-archives/yifu-archives-api/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/vo/EmployeeXProjectVO.java
View file @
d485a2ef
...
...
@@ -78,7 +78,7 @@ public class EmployeeXProjectVO extends RowIndex implements Serializable {
* 是否同步减档(0否;1是)
*/
@ExcelProperty
(
value
=
"是否同步减档"
)
@NotNull
(
message
=
"是否同步减档不能为空"
)
@ExcelAttribute
(
name
=
"是否同步减档"
,
isNotEmpty
=
true
,
errorInfo
=
"是否同步减档不能为空"
,
maxLength
=
1
)
//
@NotNull(message = "是否同步减档不能为空")
//
@ExcelAttribute(name = "是否同步减档",isNotEmpty = true, errorInfo = "是否同步减档不能为空",maxLength = 1)
private
String
isLeaveEmployee
;
}
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/constants/EmployeeConstants.java
View file @
d485a2ef
...
...
@@ -28,6 +28,8 @@ public class EmployeeConstants {
public
static
final
String
ID_CITY_MUST
=
"更新户籍县,户籍市必填"
;
public
static
final
String
FILE_ROVINCE_MUST
=
"更新档案市,档案省必填"
;
public
static
final
String
FILE_CITY_MUST
=
"更新档案县,档案市必填"
;
public
static
final
String
DEPT_NO_ERROR
=
"项目编码错误"
;
public
static
final
String
DEPT_NO_EXIST
=
"根据项目编码未找到项目"
;
/**
* 无数据可更新
...
...
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/controller/TElecEmployeeInfoController.java
View file @
d485a2ef
...
...
@@ -129,7 +129,7 @@ public class TElecEmployeeInfoController {
@PostMapping
(
"/importZip"
)
@Operation
(
summary
=
"批量导入电子档案"
,
description
=
"批量导入电子档案"
)
@SysLog
(
"批量导入电子档案"
)
public
R
<
Boolean
>
importZip
(
@RequestBody
MultipartFile
file
)
{
public
R
importZip
(
@RequestBody
MultipartFile
file
)
{
return
this
.
tElecEmployeeInfoService
.
importZip
(
file
);
}
}
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/service/TElecEmployeeInfoService.java
View file @
d485a2ef
...
...
@@ -41,7 +41,7 @@ public interface TElecEmployeeInfoService extends IService<TElecEmployeeInfo> {
* @author: huyc
* @date: 2022/6/24
*/
R
<
Boolean
>
importZip
(
MultipartFile
file
);
R
importZip
(
MultipartFile
file
);
/**
* @description: 通过身份证号查询人员档案
...
...
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/service/TEmployeeProjectService.java
View file @
d485a2ef
...
...
@@ -42,14 +42,49 @@ import java.util.Map;
*/
public
interface
TEmployeeProjectService
extends
IService
<
TEmployeeProject
>
{
/**
* @param tEmployeeProject
* @Description: 新增项目档案校验
* @Author: huyc
* @Date: 2022/6/21 10:30
* @return: R
**/
R
addCheck
(
TEmployeeProject
tEmployeeProject
);
/**
* @param jsonObject
* @Description: 复档复项相关操作
* @Author: huyc
* @Date: 2022/6/21 10:30
* @return: R
**/
R
reEmpInfo
(
JSONObject
jsonObject
);
/**
* @param tEmployeeProject
* @Description: 新增项目档案表
* @Author: huyc
* @Date: 2022/6/21 10:30
* @return: R
**/
R
saveEmp
(
TEmployeeProject
tEmployeeProject
);
/**
* @param tEmployeeProject
* @Description: 修改项目档案表
* @Author: huyc
* @Date: 2022/6/21 10:30
* @return: R
**/
R
updateProject
(
TEmployeeProject
tEmployeeProject
);
/**
* @param id
* @Description: 通过id删除项目档案
* @Author: huyc
* @Date: 2022/6/21 10:30
* @return: R
**/
R
removeProjectInfo
(
String
id
);
/**
...
...
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/service/impl/TElecEmployeeInfoServiceImpl.java
View file @
d485a2ef
...
...
@@ -41,11 +41,11 @@ import org.apache.commons.fileupload.FileItemFactory;
import
org.apache.commons.fileupload.disk.DiskFileItemFactory
;
import
org.springframework.boot.context.properties.EnableConfigurationProperties
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.ResourceUtils
;
import
org.springframework.web.multipart.MultipartFile
;
import
org.springframework.web.multipart.commons.CommonsMultipartFile
;
import
java.io.*
;
import
java.util.Arrays
;
import
java.util.Enumeration
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -90,10 +90,10 @@ public class TElecEmployeeInfoServiceImpl extends ServiceImpl<TElecEmployeeInfoM
* @date: 2022/6/27
*/
@Override
public
R
<
Boolean
>
importZip
(
MultipartFile
zipFile
){
public
R
importZip
(
MultipartFile
zipFile
){
try
{
String
pathName
=
ResourceUtils
.
getURL
(
"classpath:"
).
getPath
()
+
"unloap/"
;
String
dec
=
ResourceUtils
.
getURL
(
"classpath:"
).
getPath
()
+
"unloap/"
;
String
pathName
=
System
.
getProperty
(
"java.io.tmpdir"
)
;
String
dec
=
System
.
getProperty
(
"java.io.tmpdir"
)
;
File
file1
=
new
File
(
pathName
);
//如果文件夹不存在 创建文件夹
if
(!
file1
.
exists
())
{
...
...
@@ -107,9 +107,7 @@ public class TElecEmployeeInfoServiceImpl extends ServiceImpl<TElecEmployeeInfoM
File
file
=
new
File
(
pathName
);
zipFile
.
transferTo
(
file
);
// 获取解压出来的文件名 不带后缀
unZip
(
file
,
dec
);
//解析完成删除本次解析中生成的文件 删除此目录下的所有文件
deleteFolder
(
dec
);
return
unZip
(
file
,
dec
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
...
...
@@ -121,6 +119,9 @@ public class TElecEmployeeInfoServiceImpl extends ServiceImpl<TElecEmployeeInfoM
TEmployeeInfo
tEmployeeInfo
=
tEmployeeInfoService
.
getOne
((
Wrappers
.<
TEmployeeInfo
>
query
().
lambda
()
.
eq
(
TEmployeeInfo:
:
getEmpIdcard
,
idCard
)).
eq
(
TEmployeeInfo:
:
getDeleteFlag
,
CommonConstants
.
ZERO_STRING
));
if
(
Common
.
isNotNull
(
tEmployeeInfo
))
{
if
(
CommonConstants
.
ONE_INT
==
tEmployeeInfo
.
getFileStatus
())
{
return
R
.
failed
(
"身份证号对应的档案为已减档"
);
}
return
R
.
ok
(
tEmployeeInfo
);
}
return
R
.
failed
(
"未找到身份证号对应的档案信息"
);
...
...
@@ -196,18 +197,18 @@ public class TElecEmployeeInfoServiceImpl extends ServiceImpl<TElecEmployeeInfoM
fos
.
write
(
buf
,
0
,
len
);
}
R
<
FileVo
>
fileVo
=
fileUploadService
.
uploadImg
(
fileCovertMultipartFile
(
targetFile
),
""
,
CommonConstants
.
EIGHT_INT
,
""
);
if
(
empInfo
.
length
()
>
empInfo
.
lastIndexOf
(
"/"
)
+
1
)
{
String
idCard
=
empInfo
.
substring
(
0
,
empInfo
.
indexOf
(
"/"
));
String
dataType
=
empInfo
.
substring
(
empInfo
.
indexOf
(
"/"
)
+
1
,
empInfo
.
lastIndexOf
(
"/"
));
String
empName
=
""
;
TEmployeeInfo
tEmployeeInfo
=
tEmployeeInfoService
.
getOne
((
Wrappers
.<
TEmployeeInfo
>
query
().
lambda
()
.
eq
(
TEmployeeInfo:
:
getEmpIdcard
,
idCard
)));
.
eq
(
TEmployeeInfo:
:
getEmpIdcard
,
idCard
)).
eq
(
TEmployeeInfo:
:
getFileStatus
,
CommonConstants
.
ZERO_INT
)
.
eq
(
TEmployeeInfo:
:
getDeleteFlag
,
CommonConstants
.
ZERO_STRING
));
if
(
Common
.
isNotNull
(
tEmployeeInfo
))
{
empName
=
tEmployeeInfo
.
getEmpName
();
}
else
{
return
R
.
failed
(
"未找到身份证对应的档案信息,身份证号:"
+
idCard
);
}
String
attachInfo
=
empInfo
.
substring
(
empInfo
.
lastIndexOf
(
"/"
)+
1
,
empInfo
.
length
());
TElecEmployeeInfo
tElecEmployeeInfo
=
new
TElecEmployeeInfo
();
tElecEmployeeInfo
.
setEmpIdcard
(
idCard
);
tElecEmployeeInfo
.
setEmpName
(
empName
);
...
...
@@ -215,7 +216,14 @@ public class TElecEmployeeInfoServiceImpl extends ServiceImpl<TElecEmployeeInfoM
tElecEmployeeInfo
.
setDataType
(
elecTypeMap
.
get
(
dataType
));
}
this
.
save
(
tElecEmployeeInfo
);
//文件上传并保存附件信息
R
<
FileVo
>
fileVo
=
fileUploadService
.
uploadImg
(
fileCovertMultipartFile
(
targetFile
),
""
,
CommonConstants
.
EIGHT_INT
,
""
);
String
id
=
fileVo
.
getData
().
getUid
();
attaInfoMapper
.
updateDomainId
(
tElecEmployeeInfo
.
getId
(),
Arrays
.
asList
(
id
));
}
//解析完成删除本次解析中生成的文件 删除此目录下的所有文件
deleteFolder
(
destDirPath
);
// 关流顺序,先打开的后关闭
fos
.
close
();
is
.
close
();
...
...
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/service/impl/TEmployeeInfoServiceImpl.java
View file @
d485a2ef
...
...
@@ -24,6 +24,7 @@ import com.alibaba.excel.read.listener.ReadListener;
import
com.alibaba.excel.read.metadata.holder.ReadRowHolder
;
import
com.alibaba.excel.util.ListUtils
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
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.pig4cloud.plugin.excel.vo.ErrorMessage
;
...
...
@@ -33,11 +34,9 @@ import com.yifu.cloud.plus.v1.yifu.archives.constants.EmployeeConstants;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.TEmpEducation
;
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.entity.TSettleDomain
;
import
com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmployeeInfoMapper
;
import
com.yifu.cloud.plus.v1.yifu.archives.service.TEmpEducationService
;
import
com.yifu.cloud.plus.v1.yifu.archives.service.TEmployeeInfoService
;
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.*
;
import
com.yifu.cloud.plus.v1.yifu.archives.vo.*
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.CacheConstants
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants
;
...
...
@@ -86,6 +85,7 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
private
final
DaprUpmsProperties
daprUpmsProperties
;
private
final
TEmployeeLogService
tEmployeeLogService
;
private
final
TEmpEducationService
tEmpEducationService
;
private
final
TSettleDomainService
tSettleDomainService
;
@Override
public
IPage
<
TEmployeeInfo
>
getPage
(
Page
<
TEmployeeInfo
>
page
,
TEmployeeInfo
employeeInfo
,
String
sql
)
{
...
...
@@ -778,7 +778,11 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
log
.
error
(
CommonConstants
.
IMPORT_DATA_ANALYSIS_ERROR
,
e
);
return
R
.
failed
(
CommonConstants
.
IMPORT_DATA_ANALYSIS_ERROR
);
}
return
R
.
ok
(
errorMessageList
);
if
(
errorMessageList
.
isEmpty
())
{
return
R
.
ok
();
}
else
{
return
R
.
failed
(
errorMessageList
);
}
}
...
...
@@ -786,21 +790,26 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
if
(
excelVOList
==
null
||
excelVOList
.
isEmpty
())
{
return
R
.
failed
(
CommonConstants
.
DATA_CAN_NOT_EMPTY
);
}
Set
<
String
>
errorMsg
;
YifuUser
user
=
SecurityUtils
.
getUser
();
if
(
user
==
null
||
Common
.
isEmpty
(
user
.
getId
()))
{
return
R
.
failed
(
"请登录!"
);
errorMsg
=
new
HashSet
<>();
errorMsg
.
add
(
CommonConstants
.
PLEASE_LOG_IN
);
errorMessageList
.
add
(
new
ErrorMessage
(
2L
,
errorMsg
));
return
R
.
failed
(
errorMessageList
);
}
Map
<
Long
,
ErrorMessage
>
errorMsgMap
=
new
HashMap
<>();
if
(
Common
.
isNotNull
(
errorMessageList
))
{
errorMessageList
.
stream
().
forEach
(
errorMessage
->
errorMsgMap
.
put
(
errorMessage
.
getLineNum
(),
errorMessage
));
}
// 获取身份证、手机号列表,批量查询档案
List
<
String
>
idCardList
=
new
ArrayList
<>();
List
<
String
>
phoneList
=
new
ArrayList
<>();
Map
<
String
,
Integer
>
idCardMap
=
new
HashMap
<>();
String
idCard
;
// 个性化校验逻辑
Set
<
String
>
errorMsg
;
List
<
String
>
deptNoList
=
new
ArrayList
<>()
;
for
(
int
i
=
0
;
i
<
excelVOList
.
size
();
i
++)
{
errorMsg
=
new
HashSet
<>();
// 判空
...
...
@@ -822,12 +831,34 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
if
(
Common
.
isNotNull
(
excelVOList
.
get
(
i
).
getEmpPhone
()))
{
phoneList
.
add
(
excelVOList
.
get
(
i
).
getEmpPhone
());
}
if
(
Common
.
isNotNull
(
excelVOList
.
get
(
i
).
getDeptNo
()))
{
deptNoList
.
add
(
excelVOList
.
get
(
i
).
getDeptNo
());
}
// 数据合法情况
if
(!
CollUtil
.
isEmpty
(
errorMsg
))
{
// 数据不合法
errorMessageList
.
add
(
new
ErrorMessage
((
i
+
2L
),
errorMsg
));
}
}
List
<
TSettleDomain
>
deptList
=
tSettleDomainService
.
list
(
Wrappers
.<
TSettleDomain
>
query
().
lambda
()
.
eq
(
TSettleDomain:
:
getDeleteFlag
,
CommonConstants
.
STATUS_NORMAL
)
.
eq
(
TSettleDomain:
:
getStopFlag
,
CommonConstants
.
STATUS_NORMAL
)
.
in
(
TSettleDomain:
:
getDepartNo
,
deptNoList
)
);
Map
<
String
,
Integer
>
deptMap
=
new
HashMap
<>();
if
(
deptList
==
null
||
deptList
.
isEmpty
())
{
errorMsg
=
new
HashSet
<>();
errorMsg
.
add
(
EmployeeConstants
.
DEPT_NO_EXIST
);
errorMessageList
.
add
(
new
ErrorMessage
(
2L
,
errorMsg
));
return
R
.
failed
(
errorMessageList
);
}
else
{
for
(
TSettleDomain
dept
:
deptList
)
{
deptMap
.
put
(
dept
.
getDepartNo
(),
CommonConstants
.
ONE_INT
);
}
}
// 查找档案库
Map
<
String
,
TEmployeeInfo
>
existEmpMap
=
new
HashMap
<>();
Map
<
String
,
TEmployeeInfo
>
existPhoneMap
=
new
HashMap
<>();
...
...
@@ -901,6 +932,10 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
saveEmp
=
new
TEmployeeInfo
();
errorMsg
=
new
HashSet
<>();
excel
=
excelVOList
.
get
(
i
);
if
(
deptMap
.
get
(
excel
.
getDeptNo
())
==
null
)
{
errorMsg
.
add
(
EmployeeConstants
.
DEPT_NO_ERROR
);
}
existEmp
=
existEmpMap
.
get
(
excel
.
getEmpIdcard
());
// 档案存在
if
(
existEmp
!=
null
)
{
...
...
@@ -1317,16 +1352,27 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
log
.
error
(
CommonConstants
.
IMPORT_DATA_ANALYSIS_ERROR
,
e
);
return
R
.
failed
(
CommonConstants
.
IMPORT_DATA_ANALYSIS_ERROR
);
}
return
R
.
ok
(
errorMessageList
);
if
(
errorMessageList
.
isEmpty
())
{
return
R
.
ok
();
}
else
{
return
R
.
failed
(
errorMessageList
);
}
}
private
R
<
List
<
ErrorMessage
>>
batchUpdateCore
(
List
<
EmployeeVO
>
excelVOList
,
List
<
ErrorMessage
>
errorMessageList
)
{
YifuUser
user
=
SecurityUtils
.
getUser
();
Set
<
String
>
errorMsg
;
if
(
user
==
null
||
Common
.
isEmpty
(
user
.
getId
()))
{
return
R
.
failed
(
"请登录!"
);
errorMsg
=
new
HashSet
<>();
errorMsg
.
add
(
CommonConstants
.
PLEASE_LOG_IN
);
errorMessageList
.
add
(
new
ErrorMessage
(
2L
,
errorMsg
));
return
R
.
failed
(
errorMessageList
);
}
if
(
excelVOList
==
null
||
excelVOList
.
isEmpty
())
{
return
R
.
failed
(
CommonConstants
.
DATA_CAN_NOT_EMPTY
);
errorMsg
=
new
HashSet
<>();
errorMsg
.
add
(
CommonConstants
.
DATA_CAN_NOT_EMPTY
);
errorMessageList
.
add
(
new
ErrorMessage
(
2L
,
errorMsg
));
return
R
.
failed
(
errorMessageList
);
}
// 通用校验获取失败的数据
Map
<
Long
,
ErrorMessage
>
errorMsgMap
=
new
HashMap
<>();
...
...
@@ -1374,7 +1420,6 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
}
// 个性化校验逻辑
Set
<
String
>
errorMsg
;
EmployeeVO
excel
;
// 需要保存的档案信息
TEmployeeInfo
saveEmp
;
...
...
@@ -1832,10 +1877,14 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
if
(
list
!=
null
&&
!
list
.
isEmpty
())
{
ServletOutputStream
out
=
null
;
try
{
ExcelUtil
<
EmployeeExportVO
>
util
=
new
ExcelUtil
<>(
EmployeeExportVO
.
class
);
for
(
EmployeeExportVO
vo
:
list
)
{
util
.
convertEntity
(
vo
,
null
,
null
,
null
);
}
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
,
EmployeeExportVO
.
class
).
includeColumnFiledNames
(
employeeInfo
.
getExportFields
())
.
sheet
(
"离职档案"
).
doWrite
(
list
);
...
...
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/service/impl/TEmployeeProjectServiceImpl.java
View file @
d485a2ef
...
...
@@ -157,10 +157,12 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
//查询人员档案
TEmployeeInfo
tEmployeeInfo
=
tEmployeeInfoMapper
.
selectOne
(
Wrappers
.<
TEmployeeInfo
>
query
().
lambda
()
.
eq
(
TEmployeeInfo:
:
getEmpIdcard
,
tEmployeeProject
.
getEmpIdcard
())
.
eq
(
TEmployeeInfo:
:
getDeleteFlag
,
CommonConstants
.
STATUS_NORMAL
));
.
eq
(
TEmployeeInfo:
:
getDeleteFlag
,
CommonConstants
.
STATUS_NORMAL
)
.
eq
(
TEmployeeInfo:
:
getFileStatus
,
CommonConstants
.
ZERO_INT
));
if
(
Common
.
isNotNull
(
tEmployeeInfo
))
{
TEmployeeInfo
tEmployeeInfoCompare
=
tEmployeeInfoMapper
.
selectById
(
tEmployeeInfo
.
getId
());
String
empNO
=
getEmpNo
(
tEmployeeProject
.
getDeptNo
());
tEmployeeProject
.
setEmpNo
(
empNO
);
tEmployeeProject
.
setEmpId
(
tEmployeeInfo
.
getId
());
...
...
@@ -174,6 +176,7 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
}
tEmployeeInfo
.
setProjectNum
(
tEmployeeInfo
.
getProjectNum
().
intValue
()
+
CommonConstants
.
ONE_INT
);
tEmployeeInfoMapper
.
updateById
(
tEmployeeInfo
);
tEmployeeLogService
.
saveModificationRecord
(
CommonConstants
.
dingleDigitIntArray
[
0
],
tEmployeeInfoCompare
.
getId
(),
""
,
tEmployeeInfoCompare
,
tEmployeeInfo
);
return
R
.
ok
();
}
return
R
.
failed
(
"未在人员档案中查到身份信息"
);
...
...
@@ -185,14 +188,28 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
boolean
flag
=
this
.
updateById
(
tEmployeeProject
);
TEmployeeInfo
tEmployeeInfo
=
tEmployeeInfoMapper
.
selectOne
(
Wrappers
.<
TEmployeeInfo
>
query
().
lambda
()
.
eq
(
TEmployeeInfo:
:
getEmpIdcard
,
tEmployeeProject
.
getEmpIdcard
())
.
eq
(
TEmployeeInfo:
:
getDeleteFlag
,
CommonConstants
.
STATUS_NORMAL
));
.
eq
(
TEmployeeInfo:
:
getDeleteFlag
,
CommonConstants
.
STATUS_NORMAL
)
.
eq
(
TEmployeeInfo:
:
getFileStatus
,
CommonConstants
.
ZERO_INT
));
if
(
Common
.
isNotNull
(
tEmployeeInfo
))
{
TEmployeeInfo
tEmployeeInfoCompare
=
tEmployeeInfoMapper
.
selectById
(
tEmployeeInfo
.
getId
());
if
(
CommonConstants
.
ZERO_STRING
.
equals
(
tEmployeeProject
.
getEmpNatrue
()))
{
tEmployeeInfo
.
setEmpNatrue
(
CommonConstants
.
ZERO_STRING
);
}
else
if
(
CommonConstants
.
ONE_STRING
.
equals
(
tEmployeeProject
.
getEmpNatrue
())
&&
!
CommonConstants
.
ZERO_STRING
.
equals
(
tEmployeeInfo
.
getEmpNatrue
()))
{
tEmployeeInfo
.
setEmpNatrue
(
CommonConstants
.
ONE_STRING
);
//查询该人员所有的的项目档案
List
<
TEmployeeProject
>
list
=
this
.
list
(
Wrappers
.<
TEmployeeProject
>
query
().
lambda
()
.
eq
(
TEmployeeProject:
:
getEmpIdcard
,
tEmployeeProject
.
getEmpIdcard
())
.
eq
(
TEmployeeProject:
:
getDeleteFlag
,
CommonConstants
.
STATUS_NORMAL
)
.
eq
(
TEmployeeProject:
:
getProjectStatus
,
CommonConstants
.
ZERO_INT
));
//从剩下的项目档案中查找员工类型并更新
if
(
Common
.
isNotNull
(
list
))
{
Set
<
String
>
empNatrue
=
list
.
stream
().
map
(
TEmployeeProject:
:
getEmpNatrue
).
collect
(
Collectors
.
toSet
());
if
(
empNatrue
.
stream
().
anyMatch
(
e
->
e
.
equals
(
CommonConstants
.
ZERO_STRING
)))
{
tEmployeeInfo
.
setEmpNatrue
(
CommonConstants
.
ZERO_STRING
);
}
else
if
(
empNatrue
.
stream
().
anyMatch
(
e
->
e
.
equals
(
CommonConstants
.
ONE_STRING
))){
tEmployeeInfo
.
setEmpNatrue
(
CommonConstants
.
ONE_STRING
);
}
else
{
tEmployeeInfo
.
setEmpNatrue
(
CommonConstants
.
TWO_STRING
);
}
}
tEmployeeInfoMapper
.
updateById
(
tEmployeeInfo
);
tEmployeeLogService
.
saveModificationRecord
(
CommonConstants
.
dingleDigitIntArray
[
0
],
tEmployeeInfoCompare
.
getId
(),
""
,
tEmployeeInfoCompare
,
tEmployeeInfo
);
}
...
...
@@ -203,23 +220,34 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
@Override
@Transactional
public
R
removeProjectInfo
(
String
id
)
{
TEmployeeProject
tEmployeeProject
=
this
.
getById
(
id
);
//对比对象
TEmployeeProject
compareProject
=
this
.
getById
(
id
);
if
(
tEmployeeProject
.
getInsuranceStatus
()
!=
CommonConstants
.
dingleDigitIntArray
[
0
]
||
tEmployeeProject
.
getSocialStatus
()
!=
CommonConstants
.
dingleDigitIntArray
[
0
]
||
tEmployeeProject
.
getFundStatus
()
!=
CommonConstants
.
dingleDigitIntArray
[
0
])
{
return
R
.
failed
(
"人员在该项目下存在进行中/未完结的服务,禁止删除"
);
}
//逻辑删除项目档案
tEmployeeProject
.
setDeleteFlag
(
CommonConstants
.
ONE_STRING
);
baseMapper
.
updateById
(
tEmployeeProject
);
//更新操作记录
tEmployeeLogService
.
saveModificationRecord
(
CommonConstants
.
dingleDigitIntArray
[
1
],
""
,
tEmployeeProject
.
getId
(),
compareProject
,
tEmployeeProject
);
List
<
TEmployeeInfo
>
updList
=
new
ArrayList
<>();
TEmployeeInfo
tEmployeeInfo
=
tEmployeeInfoMapper
.
selectOne
(
Wrappers
.<
TEmployeeInfo
>
query
().
lambda
()
.
eq
(
TEmployeeInfo:
:
getEmpIdcard
,
tEmployeeProject
.
getEmpIdcard
())
.
eq
(
TEmployeeInfo:
:
getDeleteFlag
,
CommonConstants
.
STATUS_NORMAL
));
//删除项目档案
this
.
removeById
(
id
);
TEmployeeInfo
tEmployeeInfoCop
=
tEmployeeInfoMapper
.
selectById
(
tEmployeeInfo
.
getId
());
List
<
String
>
idList
=
new
ArrayList
<>();
idList
.
add
(
id
);
//从剩下的项目档案中查找员工类型并更新
setEmpNature
(
tEmployeeProject
.
getEmpIdcard
(),
tEmployeeInfo
,
idList
);
tEmployeeInfoMapper
.
updateById
(
tEmployeeInfo
);
//更新操作日志
tEmployeeLogService
.
saveModificationRecord
(
CommonConstants
.
dingleDigitIntArray
[
0
],
tEmployeeInfoCop
.
getId
(),
""
,
tEmployeeInfoCop
,
tEmployeeInfo
);
.
eq
(
TEmployeeInfo:
:
getDeleteFlag
,
CommonConstants
.
STATUS_NORMAL
)
.
eq
(
TEmployeeInfo:
:
getFileStatus
,
CommonConstants
.
ZERO_INT
));
if
(
Common
.
isNotNull
(
tEmployeeInfo
))
{
updList
.
add
(
tEmployeeInfo
);
doJointTask
.
doUpdateEmployeeInfo
(
updList
);
}
return
R
.
ok
();
}
...
...
@@ -228,29 +256,83 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
if
(
Common
.
isNotNull
(
jsonObject
))
{
String
empId
=
jsonObject
.
getString
(
"empId"
);
String
empProId
=
jsonObject
.
getString
(
"empProId"
);
TEmployeeInfo
tEmployeeInfoOld
=
tEmployeeInfoMapper
.
selectById
(
empId
);
TEmployeeProject
tEmployeeProjectOld
=
this
.
getById
(
empProId
);
TEmployeeInfo
tEmployeeInfoOld
;
TEmployeeProject
tEmployeeProjectOld
;
if
(!
Common
.
isEmpty
(
empId
)
&&
Common
.
isEmpty
(
empProId
))
{
//复档
tEmployeeInfoOld
=
tEmployeeInfoMapper
.
selectById
(
empId
);
TEmployeeInfo
tEmployeeInfo
=
tEmployeeInfoMapper
.
selectById
(
empId
);
tEmployeeInfo
.
setFileStatus
(
CommonConstants
.
dingleDigitIntArray
[
0
]);
tEmployeeInfoMapper
.
updateById
(
tEmployeeInfo
);
tEmployeeLogService
.
saveModificationRecord
(
CommonConstants
.
dingleDigitIntArray
[
0
],
empId
,
""
,
tEmployeeInfoOld
,
tEmployeeInfo
);
}
else
if
(
Common
.
isEmpty
(
empId
)
&&
!
Common
.
isEmpty
(
empProId
))
{
//复项
tEmployeeProjectOld
=
this
.
getById
(
empProId
);
TEmployeeProject
tEmployeeProject
=
this
.
getById
(
empProId
);
tEmployeeProject
.
setProjectStatus
(
CommonConstants
.
dingleDigitIntArray
[
0
]);
this
.
updateById
(
tEmployeeProject
);
TEmployeeInfo
tEmployeeInfo
=
tEmployeeInfoMapper
.
selectOne
(
Wrappers
.<
TEmployeeInfo
>
query
().
lambda
()
.
eq
(
TEmployeeInfo:
:
getEmpIdcard
,
tEmployeeProject
.
getEmpIdcard
())
.
eq
(
TEmployeeInfo:
:
getDeleteFlag
,
CommonConstants
.
STATUS_NORMAL
)
.
eq
(
TEmployeeInfo:
:
getFileStatus
,
CommonConstants
.
ZERO_INT
));
if
(
Common
.
isNotNull
(
tEmployeeInfo
))
{
tEmployeeInfoOld
=
tEmployeeInfoMapper
.
selectById
(
empId
);
//查询该人员所有的的项目档案
List
<
TEmployeeProject
>
list
=
this
.
list
(
Wrappers
.<
TEmployeeProject
>
query
().
lambda
()
.
eq
(
TEmployeeProject:
:
getEmpIdcard
,
tEmployeeProject
.
getEmpIdcard
())
.
eq
(
TEmployeeProject:
:
getDeleteFlag
,
CommonConstants
.
STATUS_NORMAL
)
.
eq
(
TEmployeeProject:
:
getProjectStatus
,
CommonConstants
.
ZERO_INT
));
//从剩下的项目档案中查找员工类型并更新
if
(
Common
.
isNotNull
(
list
))
{
Set
<
String
>
empNatrue
=
list
.
stream
().
map
(
TEmployeeProject:
:
getEmpNatrue
).
collect
(
Collectors
.
toSet
());
if
(
empNatrue
.
stream
().
anyMatch
(
e
->
e
.
equals
(
CommonConstants
.
ZERO_STRING
)))
{
tEmployeeInfo
.
setEmpNatrue
(
CommonConstants
.
ZERO_STRING
);
}
else
if
(
empNatrue
.
stream
().
anyMatch
(
e
->
e
.
equals
(
CommonConstants
.
ONE_STRING
))){
tEmployeeInfo
.
setEmpNatrue
(
CommonConstants
.
ONE_STRING
);
}
else
{
tEmployeeInfo
.
setEmpNatrue
(
CommonConstants
.
TWO_STRING
);
}
}
tEmployeeInfo
.
setProjectNum
(
tEmployeeInfo
.
getProjectNum
()
+
CommonConstants
.
ONE_INT
);
tEmployeeInfoMapper
.
updateById
(
tEmployeeInfo
);
tEmployeeLogService
.
saveModificationRecord
(
CommonConstants
.
dingleDigitIntArray
[
0
],
tEmployeeInfo
.
getId
(),
""
,
tEmployeeInfoOld
,
tEmployeeInfo
);
}
tEmployeeLogService
.
saveModificationRecord
(
CommonConstants
.
dingleDigitIntArray
[
1
],
""
,
empProId
,
tEmployeeProjectOld
,
tEmployeeProject
);
}
else
{
tEmployeeInfoOld
=
tEmployeeInfoMapper
.
selectById
(
empId
);
tEmployeeProjectOld
=
this
.
getById
(
empProId
);
//复档复项
TEmployeeInfo
tEmployeeInfo
=
tEmployeeInfoMapper
.
selectById
(
empId
);
TEmployeeProject
tEmployeeProject
=
this
.
getById
(
empProId
);
tEmployeeInfo
.
setFileStatus
(
CommonConstants
.
dingleDigitIntArray
[
0
]);
tEmployeeInfoMapper
.
updateById
(
tEmployeeInfo
);
tEmployeeProject
.
setProjectStatus
(
CommonConstants
.
dingleDigitIntArray
[
0
]);
this
.
updateById
(
tEmployeeProject
);
tEmployeeLogService
.
saveModificationRecord
(
CommonConstants
.
dingleDigitIntArray
[
1
],
""
,
empProId
,
tEmployeeProjectOld
,
tEmployeeProject
);
TEmployeeInfo
tEmployeeInfo
=
tEmployeeInfoMapper
.
selectById
(
empId
);
tEmployeeInfo
.
setFileStatus
(
CommonConstants
.
dingleDigitIntArray
[
0
]);
//查询该人员所有的的项目档案
List
<
TEmployeeProject
>
list
=
this
.
list
(
Wrappers
.<
TEmployeeProject
>
query
().
lambda
()
.
eq
(
TEmployeeProject:
:
getEmpIdcard
,
tEmployeeProject
.
getEmpIdcard
())
.
eq
(
TEmployeeProject:
:
getDeleteFlag
,
CommonConstants
.
STATUS_NORMAL
)
.
eq
(
TEmployeeProject:
:
getProjectStatus
,
CommonConstants
.
ZERO_INT
));
//从剩下的项目档案中查找员工类型并更新
if
(
Common
.
isNotNull
(
list
))
{
Set
<
String
>
empNatrue
=
list
.
stream
().
map
(
TEmployeeProject:
:
getEmpNatrue
).
collect
(
Collectors
.
toSet
());
if
(
empNatrue
.
stream
().
anyMatch
(
e
->
e
.
equals
(
CommonConstants
.
ZERO_STRING
)))
{
tEmployeeInfo
.
setEmpNatrue
(
CommonConstants
.
ZERO_STRING
);
}
else
if
(
empNatrue
.
stream
().
anyMatch
(
e
->
e
.
equals
(
CommonConstants
.
ONE_STRING
))){
tEmployeeInfo
.
setEmpNatrue
(
CommonConstants
.
ONE_STRING
);
}
else
{
tEmployeeInfo
.
setEmpNatrue
(
CommonConstants
.
TWO_STRING
);
}
}
tEmployeeInfo
.
setProjectNum
(
CommonConstants
.
ONE_INT
);
tEmployeeInfoMapper
.
updateById
(
tEmployeeInfo
);
tEmployeeLogService
.
saveModificationRecord
(
CommonConstants
.
dingleDigitIntArray
[
0
],
empId
,
""
,
tEmployeeInfoOld
,
tEmployeeInfo
);
}
}
else
{
...
...
@@ -288,21 +370,21 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
}
tEmployeeInfo
.
setFileStatus
(
CommonConstants
.
dingleDigitIntArray
[
1
]);
code
=
CommonConstants
.
ONE_STRING
;
}
}
else
{
//从剩下的项目档案中查找员工类型并更新
if
(
Common
.
isNotNull
(
list
))
{
for
(
TEmployeeProject
t
:
list
)
{
if
(
CommonConstants
.
ZERO_STRING
.
equals
(
t
.
getEmpNatrue
(
)))
{
//从剩下的项目档案中查找员工类型并更新
if
(
Common
.
isNotNull
(
list
))
{
Set
<
String
>
empNatrue
=
list
.
stream
().
map
(
TEmployeeProject:
:
getEmpNatrue
).
collect
(
Collectors
.
toSet
());
if
(
empNatrue
.
stream
().
anyMatch
(
e
->
e
.
equals
(
CommonConstants
.
ZERO_STRING
)))
{
tEmployeeInfo
.
setEmpNatrue
(
CommonConstants
.
ZERO_STRING
);
break
;
}
if
(
CommonConstants
.
ONE_STRING
.
equals
(
t
.
getEmpNatrue
())
&&
!
CommonConstants
.
ONE_STRING
.
equals
(
tEmployeeInfo
.
getEmpNatrue
()))
{
}
else
if
(
empNatrue
.
stream
().
anyMatch
(
e
->
e
.
equals
(
CommonConstants
.
ONE_STRING
)))
{
tEmployeeInfo
.
setEmpNatrue
(
CommonConstants
.
ONE_STRING
);
break
;
}
else
{
tEmployeeInfo
.
setEmpNatrue
(
CommonConstants
.
TWO_STRING
);
}
}
}
tEmployeeInfo
.
setProjectNum
(
tEmployeeInfo
.
getProjectNum
()
-
CommonConstants
.
ONE_INT
);
tEmployeeInfoMapper
.
updateById
(
tEmployeeInfo
);
tEmployeeLogService
.
saveModificationRecord
(
CommonConstants
.
dingleDigitIntArray
[
0
],
tEmployeeInfo
.
getId
(),
""
,
tEmployeeInfoOld
,
tEmployeeInfo
);
...
...
@@ -326,10 +408,6 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
List
<
TEmployeeProject
>
updProjectList
=
new
ArrayList
<>();
//人员档案更新list
List
<
TEmployeeInfo
>
updList
=
new
ArrayList
<>();
// 新老档案List
List
<
EmployeeNewOldVO
>
updateList
=
new
ArrayList
<>();
// 新老档案vo
EmployeeNewOldVO
newOld
;
// 新老项目档案vo
EmployeeProjectNewOldVO
newOldProject
;
// 新老项目档案List
...
...
@@ -339,7 +417,6 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
for
(
int
i
=
0
;
i
<
excelVOList
.
size
();
i
++)
{
EmployeeXProjectVO
excel
=
excelVOList
.
get
(
i
);
List
<
TEmployeeProject
>
idList
=
new
ArrayList
<>();
//根据身份证和项目编码获取项目档案
TEmployeeProject
tEmployeeProject
=
this
.
getOne
(
Wrappers
.<
TEmployeeProject
>
query
().
lambda
()
.
eq
(
TEmployeeProject:
:
getEmpIdcard
,
excel
.
getEmpIdcard
())
...
...
@@ -351,7 +428,6 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
if
(
tEmployeeProject
.
getInsuranceStatus
()
!=
CommonConstants
.
dingleDigitIntArray
[
0
]
||
tEmployeeProject
.
getSocialStatus
()
!=
CommonConstants
.
dingleDigitIntArray
[
0
]
||
tEmployeeProject
.
getFundStatus
()
!=
CommonConstants
.
dingleDigitIntArray
[
0
])
{
idList
.
add
(
tEmployeeProject
);
errorMessageList
.
add
(
new
ErrorMessage
(
excel
.
getRowIndex
(),
MsgUtils
.
getMessage
(
ErrorCodes
.
ARCHIVES_PROJECT_CHANGE_NOT_EXIST
)));
}
else
{
TEmployeeProject
tEmployeeProjectOld
=
this
.
getById
(
tEmployeeProject
.
getId
());
...
...
@@ -366,32 +442,12 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
newOldProject
.
setNewProjectEmployee
(
tEmployeeProject
);
updateProjectList
.
add
(
newOldProject
);
//查询该人员所有的项目档案
List
<
TEmployeeProject
>
list
=
this
.
list
(
Wrappers
.<
TEmployeeProject
>
query
().
lambda
()
.
eq
(
TEmployeeProject:
:
getEmpIdcard
,
tEmployeeProject
.
getEmpIdcard
())
.
eq
(
TEmployeeProject:
:
getDeleteFlag
,
CommonConstants
.
STATUS_NORMAL
)
.
eq
(
TEmployeeProject:
:
getProjectStatus
,
CommonConstants
.
ZERO_INT
));
if
(
Common
.
isNotNull
(
list
))
{
for
(
TEmployeeProject
tEmployeeProject1
:
list
)
{
if
(!
excelVOList
.
stream
().
anyMatch
(
e
->
saveCheck
(
e
,
tEmployeeProject1
)))
{
idList
.
add
(
tEmployeeProject1
);
}
}
}
TEmployeeInfo
tEmployeeInfoOld
=
tEmployeeInfoMapper
.
selectById
(
tEmployeeProject
.
getEmpId
());
TEmployeeInfo
tEmployeeInfo
=
tEmployeeInfoMapper
.
selectById
(
tEmployeeProject
.
getEmpId
());
List
<
String
>
projectIdList
=
idList
.
stream
().
map
(
TEmployeeProject:
:
getId
).
collect
(
Collectors
.
toList
());
//从剩下的项目档案中查找员工类型并更新
setEmpNature
(
tEmployeeProject
.
getEmpIdcard
(),
tEmployeeInfo
,
projectIdList
);
updList
.
add
(
tEmployeeInfo
);
newOld
=
new
EmployeeNewOldVO
();
newOld
.
setOldEmployee
(
tEmployeeInfoOld
);
newOld
.
setNewEmployee
(
tEmployeeInfo
);
updateList
.
add
(
newOld
);
}
}
else
{
idList
.
add
(
tEmployeeProject
);
errorMessageList
.
add
(
new
ErrorMessage
(
excel
.
getRowIndex
(),
MsgUtils
.
getMessage
(
ErrorCodes
.
PROJECT_PERSON_SEARCH_EXIT
)));
}
}
...
...
@@ -404,18 +460,10 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
}
//更新人员档案
if
(
updList
.
size
()
>
CommonConstants
.
dingleDigitIntArray
[
0
])
{
for
(
TEmployeeInfo
tEmployeeInfo
:
updList
)
{
tEmployeeInfoMapper
.
updateById
(
tEmployeeInfo
);
}
List
<
TEmployeeInfo
>
updEmpInfoList
=
updList
.
stream
().
distinct
().
collect
(
Collectors
.
toList
());
doJointTask
.
doUpdateEmployeeInfo
(
updEmpInfoList
);
}
// 记录变更日志
if
(
updateList
.
size
()
>
CommonConstants
.
dingleDigitIntArray
[
0
])
{
for
(
EmployeeNewOldVO
newOldInfo
:
updateList
)
{
tEmployeeLogService
.
saveModificationRecord
(
CommonConstants
.
dingleDigitIntArray
[
0
]
,
newOldInfo
.
getOldEmployee
().
getId
(),
""
,
newOldInfo
.
getOldEmployee
(),
newOldInfo
.
getNewEmployee
());
}
}
if
(
updateProjectList
.
size
()
>
CommonConstants
.
dingleDigitIntArray
[
0
])
{
for
(
EmployeeProjectNewOldVO
newOldVO
:
updateProjectList
)
{
tEmployeeLogService
.
saveModificationRecord
(
CommonConstants
.
dingleDigitIntArray
[
1
]
...
...
@@ -606,6 +654,7 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
try
{
if
(
updateList
.
size
()
>
CommonConstants
.
dingleDigitIntArray
[
0
])
{
tEmployeeInfoMapper
.
updateExcelEmployeeInfo
(
updateList
);
doJointTask
.
doUpdateEmployeeInfo
(
updateList
);
}
if
(
proInsList
.
size
()
>
CommonConstants
.
dingleDigitIntArray
[
0
])
{
baseMapper
.
insertExcelEmpProject
(
proInsList
);
...
...
@@ -726,24 +775,24 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
.
eq
(
TEmployeeProject:
:
getDeptNo
,
excel
.
getDeptNo
())
.
eq
(
TEmployeeProject:
:
getDeleteFlag
,
CommonConstants
.
STATUS_NORMAL
));
if
(
Common
.
isEmpty
(
tEmployeeProject
))
{
errorMessageList
.
add
(
new
ErrorMessage
(
excel
.
getRowIndex
(),
MsgUtils
.
getMessage
(
ErrorCodes
.
CHECKS_EMP_EXIT_ERROR
)));
}
else
{
if
(
tEmployeeProject
.
getProjectStatus
()
!=
CommonConstants
.
dingleDigitIntArray
[
0
])
{
errorMessageList
.
add
(
new
ErrorMessage
(
excel
.
getRowIndex
(),
MsgUtils
.
getMessage
(
ErrorCodes
.
CHECKS_EMP_DELETE_ERROR
)));
}
else
{
errorMessageList
.
add
(
new
ErrorMessage
(
excel
.
getRowIndex
(),
MsgUtils
.
getMessage
(
ErrorCodes
.
CHECKS_EMP_EXIT_ERROR
)));
}
}
else
{
updateExcelProj
(
excel
,
updateList
,
tEmployeeProject
);
TEmployeeProject
tEmployeeProjectOld
=
this
.
getById
(
tEmployeeProject
.
getId
());
newOldProject
=
new
EmployeeProjectNewOldVO
();
newOldProject
.
setOldProjectEmployee
(
tEmployeeProjectOld
);
newOldProject
.
setNewProjectEmployee
(
tEmployeeProject
);
updateProjectList
.
add
(
newOldProject
);
updateExcelProj
(
excel
,
updateList
,
tEmployeeProject
);
TEmployeeProject
tEmployeeProjectOld
=
this
.
getById
(
tEmployeeProject
.
getId
());
newOldProject
=
new
EmployeeProjectNewOldVO
();
newOldProject
.
setOldProjectEmployee
(
tEmployeeProjectOld
);
newOldProject
.
setNewProjectEmployee
(
tEmployeeProject
);
updateProjectList
.
add
(
newOldProject
);
TEmployeeInfo
tEmployeeInfo
=
tEmployeeInfoMapper
.
selectOne
(
Wrappers
.<
TEmployeeInfo
>
query
().
lambda
()
.
eq
(
TEmployeeInfo:
:
getEmpIdcard
,
excel
.
getEmpIdcard
())
.
eq
(
TEmployeeInfo:
:
getFileStatus
,
CommonConstants
.
ZERO_INT
)
.
eq
(
TEmployeeInfo:
:
getDeleteFlag
,
CommonConstants
.
STATUS_NORMAL
));
updTEmployeeList
.
add
(
tEmployeeInfo
);
TEmployeeInfo
tEmployeeInfo
=
tEmployeeInfoMapper
.
selectOne
(
Wrappers
.<
TEmployeeInfo
>
query
().
lambda
()
.
eq
(
TEmployeeInfo:
:
getEmpIdcard
,
excel
.
getEmpIdcard
())
.
eq
(
TEmployeeInfo:
:
getFileStatus
,
CommonConstants
.
ZERO_INT
)
.
eq
(
TEmployeeInfo:
:
getDeleteFlag
,
CommonConstants
.
STATUS_NORMAL
));
updTEmployeeList
.
add
(
tEmployeeInfo
);
}
}
}
...
...
@@ -753,7 +802,7 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
if
(
updateList
.
size
()
>
CommonConstants
.
dingleDigitIntArray
[
0
])
{
baseMapper
.
updateExcelEmpProject
(
updateList
);
}
if
(
updTEmployeeList
.
size
()>
CommonConstants
.
dingleDigitIntArray
[
0
])
{
if
(
updTEmployeeList
.
size
()
>
CommonConstants
.
dingleDigitIntArray
[
0
])
{
List
<
TEmployeeInfo
>
updEmpInfoList
=
updTEmployeeList
.
stream
().
distinct
().
collect
(
Collectors
.
toList
());
doJointTask
.
doUpdateEmployeeInfo
(
updEmpInfoList
);
}
...
...
@@ -815,8 +864,14 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
}
@Override
@Transactional
public
R
<
List
<
ErrorMessage
>>
batchRemoveByIds
(
String
ids
)
{
List
<
ErrorMessage
>
errorList
=
new
ArrayList
<
ErrorMessage
>();
List
<
TEmployeeProject
>
updList
=
new
ArrayList
<>();
List
<
TEmployeeInfo
>
infoUpdList
=
new
ArrayList
<>();
List
<
String
>
idsList
=
null
;
if
(!
Common
.
isEmpty
(
ids
))
{
idsList
=
Common
.
initStrToList
(
ids
,
CommonConstants
.
COMMA_STRING
);
...
...
@@ -834,7 +889,11 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
try
{
if
(
CommonConstants
.
dingleDigitIntArray
[
0
]
==
delProject
.
getStatus
())
{
delProject
.
setDeleteFlag
(
CommonConstants
.
ONE_STRING
);
baseMapper
.
updateById
(
delProject
);
updList
.
add
(
delProject
);
TEmployeeInfo
tEmployeeInfo
=
tEmployeeInfoMapper
.
selectOne
(
Wrappers
.<
TEmployeeInfo
>
query
().
lambda
()
.
eq
(
TEmployeeInfo:
:
getEmpIdcard
,
delProject
.
getEmpIdcard
())
.
eq
(
TEmployeeInfo:
:
getDeleteFlag
,
CommonConstants
.
STATUS_NORMAL
));
infoUpdList
.
add
(
tEmployeeInfo
);
}
else
{
errorList
.
add
(
new
ErrorMessage
(
i
,
MsgUtils
.
getMessage
(
ErrorCodes
.
CHECKS_PROJECT_DELETE_ERROR
)));
}
...
...
@@ -847,6 +906,15 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
}
if
(
CollUtil
.
isNotEmpty
(
errorList
))
{
return
R
.
failed
(
errorList
);
}
else
{
if
(
updList
.
size
()
>
CommonConstants
.
dingleDigitIntArray
[
0
])
{
for
(
TEmployeeProject
tEmployeeProject:
updList
)
{
baseMapper
.
updateById
(
tEmployeeProject
);
}
}
if
(
infoUpdList
.
size
()
>
CommonConstants
.
dingleDigitIntArray
[
0
])
{
doJointTask
.
doUpdateEmployeeInfo
(
infoUpdList
);
}
}
return
R
.
ok
();
}
...
...
@@ -961,18 +1029,12 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
* 更新人员档案
*/
private
void
updateExcelPost
(
EmployeeProjectVO
excel
,
List
<
TEmployeeInfo
>
updateList
,
TEmployeeInfo
tEmployeeInfo
,
int
num
)
{
String
empNature
=
tEmployeeInfo
.
getEmpNatrue
();
BeanUtil
.
copyProperties
(
excel
,
tEmployeeInfo
);
YifuUser
user
=
SecurityUtils
.
getUser
();
tEmployeeInfo
.
setUpdateBy
(
user
.
getId
());
if
(
num
==
CommonConstants
.
ONE_INT
)
{
tEmployeeInfo
.
setProjectNum
(
tEmployeeInfo
.
getProjectNum
().
intValue
()
+
CommonConstants
.
ONE_INT
);
}
if
(
CommonConstants
.
ZERO_STRING
.
equals
(
tEmployeeInfo
.
getEmpNatrue
()))
{
tEmployeeInfo
.
setEmpNatrue
(
CommonConstants
.
ZERO_STRING
);
}
else
if
(
CommonConstants
.
ONE_STRING
.
equals
(
tEmployeeInfo
.
getEmpNatrue
())
&&
!
CommonConstants
.
ZERO_STRING
.
equals
(
empNature
))
{
tEmployeeInfo
.
setEmpNatrue
(
CommonConstants
.
ONE_STRING
);
}
updateList
.
add
(
tEmployeeInfo
);
// 记录变更日志
TEmployeeInfo
tEmployeeInfoOld
=
tEmployeeInfoMapper
.
selectById
(
tEmployeeInfo
.
getId
());
...
...
@@ -1074,30 +1136,6 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
return
str
;
}
//从剩下的项目档案中查找员工类型
public
void
setEmpNature
(
String
empIdcard
,
TEmployeeInfo
tEmployeeInfo
,
List
<
String
>
idlist
)
{
if
(
Common
.
isNotNull
(
idlist
))
{
List
<
TEmployeeProject
>
list
=
this
.
list
(
Wrappers
.<
TEmployeeProject
>
query
().
lambda
()
.
in
(
TEmployeeProject:
:
getId
,
idlist
)
.
eq
(
TEmployeeProject:
:
getEmpIdcard
,
empIdcard
)
.
eq
(
TEmployeeProject:
:
getDeleteFlag
,
CommonConstants
.
STATUS_NORMAL
)
.
eq
(
TEmployeeProject:
:
getProjectStatus
,
CommonConstants
.
ZERO_INT
));
if
(
Common
.
isNotNull
(
list
))
{
for
(
TEmployeeProject
t
:
list
)
{
if
(
CommonConstants
.
ZERO_STRING
.
equals
(
t
.
getEmpNatrue
()))
{
tEmployeeInfo
.
setEmpNatrue
(
CommonConstants
.
ZERO_STRING
);
break
;
}
if
(
CommonConstants
.
ONE_STRING
.
equals
(
t
.
getEmpNatrue
())
&&
!
CommonConstants
.
ONE_STRING
.
equals
(
tEmployeeInfo
.
getEmpNatrue
()))
{
tEmployeeInfo
.
setEmpNatrue
(
CommonConstants
.
ONE_STRING
);
break
;
}
}
}
}
}
public
boolean
saveCheck
(
EmployeeXProjectVO
employeeXProjectVO
,
TEmployeeProject
tEmployeeProject
)
{
if
(
employeeXProjectVO
.
getDeptNo
().
equals
(
tEmployeeProject
.
getDeptNo
())
&&
employeeXProjectVO
.
getEmpIdcard
().
equals
(
tEmployeeProject
.
getEmpIdcard
()))
{
...
...
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/utils/DoJointTask.java
View file @
d485a2ef
...
...
@@ -7,12 +7,15 @@ import com.yifu.cloud.plus.v1.yifu.archives.service.TEmployeeInfoService;
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.common.core.constant.CommonConstants
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.Common
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.stereotype.Component
;
import
java.util.List
;
import
java.util.Set
;
import
java.util.stream.Collectors
;
/**
* 主要执行人员档案的员工类型同步更新
...
...
@@ -50,15 +53,18 @@ public class DoJointTask {
.
eq
(
TEmployeeProject:
:
getEmpIdcard
,
tEmployeeInfo
.
getEmpIdcard
())
.
eq
(
TEmployeeProject:
:
getDeleteFlag
,
CommonConstants
.
STATUS_NORMAL
)
.
eq
(
TEmployeeProject:
:
getProjectStatus
,
CommonConstants
.
ZERO_INT
));
for
(
TEmployeeProject
tEmployeeProject:
list
)
{
if
(
CommonConstants
.
ZERO_STRING
.
equals
(
tEmployeeProject
.
getEmpNatrue
()))
{
if
(
Common
.
isNotNull
(
list
))
{
Set
<
String
>
empNatrue
=
list
.
stream
().
map
(
TEmployeeProject:
:
getEmpNatrue
).
collect
(
Collectors
.
toSet
());
if
(
empNatrue
.
stream
().
anyMatch
(
e
->
e
.
equals
(
CommonConstants
.
ZERO_STRING
)))
{
tEmployeeInfo
.
setEmpNatrue
(
CommonConstants
.
ZERO_STRING
);
break
;
}
else
if
(
CommonConstants
.
ONE_STRING
.
equals
(
tEmployeeProject
.
getEmpNatrue
())
&&
!
CommonConstants
.
ZERO_STRING
.
equals
(
tEmployeeInfo
.
getEmpNatrue
()))
{
}
else
if
(
empNatrue
.
stream
().
anyMatch
(
e
->
e
.
equals
(
CommonConstants
.
ONE_STRING
)))
{
tEmployeeInfo
.
setEmpNatrue
(
CommonConstants
.
ONE_STRING
);
break
;
}
else
{
tEmployeeInfo
.
setEmpNatrue
(
CommonConstants
.
TWO_STRING
);
}
tEmployeeInfo
.
setEmpNatrue
(
CommonConstants
.
TWO_STRING
);
tEmployeeInfo
.
setProjectNum
(
list
.
size
());
}
else
{
tEmployeeInfo
.
setProjectNum
(
CommonConstants
.
ZERO_INT
);
}
tEmployeeInfoService
.
updateById
(
tEmployeeInfo
);
tEmployeeLogService
.
saveModificationRecord
(
CommonConstants
.
dingleDigitIntArray
[
0
]
...
...
yifu-archives/yifu-archives-biz/src/main/resources/application-test.yml
View file @
d485a2ef
...
...
@@ -16,11 +16,23 @@ spring:
password
:
yf_zsk
#url: jdbc:mysql://127.0.0.1:3306/yifu_upms?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowMultiQueries=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true
url
:
jdbc:mysql://192.168.1.65:22306/mvp_archives?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowMultiQueries=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true
servlet
:
multipart
:
location
:
/data/tmp/
#法大大生产环境
#fdd:
# app-id: FA05480470
# app-key: GTYGFVFOYUYP3ONRHY91EK8IEAK5L9E7
# server-url: https://openapi.fadada.com/api/v3/
# connect-timeout: 10000
# read-timeout: 10000
# hrms-url: http://2349f6a315.wicp.vip:39468/v1.0/invoke/yifu-archives/method
#法大大沙箱环境配置
fdd
:
app-id
:
FA05480470
app-key
:
GTYGFVFOYUYP3ONRHY91EK8IEAK5L9E7
server-url
:
https://openapi.fadada.com/api/v3/
connect-timeout
:
10000
read-timeout
:
10000
hrms-url
:
http://2349f6a315.wicp.vip:39468/v1.0/invoke/yifu-archives/method/fdd/notifyUrl
\ No newline at end of file
appId
:
FA38847543
appKey
:
HOQBDZAEMEILJM6WU9LY0OPFHNFAMVTQ
serverUrl
:
https://sandboxapi.fadada.com/api/v3/
connectTimeout
:
10000
readTimeout
:
10000
hrmsUrl
:
http://2349f6a315.wicp.vip:39468/v1.0/invoke/yifu-archives/method
\ No newline at end of file
yifu-archives/yifu-archives-biz/src/main/resources/mapper/TEmployeeInfoMapper.xml
View file @
d485a2ef
...
...
@@ -549,6 +549,7 @@
,GROUP_CONCAT(DISTINCT b.unit_no) UNIT_NO
,a.LEAVE_TIME
,a.LEAVE_USER
,a.LEAVE_USER_NAME
,a.LEAVE_REASON
from t_employee_info a
left join t_employee_project b on a.id = b.EMP_ID
...
...
yifu-common/yifu-common-core/src/main/java/com/yifu.cloud.plus.v1/yifu/common/core/util/DateUtil.java
View file @
d485a2ef
...
...
@@ -76,6 +76,7 @@ public class DateUtil {
* yyyyMMddHHmmss
*/
public
static
final
String
DATE_PATTERN
=
"yyyyMMddHHmmss"
;
public
static
final
String
EXPORT_PATTERN
=
"yyyyMMdd-HHmmss"
;
protected
static
final
float
normalizedJulian
(
float
jd
)
{
...
...
@@ -1407,7 +1408,7 @@ public class DateUtil {
* @return: java.lang.String
**/
public
static
String
getThisTime
(){
SimpleDateFormat
sf
=
new
SimpleDateFormat
(
DateUtil
.
DATE
_PATTERN
);
SimpleDateFormat
sf
=
new
SimpleDateFormat
(
DateUtil
.
EXPORT
_PATTERN
);
return
sf
.
format
(
new
Date
());
}
...
...
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