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
5a7e79b6
Commit
5a7e79b6
authored
Dec 18, 2019
by
hanfeng
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master-customer-management' into master-customer-management
parents
a416a068
5d8b3090
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
35 deletions
+40
-35
AppUserRelationBiz.java
...github/wxiaoqi/security/admin/biz/AppUserRelationBiz.java
+40
-35
No files found.
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/biz/AppUserRelationBiz.java
View file @
5a7e79b6
...
@@ -67,57 +67,62 @@ public class AppUserRelationBiz extends BaseBiz<AppUserRelationMapper,AppUserRel
...
@@ -67,57 +67,62 @@ public class AppUserRelationBiz extends BaseBiz<AppUserRelationMapper,AppUserRel
* @param parentId
* @param parentId
*/
*/
public
void
bindRelation
(
Integer
userId
,
Integer
parentId
,
Integer
type
){
public
void
bindRelation
(
Integer
userId
,
Integer
parentId
,
Integer
type
){
if
(
userId
.
equals
(
parentId
)){
try
{
log
.
info
(
"----userId==="
+
userId
+
"----parentId===="
+
parentId
+
"----自己不能成为自己的上线"
);
if
(
userId
.
equals
(
parentId
)){
return
;
log
.
info
(
"----userId==="
+
userId
+
"----parentId===="
+
parentId
+
"----自己不能成为自己的上线"
);
}
return
;
}
/* AppUserVo appUserVo=userDetailBiz.getUserInfoById(userId);
/* AppUserVo appUserVo=userDetailBiz.getUserInfoById(userId);
if (appUserVo==null){
if (appUserVo==null){
log.info("----userId==="+userId+"----parentId===="+parentId+"----该用户不存在");
log.info("----userId==="+userId+"----parentId===="+parentId+"----该用户不存在");
return;
return;
}*/
}*/
AppUserVo
appUserVo
=
userDetailBiz
.
getUserInfoById
(
parentId
);
AppUserVo
appUserVo
=
userDetailBiz
.
getUserInfoById
(
parentId
);
if
(
appUserVo
==
null
){
if
(
appUserVo
==
null
){
log
.
info
(
"----userId==="
+
userId
+
"----parentId===="
+
parentId
+
"----该上线用户不存在"
);
log
.
info
(
"----userId==="
+
userId
+
"----parentId===="
+
parentId
+
"----该上线用户不存在"
);
return
;
return
;
}
}
AppUserRelation
relation
=
getMyBiz
().
getRelationByUserId
(
parentId
);
AppUserRelation
relation
=
getMyBiz
().
getRelationByUserId
(
parentId
);
Long
time
=
System
.
currentTimeMillis
();
Long
time
=
System
.
currentTimeMillis
();
if
(
relation
==
null
){
relation
=
new
AppUserRelation
();
relation
.
setUserId
(
parentId
);
relation
.
setBindType
(
type
);
insertSelective
(
relation
);
}
Long
bindTime
=
time
-
validTime
;
//判断用户是否有有效的下线
if
(
getCountByParentId
(
userId
,
bindTime
)==
0L
){
relation
=
getMyBiz
().
getRelationByUserId
(
userId
);
if
(
relation
==
null
){
if
(
relation
==
null
){
relation
=
new
AppUserRelation
();
relation
=
new
AppUserRelation
();
relation
.
setUserId
(
userId
);
relation
.
setUserId
(
parentId
);
relation
.
setParentId
(
parentId
);
relation
.
setBindType
(
type
);
relation
.
setBindType
(
type
);
relation
.
setBindTime
(
time
);
insertSelective
(
relation
);
insertSelective
(
relation
);
}
else
{
}
//判断用户是否有有效的上线
Long
bindTime
=
time
-
validTime
;
log
.
info
(
"----userId==="
+
userId
+
"----bindTime===="
+
bindTime
+
"----relation.getBindTime()==="
+
relation
.
getBindTime
());
//判断用户是否有有效的下线
if
(
relation
.
getParentId
()==
null
||
relation
.
getParentId
()==
0
||(
relation
.
getIsForever
()!=
1
&&
validTime
>
0
&&
relation
.
getBindTime
()<
bindTime
)){
if
(
getCountByParentId
(
userId
,
bindTime
)==
0L
){
relation
=
getMyBiz
().
getRelationByUserId
(
userId
);
if
(
relation
==
null
){
relation
=
new
AppUserRelation
();
relation
.
setUserId
(
userId
);
relation
.
setParentId
(
parentId
);
relation
.
setParentId
(
parentId
);
relation
.
setBindType
(
type
);
relation
.
setBindType
(
type
);
relation
.
setBindTime
(
time
);
relation
.
setBindTime
(
time
);
getMyBiz
().
updRelation
(
relation
);
insertSelective
(
relation
);
}
else
{
//判断用户是否有有效的上线
log
.
info
(
"----userId==="
+
userId
+
"----bindTime===="
+
bindTime
+
"----relation.getBindTime()==="
+
relation
.
getBindTime
());
if
(
relation
.
getParentId
()==
null
||
relation
.
getParentId
()==
0
||(
relation
.
getIsForever
()!=
1
&&
validTime
>
0
&&
relation
.
getBindTime
()<
bindTime
)){
relation
.
setParentId
(
parentId
);
relation
.
setBindType
(
type
);
relation
.
setBindTime
(
time
);
getMyBiz
().
updRelation
(
relation
);
}
}
if
(
relation
!=
null
){
AppStaffUserDTO
staffUserDTO
=
new
AppStaffUserDTO
();
staffUserDTO
.
setSuId
(
relation
.
getParentId
());
staffUserDTO
.
setUid
(
relation
.
getUserId
());
staffUserBiz
.
addAppStaffUser
(
staffUserDTO
);
}
}
}
}
if
(
relation
!=
null
){
}
catch
(
Exception
e
){
AppStaffUserDTO
staffUserDTO
=
new
AppStaffUserDTO
();
log
.
info
(
"网络异常==="
+
e
.
getMessage
());
staffUserDTO
.
setSuId
(
relation
.
getParentId
());
staffUserDTO
.
setUid
(
relation
.
getUserId
());
staffUserBiz
.
addAppStaffUser
(
staffUserDTO
);
}
}
}
}
}
//首页关系绑定
//首页关系绑定
public
ObjectRestResponse
appBindRelation
(
Integer
userId
,
String
code
){
public
ObjectRestResponse
appBindRelation
(
Integer
userId
,
String
code
){
...
...
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