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
61bc09e2
Commit
61bc09e2
authored
Jan 09, 2026
by
jianan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
前端对接问题修复102
parent
32fab354
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
35 additions
and
49 deletions
+35
-49
yd-csf-service/src/main/java/com/yd/csf/service/model/Fortune.java
+5
-0
yd-csf-service/src/main/java/com/yd/csf/service/service/impl/FortuneServiceImpl.java
+7
-17
yd-csf-service/src/main/java/com/yd/csf/service/vo/ExpectedFortuneExportDTO.java
+3
-3
yd-csf-service/src/main/java/com/yd/csf/service/vo/FortuneVO.java
+14
-27
yd-csf-service/src/main/resources/mappers/FortuneMapper.xml
+6
-2
No files found.
yd-csf-service/src/main/java/com/yd/csf/service/model/Fortune.java
View file @
61bc09e2
...
@@ -169,6 +169,11 @@ public class Fortune implements Serializable {
...
@@ -169,6 +169,11 @@ public class Fortune implements Serializable {
private
LocalDate
actualPayoutDate
;
private
LocalDate
actualPayoutDate
;
/**
/**
* 检核人
*/
private
String
reconciliationOperator
;
/**
* 出账数据业务ID
* 出账数据业务ID
*/
*/
private
String
fortuneAccountBizId
;
private
String
fortuneAccountBizId
;
...
...
yd-csf-service/src/main/java/com/yd/csf/service/service/impl/FortuneServiceImpl.java
View file @
61bc09e2
...
@@ -113,21 +113,16 @@ public class FortuneServiceImpl extends ServiceImpl<FortuneMapper, Fortune>
...
@@ -113,21 +113,16 @@ public class FortuneServiceImpl extends ServiceImpl<FortuneMapper, Fortune>
List
<
FortuneVO
>
fortuneVOList
=
new
ArrayList
<>();
List
<
FortuneVO
>
fortuneVOList
=
new
ArrayList
<>();
Set
<
String
>
expectedFortuneBizIdSet
=
new
HashSet
<>();
Set
<
String
>
expectedFortuneBizIdSet
=
new
HashSet
<>();
Set
<
String
>
commissionBizIdSet
=
new
HashSet
<>();
Set
<
String
>
policyNoSet
=
new
HashSet
<>();
Set
<
String
>
policyNoSet
=
new
HashSet
<>();
for
(
Fortune
fortune
:
fortuneList
)
{
for
(
Fortune
fortune
:
fortuneList
)
{
FortuneVO
fortuneVO
=
FortuneVO
.
objToVo
(
fortune
);
FortuneVO
fortuneVO
=
FortuneVO
.
objToVo
(
fortune
);
fortuneVOList
.
add
(
fortuneVO
);
fortuneVOList
.
add
(
fortuneVO
);
expectedFortuneBizIdSet
.
add
(
fortune
.
getExpectedFortuneBizId
());
expectedFortuneBizIdSet
.
add
(
fortune
.
getExpectedFortuneBizId
());
commissionBizIdSet
.
add
(
fortune
.
getCommissionBizId
());
policyNoSet
.
add
(
fortune
.
getPolicyNo
());
policyNoSet
.
add
(
fortune
.
getPolicyNo
());
}
}
// 1.关联查询来佣信息
List
<
Commission
>
commissionList
=
commissionService
.
list
(
new
QueryWrapper
<
Commission
>().
in
(
"commission_biz_id"
,
commissionBizIdSet
));
Map
<
String
,
Commission
>
commissionMap
=
commissionList
.
stream
().
collect
(
Collectors
.
toMap
(
Commission:
:
getCommissionBizId
,
a
->
a
,
(
oldValue
,
newValue
)
->
newValue
));
Set
<
String
>
commissionExpectedBizIdSet
=
commissionList
.
stream
().
map
(
Commission
:
:
getCommissionExpectedBizId
).
collect
(
Collectors
.
toSet
());
Set
<
String
>
commissionExpectedBizIdSet
=
fortuneList
.
stream
().
map
(
Fortune
:
:
getCommissionExpectedBizId
).
collect
(
Collectors
.
toSet
());
// 1
.1
关联查询来佣预期信息
// 1 关联查询来佣预期信息
List
<
CommissionExpected
>
commissionExpectedList
=
commissionExpectedService
.
lambdaQuery
()
List
<
CommissionExpected
>
commissionExpectedList
=
commissionExpectedService
.
lambdaQuery
()
.
in
(
CommissionExpected:
:
getCommissionExpectedBizId
,
commissionExpectedBizIdSet
)
.
in
(
CommissionExpected:
:
getCommissionExpectedBizId
,
commissionExpectedBizIdSet
)
.
select
(
CommissionExpected:
:
getCommissionExpectedBizId
,
CommissionExpected:
:
getPaidAmount
,
CommissionExpected:
:
getPaidRatio
)
.
select
(
CommissionExpected:
:
getCommissionExpectedBizId
,
CommissionExpected:
:
getPaidAmount
,
CommissionExpected:
:
getPaidRatio
)
...
@@ -146,16 +141,13 @@ public class FortuneServiceImpl extends ServiceImpl<FortuneMapper, Fortune>
...
@@ -146,16 +141,13 @@ public class FortuneServiceImpl extends ServiceImpl<FortuneMapper, Fortune>
Map
<
String
,
ExpectedFortune
>
expectedFortuneMap
=
expectedFortuneList
.
stream
().
collect
(
Collectors
.
toMap
(
ExpectedFortune:
:
getExpectedFortuneBizId
,
a
->
a
,
(
oldValue
,
newValue
)
->
newValue
));
Map
<
String
,
ExpectedFortune
>
expectedFortuneMap
=
expectedFortuneList
.
stream
().
collect
(
Collectors
.
toMap
(
ExpectedFortune:
:
getExpectedFortuneBizId
,
a
->
a
,
(
oldValue
,
newValue
)
->
newValue
));
fortuneVOList
.
forEach
(
fortuneVO
->
{
fortuneVOList
.
forEach
(
fortuneVO
->
{
String
commissionBizId
=
fortuneVO
.
getCommissionBizId
();
String
commissionBizId
=
fortuneVO
.
getCommissionExpectedBizId
();
Commission
commission
=
commissionMap
.
get
(
commissionBizId
);
if
(
commission
!=
null
)
{
// 设置来佣金额和比例
// 设置来佣金额和比例
CommissionExpected
commissionExpected
=
commissionExpectedMap
.
get
(
commission
.
getCommissionExpectedBizId
()
);
CommissionExpected
commissionExpected
=
commissionExpectedMap
.
get
(
commissionBizId
);
if
(
commissionExpected
!=
null
)
{
if
(
commissionExpected
!=
null
)
{
fortuneVO
.
setCommissionPaidAmount
(
commissionExpected
.
getPaidAmount
());
fortuneVO
.
setCommissionPaidAmount
(
commissionExpected
.
getPaidAmount
());
fortuneVO
.
setCommissionPaidRatio
(
commissionExpected
.
getPaidRatio
());
fortuneVO
.
setCommissionPaidRatio
(
commissionExpected
.
getPaidRatio
());
}
}
}
// 设置保单信息
// 设置保单信息
Policy
policy
=
policyMap
.
get
(
fortuneVO
.
getPolicyNo
());
Policy
policy
=
policyMap
.
get
(
fortuneVO
.
getPolicyNo
());
...
@@ -164,11 +156,6 @@ public class FortuneServiceImpl extends ServiceImpl<FortuneMapper, Fortune>
...
@@ -164,11 +156,6 @@ public class FortuneServiceImpl extends ServiceImpl<FortuneMapper, Fortune>
fortuneVO
.
setInsuranceCompany
(
policy
.
getInsuranceCompany
());
fortuneVO
.
setInsuranceCompany
(
policy
.
getInsuranceCompany
());
fortuneVO
.
setProductName
(
policy
.
getProductName
());
fortuneVO
.
setProductName
(
policy
.
getProductName
());
}
}
// 设置预计出账信息
ExpectedFortune
expectedFortune
=
expectedFortuneMap
.
get
(
fortuneVO
.
getExpectedFortuneBizId
());
if
(
expectedFortune
!=
null
)
{
FortuneVO
.
calculateByExpectedFortune
(
fortuneVO
,
expectedFortune
);
}
});
});
fortuneVOPage
.
setRecords
(
fortuneVOList
);
fortuneVOPage
.
setRecords
(
fortuneVOList
);
...
@@ -222,6 +209,9 @@ public class FortuneServiceImpl extends ServiceImpl<FortuneMapper, Fortune>
...
@@ -222,6 +209,9 @@ public class FortuneServiceImpl extends ServiceImpl<FortuneMapper, Fortune>
AuthUserDto
currentLoginUser
=
SecurityUtil
.
getCurrentLoginUser
();
AuthUserDto
currentLoginUser
=
SecurityUtil
.
getCurrentLoginUser
();
String
loginUserId
=
currentLoginUser
.
getId
().
toString
();
String
loginUserId
=
currentLoginUser
.
getId
().
toString
();
// 检核人
fortune
.
setReconciliationOperator
(
currentLoginUser
.
getUsername
());
// 如果传入了金额
// 如果传入了金额
if
(
currentPaymentAmount
!=
null
)
{
if
(
currentPaymentAmount
!=
null
)
{
splitFortune
(
fortune
,
currentPaymentAmount
,
expectedFortune
,
loginUserId
,
fortuneUpdateRequest
);
splitFortune
(
fortune
,
currentPaymentAmount
,
expectedFortune
,
loginUserId
,
fortuneUpdateRequest
);
...
...
yd-csf-service/src/main/java/com/yd/csf/service/vo/ExpectedFortuneExportDTO.java
View file @
61bc09e2
...
@@ -33,15 +33,15 @@ public class ExpectedFortuneExportDTO {
...
@@ -33,15 +33,15 @@ public class ExpectedFortuneExportDTO {
@ExcelProperty
(
"保单号"
)
@ExcelProperty
(
"保单号"
)
private
String
policyNo
;
private
String
policyNo
;
@ExcelProperty
(
"出账状态"
)
private
String
status
;
@ExcelProperty
(
"转介人名称"
)
@ExcelProperty
(
"转介人名称"
)
private
String
broker
;
private
String
broker
;
@ExcelProperty
(
"团队名称"
)
@ExcelProperty
(
"团队名称"
)
private
String
team
;
private
String
team
;
@ExcelProperty
(
"出账状态"
)
private
String
status
;
@ExcelProperty
(
"出账币种"
)
@ExcelProperty
(
"出账币种"
)
private
String
currency
;
private
String
currency
;
...
...
yd-csf-service/src/main/java/com/yd/csf/service/vo/FortuneVO.java
View file @
61bc09e2
...
@@ -77,6 +77,12 @@ public class FortuneVO implements Serializable {
...
@@ -77,6 +77,12 @@ public class FortuneVO implements Serializable {
private
String
commissionBizId
;
private
String
commissionBizId
;
/**
/**
* 来佣预期业务id
*/
@Schema
(
description
=
"来佣预期业务id"
)
private
String
commissionExpectedBizId
;
/**
* 已入账来佣金额(HKD)
* 已入账来佣金额(HKD)
*/
*/
@Schema
(
description
=
"已入账来佣金额(HKD)"
)
@Schema
(
description
=
"已入账来佣金额(HKD)"
)
...
@@ -155,18 +161,6 @@ public class FortuneVO implements Serializable {
...
@@ -155,18 +161,6 @@ public class FortuneVO implements Serializable {
private
String
currency
;
private
String
currency
;
/**
/**
* 已出账金额
*/
@Schema
(
description
=
"已出账金额"
)
private
BigDecimal
fortunePaidAmount
;
/**
* 待出账金额
*/
@Schema
(
description
=
"剩余出账金额"
)
private
BigDecimal
fortuneUnpaidAmount
;
/**
* 本期出账金额
* 本期出账金额
*/
*/
@Schema
(
description
=
"本期出账金额"
)
@Schema
(
description
=
"本期出账金额"
)
...
@@ -259,6 +253,12 @@ public class FortuneVO implements Serializable {
...
@@ -259,6 +253,12 @@ public class FortuneVO implements Serializable {
private
String
creatorId
;
private
String
creatorId
;
/**
/**
* 操作人
*/
@Schema
(
description
=
"操作人"
)
private
String
reconciliationOperator
;
/**
* 更新人ID
* 更新人ID
*/
*/
@Schema
(
description
=
"更新人ID"
)
@Schema
(
description
=
"更新人ID"
)
...
@@ -292,22 +292,9 @@ public class FortuneVO implements Serializable {
...
@@ -292,22 +292,9 @@ public class FortuneVO implements Serializable {
}
}
FortuneVO
fortuneVO
=
new
FortuneVO
();
FortuneVO
fortuneVO
=
new
FortuneVO
();
BeanUtils
.
copyProperties
(
fortune
,
fortuneVO
);
BeanUtils
.
copyProperties
(
fortune
,
fortuneVO
);
// 待出账比例
fortuneVO
.
setFortuneUnpaidRatio
(
BigDecimal
.
valueOf
(
100
).
subtract
(
fortuneVO
.
getCurrentPaymentRatio
()));
return
fortuneVO
;
return
fortuneVO
;
}
}
public
static
void
calculateByExpectedFortune
(
FortuneVO
fortuneVO
,
ExpectedFortune
expectedFortune
)
{
BigDecimal
amount
=
expectedFortune
.
getAmount
();
BigDecimal
paidAmount
=
expectedFortune
.
getPaidAmount
();
if
(
amount
!=
null
&&
paidAmount
!=
null
)
{
fortuneVO
.
setAmount
(
amount
);
fortuneVO
.
setFortunePaidAmount
(
paidAmount
);
BigDecimal
unpaidAmount
=
amount
.
subtract
(
paidAmount
);
fortuneVO
.
setFortuneUnpaidAmount
(
unpaidAmount
);
fortuneVO
.
setFortuneUnpaidRatio
(
unpaidAmount
.
divide
(
amount
,
4
,
RoundingMode
.
HALF_UP
).
multiply
(
BigDecimal
.
valueOf
(
100
)));
}
}
}
}
yd-csf-service/src/main/resources/mappers/FortuneMapper.xml
View file @
61bc09e2
...
@@ -33,6 +33,7 @@
...
@@ -33,6 +33,7 @@
<result
property=
"status"
column=
"status"
/>
<result
property=
"status"
column=
"status"
/>
<result
property=
"payoutDate"
column=
"payout_date"
/>
<result
property=
"payoutDate"
column=
"payout_date"
/>
<result
property=
"actualPayoutDate"
column=
"actual_payout_date"
/>
<result
property=
"actualPayoutDate"
column=
"actual_payout_date"
/>
<result
property=
"reconciliationOperator"
column=
"reconciliation_operator"
/>
<result
property=
"isTax"
column=
"is_tax"
/>
<result
property=
"isTax"
column=
"is_tax"
/>
<result
property=
"taxAmount"
column=
"tax_amount"
/>
<result
property=
"taxAmount"
column=
"tax_amount"
/>
<result
property=
"netAmount"
column=
"net_amount"
/>
<result
property=
"netAmount"
column=
"net_amount"
/>
...
@@ -53,7 +54,7 @@
...
@@ -53,7 +54,7 @@
commission_biz_id,commission_expected_biz_id,policy_no,fortune_period,fortune_total_period,broker_biz_id,
commission_biz_id,commission_expected_biz_id,policy_no,fortune_period,fortune_total_period,broker_biz_id,
team_biz_id,grade_commission_rate,share_rate,fortune_name,fortune_type,is_part,
team_biz_id,grade_commission_rate,share_rate,fortune_name,fortune_type,is_part,
amount,currency,exchange_rate,hkd_amount,current_payment_amount,current_payment_hkd_amount,current_payment_ratio,status,payout_date,actual_payout_date,is_tax,
amount,currency,exchange_rate,hkd_amount,current_payment_amount,current_payment_hkd_amount,current_payment_ratio,status,payout_date,actual_payout_date,is_tax,
tax_amount,net_amount,salary_biz_id,base_rule_biz_id,settlement_biz_id,
tax_amount,net_amount,salary_biz_id,base_rule_biz_id,settlement_biz_id,
reconciliation_operator,
calculation_formula,remark,is_deleted,creator_id,updater_id,
calculation_formula,remark,is_deleted,creator_id,updater_id,
create_time,update_time
create_time,update_time
</sql>
</sql>
...
@@ -63,7 +64,10 @@
...
@@ -63,7 +64,10 @@
f.policy_no,
f.policy_no,
SUM(CASE WHEN f.is_part = '0' THEN f.hkd_amount ELSE 0 END) AS amount,
SUM(CASE WHEN f.is_part = '0' THEN f.hkd_amount ELSE 0 END) AS amount,
SUM(CASE WHEN f.status = '2' THEN f.current_payment_hkd_amount ELSE 0 END) AS sentAmount,
SUM(CASE WHEN f.status = '2' THEN f.current_payment_hkd_amount ELSE 0 END) AS sentAmount,
SUM(CASE WHEN f.status = '0' THEN f.current_payment_hkd_amount ELSE 0 END) AS pendingOutAmount,
IFNULL(
(select sum(hkd_amount)
from expected_fortune where status = '0' and policy_no = f.policy_no
),0) AS pendingOutAmount,
SUM(CASE WHEN f.status = '6' THEN f.current_payment_hkd_amount ELSE 0 END) AS availableOutAmount,
SUM(CASE WHEN f.status = '6' THEN f.current_payment_hkd_amount ELSE 0 END) AS availableOutAmount,
COUNT(DISTINCT f.policy_no) AS totalPolicyCount,
COUNT(DISTINCT f.policy_no) AS totalPolicyCount,
MAX(ce.expected_amount) AS totalInAmount,
MAX(ce.expected_amount) AS totalInAmount,
...
...
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