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
db0e9623
Commit
db0e9623
authored
Dec 14, 2022
by
zhaji
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
"feature-zhaJi:新增登记保单保费的商险办理地权限"
parent
8be268ea
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
4 deletions
+23
-4
InsurancesConstants.java
...lus/v1/yifu/insurances/constants/InsurancesConstants.java
+4
-0
TInsuranceDetailServiceImpl.java
...s/service/insurance/impl/TInsuranceDetailServiceImpl.java
+19
-4
No files found.
yifu-insurances/yifu-insurances-api/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/constants/InsurancesConstants.java
View file @
db0e9623
...
...
@@ -1274,5 +1274,9 @@ public class InsurancesConstants {
*/
public
static
final
String
EKP_SEND_ERROR
=
"存在与ekp系统交互异常,请联系管理员处理后再操作"
;
/**
* 当前登录人无任何商险办理地的操作权限
*/
public
static
final
String
NO_PERMISSION
=
"当前登录人无任何商险办理地的操作权限"
;
}
yifu-insurances/yifu-insurances-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/service/insurance/impl/TInsuranceDetailServiceImpl.java
View file @
db0e9623
...
...
@@ -25,6 +25,7 @@ import com.yifu.cloud.plus.v1.yifu.ekp.util.EkpInsuranceUtil;
import
com.yifu.cloud.plus.v1.yifu.insurances.constants.InsurancesConstants
;
import
com.yifu.cloud.plus.v1.yifu.insurances.entity.*
;
import
com.yifu.cloud.plus.v1.yifu.insurances.mapper.insurances.TInsuranceDetailMapper
;
import
com.yifu.cloud.plus.v1.yifu.insurances.service.TInsuranceAreaResService
;
import
com.yifu.cloud.plus.v1.yifu.insurances.service.ekp.EkpSettleService
;
import
com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.*
;
import
com.yifu.cloud.plus.v1.yifu.insurances.util.BigDecimalUtils
;
...
...
@@ -117,7 +118,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
private
TInsurancePolicyService
tInsurancePolicyService
;
@Resource
private
TBusinessOperateService
tBusinessOperateService
;
@Resource
private
TInsuranceAreaResService
tInsuranceAreaResService
;
/***********************商险办理********************************/
/**
* 每日定时刷新商险到期数据
...
...
@@ -1735,7 +1737,14 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
if
(
user
==
null
||
Common
.
isEmpty
(
user
.
getId
()))
{
return
R
.
failed
(
CommonConstants
.
PLEASE_LOG_IN
);
}
List
<
InsuranceRegisterParam
>
operatList
=
registeredPolicyPremiumCheck
(
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
<
InsuranceRegisterParam
>
operatList
=
registeredPolicyPremiumCheck
(
paramList
,
insuranceAreaResList
);
//保存到数据库中的结果
List
<
InsuranceRegisterParam
>
listSuccess
=
operatList
.
stream
().
filter
(
e
->
e
.
getErrorMessage
().
equals
(
CommonConstants
.
RESULT_DATA_SUCESS
)).
collect
(
Collectors
.
toList
());
List
<
TInsuranceDetail
>
detailList
=
new
ArrayList
<>();
...
...
@@ -3349,7 +3358,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
* @param paramList
* @return {@link Map<String, List<InsuranceRegisterParam>>}
*/
private
List
<
InsuranceRegisterParam
>
registeredPolicyPremiumCheck
(
List
<
InsuranceRegisterParam
>
paramList
){
private
List
<
InsuranceRegisterParam
>
registeredPolicyPremiumCheck
(
List
<
InsuranceRegisterParam
>
paramList
,
List
<
TInsuranceAreaRes
>
insuranceAreaResList
){
for
(
InsuranceRegisterParam
param
:
paramList
.
stream
().
distinct
().
collect
(
Collectors
.
toList
()))
{
// 必填校验
if
(
StringUtils
.
isBlank
(
param
.
getEmpName
())){
...
...
@@ -3425,6 +3434,12 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
param
.
setErrorMessage
(
InsurancesConstants
.
NOT_FOUND_INSERT_OR_BATCH_RECORD
);
continue
;
}
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
;
}
LambdaQueryWrapper
<
TInsuranceEkp
>
ekpLambdaQueryWrapper
=
new
LambdaQueryWrapper
<>();
ekpLambdaQueryWrapper
.
eq
(
TInsuranceEkp
::
getDetailId
,
detail
.
getId
()).
eq
(
TInsuranceEkp
::
getResendFlag
,
CommonConstants
.
ZERO_INT
);
List
<
TInsuranceEkp
>
ekpList
=
tInsuranceEkpService
.
list
(
ekpLambdaQueryWrapper
);
...
...
@@ -6556,8 +6571,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
return
R
.
failed
(
"无可出险的保单"
);
}
List
<
TInsuranceOperate
>
operateList
=
new
ArrayList
<>();
LambdaUpdateWrapper
<
TInsuranceDetail
>
updateWrapper
=
new
LambdaUpdateWrapper
<>();
for
(
TInsuranceDetail
tInsuranceDetail
:
list
)
{
LambdaUpdateWrapper
<
TInsuranceDetail
>
updateWrapper
=
new
LambdaUpdateWrapper
<>();
TInsuranceOperate
operate
=
new
TInsuranceOperate
();
updateWrapper
.
eq
(
TInsuranceDetail
::
getId
,
tInsuranceDetail
.
getId
())
.
set
(
TInsuranceDetail
::
getIsUse
,
CommonConstants
.
ONE_INT
)
...
...
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