Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
fit-finance
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
fitness-server
fit-finance
Commits
b127d739
Commit
b127d739
authored
Apr 23, 2024
by
程裕兵
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:brand merchant
parent
4bf3d76d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
5 deletions
+12
-5
service/src/main/java/com/jiejing/fitness/finance/service/merchant/convert/MerchantConvert.java
+10
-3
service/src/main/java/com/jiejing/fitness/finance/service/merchant/impl/BrandMerchantServiceImpl.java
+2
-2
No files found.
service/src/main/java/com/jiejing/fitness/finance/service/merchant/convert/MerchantConvert.java
View file @
b127d739
...
@@ -58,6 +58,7 @@ import java.util.List;
...
@@ -58,6 +58,7 @@ import java.util.List;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.Optional
;
import
java.util.Optional
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
import
org.apache.commons.lang3.tuple.Pair
;
/**
/**
* @author chengyubing
* @author chengyubing
...
@@ -552,10 +553,16 @@ public class MerchantConvert {
...
@@ -552,10 +553,16 @@ public class MerchantConvert {
}
}
public
static
List
<
BrandMerchantVO
>
convertBrandMerchantList
(
Long
brandId
,
List
<
MerchantVO
>
merchants
,
public
static
List
<
BrandMerchantVO
>
convertBrandMerchantList
(
Long
brandId
,
List
<
MerchantVO
>
merchants
,
SubChannelInfoDTO
dto
,
Map
<
Long
,
List
<
StudioVO
>>
studioMap
,
Map
<
Long
,
StudioMerchantApply
>
applyMap
)
{
List
<
PartyToMerchant
>
studioRelations
,
SubChannelInfoDTO
dto
,
Map
<
Long
,
StudioVO
>
studioMap
,
Map
<
Long
,
StudioMerchantApply
>
applyMap
)
{
Map
<
Long
,
List
<
Pair
<
Long
,
Long
>>>
merchantMap
=
studioRelations
.
stream
()
.
map
(
e
->
Pair
.
of
(
e
.
getMerchantId
(),
e
.
getPartyId
()))
.
collect
(
Collectors
.
groupingBy
(
Pair:
:
getLeft
));
return
merchants
.
stream
().
map
(
e
->
{
return
merchants
.
stream
().
map
(
e
->
{
List
<
String
>
studioNames
=
studioMap
.
getOrDefault
(
brandId
,
new
ArrayList
<>()).
stream
()
List
<
String
>
studioNames
=
merchantMap
.
getOrDefault
(
e
.
getId
(),
new
ArrayList
<>()).
stream
()
.
map
(
StudioVO:
:
getName
).
collect
(
Collectors
.
toList
());
.
filter
(
pair
->
null
!=
studioMap
.
get
(
pair
.
getRight
()))
.
map
(
pair
->
studioMap
.
get
(
pair
.
getRight
()).
getName
())
.
collect
(
Collectors
.
toList
());
return
convertBrandMerchant
(
brandId
,
studioNames
,
e
,
dto
,
applyMap
.
get
(
e
.
getId
()));
return
convertBrandMerchant
(
brandId
,
studioNames
,
e
,
dto
,
applyMap
.
get
(
e
.
getId
()));
}).
sorted
((
o1
,
o2
)
->
o2
.
getFinishTime
().
compareTo
(
o1
.
getFinishTime
())).
collect
(
Collectors
.
toList
());
}).
sorted
((
o1
,
o2
)
->
o2
.
getFinishTime
().
compareTo
(
o1
.
getFinishTime
())).
collect
(
Collectors
.
toList
());
}
}
...
...
service/src/main/java/com/jiejing/fitness/finance/service/merchant/impl/BrandMerchantServiceImpl.java
View file @
b127d739
...
@@ -84,9 +84,9 @@ public class BrandMerchantServiceImpl implements BrandMerchantService {
...
@@ -84,9 +84,9 @@ public class BrandMerchantServiceImpl implements BrandMerchantService {
merchantIds
,
PartyTypeEnum
.
STUDIO
);
merchantIds
,
PartyTypeEnum
.
STUDIO
);
List
<
Long
>
studioIds
=
studioRelations
.
stream
().
map
(
PartyToMerchant:
:
getPartyId
)
List
<
Long
>
studioIds
=
studioRelations
.
stream
().
map
(
PartyToMerchant:
:
getPartyId
)
.
collect
(
Collectors
.
toList
());
.
collect
(
Collectors
.
toList
());
Map
<
Long
,
List
<
StudioVO
>>
studioMap
=
studioRpcService
.
mapStudioByBrandId
(
studioIds
);
Map
<
Long
,
StudioVO
>
studioMap
=
studioRpcService
.
mapStudio
(
studioIds
);
List
<
MerchantVO
>
merchants
=
merchantRpcService
.
listByIds
(
merchantIds
);
List
<
MerchantVO
>
merchants
=
merchantRpcService
.
listByIds
(
merchantIds
);
return
MerchantConvert
.
convertBrandMerchantList
(
brandId
,
merchants
,
return
MerchantConvert
.
convertBrandMerchantList
(
brandId
,
merchants
,
studioRelations
,
configService
.
getDefaultBrandSubChannelInfo
(),
studioMap
,
applyMap
);
configService
.
getDefaultBrandSubChannelInfo
(),
studioMap
,
applyMap
);
}
}
...
...
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