Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
O
order-group
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
order-group-application
order-group
Commits
a4cf3f30
Commit
a4cf3f30
authored
May 31, 2021
by
周晓航
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
有数上报 功能迁移至 发送MQ
parent
0345fcae
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
4 deletions
+27
-4
call-back-service/src/main/java/cn/freemud/amp/config/OrderCallBackConfig.java
+19
-0
call-back-service/src/main/java/cn/freemud/amp/service/OrderCallBackMQService.java
+8
-4
No files found.
call-back-service/src/main/java/cn/freemud/amp/config/OrderCallBackConfig.java
View file @
a4cf3f30
...
@@ -35,6 +35,11 @@ public class OrderCallBackConfig {
...
@@ -35,6 +35,11 @@ public class OrderCallBackConfig {
public
static
final
String
INVOICE_QUEUE
=
"invoice-report-queue"
;
public
static
final
String
INVOICE_QUEUE
=
"invoice-report-queue"
;
public
static
final
String
INVOICE_ROUTE_KEY
=
"invoice-report-queue-routing-key"
;
public
static
final
String
INVOICE_ROUTE_KEY
=
"invoice-report-queue-routing-key"
;
// 腾讯有数上报 & 门店营业开店记录 发送到 ordercenter-order组的 mq中
public
static
final
String
SEND_YOUSHU_REPORT_QUEUE_ROUTING_KEY
=
"send-youshu-report-queue-routing-key"
;
public
static
final
String
SEND_YOUSHU_REPORT_QUEUE
=
"send-youshu-report-queue"
;
/**
/**
* 定义基于Fanout 的Exchange。
* 定义基于Fanout 的Exchange。
* 基于这个代码,也可以非常方便的定义其他的Exchange类型。
* 基于这个代码,也可以非常方便的定义其他的Exchange类型。
...
@@ -114,4 +119,18 @@ public class OrderCallBackConfig {
...
@@ -114,4 +119,18 @@ public class OrderCallBackConfig {
Binding
bindingInvoiceQueue
(
@Qualifier
(
"invoiceQueue"
)
Queue
invoiceQueue
,
@Qualifier
(
"invoiceExchange"
)
Exchange
invoiceExchange
)
{
Binding
bindingInvoiceQueue
(
@Qualifier
(
"invoiceQueue"
)
Queue
invoiceQueue
,
@Qualifier
(
"invoiceExchange"
)
Exchange
invoiceExchange
)
{
return
BindingBuilder
.
bind
(
invoiceQueue
).
to
(
invoiceExchange
).
with
(
INVOICE_ROUTE_KEY
).
noargs
();
return
BindingBuilder
.
bind
(
invoiceQueue
).
to
(
invoiceExchange
).
with
(
INVOICE_ROUTE_KEY
).
noargs
();
}
}
/**
* 有数上报/ 支付门店 queue 绑定
* @return
*/
@Bean
(
name
=
"sendWechatReportQueue"
)
public
Queue
sendWechatReportQueue
()
{
return
QueueBuilder
.
durable
(
SEND_YOUSHU_REPORT_QUEUE
).
build
();
}
@Bean
Binding
bindingSendWechatReportQueue
(
@Qualifier
(
"sendWechatReportQueue"
)
Queue
sendWechatReportQueue
,
@Qualifier
(
"topicExchange"
)
Exchange
topicExchange
)
{
return
BindingBuilder
.
bind
(
sendWechatReportQueue
).
to
(
topicExchange
).
with
(
SEND_YOUSHU_REPORT_QUEUE_ROUTING_KEY
).
noargs
();
}
}
}
call-back-service/src/main/java/cn/freemud/amp/service/OrderCallBackMQService.java
View file @
a4cf3f30
...
@@ -96,7 +96,7 @@ public class OrderCallBackMQService {
...
@@ -96,7 +96,7 @@ public class OrderCallBackMQService {
}
else
{
}
else
{
revert
(
body
);
revert
(
body
);
}
}
// 有数订单数据上报
// 有数订单数据上报
& 每日下单门店统计
sendYoushuReportMQ
(
body
);
sendYoushuReportMQ
(
body
);
}
}
...
@@ -344,16 +344,20 @@ public class OrderCallBackMQService {
...
@@ -344,16 +344,20 @@ public class OrderCallBackMQService {
* @param body
* @param body
*/
*/
private
void
sendYoushuReportMQ
(
OrderCallBackRequestVo
body
)
{
private
void
sendYoushuReportMQ
(
OrderCallBackRequestVo
body
)
{
logger
.
info
(
"send youshu report MQ orderCode:{} queue:{} content:{}"
,
new
Object
[]{
body
.
getOrderCode
(),
"send-youshu-report-queue"
,
JSONObject
.
toJSONString
(
body
.
getContent
())});
try
{
try
{
if
(
Objects
.
isNull
(
body
)
||
StringUtils
.
isEmpty
(
body
.
getContent
()))
{
if
(
Objects
.
isNull
(
body
)
||
StringUtils
.
isEmpty
(
body
.
getContent
()))
{
return
;
return
;
}
}
// 正常变化 订单正向操作
// 正常变化 订单正向操作
fisherman 检查下
if
(
body
.
getOperateType
()
==
1
&&
"1"
.
equals
(
body
.
getMsgType
()))
{
if
(
body
.
getOperateType
()
==
1
&&
"1"
.
equals
(
body
.
getMsgType
()))
{
Header
header
=
new
Header
(
MQAction
.
UPDATE
.
getAction
(),
"call-back-service-api"
,
OrderCallBackConfig
.
SEND_YOUSHU_REPORT_QUEUE_ROUTING_KEY
,
OrderCallBackConfig
.
SEND_YOUSHU_REPORT_QUEUE
);
MQMessage
<
OrderCallBackRequestVo
>
message
=
new
MQMessage
<>(
header
,
body
);
mqService
.
convertAndSend
(
OrderCallBackConfig
.
TOPIC_EXCHANGE_NAME
,
OrderCallBackConfig
.
SEND_YOUSHU_REPORT_QUEUE_ROUTING_KEY
,
message
);
}
}
}
catch
(
Exception
e
){
}
catch
(
Exception
e
){
logger
.
info
(
"send youshu report MQ ERROR :{}"
,
JSON
.
toJSONString
(
e
));
}
}
}
}
}
}
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