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
dd51c838
Commit
dd51c838
authored
Jan 28, 2026
by
fangxinjiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化-fxj
parent
20d3497a
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
2 deletions
+33
-2
TInsuranceDetailServiceImpl.java
...s/service/insurance/impl/TInsuranceDetailServiceImpl.java
+33
-2
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 @
dd51c838
...
...
@@ -537,22 +537,32 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
}
//计算购买周期:购买周期=保单结束日期-参保开始日期+1(天数);购买周期=保单结束日期-参保开始日期+1(天数)推算出月数;
//按天计费方式
long
day
=
LocalDateUtil
.
betweenDay
(
buyStartDate
.
toString
(),
detail
.
getPolicyEnd
().
toString
());
if
(
null
!=
detail
.
getBillingType
()
&&
CommonConstants
.
ZERO_INT
==
detail
.
getBillingType
().
intValue
()){
//计算预计保费:根据计费方式、购买标准、购买天数/月数等计算:
//“计费方式”为“按天”的,预估保费=购买周期天数/365*购买标准+5元;
//“计费方式”为“按月”的,预估保费=购买周期月数对应的费率*购买标准+5元
//按天计费方式
detail
.
setEstimatePremium
(
new
BigDecimal
(
detail
.
getBuyStandard
())
.
multiply
(
new
BigDecimal
(
purchaseCycle
))
.
multiply
(
new
BigDecimal
(
day
))
.
divide
(
new
BigDecimal
(
"365"
),
2
,
RoundingMode
.
HALF_UP
)
.
add
(
new
BigDecimal
(
"5.00"
)));
TInsuranceTypeRate
typeRate
=
tInsuranceTypeRateService
.
getOne
(
Wrappers
.<
TInsuranceTypeRate
>
query
().
lambda
()
.
eq
(
TInsuranceTypeRate:
:
getInsuranceTypeId
,
detail
.
getInsuranceTypeId
())
.
eq
(
TInsuranceTypeRate:
:
getMonth
,
purchaseCycle
)
.
eq
(
TInsuranceTypeRate:
:
getDeleteFlag
,
CommonConstants
.
ZERO_INT
)
.
last
(
CommonConstants
.
LAST_ONE_SQL
)
);
if
(
null
!=
typeRate
){
detail
.
setRate
(
new
BigDecimal
(
typeRate
.
getRate
()));
}
//按月计费方式
}
else
if
(
null
!=
detail
.
getBillingType
()
&&
CommonConstants
.
ONE_INT
==
detail
.
getBillingType
().
intValue
()){
detail
.
setEstimatePremium
(
new
BigDecimal
(
detail
.
getBuyStandard
())
.
multiply
(
null
==
detail
.
getRate
()?
BigDecimal
.
ZERO
:
detail
.
getRate
())
.
add
(
new
BigDecimal
(
"5.00"
)));
}
long
day
=
LocalDateUtil
.
betweenDay
(
buyStartDate
.
toString
(),
detail
.
getPolicyEnd
().
toString
());
//购买周期
detail
.
setPurchaseCycle
(
purchaseCycle
+
"个月/"
+
day
+
"天"
);
if
(
CommonConstants
.
ZERO_STRING
.
equals
(
detail
.
getIsJfcd
())){
...
...
@@ -2196,6 +2206,27 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
updateEmployeeInsurancePreRenewById
(
detail
,
Stream
.
of
(
"4"
).
collect
(
Collectors
.
toList
()),
CommonConstants
.
SIX_STRING
,
false
);
//如果是见费出单,生成差额数据
if
(
CommonConstants
.
ZERO_STRING
.
equals
(
detail
.
getIsJfcd
())){
//保费存储
TInsuranceSettle
settle
=
new
TInsuranceSettle
();
settle
.
setInsDetailId
(
detail
.
getId
());
settle
.
setSettleType
(
CommonConstants
.
TWO_INT
);
settle
.
setSettleHandleStatus
(
CommonConstants
.
ONE_STRING
);
settle
.
setEstimatePremium
(
BigDecimalUtils
.
safeAdd
(
detail
.
getActualPremium
(),
detail
.
getEstimatePremium
()));
settle
.
setActualPremium
(
BigDecimal
.
ZERO
);
//调完ekp接口才会是1
settle
.
setIsEstimatePush
(
CommonConstants
.
ONE_INT
);
settle
.
setEstimatePushTime
(
LocalDateTime
.
now
());
settle
.
setCreateTime
(
LocalDateTime
.
now
());
settle
.
setId
(
RandomStringUtils
.
randomNumeric
(
19
));
settleList
.
add
(
settle
);
TInsuranceDetail
detailTemp
=
new
TInsuranceDetail
();
BeanCopyUtils
.
copyProperties
(
detail
,
detailTemp
);
detailTemp
.
setDefaultSettleId
(
settle
.
getId
());
detailTemp
.
setEstimatePremium
(
BigDecimalUtils
.
safeAdd
(
detail
.
getActualPremium
(),
detail
.
getEstimatePremium
()));
detailTemp
.
setActualPremium
(
BigDecimal
.
ZERO
);
//差额结算
detailTemp
.
setSettleType
(
CommonConstants
.
TWO_INT
);
successBanlance
.
add
(
detailTemp
);
successThree
.
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