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
1b972788
Commit
1b972788
authored
Nov 01, 2019
by
hezhen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加上级
parent
800c919f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
53 additions
and
10 deletions
+53
-10
AppUserDTO.java
...m/github/wxiaoqi/security/admin/feign/dto/AppUserDTO.java
+6
-1
AppUserController.java
...github/wxiaoqi/security/admin/rest/AppUserController.java
+47
-9
No files found.
ace-modules/ace-admin-api/src/main/java/com/github/wxiaoqi/security/admin/feign/dto/AppUserDTO.java
View file @
1b972788
...
...
@@ -20,7 +20,9 @@ public class AppUserDTO {
private
Integer
isMember
;
private
String
username
;
private
String
wxNickname
;
private
String
qqNickname
;
private
String
nickname
;
private
String
aliPayNickName
;
private
String
realname
;
private
String
headimgurl
;
private
String
email
;
...
...
@@ -88,7 +90,10 @@ public class AppUserDTO {
private
String
itemImg
;
private
Integer
memberNo
;
private
Long
cardLeave
;
private
Integer
isBind
;
private
Boolean
isBindWx
;
private
Boolean
isBindAliPay
;
private
Boolean
isBindQQ
;
//用户上线
private
Integer
parentId
;
}
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/rest/AppUserController.java
View file @
1b972788
package
com
.
github
.
wxiaoqi
.
security
.
admin
.
rest
;
import
com.github.wxiaoqi.security.admin.biz.*
;
import
com.github.wxiaoqi.security.admin.bo.UserBo
;
import
com.github.wxiaoqi.security.admin.dto.AccountBindDTO
;
import
com.github.wxiaoqi.security.admin.entity.*
;
import
com.github.wxiaoqi.security.admin.feign.dto.AppUserDTO
;
import
com.github.wxiaoqi.security.admin.vo.AppUserGroups
;
...
...
@@ -74,6 +76,9 @@ public class AppUserController extends CommonBaseController{
@Autowired
private
AppUserAlipayBiz
appUserAlipayBiz
;
@Autowired
private
AppUserRelationBiz
relationBiz
;
@GetMapping
(
"page"
)
...
...
@@ -145,7 +150,7 @@ public class AppUserController extends CommonBaseController{
throw
new
Exception
();
}
Integer
id
=
userVo
.
getId
();
Integer
positionId
=
userVo
.
getPositionId
();
Integer
positionId
=
userVo
.
getPositionId
();
BeanUtils
.
copyProperties
(
userDTO
,
userVo
);
if
(
userVo
.
getIsMember
()!=
null
&&
userVo
.
getIsMember
()>
0
){
//获取用户会员信息
...
...
@@ -159,7 +164,6 @@ public class AppUserController extends CommonBaseController{
String
icon
=
memberLevel
.
getIcon
();
userDTO
.
setIcon
(
icon
);
userDTO
.
setBigIcon
(
memberLevel
.
getBigIcon
());
userDTO
.
setItemImg
(
memberLevel
.
getItemImg
());
}
}
}
...
...
@@ -167,10 +171,20 @@ public class AppUserController extends CommonBaseController{
if
(
userPosition
!=
null
&&
userPosition
.
getLevel
()>
0
){
userDTO
.
setPositionName
(
userPosition
.
getName
());
}
AppUserRelation
relation
=
relationBiz
.
getRelationByIdUserIdAndTime
(
userid
);
Integer
parentId
=
0
;
if
(
relation
!=
null
){
parentId
=
relation
.
getParentId
();
}
userDTO
.
setParentId
(
parentId
);
List
<
AppUserAlipay
>
appUserAlipays
=
appUserAlipayBiz
.
getByUserId
(
request
);
long
count
=
appUserAlipays
.
stream
().
filter
(
appUserAlipay
->
appUserAlipay
.
getType
()
==
1
).
count
();
userDTO
.
setIsBindAliPay
(
count
>
0
);
userDTO
.
setId
(
id
);
userDTO
.
setAliPayNickName
(
userDTO
.
getIsBindAliPay
()?
appUserAlipays
.
get
(
0
).
getNickname
():
""
);
AppUserLogin
appUserLogin
=
appUserLoginBiz
.
selectById
(
userid
);
userDTO
.
setIsBindWx
(
StringUtils
.
isNotEmpty
(
appUserLogin
.
getWxOpenid
()));
userDTO
.
setIsBindQQ
(
StringUtils
.
isNotEmpty
(
appUserLogin
.
getOpenid
()));
return
ObjectRestResponse
.
succ
(
userDTO
);
}
...
...
@@ -209,9 +223,8 @@ public class AppUserController extends CommonBaseController{
*/
@PostMapping
(
"/edit"
)
public
ObjectRestResponse
edit
(
@RequestBody
AppUserVo
userVo
,
HttpServletRequest
request
)
throws
Exception
{
if
(
userVo
==
null
||
userVo
.
getId
()==
null
){
return
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
NULL_CODE
,
"参数为空"
);
}
String
id
=
userAuthUtil
.
getInfoFromToken
(
userAuthConfig
.
getToken
(
request
)).
getId
();
userVo
.
setUserid
(
Integer
.
valueOf
(
id
));
userDetailBiz
.
updUuserInfoById
(
userVo
);
Integer
userid
=
userVo
.
getUserid
();
if
(
userid
!=
null
){
...
...
@@ -221,7 +234,7 @@ public class AppUserController extends CommonBaseController{
appUserLogin
.
setOpenid
(
userVo
.
getOpenid
());
appUserLogin
.
setId
(
userid
);
appUserLogin
.
setUsername
(
userVo
.
getUsername
());
appUserLoginBiz
.
bindOpenid
(
appUserLogin
);
appUserLoginBiz
.
updateAppuserLogin
(
appUserLogin
);
//支付宝绑定
if
(
StringUtils
.
isNotEmpty
(
userVo
.
getAliCode
())
&&
userVo
.
getAliCode
().
trim
().
length
()>
0
){
appUserAlipayBiz
.
getUserInfo
(
userVo
.
getAliCode
(),
request
);
...
...
@@ -304,7 +317,7 @@ public class AppUserController extends CommonBaseController{
}
@GetMapping
(
"/findusersByIds"
)
public
Map
<
Integer
,
AppUserLogin
>
findAppUsersByUserIds
(
@RequestParam
(
value
=
"userIds"
)
List
<
Integer
>
userIds
){
return
appUserLoginBiz
.
findUserIdAndUserLoginMapByMemberIds
(
userIds
);
return
appUserLoginBiz
.
findUserIdAndUserLoginMapByMemberIds
(
userIds
);
}
@GetMapping
(
"/finduserIdsByphones"
)
...
...
@@ -316,8 +329,8 @@ public class AppUserController extends CommonBaseController{
@IgnoreUserToken
@IgnoreClientToken
public
ObjectRestResponse
<
AppUserInfoVo
>
findUserInfoByCode
(
@PathVariable
(
"code"
)
String
code
){
AppUserInfoVo
appUserInfoVo
=
userDetailBiz
.
findUserInfoByCode
(
code
);
return
ObjectRestResponse
.
succ
(
appUserInfoVo
);
AppUserInfoVo
appUserInfoVo
=
userDetailBiz
.
findUserInfoByCode
(
code
);
return
ObjectRestResponse
.
succ
(
appUserInfoVo
);
}
@GetMapping
(
"/app/unauth/getUserIdByUsername"
)
...
...
@@ -334,4 +347,29 @@ public class AppUserController extends CommonBaseController{
public
Object
test
()
{
return
appUserLoginBiz
.
test
();
}
@PostMapping
(
"/bind"
)
private
ObjectRestResponse
accountBinding
(
@RequestBody
AccountBindDTO
accountBindDTO
,
HttpServletRequest
request
){
try
{
IJWTInfo
infoFromToken
=
userAuthUtil
.
getInfoFromToken
(
userAuthConfig
.
getToken
(
request
));
return
appUserLoginBiz
.
bindAccount
(
accountBindDTO
,
Integer
.
valueOf
(
infoFromToken
.
getId
()),
request
);
}
catch
(
Exception
ex
){
throw
new
BaseException
(
ex
);
}
}
@GetMapping
(
"/users"
)
List
<
Integer
>
findAppUserIds
(
@RequestParam
(
value
=
"phone"
,
required
=
false
)
String
phone
,
@RequestParam
(
value
=
"leaderPhone"
,
required
=
false
)
String
leaderPhone
,
@RequestParam
(
value
=
"name"
,
required
=
false
)
String
name
)
{
return
appUserLoginBiz
.
findAppuser
(
phone
,
leaderPhone
,
name
);
}
@PostMapping
(
"/users/info"
)
List
<
UserBo
>
findUserDetailByUserBo
(
@RequestBody
(
required
=
false
)
List
<
UserBo
>
userBos
)
{
return
appUserLoginBiz
.
findUserDetailInfo
(
userBos
);
}
}
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