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
fbd31c8a
Commit
fbd31c8a
authored
Mar 09, 2026
by
zhangxingmin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
push
parent
0225290a
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
92 additions
and
19 deletions
+92
-19
yd-csf-feign/src/main/java/com/yd/csf/feign/response/expectedfortune/ApiExpectedFortunePageResponse.java
+5
-0
yd-csf-service/src/main/java/com/yd/csf/service/dao/ConditionConfigMapper.java
+9
-0
yd-csf-service/src/main/java/com/yd/csf/service/service/IConditionConfigService.java
+3
-0
yd-csf-service/src/main/java/com/yd/csf/service/service/impl/ConditionConfigServiceImpl.java
+7
-0
yd-csf-service/src/main/java/com/yd/csf/service/service/impl/ExpectedFortuneServiceImpl.java
+52
-19
yd-csf-service/src/main/resources/mappers/ConditionConfigMapper.xml
+16
-0
No files found.
yd-csf-feign/src/main/java/com/yd/csf/feign/response/expectedfortune/ApiExpectedFortunePageResponse.java
View file @
fbd31c8a
...
@@ -229,4 +229,9 @@ public class ApiExpectedFortunePageResponse {
...
@@ -229,4 +229,9 @@ public class ApiExpectedFortunePageResponse {
@Schema
(
description
=
"更新时间"
)
@Schema
(
description
=
"更新时间"
)
private
LocalDateTime
updateTime
;
private
LocalDateTime
updateTime
;
/**
* 发佣率(对应职级)
*/
@Schema
(
description
=
"发佣率(对应职级)"
)
private
String
commissionRatio
;
}
}
yd-csf-service/src/main/java/com/yd/csf/service/dao/ConditionConfigMapper.java
View file @
fbd31c8a
...
@@ -7,6 +7,8 @@ import com.yd.csf.feign.response.conditionconfig.ApiConditionConfigPageResponse;
...
@@ -7,6 +7,8 @@ import com.yd.csf.feign.response.conditionconfig.ApiConditionConfigPageResponse;
import
com.yd.csf.service.model.ConditionConfig
;
import
com.yd.csf.service.model.ConditionConfig
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
import
java.util.Map
;
/**
/**
* <p>
* <p>
...
@@ -20,4 +22,11 @@ public interface ConditionConfigMapper extends BaseMapper<ConditionConfig> {
...
@@ -20,4 +22,11 @@ public interface ConditionConfigMapper extends BaseMapper<ConditionConfig> {
IPage
<
ApiConditionConfigPageResponse
>
page
(
@Param
(
"page"
)
Page
<
ApiConditionConfigPageResponse
>
page
,
IPage
<
ApiConditionConfigPageResponse
>
page
(
@Param
(
"page"
)
Page
<
ApiConditionConfigPageResponse
>
page
,
@Param
(
"request"
)
ApiConditionConfigPageRequest
request
);
@Param
(
"request"
)
ApiConditionConfigPageRequest
request
);
/**
* 根据业务员ID列表查询每个业务员对应的基础销售积分比例
* @param brokerBizIds 业务员ID列表
* @return 包含 brokerBizId 和 conditional_value 的 Map 列表
*/
List
<
Map
<
String
,
Object
>>
selectBrokerRatioByBizIds
(
@Param
(
"list"
)
List
<
String
>
brokerBizIds
);
}
}
yd-csf-service/src/main/java/com/yd/csf/service/service/IConditionConfigService.java
View file @
fbd31c8a
...
@@ -9,6 +9,7 @@ import com.yd.csf.service.model.ConditionConfig;
...
@@ -9,6 +9,7 @@ import com.yd.csf.service.model.ConditionConfig;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
/**
/**
* <p>
* <p>
...
@@ -23,6 +24,8 @@ public interface IConditionConfigService extends IService<ConditionConfig> {
...
@@ -23,6 +24,8 @@ public interface IConditionConfigService extends IService<ConditionConfig> {
IPage
<
ApiConditionConfigPageResponse
>
page
(
Page
<
ApiConditionConfigPageResponse
>
page
,
IPage
<
ApiConditionConfigPageResponse
>
page
(
Page
<
ApiConditionConfigPageResponse
>
page
,
ApiConditionConfigPageRequest
request
);
ApiConditionConfigPageRequest
request
);
List
<
Map
<
String
,
Object
>>
selectBrokerRatioByBizIds
(
List
<
String
>
brokerBizIds
);
ConditionConfig
queryOne
(
String
conditionBizId
);
ConditionConfig
queryOne
(
String
conditionBizId
);
List
<
ConditionConfig
>
queryList
(
ConditionConfigDto
dto
);
List
<
ConditionConfig
>
queryList
(
ConditionConfigDto
dto
);
...
...
yd-csf-service/src/main/java/com/yd/csf/service/service/impl/ConditionConfigServiceImpl.java
View file @
fbd31c8a
...
@@ -12,10 +12,12 @@ import com.yd.csf.service.model.FormulaConfig;
...
@@ -12,10 +12,12 @@ import com.yd.csf.service.model.FormulaConfig;
import
com.yd.csf.service.service.IConditionConfigService
;
import
com.yd.csf.service.service.IConditionConfigService
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.ibatis.annotations.Param
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.CollectionUtils
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
/**
/**
* <p>
* <p>
...
@@ -34,6 +36,11 @@ public class ConditionConfigServiceImpl extends ServiceImpl<ConditionConfigMappe
...
@@ -34,6 +36,11 @@ public class ConditionConfigServiceImpl extends ServiceImpl<ConditionConfigMappe
return
baseMapper
.
page
(
page
,
request
);
return
baseMapper
.
page
(
page
,
request
);
}
}
@Override
public
List
<
Map
<
String
,
Object
>>
selectBrokerRatioByBizIds
(
List
<
String
>
brokerBizIds
){
return
baseMapper
.
selectBrokerRatioByBizIds
(
brokerBizIds
);
}
/**
/**
* 查询单个对象
* 查询单个对象
* @param conditionBizId
* @param conditionBizId
...
...
yd-csf-service/src/main/java/com/yd/csf/service/service/impl/ExpectedFortuneServiceImpl.java
View file @
fbd31c8a
...
@@ -10,6 +10,7 @@ import com.yd.csf.service.model.ExpectedFortune;
...
@@ -10,6 +10,7 @@ import com.yd.csf.service.model.ExpectedFortune;
import
com.yd.csf.service.dao.ExpectedFortuneMapper
;
import
com.yd.csf.service.dao.ExpectedFortuneMapper
;
import
com.yd.csf.service.model.Policy
;
import
com.yd.csf.service.model.Policy
;
import
com.yd.csf.service.model.PolicyFollow
;
import
com.yd.csf.service.model.PolicyFollow
;
import
com.yd.csf.service.service.IConditionConfigService
;
import
com.yd.csf.service.service.IExpectedFortuneService
;
import
com.yd.csf.service.service.IExpectedFortuneService
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.yd.csf.service.service.PolicyFollowService
;
import
com.yd.csf.service.service.PolicyFollowService
;
...
@@ -20,8 +21,7 @@ import org.springframework.beans.BeanUtils;
...
@@ -20,8 +21,7 @@ import org.springframework.beans.BeanUtils;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
import
java.util.List
;
import
java.util.*
;
import
java.util.Map
;
import
java.util.function.Function
;
import
java.util.function.Function
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
...
@@ -42,6 +42,9 @@ public class ExpectedFortuneServiceImpl extends ServiceImpl<ExpectedFortuneMappe
...
@@ -42,6 +42,9 @@ public class ExpectedFortuneServiceImpl extends ServiceImpl<ExpectedFortuneMappe
@Resource
@Resource
private
PolicyFollowService
policyFollowService
;
private
PolicyFollowService
policyFollowService
;
@Resource
private
IConditionConfigService
iConditionConfigService
;
@Override
@Override
public
IPage
<
ApiExpectedFortunePageResponse
>
page
(
Page
<
ApiExpectedFortunePageResponse
>
page
,
public
IPage
<
ApiExpectedFortunePageResponse
>
page
(
Page
<
ApiExpectedFortunePageResponse
>
page
,
ApiExpectedFortunePageRequest
request
)
{
ApiExpectedFortunePageRequest
request
)
{
...
@@ -88,35 +91,65 @@ public class ExpectedFortuneServiceImpl extends ServiceImpl<ExpectedFortuneMappe
...
@@ -88,35 +91,65 @@ public class ExpectedFortuneServiceImpl extends ServiceImpl<ExpectedFortuneMappe
@Override
@Override
public
List
<
ApiExpectedFortunePageResponse
>
toVOList
(
List
<
ExpectedFortune
>
expectedFortuneList
)
{
public
List
<
ApiExpectedFortunePageResponse
>
toVOList
(
List
<
ExpectedFortune
>
expectedFortuneList
)
{
// 关联保单信息
if
(
CollUtil
.
isEmpty
(
expectedFortuneList
))
{
return
Collections
.
emptyList
();
}
// 收集所有 brokerBizId
List
<
String
>
brokerBizIds
=
expectedFortuneList
.
stream
()
.
map
(
ExpectedFortune:
:
getBrokerBizId
)
.
filter
(
Objects:
:
nonNull
)
.
distinct
()
.
collect
(
Collectors
.
toList
());
Map
<
String
,
String
>
brokerRatioMap
=
new
HashMap
<>();
if
(
CollUtil
.
isNotEmpty
(
brokerBizIds
))
{
List
<
Map
<
String
,
Object
>>
ratioList
=
iConditionConfigService
.
selectBrokerRatioByBizIds
(
brokerBizIds
);
brokerRatioMap
=
ratioList
.
stream
()
.
filter
(
map
->
map
.
get
(
"conditional_value"
)
!=
null
)
.
collect
(
Collectors
.
toMap
(
map
->
(
String
)
map
.
get
(
"brokerBizId"
),
map
->
(
String
)
map
.
get
(
"conditional_value"
),
(
v1
,
v2
)
->
v1
));
}
List
<
String
>
policyNos
=
expectedFortuneList
.
stream
()
.
map
(
ExpectedFortune:
:
getPolicyNo
)
.
collect
(
Collectors
.
toList
());
List
<
Policy
>
policyList
=
policyService
.
lambdaQuery
()
List
<
Policy
>
policyList
=
policyService
.
lambdaQuery
()
.
in
(
Policy:
:
getPolicyNo
,
expectedFortuneList
.
stream
().
map
(
ExpectedFortune:
:
getPolicyNo
).
collect
(
Collectors
.
toList
()))
.
in
(
Policy:
:
getPolicyNo
,
policyNos
).
list
();
.
list
();
List
<
PolicyFollow
>
policyFollowList
=
policyFollowService
.
lambdaQuery
()
List
<
PolicyFollow
>
policyFollowList
=
policyFollowService
.
lambdaQuery
()
.
in
(
PolicyFollow:
:
getPolicyNo
,
expectedFortuneList
.
stream
().
map
(
ExpectedFortune:
:
getPolicyNo
).
collect
(
Collectors
.
toList
()))
.
in
(
PolicyFollow:
:
getPolicyNo
,
policyNos
).
list
();
.
list
();
Map
<
String
,
Policy
>
policyMap
=
policyList
.
stream
()
Map
<
String
,
Policy
>
policyMap
=
policyList
.
stream
()
.
collect
(
Collectors
.
toMap
(
Policy:
:
getPolicyNo
,
Function
.
identity
()));
.
collect
(
Collectors
.
toMap
(
Policy:
:
getPolicyNo
,
Function
.
identity
()));
Map
<
String
,
PolicyFollow
>
policyFollowMap
=
policyFollowList
.
stream
()
Map
<
String
,
PolicyFollow
>
policyFollowMap
=
policyFollowList
.
stream
()
.
collect
(
Collectors
.
toMap
(
PolicyFollow:
:
getPolicyNo
,
Function
.
identity
()));
.
collect
(
Collectors
.
toMap
(
PolicyFollow:
:
getPolicyNo
,
Function
.
identity
()));
List
<
ApiExpectedFortunePageResponse
>
expectedFortuneVOList
=
expectedFortuneList
.
stream
().
map
(
expectedFortune
->
{
// 组装 VO
ApiExpectedFortunePageResponse
expectedFortuneVO
=
new
ApiExpectedFortunePageResponse
();
Map
<
String
,
String
>
finalBrokerRatioMap
=
brokerRatioMap
;
BeanUtils
.
copyProperties
(
expectedFortune
,
expectedFortuneVO
);
List
<
ApiExpectedFortunePageResponse
>
voList
=
expectedFortuneList
.
stream
().
map
(
ef
->
{
ApiExpectedFortunePageResponse
vo
=
new
ApiExpectedFortunePageResponse
();
BeanUtils
.
copyProperties
(
ef
,
vo
);
Policy
policy
=
policyMap
.
get
(
expectedFortune
.
getPolicyNo
());
String
ratio
=
finalBrokerRatioMap
.
get
(
ef
.
getBrokerBizId
());
PolicyFollow
policyFollow
=
policyFollowMap
.
get
(
expectedFortune
.
getPolicyNo
());
vo
.
setCommissionRatio
(
ratio
);
Policy
policy
=
policyMap
.
get
(
ef
.
getPolicyNo
());
PolicyFollow
follow
=
policyFollowMap
.
get
(
ef
.
getPolicyNo
());
if
(
policy
!=
null
)
{
if
(
policy
!=
null
)
{
expectedFortuneVO
.
setInsuranceCompany
(
policy
.
getInsuranceCompany
());
vo
.
setInsuranceCompany
(
policy
.
getInsuranceCompany
());
expectedFortuneVO
.
setPremium
(
policy
.
getPaymentPremium
());
vo
.
setPremium
(
policy
.
getPaymentPremium
());
}
}
if
(
policyF
ollow
!=
null
)
{
if
(
f
ollow
!=
null
)
{
expectedFortuneVO
.
setProductName
(
policyF
ollow
.
getProductName
());
vo
.
setProductName
(
f
ollow
.
getProductName
());
expectedFortuneVO
.
setProductLaunchBizId
(
policyF
ollow
.
getProductLaunchBizId
());
vo
.
setProductLaunchBizId
(
f
ollow
.
getProductLaunchBizId
());
}
}
return
expectedFortuneVO
;
return
vo
;
}).
collect
(
Collectors
.
toList
());
}).
collect
(
Collectors
.
toList
());
return
expectedFortuneVOList
;
return
voList
;
}
}
@Override
@Override
...
...
yd-csf-service/src/main/resources/mappers/ConditionConfigMapper.xml
View file @
fbd31c8a
...
@@ -12,4 +12,20 @@
...
@@ -12,4 +12,20 @@
and cc.is_deleted = 0
and cc.is_deleted = 0
</where>
</where>
</select>
</select>
<select
id=
"selectBrokerRatioByBizIds"
resultType=
"java.util.Map"
>
SELECT
aaf.agent_id AS brokerBizId,
cc.conditional_value
FROM agent_accumulated_fyc aaf
LEFT JOIN condition_config cc
ON aaf.total_fyc >= cc.min_value
AND (cc.max_value IS NULL OR aaf.total_fyc
<
cc.max_value)
AND cc.condition_type_biz_id = 'condition_type_sk33eRvu75eF8IRL'
WHERE aaf.agent_id IN
<foreach
collection=
"list"
item=
"item"
open=
"("
separator=
","
close=
")"
>
#{item}
</foreach>
</select>
</mapper>
</mapper>
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