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
cdb3c751
Commit
cdb3c751
authored
Aug 20, 2019
by
jiaorz
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/dev' into jrz_dev
parents
8543716f
f2cf11e1
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
62 additions
and
17 deletions
+62
-17
BaseUserMemberController.java
...wxiaoqi/security/admin/rest/BaseUserMemberController.java
+43
-2
AppUserDetailMapper.xml
...e-admin/src/main/resources/mapper/AppUserDetailMapper.xml
+17
-15
BaseUserMemberMapper.xml
...-admin/src/main/resources/mapper/BaseUserMemberMapper.xml
+2
-0
No files found.
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/rest/BaseUserMemberController.java
View file @
cdb3c751
...
...
@@ -5,11 +5,18 @@ import com.github.wxiaoqi.security.admin.dto.BaseUserMemberVO;
import
com.github.wxiaoqi.security.admin.dto.UserMemberDTO
;
import
com.github.wxiaoqi.security.admin.entity.AppUserManage
;
import
com.github.wxiaoqi.security.admin.entity.BaseUserMember
;
import
com.github.wxiaoqi.security.admin.feign.UserFeign
;
import
com.github.wxiaoqi.security.admin.feign.dto.AppUserDTO
;
import
com.github.wxiaoqi.security.auth.client.config.UserAuthConfig
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.rest.BaseController
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
java.lang.reflect.InvocationTargetException
;
import
java.util.Objects
;
/**
* 用户会员
...
...
@@ -17,20 +24,45 @@ import java.lang.reflect.InvocationTargetException;
*/
@RestController
@RequestMapping
(
"baseUserMember"
)
@Api
(
tags
=
"后台获取和修改用户会员信息"
)
public
class
BaseUserMemberController
extends
BaseController
<
BaseUserMemberBiz
,
BaseUserMember
>
{
@Autowired
private
UserFeign
userFeign
;
@Autowired
private
UserAuthConfig
userAuthConfig
;
/**
* 获取用户会员
* @param userId
* @return
*/
@ApiOperation
(
value
=
"根据用户id获取用户会员信息"
)
@RequestMapping
(
"/findOne/{userId}"
)
public
ObjectRestResponse
<
BaseUserMemberVO
>
findOneByUserId
(
@PathVariable
Integer
userId
){
return
ObjectRestResponse
.
succ
(
baseBiz
.
findOneByUserId
(
userId
));
}
/**
* 根据token获取用户会员信息
* @return
*/
@RequestMapping
(
"/getUserMember"
)
@ApiOperation
(
value
=
"根据token获取用户会员信息"
)
public
ObjectRestResponse
<
BaseUserMemberVO
>
findOneByToken
(){
try
{
AppUserDTO
user
=
userFeign
.
userDetailByToken
(
userAuthConfig
.
getToken
(
request
)).
getData
();
return
ObjectRestResponse
.
succ
(
baseBiz
.
findOneByUserId
(
user
.
getUserid
()));
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
return
ObjectRestResponse
.
createDefaultFail
();
}
}
// /**
// * 设置用户会员
...
...
@@ -51,12 +83,21 @@ public class BaseUserMemberController extends BaseController<BaseUserMemberBiz,
* @return
*/
@PutMapping
(
"/setUserMember"
)
@ApiOperation
(
value
=
"修改用户会员信息"
)
public
ObjectRestResponse
UpdateUserMember
(
@RequestBody
UserMemberDTO
userMemberDTO
)
throws
Exception
{
if
(
userMemberDTO
==
null
||
userMemberDTO
.
getRentFreeDays
()<
0
||
userMemberDTO
.
getTotalNumber
()<
0
)
{
if
(
userMemberDTO
==
null
)
{
return
ObjectRestResponse
.
createDefaultFail
();
}
if
(
Objects
.
nonNull
(
userMemberDTO
.
getRentFreeDays
())&&
userMemberDTO
.
getRentFreeDays
()<
0
){
return
ObjectRestResponse
.
createDefaultFail
();
}
if
(
Objects
.
nonNull
(
userMemberDTO
.
getTotalNumber
())&&
userMemberDTO
.
getTotalNumber
()<
0
){
return
ObjectRestResponse
.
createDefaultFail
();
}
baseBiz
.
UpdateUserMember
(
userMemberDTO
);
return
ObjectRestResponse
.
succ
();
...
...
ace-modules/ace-admin/src/main/resources/mapper/AppUserDetailMapper.xml
View file @
cdb3c751
...
...
@@ -68,26 +68,28 @@
m.total_number as totalNumber,
m.rent_free_days as rentFreeDays,
m.crt_time as timeOfMembership,
m.recent_recharge as
recentRecharge,
m.recent_recharge as recentRecharge,
m.name as memberName,
ul.username as inviter,
aup.name as `positionName`
from
app_user_login l
inner join
(select * from app_user_detail where 1=1
<if
test=
"postionState != null"
>
<choose>
<when
test=
"postionState == 6"
>
and `position_id`=#{postionState}
</when>
<otherwise>
and
<![CDATA[`position_id`<>6]]>
</otherwise>
</choose>
</if>
) d
(select * from app_user_detail where 1=1
<if
test=
"postionState != null"
>
<choose>
<when
test=
"postionState == 6"
>
and `position_id`=#{postionState}
</when>
<otherwise>
and
<![CDATA[`position_id`<>6]]>
</otherwise>
</choose>
</if>
) d
on
d.userid = l.id
left
join
left join
app_user_login ul
on
ul.id=d.inviter_account
...
...
@@ -110,7 +112,7 @@
on aup.id = d.position_id
where l.isdel = 0
<if
test=
"mobile !=null and mobile !='' "
>
and l.username like
CONCAT('%',#{mobile},'%')
and l.username like CONCAT('%',#{mobile},'%')
</if>
<if
test=
"channel !=null "
>
and d.channel=#{channel}
...
...
@@ -131,10 +133,10 @@
<if
test=
"source !=null "
>
and d.source = #{source}
</if>
order by
l.id
ASC
order by
l.id
ASC
</select>
<update
id=
"updateUserMemberStatusByUserId"
>
<update
id=
"updateUserMemberStatusByUserId"
>
update `app_user_detail` set `is_member`={status} where `userid`=#{userId}
</update>
<update
id=
"updateUserPositionByUserId"
>
...
...
ace-modules/ace-admin/src/main/resources/mapper/BaseUserMemberMapper.xml
View file @
cdb3c751
...
...
@@ -49,6 +49,8 @@
m.user_id=#{userId}
and
m.is_del=0
limit 1
</select>
</mapper>
\ No newline at end of file
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