Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
X
xyqb-user2
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
head_group
xyqb-user2
Commits
dbe5c08e
Commit
dbe5c08e
authored
Feb 01, 2023
by
王亮
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
format code.
parent
f6d61138
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
33 deletions
+36
-33
BlackHoleRegisteredEventListener.java
...antgroup/xyqb/event/BlackHoleRegisteredEventListener.java
+36
-33
No files found.
src/main/java/cn/quantgroup/xyqb/event/BlackHoleRegisteredEventListener.java
View file @
dbe5c08e
package
cn
.
quantgroup
.
xyqb
.
event
;
import
cn.quantgroup.xyqb.entity.User
;
import
cn.quantgroup.xyqb.model.UserRegisterParam
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
java.time.LocalDate
;
...
...
@@ -14,6 +13,9 @@ import org.springframework.beans.factory.annotation.Value;
import
org.springframework.context.ApplicationListener
;
import
org.springframework.stereotype.Component
;
/**
* 用户注册发送给合同中心事件监听
*/
@Slf4j
@Component
public
class
BlackHoleRegisteredEventListener
implements
ApplicationListener
<
RegisterEvent
>
{
...
...
@@ -33,12 +35,12 @@ public class BlackHoleRegisteredEventListener implements ApplicationListener<Reg
@Override
public
void
onApplicationEvent
(
RegisterEvent
event
)
{
User
user
=
event
.
getUserRegisterParam
().
getUser
();
log
.
info
(
"onApplicationEvent cn.quantgroup.xyqb.event.BlackHoleRegisteredEventListener
start userId = 【{}】, registerFrom = 【{}】"
,
user
.
getId
(),
event
);
log
.
info
(
"onApplicationEvent
start userId = 【{}】, registerFrom = 【{}】"
,
user
.
getId
(),
event
);
LocalDate
signDate
=
LocalDate
.
now
();
String
dateStr
=
signDate
.
format
(
DateTimeFormatter
.
ofPattern
(
"yyyy年MM月dd日"
));
int
day
=
signDate
.
getDayOfMonth
();
// 信用钱包服务与隐私协议
templateIds
.
forEach
(
id
->
{
templateIds
.
forEach
(
id
->
{
JSONObject
fields
=
new
JSONObject
();
fields
.
put
(
"phoneNo"
,
user
.
getPhoneNo
());
fields
.
put
(
"genarateDateStr"
,
dateStr
);
...
...
@@ -50,7 +52,8 @@ public class BlackHoleRegisteredEventListener implements ApplicationListener<Reg
json
.
put
(
"fields"
,
fields
);
JSONArray
array
=
new
JSONArray
();
array
.
add
(
json
);
registeredNotifyBlackHoleRabbitTemplate
.
convertAndSend
(
exchange
,
routingKey
,
array
.
toString
());
registeredNotifyBlackHoleRabbitTemplate
.
convertAndSend
(
exchange
,
routingKey
,
array
.
toString
());
});
}
}
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