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
69a49880
Commit
69a49880
authored
Dec 14, 2022
by
李灿灿
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:登记保单保费、修改已投保信息 添加办理地权限
parent
c499925c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
4 deletions
+32
-4
TInsuranceDetailServiceImpl.java
...s/service/insurance/impl/TInsuranceDetailServiceImpl.java
+32
-4
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 @
69a49880
...
@@ -2033,7 +2033,14 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
...
@@ -2033,7 +2033,14 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
if
(
user
==
null
||
Common
.
isEmpty
(
user
.
getId
()))
{
if
(
user
==
null
||
Common
.
isEmpty
(
user
.
getId
()))
{
return
R
.
failed
(
CommonConstants
.
PLEASE_LOG_IN
);
return
R
.
failed
(
CommonConstants
.
PLEASE_LOG_IN
);
}
}
List
<
InsuranceRegisterInvoiceNoParam
>
operateList
=
registeredInvoiceNoCheck
(
paramList
);
//获取当前登录人的商险办理地权限
LambdaQueryWrapper
<
TInsuranceAreaRes
>
areaQuery
=
new
LambdaQueryWrapper
<>();
areaQuery
.
eq
(
TInsuranceAreaRes:
:
getUserId
,
user
.
getId
()).
eq
(
TInsuranceAreaRes:
:
getStatus
,
CommonConstants
.
ZERO_INT
);
List
<
TInsuranceAreaRes
>
insuranceAreaResList
=
tInsuranceAreaResService
.
list
(
areaQuery
);
if
(
CollectionUtils
.
isEmpty
(
insuranceAreaResList
))
{
return
R
.
failed
(
InsurancesConstants
.
NO_PERMISSION
);
}
List
<
InsuranceRegisterInvoiceNoParam
>
operateList
=
registeredInvoiceNoCheck
(
paramList
,
insuranceAreaResList
);
//需要修改的结果
//需要修改的结果
List
<
InsuranceRegisterInvoiceNoParam
>
listSuccess
=
operateList
.
stream
().
filter
(
e
->
e
.
getErrorMessage
().
equals
(
CommonConstants
.
RESULT_DATA_SUCESS
)).
collect
(
Collectors
.
toList
());
List
<
InsuranceRegisterInvoiceNoParam
>
listSuccess
=
operateList
.
stream
().
filter
(
e
->
e
.
getErrorMessage
().
equals
(
CommonConstants
.
RESULT_DATA_SUCESS
)).
collect
(
Collectors
.
toList
());
List
<
TInsuranceDetail
>
detailList
=
new
ArrayList
<>();
List
<
TInsuranceDetail
>
detailList
=
new
ArrayList
<>();
...
@@ -2141,7 +2148,14 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
...
@@ -2141,7 +2148,14 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
if
(
user
==
null
||
Common
.
isEmpty
(
user
.
getId
()))
{
if
(
user
==
null
||
Common
.
isEmpty
(
user
.
getId
()))
{
return
R
.
failed
(
CommonConstants
.
PLEASE_LOG_IN
);
return
R
.
failed
(
CommonConstants
.
PLEASE_LOG_IN
);
}
}
List
<
InsuranceInsuredParam
>
operateList
=
updateInsuranceInsuredCheck
(
paramList
);
//获取当前登录人的商险办理地权限
LambdaQueryWrapper
<
TInsuranceAreaRes
>
areaQuery
=
new
LambdaQueryWrapper
<>();
areaQuery
.
eq
(
TInsuranceAreaRes:
:
getUserId
,
user
.
getId
()).
eq
(
TInsuranceAreaRes:
:
getStatus
,
CommonConstants
.
ZERO_INT
);
List
<
TInsuranceAreaRes
>
insuranceAreaResList
=
tInsuranceAreaResService
.
list
(
areaQuery
);
if
(
CollectionUtils
.
isEmpty
(
insuranceAreaResList
))
{
return
R
.
failed
(
InsurancesConstants
.
NO_PERMISSION
);
}
List
<
InsuranceInsuredParam
>
operateList
=
updateInsuranceInsuredCheck
(
paramList
,
insuranceAreaResList
);
//需要修改的结果
//需要修改的结果
List
<
InsuranceInsuredParam
>
listSuccess
=
operateList
.
stream
().
filter
(
e
->
e
.
getErrorMessage
().
equals
(
CommonConstants
.
RESULT_DATA_SUCESS
)).
collect
(
Collectors
.
toList
());
List
<
InsuranceInsuredParam
>
listSuccess
=
operateList
.
stream
().
filter
(
e
->
e
.
getErrorMessage
().
equals
(
CommonConstants
.
RESULT_DATA_SUCESS
)).
collect
(
Collectors
.
toList
());
List
<
TInsuranceDetail
>
detailList
=
new
ArrayList
<>();
List
<
TInsuranceDetail
>
detailList
=
new
ArrayList
<>();
...
@@ -3608,9 +3622,10 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
...
@@ -3608,9 +3622,10 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
*
*
* @author licancan
* @author licancan
* @param paramList
* @param paramList
* @param insuranceAreaResList 办理地权限
* @return {@link List<InsuranceRegisterInvoiceNoParam>}
* @return {@link List<InsuranceRegisterInvoiceNoParam>}
*/
*/
private
List
<
InsuranceRegisterInvoiceNoParam
>
registeredInvoiceNoCheck
(
List
<
InsuranceRegisterInvoiceNoParam
>
paramList
){
private
List
<
InsuranceRegisterInvoiceNoParam
>
registeredInvoiceNoCheck
(
List
<
InsuranceRegisterInvoiceNoParam
>
paramList
,
List
<
TInsuranceAreaRes
>
insuranceAreaResList
){
List
<
InsuranceRegisterInvoiceNoParam
>
collect
=
paramList
.
stream
().
distinct
().
collect
(
Collectors
.
toList
());
List
<
InsuranceRegisterInvoiceNoParam
>
collect
=
paramList
.
stream
().
distinct
().
collect
(
Collectors
.
toList
());
for
(
InsuranceRegisterInvoiceNoParam
param
:
collect
)
{
for
(
InsuranceRegisterInvoiceNoParam
param
:
collect
)
{
// 必填校验
// 必填校验
...
@@ -3675,6 +3690,12 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
...
@@ -3675,6 +3690,12 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
param
.
setErrorMessage
(
InsurancesConstants
.
NOT_FOUND_INSERT_OR_BATCH_RECORD
);
param
.
setErrorMessage
(
InsurancesConstants
.
NOT_FOUND_INSERT_OR_BATCH_RECORD
);
continue
;
continue
;
}
else
{
}
else
{
//商险办理地权限校验
boolean
b
=
insuranceAreaResList
.
stream
().
anyMatch
(
s
->
detail
.
getInsuranceHandleCity
().
equals
(
s
.
getCity
())
&&
detail
.
getInsuranceHandleProvince
().
equals
(
s
.
getProvince
()));
if
(!
b
){
param
.
setErrorMessage
(
InsurancesConstants
.
NO_DETAIL_JURISDICTION
);
continue
;
}
if
(
detail
.
getBuyHandleStatus
()
!=
CommonConstants
.
THREE_INT
&&
detail
.
getBuyHandleStatus
()
!=
CommonConstants
.
FIVE_INT
){
if
(
detail
.
getBuyHandleStatus
()
!=
CommonConstants
.
THREE_INT
&&
detail
.
getBuyHandleStatus
()
!=
CommonConstants
.
FIVE_INT
){
param
.
setErrorMessage
(
InsurancesConstants
.
CURRENT_STATUS_NOT_REGISTER_INVOICE_NO
);
param
.
setErrorMessage
(
InsurancesConstants
.
CURRENT_STATUS_NOT_REGISTER_INVOICE_NO
);
continue
;
continue
;
...
@@ -3692,9 +3713,10 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
...
@@ -3692,9 +3713,10 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
*
*
* @author licancan
* @author licancan
* @param paramList
* @param paramList
* @param insuranceAreaResList 办理地权限
* @return {@link List<InsuranceInsuredParam>}
* @return {@link List<InsuranceInsuredParam>}
*/
*/
private
List
<
InsuranceInsuredParam
>
updateInsuranceInsuredCheck
(
List
<
InsuranceInsuredParam
>
paramList
){
private
List
<
InsuranceInsuredParam
>
updateInsuranceInsuredCheck
(
List
<
InsuranceInsuredParam
>
paramList
,
List
<
TInsuranceAreaRes
>
insuranceAreaResList
){
List
<
InsuranceInsuredParam
>
collect
=
paramList
.
stream
().
distinct
().
collect
(
Collectors
.
toList
());
List
<
InsuranceInsuredParam
>
collect
=
paramList
.
stream
().
distinct
().
collect
(
Collectors
.
toList
());
for
(
InsuranceInsuredParam
param
:
collect
)
{
for
(
InsuranceInsuredParam
param
:
collect
)
{
// 必填校验
// 必填校验
...
@@ -3796,6 +3818,12 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
...
@@ -3796,6 +3818,12 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
param
.
setErrorMessage
(
InsurancesConstants
.
NOT_FOUND_INSURANCE_RECORD
);
param
.
setErrorMessage
(
InsurancesConstants
.
NOT_FOUND_INSURANCE_RECORD
);
continue
;
continue
;
}
else
{
}
else
{
//商险办理地权限校验
boolean
b
=
insuranceAreaResList
.
stream
().
anyMatch
(
s
->
detail
.
getInsuranceHandleCity
().
equals
(
s
.
getCity
())
&&
detail
.
getInsuranceHandleProvince
().
equals
(
s
.
getProvince
()));
if
(!
b
){
param
.
setErrorMessage
(
InsurancesConstants
.
NO_DETAIL_JURISDICTION
);
continue
;
}
//判断是否是已投保状态或已减员
//判断是否是已投保状态或已减员
if
(
detail
.
getBuyHandleStatus
()
!=
CommonConstants
.
THREE_INT
&&
detail
.
getBuyHandleStatus
()
!=
CommonConstants
.
FIVE_INT
){
if
(
detail
.
getBuyHandleStatus
()
!=
CommonConstants
.
THREE_INT
&&
detail
.
getBuyHandleStatus
()
!=
CommonConstants
.
FIVE_INT
){
param
.
setErrorMessage
(
InsurancesConstants
.
CURRENT_STATUS_NOT_CHANGE_INSURANCE_RECORD
);
param
.
setErrorMessage
(
InsurancesConstants
.
CURRENT_STATUS_NOT_CHANGE_INSURANCE_RECORD
);
...
...
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