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
c8c933c2
Commit
c8c933c2
authored
Dec 20, 2019
by
hezhen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ceshi
parent
5a4b9946
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
54 deletions
+35
-54
AppUserPositionTempBiz.java
...ub/wxiaoqi/security/admin/biz/AppUserPositionTempBiz.java
+0
-1
AppUserRelationBiz.java
...github/wxiaoqi/security/admin/biz/AppUserRelationBiz.java
+34
-52
ActivityPopularizeBiz.java
...com/xxfc/platform/activity/biz/ActivityPopularizeBiz.java
+1
-1
No files found.
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/biz/AppUserPositionTempBiz.java
View file @
c8c933c2
...
@@ -15,7 +15,6 @@ import com.google.common.collect.Lists;
...
@@ -15,7 +15,6 @@ import com.google.common.collect.Lists;
import
com.xxfc.platform.im.utils.BeanUtil
;
import
com.xxfc.platform.im.utils.BeanUtil
;
import
com.xxfc.platform.vehicle.entity.BranchCompany
;
import
com.xxfc.platform.vehicle.entity.BranchCompany
;
import
com.xxfc.platform.vehicle.feign.VehicleFeign
;
import
com.xxfc.platform.vehicle.feign.VehicleFeign
;
import
io.swagger.models.auth.In
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
...
...
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/biz/AppUserRelationBiz.java
View file @
c8c933c2
...
@@ -2,15 +2,12 @@ package com.github.wxiaoqi.security.admin.biz;
...
@@ -2,15 +2,12 @@ package com.github.wxiaoqi.security.admin.biz;
import
com.ace.cache.annotation.Cache
;
import
com.ace.cache.annotation.Cache
;
import
com.ace.cache.annotation.CacheClear
;
import
com.ace.cache.annotation.CacheClear
;
import
com.github.wxiaoqi.security.admin.bo.InviteMemberBO
;
import
com.github.wxiaoqi.security.admin.bo.UserBo
;
import
com.github.wxiaoqi.security.admin.dto.UserRelationDTO
;
import
com.github.wxiaoqi.security.admin.dto.UserRelationDTO
;
import
com.github.wxiaoqi.security.admin.entity.*
;
import
com.github.wxiaoqi.security.admin.entity.*
;
import
com.github.wxiaoqi.security.admin.feign.dto.AppUserDTO
;
import
com.github.wxiaoqi.security.admin.feign.dto.AppUserDTO
;
import
com.github.wxiaoqi.security.admin.mapper.AppUserRelationMapper
;
import
com.github.wxiaoqi.security.admin.vo.AppUserVo
;
import
com.github.wxiaoqi.security.admin.vo.AppUserVo
;
import
com.github.wxiaoqi.security.admin.bo.InviteMemberBO
;
import
com.github.wxiaoqi.security.admin.vo.InviteMemberVo
;
import
com.github.wxiaoqi.security.admin.vo.InviteMemberVo
;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.util.process.ResultCode
;
import
com.github.wxiaoqi.security.common.util.process.ResultCode
;
import
com.github.wxiaoqi.security.common.vo.PageDataVO
;
import
com.github.wxiaoqi.security.common.vo.PageDataVO
;
...
@@ -23,11 +20,8 @@ import org.springframework.beans.factory.annotation.Value;
...
@@ -23,11 +20,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.time.Instant
;
import
java.util.*
;
import
java.util.*
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
...
@@ -66,7 +60,6 @@ public class AppUserRelationBiz extends BaseBiz<AppUserRelationMapper, AppUserRe
...
@@ -66,7 +60,6 @@ public class AppUserRelationBiz extends BaseBiz<AppUserRelationMapper, AppUserRe
@Autowired
@Autowired
private
AppStaffUserBiz
staffUserBiz
;
private
AppStaffUserBiz
staffUserBiz
;
private
static
final
HashMap
<
Integer
,
Boolean
>
map
=
new
HashMap
<>();
private
static
final
HashMap
<
Integer
,
Boolean
>
map
=
new
HashMap
<>();
private
static
final
HashMap
<
Integer
,
Boolean
>
parentMap
=
new
HashMap
<>();
private
static
final
HashMap
<
Integer
,
Boolean
>
parentMap
=
new
HashMap
<>();
private
static
final
Object
obj
=
new
Object
();
private
static
final
Object
obj
=
new
Object
();
...
@@ -122,7 +115,6 @@ public class AppUserRelationBiz extends BaseBiz<AppUserRelationMapper, AppUserRe
...
@@ -122,7 +115,6 @@ public class AppUserRelationBiz extends BaseBiz<AppUserRelationMapper, AppUserRe
}
}
/* 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;
...
@@ -132,44 +124,43 @@ public class AppUserRelationBiz extends BaseBiz<AppUserRelationMapper, AppUserRe
...
@@ -132,44 +124,43 @@ public class AppUserRelationBiz extends BaseBiz<AppUserRelationMapper, AppUserRe
log
.
info
(
"----userId==="
+
userId
+
"----parentId===="
+
parentId
+
"----该上线用户不存在"
);
log
.
info
(
"----userId==="
+
userId
+
"----parentId===="
+
parentId
+
"----该上线用户不存在"
);
return
;
return
;
}
}
AppUserRelation
relation
=
getMyBiz
().
getRelationByUserId
(
parentId
);
if
(
lock
(
userId
))
{
Long
time
=
System
.
currentTimeMillis
();
AppUserRelation
relation
=
getMyBiz
().
getRelationByUserId
(
parentId
);
if
(
relation
==
null
){
Long
time
=
System
.
currentTimeMillis
();
relation
=
new
AppUserRelation
();
if
(
relation
==
null
)
{
relation
.
setUserId
(
parentId
);
insertLock
(
parentId
,
type
);
relation
.
setBindType
(
type
);
}
insertSelective
(
relation
);
Long
bindTime
=
time
-
validTime
;
}
//判断用户是否有有效的下线
Long
bindTime
=
time
-
validTime
;
if
(
getCountByParentId
(
userId
,
bindTime
)
==
0L
)
{
//判断用户是否有有效的下线
relation
=
getMyBiz
().
getRelationByUserId
(
userId
);
if
(
getCountByParentId
(
userId
,
bindTime
)==
0L
){
if
(
relation
==
null
)
{
relation
=
getMyBiz
().
getRelationByUserId
(
userId
);
relation
=
new
AppUserRelation
();
if
(
relation
==
null
){
relation
.
setUserId
(
userId
);
relation
=
new
AppUserRelation
();
relation
.
setUserId
(
userId
);
relation
.
setParentId
(
parentId
);
relation
.
setBindType
(
type
);
relation
.
setBindTime
(
time
);
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
.
setParentId
(
parentId
);
relation
.
setBindType
(
type
);
relation
.
setBindType
(
type
);
relation
.
setBindTime
(
time
);
relation
.
setBindTime
(
time
);
getMyBiz
().
updRelation
(
relation
);
insertSelective
(
relation
);
AppStaffUserDTO
staffUserDTO
=
new
AppStaffUserDTO
();
staffUserDTO
.
setSuId
(
relation
.
getParentId
());
staffUserDTO
.
setUid
(
relation
.
getUserId
());
staffUserBiz
.
addAppStaffUser
(
staffUserDTO
);
}
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
);
}
}
}
}
catch
(
Exception
e
){
}
catch
(
Exception
e
){
log
.
info
(
"网络异常==="
+
e
.
getMessage
());
log
.
info
(
"网络异常==="
+
e
.
getMessage
());
}
finally
{
unLock
(
userId
);
}
}
}
}
...
@@ -191,7 +182,7 @@ public class AppUserRelationBiz extends BaseBiz<AppUserRelationMapper, AppUserRe
...
@@ -191,7 +182,7 @@ public class AppUserRelationBiz extends BaseBiz<AppUserRelationMapper, AppUserRe
unParentLock
(
userId
);
unParentLock
(
userId
);
}
}
}
}
//首页关系绑定
//首页关系绑定
public
ObjectRestResponse
appBindRelation
(
Integer
userId
,
String
code
)
{
public
ObjectRestResponse
appBindRelation
(
Integer
userId
,
String
code
)
{
Integer
parentId
=
0
;
Integer
parentId
=
0
;
...
@@ -295,9 +286,9 @@ public class AppUserRelationBiz extends BaseBiz<AppUserRelationMapper, AppUserRe
...
@@ -295,9 +286,9 @@ public class AppUserRelationBiz extends BaseBiz<AppUserRelationMapper, AppUserRe
relationTemp
.
setIsValid
(
0
);
relationTemp
.
setIsValid
(
0
);
relationTemp
.
setType
(
1
);
relationTemp
.
setType
(
1
);
relationTemp
.
setIsDel
(
0
);
relationTemp
.
setIsDel
(
0
);
relationTemp
=
relationTempBiz
.
selectOne
(
relationTemp
);
relationTemp
=
relationTempBiz
.
selectOne
(
relationTemp
);
if
(
relationTemp
==
null
)
{
if
(
relationTemp
==
null
)
{
return
;
return
;
}
}
Integer
parentId
=
relationTemp
.
getUserId
();
Integer
parentId
=
relationTemp
.
getUserId
();
bindRelation
(
platform_userid
,
parentId
,
2
);
bindRelation
(
platform_userid
,
parentId
,
2
);
...
@@ -476,14 +467,5 @@ public class AppUserRelationBiz extends BaseBiz<AppUserRelationMapper, AppUserRe
...
@@ -476,14 +467,5 @@ public class AppUserRelationBiz extends BaseBiz<AppUserRelationMapper, AppUserRe
}
}
}
}
public
List
<
UserBo
>
findAllRelations
(){
List
<
UserBo
>
userBoList
=
mapper
.
findAllRelations
();
return
CollectionUtils
.
isEmpty
(
userBoList
)?
Collections
.
emptyList
():
userBoList
;
}
public
void
updateParentIdByUserId
(
Integer
leaderId
,
Integer
userId
)
{
mapper
.
updateParentIdByUserId
(
leaderId
,
userId
,
Instant
.
now
().
toEpochMilli
());
}
}
}
xx-activity/xx-activity-server/src/main/java/com/xxfc/platform/activity/biz/ActivityPopularizeBiz.java
View file @
c8c933c2
...
@@ -205,7 +205,7 @@ public class ActivityPopularizeBiz extends BaseBiz<ActivityPopularizeMapper, Act
...
@@ -205,7 +205,7 @@ public class ActivityPopularizeBiz extends BaseBiz<ActivityPopularizeMapper, Act
}
}
}
}
}
else
{
}
else
{
// 获取锁失败
// 获取锁失败
log
.
info
(
"tryLock fail, key = [{}]"
,
lockKey
);
log
.
info
(
"tryLock fail, key = [{}]"
,
lockKey
);
}
}
...
...
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