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
9864817b
Commit
9864817b
authored
Jul 07, 2022
by
fangxinjiang
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/develop' into develop
parents
59333327
b7ea25da
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
199 additions
and
81 deletions
+199
-81
EmployeeProjectNewOldVO.java
...oud/plus/v1/yifu/archives/vo/EmployeeProjectNewOldVO.java
+45
-0
EmployeeProjectUpdateVO.java
...oud/plus/v1/yifu/archives/vo/EmployeeProjectUpdateVO.java
+1
-1
TEmpChangeInfoServiceImpl.java
...yifu/archives/service/impl/TEmpChangeInfoServiceImpl.java
+11
-11
TEmployeeProjectServiceImpl.java
...fu/archives/service/impl/TEmployeeProjectServiceImpl.java
+140
-67
ErrorCodes.java
....cloud.plus.v1/yifu/common/core/exception/ErrorCodes.java
+1
-1
messages_zh_CN.properties
...on-core/src/main/resources/i18n/messages_zh_CN.properties
+1
-1
No files found.
yifu-archives/yifu-archives-api/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/vo/EmployeeProjectNewOldVO.java
0 → 100644
View file @
9864817b
/*
* 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.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeProject
;
import
lombok.Data
;
import
java.io.Serializable
;
/**
* 项目档案更新记录需要的信息
*
* @author huyc
* @date 2022-06-20 17:54:40
*/
@Data
public
class
EmployeeProjectNewOldVO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* 变更前的项目档案
*/
private
TEmployeeProject
oldProjectEmployee
;
/**
* 变更后的项目档案
*/
private
TEmployeeProject
newProjectEmployee
;
}
yifu-archives/yifu-archives-api/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/vo/EmployeeProjectUpdateVO.java
View file @
9864817b
...
@@ -115,7 +115,7 @@ public class EmployeeProjectUpdateVO extends RowIndex implements Serializable {
...
@@ -115,7 +115,7 @@ public class EmployeeProjectUpdateVO extends RowIndex implements Serializable {
/**
/**
* 入职日期
* 入职日期
*/
*/
@ExcelAttribute
(
name
=
"入职日期"
,
maxLength
=
4
)
@ExcelAttribute
(
name
=
"入职日期"
)
@ExcelProperty
(
value
=
"入职日期"
)
@ExcelProperty
(
value
=
"入职日期"
)
@Past
@Past
@DateTimeFormat
(
"yyyy-MM-dd"
)
@DateTimeFormat
(
"yyyy-MM-dd"
)
...
...
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/service/impl/TEmpChangeInfoServiceImpl.java
View file @
9864817b
...
@@ -109,6 +109,7 @@ public class TEmpChangeInfoServiceImpl extends ServiceImpl<TEmpChangeInfoMapper,
...
@@ -109,6 +109,7 @@ public class TEmpChangeInfoServiceImpl extends ServiceImpl<TEmpChangeInfoMapper,
errorMessageList
.
stream
().
forEach
(
errorMessage
->
errorMsgMap
.
put
(
errorMessage
.
getLineNum
(),
errorMessage
));
errorMessageList
.
stream
().
forEach
(
errorMessage
->
errorMsgMap
.
put
(
errorMessage
.
getLineNum
(),
errorMessage
));
}
}
List
<
TEmployeeProject
>
updateList
=
new
ArrayList
<>();
Set
<
String
>
errorMsg
;
Set
<
String
>
errorMsg
;
// 执行数据插入操作 组装
// 执行数据插入操作 组装
for
(
int
i
=
0
;
i
<
excelVOList
.
size
();
i
++)
{
for
(
int
i
=
0
;
i
<
excelVOList
.
size
();
i
++)
{
...
@@ -120,21 +121,17 @@ public class TEmpChangeInfoServiceImpl extends ServiceImpl<TEmpChangeInfoMapper,
...
@@ -120,21 +121,17 @@ public class TEmpChangeInfoServiceImpl extends ServiceImpl<TEmpChangeInfoMapper,
TEmpChangeInfoVO
excel
=
excelVOList
.
get
(
i
);
TEmpChangeInfoVO
excel
=
excelVOList
.
get
(
i
);
if
(
Common
.
isNotNull
(
excel
.
getChangeStartMonth
())
&&
excel
.
getChangeStartMonth
().
length
()
>
CommonConstants
.
dingleDigitIntArray
[
6
])
{
if
(
Common
.
isNotNull
(
excel
.
getChangeStartMonth
())
&&
excel
.
getChangeStartMonth
().
length
()
>
CommonConstants
.
dingleDigitIntArray
[
6
])
{
errorMsg
.
add
(
"第"
+
(
i
+
2
)
+
"行划转起始月长度不能超过6位"
);
errorMsg
.
add
(
"划转起始月长度不能超过6位"
);
errorMsgMap
.
put
((
i
+
2L
),
new
ErrorMessage
(
"第"
+
(
i
+
2
)
+
"行划转起始月长度不能超过6位"
));
}
}
if
(!
Common
.
isEmpty
(
excel
.
getChangeStartMonth
())
&&
!
PATTERN
.
matcher
(
excel
.
getChangeStartMonth
()).
matches
())
{
if
(!
Common
.
isEmpty
(
excel
.
getChangeStartMonth
())
&&
!
PATTERN
.
matcher
(
excel
.
getChangeStartMonth
()).
matches
())
{
errorMsg
.
add
(
"第"
+
(
i
+
2
)
+
"行划转起始月格式错误"
);
errorMsg
.
add
(
"划转起始月格式错误"
);
errorMsgMap
.
put
((
i
+
2L
),
new
ErrorMessage
(
"第"
+
(
i
+
2
)
+
"行划转起始月格式错误"
));
}
}
if
(
excel
.
getUnsettleDeal
().
equals
(
CommonConstants
.
IS_CHANGE
))
{
if
(
excel
.
getUnsettleDeal
().
equals
(
CommonConstants
.
IS_CHANGE
))
{
if
(
Common
.
isEmpty
(
excel
.
getChangeStartMonth
()))
{
if
(
Common
.
isEmpty
(
excel
.
getChangeStartMonth
()))
{
errorMsg
.
add
(
"第"
+
(
i
+
2
)
+
"行划转起始月不能为空"
);
errorMsg
.
add
(
"划转起始月不能为空"
);
errorMsgMap
.
put
((
i
+
2L
),
new
ErrorMessage
(
"第"
+
(
i
+
2
)
+
"行划转起始月不能为空"
));
}
else
if
(
PATTERN
.
matcher
(
excel
.
getChangeStartMonth
()).
matches
())
{
}
else
if
(
PATTERN
.
matcher
(
excel
.
getChangeStartMonth
()).
matches
())
{
if
(
Integer
.
parseInt
(
excel
.
getChangeStartMonth
())
>
Integer
.
parseInt
(
DateUtil
.
getThisMonth
()))
{
if
(
Integer
.
parseInt
(
excel
.
getChangeStartMonth
())
>
Integer
.
parseInt
(
DateUtil
.
getThisMonth
()))
{
errorMsg
.
add
(
"第"
+
(
i
+
2
)
+
"行划转起始月要小于等于当前月"
);
errorMsg
.
add
(
"划转起始月要小于等于当前月"
);
errorMsgMap
.
put
((
i
+
2L
),
new
ErrorMessage
(
"第"
+
(
i
+
2
)
+
"行划转起始月要小于等于当前月"
));
}
}
}
}
}
}
...
@@ -174,7 +171,7 @@ public class TEmpChangeInfoServiceImpl extends ServiceImpl<TEmpChangeInfoMapper,
...
@@ -174,7 +171,7 @@ public class TEmpChangeInfoServiceImpl extends ServiceImpl<TEmpChangeInfoMapper,
updateTEmployeePro
.
setUnitNo
(
tCustomerInfo
.
getCustomerCode
());
updateTEmployeePro
.
setUnitNo
(
tCustomerInfo
.
getCustomerCode
());
updateTEmployeePro
.
setUnitName
(
tCustomerInfo
.
getCustomerName
());
updateTEmployeePro
.
setUnitName
(
tCustomerInfo
.
getCustomerName
());
}
}
tEmployeeProjectService
.
updateByI
d
(
updateTEmployeePro
);
updateList
.
ad
d
(
updateTEmployeePro
);
// 记录变更日志
// 记录变更日志
TEmployeeProject
tEmployeeProjectOld
=
tEmployeeProjectService
.
getById
(
updateTEmployeePro
.
getId
());
TEmployeeProject
tEmployeeProjectOld
=
tEmployeeProjectService
.
getById
(
updateTEmployeePro
.
getId
());
tEmployeeLogService
.
saveModificationRecord
(
CommonConstants
.
dingleDigitIntArray
[
1
],
""
,
tEmployeeProjectOld
.
getId
(),
tEmployeeProjectOld
,
updateTEmployeePro
);
tEmployeeLogService
.
saveModificationRecord
(
CommonConstants
.
dingleDigitIntArray
[
1
],
""
,
tEmployeeProjectOld
.
getId
(),
tEmployeeProjectOld
,
updateTEmployeePro
);
...
@@ -182,13 +179,16 @@ public class TEmpChangeInfoServiceImpl extends ServiceImpl<TEmpChangeInfoMapper,
...
@@ -182,13 +179,16 @@ public class TEmpChangeInfoServiceImpl extends ServiceImpl<TEmpChangeInfoMapper,
}
else
{
}
else
{
errorMsg
.
add
(
MsgUtils
.
getMessage
(
ErrorCodes
.
PROJECT_PERSON_SEARCH_EXIT
,
excel
.
getOldSettleCode
()));
errorMsg
.
add
(
MsgUtils
.
getMessage
(
ErrorCodes
.
PROJECT_PERSON_SEARCH_EXIT
,
excel
.
getOldSettleCode
()));
}
}
}
else
{
}
// 数据不合法
if
(!
CollUtil
.
isEmpty
(
errorMsg
))
{
errorMessageList
.
add
(
new
ErrorMessage
((
long
)
(
i
+
2
),
errorMsg
));
errorMessageList
.
add
(
new
ErrorMessage
((
long
)
(
i
+
2
),
errorMsg
));
}
}
}
}
if
(
CollUtil
.
isNotEmpty
(
errorMessageList
))
{
if
(
CollUtil
.
isNotEmpty
(
errorMessageList
))
{
return
R
.
failed
(
errorMessageList
);
return
R
.
failed
(
errorMessageList
);
}
else
{
tEmployeeProjectService
.
updateBatchById
(
updateList
);
}
}
return
R
.
ok
();
return
R
.
ok
();
}
}
...
...
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/service/impl/TEmployeeProjectServiceImpl.java
View file @
9864817b
...
@@ -38,10 +38,7 @@ import com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmployeeProjectMapper;
...
@@ -38,10 +38,7 @@ import com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmployeeProjectMapper;
import
com.yifu.cloud.plus.v1.yifu.archives.service.TEmployeeLogService
;
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.TEmployeeProjectService
;
import
com.yifu.cloud.plus.v1.yifu.archives.service.TSettleDomainService
;
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.*
;
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
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants
;
import
com.yifu.cloud.plus.v1.yifu.common.core.exception.ErrorCodes
;
import
com.yifu.cloud.plus.v1.yifu.common.core.exception.ErrorCodes
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.*
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.*
;
...
@@ -49,7 +46,6 @@ import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
...
@@ -49,7 +46,6 @@ import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import
com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils
;
import
com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils
;
import
lombok.RequiredArgsConstructor
;
import
lombok.RequiredArgsConstructor
;
import
lombok.extern.log4j.Log4j2
;
import
lombok.extern.log4j.Log4j2
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.validation.BindingResult
;
import
org.springframework.validation.BindingResult
;
...
@@ -194,6 +190,7 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
...
@@ -194,6 +190,7 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
}
}
@Override
@Override
@Transactional
public
R
removeProjectInfo
(
String
id
)
{
public
R
removeProjectInfo
(
String
id
)
{
TEmployeeProject
tEmployeeProject
=
this
.
getById
(
id
);
TEmployeeProject
tEmployeeProject
=
this
.
getById
(
id
);
...
@@ -204,9 +201,10 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
...
@@ -204,9 +201,10 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
this
.
removeById
(
id
);
this
.
removeById
(
id
);
TEmployeeInfo
tEmployeeInfoCop
=
tEmployeeInfoMapper
.
selectById
(
tEmployeeInfo
.
getId
());
TEmployeeInfo
tEmployeeInfoCop
=
tEmployeeInfoMapper
.
selectById
(
tEmployeeInfo
.
getId
());
List
<
String
>
idList
=
new
ArrayList
<>();
idList
.
add
(
id
);
//从剩下的项目档案中查找员工类型并更新
//从剩下的项目档案中查找员工类型并更新
setEmpNature
(
tEmployeeProject
.
getEmpIdcard
(),
tEmployeeInfo
);
setEmpNature
(
tEmployeeProject
.
getEmpIdcard
(),
tEmployeeInfo
,
idList
);
tEmployeeInfoMapper
.
updateById
(
tEmployeeInfo
);
tEmployeeInfoMapper
.
updateById
(
tEmployeeInfo
);
//更新操作日志
//更新操作日志
tEmployeeLogService
.
saveModificationRecord
(
CommonConstants
.
dingleDigitIntArray
[
0
],
tEmployeeInfoCop
.
getId
(),
""
,
tEmployeeInfoCop
,
tEmployeeInfo
);
tEmployeeLogService
.
saveModificationRecord
(
CommonConstants
.
dingleDigitIntArray
[
0
],
tEmployeeInfoCop
.
getId
(),
""
,
tEmployeeInfoCop
,
tEmployeeInfo
);
...
@@ -296,8 +294,8 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
...
@@ -296,8 +294,8 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
}
}
tEmployeeInfoMapper
.
updateById
(
tEmployeeInfo
);
tEmployeeInfoMapper
.
updateById
(
tEmployeeInfo
);
tEmployeeLogService
.
saveModificationRecord
(
CommonConstants
.
dingleDigitIntArray
[
0
],
tEmployeeInfo
.
getId
(),
""
,
tEmployee
Project
Old
,
tEmployeeInfo
);
tEmployeeLogService
.
saveModificationRecord
(
CommonConstants
.
dingleDigitIntArray
[
0
],
tEmployeeInfo
.
getId
(),
""
,
tEmployee
Info
Old
,
tEmployeeInfo
);
tEmployeeLogService
.
saveModificationRecord
(
CommonConstants
.
dingleDigitIntArray
[
1
],
""
,
tEmployeeProject
.
getId
(),
tEmployee
Info
Old
,
tEmployeeProject
);
tEmployeeLogService
.
saveModificationRecord
(
CommonConstants
.
dingleDigitIntArray
[
1
],
""
,
tEmployeeProject
.
getId
(),
tEmployee
Project
Old
,
tEmployeeProject
);
if
(
CommonConstants
.
ONE_STRING
.
equals
(
code
))
{
if
(
CommonConstants
.
ONE_STRING
.
equals
(
code
))
{
return
R
.
ok
(
null
,
"减项减档成功"
);
return
R
.
ok
(
null
,
"减项减档成功"
);
}
else
{
}
else
{
...
@@ -313,9 +311,24 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
...
@@ -313,9 +311,24 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
// 通用校验获取失败的数据
// 通用校验获取失败的数据
List
<
ErrorMessage
>
errorMessageList
=
(
List
<
ErrorMessage
>)
bindingResult
.
getTarget
();
List
<
ErrorMessage
>
errorMessageList
=
(
List
<
ErrorMessage
>)
bindingResult
.
getTarget
();
//项目档案更新list
List
<
TEmployeeProject
>
updProjectList
=
new
ArrayList
<>();
//人员档案更新list
List
<
TEmployeeInfo
>
updList
=
new
ArrayList
<>();
// 新老档案List
List
<
EmployeeNewOldVO
>
updateList
=
new
ArrayList
<>();
// 新老档案vo
EmployeeNewOldVO
newOld
;
// 新老项目档案vo
EmployeeProjectNewOldVO
newOldProject
;
// 新老项目档案List
List
<
EmployeeProjectNewOldVO
>
updateProjectList
=
new
ArrayList
<>();
List
<
EmployeeXProjectVO
>
selectList
=
excelVOList
.
stream
().
filter
(
e
->
e
.
getIsLeaveEmployee
().
equals
(
CommonConstants
.
ONE_STRING
)).
collect
(
Collectors
.
toList
());
// 执行数据插入操作 组装 PostDto
// 执行数据插入操作 组装 PostDto
for
(
int
i
=
0
;
i
<
excelVOList
.
size
();
i
++)
{
for
(
int
i
=
0
;
i
<
excelVOList
.
size
();
i
++)
{
EmployeeXProjectVO
excel
=
excelVOList
.
get
(
i
);
EmployeeXProjectVO
excel
=
excelVOList
.
get
(
i
);
//根据身份证和项目编码获取项目档案
//根据身份证和项目编码获取项目档案
TEmployeeProject
tEmployeeProject
=
this
.
getOne
(
Wrappers
.<
TEmployeeProject
>
query
().
lambda
()
TEmployeeProject
tEmployeeProject
=
this
.
getOne
(
Wrappers
.<
TEmployeeProject
>
query
().
lambda
()
.
eq
(
TEmployeeProject:
:
getEmpIdcard
,
excel
.
getEmpIdcard
())
.
eq
(
TEmployeeProject:
:
getEmpIdcard
,
excel
.
getEmpIdcard
())
...
@@ -328,9 +341,7 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
...
@@ -328,9 +341,7 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
if
(
tEmployeeProject
.
getInsuranceStatus
()
!=
CommonConstants
.
dingleDigitIntArray
[
0
]
||
tEmployeeProject
.
getSocialStatus
()
!=
CommonConstants
.
dingleDigitIntArray
[
0
]
||
if
(
tEmployeeProject
.
getInsuranceStatus
()
!=
CommonConstants
.
dingleDigitIntArray
[
0
]
||
tEmployeeProject
.
getSocialStatus
()
!=
CommonConstants
.
dingleDigitIntArray
[
0
]
||
tEmployeeProject
.
getFundStatus
()
!=
CommonConstants
.
dingleDigitIntArray
[
0
])
{
tEmployeeProject
.
getFundStatus
()
!=
CommonConstants
.
dingleDigitIntArray
[
0
])
{
errorMessageList
.
add
(
new
ErrorMessage
(
excel
.
getRowIndex
(),
MsgUtils
.
getMessage
(
ErrorCodes
.
ARCHIVES_PROJECT_CHANGE_NOT_EXIST
)));
errorMessageList
.
add
(
new
ErrorMessage
(
excel
.
getRowIndex
(),
MsgUtils
.
getMessage
(
ErrorCodes
.
ARCHIVES_PROJECT_CHANGE_NOT_EXIST
)));
}
else
{
}
else
if
(
CommonConstants
.
ONE_STRING
.
equals
(
excel
.
getIsLeaveEmployee
()))
{
TEmployeeInfo
tEmployeeInfo
=
tEmployeeInfoMapper
.
selectById
(
tEmployeeProject
.
getEmpId
());
if
(
CommonConstants
.
ONE_STRING
.
equals
(
excel
.
getIsLeaveEmployee
()))
{
//查询该人员其他的项目档案
//查询该人员其他的项目档案
List
<
TEmployeeProject
>
list
=
this
.
list
(
Wrappers
.<
TEmployeeProject
>
query
().
lambda
()
List
<
TEmployeeProject
>
list
=
this
.
list
(
Wrappers
.<
TEmployeeProject
>
query
().
lambda
()
...
@@ -339,33 +350,81 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
...
@@ -339,33 +350,81 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
.
eq
(
TEmployeeProject:
:
getDeleteFlag
,
CommonConstants
.
STATUS_NORMAL
)
.
eq
(
TEmployeeProject:
:
getDeleteFlag
,
CommonConstants
.
STATUS_NORMAL
)
.
eq
(
TEmployeeProject:
:
getProjectStatus
,
CommonConstants
.
ZERO_INT
));
.
eq
(
TEmployeeProject:
:
getProjectStatus
,
CommonConstants
.
ZERO_INT
));
if
(
tEmployeeProject
.
getIsLeaveEmployee
()
==
CommonConstants
.
dingleDigitIntArray
[
1
])
{
TEmployeeInfo
tEmployeeInfo
=
tEmployeeInfoMapper
.
selectById
(
tEmployeeProject
.
getEmpId
());
if
(
Common
.
isNotNull
(
list
))
{
if
(
Common
.
isNotNull
(
list
))
{
errorMessageList
.
add
(
new
ErrorMessage
(
excel
.
getRowIndex
(),
MsgUtils
.
getMessage
(
ErrorCodes
.
QT_PROJECT_CHANGE_NOT_EXIST
)));
boolean
flag
=
false
;
}
else
{
for
(
TEmployeeProject
tEmployeeProject1
:
list
)
{
if
(!
selectList
.
stream
().
anyMatch
(
e
->
saveCheck
(
e
,
tEmployeeProject1
)))
{
flag
=
true
;
}
}
if
(
flag
)
{
tEmployeeInfo
.
setFileStatus
(
CommonConstants
.
dingleDigitIntArray
[
1
]);
tEmployeeInfo
.
setFileStatus
(
CommonConstants
.
dingleDigitIntArray
[
1
]);
tEmployeeInfo
.
setLeaveReason
(
excel
.
getLeaveReason
());
tEmployeeInfo
.
setLeaveReason
(
excel
.
getLeaveReason
());
tEmployeeInfo
.
setLeaveRemark
(
excel
.
getLeaveRemark
());
tEmployeeInfo
.
setLeaveRemark
(
excel
.
getLeaveRemark
());
tEmployeeInfo
.
setLeaveTime
(
LocalDateTime
.
now
());
tEmployeeInfo
.
setLeaveTime
(
LocalDateTime
.
now
());
List
<
String
>
idList
=
list
.
stream
().
map
(
TEmployeeProject:
:
getId
).
collect
(
Collectors
.
toList
());
//从剩下的项目档案中查找员工类型并更新
setEmpNature
(
tEmployeeProject
.
getEmpIdcard
(),
tEmployeeInfo
,
idList
);
updList
.
add
(
tEmployeeInfo
);
}
else
{
errorMessageList
.
add
(
new
ErrorMessage
(
excel
.
getRowIndex
(),
MsgUtils
.
getMessage
(
ErrorCodes
.
QT_PROJECT_CHANGE_NOT_EXIST
)));
}
}
}
else
{
tEmployeeInfo
.
setFileStatus
(
CommonConstants
.
dingleDigitIntArray
[
1
]);
tEmployeeInfo
.
setLeaveReason
(
excel
.
getLeaveReason
());
tEmployeeInfo
.
setLeaveRemark
(
excel
.
getLeaveRemark
());
tEmployeeInfo
.
setLeaveTime
(
LocalDateTime
.
now
());
updList
.
add
(
tEmployeeInfo
);
}
}
newOld
=
new
EmployeeNewOldVO
();
newOld
.
setOldEmployee
(
tEmployeeInfoOld
);
newOld
.
setNewEmployee
(
tEmployeeInfo
);
updateList
.
add
(
newOld
);
}
}
tEmployeeProject
.
setProjectStatus
(
CommonConstants
.
dingleDigitIntArray
[
1
]);
tEmployeeProject
.
setProjectStatus
(
CommonConstants
.
dingleDigitIntArray
[
1
]);
tEmployeeProject
.
setLeaveReason
(
excel
.
getLeaveReason
());
tEmployeeProject
.
setLeaveReason
(
excel
.
getLeaveReason
());
tEmployeeProject
.
setLeaveRemark
(
excel
.
getLeaveRemark
());
tEmployeeProject
.
setLeaveRemark
(
excel
.
getLeaveRemark
());
tEmployeeProject
.
setLeaveTime
(
LocalDateTime
.
now
());
tEmployeeProject
.
setLeaveTime
(
LocalDateTime
.
now
());
this
.
updateByI
d
(
tEmployeeProject
);
updProjectList
.
ad
d
(
tEmployeeProject
);
//从剩下的项目档案中查找员工类型并更新
newOldProject
=
new
EmployeeProjectNewOldVO
();
setEmpNature
(
tEmployeeProject
.
getEmpIdcard
(),
tEmployeeInfo
);
newOldProject
.
setOldProjectEmployee
(
tEmployeeProjectOld
);
tEmployeeInfoMapper
.
updateById
(
tEmployeeInfo
);
newOldProject
.
setNewProjectEmployee
(
tEmployeeProject
);
tEmployeeLogService
.
saveModificationRecord
(
CommonConstants
.
dingleDigitIntArray
[
0
],
tEmployeeInfo
.
getId
(),
""
,
tEmployeeProjectOld
,
tEmployeeInfo
);
updateProjectList
.
add
(
newOldProject
);
tEmployeeLogService
.
saveModificationRecord
(
CommonConstants
.
dingleDigitIntArray
[
1
],
""
,
tEmployeeProject
.
getId
(),
tEmployeeInfoOld
,
tEmployeeProject
);
}
else
{
}
errorMessageList
.
add
(
new
ErrorMessage
(
excel
.
getRowIndex
(),
MsgUtils
.
getMessage
(
ErrorCodes
.
PROJECT_PERSON_SEARCH_EXIT
)));
}
}
}
}
if
(
errorMessageList
.
size
()
>
CommonConstants
.
ZERO_INT
)
{
if
(
errorMessageList
.
size
()
>
CommonConstants
.
ZERO_INT
)
{
return
R
.
failed
(
errorMessageList
);
return
R
.
failed
(
errorMessageList
);
}
else
{
//更新项目档案
if
(
updProjectList
.
size
()
>
CommonConstants
.
dingleDigitIntArray
[
0
])
{
this
.
updateBatchById
(
updProjectList
);
}
//更新人员档案
if
(
updList
.
size
()
>
CommonConstants
.
dingleDigitIntArray
[
0
])
{
for
(
TEmployeeInfo
tEmployeeInfo
:
updList
)
{
tEmployeeInfoMapper
.
updateById
(
tEmployeeInfo
);
}
}
// 记录变更日志
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
]
,
""
,
newOldVO
.
getNewProjectEmployee
().
getId
()
,
newOldVO
.
getOldProjectEmployee
(),
newOldVO
.
getNewProjectEmployee
());
}
}
}
}
return
R
.
ok
();
return
R
.
ok
();
}
}
...
@@ -430,6 +489,7 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
...
@@ -430,6 +489,7 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
/**
/**
* 新增档案操作记录
* 新增档案操作记录
*
* @param excelVOList
* @param excelVOList
* @param errorMessageList
* @param errorMessageList
* @param
* @param
...
@@ -544,6 +604,7 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
...
@@ -544,6 +604,7 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
}
}
}
}
if
(
CollUtil
.
isEmpty
(
errorMessageList
))
{
try
{
try
{
if
(
updateList
.
size
()
>
CommonConstants
.
dingleDigitIntArray
[
0
])
{
if
(
updateList
.
size
()
>
CommonConstants
.
dingleDigitIntArray
[
0
])
{
tEmployeeInfoMapper
.
updateExcelEmployeeInfo
(
updateList
);
tEmployeeInfoMapper
.
updateExcelEmployeeInfo
(
updateList
);
...
@@ -561,6 +622,7 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
...
@@ -561,6 +622,7 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
log
.
error
(
"数据更新异常"
,
e
);
log
.
error
(
"数据更新异常"
,
e
);
}
}
}
}
}
@Override
@Override
@Transactional
@Transactional
...
@@ -660,6 +722,7 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
...
@@ -660,6 +722,7 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
if
(
CollUtil
.
isEmpty
(
errorMessageList
))
{
if
(
CollUtil
.
isEmpty
(
errorMessageList
))
{
updateExcelProj
(
excel
,
updateList
,
tEmployeeProject
);
updateExcelProj
(
excel
,
updateList
,
tEmployeeProject
);
if
(
Common
.
isNotNull
(
excel
.
getEmpNatrue
()))
{
if
(!
excel
.
getEmpNatrue
().
equals
(
tEmployeeProject
.
getEmpNatrue
()))
{
if
(!
excel
.
getEmpNatrue
().
equals
(
tEmployeeProject
.
getEmpNatrue
()))
{
TEmployeeInfo
tEmployeeInfo
=
tEmployeeInfoMapper
.
selectOne
(
Wrappers
.<
TEmployeeInfo
>
query
().
lambda
()
TEmployeeInfo
tEmployeeInfo
=
tEmployeeInfoMapper
.
selectOne
(
Wrappers
.<
TEmployeeInfo
>
query
().
lambda
()
.
eq
(
TEmployeeInfo:
:
getEmpIdcard
,
excel
.
getEmpIdcard
())
.
eq
(
TEmployeeInfo:
:
getEmpIdcard
,
excel
.
getEmpIdcard
())
...
@@ -679,6 +742,7 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
...
@@ -679,6 +742,7 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
}
}
}
}
}
}
}
try
{
try
{
if
(
updateList
.
size
()
>
CommonConstants
.
dingleDigitIntArray
[
0
])
{
if
(
updateList
.
size
()
>
CommonConstants
.
dingleDigitIntArray
[
0
])
{
baseMapper
.
updateExcelEmpProject
(
updateList
);
baseMapper
.
updateExcelEmpProject
(
updateList
);
...
@@ -997,8 +1061,9 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
...
@@ -997,8 +1061,9 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
}
}
//从剩下的项目档案中查找员工类型
//从剩下的项目档案中查找员工类型
public
void
setEmpNature
(
String
empIdcard
,
TEmployeeInfo
tEmployeeInfo
)
{
public
void
setEmpNature
(
String
empIdcard
,
TEmployeeInfo
tEmployeeInfo
,
List
<
String
>
idlist
)
{
List
<
TEmployeeProject
>
list
=
this
.
list
(
Wrappers
.<
TEmployeeProject
>
query
().
lambda
()
List
<
TEmployeeProject
>
list
=
this
.
list
(
Wrappers
.<
TEmployeeProject
>
query
().
lambda
()
.
notIn
(
TEmployeeProject:
:
getId
,
idlist
)
.
eq
(
TEmployeeProject:
:
getEmpIdcard
,
empIdcard
)
.
eq
(
TEmployeeProject:
:
getEmpIdcard
,
empIdcard
)
.
eq
(
TEmployeeProject:
:
getDeleteFlag
,
CommonConstants
.
STATUS_NORMAL
)
.
eq
(
TEmployeeProject:
:
getDeleteFlag
,
CommonConstants
.
STATUS_NORMAL
)
.
eq
(
TEmployeeProject:
:
getProjectStatus
,
CommonConstants
.
ZERO_INT
));
.
eq
(
TEmployeeProject:
:
getProjectStatus
,
CommonConstants
.
ZERO_INT
));
...
@@ -1016,4 +1081,12 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
...
@@ -1016,4 +1081,12 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
}
}
}
}
}
}
public
boolean
saveCheck
(
EmployeeXProjectVO
employeeXProjectVO
,
TEmployeeProject
tEmployeeProject
)
{
if
(
employeeXProjectVO
.
getDeptNo
().
equals
(
tEmployeeProject
.
getDeptNo
())
&&
employeeXProjectVO
.
getEmpIdcard
().
equals
(
tEmployeeProject
.
getEmpIdcard
()))
{
return
true
;
}
return
false
;
}
}
}
yifu-common/yifu-common-core/src/main/java/com/yifu.cloud.plus.v1/yifu/common/core/exception/ErrorCodes.java
View file @
9864817b
...
@@ -296,7 +296,7 @@ public interface ErrorCodes {
...
@@ -296,7 +296,7 @@ public interface ErrorCodes {
*/
*/
String
ARCHIVES_PROJECT_CHANGE_NOT_EXIST
=
"archives.project.change.not.exist"
;
String
ARCHIVES_PROJECT_CHANGE_NOT_EXIST
=
"archives.project.change.not.exist"
;
/**
/**
*
存在其他草稿/已审核的状态的项目,不允许同步减档
*
该人员存在其他进行中的项目,禁止同步减档!
*/
*/
String
QT_PROJECT_CHANGE_NOT_EXIST
=
"qt.project.change.not.exist"
;
String
QT_PROJECT_CHANGE_NOT_EXIST
=
"qt.project.change.not.exist"
;
/**
/**
...
...
yifu-common/yifu-common-core/src/main/resources/i18n/messages_zh_CN.properties
View file @
9864817b
...
@@ -98,7 +98,7 @@ archives.project.change.not.exist=\u4EBA\u5458\u5728\u8BE5\u9879\u76EE\u4E0B\u5B
...
@@ -98,7 +98,7 @@ archives.project.change.not.exist=\u4EBA\u5458\u5728\u8BE5\u9879\u76EE\u4E0B\u5B
archives.project.emp.lose.fee.not.empty
=
\u
4E0D
\u
826F
\u
8BB0
\u
5F55
\u
8D39
\u7528\u
635F
\u5931\u
548C
\u5176\u
4ED6
\u
635F
\u5931\u
4E0D
\u
53EF
\u
540C
\u
65F6
\u
4E3A
\u
7A7A
archives.project.emp.lose.fee.not.empty
=
\u
4E0D
\u
826F
\u
8BB0
\u
5F55
\u
8D39
\u7528\u
635F
\u5931\u
548C
\u5176\u
4ED6
\u
635F
\u5931\u
4E0D
\u
53EF
\u
540C
\u
65F6
\u
4E3A
\u
7A7A
qt.project.change.not.exist
=
\u
5B58
\u5728\u5176\u
4ED6
\u8349\u
7A3F/
\u
5DF2
\u
5BA1
\u6838\u7684\u
72B6
\u6001\u7684\u9879\u
76EE
\u
FF0C
\u
4E0D
\u5141\u
8BB8
\u
540C
\u
6B65
\u
51CF
\u6863
qt.project.change.not.exist
=
\u
8BE5
\u
4EBA
\u5458\u
5B58
\u5728\u5176\u
4ED6
\u
8FDB
\u
884C
\u
4E2D
\u7684\u9879\u
76EE
\u
FF0C
\u7981\u
6B62
\u
540C
\u
6B65
\u
51CF
\u6863
project.search.not.exist
=
\u
672A
\u
627E
\u5230\u
5BF9
\u
5E94
\u7684\u9879\u
76EE
\u
FF0C
\u
8BF7
\u6838\u
5B9E
project.search.not.exist
=
\u
672A
\u
627E
\u5230\u
5BF9
\u
5E94
\u7684\u9879\u
76EE
\u
FF0C
\u
8BF7
\u6838\u
5B9E
change.strat.month.exit
=
\u5212\u
8F6C
\u
8D77
\u
59CB
\u6708\u
4E0D
\u
80FD
\u
4E3A
\u
7A7A
change.strat.month.exit
=
\u5212\u
8F6C
\u
8D77
\u
59CB
\u6708\u
4E0D
\u
80FD
\u
4E3A
\u
7A7A
...
...
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