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
c4697352
Commit
c4697352
authored
Nov 28, 2025
by
jianan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新单跟进129
parent
0a4e40bf
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
9 deletions
+32
-9
yd-csf-service/src/main/java/com/yd/csf/service/service/impl/CommissionExpectedServiceImpl.java
+3
-1
yd-csf-service/src/main/java/com/yd/csf/service/service/impl/CommissionServiceImpl.java
+29
-8
No files found.
yd-csf-service/src/main/java/com/yd/csf/service/service/impl/CommissionExpectedServiceImpl.java
View file @
c4697352
...
...
@@ -165,7 +165,9 @@ public class CommissionExpectedServiceImpl extends ServiceImpl<CommissionExpecte
if
(
policy
!=
null
)
{
BigDecimal
expectedAmount
=
policy
.
getPaymentPremium
()
.
multiply
(
commissionExpected
.
getCommissionRatio
())
.
multiply
(
commissionExpected
.
getDefaultExchangeRate
());
.
multiply
(
commissionExpected
.
getDefaultExchangeRate
())
.
multiply
(
BigDecimal
.
valueOf
(
100
))
;
commissionExpected
.
setExpectedAmount
(
expectedAmount
);
}
...
...
yd-csf-service/src/main/java/com/yd/csf/service/service/impl/CommissionServiceImpl.java
View file @
c4697352
...
...
@@ -128,6 +128,8 @@ public class CommissionServiceImpl extends ServiceImpl<CommissionMapper, Commiss
BeanUtils
.
copyProperties
(
commissionUpdateRequest
,
commission
,
"id"
,
"commissionBizId"
);
commission
.
setUpdaterId
(
loginUserId
);
commission
.
setUpdateTime
(
new
Date
());
// 先更新来佣属性
this
.
updateById
(
commission
);
// 查询预计来佣
CommissionExpected
commissionExpected
;
...
...
@@ -141,6 +143,7 @@ public class CommissionServiceImpl extends ServiceImpl<CommissionMapper, Commiss
commission
.
setStatus
(
CommissionStatusEnum
.
COMPARE_FAIL
.
getItemValue
());
commission
.
setRemark
(
e
.
getMessage
());
}
// 更新比对信息
return
this
.
updateById
(
commission
);
}
...
...
@@ -229,6 +232,28 @@ public class CommissionServiceImpl extends ServiceImpl<CommissionMapper, Commiss
commission
.
getPolicyNo
(),
commission
.
getCommissionName
(),
commission
.
getCommissionPeriod
(),
commission
.
getCurrency
());
throw
new
BusinessException
(
ResultCode
.
NULL_ERROR
.
getCode
(),
errorMsg
);
}
// 查询当前来佣对应的所有来佣记录
QueryWrapper
<
Commission
>
queryWrapperCommission
=
new
QueryWrapper
<>();
queryWrapperCommission
.
eq
(
"policy_no"
,
commission
.
getPolicyNo
());
queryWrapperCommission
.
eq
(
"commission_name"
,
commission
.
getCommissionName
());
queryWrapperCommission
.
eq
(
"commission_period"
,
commission
.
getCommissionPeriod
());
queryWrapperCommission
.
eq
(
"currency"
,
commission
.
getCurrency
());
List
<
Commission
>
commissionList
=
this
.
list
(
queryWrapperCommission
);
// 统计已入账金额
BigDecimal
amount
=
commissionList
.
stream
()
.
filter
(
commission1
->
commission1
.
getStatus
().
equals
(
CommissionStatusEnum
.
COMPARE_SUCCESS
.
getItemValue
()))
.
map
(
Commission:
:
getAmount
).
reduce
(
BigDecimal
.
ZERO
,
BigDecimal:
:
add
);
one
.
setPaidAmount
(
amount
);
// 计算预计来佣金额
if
(
one
.
getExpectedAmount
()
==
null
)
{
BigDecimal
expectedAmount
=
new
BigDecimal
(
commission
.
getPremium
())
.
multiply
(
one
.
getCommissionRatio
())
.
multiply
(
one
.
getDefaultExchangeRate
())
.
multiply
(
BigDecimal
.
valueOf
(
100
))
;
one
.
setExpectedAmount
(
expectedAmount
);
}
return
one
;
}
...
...
@@ -496,20 +521,16 @@ public class CommissionServiceImpl extends ServiceImpl<CommissionMapper, Commiss
throw
new
BusinessException
(
ResultCode
.
NULL_ERROR
.
getCode
(),
"当前结算汇率不能为空"
);
}
// 当前来佣比例=当前入账金额/结算汇率/保费
// 当前来佣比例=当前入账金额/结算汇率/保费
* 100
BigDecimal
currentCommissionRatio
=
commission
.
getAmount
()
.
divide
(
new
BigDecimal
(
premium
),
2
,
RoundingMode
.
HALF_UP
)
.
divide
(
new
BigDecimal
(
commission
.
getExchangeRate
()),
2
,
RoundingMode
.
HALF_UP
);
.
divide
(
new
BigDecimal
(
commission
.
getExchangeRate
()),
2
,
RoundingMode
.
HALF_UP
)
.
multiply
(
new
BigDecimal
(
100
))
;
// 预计来佣比例
BigDecimal
expectedCommissionRatio
=
expected
.
getCommissionRatio
();
// 预计总金额
BigDecimal
expectedAmount
=
expected
.
getExpectedAmount
();
if
(
expectedAmount
==
null
||
BigDecimal
.
ZERO
.
compareTo
(
currentCommissionRatio
)
==
0
)
{
expectedAmount
=
new
BigDecimal
(
premium
)
.
multiply
(
expected
.
getCommissionRatio
())
.
multiply
(
expected
.
getDefaultExchangeRate
());
expected
.
setExpectedAmount
(
expectedAmount
);
}
// 已入账金额
BigDecimal
paidAmount
=
commission
.
getAmount
().
add
(
ObjectUtils
.
defaultIfNull
(
expected
.
getPaidAmount
(),
BigDecimal
.
ZERO
));
...
...
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