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
2a8e305a
Commit
2a8e305a
authored
Jul 10, 2026
by
jianan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
生成可出帐,根据入账记录的 保单号+期数 获取
parent
8868d149
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
17 deletions
+17
-17
yd-csf-service/src/main/java/com/yd/csf/service/service/impl/CommissionServiceImpl.java
+17
-17
No files found.
yd-csf-service/src/main/java/com/yd/csf/service/service/impl/CommissionServiceImpl.java
View file @
2a8e305a
...
@@ -634,11 +634,16 @@ public class CommissionServiceImpl extends ServiceImpl<CommissionMapper, Commiss
...
@@ -634,11 +634,16 @@ public class CommissionServiceImpl extends ServiceImpl<CommissionMapper, Commiss
List
<
ExpectedFortune
>
expectedFortuneList
=
iExpectedFortuneService
.
lambdaQuery
()
List
<
ExpectedFortune
>
expectedFortuneList
=
iExpectedFortuneService
.
lambdaQuery
()
.
in
(
ExpectedFortune:
:
getPolicyNo
,
policyNoSet
)
.
in
(
ExpectedFortune:
:
getPolicyNo
,
policyNoSet
)
.
list
();
.
list
();
// 1.2 根据期数筛选符合的预计发佣记录
Set
<
Integer
>
commissionPeriodSet
=
commissions
.
stream
().
map
(
Commission:
:
getCommissionPeriod
).
collect
(
Collectors
.
toSet
());
// 1.2 构建保单号+佣金期数的快速查找集合
Set
<
String
>
commissionKeySet
=
commissions
.
stream
()
.
map
(
c
->
c
.
getPolicyNo
()
+
"_"
+
c
.
getCommissionPeriod
())
.
collect
(
Collectors
.
toSet
());
// 1.3 根据保单号+佣金期数筛选符合的预计发佣记录
List
<
ExpectedFortune
>
filteredExpectedFortuneList1
=
new
ArrayList
<>();
List
<
ExpectedFortune
>
filteredExpectedFortuneList1
=
new
ArrayList
<>();
for
(
ExpectedFortune
expectedFortune
:
expectedFortuneList
)
{
for
(
ExpectedFortune
expectedFortune
:
expectedFortuneList
)
{
if
(
commission
PeriodSet
.
contains
(
expectedFortune
.
getFortunePeriod
()))
{
if
(
commission
KeySet
.
contains
(
expectedFortune
.
getPolicyNo
()
+
"_"
+
expectedFortune
.
getFortunePeriod
()))
{
filteredExpectedFortuneList1
.
add
(
expectedFortune
);
filteredExpectedFortuneList1
.
add
(
expectedFortune
);
}
}
}
}
...
@@ -674,7 +679,7 @@ public class CommissionServiceImpl extends ServiceImpl<CommissionMapper, Commiss
...
@@ -674,7 +679,7 @@ public class CommissionServiceImpl extends ServiceImpl<CommissionMapper, Commiss
}
}
// 2.4 根据保单号、期数查询入账检核汇率
// 2.4 根据保单号、期数查询入账检核汇率
Map
<
String
,
BigDecimal
>
exchangeRateMap
=
this
.
queryCommissionExchangeRateMap
(
policyNoSet
,
commissionPeriodSet
);
Map
<
String
,
BigDecimal
>
exchangeRateMap
=
this
.
queryCommissionExchangeRateMap
(
commissions
);
// 3. 构建实际的初始发佣记录(使用入账检核汇率)
// 3. 构建实际的初始发佣记录(使用入账检核汇率)
List
<
Fortune
>
newFortuneList
=
buildNewFortunes
(
filteredExpectedFortuneList2
,
commissions
,
exchangeRateMap
);
List
<
Fortune
>
newFortuneList
=
buildNewFortunes
(
filteredExpectedFortuneList2
,
commissions
,
exchangeRateMap
);
...
@@ -685,18 +690,15 @@ public class CommissionServiceImpl extends ServiceImpl<CommissionMapper, Commiss
...
@@ -685,18 +690,15 @@ public class CommissionServiceImpl extends ServiceImpl<CommissionMapper, Commiss
return
true
;
return
true
;
}
}
private
Map
<
String
,
BigDecimal
>
queryCommissionExchangeRateMap
(
Set
<
String
>
policyNoSet
,
Set
<
Integer
>
commissionPeriodSet
)
{
private
Map
<
String
,
BigDecimal
>
queryCommissionExchangeRateMap
(
List
<
Commission
>
commissions
)
{
if
(
CollectionUtils
.
isEmpty
(
policyNoSet
)
||
CollectionUtils
.
isEmpty
(
commissionPeriodSet
))
{
if
(
CollectionUtils
.
isEmpty
(
commissions
))
{
return
new
HashMap
<>();
return
new
HashMap
<>();
}
}
// 1. 查询所有符合条件的记录,按入账日期降序排序
// 1. 按入账日期降序排序
List
<
Commission
>
commissionExchangeRateList
=
this
.
lambdaQuery
()
List
<
Commission
>
commissionExchangeRateList
=
commissions
.
stream
()
.
in
(
Commission:
:
getPolicyNo
,
policyNoSet
)
.
sorted
(
Comparator
.
comparing
(
Commission:
:
getCommissionDate
).
reversed
())
.
in
(
Commission:
:
getCommissionPeriod
,
commissionPeriodSet
)
.
collect
(
Collectors
.
toList
());
.
select
(
Commission:
:
getPolicyNo
,
Commission:
:
getCommissionPeriod
,
Commission:
:
getExchangeRate
,
Commission:
:
getCommissionDate
)
.
orderByDesc
(
Commission:
:
getId
)
.
list
();
// 2. 按 policyNo + commissionPeriod 分组,取每组的第一条(最新的)
// 2. 按 policyNo + commissionPeriod 分组,取每组的第一条(最新的)
Map
<
String
,
BigDecimal
>
exchangeRateMap
=
commissionExchangeRateList
.
stream
()
Map
<
String
,
BigDecimal
>
exchangeRateMap
=
commissionExchangeRateList
.
stream
()
...
@@ -711,12 +713,10 @@ public class CommissionServiceImpl extends ServiceImpl<CommissionMapper, Commiss
...
@@ -711,12 +713,10 @@ public class CommissionServiceImpl extends ServiceImpl<CommissionMapper, Commiss
// 3. 确保所有 policyNo + commissionPeriod 组合都在 Map 中,没有记录的设为 null
// 3. 确保所有 policyNo + commissionPeriod 组合都在 Map 中,没有记录的设为 null
Map
<
String
,
BigDecimal
>
result
=
new
HashMap
<>();
Map
<
String
,
BigDecimal
>
result
=
new
HashMap
<>();
for
(
String
policyNo
:
policyNoSet
)
{
for
(
Commission
commission
:
commissions
)
{
for
(
Integer
commissionPeriod
:
commissionPeriodSet
)
{
String
key
=
buildPolicyPeriodKey
(
commission
.
getPolicyNo
(),
commission
.
getCommissionPeriod
());
String
key
=
buildPolicyPeriodKey
(
policyNo
,
commissionPeriod
);
result
.
put
(
key
,
exchangeRateMap
.
getOrDefault
(
key
,
null
));
result
.
put
(
key
,
exchangeRateMap
.
getOrDefault
(
key
,
null
));
}
}
}
return
result
;
return
result
;
}
}
...
...
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