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
81347470
Commit
81347470
authored
Aug 14, 2024
by
程裕兵
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:添加半屏小程序
parent
4136ba07
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
37 additions
and
27 deletions
+37
-27
app/src/main/resources/application-canary.yml
+2
-1
app/src/main/resources/application-dev.yml
+2
-1
app/src/main/resources/application-local.yml
+1
-1
app/src/main/resources/application-prod.yml
+2
-1
app/src/main/resources/application-rc.yml
+2
-1
repository/src/main/java/com/jiejing/fitness/finance/repository/service/StudioEmbeddedXcxApplyRpService.java
+11
-11
service/src/main/java/com/jiejing/fitness/finance/service/merchant/convert/StudioEmbeddedXcxConvert.java
+3
-3
service/src/main/java/com/jiejing/fitness/finance/service/merchant/impl/StudioMerchantServiceImpl.java
+14
-8
No files found.
app/src/main/resources/application-canary.yml
View file @
81347470
...
...
@@ -27,5 +27,5 @@ finance:
wx
:
component
:
appId
:
wxe6c4979bafd48126
authorizer
:
embedded
:
appId
:
wx06a084dcba4f0a05
\ No newline at end of file
app/src/main/resources/application-dev.yml
View file @
81347470
...
...
@@ -27,5 +27,5 @@ finance:
wx
:
component
:
appId
:
wxda913f3b6f1439b4
authorizer
:
embedded
:
appId
:
wxf187be22c2234300
\ No newline at end of file
app/src/main/resources/application-local.yml
View file @
81347470
...
...
@@ -32,5 +32,5 @@ finance:
wx
:
component
:
appId
:
wxda913f3b6f1439b4
authorizer
:
embedded
:
appId
:
wxf187be22c2234300
app/src/main/resources/application-prod.yml
View file @
81347470
...
...
@@ -27,5 +27,5 @@ finance:
wx
:
component
:
appId
:
wxe6c4979bafd48126
authorizer
:
embedded
:
appId
:
wx06a084dcba4f0a05
\ No newline at end of file
app/src/main/resources/application-rc.yml
View file @
81347470
...
...
@@ -27,5 +27,5 @@ finance:
wx
:
component
:
appId
:
wxfe4c26daa7e85d14
authorizer
:
embedded
:
appId
:
wxf187be22c2234300
\ No newline at end of file
repository/src/main/java/com/jiejing/fitness/finance/repository/service/StudioEmbeddedXcxApplyRpService.java
View file @
81347470
...
...
@@ -37,39 +37,39 @@ public class StudioEmbeddedXcxApplyRpService extends
MapperRepoService
<
Long
,
StudioEmbeddedXcxApply
,
StudioEmbeddedXcxApplyMapper
>
{
public
Map
<
String
,
StudioEmbeddedXcxApply
>
mapByStudioIdAndAppId
(
Long
studioId
,
String
componentAppId
,
String
systemXcx
AppId
,
List
<
String
>
appIds
)
{
return
this
.
listByStudioIdAndAppId
(
studioId
,
componentAppId
,
systemXcx
AppId
,
appIds
)
String
componentAppId
,
String
embedded
AppId
,
List
<
String
>
appIds
)
{
return
this
.
listByStudioIdAndAppId
(
studioId
,
componentAppId
,
embedded
AppId
,
appIds
)
.
stream
().
collect
(
Collectors
.
toMap
(
StudioEmbeddedXcxApply:
:
getAppId
,
e
->
e
));
}
public
List
<
StudioEmbeddedXcxApply
>
listByStudioIdAndAppId
(
Long
studioId
,
String
componentAppId
,
String
systemXcx
AppId
,
List
<
String
>
appIds
)
{
String
embedded
AppId
,
List
<
String
>
appIds
)
{
QueryWrapper
<
StudioEmbeddedXcxApply
>
wrapper
=
new
QueryWrapper
<>();
wrapper
.
eq
(
StudioEmbeddedXcxApply
.
STUDIO_ID
,
studioId
);
wrapper
.
eq
(
StudioEmbeddedXcxApply
.
COMPONENT_APP_ID
,
componentAppId
);
wrapper
.
eq
(
StudioEmbeddedXcxApply
.
A
UTHORIZER_APP_ID
,
systemXcx
AppId
);
wrapper
.
in
(
StudioEmbeddedXcxApply
.
APP_ID
,
appIds
);
wrapper
.
eq
(
StudioEmbeddedXcxApply
.
A
PP_ID
,
embedded
AppId
);
wrapper
.
in
(
StudioEmbeddedXcxApply
.
A
UTHORIZER_A
PP_ID
,
appIds
);
return
Optional
.
ofNullable
(
this
.
baseMapper
.
selectList
(
wrapper
)).
orElse
(
new
ArrayList
<>(
1
));
}
public
StudioEmbeddedXcxApply
getByStudioIdAndAppId
(
Long
studioId
,
String
componentAppId
,
String
systemXcx
AppId
,
String
appId
)
{
String
embedded
AppId
,
String
appId
)
{
QueryWrapper
<
StudioEmbeddedXcxApply
>
wrapper
=
new
QueryWrapper
<>();
wrapper
.
eq
(
StudioEmbeddedXcxApply
.
STUDIO_ID
,
studioId
);
wrapper
.
eq
(
StudioEmbeddedXcxApply
.
COMPONENT_APP_ID
,
componentAppId
);
wrapper
.
eq
(
StudioEmbeddedXcxApply
.
APP_ID
,
a
ppId
);
wrapper
.
eq
(
StudioEmbeddedXcxApply
.
AUTHORIZER_APP_ID
,
systemXcxA
ppId
);
wrapper
.
eq
(
StudioEmbeddedXcxApply
.
APP_ID
,
embeddedA
ppId
);
wrapper
.
eq
(
StudioEmbeddedXcxApply
.
AUTHORIZER_APP_ID
,
a
ppId
);
return
Optional
.
ofNullable
(
this
.
baseMapper
.
selectList
(
wrapper
))
.
orElse
(
new
ArrayList
<>(
1
))
.
stream
().
findFirst
().
orElse
(
null
);
}
public
List
<
StudioEmbeddedXcxApply
>
listByAppIds
(
String
componentAppId
,
String
systemXcx
AppId
,
public
List
<
StudioEmbeddedXcxApply
>
listByAppIds
(
String
componentAppId
,
String
embedded
AppId
,
List
<
String
>
appIds
)
{
QueryWrapper
<
StudioEmbeddedXcxApply
>
wrapper
=
new
QueryWrapper
<>();
wrapper
.
eq
(
StudioEmbeddedXcxApply
.
COMPONENT_APP_ID
,
componentAppId
);
wrapper
.
eq
(
StudioEmbeddedXcxApply
.
A
UTHORIZER_APP_ID
,
systemXcx
AppId
);
wrapper
.
in
(
StudioEmbeddedXcxApply
.
APP_ID
,
appIds
);
wrapper
.
eq
(
StudioEmbeddedXcxApply
.
A
PP_ID
,
embedded
AppId
);
wrapper
.
in
(
StudioEmbeddedXcxApply
.
A
UTHORIZER_A
PP_ID
,
appIds
);
return
Optional
.
ofNullable
(
this
.
baseMapper
.
selectList
(
wrapper
)).
orElse
(
new
ArrayList
<>(
1
));
}
}
service/src/main/java/com/jiejing/fitness/finance/service/merchant/convert/StudioEmbeddedXcxConvert.java
View file @
81347470
...
...
@@ -16,13 +16,13 @@ import java.util.stream.Collectors;
*/
public
class
StudioEmbeddedXcxConvert
{
public
static
StudioEmbeddedXcxApply
toEntity
(
Long
studioId
,
String
componentAppId
,
String
systemXcx
AppId
,
public
static
StudioEmbeddedXcxApply
toEntity
(
Long
studioId
,
String
componentAppId
,
String
embedded
AppId
,
String
appId
)
{
StudioEmbeddedXcxApply
record
=
new
StudioEmbeddedXcxApply
();
record
.
setId
(
IdWorker
.
getId
());
record
.
setComponentAppId
(
componentAppId
);
record
.
setAuthorizerAppId
(
systemXcxA
ppId
);
record
.
setAppId
(
a
ppId
);
record
.
setAuthorizerAppId
(
a
ppId
);
record
.
setAppId
(
embeddedA
ppId
);
record
.
setStudioId
(
studioId
);
record
.
setState
(
EmbededXcxEnum
.
INIT
.
getCode
());
record
.
setCreateTime
(
new
Date
());
...
...
service/src/main/java/com/jiejing/fitness/finance/service/merchant/impl/StudioMerchantServiceImpl.java
View file @
81347470
...
...
@@ -128,11 +128,17 @@ public class StudioMerchantServiceImpl implements StudioMerchantService {
@Resource
(
name
=
"financeThreadPool"
)
private
Executor
executor
;
/**
* 第三方平台appId
*/
@Value
(
"${wx.component.appId}"
)
private
String
wxComponentAppId
;
@Value
(
"${wx.authorizer.appId}"
)
private
String
authorizerAppId
;
/**
* 半屏小程序
*/
@Value
(
"${wx.embedded.appId}"
)
private
String
embeddedAppId
;
private
static
final
Integer
WX_SUCCESS_CODE
=
0
;
...
...
@@ -262,7 +268,7 @@ public class StudioMerchantServiceImpl implements StudioMerchantService {
@Override
public
StudioEmbeddedXcxVO
getEmbeddedXcx
(
Long
studioId
,
String
appId
)
{
StudioEmbeddedXcxApply
embeddedXcx
=
studioEmbeddedXcxApplyRpService
.
getByStudioIdAndAppId
(
studioId
,
wxComponentAppId
,
authorizer
AppId
,
appId
);
studioId
,
wxComponentAppId
,
embedded
AppId
,
appId
);
if
(
null
==
embeddedXcx
)
{
return
null
;
}
...
...
@@ -277,7 +283,7 @@ public class StudioMerchantServiceImpl implements StudioMerchantService {
}
Map
<
String
,
StudioEmbeddedXcxApply
>
existMap
=
studioEmbeddedXcxApplyRpService
.
mapByStudioIdAndAppId
(
studioId
,
wxComponentAppId
,
authorizer
AppId
,
appIds
);
studioId
,
wxComponentAppId
,
embedded
AppId
,
appIds
);
appIds
.
stream
()
.
filter
(
appId
->
null
==
existMap
.
get
(
appId
)
||
EmbededXcxEnum
.
isFail
(
existMap
.
get
(
appId
).
getState
()))
.
forEach
(
appId
->
{
...
...
@@ -285,13 +291,13 @@ public class StudioMerchantServiceImpl implements StudioMerchantService {
StudioEmbeddedXcxApply
entity
=
existMap
.
get
(
appId
);
if
(
null
==
entity
)
{
entity
=
StudioEmbeddedXcxConvert
.
toEntity
(
studioId
,
wxComponentAppId
,
authorizer
AppId
,
appId
);
entity
=
StudioEmbeddedXcxConvert
.
toEntity
(
studioId
,
wxComponentAppId
,
embedded
AppId
,
appId
);
studioEmbeddedXcxApplyRpService
.
insert
(
entity
);
}
else
{
studioEmbeddedXcxApplyRpService
.
updateById
(
StudioEmbeddedXcxConvert
.
toInit
(
entity
));
}
try
{
JSONObject
result
=
weXcxService
.
addEmbeddedXcx
(
wxComponentAppId
,
a
uthorizerAppId
,
a
ppId
,
JSONObject
result
=
weXcxService
.
addEmbeddedXcx
(
wxComponentAppId
,
a
ppId
,
embeddedA
ppId
,
"申请半屏小程序"
);
Integer
code
=
result
.
getInteger
(
"errcode"
);
String
message
=
result
.
getString
(
"errmsg"
);
...
...
@@ -317,7 +323,7 @@ public class StudioMerchantServiceImpl implements StudioMerchantService {
}
List
<
StudioEmbeddedXcxApply
>
applies
=
studioEmbeddedXcxApplyRpService
.
listByAppIds
(
wxComponentAppId
,
authorizer
AppId
,
list
.
stream
().
map
(
AuthXcxInfo:
:
getAppId
).
collect
(
Collectors
.
toList
()));
embedded
AppId
,
list
.
stream
().
map
(
AuthXcxInfo:
:
getAppId
).
collect
(
Collectors
.
toList
()));
if
(
CollectionUtil
.
isEmpty
(
applies
))
{
return
;
}
...
...
@@ -363,7 +369,7 @@ public class StudioMerchantServiceImpl implements StudioMerchantService {
int
num
=
100
;
for
(
int
start
=
0
;
start
<
10
;
start
++)
{
HalfScreenXcxAuthVO
vo
=
weXcxService
.
listEmbeddedXcx
(
wxComponentAppId
,
authorizer
AppId
,
start
,
num
);
HalfScreenXcxAuthVO
vo
=
weXcxService
.
listEmbeddedXcx
(
wxComponentAppId
,
embedded
AppId
,
start
,
num
);
if
(
CollectionUtil
.
isEmpty
(
vo
.
getWxaEmbeddedList
()))
{
break
;
}
...
...
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