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
7463f806
Commit
7463f806
authored
Aug 02, 2022
by
李灿灿
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
【商险-投保-替换】替换逻辑变更
parent
45129435
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
73 additions
and
1 deletion
+73
-1
TInsuranceDetail.java
...loud/plus/v1/yifu/insurances/entity/TInsuranceDetail.java
+1
-0
TInsuranceDetailServiceImpl.java
.../insurances/service/impl/TInsuranceDetailServiceImpl.java
+72
-1
No files found.
yifu-insurances/yifu-insurances-api/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/entity/TInsuranceDetail.java
View file @
7463f806
...
@@ -248,6 +248,7 @@ public class TInsuranceDetail extends BaseEntity {
...
@@ -248,6 +248,7 @@ public class TInsuranceDetail extends BaseEntity {
* 是否有效 0有效 1无效
* 是否有效 0有效 1无效
*/
*/
@Schema
(
description
=
"是否有效 0有效 1无效"
)
@Schema
(
description
=
"是否有效 0有效 1无效"
)
@TableField
(
updateStrategy
=
FieldStrategy
.
IGNORED
)
private
Integer
isEffect
;
private
Integer
isEffect
;
/**
/**
...
...
yifu-insurances/yifu-insurances-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/service/impl/TInsuranceDetailServiceImpl.java
View file @
7463f806
...
@@ -403,6 +403,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
...
@@ -403,6 +403,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
return
R
.
failed
(
InsurancesConstants
.
DATA_IS_NOT_EXIST
);
return
R
.
failed
(
InsurancesConstants
.
DATA_IS_NOT_EXIST
);
}
}
if
(
byId
.
getBuyHandleStatus
()
==
CommonConstants
.
FOUR_INT
&&
byId
.
getBuyType
()
!=
CommonConstants
.
FOUR_INT
){
if
(
byId
.
getBuyHandleStatus
()
==
CommonConstants
.
FOUR_INT
&&
byId
.
getBuyType
()
!=
CommonConstants
.
FOUR_INT
){
//新增、批增的编辑逻辑
// 身份证号位数校验(18 位合法)
// 身份证号位数校验(18 位合法)
if
(!
ValidityUtil
.
validateIDCard
(
param
.
getEmpIdcardNo
())){
if
(!
ValidityUtil
.
validateIDCard
(
param
.
getEmpIdcardNo
())){
return
R
.
failed
(
InsurancesConstants
.
EMP_IDCARD_NO_NOT_LEGITIMATE
);
return
R
.
failed
(
InsurancesConstants
.
EMP_IDCARD_NO_NOT_LEGITIMATE
);
...
@@ -554,7 +556,55 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
...
@@ -554,7 +556,55 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
byId
.
setUpdateBy
(
user
.
getId
());
byId
.
setUpdateBy
(
user
.
getId
());
byId
.
setUpdateTime
(
LocalDateTime
.
now
());
byId
.
setUpdateTime
(
LocalDateTime
.
now
());
this
.
updateById
(
byId
);
this
.
updateById
(
byId
);
}
else
{
}
else
if
(
byId
.
getBuyHandleStatus
()
==
CommonConstants
.
FOUR_INT
&&
byId
.
getBuyType
()
==
CommonConstants
.
FOUR_INT
){
//替换的编辑逻辑
// 身份证号位数校验(18 位合法)
if
(!
ValidityUtil
.
validateIDCard
(
param
.
getEmpIdcardNo
())){
return
R
.
failed
(
InsurancesConstants
.
EMP_IDCARD_NO_NOT_LEGITIMATE
);
}
//校验身份合法
/*TCheckIdCard checkIdCard = new TCheckIdCard();
checkIdCard.setName(param.getEmpName());
checkIdCard.setIdCard(param.getEmpIdcardNo());
R<TCheckIdCard> tCheckIdCardR = checkDaprUtil.checkIdCardSingle(checkIdCard);
if (null != tCheckIdCardR && tCheckIdCardR.getCode() == CommonConstants.SUCCESS){
TCheckIdCard data = tCheckIdCardR.getData();
if (CommonConstants.ONE_INT != data.getIsTrue()){
return R.failed(InsurancesConstants.EMP_ID_CARD_NO_NOT_FIT);
}
}*/
TInsuranceReplace
one
=
tInsuranceReplaceService
.
getOne
(
Wrappers
.<
TInsuranceReplace
>
query
().
lambda
()
.
eq
(
TInsuranceReplace:
:
getToInsuranceDetailId
,
byId
.
getId
())
.
last
(
CommonConstants
.
LAST_ONE_SQL
));
if
(
Optional
.
ofNullable
(
one
).
isPresent
()){
TInsuranceDetail
insuranceDetail
=
this
.
getById
(
one
.
getFromInsuranceDetailId
());
if
(
Optional
.
ofNullable
(
insuranceDetail
).
isPresent
()){
if
(
insuranceDetail
.
getIsUse
()
==
CommonConstants
.
ONE_INT
){
return
R
.
failed
(
"员工"
+
insuranceDetail
.
getEmpName
()+
"的投保记录已出险,无法替换"
);
}
if
(
insuranceDetail
.
getIsEffect
()
==
CommonConstants
.
ONE_INT
){
return
R
.
failed
(
"员工"
+
insuranceDetail
.
getEmpName
()+
"的投保记录无效,无法替换"
);
}
//被替换者无效
insuranceDetail
.
setIsEffect
(
CommonConstants
.
ONE_INT
);
this
.
updateById
(
insuranceDetail
);
//替换记录成功
one
.
setReplaceStatus
(
CommonConstants
.
ONE_INT
);
tInsuranceReplaceService
.
updateById
(
one
);
//替换状态下目前只能编辑姓名、身份证号
//投保状态:待投保
byId
.
setBuyHandleStatus
(
CommonConstants
.
ONE_INT
);
byId
.
setEmpName
(
param
.
getEmpName
());
byId
.
setEmpIdcardNo
(
param
.
getEmpIdcardNo
());
byId
.
setUpdateBy
(
user
.
getId
());
byId
.
setUpdateTime
(
LocalDateTime
.
now
());
this
.
updateById
(
byId
);
}
}
}
else
{
return
R
.
failed
(
InsurancesConstants
.
EDIT_NOT_ALLOW
);
return
R
.
failed
(
InsurancesConstants
.
EDIT_NOT_ALLOW
);
}
}
//操作记录
//操作记录
...
@@ -680,6 +730,27 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
...
@@ -680,6 +730,27 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
listVO
.
setErrorMessage
(
InsurancesConstants
.
REDUCE_ROLLBACK_REDUCE_IS_NOT_ALLOW
);
listVO
.
setErrorMessage
(
InsurancesConstants
.
REDUCE_ROLLBACK_REDUCE_IS_NOT_ALLOW
);
errorList
.
add
(
listVO
);
errorList
.
add
(
listVO
);
}
else
{
}
else
{
//判断是否是替换类型的退回,如果是,需要将被替换者激活,替换者有效状态为空
if
(
detail
.
getBuyType
()
==
CommonConstants
.
FOUR_INT
){
//替换者有效状态为空
detail
.
setIsEffect
(
null
);
TInsuranceReplace
one
=
tInsuranceReplaceService
.
getOne
(
Wrappers
.<
TInsuranceReplace
>
query
().
lambda
()
.
eq
(
TInsuranceReplace:
:
getToInsuranceDetailId
,
detail
.
getId
())
.
last
(
CommonConstants
.
LAST_ONE_SQL
));
if
(
Optional
.
ofNullable
(
one
).
isPresent
()){
//替换记录变为失败
one
.
setReplaceStatus
(
CommonConstants
.
ZERO_INT
);
tInsuranceReplaceService
.
updateById
(
one
);
TInsuranceDetail
byId
=
this
.
getById
(
one
.
getFromInsuranceDetailId
());
if
(
Optional
.
ofNullable
(
byId
).
isPresent
()){
//被替换者激活
byId
.
setIsEffect
(
CommonConstants
.
ZERO_INT
);
this
.
updateById
(
byId
);
}
}
}
// 记录状态置为「退回」
// 记录状态置为「退回」
detail
.
setBuyHandleStatus
(
CommonConstants
.
FOUR_INT
);
detail
.
setBuyHandleStatus
(
CommonConstants
.
FOUR_INT
);
detail
.
setUpdateBy
(
user
.
getId
());
detail
.
setUpdateBy
(
user
.
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