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
0a70d31b
Commit
0a70d31b
authored
Aug 06, 2019
by
jiaorz
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/base-modify' into base-modify
parents
070fc60e
d3a351e3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
7 deletions
+15
-7
AppUserRelationBiz.java
...github/wxiaoqi/security/admin/biz/AppUserRelationBiz.java
+9
-3
CampsiteShopBiz.java
.../java/com/xxfc/platform/campsite/biz/CampsiteShopBiz.java
+6
-4
No files found.
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/biz/AppUserRelationBiz.java
View file @
0a70d31b
...
...
@@ -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
;
...
...
xx-campsite/xx-campsite-server/src/main/java/com/xxfc/platform/campsite/biz/CampsiteShopBiz.java
View file @
0a70d31b
...
...
@@ -167,11 +167,13 @@ public class CampsiteShopBiz extends BaseBiz<CampsiteShopMapper, CampsiteShop> {
}
campsiteShopDetailVo
.
setTypeNames
(
shopTagDTOS
==
null
?
Collections
.
EMPTY_LIST
:
shopTagDTOS
.
stream
().
map
(
CampsiteShopTagDTO:
:
getName
).
collect
(
Collectors
.
toList
()));
//根据经纬度算距离
double
distance
=
getDistance
(
campsiteShopDetailDTO
.
getLongitude
(),
campsiteShopDetailDTO
.
getLatitude
(),
longitude
,
latitude
);
if
(
log
.
isDebugEnabled
())
{
log
.
debug
(
"根据店铺经度=【{}】,纬度=【{}】和自己所在位置的经度=【{}】,纬度=【{}】计算出的距离:【{}km】"
,
campsiteShopDetailDTO
.
getLongitude
(),
campsiteShopDetailDTO
.
getLatitude
(),
longitude
,
latitude
,
distance
);
if
(
campsiteShopDetailDTO
.
getLongitude
()!=
null
&&
campsiteShopDetailDTO
.
getLatitude
()!=
null
)
{
double
distance
=
getDistance
(
campsiteShopDetailDTO
.
getLongitude
(),
campsiteShopDetailDTO
.
getLatitude
(),
longitude
,
latitude
);
if
(
log
.
isDebugEnabled
())
{
log
.
debug
(
"根据店铺经度=【{}】,纬度=【{}】和自己所在位置的经度=【{}】,纬度=【{}】计算出的距离:【{}km】"
,
campsiteShopDetailDTO
.
getLongitude
(),
campsiteShopDetailDTO
.
getLatitude
(),
longitude
,
latitude
,
distance
);
}
campsiteShopDetailVo
.
setDistance
(
String
.
format
(
"%.1f"
,
distance
));
}
campsiteShopDetailVo
.
setDistance
(
String
.
format
(
"%.1f"
,
distance
));
campsiteValueOperations
.
set
(
String
.
format
(
"%s%d"
,
CAMSITE_DETAIL_CACHE_PREKEY
,
id
),
JSONObject
.
toJSONString
(
campsiteShopDetailVo
));
return
campsiteShopDetailVo
;
}
...
...
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