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
c14785a2
Commit
c14785a2
authored
Apr 08, 2024
by
程裕兵
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:enum error
parent
e3f81feb
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
4 deletions
+25
-4
service/src/main/java/com/jiejing/fitness/finance/service/merchant/convert/MerchantConvert.java
+6
-2
service/src/main/java/com/jiejing/fitness/finance/service/merchant/impl/StudioMerchantServiceImpl.java
+19
-2
No files found.
service/src/main/java/com/jiejing/fitness/finance/service/merchant/convert/MerchantConvert.java
View file @
c14785a2
...
...
@@ -2,6 +2,7 @@ package com.jiejing.fitness.finance.service.merchant.convert;
import
com.alibaba.fastjson.JSON
;
import
com.baomidou.mybatisplus.core.toolkit.IdWorker
;
import
com.jiejing.common.utils.collection.CollectionUtil
;
import
com.jiejing.common.utils.convert.BeanUtil
;
import
com.jiejing.common.utils.crypt.AesUtil
;
import
com.jiejing.filecenter.api.resource.vo.ResourceInfoVO
;
...
...
@@ -446,9 +447,12 @@ public class MerchantConvert {
.
build
();
}
public
static
StudioMerchantApplyVO
convertApply
(
StudioMerchantApply
apply
)
{
public
static
StudioMerchantApplyVO
convertApply
(
StudioMerchantApply
apply
,
Map
<
Long
,
String
>
urlMap
)
{
ApplyStudioMerchantParams
info
=
JSON
.
parseObject
(
apply
.
getMerchantInfo
(),
ApplyStudioMerchantParams
.
class
).
decrypt
(
apply
.
getSalt
());
if
(
CollectionUtil
.
isNotEmpty
(
info
.
getResourceMap
())
&&
CollectionUtil
.
isNotEmpty
(
urlMap
))
{
info
.
getResourceMap
().
values
().
forEach
(
e
->
e
.
setUrl
(
urlMap
.
get
(
e
.
getResourceId
())));
}
return
StudioMerchantApplyVO
.
builder
()
.
id
(
apply
.
getId
())
.
brandId
(
apply
.
getBrandId
())
...
...
@@ -489,7 +493,7 @@ public class MerchantConvert {
return
Optional
.
ofNullable
(
applies
)
.
orElse
(
new
ArrayList
<>())
.
stream
()
.
map
(
MerchantConvert:
:
convertApply
)
.
map
(
e
->
convertApply
(
e
,
null
)
)
.
collect
(
Collectors
.
toList
());
}
...
...
service/src/main/java/com/jiejing/fitness/finance/service/merchant/impl/StudioMerchantServiceImpl.java
View file @
c14785a2
package
com
.
jiejing
.
fitness
.
finance
.
service
.
merchant
.
impl
;
import
com.alibaba.fastjson.JSON
;
import
com.baomidou.mybatisplus.core.toolkit.IdWorker
;
import
com.jiejing.common.exception.BizException
;
import
com.jiejing.common.model.PageVO
;
...
...
@@ -7,6 +8,7 @@ import com.jiejing.common.utils.collection.CollectionUtil;
import
com.jiejing.common.utils.convert.BeanUtil
;
import
com.jiejing.filecenter.api.resource.vo.ResourceInfoVO
;
import
com.jiejing.fitness.enums.finance.PartyTypeEnum
;
import
com.jiejing.fitness.finance.api.merchant.request.model.BrandResourceInfo
;
import
com.jiejing.fitness.finance.api.merchant.vo.StudioMerchantApplyVO
;
import
com.jiejing.fitness.finance.api.merchant.vo.StudioMerchantAuthSubChannelVO
;
import
com.jiejing.fitness.finance.api.merchant.vo.StudioMerchantBindXcxAppIdVO
;
...
...
@@ -179,7 +181,9 @@ public class StudioMerchantServiceImpl implements StudioMerchantService {
}
MerchantVO
merchant
=
merchantRpcService
.
getByMerchantId
(
relation
.
getMerchantId
());
List
<
Long
>
resourceIds
=
this
.
getResourceIds
(
merchant
);
Map
<
Long
,
String
>
urlMap
=
resourceRpcService
.
getResourceUrlMap
(
studioId
,
resourceIds
);
StudioMerchantApply
apply
=
studioMerchantApplyRpService
.
getLatestOneSuccessByMerchantId
(
relation
.
getMerchantId
());
Map
<
Long
,
String
>
urlMap
=
resourceRpcService
.
getResourceUrlMap
(
apply
.
getBrandId
(),
resourceIds
);
return
MerchantConvert
.
convertStudioMerchant
(
relation
,
merchant
,
configService
.
getDefaultBrandSubChannelInfo
(),
urlMap
);
}
...
...
@@ -188,7 +192,20 @@ public class StudioMerchantServiceImpl implements StudioMerchantService {
public
StudioMerchantApplyVO
getApply
(
Long
id
)
{
StudioMerchantApply
apply
=
studioMerchantApplyRpService
.
getById
(
id
)
.
orElseThrow
(()
->
new
BizException
(
FinanceErrorEnums
.
NOT_EXIST
));
return
MerchantConvert
.
convertApply
(
apply
);
Map
<
Long
,
String
>
urlMap
=
this
.
getResouceseUrlMap
(
apply
);
return
MerchantConvert
.
convertApply
(
apply
,
urlMap
);
}
private
Map
<
Long
,
String
>
getResouceseUrlMap
(
StudioMerchantApply
apply
)
{
List
<
Long
>
resourceIds
=
this
.
getResourceIds
(
apply
);
return
resourceRpcService
.
getResourceUrlMap
(
apply
.
getBrandId
(),
resourceIds
);
}
private
List
<
Long
>
getResourceIds
(
StudioMerchantApply
apply
)
{
ApplyStudioMerchantParams
info
=
JSON
.
parseObject
(
apply
.
getMerchantInfo
(),
ApplyStudioMerchantParams
.
class
);
return
info
.
getResourceMap
().
values
().
stream
().
map
(
BrandResourceInfo:
:
getResourceId
)
.
collect
(
Collectors
.
toList
());
}
@Override
...
...
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