Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jinli gu
Jeepay
Commits
81c94049
Commit
81c94049
authored
Jun 28, 2021
by
xiaoyu
Browse files
增加RabbitMQ兼容
parent
7d78af1a
Changes
65
Hide whitespace changes
Inline
Side-by-side
conf/manager/application.yml
View file @
81c94049
...
...
@@ -22,10 +22,25 @@ spring:
host
:
127.0.0.1
port
:
6379
password
:
# 注意:以下MQ配置需注意【如需使用activeMQ则需将rabbitMQ配置注释即可】
profiles
:
include
:
-
activeMQ
# - rabbitMQ # 需要安装延迟队列插件:https://www.rabbitmq.com/blog/2015/04/16/scheduling-messages-with-rabbitmq/
#activeMQ配置
activemq
:
broker-url
:
tcp://localhost:61616
#连接地址
#rabbitmq配置
# rabbitmq:
# addresses: 127.0.0.1:5672
# username: jeepay
# password: 123123
# dynamic: true
# virtual-host: /
#日志配置参数。
# 当存在logback-spring.xml文件时: 该配置将引进到logback配置, springboot配置不生效。
# 不存在logback-spring.xml 文件时, 使用springboot的配置, 同样可用。
...
...
conf/merchant/application.yml
View file @
81c94049
...
...
@@ -22,10 +22,25 @@ spring:
host
:
127.0.0.1
port
:
6379
password
:
# 注意:以下MQ配置需注意【如需使用activeMQ则需将rabbitMQ配置注释即可】
profiles
:
include
:
-
activeMQ
# - rabbitMQ # 需要安装延迟队列插件:https://www.rabbitmq.com/blog/2015/04/16/scheduling-messages-with-rabbitmq/
#activeMQ配置
activemq
:
broker-url
:
tcp://localhost:61616
#连接地址
#rabbitmq配置
# rabbitmq:
# addresses: 127.0.0.1:5672
# username: jeepay
# password: 123123
# dynamic: true
# virtual-host: /
#日志配置参数。
# 当存在logback-spring.xml文件时: 该配置将引进到logback配置, springboot配置不生效。
# 不存在logback-spring.xml 文件时, 使用springboot的配置, 同样可用。
...
...
conf/payment/application.yml
View file @
81c94049
...
...
@@ -22,10 +22,25 @@ spring:
host
:
127.0.0.1
port
:
6379
password
:
# 注意:以下MQ配置需注意【如需使用activeMQ则需将rabbitMQ配置注释即可】
profiles
:
include
:
-
activeMQ
# - rabbitMQ # 需要安装延迟队列插件:https://www.rabbitmq.com/blog/2015/04/16/scheduling-messages-with-rabbitmq/
#activeMQ配置
activemq
:
broker-url
:
tcp://localhost:61616
#连接地址
#rabbitmq配置
# rabbitmq:
# addresses: 127.0.0.1:5672
# username: jeepay
# password: 123123
# dynamic: true
# virtual-host: /
#日志配置参数。
# 当存在logback-spring.xml文件时: 该配置将引进到logback配置, springboot配置不生效。
# 不存在logback-spring.xml 文件时, 使用springboot的配置, 同样可用。
...
...
jeepay-core/src/main/java/com/jeequan/jeepay/core/constants/CS.java
View file @
81c94049
...
...
@@ -150,6 +150,15 @@ public class CS {
}
/** RabbitMQ交换机类型 **/
public
static
final
String
TOPIC_EXCHANGE
=
"topicExchange"
;
public
static
final
String
DIRECT_EXCHANGE
=
"directExchange"
;
public
static
final
String
DELAYED_EXCHANGE
=
"delayedExchange"
;
// 延迟交换机
/** 切换MQ的类型 **/
public
static
class
MQTYPE
{
public
static
final
String
ACTIVE_MQ
=
"activeMQ"
;
public
static
final
String
RABBIT_MQ
=
"rabbitMQ"
;
}
//菜单类型
public
interface
ENT_TYPE
{
...
...
jeepay-manager/pom.xml
View file @
81c94049
...
...
@@ -89,6 +89,12 @@
<artifactId>
spring-boot-starter-activemq
</artifactId>
</dependency>
<!-- 添加对rabbitMQ的支持 -->
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-amqp
</artifactId>
</dependency>
<!-- 引入 jeepay-sdk-java -->
<dependency>
<groupId>
com.jeequan
</groupId>
...
...
jeepay-manager/src/main/java/com/jeequan/jeepay/mgr/ctrl/config/SysConfigController.java
View file @
81c94049
...
...
@@ -20,10 +20,9 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import
com.jeequan.jeepay.core.aop.MethodLog
;
import
com.jeequan.jeepay.core.constants.ApiCodeEnum
;
import
com.jeequan.jeepay.core.entity.SysConfig
;
import
com.jeequan.jeepay.core.utils.StringKit
;
import
com.jeequan.jeepay.core.model.ApiRes
;
import
com.jeequan.jeepay.mgr.ctrl.CommonCtrl
;
import
com.jeequan.jeepay.mgr.mq.
top
ic.Mq
Topic4ModifySysConfig
;
import
com.jeequan.jeepay.mgr.mq.
serv
ic
e
.Mq
ServiceImpl
;
import
com.jeequan.jeepay.service.impl.SysConfigService
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
...
...
@@ -34,7 +33,6 @@ import org.springframework.web.bind.annotation.RequestMapping;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -51,7 +49,7 @@ import java.util.Map;
public
class
SysConfigController
extends
CommonCtrl
{
@Autowired
private
SysConfigService
sysConfigService
;
@Autowired
private
Mq
Topic4ModifySysConfig
mqTopic4ModifySysConfig
;
@Autowired
private
Mq
ServiceImpl
mqService
;
/**
...
...
@@ -86,7 +84,7 @@ public class SysConfigController extends CommonCtrl {
int
update
=
sysConfigService
.
updateByConfigKey
(
updateMap
);
if
(
update
<=
0
)
return
ApiRes
.
fail
(
ApiCodeEnum
.
SYSTEM_ERROR
,
"更新失败"
);
mq
Topic4
ModifySysConfig
.
push
(
groupKey
);
mq
Service
.
send
ModifySysConfig
(
groupKey
);
return
ApiRes
.
ok
();
}
...
...
jeepay-manager/src/main/java/com/jeequan/jeepay/mgr/ctrl/isv/IsvInfoController.java
View file @
81c94049
...
...
@@ -23,7 +23,7 @@ import com.jeequan.jeepay.core.constants.ApiCodeEnum;
import
com.jeequan.jeepay.core.entity.IsvInfo
;
import
com.jeequan.jeepay.core.model.ApiRes
;
import
com.jeequan.jeepay.mgr.ctrl.CommonCtrl
;
import
com.jeequan.jeepay.mgr.mq.
top
ic.Mq
Topic4ModifyIsvInfo
;
import
com.jeequan.jeepay.mgr.mq.
serv
ic
e
.Mq
ServiceImpl
;
import
com.jeequan.jeepay.service.impl.IsvInfoService
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -45,7 +45,7 @@ import org.springframework.web.bind.annotation.RestController;
public
class
IsvInfoController
extends
CommonCtrl
{
@Autowired
private
IsvInfoService
isvInfoService
;
@Autowired
private
Mq
Topic4ModifyIsvInfo
mqTopic4ModifyIsvInfo
;
@Autowired
private
Mq
ServiceImpl
mqServiceImpl
;
/**
* @author: pangxiaoyu
...
...
@@ -95,7 +95,7 @@ public class IsvInfoController extends CommonCtrl {
@RequestMapping
(
value
=
"/{isvNo}"
,
method
=
RequestMethod
.
DELETE
)
public
ApiRes
delete
(
@PathVariable
(
"isvNo"
)
String
isvNo
)
{
isvInfoService
.
removeByIsvNo
(
isvNo
);
mq
Topic4
ModifyIsvInfo
.
push
(
isvNo
);
// 推送mq到目前节点进行更新数据
mq
ServiceImpl
.
send
ModifyIsvInfo
(
isvNo
);
// 推送mq到目前节点进行更新数据
return
ApiRes
.
ok
();
}
...
...
@@ -111,7 +111,7 @@ public class IsvInfoController extends CommonCtrl {
IsvInfo
isvInfo
=
getObject
(
IsvInfo
.
class
);
isvInfo
.
setIsvNo
(
isvNo
);
boolean
result
=
isvInfoService
.
updateById
(
isvInfo
);
mq
Topic4
ModifyIsvInfo
.
push
(
isvNo
);
// 推送mq到目前节点进行更新数据
mq
ServiceImpl
.
send
ModifyIsvInfo
(
isvNo
);
// 推送mq到目前节点进行更新数据
if
(!
result
)
return
ApiRes
.
fail
(
ApiCodeEnum
.
SYS_OPERATION_FAIL_UPDATE
);
return
ApiRes
.
ok
();
}
...
...
jeepay-manager/src/main/java/com/jeequan/jeepay/mgr/ctrl/isv/IsvPayInterfaceConfigController.java
View file @
81c94049
...
...
@@ -22,7 +22,7 @@ import com.jeequan.jeepay.core.entity.PayInterfaceConfig;
import
com.jeequan.jeepay.core.entity.PayInterfaceDefine
;
import
com.jeequan.jeepay.core.model.ApiRes
;
import
com.jeequan.jeepay.mgr.ctrl.CommonCtrl
;
import
com.jeequan.jeepay.mgr.mq.
top
ic.Mq
Topic4ModifyIsvInfo
;
import
com.jeequan.jeepay.mgr.mq.
serv
ic
e
.Mq
ServiceImpl
;
import
com.jeequan.jeepay.service.impl.PayInterfaceConfigService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.security.access.prepost.PreAuthorize
;
...
...
@@ -43,7 +43,7 @@ import java.util.List;
public
class
IsvPayInterfaceConfigController
extends
CommonCtrl
{
@Autowired
private
PayInterfaceConfigService
payInterfaceConfigService
;
@Autowired
private
Mq
Topic4ModifyIsvInfo
mqTopic4ModifyIsvInfo
;
@Autowired
private
Mq
ServiceImpl
mqServiceImpl
;
/**
* @Author: ZhuXiao
...
...
@@ -114,7 +114,7 @@ public class IsvPayInterfaceConfigController extends CommonCtrl {
if
(!
result
)
{
return
ApiRes
.
fail
(
ApiCodeEnum
.
SYSTEM_ERROR
,
"配置失败"
);
}
mq
Topic4
ModifyIsvInfo
.
push
(
infoId
);
// 推送mq到目前节点进行更新数据
mq
ServiceImpl
.
send
ModifyIsvInfo
(
infoId
);
// 推送mq到目前节点进行更新数据
return
ApiRes
.
ok
();
}
...
...
jeepay-manager/src/main/java/com/jeequan/jeepay/mgr/ctrl/merchant/MchAppController.java
View file @
81c94049
...
...
@@ -21,16 +21,11 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import
com.jeequan.jeepay.core.aop.MethodLog
;
import
com.jeequan.jeepay.core.constants.ApiCodeEnum
;
import
com.jeequan.jeepay.core.entity.MchApp
;
import
com.jeequan.jeepay.core.entity.MchInfo
;
import
com.jeequan.jeepay.core.entity.PayOrder
;
import
com.jeequan.jeepay.core.exception.BizException
;
import
com.jeequan.jeepay.core.model.ApiRes
;
import
com.jeequan.jeepay.mgr.ctrl.CommonCtrl
;
import
com.jeequan.jeepay.mgr.mq.queue.MqQueue4ModifyMchUserRemove
;
import
com.jeequan.jeepay.mgr.mq.topic.MqTopic4ModifyMchApp
;
import
com.jeequan.jeepay.mgr.mq.service.MqServiceImpl
;
import
com.jeequan.jeepay.service.impl.MchAppService
;
import
com.jeequan.jeepay.service.impl.MchInfoService
;
import
com.jeequan.jeepay.service.impl.PayOrderService
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.security.access.prepost.PreAuthorize
;
...
...
@@ -49,7 +44,7 @@ public class MchAppController extends CommonCtrl {
@Autowired
private
MchInfoService
mchInfoService
;
@Autowired
private
MchAppService
mchAppService
;
@Autowired
private
Mq
Topic4ModifyMchApp
mqTopic4ModifyMchApp
;
@Autowired
private
Mq
ServiceImpl
mqServiceImpl
;
/**
* @Author: ZhuXiao
...
...
@@ -127,7 +122,7 @@ public class MchAppController extends CommonCtrl {
return
ApiRes
.
fail
(
ApiCodeEnum
.
SYS_OPERATION_FAIL_UPDATE
);
}
// 推送修改应用消息
mq
Topic4
ModifyMchApp
.
push
(
mchApp
.
getMchNo
(),
mchApp
.
getAppId
());
mq
ServiceImpl
.
send
ModifyMchApp
(
mchApp
.
getMchNo
(),
mchApp
.
getAppId
());
return
ApiRes
.
ok
();
}
...
...
@@ -145,7 +140,7 @@ public class MchAppController extends CommonCtrl {
mchAppService
.
removeByAppId
(
appId
);
// 推送mq到目前节点进行更新数据
mq
Topic4
ModifyMchApp
.
push
(
mchApp
.
getMchNo
(),
appId
);
mq
ServiceImpl
.
send
ModifyMchApp
(
mchApp
.
getMchNo
(),
appId
);
return
ApiRes
.
ok
();
}
...
...
jeepay-manager/src/main/java/com/jeequan/jeepay/mgr/ctrl/merchant/MchInfoController.java
View file @
81c94049
...
...
@@ -26,8 +26,7 @@ import com.jeequan.jeepay.core.entity.MchInfo;
import
com.jeequan.jeepay.core.entity.SysUser
;
import
com.jeequan.jeepay.core.model.ApiRes
;
import
com.jeequan.jeepay.mgr.ctrl.CommonCtrl
;
import
com.jeequan.jeepay.mgr.mq.queue.MqQueue4ModifyMchUserRemove
;
import
com.jeequan.jeepay.mgr.mq.topic.MqTopic4ModifyMchInfo
;
import
com.jeequan.jeepay.mgr.mq.service.MqServiceImpl
;
import
com.jeequan.jeepay.service.impl.MchInfoService
;
import
com.jeequan.jeepay.service.impl.SysUserAuthService
;
import
com.jeequan.jeepay.service.impl.SysUserService
;
...
...
@@ -39,7 +38,9 @@ import org.springframework.web.bind.annotation.RequestMapping;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.*
;
import
java.util.HashSet
;
import
java.util.List
;
import
java.util.Set
;
/**
* 商户管理类
...
...
@@ -54,9 +55,8 @@ public class MchInfoController extends CommonCtrl {
@Autowired
private
MchInfoService
mchInfoService
;
@Autowired
private
SysUserService
sysUserService
;
@Autowired
private
MqTopic4ModifyMchInfo
mqTopic4ModifyMchInfo
;
@Autowired
private
MqQueue4ModifyMchUserRemove
mqQueue4ModifyMchUserRemove
;
@Autowired
private
SysUserAuthService
sysUserAuthService
;
@Autowired
private
MqServiceImpl
mqServiceImpl
;
/**
* @author: pangxiaoyu
...
...
@@ -113,9 +113,9 @@ public class MchInfoController extends CommonCtrl {
public
ApiRes
delete
(
@PathVariable
(
"mchNo"
)
String
mchNo
)
{
List
<
Long
>
userIdList
=
mchInfoService
.
removeByMchNo
(
mchNo
);
// 推送mq删除redis用户缓存
mq
Queue4ModifyMch
UserRemove
.
push
(
userIdList
);
mq
ServiceImpl
.
send
UserRemove
(
userIdList
);
// 推送mq到目前节点进行更新数据
mq
Topic4
ModifyMchInfo
.
push
(
mchNo
);
mq
ServiceImpl
.
send
ModifyMchInfo
(
mchNo
);
return
ApiRes
.
ok
();
}
...
...
@@ -161,7 +161,7 @@ public class MchInfoController extends CommonCtrl {
// 推送mq删除redis用户认证信息
if
(!
removeCacheUserIdList
.
isEmpty
())
{
mq
Queue4ModifyMch
UserRemove
.
push
(
removeCacheUserIdList
);
mq
ServiceImpl
.
send
UserRemove
(
removeCacheUserIdList
);
}
//更新商户信息
...
...
@@ -170,7 +170,7 @@ public class MchInfoController extends CommonCtrl {
}
// 推送mq到目前节点进行更新数据
mq
Topic4
ModifyMchInfo
.
push
(
mchNo
);
mq
ServiceImpl
.
send
ModifyMchInfo
(
mchNo
);
return
ApiRes
.
ok
();
}
...
...
jeepay-manager/src/main/java/com/jeequan/jeepay/mgr/ctrl/merchant/MchPayInterfaceConfigController.java
View file @
81c94049
...
...
@@ -23,8 +23,7 @@ import com.jeequan.jeepay.core.entity.PayInterfaceConfig;
import
com.jeequan.jeepay.core.entity.PayInterfaceDefine
;
import
com.jeequan.jeepay.core.model.ApiRes
;
import
com.jeequan.jeepay.mgr.ctrl.CommonCtrl
;
import
com.jeequan.jeepay.mgr.mq.topic.MqTopic4ModifyMchApp
;
import
com.jeequan.jeepay.mgr.mq.topic.MqTopic4ModifyMchInfo
;
import
com.jeequan.jeepay.mgr.mq.service.MqServiceImpl
;
import
com.jeequan.jeepay.service.impl.MchAppService
;
import
com.jeequan.jeepay.service.impl.PayInterfaceConfigService
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -46,7 +45,7 @@ import java.util.List;
public
class
MchPayInterfaceConfigController
extends
CommonCtrl
{
@Autowired
private
PayInterfaceConfigService
payInterfaceConfigService
;
@Autowired
private
Mq
Topic4ModifyMchApp
mqTopic4ModifyMchApp
;
@Autowired
private
Mq
ServiceImpl
mqServiceImpl
;
@Autowired
private
MchAppService
mchAppService
;
/**
...
...
@@ -125,7 +124,7 @@ public class MchPayInterfaceConfigController extends CommonCtrl {
return
ApiRes
.
fail
(
ApiCodeEnum
.
SYSTEM_ERROR
,
"配置失败"
);
}
mq
Topic4
ModifyMchApp
.
push
(
mchApp
.
getMchNo
(),
infoId
);
// 推送mq到目前节点进行更新数据
mq
ServiceImpl
.
send
ModifyMchApp
(
mchApp
.
getMchNo
(),
infoId
);
// 推送mq到目前节点进行更新数据
return
ApiRes
.
ok
();
}
...
...
jeepay-manager/src/main/java/com/jeequan/jeepay/mgr/ctrl/order/MchNotifyController.java
View file @
81c94049
...
...
@@ -23,7 +23,7 @@ import com.jeequan.jeepay.core.entity.MchNotifyRecord;
import
com.jeequan.jeepay.core.exception.BizException
;
import
com.jeequan.jeepay.core.model.ApiRes
;
import
com.jeequan.jeepay.mgr.ctrl.CommonCtrl
;
import
com.jeequan.jeepay.mgr.mq.
queue.MqQueue4PayOrderMchNotify
;
import
com.jeequan.jeepay.mgr.mq.
service.MqServiceImpl
;
import
com.jeequan.jeepay.service.impl.MchNotifyRecordService
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -45,7 +45,7 @@ import org.springframework.web.bind.annotation.RestController;
public
class
MchNotifyController
extends
CommonCtrl
{
@Autowired
private
MchNotifyRecordService
mchNotifyService
;
@Autowired
private
Mq
Queue4PayOrderMchNotify
mqQueue4PayOrderMchNotify
;
@Autowired
private
Mq
ServiceImpl
mqServiceImpl
;
/**
* @author: pangxiaoyu
...
...
@@ -106,7 +106,7 @@ public class MchNotifyController extends CommonCtrl {
mchNotifyService
.
getBaseMapper
().
updateIngAndAddNotifyCountLimit
(
notifyId
);
//调起MQ重发
mq
Queue4
PayOrder
Mch
Notify
.
send
(
notifyId
);
mq
ServiceImpl
.
send
PayOrderNotify
(
notifyId
+
""
);
return
ApiRes
.
ok
(
mchNotify
);
}
...
...
jeepay-manager/src/main/java/com/jeequan/jeepay/mgr/mq/queue/MqQueue4ModifyMchUserRemove.java
View file @
81c94049
...
...
@@ -17,12 +17,18 @@ package com.jeequan.jeepay.mgr.mq.queue;
import
com.alibaba.fastjson.JSONArray
;
import
com.jeequan.jeepay.core.constants.CS
;
import
com.jeequan.jeepay.mgr.mq.service.MqMchUserRemoveService
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.activemq.command.ActiveMQQueue
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Qualifier
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Lazy
;
import
org.springframework.context.annotation.Profile
;
import
org.springframework.jms.core.JmsTemplate
;
import
org.springframework.stereotype.Component
;
import
javax.jms.Queue
;
import
java.util.Collection
;
/**
...
...
@@ -34,24 +40,27 @@ import java.util.Collection;
*/
@Slf4j
@Component
public
class
MqQueue4ModifyMchUserRemove
extends
ActiveMQQueue
{
@Profile
(
CS
.
MQTYPE
.
ACTIVE_MQ
)
public
class
MqQueue4ModifyMchUserRemove
extends
MqMchUserRemoveService
{
@Autowired
private
JmsTemplate
jmsTemplate
;
public
MqQueue4ModifyMchUserRemove
(){
super
(
CS
.
MQ
.
QUEUE_MODIFY_MCH_USER_REMOVE
);
@Bean
(
"modifyMchUserRemove"
)
public
Queue
mqQueue4ModifyMchUserRemove
(){
return
new
ActiveMQQueue
(
CS
.
MQ
.
QUEUE_MODIFY_MCH_USER_REMOVE
);
}
/**
* @author: pangxiaoyu
* @date: 2021/6/7 16:16
* @describe: 推送消息到各个节点
*/
public
void
push
(
Collection
<
Long
>
userIdList
)
{
@Lazy
@Autowired
@Qualifier
(
"modifyMchUserRemove"
)
private
Queue
mqQueue4ModifyMchUserRemove
;
@Override
public
void
send
(
Collection
<
Long
>
userIdList
)
{
if
(
userIdList
==
null
||
userIdList
.
isEmpty
()){
return
;
}
this
.
jmsTemplate
.
convertAndSend
(
this
,
JSONArray
.
toJSONString
(
userIdList
));
this
.
jmsTemplate
.
convertAndSend
(
mqQueue4ModifyMchUserRemove
,
JSONArray
.
toJSONString
(
userIdList
));
}
}
jeepay-manager/src/main/java/com/jeequan/jeepay/mgr/mq/queue/MqQueue4PayOrderMchNotify.java
View file @
81c94049
...
...
@@ -16,12 +16,19 @@
package
com.jeequan.jeepay.mgr.mq.queue
;
import
com.jeequan.jeepay.core.constants.CS
;
import
com.jeequan.jeepay.mgr.mq.service.MqPayOrderNotifyService
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.activemq.command.ActiveMQQueue
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Qualifier
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Lazy
;
import
org.springframework.context.annotation.Profile
;
import
org.springframework.jms.core.JmsTemplate
;
import
org.springframework.stereotype.Component
;
import
javax.jms.Queue
;
/**
* 商户订单回调MQ通知
*
...
...
@@ -31,17 +38,26 @@ import org.springframework.stereotype.Component;
*/
@Slf4j
@Component
public
class
MqQueue4PayOrderMchNotify
extends
ActiveMQQueue
{
@Profile
(
CS
.
MQTYPE
.
ACTIVE_MQ
)
public
class
MqQueue4PayOrderMchNotify
extends
MqPayOrderNotifyService
{
@Autowired
private
JmsTemplate
jmsTemplate
;
public
MqQueue4PayOrderMchNotify
(){
super
(
CS
.
MQ
.
QUEUE_PAYORDER_MCH_NOTIFY
);
@Bean
(
"payOrderMchNotify"
)
public
Queue
mqQueue4PayOrderMchNotify
(){
return
new
ActiveMQQueue
(
CS
.
MQ
.
QUEUE_PAYORDER_MCH_NOTIFY
);
}
@Lazy
@Autowired
@Qualifier
(
"payOrderMchNotify"
)
private
Queue
mqQueue4PayOrderMchNotify
;
/** 发送MQ消息 **/
public
void
send
(
Long
notifyId
)
{
this
.
jmsTemplate
.
convertAndSend
(
this
,
notifyId
+
""
);
@Override
public
void
send
(
String
msg
)
{
this
.
jmsTemplate
.
convertAndSend
(
mqQueue4PayOrderMchNotify
,
msg
);
}
}
jeepay-manager/src/main/java/com/jeequan/jeepay/mgr/mq/queue/RabbitMq4ModifyMchUserRemove.java
0 → 100644
View file @
81c94049
/*
* Copyright (c) 2021-2031, 河北计全科技有限公司 (https://www.jeequan.com & jeequan@126.com).
* <p>
* Licensed under the GNU LESSER GENERAL PUBLIC LICENSE 3.0;
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* <p>
* http://www.gnu.org/licenses/lgpl.html
* <p>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
com.jeequan.jeepay.mgr.mq.queue
;
import
com.alibaba.fastjson.JSONArray
;
import
com.jeequan.jeepay.core.constants.CS
;
import
com.jeequan.jeepay.mgr.mq.service.MqMchUserRemoveService
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.amqp.core.AmqpTemplate
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.context.annotation.Profile
;
import
org.springframework.stereotype.Component
;
import
java.util.Collection
;
/**
* Rabbitmq
* 商户用户信息清除
* @author xiaoyu
* @site https://www.jeepay.vip
* @date 2021/6/25 17:10
*/
@Slf4j
@Component
@Profile
(
CS
.
MQTYPE
.
RABBIT_MQ
)
public
class
RabbitMq4ModifyMchUserRemove
extends
MqMchUserRemoveService
{
@Autowired
private
AmqpTemplate
rabbitTemplate
;
@Override
public
void
send
(
Collection
<
Long
>
userIdList
)
{
if
(
userIdList
==
null
||
userIdList
.
isEmpty
()){
return
;
}
rabbitTemplate
.
convertAndSend
(
CS
.
MQ
.
QUEUE_MODIFY_MCH_USER_REMOVE
,
JSONArray
.
toJSONString
(
userIdList
));
}
}
jeepay-manager/src/main/java/com/jeequan/jeepay/mgr/mq/queue/RabbitMq4PayOrderMchNotify.java
0 → 100644
View file @
81c94049
/*
* Copyright (c) 2021-2031, 河北计全科技有限公司 (https://www.jeequan.com & jeequan@126.com).
* <p>
* Licensed under the GNU LESSER GENERAL PUBLIC LICENSE 3.0;
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* <p>
* http://www.gnu.org/licenses/lgpl.html
* <p>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
com.jeequan.jeepay.mgr.mq.queue
;
import
com.jeequan.jeepay.core.constants.CS
;
import
com.jeequan.jeepay.mgr.mq.service.MqPayOrderNotifyService
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.amqp.core.AmqpTemplate
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.context.annotation.Profile
;
import
org.springframework.stereotype.Component
;
/**
* Rabbitmq
* 商户订单回调MQ通知
* @author xiaoyu
* @site https://www.jeepay.vip
* @date 2021/6/25 17:10
*/
@Slf4j
@Component
@Profile
(
CS
.
MQTYPE
.
RABBIT_MQ
)
public
class
RabbitMq4PayOrderMchNotify
extends
MqPayOrderNotifyService
{
@Autowired
private
AmqpTemplate
rabbitTemplate
;
@Override
public
void
send
(
String
msg
)
{
rabbitTemplate
.
convertAndSend
(
CS
.
MQ
.
QUEUE_PAYORDER_MCH_NOTIFY
,
msg
);
}
}
jeepay-manager/src/main/java/com/jeequan/jeepay/mgr/mq/service/MqMchUserRemoveService.java
0 → 100644
View file @
81c94049
/*
* Copyright (c) 2021-2031, 河北计全科技有限公司 (https://www.jeequan.com & jeequan@126.com).
* <p>
* Licensed under the GNU LESSER GENERAL PUBLIC LICENSE 3.0;
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* <p>
* http://www.gnu.org/licenses/lgpl.html
* <p>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
com.jeequan.jeepay.mgr.mq.service
;
import
java.util.Collection
;
/**
* mq消息中转抽象类
*
* @author xiaoyu
* @site https://www.jeepay.vip
* @date 2021/6/25 17:10
*/
public
abstract
class
MqMchUserRemoveService
{
public
abstract
void
send
(
Collection
<
Long
>
userIdList
);
}
jeepay-manager/src/main/java/com/jeequan/jeepay/mgr/mq/service/MqModifyIsvInfoService.java
0 → 100644
View file @
81c94049
/*
* Copyright (c) 2021-2031, 河北计全科技有限公司 (https://www.jeequan.com & jeequan@126.com).
* <p>
* Licensed under the GNU LESSER GENERAL PUBLIC LICENSE 3.0;
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* <p>
* http://www.gnu.org/licenses/lgpl.html
* <p>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
com.jeequan.jeepay.mgr.mq.service
;
/**
* mq消息中转抽象类
*
* @author xiaoyu
* @site https://www.jeepay.vip
* @date 2021/6/25 17:10
*/
public
abstract
class
MqModifyIsvInfoService
{
public
abstract
void
send
(
String
msg
);
}
jeepay-manager/src/main/java/com/jeequan/jeepay/mgr/mq/service/MqModifyMchAppService.java
0 → 100644
View file @
81c94049
/*
* Copyright (c) 2021-2031, 河北计全科技有限公司 (https://www.jeequan.com & jeequan@126.com).
* <p>
* Licensed under the GNU LESSER GENERAL PUBLIC LICENSE 3.0;
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* <p>
* http://www.gnu.org/licenses/lgpl.html
* <p>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
com.jeequan.jeepay.mgr.mq.service
;
/**
* mq消息中转抽象类
*
* @author xiaoyu
* @site https://www.jeepay.vip
* @date 2021/6/25 17:10
*/
public
abstract
class
MqModifyMchAppService
{
public
abstract
void
send
(
String
mchNo
,
String
appId
);
}
jeepay-manager/src/main/java/com/jeequan/jeepay/mgr/mq/service/MqModifyMchInfoService.java
0 → 100644
View file @
81c94049
/*
* Copyright (c) 2021-2031, 河北计全科技有限公司 (https://www.jeequan.com & jeequan@126.com).
* <p>
* Licensed under the GNU LESSER GENERAL PUBLIC LICENSE 3.0;
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* <p>
* http://www.gnu.org/licenses/lgpl.html
* <p>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
com.jeequan.jeepay.mgr.mq.service
;
/**
* mq消息中转抽象类
*
* @author xiaoyu
* @site https://www.jeepay.vip
* @date 2021/6/25 17:10
*/
public
abstract
class
MqModifyMchInfoService
{
public
abstract
void
send
(
String
mchNo
);
}
Prev
1
2
3
4
Next
Write
Preview
Supports
Markdown
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