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
69f2e867
Commit
69f2e867
authored
Aug 06, 2019
by
hezhen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
123
parent
98792612
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
38 additions
and
14 deletions
+38
-14
AppUserRelationBiz.java
...github/wxiaoqi/security/admin/biz/AppUserRelationBiz.java
+27
-4
AppUserSellingWaterBiz.java
...ub/wxiaoqi/security/admin/biz/AppUserSellingWaterBiz.java
+2
-2
AppUserRelationController.java
...xiaoqi/security/admin/rest/AppUserRelationController.java
+2
-1
TourGoodMapper.xml
...-tour-server/src/main/resources/mapper/TourGoodMapper.xml
+7
-7
No files found.
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/biz/AppUserRelationBiz.java
View file @
69f2e867
...
@@ -57,6 +57,7 @@ public class AppUserRelationBiz extends BaseBiz<AppUserRelationMapper,AppUserRel
...
@@ -57,6 +57,7 @@ public class AppUserRelationBiz extends BaseBiz<AppUserRelationMapper,AppUserRel
/**
/**
* 关系绑定
* 关系绑定
* 规则A->B (B无有效上线+无有效下线)
* @param userId
* @param userId
* @param parentId
* @param parentId
*/
*/
...
@@ -70,8 +71,6 @@ public class AppUserRelationBiz extends BaseBiz<AppUserRelationMapper,AppUserRel
...
@@ -70,8 +71,6 @@ public class AppUserRelationBiz extends BaseBiz<AppUserRelationMapper,AppUserRel
if
(
relation
==
null
){
if
(
relation
==
null
){
relation
=
new
AppUserRelation
();
relation
=
new
AppUserRelation
();
relation
.
setUserId
(
parentId
);
relation
.
setUserId
(
parentId
);
relation
.
setIsForever
(
1
);
relation
.
setBindTime
(
time
);
relation
.
setBindType
(
type
);
relation
.
setBindType
(
type
);
insertSelective
(
relation
);
insertSelective
(
relation
);
}
}
...
@@ -84,8 +83,10 @@ public class AppUserRelationBiz extends BaseBiz<AppUserRelationMapper,AppUserRel
...
@@ -84,8 +83,10 @@ public class AppUserRelationBiz extends BaseBiz<AppUserRelationMapper,AppUserRel
relation
.
setBindTime
(
time
);
relation
.
setBindTime
(
time
);
insertSelective
(
relation
);
insertSelective
(
relation
);
}
else
{
}
else
{
//用户存在父id为0的不能成为任何人下线
//(B无有效上线+无有效下线)
if
((
relation
.
getIsForever
()!=
1
&&(
time
-
relation
.
getBindTime
())>
validTime
)){
Long
bindTime
=
time
-
validTime
;
log
.
info
(
"----userId==="
+
userId
+
"----bindTime===="
+
bindTime
+
"----relation.getBindTime()==="
+
relation
.
getBindTime
());
if
((
relation
.
getParentId
()==
null
||
relation
.
getParentId
()==
0
||(
relation
.
getIsForever
()!=
1
&&
relation
.
getBindTime
()<
bindTime
))&&
getCountByParentId
(
userId
,
bindTime
)==
0L
){
relation
.
setParentId
(
parentId
);
relation
.
setParentId
(
parentId
);
relation
.
setBindType
(
type
);
relation
.
setBindType
(
type
);
relation
.
setBindTime
(
time
);
relation
.
setBindTime
(
time
);
...
@@ -197,6 +198,28 @@ public class AppUserRelationBiz extends BaseBiz<AppUserRelationMapper,AppUserRel
...
@@ -197,6 +198,28 @@ public class AppUserRelationBiz extends BaseBiz<AppUserRelationMapper,AppUserRel
return
selectOne
(
relation
);
return
selectOne
(
relation
);
}
}
//获取有效的上线
public
AppUserRelation
getRelationByIdUserIdAndTime
(
Integer
userId
){
AppUserRelation
userRelation
=
getMyBiz
().
getRelationByUserId
(
userId
);
if
(
userRelation
==
null
){
return
null
;
}
log
.
info
(
"---userId==="
+
userId
+
"-----isForever==="
+
userRelation
.
getIsForever
());
Long
time
=
System
.
currentTimeMillis
()-
validTime
;
if
(
userRelation
.
getIsForever
()==
1
||
userRelation
.
getBindTime
()>
time
){
return
userRelation
;
}
log
.
info
(
"---userId==="
+
userId
+
"-----time==="
+
time
+
"----userRelation.getBindTime()==="
+
userRelation
.
getBindTime
());
return
null
;
}
//获取用户的下线总数
public
int
getCountByParentId
(
Integer
parentId
,
Long
time
){
Example
example
=
new
Example
(
AppUserRelation
.
class
);
example
.
createCriteria
().
andEqualTo
(
"parentId"
,
parentId
).
andNotEqualTo
(
"isForever"
,
1
).
andGreaterThan
(
"bindTime"
,
time
);
return
mapper
.
selectCountByExample
(
example
);
}
@CacheClear
(
key
=
"user:relation{1.userId}"
)
@CacheClear
(
key
=
"user:relation{1.userId}"
)
public
int
updRelation
(
AppUserRelation
appUserRelation
){
public
int
updRelation
(
AppUserRelation
appUserRelation
){
return
super
.
updateSelectiveByIdRe
(
appUserRelation
);
return
super
.
updateSelectiveByIdRe
(
appUserRelation
);
...
...
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/biz/AppUserSellingWaterBiz.java
View file @
69f2e867
...
@@ -95,9 +95,9 @@ public class AppUserSellingWaterBiz extends BaseBiz<AppUserSellingWaterMapper, A
...
@@ -95,9 +95,9 @@ public class AppUserSellingWaterBiz extends BaseBiz<AppUserSellingWaterMapper, A
log
.
info
(
"购买计算用户拥金----payOrderWater----参数不能为空----orderId==="
+
orderId
);
log
.
info
(
"购买计算用户拥金----payOrderWater----参数不能为空----orderId==="
+
orderId
);
return
;
return
;
}
}
AppUserRelation
relation
=
relationBiz
.
getRelationBy
UserId
(
userId
);
AppUserRelation
relation
=
relationBiz
.
getRelationBy
IdUserIdAndTime
(
userId
);
if
(
relation
==
null
||
relation
.
getParentId
()
==
null
||
relation
.
getParentId
()
==
0
)
{
if
(
relation
==
null
||
relation
.
getParentId
()
==
null
||
relation
.
getParentId
()
==
0
)
{
log
.
info
(
"购买计算用户拥金----payOrderWater--------userId==="
+
userId
+
"---无上线"
);
log
.
info
(
"购买计算用户拥金----payOrderWater--------userId==="
+
userId
+
"---无
有效
上线"
);
return
;
return
;
}
}
...
...
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/rest/AppUserRelationController.java
View file @
69f2e867
...
@@ -43,9 +43,10 @@ public class AppUserRelationController extends BaseController<AppUserRelationBiz
...
@@ -43,9 +43,10 @@ public class AppUserRelationController extends BaseController<AppUserRelationBiz
@ApiModelProperty
(
"app分享绑定"
)
@ApiModelProperty
(
"app分享绑定"
)
public
ObjectRestResponse
bind
(
public
ObjectRestResponse
bind
(
@RequestParam
(
value
=
"code"
,
defaultValue
=
""
)
String
code
,
@RequestParam
(
value
=
"code"
,
defaultValue
=
""
)
String
code
,
@RequestParam
(
value
=
"userid"
,
defaultValue
=
"0"
)
Integer
userid
,
HttpServletRequest
request
){
HttpServletRequest
request
){
try
{
try
{
Integer
userid
=
Integer
.
parseInt
(
userAuthUtil
.
getInfoFromToken
(
userAuthConfig
.
getToken
(
request
)).
getId
());
//
Integer userid = Integer.parseInt(userAuthUtil.getInfoFromToken(userAuthConfig.getToken(request)).getId());
return
baseBiz
.
appBindRelation
(
userid
,
code
);
return
baseBiz
.
appBindRelation
(
userid
,
code
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
...
...
xx-tour/xx-tour-server/src/main/resources/mapper/TourGoodMapper.xml
View file @
69f2e867
...
@@ -86,9 +86,9 @@
...
@@ -86,9 +86,9 @@
SELECT g.id as `id`,g.name as `name`,g.cover as `imgUrl`,g.price,
SELECT g.id as `id`,g.name as `name`,g.cover as `imgUrl`,g.price,
REPLACE(GROUP_CONCAT( DISTINCT t.`name`),',','|')as name1
REPLACE(GROUP_CONCAT( DISTINCT t.`name`),',','|')as name1
from tour_good g
from tour_good g
LEFT JOIN
tour_good_tag
tag ON g.id=tag.good_id
LEFT JOIN
(SELECT * FROM tour_good_tag WHERE is_del=0)
tag ON g.id=tag.good_id
LEFT JOIN
tour_tag
t ON tag.tag_id=t.id
LEFT JOIN
(SELECT * FROM tour_tag WHERE is_del=0)
t ON tag.tag_id=t.id
where g.recommend=1 and g.status=1 and g.is_del=0
and t.is_del=0
where g.recommend=1 and g.status=1 and g.is_del=0
GROUP BY g.id
GROUP BY g.id
ORDER BY g.rank DESC ,g.id DESC
ORDER BY g.rank DESC ,g.id DESC
limit #{start,jdbcType=INTEGER},#{size,jdbcType=INTEGER}
limit #{start,jdbcType=INTEGER},#{size,jdbcType=INTEGER}
...
@@ -101,16 +101,16 @@
...
@@ -101,16 +101,16 @@
<!--后台查询旅游路线列表-->
<!--后台查询旅游路线列表-->
<select
id=
"findGoodList"
resultMap=
"tourGoodVoMap"
>
<select
id=
"findGoodList"
resultMap=
"tourGoodVoMap"
>
SELECT g.*,REPLACE(GROUP_CONCAT( DISTINCT t.`name`),',','|')as tagNames from tour_good g
SELECT g.*,REPLACE(GROUP_CONCAT( DISTINCT t.`name`),',','|')as tagNames from tour_good g
LEFT JOIN
tour_good_tag
tag ON g.id=tag.good_id
LEFT JOIN
(SELECT * FROM tour_good_tag WHERE is_del=0)
tag ON g.id=tag.good_id
LEFT JOIN
tour_tag
t ON tag.tag_id=t.id
LEFT JOIN
(SELECT * FROM tour_tag WHERE is_del=0)
t ON tag.tag_id=t.id
<where>
<where>
g.is_del=0
and t.is_del=0
g.is_del=0
<if
test=
"params.name != null and params.name != ''"
>
<if
test=
"params.name != null and params.name != ''"
>
and (g.`name` like CONCAT('%',#{params.name},'%') or g.introduce like CONCAT('%',#{params.name},'%'))
and (g.`name` like CONCAT('%',#{params.name},'%') or g.introduce like CONCAT('%',#{params.name},'%'))
</if>
</if>
<if
test=
"params.tagId != null and params.tagId != '' "
>
<if
test=
"params.tagId != null and params.tagId != '' "
>
and g.id in (SELECT good_id from tour_good_tag
and g.id in (SELECT good_id from tour_good_tag
where tag_id = #{params.tagId})
where tag_id = #{params.tagId}
and is_del=0
)
</if>
</if>
</where>
</where>
...
...
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