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
af188164
Commit
af188164
authored
Jul 10, 2026
by
zhangxingmin
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/dev' into prod
parents
8faa5287
49a2a946
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
168 additions
and
103 deletions
+168
-103
yd-csf-api/src/main/java/com/yd/csf/api/controller/ApiFortuneController.java
+4
-2
yd-csf-service/src/main/java/com/yd/csf/service/model/Policy.java
+5
-0
yd-csf-service/src/main/java/com/yd/csf/service/service/FortuneService.java
+1
-1
yd-csf-service/src/main/java/com/yd/csf/service/service/IExpectedFortuneService.java
+3
-0
yd-csf-service/src/main/java/com/yd/csf/service/service/impl/CommissionServiceImpl.java
+62
-29
yd-csf-service/src/main/java/com/yd/csf/service/service/impl/ExpectedFortuneServiceImpl.java
+29
-2
yd-csf-service/src/main/java/com/yd/csf/service/service/impl/FortuneServiceImpl.java
+56
-68
yd-csf-service/src/main/java/com/yd/csf/service/service/impl/PolicyFollowServiceImpl.java
+6
-0
yd-csf-service/src/main/resources/mappers/PolicyMapper.xml
+2
-1
No files found.
yd-csf-api/src/main/java/com/yd/csf/api/controller/ApiFortuneController.java
View file @
af188164
...
@@ -522,7 +522,7 @@ public class ApiFortuneController {
...
@@ -522,7 +522,7 @@ public class ApiFortuneController {
// 查询统计数据
// 查询统计数据
List
<
Fortune
>
fortuneList
=
fortuneService
.
list
(
queryWrapper
);
List
<
Fortune
>
fortuneList
=
fortuneService
.
list
(
queryWrapper
);
FortuneStatisticsVO
statisticsVO
=
fortuneService
.
getFortuneStatistics
(
fortuneList
.
stream
().
map
(
Fortune:
:
getId
).
collect
(
Collectors
.
toList
())
);
FortuneStatisticsVO
statisticsVO
=
fortuneService
.
getFortuneStatistics
(
fortuneList
);
// 组装返回结果
// 组装返回结果
FortunePageResponse
response
=
new
FortunePageResponse
();
FortunePageResponse
response
=
new
FortunePageResponse
();
...
@@ -540,7 +540,9 @@ public class ApiFortuneController {
...
@@ -540,7 +540,9 @@ public class ApiFortuneController {
if
(
CollectionUtils
.
isEmpty
(
statisticsRequest
.
getFortuneIdList
()))
{
if
(
CollectionUtils
.
isEmpty
(
statisticsRequest
.
getFortuneIdList
()))
{
return
Result
.
fail
(
ErrorCode
.
PARAMS_ERROR
.
getCode
(),
"fortuneId列表不能为空"
);
return
Result
.
fail
(
ErrorCode
.
PARAMS_ERROR
.
getCode
(),
"fortuneId列表不能为空"
);
}
}
return
Result
.
success
(
fortuneService
.
getFortuneStatistics
(
statisticsRequest
.
getFortuneIdList
()));
List
<
Fortune
>
fortuneList
=
fortuneService
.
listByIds
(
statisticsRequest
.
getFortuneIdList
());
// 计算统计数据
return
Result
.
success
(
fortuneService
.
getFortuneStatistics
(
fortuneList
));
}
}
/**
/**
...
...
yd-csf-service/src/main/java/com/yd/csf/service/model/Policy.java
View file @
af188164
...
@@ -120,6 +120,11 @@ public class Policy implements Serializable {
...
@@ -120,6 +120,11 @@ public class Policy implements Serializable {
private
BigDecimal
totalPaymentPremium
;
private
BigDecimal
totalPaymentPremium
;
/**
/**
* 总保费(HKD)
*/
private
BigDecimal
totalPaymentPremiumHkd
;
/**
* 保单状态
* 保单状态
*/
*/
private
String
status
;
private
String
status
;
...
...
yd-csf-service/src/main/java/com/yd/csf/service/service/FortuneService.java
View file @
af188164
...
@@ -37,7 +37,7 @@ public interface FortuneService extends IService<Fortune> {
...
@@ -37,7 +37,7 @@ public interface FortuneService extends IService<Fortune> {
Fortune
queryOne
(
String
fortuneBizId
);
Fortune
queryOne
(
String
fortuneBizId
);
FortuneStatisticsVO
getFortuneStatistics
(
List
<
Long
>
fortuneId
List
);
FortuneStatisticsVO
getFortuneStatistics
(
List
<
Fortune
>
fortune
List
);
Boolean
addFortuneBatch
(
List
<
FortuneAddRequest
>
fortuneAddRequestList
);
Boolean
addFortuneBatch
(
List
<
FortuneAddRequest
>
fortuneAddRequestList
);
...
...
yd-csf-service/src/main/java/com/yd/csf/service/service/IExpectedFortuneService.java
View file @
af188164
...
@@ -10,6 +10,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
...
@@ -10,6 +10,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
import
com.yd.csf.service.vo.ExpectedFortuneStatisticsVO
;
import
com.yd.csf.service.vo.ExpectedFortuneStatisticsVO
;
import
com.yd.csf.service.vo.PayableReportVO
;
import
com.yd.csf.service.vo.PayableReportVO
;
import
java.math.BigDecimal
;
import
java.util.List
;
import
java.util.List
;
/**
/**
...
@@ -87,4 +88,6 @@ public interface IExpectedFortuneService extends IService<ExpectedFortune> {
...
@@ -87,4 +88,6 @@ public interface IExpectedFortuneService extends IService<ExpectedFortune> {
* @return 全部列表数据
* @return 全部列表数据
*/
*/
List
<
ApiExpectedFortunePageResponse
>
queryListAll
(
QueryWrapper
<
ExpectedFortune
>
queryWrapper
);
List
<
ApiExpectedFortunePageResponse
>
queryListAll
(
QueryWrapper
<
ExpectedFortune
>
queryWrapper
);
BigDecimal
queryExchangeRateByFeign
(
String
sourceCurrency
,
String
targetCurrency
);
}
}
yd-csf-service/src/main/java/com/yd/csf/service/service/impl/CommissionServiceImpl.java
View file @
af188164
This diff is collapsed.
Click to expand it.
yd-csf-service/src/main/java/com/yd/csf/service/service/impl/ExpectedFortuneServiceImpl.java
View file @
af188164
...
@@ -5,10 +5,13 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
...
@@ -5,10 +5,13 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yd.base.feign.client.exchangerate.ApiExchangeRateFeignClient
;
import
com.yd.common.enums.ResultCode
;
import
com.yd.common.exception.BusinessException
;
import
com.yd.common.result.Result
;
import
com.yd.csf.feign.request.expectedfortune.ApiExpectedFortunePageRequest
;
import
com.yd.csf.feign.request.expectedfortune.ApiExpectedFortunePageRequest
;
import
com.yd.csf.feign.response.expectedfortune.ApiExpectedFortunePageResponse
;
import
com.yd.csf.feign.response.expectedfortune.ApiExpectedFortunePageResponse
;
import
com.yd.csf.service.dto.UserGradeDto
;
import
com.yd.csf.service.dto.UserGradeDto
;
import
com.yd.csf.service.enums.CurrencyEnum
;
import
com.yd.csf.service.enums.FortuneTypeEnum
;
import
com.yd.csf.service.enums.FortuneTypeEnum
;
import
com.yd.csf.service.model.ExpectedFortune
;
import
com.yd.csf.service.model.ExpectedFortune
;
import
com.yd.csf.service.dao.ExpectedFortuneMapper
;
import
com.yd.csf.service.dao.ExpectedFortuneMapper
;
...
@@ -24,7 +27,7 @@ import org.springframework.beans.factory.annotation.Autowired;
...
@@ -24,7 +27,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
import
java.
time.LocalDate
;
import
java.
math.BigDecimal
;
import
java.util.*
;
import
java.util.*
;
import
java.util.function.Function
;
import
java.util.function.Function
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
...
@@ -53,6 +56,9 @@ public class ExpectedFortuneServiceImpl extends ServiceImpl<ExpectedFortuneMappe
...
@@ -53,6 +56,9 @@ public class ExpectedFortuneServiceImpl extends ServiceImpl<ExpectedFortuneMappe
@Autowired
@Autowired
private
IAgentAccumulatedFycService
iAgentAccumulatedFycService
;
private
IAgentAccumulatedFycService
iAgentAccumulatedFycService
;
@Resource
private
ApiExchangeRateFeignClient
apiExchangeRateFeignClient
;
@Override
@Override
public
IPage
<
ApiExpectedFortunePageResponse
>
page
(
Page
<
ApiExpectedFortunePageResponse
>
page
,
public
IPage
<
ApiExpectedFortunePageResponse
>
page
(
Page
<
ApiExpectedFortunePageResponse
>
page
,
ApiExpectedFortunePageRequest
request
)
{
ApiExpectedFortunePageRequest
request
)
{
...
@@ -388,4 +394,25 @@ public class ExpectedFortuneServiceImpl extends ServiceImpl<ExpectedFortuneMappe
...
@@ -388,4 +394,25 @@ public class ExpectedFortuneServiceImpl extends ServiceImpl<ExpectedFortuneMappe
return
records
;
return
records
;
}
}
/**
* 查询币对的默认汇率
*
* @param sourceCurrency 源币种
* @param targetCurrency 目标币种
* @return 汇率
*/
@Override
public
BigDecimal
queryExchangeRateByFeign
(
String
sourceCurrency
,
String
targetCurrency
)
{
if
(
sourceCurrency
.
equalsIgnoreCase
(
targetCurrency
))
{
return
BigDecimal
.
ONE
;
}
// 调用Feign客户端查询汇率
Result
<
BigDecimal
>
result
=
apiExchangeRateFeignClient
.
getExchangeRate
(
sourceCurrency
,
targetCurrency
,
""
);
if
(
result
!=
null
&&
result
.
getData
()
!=
null
)
{
return
result
.
getData
();
}
else
{
throw
new
BusinessException
(
ResultCode
.
PARAMS_ERROR
.
getCode
(),
"查询币对的默认汇率失败, 币种:"
+
sourceCurrency
+
" -> "
+
targetCurrency
);
}
}
}
}
yd-csf-service/src/main/java/com/yd/csf/service/service/impl/FortuneServiceImpl.java
View file @
af188164
This diff is collapsed.
Click to expand it.
yd-csf-service/src/main/java/com/yd/csf/service/service/impl/PolicyFollowServiceImpl.java
View file @
af188164
...
@@ -698,6 +698,7 @@ public class PolicyFollowServiceImpl extends ServiceImpl<PolicyFollowMapper, Pol
...
@@ -698,6 +698,7 @@ public class PolicyFollowServiceImpl extends ServiceImpl<PolicyFollowMapper, Pol
policy
.
setCurrency
(
policyFollow
.
getPolicyCurrency
());
policy
.
setCurrency
(
policyFollow
.
getPolicyCurrency
());
policy
.
setPaymentTerm
(
policyFollow
.
getIssueNumber
());
policy
.
setPaymentTerm
(
policyFollow
.
getIssueNumber
());
policy
.
setTotalPaymentPremium
(
calculateTotalPaymentPremium
(
policy
));
policy
.
setTotalPaymentPremium
(
calculateTotalPaymentPremium
(
policy
));
policy
.
setTotalPaymentPremiumHkd
(
calculateTotalPaymentPremiumHkd
(
policy
.
getCurrency
(),
policy
.
getTotalPaymentPremium
()));
policy
.
setUnderwritingDate
(
changePolicyFollowStatusRequest
.
getUnderwritingDate
());
policy
.
setUnderwritingDate
(
changePolicyFollowStatusRequest
.
getUnderwritingDate
());
policy
.
setEffectiveDate
(
changePolicyFollowStatusRequest
.
getEffectiveDate
());
policy
.
setEffectiveDate
(
changePolicyFollowStatusRequest
.
getEffectiveDate
());
//冷静期结束日期
//冷静期结束日期
...
@@ -733,6 +734,11 @@ public class PolicyFollowServiceImpl extends ServiceImpl<PolicyFollowMapper, Pol
...
@@ -733,6 +734,11 @@ public class PolicyFollowServiceImpl extends ServiceImpl<PolicyFollowMapper, Pol
return
true
;
return
true
;
}
}
private
BigDecimal
calculateTotalPaymentPremiumHkd
(
String
currency
,
BigDecimal
totalPaymentPremium
)
{
BigDecimal
originalToHkdRate
=
expectedFortuneService
.
queryExchangeRateByFeign
(
currency
,
"HKD"
);
return
totalPaymentPremium
.
multiply
(
originalToHkdRate
).
setScale
(
4
,
RoundingMode
.
HALF_UP
);
}
private
void
policyFollowChangeStatusValidPolicyFollow
(
PolicyFollow
policyFollow
)
{
private
void
policyFollowChangeStatusValidPolicyFollow
(
PolicyFollow
policyFollow
)
{
if
(
ObjectUtils
.
isEmpty
(
policyFollow
.
getReconciliationCompanyBizId
()))
{
if
(
ObjectUtils
.
isEmpty
(
policyFollow
.
getReconciliationCompanyBizId
()))
{
throw
new
BusinessException
(
"新单跟进-基础数据,reconciliationCompanyBizId 不能为空"
);
throw
new
BusinessException
(
"新单跟进-基础数据,reconciliationCompanyBizId 不能为空"
);
...
...
yd-csf-service/src/main/resources/mappers/PolicyMapper.xml
View file @
af188164
...
@@ -25,6 +25,7 @@
...
@@ -25,6 +25,7 @@
<result
property=
"paymentFrequency"
column=
"payment_frequency"
/>
<result
property=
"paymentFrequency"
column=
"payment_frequency"
/>
<result
property=
"paymentPremium"
column=
"payment_premium"
/>
<result
property=
"paymentPremium"
column=
"payment_premium"
/>
<result
property=
"totalPaymentPremium"
column=
"total_payment_premium"
/>
<result
property=
"totalPaymentPremium"
column=
"total_payment_premium"
/>
<result
property=
"totalPaymentPremiumHkd"
column=
"total_payment_premium_hkd"
/>
<result
property=
"status"
column=
"status"
/>
<result
property=
"status"
column=
"status"
/>
<result
property=
"currency"
column=
"currency"
/>
<result
property=
"currency"
column=
"currency"
/>
<result
property=
"initialPremium"
column=
"initial_premium"
/>
<result
property=
"initialPremium"
column=
"initial_premium"
/>
...
@@ -58,7 +59,7 @@
...
@@ -58,7 +59,7 @@
<sql
id=
"Base_Column_List"
>
<sql
id=
"Base_Column_List"
>
id,policy_biz_id,policy_no,user_biz_id,product_launch_biz_id,product_code,
id,policy_biz_id,policy_no,user_biz_id,product_launch_biz_id,product_code,
product_name,product_cate,insurance_company,insurance_company_biz_id,region,
product_name,product_cate,insurance_company,insurance_company_biz_id,region,
policy_holder,policy_holder_age,insured,guarantee_period,sum_insured,payment_term,payment_frequency,payment_premium,total_payment_premium,
policy_holder,policy_holder_age,insured,guarantee_period,sum_insured,payment_term,payment_frequency,payment_premium,total_payment_premium,
total_payment_premium_hkd,
status,currency,initial_premium,sign_date,issue_date,
status,currency,initial_premium,sign_date,issue_date,
effective_date,cooling_off_end_date,cooling_off_days,renewal_date,is_prepaid,deductibles,prepaid_term,
effective_date,cooling_off_end_date,cooling_off_days,renewal_date,is_prepaid,deductibles,prepaid_term,
initial_payment_method,renewal_payment_method,dividend_distribution_method,is_backtrack,is_join,
initial_payment_method,renewal_payment_method,dividend_distribution_method,is_backtrack,is_join,
...
...
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