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
4800c3a1
Commit
4800c3a1
authored
Dec 12, 2022
by
fangxinjiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MVP1.2:项目档案-减档逻辑调整
parent
413d02a4
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
62 additions
and
21 deletions
+62
-21
TEmployeeProject.java
.../cloud/plus/v1/yifu/archives/entity/TEmployeeProject.java
+3
-0
TEmployeeProjectServiceImpl.java
...fu/archives/service/impl/TEmployeeProjectServiceImpl.java
+55
-21
ErrorCodes.java
.../cloud/plus/v1/yifu/common/core/exception/ErrorCodes.java
+4
-0
No files found.
yifu-archives/yifu-archives-api/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/entity/TEmployeeProject.java
View file @
4800c3a1
...
...
@@ -366,6 +366,9 @@ public class TEmployeeProject extends BaseEntity {
/**
* 员工合同状态(字典)
* 0 无合同
* 2 不在用
* 1 在用
*/
@Schema
(
description
=
"员工合同状态(字典)0初始状态"
)
@ExcelAttribute
(
name
=
"合同状态"
,
isDataId
=
true
,
dataType
=
ExcelAttributeConstants
.
PERSONNEL_STATE
)
...
...
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/service/impl/TEmployeeProjectServiceImpl.java
View file @
4800c3a1
...
...
@@ -31,9 +31,11 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.yifu.cloud.plus.v1.yifu.archives.constants.EmployeeConstants
;
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.entity.TSettleDomain
;
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.TEmployeeLogService
;
...
...
@@ -87,6 +89,9 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
@Autowired
private
TSettleDomainService
tSettleDomainService
;
@Autowired
private
TEmployeeContractInfoMapper
contractInfoMapper
;
@Autowired
@Lazy
private
DoJointTask
doJointTask
;
...
...
@@ -389,10 +394,23 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
TEmployeeProject
tEmployeeProjectOld
=
this
.
getById
(
tEmployeeProject
.
getId
());
String
code
=
""
;
if
(
CommonConstants
.
ONE_INT
==
tEmployeeProject
.
getSocialStatus
()
||
CommonConstants
.
ONE_INT
==
tEmployeeProject
.
getFundStatus
()
||
CommonConstants
.
ZERO_INT
!=
tEmployeeProject
.
getInsuranceStatus
())
{
||
CommonConstants
.
ONE_INT
==
tEmployeeProject
.
getFundStatus
())
{
return
R
.
failed
(
"人员在该项目下存在进行中/未完结的服务"
);
}
// 未作废,在用 或 审核中
long
contractCount
=
contractInfoMapper
.
selectCount
(
Wrappers
.<
TEmployeeContractInfo
>
query
().
lambda
()
.
eq
(
TEmployeeContractInfo:
:
getEmpIdcard
,
tEmployeeProject
.
getEmpIdcard
())
.
eq
(
TEmployeeContractInfo:
:
getIsObsolete
,
CommonConstants
.
ZERO_STRING
)
.
eq
(
TEmployeeContractInfo:
:
getDeleteFlag
,
CommonConstants
.
ZERO_STRING
)
.
and
(
obj
->
obj
.
eq
(
TEmployeeContractInfo:
:
getInUse
,
CommonConstants
.
ZERO_STRING
))
.
or
()
.
eq
(
TEmployeeContractInfo:
:
getAuditStatus
,
CommonConstants
.
ZERO_STRING
)
.
or
()
.
eq
(
TEmployeeContractInfo:
:
getAuditStatus
,
CommonConstants
.
ONE_STRING
)
);
if
(
contractCount
>
CommonConstants
.
ZERO_INT
){
return
R
.
failed
(
ErrorCodes
.
ARCHIVES_PROJECT_CHANGE_CONTRACT_EXIST
);
}
tEmployeeProject
.
setProjectStatus
(
CommonConstants
.
dingleDigitIntArray
[
1
]);
tEmployeeProject
.
setLeaveTime
(
LocalDateTime
.
now
());
this
.
updateById
(
tEmployeeProject
);
...
...
@@ -530,6 +548,8 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
TEmployeeProject
tEmployeeProject
;
TEmployeeInfo
tEmployeeInfo
;
TEmployeeProject
tEmployeeProjectOld
;
// 在途和在用合同数目
long
contractCount
;
// 执行数据插入操作 组装 PostDto
for
(
EmployeeXProjectVO
excel
:
excelVOList
)
{
//根据身份证和项目编码获取项目档案
...
...
@@ -557,29 +577,43 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
errorMessage
.
append
(
";"
);
}
if
(
Common
.
isNotNull
(
tEmployeeProject
))
{
if
(
tEmployeeProject
.
getInsuranceStatus
()
!=
CommonConstants
.
dingleDigitIntArray
[
0
]
||
tEmployeeProject
.
getSocialStatus
()
==
CommonConstants
.
dingleDigitIntArray
[
1
]
||
if
(
tEmployeeProject
.
getSocialStatus
()
==
CommonConstants
.
dingleDigitIntArray
[
1
]
||
tEmployeeProject
.
getFundStatus
()
==
CommonConstants
.
dingleDigitIntArray
[
1
])
{
errorMessageList
.
add
(
new
ErrorMessage
(
excel
.
getRowIndex
(),
errorMessage
+
MsgUtils
.
getMessage
(
ErrorCodes
.
ARCHIVES_PROJECT_CHANGE_NOT_EXIST
)));
}
else
{
tEmployeeProjectOld
=
this
.
getById
(
tEmployeeProject
.
getId
());
tEmployeeProject
.
setProjectStatus
(
CommonConstants
.
dingleDigitIntArray
[
1
]);
tEmployeeProject
.
setLeaveReason
(
excel
.
getLeaveReason
());
tEmployeeProject
.
setLeaveRemark
(
excel
.
getLeaveRemark
());
tEmployeeProject
.
setLeaveTime
(
LocalDateTime
.
now
());
updProjectList
.
add
(
tEmployeeProject
);
newOldProject
=
new
EmployeeProjectNewOldVO
();
newOldProject
.
setOldProjectEmployee
(
tEmployeeProjectOld
);
newOldProject
.
setNewProjectEmployee
(
tEmployeeProject
);
updateProjectList
.
add
(
newOldProject
);
tEmployeeInfo
=
tEmployeeInfoMapper
.
selectById
(
tEmployeeProject
.
getEmpId
());
//从剩下的项目档案中查找员工类型并更新
updList
.
add
(
tEmployeeInfo
);
break
;
}
// 未作废,在用 或 审核中
contractCount
=
contractInfoMapper
.
selectCount
(
Wrappers
.<
TEmployeeContractInfo
>
query
().
lambda
()
.
eq
(
TEmployeeContractInfo:
:
getEmpIdcard
,
tEmployeeProject
.
getEmpIdcard
())
.
eq
(
TEmployeeContractInfo:
:
getIsObsolete
,
CommonConstants
.
ZERO_STRING
)
.
eq
(
TEmployeeContractInfo:
:
getDeleteFlag
,
CommonConstants
.
ZERO_STRING
)
.
and
(
obj
->
obj
.
eq
(
TEmployeeContractInfo:
:
getInUse
,
CommonConstants
.
ZERO_STRING
))
.
or
()
.
eq
(
TEmployeeContractInfo:
:
getAuditStatus
,
CommonConstants
.
ZERO_STRING
)
.
or
()
.
eq
(
TEmployeeContractInfo:
:
getAuditStatus
,
CommonConstants
.
ONE_STRING
)
);
if
(
contractCount
>
CommonConstants
.
ZERO_INT
){
errorMessageList
.
add
(
new
ErrorMessage
(
excel
.
getRowIndex
(),
errorMessage
+
MsgUtils
.
getMessage
(
ErrorCodes
.
ARCHIVES_PROJECT_CHANGE_CONTRACT_EXIST
)));
break
;
}
tEmployeeProjectOld
=
this
.
getById
(
tEmployeeProject
.
getId
());
tEmployeeProject
.
setProjectStatus
(
CommonConstants
.
dingleDigitIntArray
[
1
]);
tEmployeeProject
.
setLeaveReason
(
excel
.
getLeaveReason
());
tEmployeeProject
.
setLeaveRemark
(
excel
.
getLeaveRemark
());
tEmployeeProject
.
setLeaveTime
(
LocalDateTime
.
now
());
updProjectList
.
add
(
tEmployeeProject
);
newOldProject
=
new
EmployeeProjectNewOldVO
();
newOldProject
.
setOldProjectEmployee
(
tEmployeeProjectOld
);
newOldProject
.
setNewProjectEmployee
(
tEmployeeProject
);
updateProjectList
.
add
(
newOldProject
);
tEmployeeInfo
=
tEmployeeInfoMapper
.
selectById
(
tEmployeeProject
.
getEmpId
());
//从剩下的项目档案中查找员工类型并更新
updList
.
add
(
tEmployeeInfo
);
}
else
{
errorMessageList
.
add
(
new
ErrorMessage
(
excel
.
getRowIndex
(),
errorMessage
+
MsgUtils
.
getMessage
(
ErrorCodes
.
PROJECT_PERSON_SEARCH_EXIT
)));
...
...
yifu-common/yifu-common-core/src/main/java/com/yifu/cloud/plus/v1/yifu/common/core/exception/ErrorCodes.java
View file @
4800c3a1
...
...
@@ -299,6 +299,10 @@ public interface ErrorCodes {
* 人员在该项目下存在进行中/未完结的服务
*/
String
ARCHIVES_PROJECT_CHANGE_NOT_EXIST
=
"archives.project.change.not.exist"
;
/**
* 人员在该项目下存在存在在用或待审核、待提交的合同,不允许减项
*/
String
ARCHIVES_PROJECT_CHANGE_CONTRACT_EXIST
=
"archives.project.change.contract.exist"
;
/**
* 人员在原项目中存在在途的服务,请先终止后,再进行划转
*/
...
...
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