Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yd-csf
Overview
Overview
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
xingmin
yd-csf
Commits
f8230861
Commit
f8230861
authored
Sep 14, 2026
by
jianan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
保费到期提醒7
parent
38a18c82
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
160 additions
and
0 deletions
+160
-0
yd-csf-service/src/main/java/com/yd/csf/service/service/RenewalReminderQueryService.java
+21
-0
yd-csf-service/src/main/java/com/yd/csf/service/service/impl/RenewalRemindBatchServiceImpl.java
+24
-0
yd-csf-service/src/main/java/com/yd/csf/service/service/impl/RenewalReminderQueryServiceImpl.java
+115
-0
No files found.
yd-csf-service/src/main/java/com/yd/csf/service/service/RenewalReminderQueryService.java
0 → 100644
View file @
f8230861
package
com
.
yd
.
csf
.
service
.
service
;
import
com.yd.csf.service.dto.RenewalReminderData
;
import
java.time.LocalDate
;
import
java.time.YearMonth
;
/**
* 续期保单筛选:查询生效保单、计算保费到期日、过滤提醒窗口
*/
public
interface
RenewalReminderQueryService
{
/**
* 构建指定执行月的续期提醒数据。
* 窗口 = [执行月+1 月 1 号, 执行月+2 月月末]。
*
* @param execMonth 执行月
* @param today 当前日期(参数化便于测试)
*/
RenewalReminderData
build
(
YearMonth
execMonth
,
LocalDate
today
);
}
yd-csf-service/src/main/java/com/yd/csf/service/service/impl/RenewalRemindBatchServiceImpl.java
0 → 100644
View file @
f8230861
package
com
.
yd
.
csf
.
service
.
service
.
impl
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.yd.csf.service.dao.RenewalRemindBatchMapper
;
import
com.yd.csf.service.model.RenewalRemindBatch
;
import
com.yd.csf.service.service.IRenewalRemindBatchService
;
import
org.springframework.stereotype.Service
;
/**
* 保单续期提醒发送批次 服务实现类
*/
@Service
public
class
RenewalRemindBatchServiceImpl
extends
ServiceImpl
<
RenewalRemindBatchMapper
,
RenewalRemindBatch
>
implements
IRenewalRemindBatchService
{
@Override
public
RenewalRemindBatch
queryByBizMonth
(
String
bizMonth
)
{
return
this
.
baseMapper
.
selectOne
(
new
LambdaQueryWrapper
<
RenewalRemindBatch
>()
.
eq
(
RenewalRemindBatch:
:
getBizMonth
,
bizMonth
)
.
last
(
" limit 1 "
));
}
}
yd-csf-service/src/main/java/com/yd/csf/service/service/impl/RenewalReminderQueryServiceImpl.java
0 → 100644
View file @
f8230861
package
com
.
yd
.
csf
.
service
.
service
.
impl
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.yd.csf.service.dao.PolicyFollowMapper
;
import
com.yd.csf.service.dto.RenewalDuePolicy
;
import
com.yd.csf.service.dto.RenewalReminderData
;
import
com.yd.csf.service.enums.PolicyFollowStatusEnum
;
import
com.yd.csf.service.model.PolicyFollow
;
import
com.yd.csf.service.service.RenewalReminderQueryService
;
import
com.yd.csf.service.utils.RenewalDueDateCalculator
;
import
com.yd.csf.service.utils.SimpleDateUtils
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.springframework.stereotype.Service
;
import
javax.annotation.Resource
;
import
java.time.LocalDate
;
import
java.time.YearMonth
;
import
java.util.ArrayList
;
import
java.util.Comparator
;
import
java.util.LinkedHashMap
;
import
java.util.List
;
import
java.util.Map
;
/**
* 续期保单筛选实现
*/
@Service
@Slf4j
public
class
RenewalReminderQueryServiceImpl
implements
RenewalReminderQueryService
{
@Resource
private
PolicyFollowMapper
policyFollowMapper
;
@Override
public
RenewalReminderData
build
(
YearMonth
execMonth
,
LocalDate
today
)
{
LocalDate
windowStart
=
execMonth
.
plusMonths
(
1
).
atDay
(
1
);
LocalDate
windowEnd
=
execMonth
.
plusMonths
(
2
).
atEndOfMonth
();
List
<
PolicyFollow
>
effectivePolicies
=
queryEffectivePolicies
();
List
<
RenewalDuePolicy
>
duePolicies
=
new
ArrayList
<>();
Map
<
String
,
String
>
skipped
=
new
LinkedHashMap
<>();
if
(
CollectionUtils
.
isNotEmpty
(
effectivePolicies
))
{
for
(
PolicyFollow
policy
:
effectivePolicies
)
{
RenewalDueDateCalculator
.
Result
result
=
RenewalDueDateCalculator
.
calculate
(
SimpleDateUtils
.
toLocalDate
(
policy
.
getEffectiveDate
()),
policy
.
getPaymentFrequency
(),
policy
.
getIssueNumber
(),
today
);
if
(!
result
.
isIncluded
())
{
if
(
result
.
isAbnormal
())
{
log
.
warn
(
"续期提醒跳过异常保单,policyNo={}, 原因={}"
,
policy
.
getPolicyNo
(),
result
.
getSkipReason
());
skipped
.
put
(
policy
.
getPolicyNo
(),
result
.
getSkipReason
());
}
continue
;
}
LocalDate
dueDate
=
result
.
getDueDate
();
if
(!
dueDate
.
isBefore
(
windowStart
)
&&
!
dueDate
.
isAfter
(
windowEnd
))
{
duePolicies
.
add
(
new
RenewalDuePolicy
(
policy
,
dueDate
));
}
}
}
// 清单按保费到期日升序,同日按保单号
duePolicies
.
sort
(
Comparator
.
comparing
(
RenewalDuePolicy:
:
getDueDate
)
.
thenComparing
(
p
->
p
.
getPolicyFollow
().
getPolicyNo
()));
log
.
info
(
"续期提醒筛选完成,窗口=[{} ~ {}],生效保单={},命中={},异常跳过={}"
,
windowStart
,
windowEnd
,
effectivePolicies
==
null
?
0
:
effectivePolicies
.
size
(),
duePolicies
.
size
(),
skipped
.
size
());
return
new
RenewalReminderData
(
windowStart
,
windowEnd
,
duePolicies
,
skipped
);
}
/**
* 查询全部生效且未删除的保单,只取报表与计算所需字段
*/
private
List
<
PolicyFollow
>
queryEffectivePolicies
()
{
return
policyFollowMapper
.
selectList
(
new
LambdaQueryWrapper
<
PolicyFollow
>()
.
select
(
PolicyFollow:
:
getId
,
PolicyFollow:
:
getPolicyNo
,
PolicyFollow:
:
getProductName
,
PolicyFollow:
:
getPolicyHolder
,
PolicyFollow:
:
getPolicyHolderEn
,
PolicyFollow:
:
getInsured
,
PolicyFollow:
:
getStatus
,
PolicyFollow:
:
getEachIssuePremium
,
PolicyFollow:
:
getPolicyCurrency
,
PolicyFollow:
:
getPolicyLevy
,
PolicyFollow:
:
getEffectiveDate
,
PolicyFollow:
:
getSignDate
,
PolicyFollow:
:
getIssueDate
,
PolicyFollow:
:
getCoolingOffEndDate
,
PolicyFollow:
:
getIssueNumber
,
PolicyFollow:
:
getPaymentFrequency
,
PolicyFollow:
:
getIsPrepay
,
PolicyFollow:
:
getPrepaidTerm
,
PolicyFollow:
:
getProductCate
,
PolicyFollow:
:
getInsuranceCompany
,
PolicyFollow:
:
getReconciliationCompany
,
PolicyFollow:
:
getFirstBroker
,
PolicyFollow:
:
getSigner
,
PolicyFollow:
:
getPracticeCode
,
PolicyFollow:
:
getAppointmentNo
,
PolicyFollow:
:
getSignLocation
)
.
eq
(
PolicyFollow:
:
getStatus
,
PolicyFollowStatusEnum
.
EFFECTIVE
.
getItemValue
())
.
eq
(
PolicyFollow:
:
getIsDeleted
,
0
));
}
}
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