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
fab00c3f
Commit
fab00c3f
authored
Aug 13, 2024
by
程裕兵
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:添加半屏小程序
parent
48f3a19a
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
45 additions
and
42 deletions
+45
-42
repository/src/main/java/com/jiejing/fitness/finance/repository/entity/StudioEmbeddedXcxApply.java
+13
-13
repository/src/main/java/com/jiejing/fitness/finance/repository/mapper/StudioEmbeddedXcxApplyMapper.xml
+1
-1
repository/src/main/java/com/jiejing/fitness/finance/repository/service/StudioEmbeddedXcxApplyRpService.java
+19
-18
service/src/main/java/com/jiejing/fitness/finance/service/merchant/impl/StudioMerchantServiceImpl.java
+12
-10
No files found.
repository/src/main/java/com/jiejing/fitness/finance/repository/entity/StudioEmbeddedXcxApply.java
View file @
fab00c3f
...
...
@@ -38,7 +38,7 @@ import lombok.NoArgsConstructor;
@AllArgsConstructor
public
class
StudioEmbeddedXcxApply
implements
Serializable
{
private
static
final
long
serialVersionUID
=
4288943338021568638
L
;
private
static
final
long
serialVersionUID
=
-
4415580599984265484
L
;
/**
* 备注: 主键 是否允许为null: NO
...
...
@@ -47,32 +47,32 @@ public class StudioEmbeddedXcxApply implements Serializable {
private
Long
id
;
/**
* 备注: 品牌ID 是否允许为null: YES
*/
private
Long
brandId
;
/**
* 备注: 场馆ID 是否允许为null: YES
*/
private
Long
studioId
;
/**
* 备注:
小程序
appId 是否允许为null: YES
* 备注:
第三方平台
appId 是否允许为null: YES
*/
private
String
a
ppId
;
private
String
componentA
ppId
;
/**
* 备注: 授权方appId 是否允许为null: YES
* 备注: 授权方appId
(专属小程序)
是否允许为null: YES
*/
private
String
authorizerAppId
;
/**
* 备注: 支付小程序appId 是否允许为null: YES
*/
private
String
appId
;
/**
* 备注: 状态 是否允许为null: YES
*/
private
String
state
;
/**
*
失败原因
*
备注: 失败原因 是否允许为null: YES
*/
private
String
message
;
...
...
@@ -89,14 +89,14 @@ public class StudioEmbeddedXcxApply implements Serializable {
public
static
final
String
ID
=
"id"
;
public
static
final
String
BRAND_ID
=
"brand_id"
;
public
static
final
String
STUDIO_ID
=
"studio_id"
;
public
static
final
String
APP_ID
=
"
app_id"
;
public
static
final
String
COMPONENT_APP_ID
=
"component_
app_id"
;
public
static
final
String
AUTHORIZER_APP_ID
=
"authorizer_app_id"
;
public
static
final
String
APP_ID
=
"app_id"
;
public
static
final
String
STATE
=
"state"
;
public
static
final
String
MESSAGE
=
"message"
;
...
...
repository/src/main/java/com/jiejing/fitness/finance/repository/mapper/StudioEmbeddedXcxApplyMapper.xml
View file @
fab00c3f
...
...
@@ -17,7 +17,7 @@
<!-- 通用查询结果列 -->
<sql
id=
"Base_Column_List"
>
id,
brand_id, studio_id, app_id, authorizer_
app_id, state, message, create_time, update_time
id,
studio_id, component_app_id, authorizer_app_id,
app_id, state, message, create_time, update_time
</sql>
</mapper>
repository/src/main/java/com/jiejing/fitness/finance/repository/service/StudioEmbeddedXcxApplyRpService.java
View file @
fab00c3f
...
...
@@ -15,13 +15,10 @@
package
com
.
jiejing
.
fitness
.
finance
.
repository
.
service
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.google.common.collect.Lists
;
import
com.jiejing.fitness.enums.finance.EmbededXcxEnum
;
import
com.jiejing.fitness.finance.repository.entity.StudioEmbeddedXcxApply
;
import
com.jiejing.fitness.finance.repository.mapper.StudioEmbeddedXcxApplyMapper
;
import
com.jiejing.mbp.MapperRepoService
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Optional
;
...
...
@@ -39,36 +36,40 @@ import org.springframework.stereotype.Service;
public
class
StudioEmbeddedXcxApplyRpService
extends
MapperRepoService
<
Long
,
StudioEmbeddedXcxApply
,
StudioEmbeddedXcxApplyMapper
>
{
public
Map
<
String
,
StudioEmbeddedXcxApply
>
mapByStudioIdAndAppId
(
Long
studioId
,
List
<
String
>
appIds
)
{
return
this
.
listByStudioIdAndAppId
(
studioId
,
appIds
).
stream
()
.
collect
(
Collectors
.
toMap
(
StudioEmbeddedXcxApply:
:
getAppId
,
e
->
e
));
public
Map
<
String
,
StudioEmbeddedXcxApply
>
mapByStudioIdAndAuthorizerAppId
(
Long
studioId
,
String
componentAppId
,
String
systemXcxAppId
,
List
<
String
>
authorizerAppIds
)
{
return
this
.
listByStudioIdAndAuthorizerAppId
(
studioId
,
componentAppId
,
systemXcxAppId
,
authorizerAppIds
)
.
stream
().
collect
(
Collectors
.
toMap
(
StudioEmbeddedXcxApply:
:
getAppId
,
e
->
e
));
}
public
List
<
StudioEmbeddedXcxApply
>
listByStudioIdAndAppId
(
Long
studioId
,
List
<
String
>
appIds
)
{
public
List
<
StudioEmbeddedXcxApply
>
listByStudioIdAndAuthorizerAppId
(
Long
studioId
,
String
componentAppId
,
String
systemXcxAppId
,
List
<
String
>
authorizerAppIds
)
{
QueryWrapper
<
StudioEmbeddedXcxApply
>
wrapper
=
new
QueryWrapper
<>();
wrapper
.
eq
(
StudioEmbeddedXcxApply
.
STUDIO_ID
,
studioId
);
wrapper
.
in
(
StudioEmbeddedXcxApply
.
APP_ID
,
appIds
);
wrapper
.
in
(
StudioEmbeddedXcxApply
.
COMPONENT_APP_ID
,
componentAppId
);
wrapper
.
in
(
StudioEmbeddedXcxApply
.
APP_ID
,
systemXcxAppId
);
wrapper
.
in
(
StudioEmbeddedXcxApply
.
AUTHORIZER_APP_ID
,
authorizerAppIds
);
return
Optional
.
ofNullable
(
this
.
baseMapper
.
selectList
(
wrapper
)).
orElse
(
new
ArrayList
<>(
1
));
}
public
StudioEmbeddedXcxApply
getByStudioIdAndAppId
(
Long
studioId
,
String
appId
)
{
public
StudioEmbeddedXcxApply
getByStudioIdAndAuthorizerAppId
(
Long
studioId
,
String
componentAppId
,
String
systemXcxAppId
,
String
authorizerAppId
)
{
QueryWrapper
<
StudioEmbeddedXcxApply
>
wrapper
=
new
QueryWrapper
<>();
wrapper
.
eq
(
StudioEmbeddedXcxApply
.
STUDIO_ID
,
studioId
);
wrapper
.
eq
(
StudioEmbeddedXcxApply
.
APP_ID
,
appId
);
wrapper
.
in
(
StudioEmbeddedXcxApply
.
COMPONENT_APP_ID
,
componentAppId
);
wrapper
.
in
(
StudioEmbeddedXcxApply
.
APP_ID
,
systemXcxAppId
);
wrapper
.
eq
(
StudioEmbeddedXcxApply
.
AUTHORIZER_APP_ID
,
authorizerAppId
);
return
Optional
.
ofNullable
(
this
.
baseMapper
.
selectList
(
wrapper
))
.
orElse
(
new
ArrayList
<>(
1
))
.
stream
().
findFirst
().
orElse
(
null
);
}
public
List
<
StudioEmbeddedXcxApply
>
listByStudioId
(
Long
studioId
)
{
public
List
<
StudioEmbeddedXcxApply
>
listByAuthorizerAppIds
(
String
componentAppId
,
String
systemXcxAppId
,
List
<
String
>
authorizerAppIds
)
{
QueryWrapper
<
StudioEmbeddedXcxApply
>
wrapper
=
new
QueryWrapper
<>();
wrapper
.
eq
(
StudioEmbeddedXcxApply
.
STUDIO_ID
,
studioId
);
return
Optional
.
ofNullable
(
this
.
baseMapper
.
selectList
(
wrapper
)).
orElse
(
new
ArrayList
<>(
1
));
}
public
List
<
StudioEmbeddedXcxApply
>
listByAppIds
(
List
<
String
>
appIds
)
{
QueryWrapper
<
StudioEmbeddedXcxApply
>
wrapper
=
new
QueryWrapper
<>();
wrapper
.
in
(
StudioEmbeddedXcxApply
.
APP_ID
,
appIds
);
wrapper
.
in
(
StudioEmbeddedXcxApply
.
COMPONENT_APP_ID
,
componentAppId
);
wrapper
.
in
(
StudioEmbeddedXcxApply
.
APP_ID
,
systemXcxAppId
);
wrapper
.
in
(
StudioEmbeddedXcxApply
.
AUTHORIZER_APP_ID
,
authorizerAppIds
);
return
Optional
.
ofNullable
(
this
.
baseMapper
.
selectList
(
wrapper
)).
orElse
(
new
ArrayList
<>(
1
));
}
}
service/src/main/java/com/jiejing/fitness/finance/service/merchant/impl/StudioMerchantServiceImpl.java
View file @
fab00c3f
...
...
@@ -238,9 +238,10 @@ public class StudioMerchantServiceImpl implements StudioMerchantService {
}
@Override
public
StudioEmbeddedXcxVO
getEmbeddedXcx
(
Long
studioId
,
String
appId
)
{
StudioEmbeddedXcxApply
embeddedXcx
=
studioEmbeddedXcxApplyRpService
.
getByStudioIdAndAppId
(
studioId
,
appId
);
public
StudioEmbeddedXcxVO
getEmbeddedXcx
(
Long
studioId
,
String
authorizerAppId
)
{
String
systemAppId
=
this
.
listSystemXcxAppIds
().
stream
().
findFirst
().
orElse
(
null
);
StudioEmbeddedXcxApply
embeddedXcx
=
studioEmbeddedXcxApplyRpService
.
getByStudioIdAndAuthorizerAppId
(
studioId
,
wxComponentAppId
,
systemAppId
,
authorizerAppId
);
if
(
null
==
embeddedXcx
)
{
return
null
;
}
...
...
@@ -249,8 +250,8 @@ public class StudioMerchantServiceImpl implements StudioMerchantService {
@Async
(
"financeThreadPool"
)
@Override
public
void
bindEmbeddedXcx
(
Long
studioId
,
List
<
String
>
appIds
)
{
if
(
CollectionUtil
.
isEmpty
(
appIds
))
{
public
void
bindEmbeddedXcx
(
Long
studioId
,
List
<
String
>
a
uthorizerA
ppIds
)
{
if
(
CollectionUtil
.
isEmpty
(
a
uthorizerA
ppIds
))
{
return
;
}
String
systemXcxAppId
=
this
.
listSystemXcxAppIds
().
stream
().
findFirst
().
orElse
(
null
);
...
...
@@ -258,9 +259,9 @@ public class StudioMerchantServiceImpl implements StudioMerchantService {
return
;
}
Map
<
String
,
StudioEmbeddedXcxApply
>
existMap
=
studioEmbeddedXcxApplyRpService
.
mapByStudioIdAndAppId
(
studioId
,
a
ppIds
);
appIds
.
stream
()
Map
<
String
,
StudioEmbeddedXcxApply
>
existMap
=
studioEmbeddedXcxApplyRpService
.
mapByStudioIdAndA
uthorizerA
ppId
(
studioId
,
wxComponentAppId
,
systemXcxAppId
,
authorizerA
ppIds
);
a
uthorizerA
ppIds
.
stream
()
.
filter
(
appId
->
null
==
existMap
.
get
(
appId
))
.
forEach
(
appId
->
{
log
.
info
(
"bind embedded xcx {}, {}"
,
studioId
,
appId
);
...
...
@@ -294,8 +295,9 @@ public class StudioMerchantServiceImpl implements StudioMerchantService {
return
;
}
List
<
StudioEmbeddedXcxApply
>
applies
=
studioEmbeddedXcxApplyRpService
.
listByAppIds
(
list
.
stream
().
map
(
AuthXcxInfo:
:
getAppId
).
collect
(
Collectors
.
toList
()));
String
systemAppId
=
this
.
listSystemXcxAppIds
().
stream
().
findFirst
().
orElse
(
null
);
List
<
StudioEmbeddedXcxApply
>
applies
=
studioEmbeddedXcxApplyRpService
.
listByAuthorizerAppIds
(
wxComponentAppId
,
systemAppId
,
list
.
stream
().
map
(
AuthXcxInfo:
:
getAppId
).
collect
(
Collectors
.
toList
()));
if
(
CollectionUtil
.
isEmpty
(
applies
))
{
return
;
}
...
...
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