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
d9a0036b
Commit
d9a0036b
authored
Sep 02, 2022
by
hongguangwu
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/develop' into develop
parents
d89b1d67
b2b79f61
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
81 additions
and
25 deletions
+81
-25
TInsuranceDetailServiceImpl.java
...s/service/insurance/impl/TInsuranceDetailServiceImpl.java
+81
-25
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 @
d9a0036b
...
...
@@ -1053,15 +1053,50 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
}
tInsuranceSettleService
.
save
(
burden
);
SettleVo
settleVo
=
getInsuranceDetailSettleStatus
(
detail
.
getId
(),
detail
.
getDefaultSettleId
());
if
(!
Common
.
isEmpty
(
settleVo
)
&&
InsurancesConstants
.
SETTLE_ONE
.
equals
(
settleVo
.
getEstimateStatus
())
&&
InsurancesConstants
.
SETTLE_ONE
.
equals
(
settleVo
.
getActualStatus
())){
//推送负的给ekp
String
s
=
pushEstimate
(
detail
,
CommonConstants
.
THREE_INT
);
//这里退回的时候,必须置为null,防止是实缴的时候,登记保费出错
if
(
StringUtils
.
isNotBlank
(
s
)){
if
(!
Common
.
isEmpty
(
settleVo
)
){
//预估推送标识
Integer
isEstimatePush
=
settle
.
getIsEstimatePush
();
//实缴推送标识
Integer
isActualPush
=
settle
.
getIsActualPush
();
//预估结算状态
String
estimateStatus
=
settleVo
.
getEstimateStatus
();
//实缴结算状态
String
actualStatus
=
settleVo
.
getActualStatus
();
String
pushResult
=
null
;
//预估已推送,实缴未推送
if
(
isEstimatePush
==
CommonConstants
.
ONE_INT
&&
isActualPush
==
CommonConstants
.
ZERO_INT
){
//预估未结算,推送作废
if
(
InsurancesConstants
.
SETTLE_ZERO
.
equals
(
estimateStatus
)){
pushResult
=
pushEstimate
(
detail
,
CommonConstants
.
FIVE_INT
);
}
else
{
//预估结算中已结算,推送预估红冲
pushResult
=
pushEstimate
(
detail
,
CommonConstants
.
THREE_INT
);
}
}
//预估已推送,实缴已推送
if
(
isEstimatePush
==
CommonConstants
.
ONE_INT
&&
isActualPush
==
CommonConstants
.
ONE_INT
){
//预估未结算,实缴未结算推送作废
if
(
InsurancesConstants
.
SETTLE_ZERO
.
equals
(
estimateStatus
)
&&
InsurancesConstants
.
SETTLE_ZERO
.
equals
(
actualStatus
)){
pushResult
=
pushEstimate
(
detail
,
CommonConstants
.
FIVE_INT
);
}
else
{
//预估结算中,已结算,实缴已推送,推送实缴红冲信息
pushResult
=
pushEstimate
(
detail
,
CommonConstants
.
SIX_INT
);
}
}
//预估未推送,实缴已推送
if
(
isEstimatePush
==
CommonConstants
.
ZERO_INT
&&
isActualPush
==
CommonConstants
.
ONE_INT
){
//实缴未结算推送作废
if
(
InsurancesConstants
.
SETTLE_ZERO
.
equals
(
actualStatus
)){
pushResult
=
pushEstimate
(
detail
,
CommonConstants
.
FIVE_INT
);
}
else
{
//实缴结算中,已结算,推送实缴红冲信息
pushResult
=
pushEstimate
(
detail
,
CommonConstants
.
SIX_INT
);
}
}
if
(
StringUtils
.
isNotBlank
(
pushResult
)){
detail
.
setDefaultSettleId
(
null
);
}
}
}
}
//获取成功数据的remark
...
...
@@ -1140,7 +1175,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
@Override
public
R
<
List
<
InsuranceListVO
>>
successfulInsurance
(
YifuUser
user
,
List
<
InsuranceHandleParam
>
paramList
)
{
ThreadPoolExecutor
threadPool
=
new
ThreadPoolExecutor
(
50
,
50
,
100
,
TimeUnit
.
SECONDS
,
new
LinkedBlockingQueue
<>(
10
));
//解析参数里的商险id
List
<
String
>
idList
=
paramList
.
stream
().
map
(
e
->
e
.
getId
()).
distinct
().
collect
(
Collectors
.
toList
());
//操作日志对象
...
...
@@ -1262,7 +1296,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
}
updateBatchById
(
successList
);
if
(
CollectionUtils
.
isNotEmpty
(
successList
)){
//
threadPool.execute(() -> {
threadPool
.
execute
(()
->
{
//根据结算类型是合并结算,推送预估保费到ekp(上面已经算好,这里直接判断有预估保费的就推送)
for
(
TInsuranceDetail
tInsuranceDetail
:
successList
)
{
Integer
settleType
=
tInsuranceDetail
.
getSettleType
();
...
...
@@ -1280,7 +1314,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
}
}
}
//
});
});
}
//根据项目编码获取项目名称
setProjectNameByDeptNo
(
errorList
);
...
...
@@ -3466,7 +3500,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
Integer
oldSettleType
=
success
.
getOldSettleType
();
Integer
newSettleType
=
success
.
getNewSettleType
();
//更新新的项目编码,结算方式,预估保费,实际保费
updateWrapper
.
eq
(
TInsuranceDetail
::
getId
,
success
.
getId
())
updateWrapper
.
eq
(
TInsuranceDetail
::
getId
,
success
.
getId
())
.
set
(
TInsuranceDetail
::
getDeptNo
,
success
.
getNewDeptNo
())
.
set
(
TInsuranceDetail
::
getSettleType
,
newSettleType
)
.
set
(
TInsuranceDetail
::
getActualPremium
,
actualPremium
)
...
...
@@ -3525,6 +3559,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
//变更后为单独结算
if
(
CommonConstants
.
ONE_INT
==
newSettleType
)
{
//推送新的结算信息至EKP
interactiveParam
.
setEstimateStatus
(
EkpConstants
.
NOTHING
);
interactiveParam
.
setSettleType
(
InsurancesConstants
.
ACTUAL_SETTLE_BILL
);
interactiveParam
.
setInteractiveType
(
InsurancesConstants
.
NEW_SETTLE_BILL
);
interactiveParam
.
setCustomerCode
(
success
.
getNewCustomerCode
());
...
...
@@ -3532,8 +3567,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
interactiveParam
.
setDeptNo
(
success
.
getNewDeptNo
());
interactiveParam
.
setDeptName
(
success
.
getNewDeptName
());
interactiveParam
.
setActualPremium
(
success
.
getActualPremium
());
String
addBody
=
eKPInsuranceUtil
.
sendToEkp
(
interactiveParam
);
if
(
StringUtils
.
isNotBlank
(
addBody
)){
String
pushResult
=
eKPInsuranceUtil
.
sendToEkp
(
interactiveParam
);
if
(
StringUtils
.
isNotBlank
(
pushResult
)){
newInsuranceSettle
.
setActualPushTime
(
LocalDateTime
.
now
());
newInsuranceSettle
.
setIsActualPush
(
CommonConstants
.
ONE_INT
);
newInsuranceSettle
.
setUpdateTime
(
LocalDateTime
.
now
());
...
...
@@ -3546,6 +3581,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
//变更后为合并结算
if
(
CommonConstants
.
ZERO_INT
==
newSettleType
)
{
//先推送预估,再推送实际
interactiveParam
.
setEstimateStatus
(
EkpConstants
.
HAVE
);
interactiveParam
.
setCustomerCode
(
success
.
getNewCustomerCode
());
interactiveParam
.
setCustomerName
(
success
.
getNewCustomerName
());
interactiveParam
.
setDeptNo
(
success
.
getNewDeptNo
());
...
...
@@ -3583,10 +3619,10 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
}
}
}
else
{
// TODO: 2022/8/9 已有实缴但是未推送则推送新的结算信息
//变更后为单独结算
if
(
CommonConstants
.
ONE_INT
==
newSettleType
)
{
//推送新的结算信息至EKP
interactiveParam
.
setEstimateStatus
(
EkpConstants
.
NOTHING
);
interactiveParam
.
setSettleType
(
InsurancesConstants
.
ACTUAL_SETTLE_BILL
);
interactiveParam
.
setInteractiveType
(
InsurancesConstants
.
NEW_SETTLE_BILL
);
interactiveParam
.
setCustomerCode
(
success
.
getNewCustomerCode
());
...
...
@@ -3608,6 +3644,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
//变更后为合并结算
if
(
CommonConstants
.
ZERO_INT
==
newSettleType
)
{
//先推送预估,再推送实际
interactiveParam
.
setEstimateStatus
(
EkpConstants
.
HAVE
);
interactiveParam
.
setCustomerCode
(
success
.
getNewCustomerCode
());
interactiveParam
.
setCustomerName
(
success
.
getNewCustomerName
());
interactiveParam
.
setDeptNo
(
success
.
getNewDeptNo
());
...
...
@@ -3667,6 +3704,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
updateWrapper
.
set
(
TInsuranceDetail
::
getDefaultSettleId
,
tInsuranceSettle
.
getId
());
update
(
updateWrapper
);
//推送结算信息至EKP
interactiveParam
.
setEstimateStatus
(
EkpConstants
.
HAVE
);
interactiveParam
.
setCustomerCode
(
success
.
getNewCustomerCode
());
interactiveParam
.
setCustomerName
(
success
.
getNewCustomerName
());
interactiveParam
.
setDeptNo
(
success
.
getNewDeptNo
());
...
...
@@ -3738,6 +3776,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
updateWrapper
.
set
(
TInsuranceDetail
::
getEstimatePremium
,
new
BigDecimal
(
"0.00"
));
update
(
updateWrapper
);
//推送新的结算信息至EKP,推实际保费
interactiveParam
.
setEstimateStatus
(
EkpConstants
.
NOTHING
);
interactiveParam
.
setCustomerCode
(
success
.
getNewCustomerCode
());
interactiveParam
.
setCustomerName
(
success
.
getNewCustomerName
());
interactiveParam
.
setDeptNo
(
success
.
getNewDeptNo
());
...
...
@@ -3761,6 +3800,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
//变更为合并结算
if
(
CommonConstants
.
ZERO_INT
==
newSettleType
){
// 推送新的结算信息
interactiveParam
.
setEstimateStatus
(
EkpConstants
.
HAVE
);
interactiveParam
.
setCustomerCode
(
success
.
getNewCustomerCode
());
interactiveParam
.
setCustomerName
(
success
.
getNewCustomerName
());
interactiveParam
.
setDeptNo
(
success
.
getNewDeptNo
());
...
...
@@ -3802,6 +3842,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
String
deleteBody
=
eKPInsuranceUtil
.
sendToEkp
(
interactiveParam
);
if
(
StringUtils
.
isNotBlank
(
deleteBody
)){
//先推送预估,再推送实际
interactiveParam
.
setEstimateStatus
(
EkpConstants
.
HAVE
);
interactiveParam
.
setCustomerCode
(
success
.
getNewCustomerCode
());
interactiveParam
.
setCustomerName
(
success
.
getNewCustomerName
());
interactiveParam
.
setDeptNo
(
success
.
getNewDeptNo
());
...
...
@@ -3841,6 +3882,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
//如果预估和实缴均未推送
if
(
byId
.
getIsActualPush
()
==
CommonConstants
.
ZERO_INT
&&
byId
.
getIsEstimatePush
()
==
CommonConstants
.
ONE_INT
){
//先推送预估,再推送实际
interactiveParam
.
setEstimateStatus
(
EkpConstants
.
HAVE
);
interactiveParam
.
setCustomerCode
(
success
.
getNewCustomerCode
());
interactiveParam
.
setCustomerName
(
success
.
getNewCustomerName
());
interactiveParam
.
setDeptNo
(
success
.
getNewDeptNo
());
...
...
@@ -3914,6 +3956,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
updateWrapper
.
set
(
TInsuranceDetail
::
getDefaultSettleId
,
newInsuranceSettle
.
getId
());
update
(
updateWrapper
);
//推送新的结算信息至EKP
interactiveParam
.
setEstimateStatus
(
EkpConstants
.
HAVE
);
interactiveParam
.
setCustomerCode
(
success
.
getNewCustomerCode
());
interactiveParam
.
setCustomerName
(
success
.
getNewCustomerName
());
interactiveParam
.
setDeptNo
(
success
.
getNewDeptNo
());
...
...
@@ -3930,16 +3973,15 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
newInsuranceSettle
.
setUpdateTime
(
LocalDateTime
.
now
());
tInsuranceSettleService
.
updateById
(
newInsuranceSettle
);
}
else
{
//异常处理 // TODO: 2022/8/9
saveInsuranceEkp
(
interactiveParam
,
CommonConstants
.
ONE_INT
);
}
}
}
else
{
//异常处理 // TODO: 2022/8/9
saveInsuranceEkp
(
interactiveParam
,
CommonConstants
.
FOUR_INT
);
}
}
else
{
//推送新的结算信息至EKP
interactiveParam
.
setEstimateStatus
(
EkpConstants
.
HAVE
);
interactiveParam
.
setCustomerCode
(
success
.
getNewCustomerCode
());
interactiveParam
.
setCustomerName
(
success
.
getNewCustomerName
());
interactiveParam
.
setDeptNo
(
success
.
getNewDeptNo
());
...
...
@@ -3956,7 +3998,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
newInsuranceSettle
.
setUpdateTime
(
LocalDateTime
.
now
());
tInsuranceSettleService
.
updateById
(
newInsuranceSettle
);
}
else
{
//异常处理 // TODO: 2022/8/9
saveInsuranceEkp
(
interactiveParam
,
CommonConstants
.
ONE_INT
);
}
}
...
...
@@ -4504,13 +4545,13 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
if
(
Optional
.
ofNullable
(
settle
).
isPresent
()){
SettleVo
settleVo
=
getInsuranceDetailSettleStatus
(
insuranceDetail
.
getId
(),
defaultSettleId
);
if
(!
Common
.
isEmpty
(
settleVo
)){
if
(
InsurancesConstants
.
SETTLE_
ONE
.
equals
(
settleVo
.
getEstimateStatus
())
||
InsurancesConstants
.
SETTLE_ONE
.
equals
(
settleVo
.
getActualStatus
())){
param
.
setErrorMessage
(
InsurancesConstants
.
SETTLE_MONTH_CHANGE_SETTLE_STATUS_T
WO
_ERROR
);
if
(
InsurancesConstants
.
SETTLE_
TWO
.
equals
(
settleVo
.
getEstimateStatus
())
||
InsurancesConstants
.
SETTLE_TWO
.
equals
(
settleVo
.
getActualStatus
())){
param
.
setErrorMessage
(
InsurancesConstants
.
SETTLE_MONTH_CHANGE_SETTLE_STATUS_T
HREE
_ERROR
);
errorList
.
add
(
param
);
continue
;
}
if
(
InsurancesConstants
.
SETTLE_
TWO
.
equals
(
settleVo
.
getEstimateStatus
())
||
InsurancesConstants
.
SETTLE_TWO
.
equals
(
settleVo
.
getActualStatus
())){
param
.
setErrorMessage
(
InsurancesConstants
.
SETTLE_MONTH_CHANGE_SETTLE_STATUS_T
HREE
_ERROR
);
if
(
InsurancesConstants
.
SETTLE_
ONE
.
equals
(
settleVo
.
getEstimateStatus
())
||
InsurancesConstants
.
SETTLE_ONE
.
equals
(
settleVo
.
getActualStatus
())){
param
.
setErrorMessage
(
InsurancesConstants
.
SETTLE_MONTH_CHANGE_SETTLE_STATUS_T
WO
_ERROR
);
errorList
.
add
(
param
);
continue
;
}
...
...
@@ -5011,13 +5052,13 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
if
(
Optional
.
ofNullable
(
settle
).
isPresent
()){
SettleVo
settleVo
=
getInsuranceDetailSettleStatus
(
insuranceDetail
.
getId
(),
defaultSettleId
);
if
(!
Common
.
isEmpty
(
settleVo
)){
if
(
InsurancesConstants
.
SETTLE_
ONE
.
equals
(
settleVo
.
getEstimateStatus
())
||
InsurancesConstants
.
SETTLE_ONE
.
equals
(
settleVo
.
getActualStatus
())){
param
.
setErrorMessage
(
InsurancesConstants
.
DEPT_NO_CHANGE_SETTLE_STATUS_T
WO
_ERROR
);
if
(
InsurancesConstants
.
SETTLE_
TWO
.
equals
(
settleVo
.
getEstimateStatus
())
||
InsurancesConstants
.
SETTLE_TWO
.
equals
(
settleVo
.
getActualStatus
())){
param
.
setErrorMessage
(
InsurancesConstants
.
DEPT_NO_CHANGE_SETTLE_STATUS_T
HREE
_ERROR
);
errorList
.
add
(
param
);
continue
;
}
if
(
InsurancesConstants
.
SETTLE_
TWO
.
equals
(
settleVo
.
getEstimateStatus
())
||
InsurancesConstants
.
SETTLE_TWO
.
equals
(
settleVo
.
getActualStatus
())){
param
.
setErrorMessage
(
InsurancesConstants
.
DEPT_NO_CHANGE_SETTLE_STATUS_T
HREE
_ERROR
);
if
(
InsurancesConstants
.
SETTLE_
ONE
.
equals
(
settleVo
.
getEstimateStatus
())
||
InsurancesConstants
.
SETTLE_ONE
.
equals
(
settleVo
.
getActualStatus
())){
param
.
setErrorMessage
(
InsurancesConstants
.
DEPT_NO_CHANGE_SETTLE_STATUS_T
WO
_ERROR
);
errorList
.
add
(
param
);
continue
;
}
...
...
@@ -5392,11 +5433,20 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
if
(
null
!=
byId
.
getEstimatePremium
()){
param
.
setEstimatePremium
(
byId
.
getEstimatePremium
().
negate
());
}
param
.
setInteractiveType
(
InsurancesConstants
.
CORRECT_SETTLE_BILL
);
param
.
setSettleType
(
InsurancesConstants
.
ESTIMATE_SETTLE_BILL
);
pushType
=
CommonConstants
.
FIVE_INT
;
}
//6推送实缴红冲(用于投保退回场景)
if
(
CommonConstants
.
SIX_INT
==
type
){
String
defaultSettleId
=
tInsuranceDetail
.
getDefaultSettleId
();
TInsuranceSettle
byId
=
tInsuranceSettleService
.
getById
(
defaultSettleId
);
//冲正取负数
if
(
null
!=
byId
.
getActualPremium
()){
param
.
setActualPremium
(
byId
.
getActualPremium
().
negate
());
}
param
.
setInteractiveType
(
InsurancesConstants
.
CORRECT_SETTLE_BILL
);
param
.
setSettleType
(
InsurancesConstants
.
ESTIMATE
_SETTLE_BILL
);
param
.
setSettleType
(
InsurancesConstants
.
ACTUAL
_SETTLE_BILL
);
pushType
=
CommonConstants
.
FIVE_INT
;
}
//4更新实际保费(用于登记保单保费场景推送过实缴保费)
...
...
@@ -5405,6 +5455,12 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
param
.
setSettleType
(
InsurancesConstants
.
ACTUAL_SETTLE_BILL
);
pushType
=
CommonConstants
.
SEVEN_INT
;
}
//作废
if
(
CommonConstants
.
FIVE_INT
==
type
){
param
.
setInteractiveType
(
InsurancesConstants
.
ABOLISH_SETTLE_BILL
);
param
.
setSettleType
(
CommonConstants
.
EMPTY_STRING
);
pushType
=
CommonConstants
.
FOUR_INT
;
}
String
s
=
eKPInsuranceUtil
.
sendToEkp
(
param
);
if
(
StringUtils
.
isBlank
(
s
)){
saveInsuranceEkp
(
param
,
pushType
);
...
...
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