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
a5e52536
Commit
a5e52536
authored
Dec 14, 2022
by
查济
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature-1.3-zhaji' into 'feature/insurance-1.3.0'
Feature 1.3 zhaji See merge request
!303
parents
8be268ea
0a169392
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
14 deletions
+33
-14
InsurancesConstants.java
...lus/v1/yifu/insurances/constants/InsurancesConstants.java
+4
-0
TInsuranceDetailServiceImpl.java
...s/service/insurance/impl/TInsuranceDetailServiceImpl.java
+19
-4
TInsuranceDetailMapper.xml
...in/resources/mapper/insurances/TInsuranceDetailMapper.xml
+10
-10
No files found.
yifu-insurances/yifu-insurances-api/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/constants/InsurancesConstants.java
View file @
a5e52536
...
...
@@ -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 @
a5e52536
...
...
@@ -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
)
...
...
yifu-insurances/yifu-insurances-biz/src/main/resources/mapper/insurances/TInsuranceDetailMapper.xml
View file @
a5e52536
...
...
@@ -502,10 +502,10 @@
<if
test=
"param.policyNo != null and param.policyNo.trim() != ''"
>
and a.POLICY_NO like concat('%',replace(replace(#{param.policyNo},'_','\_'),'%','\%'),'%')
</if>
<if
test=
"param.policyStart != null and param.policyStart.trim() != '' and
param.policyEnd == null and param.policyEnd.trim() == ''
"
>
<if
test=
"param.policyStart != null and param.policyStart.trim() != '' and
(param.policyEnd == null or param.policyEnd.trim() == '')
"
>
AND a.POLICY_END
<![CDATA[ >= ]]>
concat(#{param.policyStart}, ' 00:00:00')
</if>
<if
test=
"param.policyEnd != null and param.policyEnd.trim() != '' and
param.policyStart == null and param.policyStart.trim() == ''
"
>
<if
test=
"param.policyEnd != null and param.policyEnd.trim() != '' and
(param.policyStart == null or param.policyStart.trim() == '')
"
>
AND a.POLICY_START
<![CDATA[ <= ]]>
concat(#{param.policyEnd}, ' 23:59:59')
</if>
<if
test=
"param.policyStart != null and param.policyStart.trim() != '' and param.policyEnd != null and param.policyEnd.trim() != ''"
>
...
...
@@ -596,10 +596,10 @@
<if
test=
"param.policyNo != null and param.policyNo.trim() != ''"
>
and a.POLICY_NO like concat('%',replace(replace(#{param.policyNo},'_','\_'),'%','\%'),'%')
</if>
<if
test=
"param.policyStart != null and param.policyStart.trim() != '' and
param.policyEnd == null and param.policyEnd.trim() == ''
"
>
<if
test=
"param.policyStart != null and param.policyStart.trim() != '' and
(param.policyEnd == null or param.policyEnd.trim() == '')
"
>
AND a.POLICY_END
<![CDATA[ >= ]]>
concat(#{param.policyStart}, ' 00:00:00')
</if>
<if
test=
"param.policyEnd != null and param.policyEnd.trim() != '' and
param.policyStart == null and param.policyStart.trim() == ''
"
>
<if
test=
"param.policyEnd != null and param.policyEnd.trim() != '' and
(param.policyStart == null or param.policyStart.trim() == '')
"
>
AND a.POLICY_START
<![CDATA[ <= ]]>
concat(#{param.policyEnd}, ' 23:59:59')
</if>
<if
test=
"param.policyStart != null and param.policyStart.trim() != '' and param.policyEnd != null and param.policyEnd.trim() != ''"
>
...
...
@@ -667,10 +667,10 @@
<if
test=
"param.policyNo != null and param.policyNo.trim() != ''"
>
and a.POLICY_NO like concat('%',replace(replace(#{param.policyNo},'_','\_'),'%','\%'),'%')
</if>
<if
test=
"param.policyStart != null and param.policyStart.trim() != '' and
param.policyEnd == null and param.policyEnd.trim() == ''
"
>
<if
test=
"param.policyStart != null and param.policyStart.trim() != '' and
(param.policyEnd == null or param.policyEnd.trim() == '')
"
>
AND a.POLICY_END
<![CDATA[ >= ]]>
concat(#{param.policyStart}, ' 00:00:00')
</if>
<if
test=
"param.policyEnd != null and param.policyEnd.trim() != '' and
param.policyStart == null and param.policyStart.trim() == ''
"
>
<if
test=
"param.policyEnd != null and param.policyEnd.trim() != '' and
(param.policyStart == null or param.policyStart.trim() == '')
"
>
AND a.POLICY_START
<![CDATA[ <= ]]>
concat(#{param.policyEnd}, ' 23:59:59')
</if>
<if
test=
"param.policyStart != null and param.policyStart.trim() != '' and param.policyEnd != null and param.policyEnd.trim() != ''"
>
...
...
@@ -747,10 +747,10 @@
<if
test=
"param.policyNo != null and param.policyNo.trim() != ''"
>
and a.POLICY_NO like concat('%',replace(replace(#{param.policyNo},'_','\_'),'%','\%'),'%')
</if>
<if
test=
"param.policyStart != null and param.policyStart.trim() != '' and
param.policyEnd == null and param.policyEnd.trim() == ''
"
>
<if
test=
"param.policyStart != null and param.policyStart.trim() != '' and
( param.policyEnd == null or param.policyEnd.trim() == '' )
"
>
AND a.POLICY_END
<![CDATA[ >= ]]>
concat(#{param.policyStart}, ' 00:00:00')
</if>
<if
test=
"param.policyEnd != null and param.policyEnd.trim() != '' and
param.policyStart == null and param.policyStart.trim() == ''
"
>
<if
test=
"param.policyEnd != null and param.policyEnd.trim() != '' and
(param.policyStart == null or param.policyStart.trim() == '')
"
>
AND a.POLICY_START
<![CDATA[ <= ]]>
concat(#{param.policyEnd}, ' 23:59:59')
</if>
<if
test=
"param.policyStart != null and param.policyStart.trim() != '' and param.policyEnd != null and param.policyEnd.trim() != ''"
>
...
...
@@ -823,10 +823,10 @@
<if
test=
"param.policyNo != null and param.policyNo.trim() != ''"
>
and a.POLICY_NO like concat('%',replace(replace(#{param.policyNo},'_','\_'),'%','\%'),'%')
</if>
<if
test=
"param.policyStart != null and param.policyStart.trim() != '' and
param.policyEnd == null and param.policyEnd.trim() == ''
"
>
<if
test=
"param.policyStart != null and param.policyStart.trim() != '' and
(param.policyEnd == null or param.policyEnd.trim() == '')
"
>
AND a.POLICY_END
<![CDATA[ >= ]]>
concat(#{param.policyStart}, ' 00:00:00')
</if>
<if
test=
"param.policyEnd != null and param.policyEnd.trim() != '' and
param.policyStart == null and param.policyStart.trim() == ''
"
>
<if
test=
"param.policyEnd != null and param.policyEnd.trim() != '' and
(param.policyStart == null or param.policyStart.trim() == '')
"
>
AND a.POLICY_START
<![CDATA[ <= ]]>
concat(#{param.policyEnd}, ' 23:59:59')
</if>
<if
test=
"param.policyStart != null and param.policyStart.trim() != '' and param.policyEnd != null and param.policyEnd.trim() != ''"
>
...
...
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