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
7275d6e4
Commit
7275d6e4
authored
Nov 07, 2022
by
李灿灿
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
20221107 要求允许同一个人同时存在多个不同的在保信息(去掉时间区间校验)
parent
89b2e8df
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
122 deletions
+10
-122
TInsuranceDetailServiceImpl.java
...s/service/insurance/impl/TInsuranceDetailServiceImpl.java
+10
-122
No files found.
yifu-insurances/yifu-insurances-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/service/insurance/impl/TInsuranceDetailServiceImpl.java
View file @
7275d6e4
...
@@ -657,7 +657,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
...
@@ -657,7 +657,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
}
}
}
}
}
}
//记录查重校验:姓名 + 身份证号 + 保险公司 + 险种 + 保单开始日期~保单结束日期
区间
是唯一(剔除退回、过期状态的记录)
//记录查重校验:姓名 + 身份证号 + 保险公司 + 险种 + 保单开始日期~保单结束日期 是唯一(剔除退回、过期状态的记录)
//待投保、投保中、已投保(有效、未过期)
//待投保、投保中、已投保(有效、未过期)
Set
<
Integer
>
setRStatus
=
Sets
.
newHashSet
();
Set
<
Integer
>
setRStatus
=
Sets
.
newHashSet
();
setRStatus
.
add
(
CommonConstants
.
FOUR_INT
);
setRStatus
.
add
(
CommonConstants
.
FOUR_INT
);
...
@@ -687,43 +687,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
...
@@ -687,43 +687,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
if
(
Optional
.
ofNullable
(
insuranceDetail
).
isPresent
()
&&
!
insuranceDetail
.
getId
().
equals
(
param
.
getId
())){
if
(
Optional
.
ofNullable
(
insuranceDetail
).
isPresent
()
&&
!
insuranceDetail
.
getId
().
equals
(
param
.
getId
())){
return
R
.
failed
(
InsurancesConstants
.
DATA_IS_EXIST
);
return
R
.
failed
(
InsurancesConstants
.
DATA_IS_EXIST
);
}
}
//时间区间
TInsuranceDetail
insuranceDetailBetween
=
this
.
baseMapper
.
selectOne
(
Wrappers
.<
TInsuranceDetail
>
query
().
lambda
()
.
eq
(
TInsuranceDetail:
:
getEmpName
,
param
.
getEmpName
())
.
eq
(
TInsuranceDetail:
:
getEmpIdcardNo
,
param
.
getEmpIdcardNo
())
.
eq
(
TInsuranceDetail:
:
getInsuranceCompanyName
,
param
.
getInsuranceCompanyName
())
.
eq
(
TInsuranceDetail:
:
getInsuranceTypeName
,
param
.
getInsuranceTypeName
())
.
notIn
(
TInsuranceDetail:
:
getBuyHandleStatus
,
setRStatus
)
.
eq
(
TInsuranceDetail:
:
getDeleteFlag
,
CommonConstants
.
ZERO_INT
)
.
and
(
wrapper
->
wrapper
.
and
(
s
->
s
.
le
(
TInsuranceDetail:
:
getPolicyStart
,
LocalDateUtil
.
parseLocalDate
(
param
.
getPolicyStart
()))
.
ge
(
TInsuranceDetail:
:
getPolicyEnd
,
LocalDateUtil
.
parseLocalDate
(
param
.
getPolicyStart
()))
)
.
or
(
e
->
e
.
le
(
TInsuranceDetail:
:
getPolicyStart
,
LocalDateUtil
.
parseLocalDate
(
param
.
getPolicyEnd
()))
.
ge
(
TInsuranceDetail:
:
getPolicyEnd
,
LocalDateUtil
.
parseLocalDate
(
param
.
getPolicyEnd
())))
.
or
(
s
->
s
.
ge
(
TInsuranceDetail:
:
getPolicyStart
,
LocalDateUtil
.
parseLocalDate
(
param
.
getPolicyStart
()))
.
le
(
TInsuranceDetail:
:
getPolicyStart
,
LocalDateUtil
.
parseLocalDate
(
param
.
getPolicyEnd
())))
.
or
(
s
->
s
.
ge
(
TInsuranceDetail:
:
getPolicyEnd
,
LocalDateUtil
.
parseLocalDate
(
param
.
getPolicyStart
()))
.
le
(
TInsuranceDetail:
:
getPolicyEnd
,
LocalDateUtil
.
parseLocalDate
(
param
.
getPolicyEnd
())))
)
//有效
.
and
(
wrapper
->
wrapper
.
eq
(
TInsuranceDetail:
:
getIsEffect
,
CommonConstants
.
ZERO_INT
)
.
or
().
isNull
(
TInsuranceDetail:
:
getIsEffect
)
)
//未过期
.
and
(
wrapper
->
wrapper
.
eq
(
TInsuranceDetail:
:
getIsOverdue
,
CommonConstants
.
ZERO_INT
)
.
or
().
isNull
(
TInsuranceDetail:
:
getIsOverdue
)
)
.
orderByDesc
(
TInsuranceDetail:
:
getUpdateTime
)
.
last
(
CommonConstants
.
LAST_ONE_SQL
)
);
if
(
Optional
.
ofNullable
(
insuranceDetailBetween
).
isPresent
()
&&
!
insuranceDetailBetween
.
getId
().
equals
(
param
.
getId
())){
return
R
.
failed
(
"当前员工在["
+
insuranceDetailBetween
.
getPolicyStart
()+
"-"
+
insuranceDetailBetween
.
getPolicyEnd
()+
"]期间内有投保记录"
);
}
BeanCopyUtils
.
copyProperties
(
param
,
byId
);
BeanCopyUtils
.
copyProperties
(
param
,
byId
);
//投保状态:待投保
//投保状态:待投保
byId
.
setBuyHandleStatus
(
CommonConstants
.
ONE_INT
);
byId
.
setBuyHandleStatus
(
CommonConstants
.
ONE_INT
);
...
@@ -1924,14 +1887,16 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
...
@@ -1924,14 +1887,16 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
continue
;
continue
;
}
}
//表内数据重复 员工姓名、员工身份证号码、保险公司、险种、起止时间
(有交叉)
//表内数据重复 员工姓名、员工身份证号码、保险公司、险种、起止时间
for
(
int
j
=
0
;
j
<
distinctList
.
size
();
j
++)
{
for
(
int
j
=
0
;
j
<
distinctList
.
size
();
j
++)
{
InsuranceAddParam
repeat
=
distinctList
.
get
(
j
);
InsuranceAddParam
repeat
=
distinctList
.
get
(
j
);
if
(
param
.
getEmpName
().
equals
(
repeat
.
getEmpName
())
if
(
param
.
getEmpName
().
equals
(
repeat
.
getEmpName
())
&&
param
.
getEmpIdcardNo
().
equals
(
repeat
.
getEmpIdcardNo
())
&&
param
.
getEmpIdcardNo
().
equals
(
repeat
.
getEmpIdcardNo
())
&&
param
.
getInsuranceCompanyName
().
equals
(
repeat
.
getInsuranceCompanyName
())
&&
param
.
getInsuranceCompanyName
().
equals
(
repeat
.
getInsuranceCompanyName
())
&&
param
.
getInsuranceTypeName
().
equals
(
repeat
.
getInsuranceTypeName
())
&&
param
.
getInsuranceTypeName
().
equals
(
repeat
.
getInsuranceTypeName
())
&&
LocalDateUtil
.
hasOverlap
(
LocalDateUtil
.
parseLocalDate
(
param
.
getPolicyStart
()),
LocalDateUtil
.
parseLocalDate
(
param
.
getPolicyEnd
()),
LocalDateUtil
.
parseLocalDate
(
repeat
.
getPolicyStart
()),
LocalDateUtil
.
parseLocalDate
(
repeat
.
getPolicyEnd
()))
//20221107 现在需求要求允许同一个人同时存在多个不同的在保信息
//&& LocalDateUtil.hasOverlap(LocalDateUtil.parseLocalDate(param.getPolicyStart()),LocalDateUtil.parseLocalDate(param.getPolicyEnd()),LocalDateUtil.parseLocalDate(repeat.getPolicyStart()),LocalDateUtil.parseLocalDate(repeat.getPolicyEnd()))
&&
param
.
getPolicyStart
().
equals
(
repeat
.
getPolicyStart
())
&&
param
.
getPolicyEnd
().
equals
(
repeat
.
getPolicyEnd
())
&&
i
!=
j
){
&&
i
!=
j
){
param
.
setErrorMessage
(
InsurancesConstants
.
DUPLICATE_DATA_ERROR
);
param
.
setErrorMessage
(
InsurancesConstants
.
DUPLICATE_DATA_ERROR
);
listResult
.
add
(
param
);
listResult
.
add
(
param
);
...
@@ -2112,7 +2077,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
...
@@ -2112,7 +2077,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
continue
;
continue
;
}
}
//记录查重校验:姓名 + 身份证号 + 保险公司 + 险种 + 保单开始日期~保单结束日期
区间
是唯一(剔除退回、过期状态的记录)
//记录查重校验:姓名 + 身份证号 + 保险公司 + 险种 + 保单开始日期~保单结束日期 是唯一(剔除退回、过期状态的记录)
//待投保、投保中、已投保(有效、未过期)
//待投保、投保中、已投保(有效、未过期)
Set
<
Integer
>
setRStatus
=
Sets
.
newHashSet
();
Set
<
Integer
>
setRStatus
=
Sets
.
newHashSet
();
setRStatus
.
add
(
CommonConstants
.
FOUR_INT
);
setRStatus
.
add
(
CommonConstants
.
FOUR_INT
);
...
@@ -2144,46 +2109,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
...
@@ -2144,46 +2109,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
continue
;
continue
;
}
}
//时间区间
TInsuranceDetail
insuranceDetailBetween
=
this
.
baseMapper
.
selectOne
(
Wrappers
.<
TInsuranceDetail
>
query
().
lambda
()
.
eq
(
TInsuranceDetail:
:
getEmpName
,
param
.
getEmpName
())
.
eq
(
TInsuranceDetail:
:
getEmpIdcardNo
,
param
.
getEmpIdcardNo
())
.
eq
(
TInsuranceDetail:
:
getInsuranceCompanyName
,
param
.
getInsuranceCompanyName
())
.
eq
(
TInsuranceDetail:
:
getInsuranceTypeName
,
param
.
getInsuranceTypeName
())
.
notIn
(
TInsuranceDetail:
:
getBuyHandleStatus
,
setRStatus
)
.
eq
(
TInsuranceDetail:
:
getDeleteFlag
,
CommonConstants
.
ZERO_INT
)
.
and
(
wrapper
->
wrapper
.
and
(
s
->
s
.
le
(
TInsuranceDetail:
:
getPolicyStart
,
LocalDateUtil
.
parseLocalDate
(
param
.
getPolicyStart
()))
.
ge
(
TInsuranceDetail:
:
getPolicyEnd
,
LocalDateUtil
.
parseLocalDate
(
param
.
getPolicyStart
()))
)
.
or
(
e
->
e
.
le
(
TInsuranceDetail:
:
getPolicyStart
,
LocalDateUtil
.
parseLocalDate
(
param
.
getPolicyEnd
()))
.
ge
(
TInsuranceDetail:
:
getPolicyEnd
,
LocalDateUtil
.
parseLocalDate
(
param
.
getPolicyEnd
())))
.
or
(
s
->
s
.
ge
(
TInsuranceDetail:
:
getPolicyStart
,
LocalDateUtil
.
parseLocalDate
(
param
.
getPolicyStart
()))
.
le
(
TInsuranceDetail:
:
getPolicyStart
,
LocalDateUtil
.
parseLocalDate
(
param
.
getPolicyEnd
())))
.
or
(
s
->
s
.
ge
(
TInsuranceDetail:
:
getPolicyEnd
,
LocalDateUtil
.
parseLocalDate
(
param
.
getPolicyStart
()))
.
le
(
TInsuranceDetail:
:
getPolicyEnd
,
LocalDateUtil
.
parseLocalDate
(
param
.
getPolicyEnd
())))
)
//有效
.
and
(
wrapper
->
wrapper
.
eq
(
TInsuranceDetail:
:
getIsEffect
,
CommonConstants
.
ZERO_INT
)
.
or
().
isNull
(
TInsuranceDetail:
:
getIsEffect
)
)
//未过期
.
and
(
wrapper
->
wrapper
.
eq
(
TInsuranceDetail:
:
getIsOverdue
,
CommonConstants
.
ZERO_INT
)
.
or
().
isNull
(
TInsuranceDetail:
:
getIsOverdue
)
)
.
orderByDesc
(
TInsuranceDetail:
:
getUpdateTime
)
.
last
(
CommonConstants
.
LAST_ONE_SQL
)
);
if
(
Optional
.
ofNullable
(
insuranceDetailBetween
).
isPresent
()){
param
.
setErrorMessage
(
"当前员工在["
+
insuranceDetailBetween
.
getPolicyStart
()+
"-"
+
insuranceDetailBetween
.
getPolicyEnd
()+
"]期间内有投保记录"
);
listResult
.
add
(
param
);
continue
;
}
listSuccess
.
add
(
param
);
listSuccess
.
add
(
param
);
}
}
map
.
put
(
"listResult"
,
listResult
);
map
.
put
(
"listResult"
,
listResult
);
...
@@ -2685,14 +2610,16 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
...
@@ -2685,14 +2610,16 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
continue
;
continue
;
}
}
//表内数据重复 员工姓名、员工身份证号码、保险公司、险种、起止时间
(有交叉)
//表内数据重复 员工姓名、员工身份证号码、保险公司、险种、起止时间
for
(
int
j
=
0
;
j
<
distinctList
.
size
();
j
++)
{
for
(
int
j
=
0
;
j
<
distinctList
.
size
();
j
++)
{
InsuranceReplaceParam
repeat
=
distinctList
.
get
(
j
);
InsuranceReplaceParam
repeat
=
distinctList
.
get
(
j
);
if
(((
param
.
getEmpName
().
equals
(
repeat
.
getEmpName
())
&&
param
.
getEmpIdcardNo
().
equals
(
repeat
.
getEmpIdcardNo
()))
if
(((
param
.
getEmpName
().
equals
(
repeat
.
getEmpName
())
&&
param
.
getEmpIdcardNo
().
equals
(
repeat
.
getEmpIdcardNo
()))
||(
param
.
getReplaceEmpName
().
equals
(
repeat
.
getReplaceEmpName
())
&&
param
.
getReplaceEmpIdcardNo
().
equals
(
repeat
.
getReplaceEmpIdcardNo
())))
||(
param
.
getReplaceEmpName
().
equals
(
repeat
.
getReplaceEmpName
())
&&
param
.
getReplaceEmpIdcardNo
().
equals
(
repeat
.
getReplaceEmpIdcardNo
())))
&&
param
.
getInsuranceCompanyName
().
equals
(
repeat
.
getInsuranceCompanyName
())
&&
param
.
getInsuranceCompanyName
().
equals
(
repeat
.
getInsuranceCompanyName
())
&&
param
.
getInsuranceTypeName
().
equals
(
repeat
.
getInsuranceTypeName
())
&&
param
.
getInsuranceTypeName
().
equals
(
repeat
.
getInsuranceTypeName
())
&&
LocalDateUtil
.
hasOverlap
(
LocalDateUtil
.
parseLocalDate
(
param
.
getPolicyStart
()),
LocalDateUtil
.
parseLocalDate
(
param
.
getPolicyEnd
()),
LocalDateUtil
.
parseLocalDate
(
repeat
.
getPolicyStart
()),
LocalDateUtil
.
parseLocalDate
(
repeat
.
getPolicyEnd
()))
//20221107 现在需求要求允许同一个人同时存在多个不同的在保信息
//&& LocalDateUtil.hasOverlap(LocalDateUtil.parseLocalDate(param.getPolicyStart()),LocalDateUtil.parseLocalDate(param.getPolicyEnd()),LocalDateUtil.parseLocalDate(repeat.getPolicyStart()),LocalDateUtil.parseLocalDate(repeat.getPolicyEnd()))
&&
param
.
getPolicyStart
().
equals
(
repeat
.
getPolicyStart
())
&&
param
.
getPolicyEnd
().
equals
(
repeat
.
getPolicyEnd
())
&&
i
!=
j
){
&&
i
!=
j
){
param
.
setErrorMessage
(
InsurancesConstants
.
DUPLICATE_DATA_ERROR
);
param
.
setErrorMessage
(
InsurancesConstants
.
DUPLICATE_DATA_ERROR
);
listResult
.
add
(
param
);
listResult
.
add
(
param
);
...
@@ -2875,45 +2802,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
...
@@ -2875,45 +2802,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
listResult
.
add
(
param
);
listResult
.
add
(
param
);
continue
;
continue
;
}
}
//时间区间
TInsuranceDetail
insuranceDetailBetween
=
this
.
baseMapper
.
selectOne
(
Wrappers
.<
TInsuranceDetail
>
query
().
lambda
()
.
eq
(
TInsuranceDetail:
:
getEmpName
,
param
.
getReplaceEmpName
())
.
eq
(
TInsuranceDetail:
:
getEmpIdcardNo
,
param
.
getReplaceEmpIdcardNo
())
.
eq
(
TInsuranceDetail:
:
getInsuranceCompanyName
,
param
.
getInsuranceCompanyName
())
.
eq
(
TInsuranceDetail:
:
getInsuranceTypeName
,
param
.
getInsuranceTypeName
())
.
notIn
(
TInsuranceDetail:
:
getBuyHandleStatus
,
setRStatus
)
.
eq
(
TInsuranceDetail:
:
getDeleteFlag
,
CommonConstants
.
ZERO_INT
)
.
and
(
wrapper
->
wrapper
.
and
(
s
->
s
.
le
(
TInsuranceDetail:
:
getPolicyStart
,
LocalDateUtil
.
parseLocalDate
(
param
.
getPolicyStart
()))
.
ge
(
TInsuranceDetail:
:
getPolicyEnd
,
LocalDateUtil
.
parseLocalDate
(
param
.
getPolicyStart
()))
)
.
or
(
e
->
e
.
le
(
TInsuranceDetail:
:
getPolicyStart
,
LocalDateUtil
.
parseLocalDate
(
param
.
getPolicyEnd
()))
.
ge
(
TInsuranceDetail:
:
getPolicyEnd
,
LocalDateUtil
.
parseLocalDate
(
param
.
getPolicyEnd
())))
.
or
(
s
->
s
.
ge
(
TInsuranceDetail:
:
getPolicyStart
,
LocalDateUtil
.
parseLocalDate
(
param
.
getPolicyStart
()))
.
le
(
TInsuranceDetail:
:
getPolicyStart
,
LocalDateUtil
.
parseLocalDate
(
param
.
getPolicyEnd
())))
.
or
(
s
->
s
.
ge
(
TInsuranceDetail:
:
getPolicyEnd
,
LocalDateUtil
.
parseLocalDate
(
param
.
getPolicyStart
()))
.
le
(
TInsuranceDetail:
:
getPolicyEnd
,
LocalDateUtil
.
parseLocalDate
(
param
.
getPolicyEnd
())))
)
//有效
.
and
(
wrapper
->
wrapper
.
eq
(
TInsuranceDetail:
:
getIsEffect
,
CommonConstants
.
ZERO_INT
)
.
or
().
isNull
(
TInsuranceDetail:
:
getIsEffect
)
)
//未过期
.
and
(
wrapper
->
wrapper
.
eq
(
TInsuranceDetail:
:
getIsOverdue
,
CommonConstants
.
ZERO_INT
)
.
or
().
isNull
(
TInsuranceDetail:
:
getIsOverdue
)
)
.
orderByDesc
(
TInsuranceDetail:
:
getUpdateTime
)
.
last
(
CommonConstants
.
LAST_ONE_SQL
)
);
if
(
Optional
.
ofNullable
(
insuranceDetailBetween
).
isPresent
()){
param
.
setErrorMessage
(
"替换员工在["
+
insuranceDetailBetween
.
getPolicyStart
()+
"-"
+
insuranceDetailBetween
.
getPolicyEnd
()+
"]期间内有投保记录"
);
listResult
.
add
(
param
);
continue
;
}
listSuccess
.
add
(
param
);
listSuccess
.
add
(
param
);
}
}
...
...
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