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
64fb7322
Commit
64fb7322
authored
Aug 02, 2022
by
李灿灿
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
办理成功替换不参与结算
parent
7463f806
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
80 additions
and
68 deletions
+80
-68
TInsuranceDetailServiceImpl.java
.../insurances/service/impl/TInsuranceDetailServiceImpl.java
+80
-68
No files found.
yifu-insurances/yifu-insurances-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/service/impl/TInsuranceDetailServiceImpl.java
View file @
64fb7322
...
@@ -829,47 +829,87 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
...
@@ -829,47 +829,87 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
listVO
.
setErrorMessage
(
InsurancesConstants
.
INSURANCE_BUY_STATUS_NOT_TWO
);
listVO
.
setErrorMessage
(
InsurancesConstants
.
INSURANCE_BUY_STATUS_NOT_TWO
);
errorList
.
add
(
listVO
);
errorList
.
add
(
listVO
);
}
else
{
}
else
{
//根据结算类型判断是否需要计算预估保费
//替换类型参与结算
//预估
if
(
detail
.
getBuyType
()
==
CommonConstants
.
FOUR_INT
){
if
(
detail
.
getSettleType
()
==
CommonConstants
.
ZERO_INT
){
//记录状态均置为「已投保」
if
(
CommonConstants
.
ONE_INT
==
detail
.
getBillingType
()){
detail
.
setBuyHandleStatus
(
CommonConstants
.
THREE_INT
);
// 按月查费率
detail
.
setSignFlag
(
CommonConstants
.
ONE_INT
);
// 预估保费 = 费率 * 购买标准
//记录的有效状态,置为「有效」
BigDecimal
estimatePremium
=
new
BigDecimal
(
detail
.
getBuyStandard
()).
multiply
(
detail
.
getRate
()).
setScale
(
2
,
BigDecimal
.
ROUND_HALF_UP
);
detail
.
setIsEffect
(
CommonConstants
.
ZERO_INT
);
detail
.
setEstimatePremium
(
estimatePremium
);
detail
.
setIsOverdue
(
CommonConstants
.
ZERO_INT
);
if
(
detail
.
getBuyType
()
==
CommonConstants
.
THREE_INT
){
detail
.
setIsUse
(
CommonConstants
.
ZERO_INT
);
detail
.
setPolicyEffect
(
LocalDate
.
now
().
plusDays
(
CommonConstants
.
ONE_INT
));
successList
.
add
(
detail
);
}
else
{
//根据结算类型判断是否需要计算预估保费
//预估
if
(
detail
.
getSettleType
()
==
CommonConstants
.
ZERO_INT
){
if
(
CommonConstants
.
ONE_INT
==
detail
.
getBillingType
()){
// 按月查费率
// 预估保费 = 费率 * 购买标准
BigDecimal
estimatePremium
=
new
BigDecimal
(
detail
.
getBuyStandard
()).
multiply
(
detail
.
getRate
()).
setScale
(
2
,
BigDecimal
.
ROUND_HALF_UP
);
detail
.
setEstimatePremium
(
estimatePremium
);
if
(
detail
.
getBuyType
()
==
CommonConstants
.
THREE_INT
){
detail
.
setPolicyEffect
(
LocalDate
.
now
().
plusDays
(
CommonConstants
.
ONE_INT
));
}
//记录状态均置为「已投保」
detail
.
setBuyHandleStatus
(
CommonConstants
.
THREE_INT
);
detail
.
setSignFlag
(
CommonConstants
.
ONE_INT
);
//记录的有效状态,置为「有效」
detail
.
setIsEffect
(
CommonConstants
.
ZERO_INT
);
detail
.
setIsOverdue
(
CommonConstants
.
ZERO_INT
);
detail
.
setIsUse
(
CommonConstants
.
ZERO_INT
);
//保费存储
TInsuranceSettle
settle
=
new
TInsuranceSettle
();
settle
.
setInsDetailId
(
detail
.
getId
());
settle
.
setSettleType
(
detail
.
getSettleType
());
settle
.
setSettleHandleStatus
(
CommonConstants
.
ONE_STRING
);
settle
.
setEstimatePremium
(
estimatePremium
);
//调完ekp接口才会是1
settle
.
setIsEstimatePush
(
CommonConstants
.
ONE_INT
);
settle
.
setEstimatePushTime
(
LocalDateTime
.
now
());
settle
.
setCreateTime
(
LocalDateTime
.
now
());
tInsuranceSettleService
.
save
(
settle
);
detail
.
setDefaultSettleId
(
settle
.
getId
());
successList
.
add
(
detail
);
}
else
{
//按天
//计算起止时间的天数
long
day
=
LocalDateUtil
.
betweenDay
(
detail
.
getPolicyStart
().
toString
(),
detail
.
getPolicyEnd
().
toString
());
//预估保费 = (购买标准 / 365) * 天数
BigDecimal
estimatePremium
=
new
BigDecimal
(
detail
.
getBuyStandard
()).
multiply
(
new
BigDecimal
(
day
)).
divide
(
new
BigDecimal
(
"365"
),
CommonConstants
.
TWO_INT
,
BigDecimal
.
ROUND_HALF_UP
);
detail
.
setEstimatePremium
(
estimatePremium
);
if
(
detail
.
getBuyType
()
==
CommonConstants
.
THREE_INT
){
detail
.
setPolicyEffect
(
LocalDate
.
now
().
plusDays
(
CommonConstants
.
ONE_INT
));
}
//记录状态均置为「已投保」
detail
.
setBuyHandleStatus
(
CommonConstants
.
THREE_INT
);
detail
.
setSignFlag
(
CommonConstants
.
ONE_INT
);
//记录的有效状态,置为「有效」
detail
.
setIsEffect
(
CommonConstants
.
ZERO_INT
);
detail
.
setIsOverdue
(
CommonConstants
.
ZERO_INT
);
detail
.
setIsUse
(
CommonConstants
.
ZERO_INT
);
//保费存储
TInsuranceSettle
settle
=
new
TInsuranceSettle
();
settle
.
setInsDetailId
(
detail
.
getId
());
settle
.
setSettleType
(
detail
.
getSettleType
());
settle
.
setSettleHandleStatus
(
CommonConstants
.
ONE_STRING
);
settle
.
setEstimatePremium
(
estimatePremium
);
//调完ekp接口才会是1
settle
.
setIsEstimatePush
(
CommonConstants
.
ONE_INT
);
settle
.
setEstimatePushTime
(
LocalDateTime
.
now
());
settle
.
setCreateTime
(
LocalDateTime
.
now
());
tInsuranceSettleService
.
save
(
settle
);
detail
.
setDefaultSettleId
(
settle
.
getId
());
successList
.
add
(
detail
);
}
}
//记录状态均置为「已投保」
}
detail
.
setBuyHandleStatus
(
CommonConstants
.
THREE_INT
);
//实缴
detail
.
setSignFlag
(
CommonConstants
.
ONE_INT
);
if
(
detail
.
getSettleType
()
==
CommonConstants
.
ONE_INT
){
//记录的有效状态,置为「有效」
detail
.
setIsEffect
(
CommonConstants
.
ZERO_INT
);
detail
.
setIsOverdue
(
CommonConstants
.
ZERO_INT
);
detail
.
setIsUse
(
CommonConstants
.
ZERO_INT
);
//保费存储
TInsuranceSettle
settle
=
new
TInsuranceSettle
();
settle
.
setInsDetailId
(
detail
.
getId
());
settle
.
setSettleType
(
detail
.
getSettleType
());
settle
.
setSettleHandleStatus
(
CommonConstants
.
ONE_STRING
);
settle
.
setEstimatePremium
(
estimatePremium
);
//调完ekp接口才会是1
settle
.
setIsEstimatePush
(
CommonConstants
.
ONE_INT
);
settle
.
setEstimatePushTime
(
LocalDateTime
.
now
());
settle
.
setCreateTime
(
LocalDateTime
.
now
());
tInsuranceSettleService
.
save
(
settle
);
detail
.
setDefaultSettleId
(
settle
.
getId
());
successList
.
add
(
detail
);
}
else
{
//按天
//计算起止时间的天数
long
day
=
LocalDateUtil
.
betweenDay
(
detail
.
getPolicyStart
().
toString
(),
detail
.
getPolicyEnd
().
toString
());
//预估保费 = (购买标准 / 365) * 天数
BigDecimal
estimatePremium
=
new
BigDecimal
(
detail
.
getBuyStandard
()).
multiply
(
new
BigDecimal
(
day
)).
divide
(
new
BigDecimal
(
"365"
),
CommonConstants
.
TWO_INT
,
BigDecimal
.
ROUND_HALF_UP
);
detail
.
setEstimatePremium
(
estimatePremium
);
if
(
detail
.
getBuyType
()
==
CommonConstants
.
THREE_INT
){
if
(
detail
.
getBuyType
()
==
CommonConstants
.
THREE_INT
){
detail
.
setPolicyEffect
(
LocalDate
.
now
().
plusDays
(
CommonConstants
.
ONE_INT
));
detail
.
setPolicyEffect
(
LocalDate
.
now
().
plusDays
(
CommonConstants
.
ONE_INT
));
}
}
...
@@ -880,37 +920,9 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
...
@@ -880,37 +920,9 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
detail
.
setIsEffect
(
CommonConstants
.
ZERO_INT
);
detail
.
setIsEffect
(
CommonConstants
.
ZERO_INT
);
detail
.
setIsOverdue
(
CommonConstants
.
ZERO_INT
);
detail
.
setIsOverdue
(
CommonConstants
.
ZERO_INT
);
detail
.
setIsUse
(
CommonConstants
.
ZERO_INT
);
detail
.
setIsUse
(
CommonConstants
.
ZERO_INT
);
//保费存储
TInsuranceSettle
settle
=
new
TInsuranceSettle
();
settle
.
setInsDetailId
(
detail
.
getId
());
settle
.
setSettleType
(
detail
.
getSettleType
());
settle
.
setSettleHandleStatus
(
CommonConstants
.
ONE_STRING
);
settle
.
setEstimatePremium
(
estimatePremium
);
//调完ekp接口才会是1
settle
.
setIsEstimatePush
(
CommonConstants
.
ONE_INT
);
settle
.
setEstimatePushTime
(
LocalDateTime
.
now
());
settle
.
setCreateTime
(
LocalDateTime
.
now
());
tInsuranceSettleService
.
save
(
settle
);
detail
.
setDefaultSettleId
(
settle
.
getId
());
successList
.
add
(
detail
);
successList
.
add
(
detail
);
}
}
}
}
//实缴
if
(
detail
.
getSettleType
()
==
CommonConstants
.
ONE_INT
){
if
(
detail
.
getBuyType
()
==
CommonConstants
.
THREE_INT
){
detail
.
setPolicyEffect
(
LocalDate
.
now
().
plusDays
(
CommonConstants
.
ONE_INT
));
}
//记录状态均置为「已投保」
detail
.
setBuyHandleStatus
(
CommonConstants
.
THREE_INT
);
detail
.
setSignFlag
(
CommonConstants
.
ONE_INT
);
//记录的有效状态,置为「有效」
detail
.
setIsEffect
(
CommonConstants
.
ZERO_INT
);
detail
.
setIsOverdue
(
CommonConstants
.
ZERO_INT
);
detail
.
setIsUse
(
CommonConstants
.
ZERO_INT
);
successList
.
add
(
detail
);
}
}
}
}
}
}
}
...
...
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