记得上下班打卡 | git大法好,push需谨慎
Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
liquidnet-bus-v1
Project
Project
Details
Activity
Releases
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
董敬伟
liquidnet-bus-v1
Commits
2800aca3
Commit
2800aca3
authored
Jul 02, 2021
by
张国柄
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
consumer for adam;
parent
415bb815
Changes
9
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
245 additions
and
774 deletions
+245
-774
GlobalAuthorityInterceptor.java
...quidnet/common/web/filter/GlobalAuthorityInterceptor.java
+3
-3
liquidnet-service-consumer-adam-dev.yml
.../liquidnet-config/liquidnet-service-consumer-adam-dev.yml
+1
-1
liquidnet-service-consumer-adam.yml
...nfig/liquidnet-config/liquidnet-service-consumer-adam.yml
+10
-14
pom.xml
...idnet-bus-service/liquidnet-service-consumer-adam/pom.xml
+0
-10
ServiceConsumerAdamApplication.java
...com/liquidnet/service/ServiceConsumerAdamApplication.java
+4
-16
KylinUtils.java
.../liquidnet/service/consumer/service/Utils/KylinUtils.java
+0
-179
ConsumerAdamProcessor.java
...ice/consumer/service/processor/ConsumerAdamProcessor.java
+207
-0
ConsumerProcessor.java
...service/consumer/service/processor/ConsumerProcessor.java
+0
-551
ConsumerAdamProcessorTest.java
...consumer/service/processor/ConsumerAdamProcessorTest.java
+20
-0
No files found.
liquidnet-bus-common/liquidnet-common-web/src/main/java/com/liquidnet/common/web/filter/GlobalAuthorityInterceptor.java
View file @
2800aca3
...
...
@@ -105,11 +105,11 @@ public class GlobalAuthorityInterceptor extends HandlerInterceptorAdapter {
@Override
public
void
afterCompletion
(
HttpServletRequest
request
,
HttpServletResponse
response
,
Object
handler
,
Exception
ex
)
throws
Exception
{
if
(!
StringUtils
.
equalsIgnoreCase
(
env
.
getProperty
(
ENV_ACTIVE
),
ENV_PROD
))
{
//
if (!StringUtils.equalsIgnoreCase(env.getProperty(ENV_ACTIVE), ENV_PROD)) {
Long
endTime
=
System
.
currentTimeMillis
();
Long
startTime
=
(
Long
)
request
.
getAttribute
(
"_startTime"
);
Long
startTime
=
(
Long
)
request
.
getAttribute
(
START_TIME
);
log
.
info
(
"[{}]耗时:{}s"
,
request
.
getRequestURI
(),
((
endTime
-
startTime
)
*
1.000
)
/
1000
);
}
//
}
}
private
void
responseHandler
(
HttpServletResponse
response
,
String
responseCode
)
throws
IOException
{
...
...
liquidnet-bus-config/liquidnet-config/liquidnet-service-consumer-adam-dev.yml
View file @
2800aca3
...
...
@@ -3,7 +3,7 @@ liquidnet:
updating
:
switch
:
false
info
:
port
:
9
005
port
:
9
998
context
:
# context: /service-consumer
name
:
liquidnet-service-consumer-adam
...
...
liquidnet-bus-config/liquidnet-config/liquidnet-service-consumer-adam.yml
View file @
2800aca3
...
...
@@ -101,26 +101,22 @@ spring:
codec
:
class
:
"
org.redisson.codec.JsonJacksonCodec"
transportMode
:
"
NIO"
# data:
# mongodb:
# uri: mongodb://${liquidnet.mongodb.user}:${liquidnet.mongodb.pwd}@${liquidnet.mongodb.host}/?authSource=admin&maxPoolSize=2000&waitQueueMultiple=100
# sslEnabled: ${liquidnet.mongodb.sslEnabled}
# database: ${liquidnet.mongodb.database}
datasource
:
name
:
${liquidnet.mysql.database-name}
url
:
jdbc:mysql://${liquidnet.mysql.urlHostAndPort}/${liquidnet.mysql.database-name}?serverTimezone=
UTC
&characterEncoding=utf-8&useSSL=false
url
:
jdbc:mysql://${liquidnet.mysql.urlHostAndPort}/${liquidnet.mysql.database-name}?serverTimezone=
Asia/Shanghai
&characterEncoding=utf-8&useSSL=false
username
:
${liquidnet.mysql.username}
password
:
${liquidnet.mysql.password}
# type: org.apache.tomcat.jdbc.pool.DataSource
driver-class-name
:
com.mysql.cj.jdbc.Driver
filters
:
stat
maxActive
:
20
initialSize
:
1
maxWait
:
60000
minIdle
:
1
timeBetweenEvictionRunsMillis
:
60000
minEvictableIdleTimeMillis
:
300000
validationQuery
:
select 'x'
testWhileIdle
:
true
testOnBorrow
:
false
testOnReturn
:
false
poolPreparedStatements
:
true
maxOpenPreparedStatements
:
20
hikari
:
maximum-pool-size
:
16
minimum-idle
:
8
connection-test-query
:
SELECT 1
# -----------------------------------------------------------
# -----------------------------------------------------------
liquidnet-bus-service/liquidnet-service-consumer-adam/pom.xml
View file @
2800aca3
...
...
@@ -31,16 +31,6 @@
<artifactId>
liquidnet-common-cache-redisson
</artifactId>
<version>
1.0-SNAPSHOT
</version>
</dependency>
<dependency>
<groupId>
com.liquidnet
</groupId>
<artifactId>
liquidnet-common-cache-redis
</artifactId>
<version>
1.0-SNAPSHOT
</version>
</dependency>
<dependency>
<groupId>
com.liquidnet
</groupId>
<artifactId>
liquidnet-service-kylin-api
</artifactId>
<version>
1.0-SNAPSHOT
</version>
</dependency>
</dependencies>
<build>
...
...
liquidnet-bus-service/liquidnet-service-consumer-adam/src/main/java/com/liquidnet/service/ServiceConsumerApplication.java
→
liquidnet-bus-service/liquidnet-service-consumer-adam/src/main/java/com/liquidnet/service/ServiceConsumerA
damA
pplication.java
View file @
2800aca3
...
...
@@ -4,36 +4,24 @@ import lombok.extern.slf4j.Slf4j;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.CommandLineRunner
;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.autoconfigure.EnableAutoConfiguration
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
import
org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration
;
import
org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration
;
import
org.springframework.boot.autoconfigure.mongo.MongoAutoConfiguration
;
import
org.springframework.cloud.bus.BusAutoConfiguration
;
import
org.springframework.core.env.Environment
;
import
org.springframework.jdbc.datasource.DataSourceTransactionManager
;
import
org.springframework.transaction.PlatformTransactionManager
;
import
javax.sql.DataSource
;
import
java.net.InetAddress
;
import
java.net.UnknownHostException
;
import
java.util.Arrays
;
@Slf4j
@EnableAutoConfiguration
(
exclude
=
{
BusAutoConfiguration
.
class
,
MongoAutoConfiguration
.
class
}
)
@SpringBootApplication
(
scanBasePackages
=
{
"com.liquidnet"
})
public
class
ServiceConsumerApplication
implements
CommandLineRunner
{
public
class
ServiceConsumerA
damA
pplication
implements
CommandLineRunner
{
@Autowired
private
Environment
environment
;
public
static
void
main
(
String
[]
args
)
{
SpringApplication
.
run
(
ServiceConsumerApplication
.
class
,
args
);
SpringApplication
.
run
(
ServiceConsumerA
damA
pplication
.
class
,
args
);
}
@Override
public
void
run
(
String
...
strings
)
throws
Exception
{
public
void
run
(
String
...
strings
)
{
try
{
log
.
info
(
"\n----------------------------------------------------------\n\t"
+
"Application '{}' is running! Access URLs:\n\t"
+
...
...
@@ -46,7 +34,7 @@ public class ServiceConsumerApplication implements CommandLineRunner {
environment
.
getProperty
(
"server.port"
),
environment
.
getProperty
(
"server.servlet.context-path"
),
Arrays
.
toString
(
environment
.
getActiveProfiles
()));
}
catch
(
UnknownHost
Exception
e
)
{
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
...
...
liquidnet-bus-service/liquidnet-service-consumer-adam/src/main/java/com/liquidnet/service/consumer/service/Utils/KylinUtils.java
deleted
100644 → 0
View file @
415bb815
package
com
.
liquidnet
.
service
.
consumer
.
service
.
Utils
;
import
com.liquidnet.common.cache.redis.util.RedisUtil
;
import
com.liquidnet.service.kylin.constant.KylinRedisConst
;
import
com.liquidnet.service.kylin.dto.vo.middle.KylinTicketTimesVo
;
import
com.liquidnet.service.kylin.dto.vo.middle.KylinTicketVo
;
import
com.liquidnet.service.kylin.dto.vo.mongo.KylinOrderTicketVo
;
import
com.liquidnet.service.kylin.dto.vo.mongo.KylinPerformanceVo
;
import
com.liquidnet.service.kylin.dto.vo.returns.KylinOrderListVo
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
@Component
public
class
KylinUtils
{
@Autowired
private
RedisUtil
redisUtil
;
/**
* @param userId 用户id
* @param type 1新增 2修改
* @param orderId 订单id [需要新增或者修改的订单id]
*/
public
Boolean
resetOrderListVo
(
String
userId
,
Integer
type
,
String
orderId
,
KylinOrderTicketVo
dataSingle
)
{
List
<
KylinOrderListVo
>
vo
=
new
ArrayList
<>();
List
<
KylinOrderListVo
>
redisVo
=
new
ArrayList
();
KylinOrderListVo
voItem
=
new
KylinOrderListVo
();
KylinOrderTicketVo
data
;
if
(
dataSingle
==
null
)
{
data
=
(
KylinOrderTicketVo
)
redisUtil
.
get
(
KylinRedisConst
.
ORDER
+
orderId
);
}
else
{
data
=
dataSingle
;
}
BeanUtils
.
copyProperties
(
data
,
voItem
);
List
<
KylinOrderListVo
>
redisData
=
(
List
<
KylinOrderListVo
>)
redisUtil
.
get
(
KylinRedisConst
.
ORDER_LIST
+
userId
);
if
(
type
==
1
)
{
redisVo
.
add
(
voItem
);
if
(
redisData
.
size
()
>
0
)
{
if
(
redisData
.
get
(
0
).
getOrderTicketsId
().
equals
(
orderId
))
{
redisData
.
remove
(
0
);
}
}
}
redisVo
.
addAll
(
redisData
);
switch
(
type
)
{
case
1
:
for
(
int
i
=
0
;
i
<
redisVo
.
size
();
i
++)
{
if
(
i
==
40
)
{
break
;
}
if
(
i
==
0
)
{
vo
.
add
(
voItem
);
}
else
{
vo
.
add
(
redisVo
.
get
(
i
));
}
}
if
(
redisVo
.
size
()
==
0
)
{
vo
.
add
(
voItem
);
}
redisUtil
.
set
(
KylinRedisConst
.
ORDER_LIST
+
userId
,
vo
);
return
true
;
case
2
:
for
(
int
i
=
0
;
i
<
redisVo
.
size
();
i
++)
{
if
(
i
==
40
)
{
break
;
}
if
(
redisVo
.
get
(
i
).
getOrderTicketsId
().
equals
(
orderId
))
{
vo
.
add
(
voItem
);
}
else
{
vo
.
add
(
redisVo
.
get
(
i
));
}
}
redisUtil
.
set
(
KylinRedisConst
.
ORDER_LIST
+
userId
,
vo
);
return
true
;
default
:
return
false
;
}
}
public
void
changeBuyInfo
(
String
userId
,
String
idCard
,
String
performanceId
,
String
ticketId
,
int
buyCount
)
{
String
redisKey
;
KylinPerformanceVo
vo
=
(
KylinPerformanceVo
)
redisUtil
.
get
(
KylinRedisConst
.
PERFORMANCES
+
performanceId
);
int
isTrueName
=
vo
.
getIsTrueName
();
String
useTime
=
""
;
HashMap
<
String
,
ArrayList
<
String
>>
allTicketId
=
new
HashMap
<>();
for
(
int
x
=
0
;
x
<
vo
.
getTicketTimeList
().
size
();
x
++)
{
KylinTicketTimesVo
timeItem
=
vo
.
getTicketTimeList
().
get
(
x
);
ArrayList
<
String
>
ticketList
=
new
ArrayList
<>();
for
(
int
y
=
0
;
y
<
timeItem
.
getTicketList
().
size
();
y
++)
{
KylinTicketVo
ticketItem
=
timeItem
.
getTicketList
().
get
(
y
);
if
(
ticketItem
.
getType
()
==
1
)
{
ticketList
.
add
(
ticketItem
.
getTicketsId
());
}
if
(
ticketItem
.
getTicketsId
().
equals
(
ticketId
))
{
useTime
=
ticketItem
.
getUseStart
();
}
}
allTicketId
.
put
(
timeItem
.
getUseStart
(),
ticketList
);
}
if
(
0
==
isTrueName
)
{
redisKey
=
KylinRedisConst
.
USERID_BUY_INFO
+
userId
;
}
else
{
redisKey
=
KylinRedisConst
.
IDCARD_BUY_INFO
+
idCard
;
}
String
performanceIdKey
=
redisKey
+
":"
+
KylinRedisConst
.
PERFORMANCE_ID
+
":"
+
performanceId
;
String
ticketIdKey
=
redisKey
+
":"
+
KylinRedisConst
.
TICKET_ID
+
":"
+
ticketId
;
String
ticketUseTimeKey
=
ticketIdKey
+
":"
+
KylinRedisConst
.
USE_TIME
;
redisUtil
.
set
(
ticketUseTimeKey
,
useTime
);
if
(
buyCount
>
0
)
{
redisUtil
.
incr
(
ticketIdKey
,
buyCount
);
redisUtil
.
incr
(
performanceIdKey
,
buyCount
);
}
else
{
redisUtil
.
decr
(
ticketIdKey
,
Math
.
abs
(
buyCount
));
redisUtil
.
decr
(
performanceIdKey
,
Math
.
abs
(
buyCount
));
}
// if (buyCount > 0) {
// redisUtil.incr(ticketIdKey, buyCount);
// if (1 == ticketType) {
// int count = 0;
// for (int i = 0; i < allTicketId.get(useTime).size(); i++) {
// String item = allTicketId.get(useTime).get(i);
// if (allTicketId.get(useTime).size() == 1) {
// redisUtil.incr(performanceIdKey, buyCount);
// break;
// }
// if (null == redisUtil.get(redisKey + ":" + KylinRedisConst.TICKET_ID + ":" + item)) {
// redisUtil.set(redisKey + ":" + KylinRedisConst.TICKET_ID + ":" + item, 0);
// }
// if (i == 0) {
// count = (int) redisUtil.get(redisKey + ":" + KylinRedisConst.TICKET_ID + ":" + item);
// } else {
// if (count != (int) redisUtil.get(redisKey + ":" + KylinRedisConst.TICKET_ID + ":" + item)) {
// redisUtil.incr(performanceIdKey, buyCount);
// break;
// }
// }
// }
// } else {
// redisUtil.incr(performanceIdKey, buyCount);
// }
// } else {
// redisUtil.decr(ticketIdKey, Math.abs(buyCount));
// if (1 == ticketType) {
// int count = 0;
// for (int i = 0; i < allTicketId.get(useTime).size(); i++) {
// String item = allTicketId.get(useTime).get(i);
// if (allTicketId.get(useTime).size() == 1) {
// redisUtil.decr(performanceIdKey, Math.abs(buyCount));
// break;
// }
// if (null == redisUtil.get(redisKey + ":" + KylinRedisConst.TICKET_ID + ":" + item)) {
// redisUtil.set(redisKey + ":" + KylinRedisConst.TICKET_ID + ":" + item, 0);
// }
// if (i == 0) {
// count = (int) redisUtil.get(redisKey + ":" + KylinRedisConst.TICKET_ID + ":" + item);
// } else {
// if (count != (int) redisUtil.get(redisKey + ":" + KylinRedisConst.TICKET_ID + ":" + item)) {
// redisUtil.decr(performanceIdKey, Math.abs(buyCount));
// break;
// }
// }
// }
// } else {
// redisUtil.decr(performanceIdKey, Math.abs(buyCount));
// }
// }
}
}
liquidnet-bus-service/liquidnet-service-consumer-adam/src/main/java/com/liquidnet/service/consumer/service/processor/ConsumerAdamProcessor.java
0 → 100644
View file @
2800aca3
package
com
.
liquidnet
.
service
.
consumer
.
service
.
processor
;
import
com.liquidnet.common.cache.redis.util.RedisUtil
;
import
com.liquidnet.common.mq.constant.MQConst
;
import
com.liquidnet.commons.lang.util.JsonUtils
;
import
com.liquidnet.service.base.SqlMapping
;
import
com.liquidnet.service.consumer.service.IBaseDao
;
import
com.rabbitmq.client.Channel
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.amqp.core.Message
;
import
org.springframework.amqp.core.MessageProperties
;
import
org.springframework.amqp.rabbit.annotation.Exchange
;
import
org.springframework.amqp.rabbit.annotation.Queue
;
import
org.springframework.amqp.rabbit.annotation.QueueBinding
;
import
org.springframework.amqp.rabbit.annotation.RabbitListener
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
javax.annotation.Resource
;
import
java.io.IOException
;
/**
* ConsumerAdamProcessor.class
*
* @author zhanggb
* Created by IntelliJ IDEA at 2021/4/29
*/
@Slf4j
@Component
public
class
ConsumerAdamProcessor
{
@Resource
IBaseDao
baseDao
;
@Autowired
RedisUtil
redisUtil
;
// @RabbitListener(bindings = @QueueBinding(
// exchange = @Exchange(MQConst.EXCHANGES_LIQUIDNET_SQL), key = MQConst.ROUTING_KEY_SQL,
// value = @Queue(MQConst.QUEUES_SQL_MAIN)
// ))
//// @RabbitListener(queues = MQConst.QUEUES_SQL_MAIN)
// public void consumerSql(Message msg, Channel channel) {
// SqlMapping.SqlMessage sqlMessage = JsonUtils.fromJson(new String(msg.getBody()), SqlMapping.SqlMessage.class);
// log.debug("CONSUMER SQL ==> Preparing:{}", JsonUtils.toJson(sqlMessage.getSqls()));
// log.debug("CONSUMER SQL ==> Parameters:{}", JsonUtils.toJson(sqlMessage.getArgs()));
//
// try {
// Boolean rstBatchSqls = baseDao.batchSqls(sqlMessage.getSqls(), sqlMessage.getArgs());
// log.debug("CONSUMER SQL result of execution:{}", rstBatchSqls);
// if (rstBatchSqls) {
// channel.basicAck(msg.getMessageProperties().getDeliveryTag(), false);
// } else {
// channel.basicReject(msg.getMessageProperties().getDeliveryTag(), true);
// }
// } catch (Exception e) {
// log.error("error:CONSUMER SQL:{}", JsonUtils.toJson(sqlMessage), e);
// try {
// channel.basicReject(msg.getMessageProperties().getDeliveryTag(), true);
// } catch (IOException ioException) {
// log.error("error:CONSUMER SQL:basicReject.msg.tag:{}", msg.getMessageProperties().getDeliveryTag(), ioException);
// }
// }
// }
private
void
consumerSqlDaoHandler
(
Message
msg
,
Channel
channel
)
{
MessageProperties
properties
=
msg
.
getMessageProperties
();
String
queue
=
properties
.
getConsumerQueue
();
long
tag
=
properties
.
getDeliveryTag
();
log
.
info
(
"CONSUMER SQL ==> [consumerQueue:{},deliveryTag:{}]"
,
queue
,
tag
);
SqlMapping
.
SqlMessage
sqlMessage
=
JsonUtils
.
fromJson
(
new
String
(
msg
.
getBody
()),
SqlMapping
.
SqlMessage
.
class
);
log
.
debug
(
"CONSUMER SQL ==> Preparing:{}"
,
JsonUtils
.
toJson
(
sqlMessage
.
getSqls
()));
log
.
debug
(
"CONSUMER SQL ==> Parameters:{}"
,
JsonUtils
.
toJson
(
sqlMessage
.
getArgs
()));
try
{
Boolean
rstBatchSqls
=
baseDao
.
batchSqls
(
sqlMessage
.
getSqls
(),
sqlMessage
.
getArgs
());
log
.
debug
(
"CONSUMER SQL result of execution:{}"
,
rstBatchSqls
);
if
(
rstBatchSqls
)
{
channel
.
basicAck
(
tag
,
false
);
}
else
{
String
rk
=
queue
+
":"
+
tag
;
if
(
redisUtil
.
incr
(
rk
,
1
)
>=
3
)
{
log
.
warn
(
"###CONSUMER SQL[consumerQueue:{},deliveryTag={},sqlMessage:{}]"
,
queue
,
tag
,
JsonUtils
.
toJson
(
sqlMessage
));
channel
.
basicAck
(
tag
,
false
);
redisUtil
.
expire
(
rk
,
600
);
}
else
{
channel
.
basicReject
(
tag
,
true
);
}
}
}
catch
(
IOException
e
)
{
log
.
error
(
"CONSUMER SQL[consumerQueue:{},deliveryTag:{},sqlMessage:{}]"
,
queue
,
tag
,
JsonUtils
.
toJson
(
sqlMessage
),
e
);
}
}
/* ================================================================== | 用户注册 */
@RabbitListener
(
bindings
=
@QueueBinding
(
exchange
=
@Exchange
(
MQConst
.
EX_LNS_SQL_UCENTER
),
key
=
MQConst
.
RK_SQL_UREGISTER
,
value
=
@Queue
(
MQConst
.
QUEUES_SQL_UREGISTER
)
))
public
void
consumerSqlForURegisterA
(
Message
msg
,
Channel
channel
)
{
this
.
consumerSqlDaoHandler
(
msg
,
channel
);
}
@RabbitListener
(
bindings
=
@QueueBinding
(
exchange
=
@Exchange
(
MQConst
.
EX_LNS_SQL_UCENTER
),
key
=
MQConst
.
RK_SQL_UREGISTER
,
value
=
@Queue
(
MQConst
.
QUEUES_SQL_UREGISTER
)
))
public
void
consumerSqlForURegisterB
(
Message
msg
,
Channel
channel
)
{
this
.
consumerSqlDaoHandler
(
msg
,
channel
);
}
@RabbitListener
(
bindings
=
@QueueBinding
(
exchange
=
@Exchange
(
MQConst
.
EX_LNS_SQL_UCENTER
),
key
=
MQConst
.
RK_SQL_UREGISTER
,
value
=
@Queue
(
MQConst
.
QUEUES_SQL_UREGISTER
)
))
public
void
consumerSqlForURegisterC
(
Message
msg
,
Channel
channel
)
{
this
.
consumerSqlDaoHandler
(
msg
,
channel
);
}
@RabbitListener
(
bindings
=
@QueueBinding
(
exchange
=
@Exchange
(
MQConst
.
EX_LNS_SQL_UCENTER
),
key
=
MQConst
.
RK_SQL_UREGISTER
,
value
=
@Queue
(
MQConst
.
QUEUES_SQL_UREGISTER
)
))
public
void
consumerSqlForURegisterD
(
Message
msg
,
Channel
channel
)
{
this
.
consumerSqlDaoHandler
(
msg
,
channel
);
}
@RabbitListener
(
bindings
=
@QueueBinding
(
exchange
=
@Exchange
(
MQConst
.
EX_LNS_SQL_UCENTER
),
key
=
MQConst
.
RK_SQL_UREGISTER
,
value
=
@Queue
(
MQConst
.
QUEUES_SQL_UREGISTER
)
))
public
void
consumerSqlForURegisterE
(
Message
msg
,
Channel
channel
)
{
this
.
consumerSqlDaoHandler
(
msg
,
channel
);
}
/* ================================================================== | 用户信息 */
@RabbitListener
(
bindings
=
@QueueBinding
(
exchange
=
@Exchange
(
MQConst
.
EX_LNS_SQL_UCENTER
),
key
=
MQConst
.
RK_SQL_UCENTER
,
value
=
@Queue
(
MQConst
.
QUEUES_SQL_UCENTER
)
))
public
void
consumerSqlForUCenterA
(
Message
msg
,
Channel
channel
)
{
this
.
consumerSqlDaoHandler
(
msg
,
channel
);
}
@RabbitListener
(
bindings
=
@QueueBinding
(
exchange
=
@Exchange
(
MQConst
.
EX_LNS_SQL_UCENTER
),
key
=
MQConst
.
RK_SQL_UCENTER
,
value
=
@Queue
(
MQConst
.
QUEUES_SQL_UCENTER
)
))
public
void
consumerSqlForUCenterB
(
Message
msg
,
Channel
channel
)
{
this
.
consumerSqlDaoHandler
(
msg
,
channel
);
}
@RabbitListener
(
bindings
=
@QueueBinding
(
exchange
=
@Exchange
(
MQConst
.
EX_LNS_SQL_UCENTER
),
key
=
MQConst
.
RK_SQL_UCENTER
,
value
=
@Queue
(
MQConst
.
QUEUES_SQL_UCENTER
)
))
public
void
consumerSqlForUCenterC
(
Message
msg
,
Channel
channel
)
{
this
.
consumerSqlDaoHandler
(
msg
,
channel
);
}
@RabbitListener
(
bindings
=
@QueueBinding
(
exchange
=
@Exchange
(
MQConst
.
EX_LNS_SQL_UCENTER
),
key
=
MQConst
.
RK_SQL_UCENTER
,
value
=
@Queue
(
MQConst
.
QUEUES_SQL_UCENTER
)
))
public
void
consumerSqlForUCenterD
(
Message
msg
,
Channel
channel
)
{
this
.
consumerSqlDaoHandler
(
msg
,
channel
);
}
@RabbitListener
(
bindings
=
@QueueBinding
(
exchange
=
@Exchange
(
MQConst
.
EX_LNS_SQL_UCENTER
),
key
=
MQConst
.
RK_SQL_UCENTER
,
value
=
@Queue
(
MQConst
.
QUEUES_SQL_UCENTER
)
))
public
void
consumerSqlForUCenterE
(
Message
msg
,
Channel
channel
)
{
this
.
consumerSqlDaoHandler
(
msg
,
channel
);
}
/* ================================================================== | 会员购买 */
@RabbitListener
(
bindings
=
@QueueBinding
(
exchange
=
@Exchange
(
MQConst
.
EX_LNS_SQL_UCENTER
),
key
=
MQConst
.
RK_SQL_UMEMBER
,
value
=
@Queue
(
MQConst
.
QUEUES_SQL_UMEMBER
)
))
public
void
consumerSqlForUMemberA
(
Message
msg
,
Channel
channel
)
{
this
.
consumerSqlDaoHandler
(
msg
,
channel
);
}
@RabbitListener
(
bindings
=
@QueueBinding
(
exchange
=
@Exchange
(
MQConst
.
EX_LNS_SQL_UCENTER
),
key
=
MQConst
.
RK_SQL_UMEMBER
,
value
=
@Queue
(
MQConst
.
QUEUES_SQL_UMEMBER
)
))
public
void
consumerSqlForUMemberB
(
Message
msg
,
Channel
channel
)
{
this
.
consumerSqlDaoHandler
(
msg
,
channel
);
}
@RabbitListener
(
bindings
=
@QueueBinding
(
exchange
=
@Exchange
(
MQConst
.
EX_LNS_SQL_UCENTER
),
key
=
MQConst
.
RK_SQL_UMEMBER
,
value
=
@Queue
(
MQConst
.
QUEUES_SQL_UMEMBER
)
))
public
void
consumerSqlForUMemberC
(
Message
msg
,
Channel
channel
)
{
this
.
consumerSqlDaoHandler
(
msg
,
channel
);
}
@RabbitListener
(
bindings
=
@QueueBinding
(
exchange
=
@Exchange
(
MQConst
.
EX_LNS_SQL_UCENTER
),
key
=
MQConst
.
RK_SQL_UMEMBER
,
value
=
@Queue
(
MQConst
.
QUEUES_SQL_UMEMBER
)
))
public
void
consumerSqlForUMemberD
(
Message
msg
,
Channel
channel
)
{
this
.
consumerSqlDaoHandler
(
msg
,
channel
);
}
@RabbitListener
(
bindings
=
@QueueBinding
(
exchange
=
@Exchange
(
MQConst
.
EX_LNS_SQL_UCENTER
),
key
=
MQConst
.
RK_SQL_UMEMBER
,
value
=
@Queue
(
MQConst
.
QUEUES_SQL_UMEMBER
)
))
public
void
consumerSqlForUMemberE
(
Message
msg
,
Channel
channel
)
{
this
.
consumerSqlDaoHandler
(
msg
,
channel
);
}
/* ================================================================== | */
}
liquidnet-bus-service/liquidnet-service-consumer-adam/src/main/java/com/liquidnet/service/consumer/service/processor/ConsumerProcessor.java
deleted
100644 → 0
View file @
415bb815
This diff is collapsed.
Click to expand it.
liquidnet-bus-service/liquidnet-service-consumer-adam/src/test/java/com/liquidnet/service/consumer/service/processor/ConsumerAdamProcessorTest.java
0 → 100644
View file @
2800aca3
package
com
.
liquidnet
.
service
.
consumer
.
service
.
processor
;
import
org.junit.jupiter.api.Test
;
import
org.junit.runner.RunWith
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.test.context.SpringBootTest
;
import
org.springframework.test.context.junit4.SpringJUnit4ClassRunner
;
@RunWith
(
SpringJUnit4ClassRunner
.
class
)
@SpringBootTest
public
class
ConsumerAdamProcessorTest
{
@Autowired
ConsumerAdamProcessor
consumerAdamProcessor
;
@Test
public
void
test
()
{
String
msg
=
"{\"sqls\":[\"INSERT INTO kylin_order_tickets(order_tickets_id,user_id,user_name,user_mobile,performance_title,order_code,qr_code,order_type,order_version,number,price,price_member,price_total,price_voucher,price_actual,price_express,price_refund,refund_number,pay_type,payment_type,time_pay,express_contacts,express_address,express_phone,coupon_type,get_ticket_type,get_ticket_describe,pay_countdown_minute,`comment`,created_at,updated_at)VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)\",\"INSERT INTO kylin_order_ticket_status(order_ticket_status_id ,order_id ,express_type ,is_student ,transfer_status ,`status` ,pay_status ,created_at ,updated_at)VALUES(?,?,?,?,?,?,?,?,?)\",\"INSERT INTO kylin_order_ticket_relations(order_ticket_relations_id ,order_id ,transfer_id ,live_id ,agent_id ,is_member ,performance_id ,time_id,ticket_id ,created_at ,updated_at)VALUES(?,?,?,?,?,?,?,?,?,?,?)\",\"INSERT INTO kylin_order_ticket_entities(order_ticket_entities_id ,order_id ,ticket_id ,user_id ,time_id ,performance_id ,enter_type ,enter_name ,enter_mobile,enter_id_code,`status`,sys_damai,check_client,is_payment,`comment`,created_at,updated_at)VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)\"],\"args\":[[[\"73901653639766016\",\"73459712083042304\",\"\",\"15001268203\",\"0607演出0607\",\"T7390165363976516260\",\"\",\"\",\"\",1,0.01,0.01,0.01,0.0,0.01,0.00,0.0,0,\"alipay\",null,null,\"\",\"\",\"\",\"no\",\"electronic\",\"\",5,null,\"2021-06-07T22:18:47.264\",null]],[[\"73901653694291968\",\"73901653639766016\",2,0,0,0,0,\"2021-06-07T22:18:47.267\",null]],[[\"73901653694291969\",\"73901653639766016\",\"\",\"\",\"0\",0,\"73776030099382272\",\"73776073304907776\",\"73776225042243584\",\"2021-06-07T22:18:47.267\",null]],[[\"73901653694291970\",\"73901653639766016\",\"73776225042243584\",\"73459712083042304\",\"73776073304907776\",\"73776030099382272\",0,\"\",\"\",\"\",0,0,\"\",0,\"\",\"2021-06-07T22:18:47.267\",null]]]}"
;
// consumerAdamProcessor.consumerSqlForUCenterA(null, null);
}
}
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