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
124fec83
Commit
124fec83
authored
Apr 24, 2026
by
jianan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增应付
parent
6d940b51
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
6 deletions
+32
-6
yd-csf-api/src/main/java/com/yd/csf/api/service/impl/ApiExpectedFortuneServiceImpl.java
+32
-6
No files found.
yd-csf-api/src/main/java/com/yd/csf/api/service/impl/ApiExpectedFortuneServiceImpl.java
View file @
124fec83
...
@@ -2,6 +2,7 @@ package com.yd.csf.api.service.impl;
...
@@ -2,6 +2,7 @@ package com.yd.csf.api.service.impl;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.collection.CollUtil
;
import
cn.hutool.core.collection.CollUtil
;
import
cn.hutool.core.util.NumberUtil
;
import
com.alibaba.excel.EasyExcel
;
import
com.alibaba.excel.EasyExcel
;
import
com.alibaba.excel.ExcelWriter
;
import
com.alibaba.excel.ExcelWriter
;
import
com.alibaba.excel.write.metadata.WriteSheet
;
import
com.alibaba.excel.write.metadata.WriteSheet
;
...
@@ -107,7 +108,7 @@ public class ApiExpectedFortuneServiceImpl implements ApiExpectedFortuneService
...
@@ -107,7 +108,7 @@ public class ApiExpectedFortuneServiceImpl implements ApiExpectedFortuneService
@Resource
@Resource
private
ApiExchangeRateFeignClient
apiExchangeRateFeignClient
;
private
ApiExchangeRateFeignClient
apiExchangeRateFeignClient
;
@Resource
@Resource
private
Commission
ExpectedService
commissionExpected
Service
;
private
Commission
Service
commission
Service
;
@Resource
@Resource
private
ApiAnnouncementCommissionRatioFeignClient
apiAnnouncementCommissionRatioFeignClient
;
private
ApiAnnouncementCommissionRatioFeignClient
apiAnnouncementCommissionRatioFeignClient
;
@Resource
@Resource
...
@@ -953,11 +954,14 @@ public class ApiExpectedFortuneServiceImpl implements ApiExpectedFortuneService
...
@@ -953,11 +954,14 @@ public class ApiExpectedFortuneServiceImpl implements ApiExpectedFortuneService
expectedFortune
.
setFortuneName
(
queryByDict
(
expectedFortuneDto
.
getFortuneType
()));
expectedFortune
.
setFortuneName
(
queryByDict
(
expectedFortuneDto
.
getFortuneType
()));
// 应付款编号(序号递增)
// 应付款编号(序号递增)
expectedFortune
.
setPayableNo
(
this
.
createPayableNo
(
expectedFortune
.
getFortuneBizType
(),
++
currentSeq
));
expectedFortune
.
setPayableNo
(
this
.
createPayableNo
(
expectedFortune
.
getFortuneBizType
(),
++
currentSeq
));
// // 默认结算汇率
// 默认结算汇率(查询当前期数入账记录的结算汇率)
// expectedFortune.setDefaultExchangeRate(
expectedFortune
.
setDefaultExchangeRate
(
// queryExchangeRateByFeign(expectedFortuneDto.getCurrency(), "HKD"));
queryCommissionExchangeRate
(
expectedFortuneDto
.
getPolicyNo
(),
expectedFortuneDto
.
getFortunePeriod
())
// // 计算港币金额
);
// expectedFortune.setHkdAmount(expectedFortuneDto.getAmount().multiply(expectedFortune.getDefaultExchangeRate()));
// 计算金额
expectedFortune
.
setAmount
(
NumberUtil
.
div
(
expectedFortuneDto
.
getHkdAmount
(),
expectedFortune
.
getDefaultExchangeRate
(),
2
)
);
// 已出帐金额、待出帐金额、已出帐比例、待出帐比例
// 已出帐金额、待出帐金额、已出帐比例、待出帐比例
expectedFortune
.
setPaidAmount
(
BigDecimal
.
ZERO
);
expectedFortune
.
setPaidAmount
(
BigDecimal
.
ZERO
);
...
@@ -972,6 +976,28 @@ public class ApiExpectedFortuneServiceImpl implements ApiExpectedFortuneService
...
@@ -972,6 +976,28 @@ public class ApiExpectedFortuneServiceImpl implements ApiExpectedFortuneService
return
true
;
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
)
{
private
String
queryByDict
(
String
fortuneType
)
{
//查询redis缓存的字典列表信息
//查询redis缓存的字典列表信息
List
<
GetDictItemListByDictTypeResponse
>
dictTypeResponses
=
redisUtil
.
getCacheObject
(
RedisConstants
.
DICT_LIST
);
List
<
GetDictItemListByDictTypeResponse
>
dictTypeResponses
=
redisUtil
.
getCacheObject
(
RedisConstants
.
DICT_LIST
);
...
...
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