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
8af5cb04
Commit
8af5cb04
authored
Apr 29, 2026
by
zhangxingmin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
push
parent
f0f7e31b
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
319 additions
and
232 deletions
+319
-232
yd-csf-service/src/main/java/com/yd/csf/service/service/impl/CommissionExpectedServiceImpl.java
+85
-47
yd-csf-service/src/main/java/com/yd/csf/service/vo/CommissionExpectedNewVO.java
+234
-185
No files found.
yd-csf-service/src/main/java/com/yd/csf/service/service/impl/CommissionExpectedServiceImpl.java
View file @
8af5cb04
...
@@ -155,6 +155,11 @@ public class CommissionExpectedServiceImpl extends ServiceImpl<CommissionExpecte
...
@@ -155,6 +155,11 @@ public class CommissionExpectedServiceImpl extends ServiceImpl<CommissionExpecte
* @param commissionExpectedPage
* @param commissionExpectedPage
* @return
* @return
*/
*/
/**
* 应收款管理列表查询(新版混合结果)
* @param commissionExpectedPage 预计来佣分页对象
* @return 混合主从记录的分页结果
*/
@Override
@Override
public
Page
<
CommissionExpectedNewVO
>
getCommissionExpectedVONewPage
(
Page
<
CommissionExpected
>
commissionExpectedPage
)
{
public
Page
<
CommissionExpectedNewVO
>
getCommissionExpectedVONewPage
(
Page
<
CommissionExpected
>
commissionExpectedPage
)
{
List
<
CommissionExpected
>
commissionExpectedList
=
commissionExpectedPage
.
getRecords
();
List
<
CommissionExpected
>
commissionExpectedList
=
commissionExpectedPage
.
getRecords
();
...
@@ -220,113 +225,128 @@ public class CommissionExpectedServiceImpl extends ServiceImpl<CommissionExpecte
...
@@ -220,113 +225,128 @@ public class CommissionExpectedServiceImpl extends ServiceImpl<CommissionExpecte
}
}
resultPage
.
setRecords
(
mixedRecords
);
resultPage
.
setRecords
(
mixedRecords
);
// 回填对账公司名称
// 回填对账公司名称(类似 enrichReceivableReportWithCompanyName)
enrichCommissionExpectedNewVOWithCompanyName
(
resultPage
);
enrichCommissionExpectedNewVOWithCompanyName
(
resultPage
);
return
resultPage
;
return
resultPage
;
}
}
/**
/**
* 构建主记录(预计来佣,type=1)
* 构建主记录(预计来佣)
* 参考 getCommissionExpectedVOPage 的填充逻辑
* 计算:实佣率(realRate) = 累积已入账比例(paidRatio)
* 当实佣率 >= 产品对应来佣率时,待入账金额设置为0
* 达成率缺口(gapRate) = 1 - (实佣率 / 产品来佣率)
* 实收金额(realAmount) = 累积已入账金额(paidAmount)
* 本次入账比例(revenueRatio) 不适用,设为null
*/
*/
private
CommissionExpectedNewVO
buildMainVo
(
CommissionExpected
expected
,
private
CommissionExpectedNewVO
buildMainVo
(
CommissionExpected
expected
,
Map
<
String
,
Policy
>
policyMap
,
Map
<
String
,
Policy
>
policyMap
,
Map
<
String
,
PolicyFollow
>
policyFollowMap
)
{
Map
<
String
,
PolicyFollow
>
policyFollowMap
)
{
CommissionExpectedNewVO
vo
=
new
CommissionExpectedNewVO
();
CommissionExpectedNewVO
vo
=
new
CommissionExpectedNewVO
();
BeanUtils
.
copyProperties
(
expected
,
vo
);
BeanUtils
.
copyProperties
(
expected
,
vo
);
// 入账年月(估):取预计来佣日期
vo
.
setCommissionDateMonth
(
expected
.
getCommissionDate
());
vo
.
setType
(
1
);
vo
.
setType
(
1
);
// 主记录编号:优先使用应收款编号,若为空则用业务ID
vo
.
setNo
(
StringUtils
.
isNotBlank
(
expected
.
getReceivableNo
())
?
expected
.
getReceivableNo
()
:
expected
.
getCommissionExpectedBizId
());
vo
.
setNo
(
StringUtils
.
isNotBlank
(
expected
.
getReceivableNo
())
?
expected
.
getReceivableNo
()
:
expected
.
getCommissionExpectedBizId
());
// 填充保单
相关信息(与 getCommissionExpectedVOPage 一致)
// 填充保单
信息
Policy
policy
=
policyMap
.
get
(
expected
.
getPolicyNo
());
Policy
policy
=
policyMap
.
get
(
expected
.
getPolicyNo
());
if
(
policy
!=
null
)
{
if
(
policy
!=
null
)
{
vo
.
setPremium
(
policy
.
getPaymentPremium
());
vo
.
setPremium
(
policy
.
getPaymentPremium
());
vo
.
setPolicyCurrency
(
policy
.
getCurrency
());
vo
.
setPolicyCurrency
(
policy
.
getCurrency
());
vo
.
setInsuranceCompany
(
policy
.
getInsuranceCompany
());
vo
.
setInsuranceCompany
(
policy
.
getInsuranceCompany
());
vo
.
setReconciliationCompany
(
policy
.
getReconciliationCompany
());
// 临时名称,后续通过公司服务回填
vo
.
setReconciliationCompany
(
policy
.
getReconciliationCompany
());
}
}
// 填充产品计划信息(优先使用 PolicyFollow 中的产品名称)
PolicyFollow
policyFollow
=
policyFollowMap
.
get
(
expected
.
getPolicyNo
());
PolicyFollow
policyFollow
=
policyFollowMap
.
get
(
expected
.
getPolicyNo
());
if
(
policyFollow
!=
null
)
{
if
(
policyFollow
!=
null
)
{
vo
.
setProductName
(
policyFollow
.
getProductName
());
vo
.
setProductName
(
policyFollow
.
getProductName
());
vo
.
setProductLaunchBizId
(
policyFollow
.
getProductLaunchBizId
());
//
vo.setProductLaunchBizId(policyFollow.getProductLaunchBizId());
}
}
//
获取累计已入账金额、比例(来自预计来佣表)
//
累积数据
BigDecimal
paidAmount
=
ObjectUtils
.
defaultIfNull
(
expected
.
getPaidAmount
(),
BigDecimal
.
ZERO
);
BigDecimal
paidAmount
=
ObjectUtils
.
defaultIfNull
(
expected
.
getPaidAmount
(),
BigDecimal
.
ZERO
);
BigDecimal
paidRatio
=
ObjectUtils
.
defaultIfNull
(
expected
.
getPaidRatio
(),
BigDecimal
.
ZERO
);
BigDecimal
paidRatio
=
ObjectUtils
.
defaultIfNull
(
expected
.
getPaidRatio
(),
BigDecimal
.
ZERO
);
if
(
expected
.
getCommissionRatio
()
!=
null
)
{
// 关联保单应收单(有预期来佣比例)
vo
.
setPaidRatio
(
paidRatio
);
vo
.
setPaidRatio
(
paidRatio
);
vo
.
setPaidAmount
(
paidAmount
);
// vo.setPaidAmount(paidAmount);
vo
.
setRealAmount
(
paidAmount
);
// 实收金额(累积)
vo
.
setExpectedAmount
(
expected
.
getExpectedAmount
());
// 产品来佣率
BigDecimal
commissionRatio
=
expected
.
getCommissionRatio
();
vo
.
setCommissionRatio
(
commissionRatio
);
if
(
commissionRatio
!=
null
&&
commissionRatio
.
compareTo
(
BigDecimal
.
ZERO
)
!=
0
)
{
// 实佣率 = paidRatio
vo
.
setRealRate
(
paidRatio
);
// 达成率缺口 = 1 - 实佣率/产品来佣率
BigDecimal
gap
=
BigDecimal
.
ONE
.
subtract
(
paidRatio
.
divide
(
commissionRatio
,
4
,
RoundingMode
.
HALF_UP
));
vo
.
setGapRate
(
gap
.
compareTo
(
BigDecimal
.
ZERO
)
<
0
?
BigDecimal
.
ZERO
:
gap
);
// 本次入账比例(主记录无意义)
vo
.
setRevenueRatio
(
null
);
}
else
{
vo
.
setRealRate
(
BigDecimal
.
ZERO
);
vo
.
setGapRate
(
BigDecimal
.
ZERO
);
}
// 累计实佣率是否已达标(实佣率 >= 产品来佣率)
// 待入账金额(已实现归零逻辑)
if
(
paidRatio
.
compareTo
(
expected
.
getCommissionRatio
())
>=
0
)
{
if
(
commissionRatio
!=
null
&&
paidRatio
.
compareTo
(
commissionRatio
)
>=
0
)
{
// 已达标或超额,待入账金额/比例归零
vo
.
setPendingRatio
(
BigDecimal
.
ZERO
);
vo
.
setPendingAmount
(
BigDecimal
.
ZERO
);
vo
.
setPendingAmount
(
BigDecimal
.
ZERO
);
}
else
{
// vo.setPendingRatio(BigDecimal.ZERO);
// 未达标,正常计算待入账
}
else
if
(
commissionRatio
!=
null
)
{
vo
.
setPendingRatio
(
expected
.
getCommissionRatio
()
.
subtract
(
paidRatio
));
// vo.setPendingRatio(commissionRatio
.subtract(paidRatio));
if
(
expected
.
getExpectedAmount
()
!=
null
)
{
if
(
expected
.
getExpectedAmount
()
!=
null
)
{
vo
.
setPendingAmount
(
expected
.
getExpectedAmount
().
subtract
(
paidAmount
));
vo
.
setPendingAmount
(
expected
.
getExpectedAmount
().
subtract
(
paidAmount
));
}
}
}
}
else
{
}
else
{
// 非关联保单应收单(无来佣比例,直接按金额差计算)
// 非关联类型
vo
.
setPaidAmount
(
paidAmount
);
if
(
expected
.
getAmount
()
!=
null
)
{
if
(
expected
.
getAmount
()
!=
null
)
{
BigDecimal
pending
=
expected
.
getAmount
().
subtract
(
paidAmount
);
BigDecimal
pending
=
expected
.
getAmount
().
subtract
(
paidAmount
);
if
(
pending
.
compareTo
(
BigDecimal
.
ZERO
)
<=
0
)
{
vo
.
setPendingAmount
(
pending
.
compareTo
(
BigDecimal
.
ZERO
)
<=
0
?
BigDecimal
.
ZERO
:
pending
);
// 已入账金额 >= 预计金额,待入账归零
vo
.
setPendingAmount
(
BigDecimal
.
ZERO
);
}
else
{
vo
.
setPendingAmount
(
pending
);
}
}
}
}
}
return
vo
;
return
vo
;
}
}
/**
/**
* 构建从记录(实际来佣,type=2)
* 构建从记录(实际来佣)
* 参考 getCommissionVOPage 的填充逻辑
* 计算:实佣率(realRate) = 本次实佣率(currentCommissionRatio)
* 本次入账比例(revenueRatio) = 本次实佣率 / 产品来佣率(若产品来佣率存在)
* 达成率缺口(gapRate) = 1 - (累积实佣率 / 产品来佣率) // 累积实佣率从主记录获取
*/
*/
private
CommissionExpectedNewVO
buildSubVo
(
Commission
commission
,
private
CommissionExpectedNewVO
buildSubVo
(
Commission
commission
,
Map
<
String
,
Policy
>
policyMap
,
Map
<
String
,
Policy
>
policyMap
,
Map
<
String
,
PolicyFollow
>
policyFollowMap
,
Map
<
String
,
PolicyFollow
>
policyFollowMap
,
CommissionExpectedNewVO
mainVo
)
{
CommissionExpectedNewVO
mainVo
)
{
// 从主记录复制公共字段
CommissionExpectedNewVO
vo
=
new
CommissionExpectedNewVO
();
CommissionExpectedNewVO
vo
=
new
CommissionExpectedNewVO
();
// 从主记录复制公共字段(排除特有字段)
BeanUtils
.
copyProperties
(
mainVo
,
vo
,
"type"
,
"no"
,
BeanUtils
.
copyProperties
(
mainVo
,
vo
,
"type"
,
"no"
,
"realReconciliationYearMonth"
,
"realCommissionDate"
,
"realExchangeRate"
,
"realReconciliationYearMonth"
,
"realCommissionDate"
,
"realExchangeRate"
,
"realAmount"
,
"realCurrentCommissionRatio"
,
"realUpdateTime"
,
"realUpdaterName"
);
"realAmount"
,
"realCurrentCommissionRatio"
,
"realUpdateTime"
,
"realUpdaterName"
,
"realRate"
,
"gapRate"
,
"revenueRatio"
,
"realRemark"
);
// 覆盖实际记录自己的字段
vo
.
setRealReconciliationYearMonth
(
commission
.
getReconciliationYearMonth
());
// 基本实际字段
vo
.
setRealCommissionDate
(
commission
.
getCommissionDate
());
vo
.
setRealReconciliationYearMonth
(
StringUtils
.
isNotBlank
(
commission
.
getReconciliationYearMonth
())
?
commission
.
getReconciliationYearMonth
().
replace
(
"-"
,
""
)
:
""
);
// vo.setRealCommissionDate(commission.getCommissionDate());
vo
.
setRealExchangeRate
(
commission
.
getExchangeRate
());
vo
.
setRealExchangeRate
(
commission
.
getExchangeRate
());
vo
.
setRealAmount
(
commission
.
getAmount
());
vo
.
setRealAmount
(
commission
.
getAmount
());
vo
.
setRealCurrentCommissionRatio
(
commission
.
getCurrentCommissionRatio
());
vo
.
setRealCurrentCommissionRatio
(
commission
.
getCurrentCommissionRatio
());
vo
.
setRealUpdateTime
(
commission
.
getUpdateTime
());
vo
.
setRealUpdateTime
(
commission
.
getUpdateTime
());
vo
.
setRealUpdaterName
(
commission
.
getUpdaterId
());
vo
.
setRealUpdaterName
(
commission
.
getUpdaterId
());
vo
.
setRealRemark
(
commission
.
getRemark
());
// 覆盖公共业务字段
// 覆盖公共业务字段
vo
.
setAmount
(
commission
.
getAmount
());
//
vo.setAmount(commission.getAmount());
vo
.
setCommissionDate
(
commission
.
getCommissionDate
());
//
vo.setCommissionDate(commission.getCommissionDate());
vo
.
setCommissionPeriod
(
commission
.
getCommissionPeriod
());
vo
.
setCommissionPeriod
(
commission
.
getCommissionPeriod
());
vo
.
setCommissionName
(
commission
.
getCommissionName
());
vo
.
setCommissionName
(
commission
.
getCommissionName
());
vo
.
setCommissionType
(
commission
.
getCommissionType
());
//
vo.setCommissionType(commission.getCommissionType());
vo
.
setCurrency
(
commission
.
getCurrency
());
//
vo.setCurrency(commission.getCurrency());
vo
.
setRemark
(
commission
.
getRemark
());
//
vo.setRemark(commission.getRemark());
vo
.
setPolicyNo
(
commission
.
getPolicyNo
());
vo
.
setPolicyNo
(
commission
.
getPolicyNo
());
// 重新
从 policyMap 获取保单信息以确保准确性
// 重新
获取保单信息
Policy
policy
=
policyMap
.
get
(
commission
.
getPolicyNo
());
Policy
policy
=
policyMap
.
get
(
commission
.
getPolicyNo
());
if
(
policy
!=
null
)
{
if
(
policy
!=
null
)
{
vo
.
setPremium
(
policy
.
getPaymentPremium
());
vo
.
setPremium
(
policy
.
getPaymentPremium
());
...
@@ -337,7 +357,25 @@ public class CommissionExpectedServiceImpl extends ServiceImpl<CommissionExpecte
...
@@ -337,7 +357,25 @@ public class CommissionExpectedServiceImpl extends ServiceImpl<CommissionExpecte
PolicyFollow
policyFollow
=
policyFollowMap
.
get
(
commission
.
getPolicyNo
());
PolicyFollow
policyFollow
=
policyFollowMap
.
get
(
commission
.
getPolicyNo
());
if
(
policyFollow
!=
null
)
{
if
(
policyFollow
!=
null
)
{
vo
.
setProductName
(
policyFollow
.
getProductName
());
vo
.
setProductName
(
policyFollow
.
getProductName
());
vo
.
setProductLaunchBizId
(
policyFollow
.
getProductLaunchBizId
());
// vo.setProductLaunchBizId(policyFollow.getProductLaunchBizId());
}
// 计算比率字段
BigDecimal
currentRatio
=
commission
.
getCurrentCommissionRatio
();
// 本次实佣率
BigDecimal
productRatio
=
mainVo
.
getCommissionRatio
();
// 产品来佣率(从主记录来)
vo
.
setRealRate
(
currentRatio
);
// 实佣率(本次)
if
(
productRatio
!=
null
&&
productRatio
.
compareTo
(
BigDecimal
.
ZERO
)
!=
0
)
{
// 本次入账比例 = 本次实佣率 / 产品来佣率
BigDecimal
revenue
=
currentRatio
.
divide
(
productRatio
,
4
,
RoundingMode
.
HALF_UP
);
vo
.
setRevenueRatio
(
revenue
.
compareTo
(
BigDecimal
.
ONE
)
>
0
?
BigDecimal
.
ONE
:
revenue
);
// 本次达成率缺口 = 1 - (实佣率(本次) / 产品来佣率)
BigDecimal
cumulativePaidRatio
=
currentRatio
!=
null
?
currentRatio
:
BigDecimal
.
ZERO
;
BigDecimal
gap
=
BigDecimal
.
ONE
.
subtract
(
cumulativePaidRatio
.
divide
(
productRatio
,
4
,
RoundingMode
.
HALF_UP
));
vo
.
setGapRate
(
gap
.
compareTo
(
BigDecimal
.
ZERO
)
<
0
?
BigDecimal
.
ZERO
:
gap
);
}
else
{
vo
.
setRevenueRatio
(
null
);
vo
.
setGapRate
(
BigDecimal
.
ZERO
);
}
}
return
vo
;
return
vo
;
...
...
yd-csf-service/src/main/java/com/yd/csf/service/vo/CommissionExpectedNewVO.java
View file @
8af5cb04
...
@@ -17,32 +17,17 @@ import java.util.List;
...
@@ -17,32 +17,17 @@ import java.util.List;
@Schema
(
description
=
"预计来佣响应"
)
@Schema
(
description
=
"预计来佣响应"
)
public
class
CommissionExpectedNewVO
implements
Serializable
{
public
class
CommissionExpectedNewVO
implements
Serializable
{
//===========公共字段=============
//===========公共字段=============
//来佣类型:1-预计(预计来佣表记录) 2-实际(保单来佣表记录)
private
Integer
type
;
/**
/**
*
编号 规则: 预计来佣表记录作为主记录,保单来佣表记录作为从记录,主记录比如生产编号为A267897 从记录第一条为A267897-1 第二条为A267897-2
*
是否实收:1-预计(预计来佣记录) 2-实收(保单来佣表记录)*
*/
*/
private
String
no
;
private
Integer
type
;
//===========以下是预计来佣表记录=============
/**
* 预计来佣id
*/
@Schema
(
description
=
"预计来佣id"
)
private
Long
id
;
/**
/**
*
预计来佣业务id
*
组编号(应收单编号)*
*/
*/
@Schema
(
description
=
"预计来佣业务id"
)
private
String
no
;
private
String
commissionExpectedBizId
;
/**
//===========以下是预计来佣记录=============
* 应收账款编号
*/
@Schema
(
description
=
"应收账款编号"
)
private
String
receivableNo
;
/**
/**
* 应收款类型 R=关联保单应收单 U=非关联保单应收单
* 应收款类型 R=关联保单应收单 U=非关联保单应收单
...
@@ -51,272 +36,336 @@ public class CommissionExpectedNewVO implements Serializable {
...
@@ -51,272 +36,336 @@ public class CommissionExpectedNewVO implements Serializable {
private
String
commissionBizType
;
private
String
commissionBizType
;
/**
/**
* 保单号
*
预计来佣-
保单号
*/
*/
@Schema
(
description
=
"保单号"
)
@Schema
(
description
=
"保单号"
)
private
String
policyNo
;
private
String
policyNo
;
/**
/**
* 期交保费
* 预计来佣-对账公司
*/
@Schema
(
description
=
"期交保费"
)
private
Object
premium
;
/**
* 保单币种
*/
@Schema
(
description
=
"保单币种"
)
private
String
policyCurrency
;
/**
* 产品计划名称
*/
@Schema
(
description
=
"产品计划名称"
)
private
String
productName
;
/**
* 保险公司业务ID
*/
@Schema
(
description
=
"保险公司业务ID"
)
private
String
insuranceCompanyBizId
;
/**
* 保险公司
*/
@Schema
(
description
=
"保险公司"
)
private
String
insuranceCompany
;
/**
* 产品上架信息表唯一业务ID
*/
@Schema
(
description
=
"产品计划: 产品上架信息表唯一业务ID"
)
private
String
productLaunchBizId
;
/**
* 对账公司
*/
*/
@Schema
(
description
=
"对账公司"
)
@Schema
(
description
=
"对账公司"
)
private
String
reconciliationCompany
;
private
String
reconciliationCompany
;
/**
/**
* 对账公司业务ID
*
预计来佣-
对账公司业务ID
*/
*/
@Schema
(
description
=
"对账公司业务ID"
)
@Schema
(
description
=
"对账公司业务ID"
)
private
String
reconciliationCompanyBizId
;
private
String
reconciliationCompanyBizId
;
/**
/**
* 佣金期数(1=第一年; 2=第二年; 3=第三年; 4=第四年; 5=第五年)
* 预计来佣-入账状态 0=待入账 1=完成入账 2=部分入账 3=已失效
*/
@Schema
(
description
=
"入账状态 0=待入账 1=完成入账 2=部分入账 3=已失效 字典值: csf_expected_commission_status"
)
private
String
status
;
/**
* 预计来佣-佣金期数(1=第一年; 2=第二年; 3=第三年; 4=第四年; 5=第五年)
*/
*/
@Schema
(
description
=
"佣金期数(1=第一年; 2=第二年; 3=第三年; 4=第四年; 5=第五年)"
)
@Schema
(
description
=
"佣金期数(1=第一年; 2=第二年; 3=第三年; 4=第四年; 5=第五年)"
)
private
Integer
commissionPeriod
;
private
Integer
commissionPeriod
;
/**
/**
* 总来佣期数
*
预计来佣-
总来佣期数
*/
*/
@Schema
(
description
=
"总来佣期数"
)
@Schema
(
description
=
"总来佣期数"
)
private
Integer
totalPeriod
;
private
Integer
totalPeriod
;
/**
/**
* 来佣名称(1:销售拥金;2:销售奖金;3:销售津贴;4:续期佣金;5:服务津贴;等等)
*
预计来佣-
来佣名称(1:销售拥金;2:销售奖金;3:销售津贴;4:续期佣金;5:服务津贴;等等)
*/
*/
@Schema
(
description
=
"来佣名称(1:销售拥金;2:销售奖金;3:销售津贴;4:续期佣金;5:服务津贴;等等)"
)
@Schema
(
description
=
"来佣名称(1:销售拥金;2:销售奖金;3:销售津贴;4:续期佣金;5:服务津贴;等等)"
)
private
String
commissionName
;
private
String
commissionName
;
/**
/**
*
来佣类型(1:销售拥金;2:销售奖金;3:销售津贴;4:续期佣金;5:服务津贴;等等)
*
预计来佣-入账年月(估) * (预计来佣日期)
*/
*/
@Schema
(
description
=
"来佣类型(1:销售拥金;2:销售奖金;3:销售津贴;4:续期佣金;5:服务津贴;等等)"
)
@Schema
(
description
=
"入账年月(估)"
)
private
String
commissionType
;
@JsonFormat
(
pattern
=
"yyyyMM"
,
timezone
=
"GMT+8"
)
private
Date
commissionDateMonth
;
/**
/**
*
预计入账比例 (%)
*
入账检核记录-入账检核年月 yyyyMM(入账年月(实))
*/
*/
@Schema
(
description
=
"
预计入账比例 (%)
"
)
@Schema
(
description
=
"
入账检核年月 yyyyMM
"
)
private
BigDecimal
commissionRatio
;
private
String
realReconciliationYearMonth
;
/**
/**
* 预计
入账金额
* 预计
来佣-已入账来佣比例 (%) ( 累积已入账比例)
*/
*/
@Schema
(
description
=
"
预计入账金额 HKD(如果不关联保单,就没有预计入账比例,此时记录预计入账金额)
"
)
@Schema
(
description
=
"
已入账来佣比例 (%)
"
)
private
BigDecimal
amount
;
private
BigDecimal
paidRatio
;
/**
/**
*
来佣币种
*
预计来佣-预计入账比例 (%)(产品对应来佣率)
*/
*/
@Schema
(
description
=
"
来佣币种
"
)
@Schema
(
description
=
"
预计入账比例 (%)
"
)
private
String
currency
;
private
BigDecimal
commissionRatio
;
/**
/**
* 预计来佣日期
* 入账检核记录-实佣率(入账金额/结算汇率/期交保费) *
* 如果这里是否实收是预计:realRate统计当前预计下面的实际来拥记录的实佣率累加和
* 如果这里是否实收是实收:realRate取realCurrentCommissionRatio赋值
*/
*/
@Schema
(
description
=
"预计来佣日期"
)
@Schema
(
description
=
"实佣率"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd"
,
timezone
=
"GMT+8"
)
private
BigDecimal
realRate
;
private
Date
commissionDate
;
/**
/**
*
入账状态 0=待入账 1=完成入账 2=部分入账 3=已失效
*
达成率缺口(1-实佣率/产品对应来佣率)*
*/
*/
@Schema
(
description
=
"
入账状态 0=待入账 1=完成入账 2=部分入账 3=已失效 字典值: csf_expected_commission_status
"
)
@Schema
(
description
=
"
实佣率
"
)
private
String
status
;
private
BigDecimal
gapRate
;
/**
/**
*
设置入账状态-修改理由
*
入账检核记录-当前结算汇率(结算汇率(实))
*/
*/
@Schema
(
description
=
"
设置入账状态-修改理由
"
)
@Schema
(
description
=
"
当前结算汇率
"
)
private
String
statusDesc
;
private
BigDecimal
realExchangeRate
;
/**
/**
*
预计入账金额(HKD
)
*
入账检核记录-来佣金额(已入账金额)(预计类型需要统计累计和值
)
*/
*/
@Schema
(
description
=
"预计入账金额(HKD)"
)
private
BigDecimal
realAmount
;
private
BigDecimal
expectedAmount
;
/**
/**
*
结算汇率(估
)
*
入账检核记录-本次入账比例(实佣率/产品对应来佣率
)
*/
*/
@Schema
(
description
=
"结算汇率(估)"
)
private
BigDecimal
revenueRatio
;
private
BigDecimal
defaultExchangeRate
;
/**
/**
*
已入账来佣金额(HKD)
*
预计来佣-待入账金额
*/
*/
@Schema
(
description
=
"
已入账来佣金额(HKD)
"
)
@Schema
(
description
=
"
待入账金额
"
)
private
BigDecimal
p
aid
Amount
;
private
BigDecimal
p
ending
Amount
;
/**
/**
*
已入账来佣比例 (%)
*
预计来佣-预计入账金额(HKD)
*/
*/
@Schema
(
description
=
"
已入账来佣比例 (%)
"
)
@Schema
(
description
=
"
预计入账金额(HKD)
"
)
private
BigDecimal
paidRatio
;
private
BigDecimal
expectedAmount
;
/**
/**
*
待入账金额
*
预计来佣-结算汇率(估)
*/
*/
@Schema
(
description
=
"
待入账金额
"
)
@Schema
(
description
=
"
结算汇率(估)
"
)
private
BigDecimal
pendingAmount
;
private
BigDecimal
defaultExchangeRate
;
/**
/**
*
待入账比例
*
预计来佣-保险公司
*/
*/
@Schema
(
description
=
"
待入账比例
"
)
@Schema
(
description
=
"
保险公司
"
)
private
BigDecimal
pendingRatio
;
private
String
insuranceCompany
;
/**
/**
*
已入账来佣列表
*
预计来佣-产品计划名称
*/
*/
@Schema
(
description
=
"
已入账来佣列表
"
)
@Schema
(
description
=
"
产品计划名称
"
)
private
List
<
Commission
>
commissionList
;
private
String
productName
;
/**
/**
*
通用备注
*
预计来佣-保单币种
*/
*/
@Schema
(
description
=
"
备注
"
)
@Schema
(
description
=
"
保单币种
"
)
private
String
remark
;
private
String
policyCurrency
;
/**
/**
*
创建人ID
*
预计来佣-期交保费
*/
*/
@Schema
(
description
=
"
创建人ID
"
)
@Schema
(
description
=
"
期交保费
"
)
private
String
creatorId
;
private
Object
premium
;
/**
/**
*
更新人ID
*
入账检核记录-通用备注
*/
*/
@Schema
(
description
=
"
更新人ID
"
)
@Schema
(
description
=
"
备注
"
)
private
String
updaterId
;
private
String
realRemark
;
/**
/**
*
创建时间
*
入账检核记录-更新人名称
*/
*/
@Schema
(
description
=
"创建时间"
)
private
String
realUpdaterName
;
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
private
Date
createTime
;
/**
/**
* 更新时间
*
入账检核记录-
更新时间
*/
*/
@Schema
(
description
=
"更新时间"
)
@Schema
(
description
=
"更新时间"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
private
Date
u
pdateTime
;
private
Date
realU
pdateTime
;
//===========以下是入账检核(保单来佣)记录=============
/**
* 入账检核记录-入账检核年月 yyyy-MM
*/
@Schema
(
description
=
"入账检核年月 yyyy-MM"
)
private
String
realReconciliationYearMonth
;
/**
* 入账检核记录-来佣日期(入账日实)
*/
@Schema
(
description
=
"来佣日期(入账日实)"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd"
,
timezone
=
"GMT+8"
)
private
Date
realCommissionDate
;
/**
* 入账检核记录-当前结算汇率(结算汇率(实))
*/
@Schema
(
description
=
"当前结算汇率"
)
private
BigDecimal
realExchangeRate
;
/**
* 来佣金额(入账金额)
*/
@Schema
(
description
=
"来佣金额"
)
private
BigDecimal
realAmount
;
// /**
// * 预计来佣id
// */
// @Schema(description = "预计来佣id")
// private Long id;
//
// /**
// * 预计来佣业务id
// */
// @Schema(description = "预计来佣业务id")
// private String commissionExpectedBizId;
//
// /**
// * 应收账款编号
// */
// @Schema(description = "应收账款编号")
// private String receivableNo;
//
// /**
// * 应收款类型 R=关联保单应收单 U=非关联保单应收单
// */
// @Schema(description = "应收款类型 R=关联保单应收单 U=非关联保单应收单")
// private String commissionBizType;
//
// /**
// * 保险公司业务ID
// */
// @Schema(description = "保险公司业务ID")
// private String insuranceCompanyBizId;
//
// /**
// * 产品上架信息表唯一业务ID
// */
// @Schema(description = "产品计划: 产品上架信息表唯一业务ID")
// private String productLaunchBizId;
//
// /**
// * 来佣类型(1:销售拥金;2:销售奖金;3:销售津贴;4:续期佣金;5:服务津贴;等等)
// */
// @Schema(description = "来佣类型(1:销售拥金;2:销售奖金;3:销售津贴;4:续期佣金;5:服务津贴;等等)")
// private String commissionType;
//
// /**
// * 预计入账金额
// */
// @Schema(description = "预计入账金额 HKD(如果不关联保单,就没有预计入账比例,此时记录预计入账金额)")
// private BigDecimal amount;
//
// /**
// * 来佣币种
// */
// @Schema(description = "来佣币种")
// private String currency;
//
// /**
// * 预计来佣日期
// */
// @Schema(description = "预计来佣日期")
// @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
// private Date commissionDate;
//
// /**
// * 设置入账状态-修改理由
// */
// @Schema(description = "设置入账状态-修改理由")
// private String statusDesc;
//
// /**
// * 已入账来佣金额(HKD)
// */
// @Schema(description = "已入账来佣金额(HKD)")
// private BigDecimal paidAmount;
//
// /**
// * 待入账比例
// */
// @Schema(description = "待入账比例")
// private BigDecimal pendingRatio;
//
// /**
// * 已入账来佣列表
// */
// @Schema(description = "已入账来佣列表")
// private List<Commission> commissionList;
//
// /**
// * 通用备注
// */
// @Schema(description = "备注")
// private String remark;
//
// /**
// * 创建人ID
// */
// @Schema(description = "创建人ID")
// private String creatorId;
//
// /**
// * 更新人ID
// */
// @Schema(description = "更新人ID")
// private String updaterId;
//
// /**
// * 创建时间
// */
// @Schema(description = "创建时间")
// @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
// private Date createTime;
//
// /**
// * 更新时间
// */
// @Schema(description = "更新时间")
// @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
// private Date updateTime;
//
//
// //===========以下是入账检核(保单来佣)记录=============
//
// /**
// * 入账检核记录-来佣日期(入账日实)
// */
// @Schema(description = "来佣日期(入账日实)")
// @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
// private Date realCommissionDate;
//
/**
/**
* 当前来佣比例 (实佣率=实际入账金额/结算汇率/每期保费)(入账比例)
* 当前来佣比例 (实佣率=实际入账金额/结算汇率/每期保费)(入账比例)
*/
*/
@Schema
(
description
=
"当前来佣比例 (实佣率=实际入账金额/结算汇率/每期保费)"
)
@Schema
(
description
=
"当前来佣比例 (实佣率=实际入账金额/结算汇率/每期保费)"
)
private
BigDecimal
realCurrentCommissionRatio
;
private
BigDecimal
realCurrentCommissionRatio
;
/**
* 更新人ID
*/
private
String
realUpdaterName
;
/**
* 更新时间
*/
@Schema
(
description
=
"更新时间"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
private
Date
realUpdateTime
;
private
static
final
long
serialVersionUID
=
1L
;
private
static
final
long
serialVersionUID
=
1L
;
/**
//
/**
* 对象转封装类
//
* 对象转封装类
*
//
*
* @param commissionExpected
//
* @param commissionExpected
* @return
//
* @return
*/
//
*/
public
static
CommissionExpectedNewVO
objToVo
(
CommissionExpected
commissionExpected
)
{
//
public static CommissionExpectedNewVO objToVo(CommissionExpected commissionExpected) {
if
(
commissionExpected
==
null
)
{
//
if (commissionExpected == null) {
return
null
;
//
return null;
}
//
}
CommissionExpectedNewVO
commissionVO
=
new
CommissionExpectedNewVO
();
//
CommissionExpectedNewVO commissionVO = new CommissionExpectedNewVO();
BeanUtils
.
copyProperties
(
commissionExpected
,
commissionVO
);
//
BeanUtils.copyProperties(commissionExpected, commissionVO);
//
BigDecimal
paidAmount1
=
ObjectUtils
.
defaultIfNull
(
commissionExpected
.
getPaidAmount
(),
BigDecimal
.
ZERO
);
//
BigDecimal paidAmount1 = ObjectUtils.defaultIfNull(commissionExpected.getPaidAmount(), BigDecimal.ZERO);
BigDecimal
paidRatio1
=
ObjectUtils
.
defaultIfNull
(
commissionExpected
.
getPaidRatio
(),
BigDecimal
.
ZERO
);
//
BigDecimal paidRatio1 = ObjectUtils.defaultIfNull(commissionExpected.getPaidRatio(), BigDecimal.ZERO);
//
// 待入账比例、待入账金额
//
// 待入账比例、待入账金额
if
(
commissionExpected
.
getCommissionRatio
()
!=
null
)
{
//
if (commissionExpected.getCommissionRatio() != null) {
commissionVO
.
setPaidRatio
(
paidRatio1
);
//
commissionVO.setPaidRatio(paidRatio1);
commissionVO
.
setPendingRatio
(
commissionExpected
.
getCommissionRatio
().
subtract
(
paidRatio1
));
//
commissionVO.setPendingRatio(commissionExpected.getCommissionRatio().subtract(paidRatio1));
if
(
commissionExpected
.
getExpectedAmount
()
!=
null
)
{
//
if (commissionExpected.getExpectedAmount() != null) {
commissionVO
.
setPaidAmount
(
paidAmount1
);
//
commissionVO.setPaidAmount(paidAmount1);
commissionVO
.
setPendingAmount
(
commissionExpected
.
getExpectedAmount
().
subtract
(
paidAmount1
));
//
commissionVO.setPendingAmount(commissionExpected.getExpectedAmount().subtract(paidAmount1));
}
//
}
return
commissionVO
;
//
return commissionVO;
}
else
{
//
} else {
commissionVO
.
setPaidAmount
(
paidAmount1
);
//
commissionVO.setPaidAmount(paidAmount1);
commissionVO
.
setPendingAmount
(
commissionExpected
.
getAmount
().
subtract
(
paidAmount1
));
//
commissionVO.setPendingAmount(commissionExpected.getAmount().subtract(paidAmount1));
//
return
commissionVO
;
//
return commissionVO;
}
//
}
}
//
}
}
}
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