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
a6794c9d
Commit
a6794c9d
authored
Jul 19, 2019
by
hezhen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改文件
parent
85170e22
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
84 additions
and
17 deletions
+84
-17
AppUserRelationBiz.java
...github/wxiaoqi/security/admin/biz/AppUserRelationBiz.java
+9
-0
RabbitAdminConfig.java
...thub/wxiaoqi/security/admin/config/RabbitAdminConfig.java
+7
-2
IntegralMQHandler.java
...hub/wxiaoqi/security/admin/handler/IntegralMQHandler.java
+19
-1
AppPermissionService.java
...aoqi/security/admin/rpc/service/AppPermissionService.java
+49
-14
No files found.
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/biz/AppUserRelationBiz.java
View file @
a6794c9d
...
...
@@ -76,6 +76,15 @@ public class AppUserRelationBiz extends BaseBiz<AppUserRelationMapper,AppUserRel
}
}
}
//永久稳定关系
public
void
foreverBind
(
Integer
user_id
){
AppUserRelation
relation
=
getMyBiz
().
getRelationByUserId
(
user_id
);
if
(
relation
!=
null
&&
relation
.
getIsForever
()==
0
){
relation
.
setIsForever
(
1
);
getMyBiz
().
updRelation
(
relation
);
}
}
/**
* 小程序分享上下线绑定
...
...
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/config/RabbitAdminConfig.java
View file @
a6794c9d
...
...
@@ -22,9 +22,14 @@ import java.util.Map;
public
class
RabbitAdminConfig
extends
RabbitCommonConfig
{
public
static
final
String
ORDER_WATER_QUEUE
=
"order.water.queue"
;
public
static
final
String
ORDER_FINLISH_user_re_QUEUE
=
"order.cancel.userRe.queue"
;
static
{
myQueue
=
new
ArrayList
<
BindDTO
>(){{
add
(
new
BindDTO
(
ORDER_WATER_QUEUE
,
RabbitConstant
.
ADMIN_TOPIC
,
"order.#"
));
add
(
new
BindDTO
(
ORDER_WATER_QUEUE
,
RabbitConstant
.
ADMIN_TOPIC
,
"order.pay"
));
add
(
new
BindDTO
(
ORDER_WATER_QUEUE
,
RabbitConstant
.
ADMIN_TOPIC
,
"order.finlish"
));
add
(
new
BindDTO
(
ORDER_WATER_QUEUE
,
RabbitConstant
.
ADMIN_TOPIC
,
"order.cancel"
));
add
(
new
BindDTO
(
ORDER_FINLISH_user_re_QUEUE
,
RabbitConstant
.
ADMIN_TOPIC
,
"order.finlish"
));
}};
}
}
...
...
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/handler/IntegralMQHandler.java
View file @
a6794c9d
...
...
@@ -10,16 +10,19 @@ import org.springframework.amqp.rabbit.annotation.RabbitListener;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
static
com
.
github
.
wxiaoqi
.
security
.
admin
.
config
.
RabbitAdminConfig
.*;
@Component
@Slf4j
public
class
IntegralMQHandler
{
@Autowired
AppUserSellingWaterBiz
waterBiz
;
@RabbitListener
(
queues
=
RabbitAdminConfig
.
ORDER_WATER_QUEUE
)
@RabbitListener
(
queues
=
ORDER_WATER_QUEUE
)
public
void
integralHandler
(
String
json
)
{
log
.
info
(
"接收到的消息:json = {}"
,
json
);
try
{
OrderWaterDTO
orderWaterDTO
=
JSONObject
.
parseObject
(
json
,
OrderWaterDTO
.
class
);
waterBiz
.
orderWater
(
orderWaterDTO
);
}
catch
(
Exception
e
){
...
...
@@ -28,4 +31,19 @@ public class IntegralMQHandler {
}
}
@RabbitListener
(
queues
=
{
ORDER_FINLISH_user_re_QUEUE
})
public
void
integralHandler2
(
String
json
)
{
log
.
info
(
"接收到的消息:json = {}"
,
json
);
try
{
OrderWaterDTO
orderWaterDTO
=
JSONObject
.
parseObject
(
json
,
OrderWaterDTO
.
class
);
waterBiz
.
orderWater
(
orderWaterDTO
);
}
catch
(
Exception
e
){
log
.
info
(
"接收到的消息失败"
);
e
.
printStackTrace
();
}
}
}
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/rpc/service/AppPermissionService.java
View file @
a6794c9d
...
...
@@ -287,10 +287,10 @@ public class AppPermissionService {
rsUserDetail
.
setCode
(
UUIDUtils
.
genCodes
(
8
));
appUserDetailBiz
.
insertSelective
(
rsUserDetail
);
log
.
error
(
"注册:新增用户详情: "
+
userid
);
//绑定上下线关系
/*
//绑定上下线关系
if(parentId!=null&&parentId>0){
relationBiz.bindRelation(userid,parentId,1);
}
}
*/
//临时会员绑定
insertUserMemberByUserIdAndPhone
(
userid
,
username
);
//参加新人活动
...
...
@@ -298,7 +298,7 @@ public class AppPermissionService {
//创建钱包
walletBiz
.
createWalletByUserId
(
appUserLogin
.
getId
());
// 登录结果要做做统一处理
JSONObject
data
=
autoLogin
(
userid
,
username
,
headimgurl
,
nickname
);
JSONObject
data
=
autoLogin
(
userid
,
username
,
headimgurl
,
nickname
,
code
);
// 到im注册,获取返回结果
Map
<
String
,
Object
>
map
=
registerIm
(
username
,
appUserLogin
.
getPassword
(),
nickname
);
if
(
map
!=
null
)
{
...
...
@@ -318,7 +318,7 @@ public class AppPermissionService {
data
.
put
(
"imUserId"
,
imUserId
);
}
if
(
data
!=
null
)
{
sendQueue
(
username
,
password
,
headimgurl
,
nickname
,
mobilecode
,
openId
,
unionid
,
type
,
code
,
activityCode
,
userid
);
sendQueue
(
username
,
password
,
headimgurl
,
nickname
,
mobilecode
,
openId
,
unionid
,
type
,
code
,
activityCode
,
userid
,
RegisterQueueDTO
.
SIGN_NEW
);
return
JsonResultUtil
.
createSuccessResultWithObj
(
data
);
}
else
{
return
JsonResultUtil
.
createDefaultFail
();
...
...
@@ -329,12 +329,13 @@ public class AppPermissionService {
}
}
private
void
sendQueue
(
String
username
,
String
password
,
String
headimgurl
,
String
nickname
,
String
mobilecode
,
String
openId
,
String
unionid
,
Integer
type
,
String
code
,
String
activityCode
,
Integer
userid
)
{
private
void
sendQueue
(
String
username
,
String
password
,
String
headimgurl
,
String
nickname
,
String
mobilecode
,
String
openId
,
String
unionid
,
Integer
type
,
String
code
,
String
activityCode
,
Integer
userid
,
Integer
sign
)
{
try
{
RegisterQueueDTO
registerQueueDTO
=
new
RegisterQueueDTO
();
//出参
// registerQueueDTO.setData(data);
registerQueueDTO
.
setAppUserId
(
userid
);
registerQueueDTO
.
setSign
(
sign
);
//入参
registerQueueDTO
.
setInParamDTO
(
new
RegisterParamDTO
(
username
,
password
,
headimgurl
,
nickname
,
mobilecode
,
openId
,
unionid
,
type
,
code
,
activityCode
));
...
...
@@ -348,7 +349,7 @@ public class AppPermissionService {
/**
* 自动登录
*/
public
JSONObject
autoLogin
(
Integer
userid
,
String
username
,
String
headimgurl
,
String
nickname
)
{
public
JSONObject
autoLogin
(
Integer
userid
,
String
username
,
String
headimgurl
,
String
nickname
,
String
code
)
{
JSONObject
data
=
new
JSONObject
();
AppUserVo
userVo
=
appUserDetailBiz
.
getUserInfoById
(
userid
);
if
(
userVo
!=
null
)
{
...
...
@@ -375,6 +376,39 @@ public class AppPermissionService {
//更新登录时间 和 ip
String
clientIp
=
getIp
();
appUserLoginBiz
.
updateLoginInfo
(
userid
,
clientIp
);
try
{
String
code1
=
null
;
String
activityCode
=
null
;
if
(
StringUtils
.
isNotBlank
(
code
)){
//判断处理活动关键字
String
[]
codes
=
code
.
split
(
"_"
);
if
(
codes
.
length
>
1
)
{
code1
=
codes
[
0
];
activityCode
=
codes
[
1
];
}
}
if
(
StringUtils
.
isNotBlank
(
code1
)){
Integer
parentId
=
appUserDetailBiz
.
getUserByCode
(
code1
);
//绑定上下线关系
if
(
parentId
!=
null
&&
parentId
>
0
)
{
relationBiz
.
bindRelation
(
userid
,
parentId
,
1
);
}
//活动消息
Integer
state
=
userVo
.
getState
();
if
(
state
!=
null
&&
state
==
1
&&
StringUtils
.
isNotBlank
(
activityCode
)){
if
(
userVo
.
getInviterAccount
()==
null
||
userVo
.
getInviterAccount
()==
0
){
userVo
.
setInviterAccount
(
parentId
);
}
userVo
.
setState
(
2
);
appUserDetailBiz
.
updUuserInfoById
(
userVo
);
sendQueue
(
username
,
null
,
headimgurl
,
nickname
,
null
,
null
,
null
,
null
,
code1
,
activityCode
,
userid
,
RegisterQueueDTO
.
SIGN_ACTIVATE
);
}
}
}
catch
(
Exception
e
){
e
.
printStackTrace
();
}
}
...
...
@@ -469,7 +503,7 @@ public class AppPermissionService {
appUserDetailBiz.updateSelectiveById(userDetail);
}*/
// 登录结果要做做统一处理
JSONObject
data
=
autoLogin
(
userid
,
username
,
headimgurl
,
nickname
);
JSONObject
data
=
autoLogin
(
userid
,
username
,
headimgurl
,
nickname
,
code
);
// 到im登录,获取返回结果
/*Integer imUserId=userLogin.getImUserid();
String imPassword=userLogin.getImPassword();
...
...
@@ -537,7 +571,7 @@ public class AppPermissionService {
* @return
*/
@Transactional
public
JSONObject
weCahtLogin
(
String
openId
,
Integer
isQQ
)
{
public
JSONObject
weCahtLogin
(
String
openId
,
Integer
isQQ
,
String
code
)
{
if
(
StringUtils
.
isBlank
(
openId
))
{
return
JsonResultUtil
.
createFailedResult
(
ResultCode
.
NULL_CODE
,
"参数为空"
);
}
...
...
@@ -556,7 +590,7 @@ public class AppPermissionService {
headimgurl
=
userVo
.
getHeadimgurl
();
nickname
=
userVo
.
getNickname
();
}
JSONObject
data
=
autoLogin
(
userid
,
userLogin
.
getUsername
(),
headimgurl
,
nickname
);
JSONObject
data
=
autoLogin
(
userid
,
userLogin
.
getUsername
(),
headimgurl
,
nickname
,
code
);
/* // 到im注册,获取返回结果
Integer imUserId=userLogin.getImUserid();
String imPassword=userLogin.getImPassword();
...
...
@@ -571,7 +605,7 @@ public class AppPermissionService {
return
JsonResultUtil
.
createDefaultFail
();
}
public
JSONObject
login
(
String
username
,
String
password
,
String
mobilecode
,
int
type
)
{
public
JSONObject
login
(
String
username
,
String
password
,
String
mobilecode
,
int
type
,
String
code
)
{
if
(
StringUtils
.
isBlank
(
username
)
||
((
StringUtils
.
isBlank
(
password
)
&&
type
==
1
)
||
(
StringUtils
.
isBlank
(
mobilecode
)
&&
type
==
2
)))
{
return
JsonResultUtil
.
createFailedResult
(
ResultCode
.
NULL_CODE
,
"请求参数为空"
);
}
...
...
@@ -598,7 +632,7 @@ public class AppPermissionService {
}
Integer
userid
=
user
.
getId
();
String
nickname
=
SystemConfig
.
USER_NIKENAME_DEFAULT
+
(
int
)
((
Math
.
random
()
*
9
+
1
)
*
100000
);
JSONObject
data
=
autoLogin
(
userid
,
user
.
getUsername
(),
SystemConfig
.
USER_HEADER_URL_DEFAULT
,
nickname
);
JSONObject
data
=
autoLogin
(
userid
,
user
.
getUsername
(),
SystemConfig
.
USER_HEADER_URL_DEFAULT
,
nickname
,
code
);
/*// 到im注册,获取返回结果
Integer imUserId=user.getImUserid();
String imPassword=user.getImPassword();
...
...
@@ -639,7 +673,7 @@ public class AppPermissionService {
appUserLoginBiz
.
updatePasswordById
(
user
);
Integer
userid
=
user
.
getId
();
String
nickname
=
SystemConfig
.
USER_NIKENAME_DEFAULT
+
(
int
)
((
Math
.
random
()
*
9
+
1
)
*
100000
);
JSONObject
data
=
autoLogin
(
userid
,
user
.
getUsername
(),
SystemConfig
.
USER_HEADER_URL_DEFAULT
,
nickname
);
JSONObject
data
=
autoLogin
(
userid
,
user
.
getUsername
(),
SystemConfig
.
USER_HEADER_URL_DEFAULT
,
nickname
,
null
);
/* // 到im登录,获取返回结果
Integer imUserId=user.getImUserid();
String imPassword=user.getImPassword();
...
...
@@ -793,7 +827,7 @@ public class AppPermissionService {
* @return
*/
public
JSONObject
appletLoginByUserId
(
Integer
uid
)
{
JSONObject
data
=
autoLogin
(
uid
,
null
,
null
,
null
);
JSONObject
data
=
autoLogin
(
uid
,
null
,
null
,
null
,
null
);
if
(
data
.
getDate
(
"userId"
)
!=
null
)
{
return
JsonResultUtil
.
createSuccessResultWithObj
(
data
);
}
...
...
@@ -847,6 +881,7 @@ public class AppPermissionService {
rsUserDetail
.
setChannel
(
UserSourceEnum
.
APPLET
.
getCode
());
rsUserDetail
.
setCrtHost
(
getIp
());
setCreateIPInfo
(
rsUserDetail
);
rsUserDetail
.
setState
(
1
);
appUserDetailBiz
.
insertSelective
(
rsUserDetail
);
log
.
error
(
"注册:新增用户详情: "
+
userid
);
//创建钱包
...
...
@@ -860,7 +895,7 @@ public class AppPermissionService {
//参加新人活动
jionActivity
(
userid
);
// 登录结果要做做统一处理
JSONObject
data
=
autoLogin
(
userid
,
username
,
headimgurl
,
nickname
);
JSONObject
data
=
autoLogin
(
userid
,
username
,
headimgurl
,
nickname
,
null
);
// 到im注册,获取返回结果
Map
<
String
,
Object
>
map
=
registerIm
(
username
,
appUserLogin
.
getPassword
(),
nickname
);
if
(
map
!=
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