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
56752545
Commit
56752545
authored
Apr 26, 2024
by
程裕兵
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:send message of merchant
parent
e0ad7429
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
63 additions
and
0 deletions
+63
-0
api/src/main/java/com/jiejing/fitness/finance/api/merchant/request/ApplyStudioMerchantRequest.java
+3
-0
api/src/main/java/com/jiejing/fitness/finance/api/merchant/vo/StudioMerchantApplyVO.java
+3
-0
service/src/main/java/com/jiejing/fitness/finance/service/merchant/convert/MerchantConvert.java
+2
-0
service/src/main/java/com/jiejing/fitness/finance/service/merchant/impl/StudioMerchantServiceImpl.java
+52
-0
service/src/main/java/com/jiejing/fitness/finance/service/merchant/params/ApplyStudioMerchantParams.java
+3
-0
No files found.
api/src/main/java/com/jiejing/fitness/finance/api/merchant/request/ApplyStudioMerchantRequest.java
View file @
56752545
...
...
@@ -76,4 +76,7 @@ public class ApplyStudioMerchantRequest {
@NotBlank
(
message
=
"验证码不能为空"
)
private
String
smsCode
;
@ApiModelProperty
(
value
=
"操作人ID"
)
private
Long
operatorId
;
}
api/src/main/java/com/jiejing/fitness/finance/api/merchant/vo/StudioMerchantApplyVO.java
View file @
56752545
...
...
@@ -128,6 +128,9 @@ public class StudioMerchantApplyVO {
@ApiModelProperty
(
value
=
"进件所需资料"
)
private
Map
<
String
,
BrandResourceInfo
>
resourceMap
;
@ApiModelProperty
(
value
=
"操作人ID"
)
private
Long
operatorId
;
@ApiModelProperty
(
"完成时间"
)
private
Date
finishTime
;
...
...
service/src/main/java/com/jiejing/fitness/finance/service/merchant/convert/MerchantConvert.java
View file @
56752545
...
...
@@ -186,6 +186,7 @@ public class MerchantConvert {
.
license
(
encrypt
.
getLicense
())
.
bankCard
(
encrypt
.
getBankCard
())
.
resourceMap
(
encrypt
.
getResourceMap
())
.
operatorId
(
encrypt
.
getOperatorId
())
.
build
());
}
...
...
@@ -478,6 +479,7 @@ public class MerchantConvert {
.
legal
(
info
.
getLegal
())
.
bankCard
(
info
.
getBankCard
())
.
resourceMap
(
info
.
getResourceMap
())
.
operatorId
(
info
.
getOperatorId
())
.
finishTime
(
apply
.
getFinishTime
())
.
createTime
(
apply
.
getCreateTime
())
.
updateTime
(
apply
.
getUpdateTime
())
...
...
service/src/main/java/com/jiejing/fitness/finance/service/merchant/impl/StudioMerchantServiceImpl.java
View file @
56752545
...
...
@@ -32,6 +32,8 @@ import com.jiejing.fitness.finance.service.rpc.MerchantRpcService;
import
com.jiejing.fitness.finance.service.rpc.MessageRpcService
;
import
com.jiejing.fitness.finance.service.rpc.ResourceRpcService
;
import
com.jiejing.fitness.finance.service.rpc.StudioRpcService
;
import
com.jiejing.message.enums.MsgChannelEnum
;
import
com.jiejing.message.event.SendCommonMsgEvent
;
import
com.jiejing.paycenter.api.merchant.request.ApplyMerchantRequest
;
import
com.jiejing.paycenter.common.enums.merchant.SubChannelOpenTypeEnums
;
import
com.jiejing.paycenter.common.model.vo.AuthSubChannelVO
;
...
...
@@ -47,7 +49,9 @@ import com.jiejing.paycenter.common.event.MerchantEvent;
import
com.jiejing.paycenter.common.model.request.ResourceInfo
;
import
com.jiejing.paycenter.common.model.vo.SubChannelVO
;
import
com.jiejing.studio.api.studio.vo.StudioVO
;
import
com.xiaomai.event.EventAgent
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Objects
;
...
...
@@ -393,6 +397,10 @@ public class StudioMerchantServiceImpl implements StudioMerchantService {
private
void
doAfterMerchantSuccess
(
MerchantEvent
event
,
Long
oldMerchantId
)
{
// 1. 配置场馆小程序appId
this
.
rebindMiniAppId
(
oldMerchantId
,
event
.
getMerchantId
());
// 2. 短信
StudioMerchantApplyVO
apply
=
this
.
getApply
(
Long
.
parseLong
(
event
.
getApplyNo
()));
this
.
sendOpenSuccessMessage
(
apply
);
}
private
void
rebindMiniAppId
(
Long
oldMerchantId
,
Long
newMerchantId
)
{
...
...
@@ -443,9 +451,53 @@ public class StudioMerchantServiceImpl implements StudioMerchantService {
}
private
void
doOpenMerchantFail
(
Long
id
,
String
failMessage
)
{
StudioMerchantApplyVO
apply
=
this
.
getApply
(
id
);
if
(
null
==
apply
)
{
return
;
}
if
(
OpenStateEnums
.
FAIL
.
getCode
().
equals
(
apply
.
getOpenState
()))
{
return
;
}
// 1. 更新
studioMerchantApplyRpService
.
updateById
(
StudioMerchantApply
.
builder
().
id
(
id
).
openState
(
OpenStateEnums
.
FAIL
.
getCode
())
.
openFailMessage
(
failMessage
).
build
());
// 2. 短信
this
.
sendOpenFailMessage
(
apply
);
}
private
void
sendOpenFailMessage
(
StudioMerchantApplyVO
apply
)
{
List
<
Map
<
String
,
Object
>>
paramList
=
new
ArrayList
<>(
1
);
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>(
1
);
paramMap
.
put
(
"targetId"
,
apply
.
getOperatorId
());
paramMap
.
put
(
"studioId"
,
apply
.
getStudioId
());
paramList
.
add
(
paramMap
);
SendCommonMsgEvent
event
=
new
SendCommonMsgEvent
();
event
.
setChannelEnums
(
Lists
.
newArrayList
(
MsgChannelEnum
.
SMS
));
event
.
setCovertTarget
(
true
);
event
.
setEventId
(
IdWorker
.
getId
());
event
.
setSourceId
(
apply
.
getStudioId
());
event
.
setBizType
(
"OPEN_MERCHANT_FAIL"
);
event
.
setParams
(
paramList
);
EventAgent
.
of
(
SendCommonMsgEvent
.
class
).
triggerEvent
(
event
);
}
private
void
sendOpenSuccessMessage
(
StudioMerchantApplyVO
apply
)
{
List
<
Map
<
String
,
Object
>>
paramList
=
new
ArrayList
<>(
1
);
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>(
1
);
paramMap
.
put
(
"targetId"
,
apply
.
getOperatorId
());
paramMap
.
put
(
"studioId"
,
apply
.
getStudioId
());
paramList
.
add
(
paramMap
);
SendCommonMsgEvent
event
=
new
SendCommonMsgEvent
();
event
.
setChannelEnums
(
Lists
.
newArrayList
(
MsgChannelEnum
.
SMS
));
event
.
setCovertTarget
(
true
);
event
.
setEventId
(
IdWorker
.
getId
());
event
.
setSourceId
(
apply
.
getStudioId
());
event
.
setBizType
(
"OPEN_MERCHANT_SUCCESS"
);
event
.
setParams
(
paramList
);
EventAgent
.
of
(
SendCommonMsgEvent
.
class
).
triggerEvent
(
event
);
}
private
void
doOpenMerchantProcess
(
Long
id
)
{
...
...
service/src/main/java/com/jiejing/fitness/finance/service/merchant/params/ApplyStudioMerchantParams.java
View file @
56752545
...
...
@@ -78,6 +78,9 @@ public class ApplyStudioMerchantParams {
@NotBlank
(
message
=
"验证码不能为空"
)
private
String
smsCode
;
@ApiModelProperty
(
value
=
"操作人ID"
)
private
Long
operatorId
;
public
ApplyStudioMerchantParams
encrypt
(
String
salt
)
{
ApplyStudioMerchantParams
copy
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
this
),
ApplyStudioMerchantParams
.
class
);
...
...
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