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
41d91709
Commit
41d91709
authored
Apr 27, 2026
by
zhangxingmin
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/test' into test_yh
parents
2521634f
5c35da16
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
79 additions
and
13 deletions
+79
-13
yd-csf-api/src/main/java/com/yd/csf/api/dto/ExecuteBillingDto.java
+7
-0
yd-csf-api/src/main/java/com/yd/csf/api/dto/GenerateExpectedFortuneDto.java
+5
-0
yd-csf-api/src/main/java/com/yd/csf/api/service/impl/ApiExpectedFortuneServiceImpl.java
+42
-11
yd-csf-feign/src/main/java/com/yd/csf/feign/request/expectedfortune/ExpectedFortuneAddRequest.java
+6
-0
yd-csf-service/src/main/java/com/yd/csf/service/dto/FortuneAccountExportDTO.java
+3
-0
yd-csf-service/src/main/java/com/yd/csf/service/dto/QueryPolicyAndBrokerDto.java
+5
-0
yd-csf-service/src/main/java/com/yd/csf/service/service/impl/FortuneAccountServiceImpl.java
+10
-2
yd-csf-service/src/main/java/com/yd/csf/service/service/impl/FortuneServiceImpl.java
+1
-0
No files found.
yd-csf-api/src/main/java/com/yd/csf/api/dto/ExecuteBillingDto.java
View file @
41d91709
...
...
@@ -11,6 +11,8 @@ import lombok.Builder;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
java.math.BigDecimal
;
@Data
@Builder
@NoArgsConstructor
...
...
@@ -43,6 +45,11 @@ public class ExecuteBillingDto {
private
Integer
paymentTerm
;
/**
* 介绍费占比
*/
private
String
brokerRatio
;
/**
* 保单和转介人信息
*/
private
QueryPolicyAndBrokerDto
policyAndBrokerDto
;
...
...
yd-csf-api/src/main/java/com/yd/csf/api/dto/GenerateExpectedFortuneDto.java
View file @
41d91709
...
...
@@ -116,6 +116,11 @@ public class GenerateExpectedFortuneDto {
private
BigDecimal
paymentPremium
;
/**
* 介绍费占比
*/
private
String
brokerRatio
;
/**
* 获得积分业务员绑定的基本法列表对应计算值
*/
private
List
<
AlgorithmResDto
>
algorithmResDtoList
;
...
...
yd-csf-api/src/main/java/com/yd/csf/api/service/impl/ApiExpectedFortuneServiceImpl.java
View file @
41d91709
...
...
@@ -2,6 +2,7 @@ package com.yd.csf.api.service.impl;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.collection.CollUtil
;
import
cn.hutool.core.util.NumberUtil
;
import
com.alibaba.excel.EasyExcel
;
import
com.alibaba.excel.ExcelWriter
;
import
com.alibaba.excel.write.metadata.WriteSheet
;
...
...
@@ -107,7 +108,7 @@ public class ApiExpectedFortuneServiceImpl implements ApiExpectedFortuneService
@Resource
private
ApiExchangeRateFeignClient
apiExchangeRateFeignClient
;
@Resource
private
Commission
ExpectedService
commissionExpected
Service
;
private
Commission
Service
commission
Service
;
@Resource
private
ApiAnnouncementCommissionRatioFeignClient
apiAnnouncementCommissionRatioFeignClient
;
@Resource
...
...
@@ -538,6 +539,7 @@ public class ApiExpectedFortuneServiceImpl implements ApiExpectedFortuneService
.
policyAndBrokerDto
(
brokerDto
)
.
issueNumber
(
i
)
.
paymentTerm
(
paymentTerm
)
.
brokerRatio
(
brokerDto
.
getBrokerRatio
())
.
build
());
if
(!
CollectionUtils
.
isEmpty
(
commissionRuleBindingList
))
{
...
...
@@ -548,6 +550,7 @@ public class ApiExpectedFortuneServiceImpl implements ApiExpectedFortuneService
.
policyAndBrokerDto
(
brokerDto
)
.
issueNumber
(
i
)
.
paymentTerm
(
paymentTerm
)
.
brokerRatio
(
brokerDto
.
getBrokerRatio
())
.
build
());
}
}
...
...
@@ -701,6 +704,8 @@ public class ApiExpectedFortuneServiceImpl implements ApiExpectedFortuneService
//保险公司业务id
.
insuranceCompanyBizId
(
brokerDto
.
getInsuranceCompanyBizId
())
.
source
(
2
)
//转介人的介绍费占比
.
brokerRatio
(
dto
.
getBrokerRatio
())
.
build
());
return
Result
.
success
();
...
...
@@ -777,6 +782,7 @@ public class ApiExpectedFortuneServiceImpl implements ApiExpectedFortuneService
//保险公司业务id
.
insuranceCompanyBizId
(
brokerDto
.
getInsuranceCompanyBizId
())
.
source
(
1
)
.
brokerRatio
(
dto
.
getBrokerRatio
())
.
build
());
return
Result
.
success
();
...
...
@@ -801,10 +807,10 @@ public class ApiExpectedFortuneServiceImpl implements ApiExpectedFortuneService
continue
;
}
log
.
info
(
"生成保单预计发佣表记录——>入参algorithmResDto:{}"
,
JSON
.
toJSONString
(
algorithmResDto
));
PolicyBroker
policyBroker
=
policyBrokerService
.
queryOne
(
QueryPolicyBrokerDto
.
builder
()
.
policyNo
(
fortuneDto
.
getPolicyNo
())
.
brokerBizId
(
fortuneDto
.
getBrokerBizId
())
.
build
());
//
PolicyBroker policyBroker = policyBrokerService.queryOne(QueryPolicyBrokerDto.builder()
//
.policyNo(fortuneDto.getPolicyNo())
//
.brokerBizId(fortuneDto.getBrokerBizId())
//
.build());
ExpectedFortune
fortune
=
new
ExpectedFortune
();
//发佣金额 -> 计算值 - sqlAlgorithmResultDtoList集合里面的计算值和值
// fortune.setAmount(algorithmResDto.getCalculatedValue());
...
...
@@ -847,7 +853,8 @@ public class ApiExpectedFortuneServiceImpl implements ApiExpectedFortuneService
fortune
.
setStandardAmount
(
standardAmount
);
// 转介人介绍费占比
String
brokerRatioStr
=
!
Objects
.
isNull
(
policyBroker
)
?
policyBroker
.
getBrokerRatio
()
:
"100"
;
// String brokerRatioStr = !Objects.isNull(policyBroker) ? policyBroker.getBrokerRatio() : "100";
String
brokerRatioStr
=
StringUtils
.
isNotBlank
(
fortuneDto
.
getBrokerRatio
())
?
fortuneDto
.
getBrokerRatio
()
:
"100"
;
fortune
.
setBrokerRatio
(
brokerRatioStr
);
try
{
...
...
@@ -953,11 +960,10 @@ public class ApiExpectedFortuneServiceImpl implements ApiExpectedFortuneService
expectedFortune
.
setFortuneName
(
queryByDict
(
expectedFortuneDto
.
getFortuneType
()));
// 应付款编号(序号递增)
expectedFortune
.
setPayableNo
(
this
.
createPayableNo
(
expectedFortune
.
getFortuneBizType
(),
++
currentSeq
));
// // 默认结算汇率
// expectedFortune.setDefaultExchangeRate(
// queryExchangeRateByFeign(expectedFortuneDto.getCurrency(), "HKD"));
// // 计算港币金额
// expectedFortune.setHkdAmount(expectedFortuneDto.getAmount().multiply(expectedFortune.getDefaultExchangeRate()));
// 计算金额
expectedFortune
.
setAmount
(
NumberUtil
.
div
(
expectedFortuneDto
.
getHkdAmount
(),
expectedFortuneDto
.
getDefaultExchangeRate
(),
2
)
);
// 已出帐金额、待出帐金额、已出帐比例、待出帐比例
expectedFortune
.
setPaidAmount
(
BigDecimal
.
ZERO
);
...
...
@@ -972,6 +978,28 @@ public class ApiExpectedFortuneServiceImpl implements ApiExpectedFortuneService
return
true
;
}
/**
* 根据保单号和期数查询入账记录的结算汇率
*
* @param policyNo 保单号
* @param period 佣金期数
* @return 结算汇率
*/
private
BigDecimal
queryCommissionExchangeRate
(
String
policyNo
,
Integer
period
)
{
// 查询当前期数入账记录的结算汇率
Commission
commissionRecord
=
commissionService
.
getOne
(
new
QueryWrapper
<
Commission
>()
.
eq
(
"policy_no"
,
policyNo
)
.
eq
(
"commission_period"
,
period
)
.
orderByDesc
(
"commission_date"
)
.
last
(
"LIMIT 1"
)
);
if
(
ObjectUtils
.
isEmpty
(
commissionRecord
))
{
throw
new
BusinessException
(
ResultCode
.
PARAMS_ERROR
.
getCode
(),
"保单号为"
+
policyNo
+
"的佣金期数为"
+
period
+
"的入账记录不存在"
);
}
return
commissionRecord
.
getExchangeRate
();
}
private
String
queryByDict
(
String
fortuneType
)
{
//查询redis缓存的字典列表信息
List
<
GetDictItemListByDictTypeResponse
>
dictTypeResponses
=
redisUtil
.
getCacheObject
(
RedisConstants
.
DICT_LIST
);
...
...
@@ -1020,6 +1048,9 @@ public class ApiExpectedFortuneServiceImpl implements ApiExpectedFortuneService
if
(
Objects
.
isNull
(
expectedFortuneDto
.
getCurrency
()))
{
throw
new
BusinessException
(
ResultCode
.
PARAMS_ERROR
.
getCode
(),
"预计出账币种不能为空"
);
}
if
(
Objects
.
isNull
(
expectedFortuneDto
.
getDefaultExchangeRate
()))
{
throw
new
BusinessException
(
ResultCode
.
PARAMS_ERROR
.
getCode
(),
"结算汇率不能为空"
);
}
}
}
...
...
yd-csf-feign/src/main/java/com/yd/csf/feign/request/expectedfortune/ExpectedFortuneAddRequest.java
View file @
41d91709
...
...
@@ -76,6 +76,12 @@ public class ExpectedFortuneAddRequest {
private
String
fortuneType
;
/**
* 结算汇率
*/
@Schema
(
description
=
"结算汇率"
)
private
BigDecimal
defaultExchangeRate
;
/**
* 出账金额 单位:港币
*/
@Schema
(
description
=
"出账金额 单位:港币"
)
...
...
yd-csf-service/src/main/java/com/yd/csf/service/dto/FortuneAccountExportDTO.java
View file @
41d91709
...
...
@@ -6,6 +6,7 @@ import lombok.Data;
import
java.io.Serializable
;
import
java.math.BigDecimal
;
import
java.time.LocalDate
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -32,6 +33,8 @@ public class FortuneAccountExportDTO implements Serializable {
private
List
<
Fortune
>
fortuneList
;
private
LocalDate
actualPayoutDate
;
// 动态字段,用于存储不同的fortune项目
private
Map
<
String
,
BigDecimal
>
fortuneAmounts
=
new
HashMap
<>();
...
...
yd-csf-service/src/main/java/com/yd/csf/service/dto/QueryPolicyAndBrokerDto.java
View file @
41d91709
...
...
@@ -86,5 +86,10 @@ public class QueryPolicyAndBrokerDto {
* 所属团队业务id
*/
private
String
teamBizId
;
/**
* 介绍费占比
*/
private
String
brokerRatio
;
//======保单转介人信息end=======
}
yd-csf-service/src/main/java/com/yd/csf/service/service/impl/FortuneAccountServiceImpl.java
View file @
41d91709
...
...
@@ -2,6 +2,7 @@ package com.yd.csf.service.service.impl;
import
java.math.RoundingMode
;
import
java.time.LocalDate
;
import
java.time.LocalDateTime
;
import
java.time.ZoneId
;
import
java.util.Date
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
...
...
@@ -125,7 +126,7 @@ public class FortuneAccountServiceImpl extends ServiceImpl<FortuneAccountMapper,
fortuneAccount
.
setTeamBizId
(
accountExportDTO
.
getTeamBizId
());
fortuneAccount
.
setCurrency
(
accountExportDTO
.
getCurrency
());
fortuneAccount
.
setHkdAmount
(
accountExportDTO
.
getAmount
());
fortuneAccount
.
setFortuneAccountDate
(
currentDate
);
fortuneAccount
.
setFortuneAccountDate
(
this
.
getActualPayoutDate
(
accountExportDTO
)
);
// 出账状态默认待出账
fortuneAccount
.
setStatus
(
FortuneStatusEnum
.
CHECKED
.
getItemValue
());
...
...
@@ -188,6 +189,14 @@ public class FortuneAccountServiceImpl extends ServiceImpl<FortuneAccountMapper,
}
private
Date
getActualPayoutDate
(
FortuneAccountExportDTO
accountExportDTO
)
{
LocalDate
actualPayoutDate
=
accountExportDTO
.
getActualPayoutDate
();
if
(
actualPayoutDate
==
null
)
{
return
null
;
}
return
Date
.
from
(
actualPayoutDate
.
atStartOfDay
(
ZoneId
.
systemDefault
()).
toInstant
());
}
@Override
public
FortuneAccount
getByFortuneAccountBizId
(
String
fortuneAccountBizId
)
{
return
this
.
getOne
(
new
QueryWrapper
<
FortuneAccount
>().
eq
(
"fortune_account_biz_id"
,
fortuneAccountBizId
));
...
...
@@ -296,7 +305,6 @@ public class FortuneAccountServiceImpl extends ServiceImpl<FortuneAccountMapper,
/* 2. 更新 FortuneAccount 状态为已出账 ----------------------------------*/
accountList
.
forEach
(
a
->
{
a
.
setStatus
(
FortuneStatusEnum
.
SENT
.
getItemValue
());
a
.
setFortuneAccountDate
(
new
Date
());
a
.
setUpdaterId
(
loginUserId
.
toString
());
a
.
setUpdateTime
(
new
Date
());
});
...
...
yd-csf-service/src/main/java/com/yd/csf/service/service/impl/FortuneServiceImpl.java
View file @
41d91709
...
...
@@ -388,6 +388,7 @@ public class FortuneServiceImpl extends ServiceImpl<FortuneMapper, Fortune>
accountDTO
.
setTeam
(
brokerFortunes
.
get
(
0
).
getTeam
());
accountDTO
.
setTeamBizId
(
brokerFortunes
.
get
(
0
).
getTeamBizId
());
accountDTO
.
setCurrency
(
currency
);
accountDTO
.
setActualPayoutDate
(
brokerFortunes
.
get
(
0
).
getActualPayoutDate
());
}
// 计算出账总额
...
...
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