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
06453fa3
Commit
06453fa3
authored
Dec 19, 2019
by
hezhen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
123
parent
7722e325
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
46 additions
and
5 deletions
+46
-5
AppUserRelationBiz.java
...github/wxiaoqi/security/admin/biz/AppUserRelationBiz.java
+7
-0
AppPermissionService.java
...aoqi/security/admin/rpc/service/AppPermissionService.java
+39
-5
No files found.
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/biz/AppUserRelationBiz.java
View file @
06453fa3
...
@@ -21,6 +21,8 @@ import org.springframework.beans.factory.annotation.Value;
...
@@ -21,6 +21,8 @@ import org.springframework.beans.factory.annotation.Value;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
com.github.wxiaoqi.security.admin.mapper.AppUserRelationMapper
;
import
com.github.wxiaoqi.security.admin.mapper.AppUserRelationMapper
;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
org.springframework.transaction.annotation.Propagation
;
import
org.springframework.transaction.annotation.Transactional
;
import
tk.mybatis.mapper.entity.Example
;
import
tk.mybatis.mapper.entity.Example
;
import
java.util.*
;
import
java.util.*
;
...
@@ -76,8 +78,11 @@ public class AppUserRelationBiz extends BaseBiz<AppUserRelationMapper, AppUserRe
...
@@ -76,8 +78,11 @@ public class AppUserRelationBiz extends BaseBiz<AppUserRelationMapper, AppUserRe
return
false
;
return
false
;
}
}
private
boolean
parentLock
(
Integer
userId
)
{
private
boolean
parentLock
(
Integer
userId
)
{
log
.
info
(
"---进锁前---parentId===="
+
userId
);
synchronized
(
parentObj
)
{
synchronized
(
parentObj
)
{
log
.
info
(
"---进锁---parentId===="
+
userId
);
if
(
parentMap
.
get
(
userId
)
==
null
)
{
if
(
parentMap
.
get
(
userId
)
==
null
)
{
log
.
info
(
"---进锁处理---parentId===="
+
userId
);
parentMap
.
put
(
userId
,
true
);
parentMap
.
put
(
userId
,
true
);
return
true
;
return
true
;
}
}
...
@@ -86,6 +91,7 @@ public class AppUserRelationBiz extends BaseBiz<AppUserRelationMapper, AppUserRe
...
@@ -86,6 +91,7 @@ public class AppUserRelationBiz extends BaseBiz<AppUserRelationMapper, AppUserRe
}
}
private
void
unParentLock
(
Integer
userId
)
{
private
void
unParentLock
(
Integer
userId
)
{
log
.
info
(
"---解锁处理---parentId===="
+
userId
);
synchronized
(
parentObj
)
{
synchronized
(
parentObj
)
{
parentMap
.
remove
(
userId
);
parentMap
.
remove
(
userId
);
}
}
...
@@ -104,6 +110,7 @@ public class AppUserRelationBiz extends BaseBiz<AppUserRelationMapper, AppUserRe
...
@@ -104,6 +110,7 @@ public class AppUserRelationBiz extends BaseBiz<AppUserRelationMapper, AppUserRe
* @param userId
* @param userId
* @param parentId
* @param parentId
*/
*/
@Transactional
(
rollbackFor
=
Exception
.
class
,
propagation
=
Propagation
.
REQUIRED
)
public
void
bindRelation
(
Integer
userId
,
Integer
parentId
,
Integer
type
){
public
void
bindRelation
(
Integer
userId
,
Integer
parentId
,
Integer
type
){
try
{
try
{
if
(
userId
.
equals
(
parentId
)){
if
(
userId
.
equals
(
parentId
)){
...
...
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/rpc/service/AppPermissionService.java
View file @
06453fa3
...
@@ -393,16 +393,50 @@ public class AppPermissionService {
...
@@ -393,16 +393,50 @@ public class AppPermissionService {
}
}
/*
public void test(){
public
void
test
(){
Example
example
=
new
Example
(
AppUserLogin
.
class
);
Example
example
=
new
Example
(
AppUserLogin
.
class
);
example
.
createCriteria
().
andEqualTo
(
"imUserid"
,
0
);
example
.
createCriteria
().
andEqualTo
(
"imUserid"
,
0
);
List
<
AppUserLogin
>
list
=
appUserLoginBiz
.
selectByExample
(
example
);
List
<
AppUserLogin
>
list
=
appUserLoginBiz
.
selectByExample
(
example
);
for (AppUserLogin userLogin:list){
for
(
AppUserLogin
userLogin:
list
)
{
Long
now
=
System
.
currentTimeMillis
()
/
1000
;
Integer
userId
=
userLogin
.
getId
();
String
username
=
userLogin
.
getUsername
();
String
ip
=
getIp
();
String
nickname
=
SystemConfig
.
USER_NIKENAME_DEFAULT
+
(
int
)
((
Math
.
random
()
*
9
+
1
)
*
100000
);
AppUserDetail
rsUserDetail
=
new
AppUserDetail
();
rsUserDetail
.
setUserid
(
userId
);
rsUserDetail
=
appUserDetailBiz
.
selectOne
(
rsUserDetail
);
if
(
rsUserDetail
==
null
)
{
rsUserDetail
.
setUserid
(
userId
);
rsUserDetail
.
setNickname
(
nickname
);
rsUserDetail
.
setHeadimgurl
(
SystemConfig
.
USER_HEADER_URL_DEFAULT
);
// 默认路径,待写
rsUserDetail
.
setCreatetime
(
now
);
rsUserDetail
.
setUpdatetime
(
now
);
rsUserDetail
.
setIsdel
(
0
);
rsUserDetail
.
setCrtHost
(
ip
);
//生成邀请码 长度改为8 不然重复率太高
rsUserDetail
.
setCode
(
ReferralCodeUtil
.
encode
(
userId
));
appUserDetailBiz
.
insertSelective
(
rsUserDetail
);
}
else
{
nickname
=
rsUserDetail
.
getNickname
();
}
Map
<
String
,
Object
>
map
=
registerIm
(
userLogin
.
getUsername
(),
userLogin
.
getPassword
(),
nickname
);
if
(
map
!=
null
)
{
Integer
imUserId
=
Integer
.
parseInt
(
map
.
get
(
"userId"
).
toString
());
String
imPassword
=
map
.
get
(
"password"
).
toString
();
if
(
imUserId
!=
null
&&
imUserId
>
0
&&
StringUtils
.
isNotBlank
(
imPassword
))
{
AppUserLogin
userLogin1
=
new
AppUserLogin
();
userLogin1
.
setId
(
userId
);
userLogin1
.
setImPassword
(
imPassword
);
userLogin1
.
setImUserid
(
imUserId
);
userLogin1
.
setUsername
(
username
);
appUserLoginBiz
.
updateSelectiveById
(
userLogin1
);
log
.
info
(
username
+
"----userLogin updateSelectiveById---username====="
+
username
+
"----imPassword===="
+
imPassword
);
}
}
}
}
}
}*/
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
)
{
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
{
try
{
...
...
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