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
ca9d69dd
Commit
ca9d69dd
authored
Jan 09, 2026
by
jianan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
前端对接问题修复103
parent
61bc09e2
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
33 deletions
+30
-33
yd-csf-service/src/main/java/com/yd/csf/service/service/impl/CommissionServiceImpl.java
+21
-32
yd-csf-service/src/main/java/com/yd/csf/service/service/impl/FortuneServiceImpl.java
+4
-0
yd-csf-service/src/main/java/com/yd/csf/service/vo/FortuneVO.java
+4
-0
yd-csf-service/src/main/resources/mappers/FortuneMapper.xml
+1
-1
No files found.
yd-csf-service/src/main/java/com/yd/csf/service/service/impl/CommissionServiceImpl.java
View file @
ca9d69dd
...
@@ -45,7 +45,6 @@ import java.math.BigDecimal;
...
@@ -45,7 +45,6 @@ import java.math.BigDecimal;
import
java.math.RoundingMode
;
import
java.math.RoundingMode
;
import
java.util.*
;
import
java.util.*
;
import
java.util.function.Function
;
import
java.util.function.Function
;
import
java.util.function.Supplier
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
/**
/**
...
@@ -639,8 +638,11 @@ public class CommissionServiceImpl extends ServiceImpl<CommissionMapper, Commiss
...
@@ -639,8 +638,11 @@ public class CommissionServiceImpl extends ServiceImpl<CommissionMapper, Commiss
fortune
.
setFortuneBizId
(
RandomStringGenerator
.
generateBizId16
(
CommonEnum
.
UID_TYPE_FORTUNE
.
getCode
()));
fortune
.
setFortuneBizId
(
RandomStringGenerator
.
generateBizId16
(
CommonEnum
.
UID_TYPE_FORTUNE
.
getCode
()));
fortune
.
setId
(
null
);
fortune
.
setId
(
null
);
fortune
.
setFortuneBizType
(
"R"
);
fortune
.
setFortuneBizType
(
"R"
);
fortune
.
setExchangeRate
(
queryDefaultExchangeRate
(
fortune
.
getCurrency
()));
fortune
.
setAmount
(
expectedFortune
.
getAmount
());
fortune
.
setAmount
(
expectedFortune
.
getAmount
());
fortune
.
setHkdAmount
(
expectedFortune
.
getAmount
().
multiply
(
fortune
.
getExchangeRate
()));
fortune
.
setCurrentPaymentAmount
(
expectedFortune
.
getAmount
());
fortune
.
setCurrentPaymentAmount
(
expectedFortune
.
getAmount
());
fortune
.
setCurrentPaymentHkdAmount
(
fortune
.
getCurrentPaymentAmount
().
multiply
(
fortune
.
getExchangeRate
()));
fortune
.
setExpectedFortuneBizId
(
expectedFortune
.
getExpectedFortuneBizId
());
fortune
.
setExpectedFortuneBizId
(
expectedFortune
.
getExpectedFortuneBizId
());
fortune
.
setStatus
(
FortuneStatusEnum
.
CAN_SEND
.
getItemValue
());
fortune
.
setStatus
(
FortuneStatusEnum
.
CAN_SEND
.
getItemValue
());
fortune
.
setIsPart
(
0
);
fortune
.
setIsPart
(
0
);
...
@@ -664,6 +666,24 @@ public class CommissionServiceImpl extends ServiceImpl<CommissionMapper, Commiss
...
@@ -664,6 +666,24 @@ public class CommissionServiceImpl extends ServiceImpl<CommissionMapper, Commiss
.
collect
(
Collectors
.
toList
());
.
collect
(
Collectors
.
toList
());
}
}
private
BigDecimal
queryDefaultExchangeRate
(
String
currency
)
{
if
(
StringUtils
.
isBlank
(
currency
))
{
return
BigDecimal
.
ONE
;
}
if
(
"HKD"
.
equalsIgnoreCase
(
currency
))
{
return
BigDecimal
.
valueOf
(
1
);
}
Result
<
List
<
GetDictItemListByDictTypeResponse
>>
result
=
apiSysDictFeignClient
.
getDictItemListByDictType
(
"csf_exchange_rate_hkd"
);
if
(
org
.
apache
.
commons
.
collections4
.
CollectionUtils
.
isNotEmpty
(
result
.
getData
()))
{
for
(
GetDictItemListByDictTypeResponse
dictItem
:
result
.
getData
())
{
if
(
StringUtils
.
equalsIgnoreCase
(
dictItem
.
getItemLabel
(),
currency
))
{
return
new
BigDecimal
(
dictItem
.
getItemValue
());
}
}
}
return
BigDecimal
.
ONE
;
}
/**
/**
* 构建保单号+期次的唯一键
* 构建保单号+期次的唯一键
*/
*/
...
@@ -671,37 +691,6 @@ public class CommissionServiceImpl extends ServiceImpl<CommissionMapper, Commiss
...
@@ -671,37 +691,6 @@ public class CommissionServiceImpl extends ServiceImpl<CommissionMapper, Commiss
return
(
policyNo
==
null
?
""
:
policyNo
)
+
"|"
+
(
period
==
null
?
""
:
period
.
toString
());
return
(
policyNo
==
null
?
""
:
policyNo
)
+
"|"
+
(
period
==
null
?
""
:
period
.
toString
());
}
}
private
void
calculateCurrentFortune
(
Fortune
fortune
,
List
<
Fortune
>
policyPaidFortuneList
)
{
// 根据转介人分组
Map
<
String
,
List
<
Fortune
>>
brokerFortuneMap
=
policyPaidFortuneList
.
stream
()
.
collect
(
Collectors
.
groupingBy
(
Fortune:
:
getBrokerBizId
));
// 当前转介人已发薪资
List
<
Fortune
>
brokerFortuneList
=
brokerFortuneMap
.
getOrDefault
(
fortune
.
getBrokerBizId
(),
new
ArrayList
<>());
// 计算当前佣金条目已发薪资
BigDecimal
brokerPaidAmount
=
brokerFortuneList
.
stream
()
.
filter
(
item
->
StringUtils
.
equals
(
item
.
getFortuneName
(),
fortune
.
getFortuneName
())
&&
item
.
getFortunePeriod
().
equals
(
fortune
.
getFortunePeriod
()))
.
map
(
Fortune:
:
getNetAmount
)
.
reduce
(
BigDecimal
.
ZERO
,
BigDecimal:
:
add
);
// 计算当前发佣金额,需要扣减已发薪资
fortune
.
setAmount
(
fortune
.
getAmount
().
subtract
(
brokerPaidAmount
));
}
private
void
matchCommission
(
Fortune
fortune
,
List
<
Commission
>
commissionList
)
{
for
(
Commission
commission
:
commissionList
)
{
if
(
StringUtils
.
equals
(
commission
.
getPolicyNo
(),
fortune
.
getPolicyNo
())
&&
commission
.
getCommissionPeriod
().
equals
(
fortune
.
getFortunePeriod
())
&&
commission
.
getCommissionName
().
equals
(
fortune
.
getFortuneName
())
)
{
fortune
.
setCommissionBizId
(
commission
.
getCommissionBizId
());
}
else
{
fortune
.
setStatus
(
FortuneStatusEnum
.
MATCH_FAIL
.
getItemValue
());
fortune
.
setRemark
(
"未找到当前预计发佣对应的来佣"
);
}
}
}
@Override
@Override
public
Commission
getByCommissionBizId
(
String
commissionBizId
)
{
public
Commission
getByCommissionBizId
(
String
commissionBizId
)
{
return
this
.
getOne
(
new
QueryWrapper
<
Commission
>().
eq
(
"commission_biz_id"
,
commissionBizId
));
return
this
.
getOne
(
new
QueryWrapper
<
Commission
>().
eq
(
"commission_biz_id"
,
commissionBizId
));
...
...
yd-csf-service/src/main/java/com/yd/csf/service/service/impl/FortuneServiceImpl.java
View file @
ca9d69dd
...
@@ -571,7 +571,11 @@ public class FortuneServiceImpl extends ServiceImpl<FortuneMapper, Fortune>
...
@@ -571,7 +571,11 @@ public class FortuneServiceImpl extends ServiceImpl<FortuneMapper, Fortune>
fortuneStatistics
=
fortuneStatisticsList
.
get
(
0
);
fortuneStatistics
=
fortuneStatisticsList
.
get
(
0
);
}
}
// 计算差额
// 计算差额
if
(
fortuneStatistics
.
getPendingOutAmount
()
!=
null
&&
fortuneStatistics
.
getAvailableOutAmount
()
!=
null
)
{
fortuneStatistics
.
setDifferenceAmount
(
fortuneStatistics
.
getPendingOutAmount
().
subtract
(
fortuneStatistics
.
getAvailableOutAmount
()));
fortuneStatistics
.
setDifferenceAmount
(
fortuneStatistics
.
getPendingOutAmount
().
subtract
(
fortuneStatistics
.
getAvailableOutAmount
()));
}
else
{
fortuneStatistics
.
setDifferenceAmount
(
BigDecimal
.
ZERO
);
}
return
fortuneStatistics
;
return
fortuneStatistics
;
}
}
...
...
yd-csf-service/src/main/java/com/yd/csf/service/vo/FortuneVO.java
View file @
ca9d69dd
...
@@ -293,7 +293,11 @@ public class FortuneVO implements Serializable {
...
@@ -293,7 +293,11 @@ public class FortuneVO implements Serializable {
FortuneVO
fortuneVO
=
new
FortuneVO
();
FortuneVO
fortuneVO
=
new
FortuneVO
();
BeanUtils
.
copyProperties
(
fortune
,
fortuneVO
);
BeanUtils
.
copyProperties
(
fortune
,
fortuneVO
);
// 待出账比例
// 待出账比例
if
(
fortuneVO
.
getCurrentPaymentRatio
()
!=
null
)
{
fortuneVO
.
setFortuneUnpaidRatio
(
BigDecimal
.
valueOf
(
100
).
subtract
(
fortuneVO
.
getCurrentPaymentRatio
()));
fortuneVO
.
setFortuneUnpaidRatio
(
BigDecimal
.
valueOf
(
100
).
subtract
(
fortuneVO
.
getCurrentPaymentRatio
()));
}
else
{
fortuneVO
.
setFortuneUnpaidRatio
(
BigDecimal
.
valueOf
(
100
));
}
return
fortuneVO
;
return
fortuneVO
;
}
}
...
...
yd-csf-service/src/main/resources/mappers/FortuneMapper.xml
View file @
ca9d69dd
...
@@ -68,7 +68,7 @@
...
@@ -68,7 +68,7 @@
(select sum(hkd_amount)
(select sum(hkd_amount)
from expected_fortune where status = '0' and policy_no = f.policy_no
from expected_fortune where status = '0' and policy_no = f.policy_no
),0) AS pendingOutAmount,
),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
in ('6','1')
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,
MAX(ce.premium) AS totalPremium
MAX(ce.premium) AS totalPremium
...
...
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