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
06e548e0
Commit
06e548e0
authored
Aug 06, 2019
by
hezhen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
123
parent
995534dc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
3 deletions
+9
-3
AppUserRelationBiz.java
...github/wxiaoqi/security/admin/biz/AppUserRelationBiz.java
+9
-3
No files found.
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/biz/AppUserRelationBiz.java
View file @
06e548e0
...
...
@@ -52,6 +52,9 @@ public class AppUserRelationBiz extends BaseBiz<AppUserRelationMapper,AppUserRel
@Autowired
private
AppUserDetailBiz
appUserDetailBiz
;
@Value
(
"${admin.validTime}"
)
private
Long
validTime
;
/**
* 关系绑定
* @param userId
...
...
@@ -63,13 +66,16 @@ public class AppUserRelationBiz extends BaseBiz<AppUserRelationMapper,AppUserRel
return
;
}
AppUserRelation
relation
=
getMyBiz
().
getRelationByUserId
(
parentId
);
Long
time
=
System
.
currentTimeMillis
();
if
(
relation
==
null
){
relation
=
new
AppUserRelation
();
relation
.
setUserId
(
parentId
);
relation
.
setIsForever
(
1
);
relation
.
setBindTime
(
time
);
relation
.
setBindType
(
type
);
insertSelective
(
relation
);
}
relation
=
getMyBiz
().
getRelationByUserId
(
userId
);
Long
time
=
System
.
currentTimeMillis
();
if
(
relation
==
null
){
relation
=
new
AppUserRelation
();
relation
.
setUserId
(
userId
);
...
...
@@ -78,7 +84,8 @@ public class AppUserRelationBiz extends BaseBiz<AppUserRelationMapper,AppUserRel
relation
.
setBindTime
(
time
);
insertSelective
(
relation
);
}
else
{
if
(
relation
.
getParentId
()==
null
||
relation
.
getParentId
()==
0
||(
relation
.
getIsForever
()!=
1
&&(
time
-
relation
.
getBindTime
())>
3600
)){
//用户存在父id为0的不能成为任何人下线
if
((
relation
.
getIsForever
()!=
1
&&(
time
-
relation
.
getBindTime
())>
validTime
)){
relation
.
setParentId
(
parentId
);
relation
.
setBindType
(
type
);
relation
.
setBindTime
(
time
);
...
...
@@ -86,7 +93,6 @@ public class AppUserRelationBiz extends BaseBiz<AppUserRelationMapper,AppUserRel
}
}
}
//首页关系绑定
public
ObjectRestResponse
appBindRelation
(
Integer
userId
,
String
code
){
Integer
parentId
=
0
;
...
...
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