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
9145f7c5
Commit
9145f7c5
authored
Mar 07, 2024
by
程裕兵
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:api
parent
204601c8
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
99 additions
and
8 deletions
+99
-8
api/src/main/java/com/jiejing/fitness/finance/api/merchant/vo/BrandResourceVO.java
+31
-0
service/src/main/java/com/jiejing/fitness/finance/service/merchant/convert/MerchantConvert.java
+41
-7
service/src/main/java/com/jiejing/fitness/finance/service/merchant/impl/BrandMerchantServiceImpl.java
+4
-0
service/src/main/java/com/jiejing/fitness/finance/service/merchant/impl/StudioMerchantServiceImpl.java
+11
-1
service/src/main/java/com/jiejing/fitness/finance/service/rpc/ResourceRpcService.java
+12
-0
No files found.
api/src/main/java/com/jiejing/fitness/finance/api/merchant/vo/BrandResourceVO.java
View file @
9145f7c5
...
...
@@ -49,4 +49,35 @@ public class BrandResourceVO {
@ApiModelProperty
(
value
=
"结算卡持卡人证件国徽面(反面)"
)
private
Long
bankCardCertBackPicId
;
@ApiModelProperty
(
value
=
"营业执照图片URL"
)
private
String
licensePicUrl
;
@ApiModelProperty
(
value
=
"线下经营门头照URL"
)
private
String
storeHeaderPicUrl
;
@ApiModelProperty
(
value
=
"线下经营内景照URL"
)
private
String
storeInnerPicUrl
;
@ApiModelProperty
(
value
=
"线下经营收银台URL"
)
private
String
storeCashierDescPicUrl
;
@ApiModelProperty
(
value
=
"法人证件人像面(正面)URL"
)
private
String
legalCertFrontPicUrl
;
@ApiModelProperty
(
value
=
"法人证件国徽面(反面)URL"
)
private
String
legalCertBackPicUrl
;
@ApiModelProperty
(
value
=
"银行卡正面URL"
)
private
String
bankCardFrontPicUrl
;
@ApiModelProperty
(
value
=
"银行卡反面URL"
)
private
String
bankCardBackPicUrl
;
@ApiModelProperty
(
value
=
"结算卡持卡人证件人像面(正面)URL"
)
private
String
bankCardCertFrontPicUrl
;
@ApiModelProperty
(
value
=
"结算卡持卡人证件国徽面(反面)URL"
)
private
String
bankCardCertBackPicUrl
;
}
service/src/main/java/com/jiejing/fitness/finance/service/merchant/convert/MerchantConvert.java
View file @
9145f7c5
...
...
@@ -4,6 +4,7 @@ import static com.jiejing.paycenter.common.enums.merchant.ResourceTypeEnums.*;
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
;
...
...
@@ -258,8 +259,42 @@ public class MerchantConvert {
}
private
static
BrandResourceVO
convertResource
(
Map
<
String
,
com
.
jiejing
.
paycenter
.
api
.
merchant
.
vo
.
ResourceInfoVO
>
resourceMap
)
{
Map
<
String
,
com
.
jiejing
.
paycenter
.
api
.
merchant
.
vo
.
ResourceInfoVO
>
resourceMap
,
Map
<
Long
,
String
>
urlMap
)
{
BrandResourceVO
resourceInfo
=
new
BrandResourceVO
();
setPicId
(
resourceInfo
,
resourceMap
);
setPicUrl
(
resourceInfo
,
urlMap
);
return
resourceInfo
;
}
private
static
void
setPicUrl
(
BrandResourceVO
resourceInfo
,
Map
<
Long
,
String
>
urlMap
)
{
if
(
CollectionUtil
.
isEmpty
(
urlMap
))
{
return
;
}
resourceInfo
.
setLicensePicUrl
(
resourceInfo
.
getLicensePicId
()
==
null
?
null
:
urlMap
.
get
(
resourceInfo
.
getLicensePicId
()));
resourceInfo
.
setStoreHeaderPicUrl
(
resourceInfo
.
getStoreHeaderPicId
()
==
null
?
null
:
urlMap
.
get
(
resourceInfo
.
getStoreHeaderPicId
()));
resourceInfo
.
setStoreInnerPicUrl
(
resourceInfo
.
getStoreInnerPicId
()
==
null
?
null
:
urlMap
.
get
(
resourceInfo
.
getStoreInnerPicId
()));
resourceInfo
.
setStoreCashierDescPicUrl
(
resourceInfo
.
getStoreCashierDescPicId
()
==
null
?
null
:
urlMap
.
get
(
resourceInfo
.
getStoreCashierDescPicId
()));
resourceInfo
.
setLegalCertFrontPicUrl
(
resourceInfo
.
getLegalCertFrontPicId
()
==
null
?
null
:
urlMap
.
get
(
resourceInfo
.
getLegalCertFrontPicId
()));
resourceInfo
.
setLegalCertBackPicUrl
(
resourceInfo
.
getLegalCertBackPicId
()
==
null
?
null
:
urlMap
.
get
(
resourceInfo
.
getLegalCertBackPicId
()));
resourceInfo
.
setBankCardFrontPicUrl
(
resourceInfo
.
getBankCardFrontPicId
()
==
null
?
null
:
urlMap
.
get
(
resourceInfo
.
getBankCardFrontPicId
()));
resourceInfo
.
setBankCardBackPicUrl
(
resourceInfo
.
getBankCardBackPicId
()
==
null
?
null
:
urlMap
.
get
(
resourceInfo
.
getBankCardBackPicId
()));
resourceInfo
.
setBankCardCertFrontPicUrl
(
resourceInfo
.
getBankCardCertFrontPicId
()
==
null
?
null
:
urlMap
.
get
(
resourceInfo
.
getBankCardCertFrontPicId
()));
resourceInfo
.
setBankCardCertBackPicUrl
(
resourceInfo
.
getBankCardCertBackPicId
()
==
null
?
null
:
urlMap
.
get
(
resourceInfo
.
getBankCardCertBackPicId
()));
}
private
static
void
setPicId
(
BrandResourceVO
resourceInfo
,
Map
<
String
,
com
.
jiejing
.
paycenter
.
api
.
merchant
.
vo
.
ResourceInfoVO
>
resourceMap
)
{
resourceInfo
.
setLicensePicId
(
Optional
.
ofNullable
(
resourceMap
.
get
(
LICENSE
.
name
())).
map
(
e
->
e
.
getResourceId
()).
orElse
(
null
));
resourceInfo
.
setStoreHeaderPicId
(
...
...
@@ -288,7 +323,6 @@ public class MerchantConvert {
resourceInfo
.
setBankCardCertBackPicId
(
Optional
.
ofNullable
(
resourceMap
.
get
(
BANK_CARD_CERT_BACK
.
name
())).
map
(
e
->
e
.
getResourceId
())
.
orElse
(
null
));
return
resourceInfo
;
}
private
static
OpenStateEnums
convertWxOfflineAuthState
(
List
<
SubChannelAuthInfo
>
auths
)
{
...
...
@@ -421,8 +455,8 @@ public class MerchantConvert {
}
public
static
StudioMerchantVO
convertStudioMerchant
(
PartyToMerchant
relation
,
MerchantVO
merchant
,
SubChannelInfoDTO
dto
)
{
return
convertBrandMerchant
(
null
,
relation
.
getPartyId
(),
merchant
,
dto
);
SubChannelInfoDTO
dto
,
Map
<
Long
,
String
>
urlMap
)
{
return
convertBrandMerchant
(
null
,
relation
.
getPartyId
(),
merchant
,
dto
,
urlMap
);
}
public
static
StudioMerchantApplyVO
convertApply
(
StudioMerchantApply
apply
)
{
...
...
@@ -468,7 +502,7 @@ public class MerchantConvert {
}
private
static
StudioMerchantVO
convertBrandMerchant
(
Long
brandId
,
Long
studioId
,
MerchantVO
merchant
,
SubChannelInfoDTO
dto
)
{
SubChannelInfoDTO
dto
,
Map
<
Long
,
String
>
urlMap
)
{
Map
<
SubChannelOpenTypeEnums
,
SubChannelInfo
>
channelMap
=
convertSubChannelMap
(
JsonUtil
.
convertList
(
merchant
.
getSubChannels
(),
SubChannelInfo
.
class
),
dto
.
getSubChannels
());
SubChannelInfo
ali
=
channelMap
.
get
(
SubChannelOpenTypeEnums
.
ALI_OFFLINE
);
...
...
@@ -499,14 +533,14 @@ public class MerchantConvert {
.
license
(
JsonUtil
.
convertObject
(
merchant
.
getLicense
(),
BrandLicenseVO
.
class
))
.
legal
(
convertLegal
(
merchant
.
getLegal
(),
merchant
.
getContact
()))
.
bankCard
(
JsonUtil
.
convertObject
(
merchant
.
getBankCard
(),
BrandBankCardVO
.
class
))
.
resource
(
convertResource
(
merchant
.
getResourceMap
()))
.
resource
(
convertResource
(
merchant
.
getResourceMap
()
,
urlMap
))
.
subChannelConfigs
(
merchant
.
getSubChannelConfigs
())
.
build
();
}
public
static
List
<
StudioMerchantVO
>
convertBrandMerchantList
(
Long
brandId
,
List
<
MerchantVO
>
merchants
,
SubChannelInfoDTO
dto
)
{
return
merchants
.
stream
().
map
(
e
->
convertBrandMerchant
(
brandId
,
null
,
e
,
dto
))
return
merchants
.
stream
().
map
(
e
->
convertBrandMerchant
(
brandId
,
null
,
e
,
dto
,
null
))
.
collect
(
Collectors
.
toList
());
}
}
service/src/main/java/com/jiejing/fitness/finance/service/merchant/impl/BrandMerchantServiceImpl.java
View file @
9145f7c5
...
...
@@ -10,6 +10,7 @@ import com.jiejing.fitness.finance.service.global.ConfigService;
import
com.jiejing.fitness.finance.service.merchant.BrandMerchantService
;
import
com.jiejing.fitness.finance.service.merchant.convert.MerchantConvert
;
import
com.jiejing.fitness.finance.service.rpc.MerchantRpcService
;
import
com.jiejing.fitness.finance.service.rpc.ResourceRpcService
;
import
com.jiejing.paycenter.api.merchant.vo.MerchantVO
;
import
java.util.List
;
import
java.util.stream.Collectors
;
...
...
@@ -43,6 +44,9 @@ public class BrandMerchantServiceImpl implements BrandMerchantService {
@Resource
private
ConfigService
configService
;
@Resource
private
ResourceRpcService
resourceRpcService
;
@Override
public
void
bind
(
Long
brandId
,
Long
merchantId
)
{
PartyToMerchant
exist
=
partyToMerchantRpService
.
getOneByPartyAndMerchantId
(
channel
,
brandId
,
...
...
service/src/main/java/com/jiejing/fitness/finance/service/merchant/impl/StudioMerchantServiceImpl.java
View file @
9145f7c5
...
...
@@ -168,8 +168,10 @@ public class StudioMerchantServiceImpl implements StudioMerchantService {
return
null
;
}
MerchantVO
merchant
=
merchantRpcService
.
getByMerchantId
(
relation
.
getMerchantId
());
List
<
Long
>
resourceIds
=
this
.
getResourceIds
(
merchant
);
Map
<
Long
,
String
>
urlMap
=
resourceRpcService
.
getResourceUrlMap
(
studioId
,
resourceIds
);
return
MerchantConvert
.
convertStudioMerchant
(
relation
,
merchant
,
configService
.
getDefaultBrandSubChannelInfo
());
configService
.
getDefaultBrandSubChannelInfo
()
,
urlMap
);
}
@Override
...
...
@@ -301,6 +303,14 @@ public class StudioMerchantServiceImpl implements StudioMerchantService {
.
collect
(
Collectors
.
toList
());
}
private
List
<
Long
>
getResourceIds
(
MerchantVO
merchant
)
{
return
merchant
.
getResourceMap
().
values
().
stream
()
.
map
(
e
->
e
.
getResourceId
())
.
filter
(
Objects:
:
nonNull
)
.
distinct
()
.
collect
(
Collectors
.
toList
());
}
private
void
doOpenMerchantFail
(
Long
id
,
String
failMessage
)
{
studioMerchantApplyRpService
.
updateById
(
StudioMerchantApply
.
builder
().
id
(
id
).
openState
(
OpenStateEnums
.
FAIL
)
...
...
service/src/main/java/com/jiejing/fitness/finance/service/rpc/ResourceRpcService.java
View file @
9145f7c5
...
...
@@ -36,4 +36,16 @@ public class ResourceRpcService {
.
orElse
(
new
HashMap
<>(
1
));
}
public
Map
<
Long
,
String
>
getResourceUrlMap
(
Long
partyId
,
List
<
Long
>
resourceIds
)
{
BatchQueryMultiResourceRequest
request
=
new
BatchQueryMultiResourceRequest
();
request
.
setAccessTypeEnum
(
AccessTypeEnum
.
PUBLIC
);
request
.
setResourceIds
(
resourceIds
);
request
.
setTenantId
(
partyId
);
request
.
setExpire
(
TimeUnit
.
SECONDS
.
toMillis
(
60
));
JsonResult
<
List
<
ResourceInfoVO
>>
result
=
resourceApi
.
getInfoByIds
(
request
);
return
Optional
.
ofNullable
(
result
.
getResult
())
.
map
(
list
->
list
.
stream
().
collect
(
Collectors
.
toMap
(
ResourceInfoVO:
:
getResourceId
,
e
->
e
.
getUrl
())))
.
orElse
(
new
HashMap
<>(
1
));
}
}
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