Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cloud-platform
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
youjj
cloud-platform
Commits
ce507aa1
Commit
ce507aa1
authored
Jul 20, 2019
by
libin
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'base-modify' of
http://113.105.137.151:22280/youjj/cloud-platform
into base-modify
parents
78bc69fa
4e343c6e
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
85 additions
and
2 deletions
+85
-2
RabbitConstant.java
...wxiaoqi/security/common/config/rabbit/RabbitConstant.java
+9
-0
RabbitAdminConfig.java
...thub/wxiaoqi/security/admin/config/RabbitAdminConfig.java
+4
-0
WalletMQHandler.java
...ithub/wxiaoqi/security/admin/handler/WalletMQHandler.java
+65
-0
AppPermissionService.java
...aoqi/security/admin/rpc/service/AppPermissionService.java
+7
-2
No files found.
ace-common/src/main/java/com/github/wxiaoqi/security/common/config/rabbit/RabbitConstant.java
View file @
ce507aa1
...
@@ -15,14 +15,23 @@ public class RabbitConstant {
...
@@ -15,14 +15,23 @@ public class RabbitConstant {
public
static
final
String
ORDER_TOPIC
=
ORDER
+
TOPIC_EXC
;
public
static
final
String
ORDER_TOPIC
=
ORDER
+
TOPIC_EXC
;
public
static
final
String
INTEGRAL
=
"integral"
;
public
static
final
String
INTEGRAL
=
"integral"
;
public
static
final
String
INTEGRAL_TOPIC
=
INTEGRAL
+
TOPIC_EXC
;
public
static
final
String
INTEGRAL_TOPIC
=
INTEGRAL
+
TOPIC_EXC
;
/**************************key*********************************/
/**************************key*********************************/
//用户
public
static
final
String
KEY_APPUSER_REGISTER
=
"appUser.register"
;
public
static
final
String
KEY_APPUSER_REGISTER
=
"appUser.register"
;
public
static
final
String
KEY_APPUSER_AUTH
=
"appUser.auth"
;
public
static
final
String
KEY_APPUSER_AUTH
=
"appUser.auth"
;
//积分
public
static
final
String
INTEGRAL_ROUTING_KEY
=
"integral_routing_key"
;
public
static
final
String
INTEGRAL_ROUTING_KEY
=
"integral_routing_key"
;
//订单
public
static
final
String
KEY_ORDER_PAY
=
"order.pay"
;
public
static
final
String
KEY_ORDER_PAY
=
"order.pay"
;
public
static
final
String
KEY_ORDER_FINLISH
=
"order.finlish"
;
public
static
final
String
KEY_ORDER_FINLISH
=
"order.finlish"
;
public
static
final
String
KEY_ORDER_CANCEL
=
"order.cancel"
;
public
static
final
String
KEY_ORDER_CANCEL
=
"order.cancel"
;
//钱包
public
static
final
String
KEY_WALLET_ADD
=
"wallet.add"
;
static
{
static
{
exchangeTopicSet
=
new
HashSet
<
String
>()
{{
exchangeTopicSet
=
new
HashSet
<
String
>()
{{
add
(
ADMIN_TOPIC
);
add
(
ADMIN_TOPIC
);
...
...
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/config/RabbitAdminConfig.java
View file @
ce507aa1
...
@@ -20,12 +20,16 @@ public class RabbitAdminConfig extends RabbitCommonConfig {
...
@@ -20,12 +20,16 @@ public class RabbitAdminConfig extends RabbitCommonConfig {
public
static
final
String
ORDER_WATER_QUEUE
=
"order.water.queue"
;
public
static
final
String
ORDER_WATER_QUEUE
=
"order.water.queue"
;
public
static
final
String
ORDER_FINLISH_USER_RE_QUEUE
=
"order.cancel.userRe.queue"
;
public
static
final
String
ORDER_FINLISH_USER_RE_QUEUE
=
"order.cancel.userRe.queue"
;
//钱包50入账
public
static
final
String
WALLET_ADD_QUEUE
=
"wallet.add.queue"
;
static
{
static
{
myQueue
=
new
ArrayList
<
BindDTO
>(){{
myQueue
=
new
ArrayList
<
BindDTO
>(){{
add
(
new
BindDTO
(
ORDER_WATER_QUEUE
,
ADMIN_TOPIC
,
KEY_ORDER_PAY
));
add
(
new
BindDTO
(
ORDER_WATER_QUEUE
,
ADMIN_TOPIC
,
KEY_ORDER_PAY
));
add
(
new
BindDTO
(
ORDER_WATER_QUEUE
,
ADMIN_TOPIC
,
KEY_ORDER_FINLISH
));
add
(
new
BindDTO
(
ORDER_WATER_QUEUE
,
ADMIN_TOPIC
,
KEY_ORDER_FINLISH
));
add
(
new
BindDTO
(
ORDER_WATER_QUEUE
,
ADMIN_TOPIC
,
KEY_ORDER_CANCEL
));
add
(
new
BindDTO
(
ORDER_WATER_QUEUE
,
ADMIN_TOPIC
,
KEY_ORDER_CANCEL
));
add
(
new
BindDTO
(
ORDER_FINLISH_USER_RE_QUEUE
,
ADMIN_TOPIC
,
KEY_ORDER_FINLISH
));
add
(
new
BindDTO
(
ORDER_FINLISH_USER_RE_QUEUE
,
ADMIN_TOPIC
,
KEY_ORDER_FINLISH
));
//钱包
add
(
new
BindDTO
(
WALLET_ADD_QUEUE
,
ADMIN_TOPIC
,
KEY_WALLET_ADD
));
}};
}};
}
}
}
}
...
...
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/handler/WalletMQHandler.java
0 → 100644
View file @
ce507aa1
package
com
.
github
.
wxiaoqi
.
security
.
admin
.
handler
;
import
cn.hutool.json.JSONUtil
;
import
com.github.wxiaoqi.security.admin.biz.AppUserSellingWaterBiz
;
import
com.rabbitmq.client.Channel
;
import
com.xxfc.platform.order.pojo.mq.OrderMQDTO
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.amqp.core.Message
;
import
org.springframework.amqp.rabbit.annotation.RabbitListener
;
import
org.springframework.amqp.support.AmqpHeaders
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.messaging.handler.annotation.Headers
;
import
org.springframework.stereotype.Component
;
import
java.io.IOException
;
import
java.util.Map
;
import
java.util.concurrent.ExecutorService
;
import
java.util.concurrent.Executors
;
import
static
com
.
github
.
wxiaoqi
.
security
.
admin
.
config
.
RabbitAdminConfig
.*;
@Component
@Slf4j
public
class
WalletMQHandler
{
@Autowired
AppUserSellingWaterBiz
waterBiz
;
/**
* 佣金
* @param
*/
@RabbitListener
(
queues
=
WALLET_ADD_QUEUE
)
public
void
integralHandler
(
Message
message
,
@Headers
Map
<
String
,
Object
>
headers
,
Channel
channel
)
{
ExecutorService
executorService
=
Executors
.
newCachedThreadPool
();
executorService
.
execute
(
new
Runnable
()
{
@Override
public
void
run
()
{
try
{
String
messageId
=
message
.
getMessageProperties
().
getMessageId
();
String
msg
=
new
String
(
message
.
getBody
(),
"UTF-8"
);
OrderMQDTO
orderMQDTO
=
JSONUtil
.
toBean
(
msg
,
OrderMQDTO
.
class
);
executorService
.
shutdown
();
Long
deliveryTag
=
(
Long
)
headers
.
get
(
AmqpHeaders
.
DELIVERY_TAG
);
// 手动签收
channel
.
basicAck
(
deliveryTag
,
false
);
}
catch
(
Exception
e
)
{
log
.
info
(
"接收到的消息失败"
);
try
{
channel
.
basicNack
(
message
.
getMessageProperties
().
getDeliveryTag
(),
false
,
false
);
}
catch
(
IOException
i
)
{
i
.
printStackTrace
();
}
e
.
printStackTrace
();
}
}
});
}
}
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/rpc/service/AppPermissionService.java
View file @
ce507aa1
...
@@ -215,6 +215,7 @@ public class AppPermissionService {
...
@@ -215,6 +215,7 @@ public class AppPermissionService {
@Transactional
(
rollbackFor
=
Exception
.
class
,
propagation
=
Propagation
.
REQUIRED
)
@Transactional
(
rollbackFor
=
Exception
.
class
,
propagation
=
Propagation
.
REQUIRED
)
public
JSONObject
register
(
String
username
,
String
password
,
String
headimgurl
,
public
JSONObject
register
(
String
username
,
String
password
,
String
headimgurl
,
String
nickname
,
String
mobilecode
,
String
openId
,
String
unionid
,
Integer
type
,
String
code
)
{
String
nickname
,
String
mobilecode
,
String
openId
,
String
unionid
,
Integer
type
,
String
code
)
{
log
.
info
(
"register------code====="
+
code
);
String
activityCode
=
null
;
String
activityCode
=
null
;
// 判断参数和验证码
// 判断参数和验证码
if
(
StringUtils
.
isBlank
(
username
)
||
StringUtils
.
isBlank
(
password
)
||
StringUtils
.
isBlank
(
mobilecode
))
{
if
(
StringUtils
.
isBlank
(
username
)
||
StringUtils
.
isBlank
(
password
)
||
StringUtils
.
isBlank
(
mobilecode
))
{
...
@@ -279,8 +280,12 @@ public class AppPermissionService {
...
@@ -279,8 +280,12 @@ public class AppPermissionService {
}
}
parentId
=
appUserDetailBiz
.
getUserByCode
(
code
);
parentId
=
appUserDetailBiz
.
getUserByCode
(
code
);
}
}
if
(
parentId
!=
null
&&
parentId
>
0
&&
StringUtils
.
isNotBlank
(
activityCode
)){
if
(
parentId
!=
null
&&
parentId
>
0
){
rsUserDetail
.
setInviterAccount
(
parentId
);
relationBiz
.
bindRelation
(
userid
,
parentId
,
1
);
if
(
StringUtils
.
isNotBlank
(
activityCode
)){
rsUserDetail
.
setInviterAccount
(
parentId
);
}
}
}
//生成邀请码 长度改为8 不然重复率太高
//生成邀请码 长度改为8 不然重复率太高
rsUserDetail
.
setCode
(
UUIDUtils
.
genCodes
(
8
));
rsUserDetail
.
setCode
(
UUIDUtils
.
genCodes
(
8
));
...
...
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