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
5298150d
Commit
5298150d
authored
Apr 22, 2026
by
zhangxingmin
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/test' into test_zxm_lengjingqi
parents
565a0e7c
ae0022b3
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
58 additions
and
57 deletions
+58
-57
yd-csf-api/src/main/java/com/yd/csf/api/service/impl/ApiExpectedFortuneServiceImpl.java
+8
-10
yd-csf-feign/src/main/java/com/yd/csf/feign/request/expectedfortune/ExpectedFortuneUpdateRequest.java
+3
-3
yd-csf-service/src/main/java/com/yd/csf/service/helper/SpeciesConditionMatcher.java
+2
-2
yd-csf-service/src/main/java/com/yd/csf/service/service/impl/CommissionExpectedServiceImpl.java
+1
-1
yd-csf-service/src/main/java/com/yd/csf/service/service/impl/CommissionServiceImpl.java
+28
-27
yd-csf-service/src/main/java/com/yd/csf/service/vo/FortuneVO.java
+10
-8
yd-csf-service/src/main/java/com/yd/csf/service/vo/PayableReportVO.java
+3
-3
yd-csf-service/src/main/java/com/yd/csf/service/vo/ReceivableReportVO.java
+3
-3
No files found.
yd-csf-api/src/main/java/com/yd/csf/api/service/impl/ApiExpectedFortuneServiceImpl.java
View file @
5298150d
...
...
@@ -1324,16 +1324,14 @@ public class ApiExpectedFortuneServiceImpl implements ApiExpectedFortuneService
ExpectedFortune
updateExpectedFortune
=
new
ExpectedFortune
();
BeanUtils
.
copyProperties
(
request
,
updateExpectedFortune
);
updateExpectedFortune
.
setId
(
expectedFortune
.
getId
());
// 默认结算汇率
updateExpectedFortune
.
setDefaultExchangeRate
(
queryExchangeRateByFeign
(
updateExpectedFortune
.
getCurrency
(),
"HKD"
));
// 计算港币金额
updateExpectedFortune
.
setHkdAmount
(
updateExpectedFortune
.
getAmount
().
multiply
(
updateExpectedFortune
.
getDefaultExchangeRate
()));
// 更新待出账金额
updateExpectedFortune
.
setUnpaidAmount
(
updateExpectedFortune
.
getHkdAmount
());
// 如果金额变更,则需要重新计算港币金额和待出账金额
if
(
ObjectUtils
.
notEqual
(
expectedFortune
.
getHkdAmount
(),
request
.
getHkdAmount
()))
{
// 计算港币金额
updateExpectedFortune
.
setHkdAmount
(
request
.
getHkdAmount
());
// 更新待出账金额
updateExpectedFortune
.
setUnpaidAmount
(
request
.
getHkdAmount
());
}
// 获取当前登录用户
AuthUserDto
currentLoginUser
=
SecurityUtil
.
getCurrentLoginUser
();
String
loginUserId
=
currentLoginUser
.
getId
().
toString
();
...
...
yd-csf-feign/src/main/java/com/yd/csf/feign/request/expectedfortune/ExpectedFortuneUpdateRequest.java
View file @
5298150d
...
...
@@ -36,10 +36,10 @@ public class ExpectedFortuneUpdateRequest {
private
LocalDate
actualPayoutDate
;
/**
* 出账金额
*
港币
出账金额
*/
@Schema
(
description
=
"出账金额"
)
private
BigDecimal
a
mount
;
@Schema
(
description
=
"
港币
出账金额"
)
private
BigDecimal
hkdA
mount
;
/**
* 出账状态
...
...
yd-csf-service/src/main/java/com/yd/csf/service/helper/SpeciesConditionMatcher.java
View file @
5298150d
...
...
@@ -79,10 +79,10 @@ public class SpeciesConditionMatcher {
BigDecimal
min
=
new
BigDecimal
(
left
);
return
actual
.
compareTo
(
min
)
>
0
;
}
else
{
// "0-10" 表示
(
0, 10]
// "0-10" 表示
[
0, 10]
BigDecimal
min
=
new
BigDecimal
(
left
);
BigDecimal
max
=
new
BigDecimal
(
right
);
return
actual
.
compareTo
(
min
)
>
0
&&
actual
.
compareTo
(
max
)
<=
0
;
return
actual
.
compareTo
(
min
)
>
=
0
&&
actual
.
compareTo
(
max
)
<=
0
;
}
}
catch
(
Exception
e
)
{
return
false
;
...
...
yd-csf-service/src/main/java/com/yd/csf/service/service/impl/CommissionExpectedServiceImpl.java
View file @
5298150d
...
...
@@ -682,7 +682,7 @@ public class CommissionExpectedServiceImpl extends ServiceImpl<CommissionExpecte
commissionExpected
.
setCommissionRatio
(
item
.
getCommissionRate
());
commissionExpected
.
setAmount
(
null
);
commissionExpected
.
setCurrency
(
item
.
getCurrency
());
commissionExpected
.
setCommissionDate
(
calculateCommissionDate
(
i
,
coolingOffEnd
Date
));
commissionExpected
.
setCommissionDate
(
calculateCommissionDate
(
i
,
effective
Date
));
commissionExpected
.
setStatus
(
CommissionExpectedStatusEnum
.
PENDING
.
getItemValue
());
commissionExpected
.
setStatusDesc
(
null
);
commissionExpected
.
setDefaultExchangeRate
(
queryExchangeRateByFeign
(
policy
.
getCurrency
(),
item
.
getCurrency
()));
...
...
yd-csf-service/src/main/java/com/yd/csf/service/service/impl/CommissionServiceImpl.java
View file @
5298150d
...
...
@@ -280,6 +280,16 @@ public class CommissionServiceImpl extends ServiceImpl<CommissionMapper, Commiss
commission
.
setReconciliationCompany
(
policy
.
getReconciliationCompany
());
commission
.
setReconciliationCompanyCode
(
policy
.
getReconciliationCompanyCode
());
commission
.
setReconciliationCompanyBizId
(
policy
.
getReconciliationCompanyBizId
());
// 本次入账比例
commission
.
setCurrentCommissionRatio
(
calculateCurrentCommissionRatio
(
commission
.
getPremium
(),
commission
.
getAmount
(),
commission
.
getCurrency
(),
commission
.
getExchangeRate
(),
commission
.
getPolicyCurrency
()
)
);
}
// 匹配预计来佣记录
CommissionExpected
expected
=
findExpectedFromList
(
commission
,
commissionExpectedList
);
...
...
@@ -287,9 +297,6 @@ public class CommissionServiceImpl extends ServiceImpl<CommissionMapper, Commiss
commission
.
setCommissionExpectedBizId
(
expected
.
getCommissionExpectedBizId
());
commission
.
setReceivableNo
(
expected
.
getReceivableNo
());
commission
.
setTotalPeriod
(
expected
.
getTotalPeriod
());
// 本次入账比例
commission
.
setCurrentCommissionRatio
(
calculateCurrentCommissionRatio
(
commission
.
getPremium
(),
commission
.
getAmount
(),
commission
.
getCurrency
(),
commission
.
getExchangeRate
(),
expected
));
}
else
{
commission
.
setRemark
(
"未查询到预计来佣记录"
);
commission
.
setStatus
(
CommissionStatusEnum
.
MATCH_FAILED
.
getItemValue
());
...
...
@@ -399,7 +406,7 @@ public class CommissionServiceImpl extends ServiceImpl<CommissionMapper, Commiss
requestAmount
,
commissionUpdateRequest
.
getCurrency
(),
commissionUpdateRequest
.
getExchangeRate
(),
commission
Expected
);
commission
.
getPolicyCurrency
()
);
commission
.
setCurrentCommissionRatio
(
currentCommissionRatio
);
}
}
...
...
@@ -750,7 +757,7 @@ public class CommissionServiceImpl extends ServiceImpl<CommissionMapper, Commiss
return
this
.
getOne
(
new
QueryWrapper
<
Commission
>().
eq
(
"commission_biz_id"
,
commissionBizId
));
}
public
BigDecimal
calculateCurrentCommissionRatio
(
String
premium
,
BigDecimal
amount
,
String
currentCurrency
,
BigDecimal
exchangeRate
,
CommissionExpected
commissionExpected
)
{
public
BigDecimal
calculateCurrentCommissionRatio
(
String
premium
,
BigDecimal
amount
,
String
currentCurrency
,
BigDecimal
exchangeRate
,
String
policyCurrency
)
{
if
(
ObjectUtils
.
isEmpty
(
premium
))
{
throw
new
BusinessException
(
ResultCode
.
NULL_ERROR
.
getCode
(),
"保单保费不能为空"
);
}
...
...
@@ -760,11 +767,9 @@ public class CommissionServiceImpl extends ServiceImpl<CommissionMapper, Commiss
if
(
ObjectUtils
.
isEmpty
(
exchangeRate
))
{
throw
new
BusinessException
(
ResultCode
.
NULL_ERROR
.
getCode
(),
"当前结算汇率不能为空"
);
}
// 获取保单币种
String
currency
=
commissionExpected
.
getPolicyCurrency
();
// 如果当前入账币种等于保单币种,直接计算来佣比例
if
(
StringUtils
.
equalsIgnoreCase
(
currentCurrency
,
c
urrency
))
{
if
(
StringUtils
.
equalsIgnoreCase
(
currentCurrency
,
policyC
urrency
))
{
return
amount
.
divide
(
new
BigDecimal
(
premium
),
4
,
RoundingMode
.
HALF_UP
)
.
multiply
(
new
BigDecimal
(
100
));
}
else
{
...
...
@@ -853,6 +858,14 @@ public class CommissionServiceImpl extends ServiceImpl<CommissionMapper, Commiss
commission
.
setInsuranceCompanyBizId
(
policy
.
getInsuranceCompanyBizId
());
commission
.
setPremium
(
Convert
.
toStr
(
policy
.
getPaymentPremium
()));
commission
.
setPolicyCurrency
(
policy
.
getCurrency
());
// 本次入账比例
commission
.
setCurrentCommissionRatio
(
calculateCurrentCommissionRatio
(
commission
.
getPremium
(),
commission
.
getAmount
(),
commission
.
getCurrency
(),
commission
.
getExchangeRate
(),
commission
.
getPolicyCurrency
())
);
}
else
{
throw
new
BusinessException
(
ResultCode
.
PARAMS_ERROR
.
getCode
(),
"保单不存在, policyNo: "
+
request
.
getPolicyNo
());
}
...
...
@@ -862,10 +875,10 @@ public class CommissionServiceImpl extends ServiceImpl<CommissionMapper, Commiss
}
// 关联预计来佣信息
CommissionExpected
expected
=
getCommissionExpectedBizIdBatch
(
request
,
policyNoSet
,
commission
);
if
(
expected
!=
null
&&
"R"
.
equals
(
expected
.
getCommissionBizType
())
)
{
// 本次入账比例
commission
.
set
CurrentCommissionRatio
(
calculateCurrentCommissionRatio
(
commission
.
getPremium
(),
commission
.
getAmount
(),
commission
.
getCurrency
(),
commission
.
getExchangeRate
(),
expected
));
if
(
expected
!=
null
)
{
commission
.
setCommissionExpectedBizId
(
expected
.
getCommissionExpectedBizId
());
commission
.
set
ReceivableNo
(
expected
.
getReceivableNo
());
commission
.
setTotalPeriod
(
expected
.
getTotalPeriod
(
));
}
commissionList
.
add
(
commission
);
...
...
@@ -978,11 +991,6 @@ public class CommissionServiceImpl extends ServiceImpl<CommissionMapper, Commiss
throw
new
BusinessException
(
ResultCode
.
NULL_ERROR
.
getCode
(),
"来佣记录不存在"
);
}
CommissionExpected
commissionExpected
=
commissionExpectedService
.
getByBizId
(
commission
.
getCommissionExpectedBizId
());
if
(
commissionExpected
!=
null
)
{
throw
new
BusinessException
(
ResultCode
.
NULL_ERROR
.
getCode
(),
"预计来佣已存在"
);
}
// 获取当前登录用户
AuthUserDto
currentLoginUser
=
SecurityUtil
.
getCurrentLoginUser
();
String
loginUserId
=
currentLoginUser
.
getId
().
toString
();
...
...
@@ -990,25 +998,18 @@ public class CommissionServiceImpl extends ServiceImpl<CommissionMapper, Commiss
CommissionExpected
expected
=
new
CommissionExpected
();
BeanUtils
.
copyProperties
(
commission
,
expected
,
"id"
,
"remark"
);
expected
.
setCommissionExpectedBizId
(
RandomStringGenerator
.
generateBizId16
(
"commission_expected"
));
expected
.
setPremium
(
new
BigDecimal
(
commission
.
getPremium
()));
if
(
ObjectUtils
.
isEmpty
(
commission
.
getReconciliationCompanyCode
()))
{
if
(
ObjectUtils
.
isEmpty
(
commission
.
getReconciliationCompanyBizId
()))
{
throw
new
BusinessException
(
ResultCode
.
PARAMS_ERROR
.
getCode
(),
"来佣记录未关联对账公司"
);
}
// 调用对账公司 feignclient,查询对账公司编码
String
reconciliationCompanyCode
=
policyFollowService
.
queryReconciliationCompanyByFeign
(
commission
.
getReconciliationCompanyBizId
());
expected
.
setReconciliationCompanyCode
(
reconciliationCompanyCode
);
commission
.
setReconciliationCompanyCode
(
reconciliationCompanyCode
);
}
// 生成应收单编号
expected
.
setReceivableNo
(
receivableService
.
generateReceivableNo
(
commission
.
getCommissionBizType
(),
commission
.
getReconciliationCompanyCode
(),
commission
.
getReconciliationCompany
()));
// 设置预计入账金额、已来佣金额、待入账金额
expected
.
setCommissionRatio
(
commission
.
getCurrentCommissionRatio
());
expected
.
setExpectedAmount
(
commission
.
getHkdAmount
());
expected
.
setPaidAmount
(
commission
.
getHkdAmount
());
expected
.
setPaidRatio
(
null
);
expected
.
setPaidRatio
(
commission
.
getCurrentCommissionRatio
()
);
expected
.
setDefaultExchangeRate
(
commission
.
getExchangeRate
());
expected
.
setCommissionDate
(
commission
.
getCommissionDate
());
expected
.
setStatus
(
CommissionExpectedStatusEnum
.
COMPARED
.
getItemValue
());
...
...
yd-csf-service/src/main/java/com/yd/csf/service/vo/FortuneVO.java
View file @
5298150d
...
...
@@ -222,10 +222,10 @@ public class FortuneVO implements Serializable {
private
String
status
;
/**
* 出账日(估)
* 出账日(估)
/ 预计发佣月
*/
@Schema
(
description
=
"出账日(估)"
)
@JsonFormat
(
pattern
=
"yyyy-MM
-dd
"
,
timezone
=
"GMT+8"
)
@Schema
(
description
=
"出账日(估)
/ 预计发佣月
"
)
@JsonFormat
(
pattern
=
"yyyy-MM"
,
timezone
=
"GMT+8"
)
private
LocalDate
payoutDate
;
/**
...
...
@@ -233,7 +233,7 @@ public class FortuneVO implements Serializable {
*/
@Schema
(
description
=
"出账日(实)"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd"
,
timezone
=
"GMT+8"
)
private
Date
actualPayoutDate
;
private
Local
Date
actualPayoutDate
;
/**
* 是否含税 0=No, 1=Yes
...
...
@@ -330,13 +330,15 @@ public class FortuneVO implements Serializable {
FortuneVO
fortuneVO
=
new
FortuneVO
();
BeanUtils
.
copyProperties
(
fortune
,
fortuneVO
);
// 计算已出账金额和待出账金额
fortuneVO
.
setFortunePaidAmount
(
fortune
.
getCurrentPaymentHkdAmount
());
fortuneVO
.
setFortuneUnpaidAmount
(
NumberUtil
.
sub
(
fortune
.
getHkdAmount
(),
fortune
.
getCurrentPaymentHkdAmount
()));
// 计算待出账比例
BigDecimal
currentPaymentHkdAmount
=
"2"
.
equals
(
fortune
.
getStatus
())
?
fortune
.
getCurrentPaymentHkdAmount
()
:
BigDecimal
.
ZERO
;
fortuneVO
.
setFortunePaidAmount
(
currentPaymentHkdAmount
);
fortuneVO
.
setFortuneUnpaidAmount
(
NumberUtil
.
sub
(
fortune
.
getHkdAmount
(),
currentPaymentHkdAmount
));
// 计算已出账比例
BigDecimal
currentPaymentRatio
=
NumberUtil
.
div
(
fortune
.
getCurrentPaymentHkdAmount
()
,
fortune
.
getHkdAmount
(),
4
)
.
div
(
currentPaymentHkdAmount
,
fortune
.
getHkdAmount
(),
4
)
.
multiply
(
BigDecimal
.
valueOf
(
100
));
fortuneVO
.
setCurrentPaymentRatio
(
currentPaymentRatio
);
// 计算剩余出账比例
fortuneVO
.
setFortuneUnpaidRatio
(
BigDecimal
.
valueOf
(
100
).
subtract
(
currentPaymentRatio
));
fortuneVO
.
setCurrency
(
CurrencyEnum
.
toLabel
(
fortune
.
getCurrency
()));
...
...
yd-csf-service/src/main/java/com/yd/csf/service/vo/PayableReportVO.java
View file @
5298150d
...
...
@@ -51,10 +51,10 @@ public class PayableReportVO {
private
Integer
fortuneTotalPeriod
;
/**
* 出账日
* 出账日
/ 预计发佣月
*/
@Schema
(
description
=
"出账日 (保单
日+2个月)
"
)
@JsonFormat
(
pattern
=
"yyyy-MM
-dd
"
,
timezone
=
"GMT+8"
)
@Schema
(
description
=
"出账日 (保单
生效日+2个月) / 预计发佣月
"
)
@JsonFormat
(
pattern
=
"yyyy-MM"
,
timezone
=
"GMT+8"
)
private
LocalDate
payoutDate
;
/**
...
...
yd-csf-service/src/main/java/com/yd/csf/service/vo/ReceivableReportVO.java
View file @
5298150d
...
...
@@ -55,10 +55,10 @@ public class ReceivableReportVO {
private
Integer
totalPeriod
;
/**
* 入账日(估)
* 入账日(估)
/ 预计来佣月
*/
@Schema
(
description
=
"入账日(估)(保单生效日+
2个月+(期数-1)年
)"
)
@JsonFormat
(
pattern
=
"yyyy-MM
-dd
"
,
timezone
=
"GMT+8"
)
@Schema
(
description
=
"入账日(估)(保单生效日+
1个月
)"
)
@JsonFormat
(
pattern
=
"yyyy-MM"
,
timezone
=
"GMT+8"
)
private
LocalDate
commissionDate
;
/**
...
...
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