Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
dj
/
rpc-riskmanage
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 50ea647c
authored
Jan 23, 2026
by
杨卫
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
feat:效果分析自测
1 parent
ac54a36e
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
37 additions
and
1 deletions
rpc-dj-riskmanage-api/src/main/java/cn/com/glsx/dj/riskmanage/dto/MerchantServiceAndBrandDTO.java
rpc-dj-riskmanage-api/src/main/java/cn/com/glsx/dj/riskmanage/dto/YqMerchantConfigDTO.java
rpc-dj-riskmanage/src/main/java/cn/com/glsx/dj/riskmanage/service/CommonService.java
rpc-dj-riskmanage/src/main/resources/META-INF/orm/ActivityMapper.xml
rpc-dj-riskmanage-api/src/main/java/cn/com/glsx/dj/riskmanage/dto/MerchantServiceAndBrandDTO.java
View file @
50ea647
package
cn
.
com
.
glsx
.
dj
.
riskmanage
.
dto
;
package
cn
.
com
.
glsx
.
dj
.
riskmanage
.
dto
;
import
cn.com.glsx.dj.smartcarlife.dto.merchant.CarBrandDTO
;
import
cn.com.glsx.dj.smartcarlife.dto.merchant.CarBrandDTO
;
import
cn.com.glsx.dj.smartcarlife.response.CarBrandResponse
;
import
com.google.common.collect.Lists
;
import
com.google.common.collect.Lists
;
import
lombok.Data
;
import
lombok.Data
;
import
lombok.experimental.Accessors
;
import
lombok.experimental.Accessors
;
...
@@ -27,6 +26,11 @@ public class MerchantServiceAndBrandDTO implements Serializable {
...
@@ -27,6 +26,11 @@ public class MerchantServiceAndBrandDTO implements Serializable {
private
Integer
merchantNo
;
private
Integer
merchantNo
;
/**
/**
* 4s店商户名称
*/
private
String
merchantName
;
/**
* 品牌名称
* 品牌名称
*/
*/
private
List
<
CarBrandDTO
>
brands
=
Lists
.
newArrayList
();
private
List
<
CarBrandDTO
>
brands
=
Lists
.
newArrayList
();
...
...
rpc-dj-riskmanage-api/src/main/java/cn/com/glsx/dj/riskmanage/dto/YqMerchantConfigDTO.java
View file @
50ea647
...
@@ -20,6 +20,11 @@ public class YqMerchantConfigDTO implements Serializable {
...
@@ -20,6 +20,11 @@ public class YqMerchantConfigDTO implements Serializable {
private
Integer
merchantId
;
private
Integer
merchantId
;
/**
/**
* 4s店商户名称
*/
private
String
merchantName
;
/**
* 主服务商商户id
* 主服务商商户id
*/
*/
private
Integer
partnerMerchantId
;
private
Integer
partnerMerchantId
;
...
...
rpc-dj-riskmanage/src/main/java/cn/com/glsx/dj/riskmanage/service/CommonService.java
View file @
50ea647
...
@@ -7,6 +7,7 @@ import cn.com.glsx.dj.riskmanage.mapper.ActivityMapper;
...
@@ -7,6 +7,7 @@ import cn.com.glsx.dj.riskmanage.mapper.ActivityMapper;
import
cn.com.glsx.dj.smartcarlife.dto.merchant.CarBrandDTO
;
import
cn.com.glsx.dj.smartcarlife.dto.merchant.CarBrandDTO
;
import
cn.com.glsx.framework.core.beans.rpc.RpcResponse
;
import
cn.com.glsx.framework.core.beans.rpc.RpcResponse
;
import
cn.com.glsx.merchants.model.response.MerchantBrandDTO
;
import
cn.com.glsx.merchants.model.response.MerchantBrandDTO
;
import
cn.com.glsx.merchants.model.response.MerchantNameDTO
;
import
cn.com.glsx.merchants.remote.MerchantRemote
;
import
cn.com.glsx.merchants.remote.MerchantRemote
;
import
cn.com.glsx.scrm.proxy.enums.ProxyRequestSourceEnum
;
import
cn.com.glsx.scrm.proxy.enums.ProxyRequestSourceEnum
;
import
cn.com.glsx.scrm.proxy.model.CommonProxyRequest
;
import
cn.com.glsx.scrm.proxy.model.CommonProxyRequest
;
...
@@ -52,6 +53,10 @@ public class CommonService {
...
@@ -52,6 +53,10 @@ public class CommonService {
* @return java.util.List<cn.com.glsx.dj.riskmanage.dto.MerchantServiceAndBrandDTO>
* @return java.util.List<cn.com.glsx.dj.riskmanage.dto.MerchantServiceAndBrandDTO>
*/
*/
public
List
<
MerchantServiceAndBrandDTO
>
findMerchantListServiceAndBrand
(
List
<
Integer
>
merchantNos
,
String
scene
)
{
public
List
<
MerchantServiceAndBrandDTO
>
findMerchantListServiceAndBrand
(
List
<
Integer
>
merchantNos
,
String
scene
)
{
if
(
CollUtil
.
isEmpty
(
merchantNos
))
{
return
Collections
.
emptyList
();
}
// 主服务商
// 主服务商
Integer
mainMerchantId
=
env
.
getProperty
(
ConfigCenterConstants
.
DIRECT_SALE_MERCHANT_ID
,
Integer
.
class
,
44217690
);
Integer
mainMerchantId
=
env
.
getProperty
(
ConfigCenterConstants
.
DIRECT_SALE_MERCHANT_ID
,
Integer
.
class
,
44217690
);
...
@@ -67,6 +72,21 @@ public class CommonService {
...
@@ -67,6 +72,21 @@ public class CommonService {
}
}
},
taskExecutor
);
},
taskExecutor
);
// 查询商户名称
CompletableFuture
<
Map
<
Integer
,
MerchantNameDTO
>>
merchantNameFuture
=
CompletableFuture
.
supplyAsync
(()
->
{
RpcResponse
<
List
<
MerchantNameDTO
>>
merchantNameByMerchantIdsResp
=
merchantRemote
.
getMerchantNameByMerchantIds
(
merchantNos
);
if
(
merchantNameByMerchantIdsResp
.
isFailed
())
{
log
.
error
(
"查询商户名称失败: {}"
,
merchantNameByMerchantIdsResp
.
getMessage
());
return
MapUtil
.<
Integer
,
MerchantNameDTO
>
builder
().
build
();
}
return
Optional
.
ofNullable
(
merchantNameByMerchantIdsResp
.
getResult
())
.
orElseGet
(
ArrayList:
:
new
)
.
stream
()
.
collect
(
Collectors
.
toMap
(
MerchantNameDTO:
:
getMerchantId
,
Function
.
identity
()));
},
taskExecutor
);
// 查询门店主营品牌
// 查询门店主营品牌
CompletableFuture
<
Map
<
Integer
,
List
<
MerchantBrandDTO
>>>
merchantBrandFuture
=
CompletableFuture
<
Map
<
Integer
,
List
<
MerchantBrandDTO
>>>
merchantBrandFuture
=
CompletableFuture
.
supplyAsync
(()
->
{
CompletableFuture
.
supplyAsync
(()
->
{
...
@@ -102,12 +122,14 @@ public class CommonService {
...
@@ -102,12 +122,14 @@ public class CommonService {
CompletableFuture
<
Void
>
allFutures
=
CompletableFuture
.
allOf
(
CompletableFuture
<
Void
>
allFutures
=
CompletableFuture
.
allOf
(
merchantConfigFuture
,
merchantConfigFuture
,
merchantBrandFuture
,
merchantBrandFuture
,
merchantNameFuture
,
carBrandFuture
carBrandFuture
);
);
return
allFutures
.
thenApply
(
v
->
{
return
allFutures
.
thenApply
(
v
->
{
Map
<
Integer
,
List
<
YqMerchantConfigDTO
>>
merchantIdGroup
=
merchantConfigFuture
.
join
();
Map
<
Integer
,
List
<
YqMerchantConfigDTO
>>
merchantIdGroup
=
merchantConfigFuture
.
join
();
Map
<
Integer
,
List
<
MerchantBrandDTO
>>
merchantIdGroupBrand
=
merchantBrandFuture
.
join
();
Map
<
Integer
,
List
<
MerchantBrandDTO
>>
merchantIdGroupBrand
=
merchantBrandFuture
.
join
();
Map
<
Integer
,
MerchantNameDTO
>
merchantNameMap
=
merchantNameFuture
.
join
();
Map
<
Integer
,
CarBrandDTO
>
firstBrandMap
=
carBrandFuture
.
join
();
Map
<
Integer
,
CarBrandDTO
>
firstBrandMap
=
carBrandFuture
.
join
();
return
merchantNos
.
stream
().
map
(
merchantNo
->
{
return
merchantNos
.
stream
().
map
(
merchantNo
->
{
...
@@ -129,6 +151,10 @@ public class CommonService {
...
@@ -129,6 +151,10 @@ public class CommonService {
CarBrandDTO
carBrandResponse
=
firstBrandMap
.
get
(
merchantBrandDTO
.
getFirstBrandId
());
CarBrandDTO
carBrandResponse
=
firstBrandMap
.
get
(
merchantBrandDTO
.
getFirstBrandId
());
merchantServiceAndBrandDTO
.
getBrands
().
add
(
carBrandResponse
);
merchantServiceAndBrandDTO
.
getBrands
().
add
(
carBrandResponse
);
});
});
Optional
.
ofNullable
(
merchantNameMap
.
get
(
merchantNo
))
.
ifPresent
(
merchantNameDTO
->
merchantServiceAndBrandDTO
.
setMerchantName
(
merchantNameDTO
.
getMerchantName
()));
return
merchantServiceAndBrandDTO
;
return
merchantServiceAndBrandDTO
;
}).
collect
(
Collectors
.
toList
());
}).
collect
(
Collectors
.
toList
());
}).
join
();
}).
join
();
...
...
rpc-dj-riskmanage/src/main/resources/META-INF/orm/ActivityMapper.xml
View file @
50ea647
...
@@ -102,6 +102,7 @@
...
@@ -102,6 +102,7 @@
<select
id=
"getServiceByMerchantId"
resultType=
"cn.com.glsx.dj.riskmanage.dto.YqMerchantConfigDTO"
>
<select
id=
"getServiceByMerchantId"
resultType=
"cn.com.glsx.dj.riskmanage.dto.YqMerchantConfigDTO"
>
select
select
t2.main_merchant_id as merchantId,
t2.main_merchant_id as merchantId,
t2.main_merchant_name as merchantName,
t1.partner_merchant_id as partnerMerchantId,
t1.partner_merchant_id as partnerMerchantId,
t1.partner_merchant_name as partnerMerchantName
t1.partner_merchant_name as partnerMerchantName
from dj_car_life_yqmerchant_config t1
from dj_car_life_yqmerchant_config t1
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment