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
565b5aaf
Commit
565b5aaf
authored
Sep 24, 2019
by
周健威
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/dev' into dev
parents
39f3ac4a
0ef9993a
Changes
15
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
98 additions
and
83 deletions
+98
-83
AuthController.java
...thub/wxiaoqi/security/auth/controller/AuthController.java
+7
-4
IUserService.java
.../com/github/wxiaoqi/security/auth/feign/IUserService.java
+5
-2
AuthService.java
...com/github/wxiaoqi/security/auth/service/AuthService.java
+2
-2
AppAuthServiceImpl.java
...xiaoqi/security/auth/service/impl/AppAuthServiceImpl.java
+4
-4
AuthServiceImpl.java
...b/wxiaoqi/security/auth/service/impl/AuthServiceImpl.java
+4
-4
UserIncomeBo.java
...va/com/github/wxiaoqi/security/admin/bo/UserIncomeBo.java
+2
-0
UserTeamMemberBo.java
...om/github/wxiaoqi/security/admin/bo/UserTeamMemberBo.java
+4
-1
AppUserPositionTempVo.java
...thub/wxiaoqi/security/admin/vo/AppUserPositionTempVo.java
+2
-0
AppUserPositionTempBiz.java
...ub/wxiaoqi/security/admin/biz/AppUserPositionTempBiz.java
+8
-5
AppUserRelationBiz.java
...github/wxiaoqi/security/admin/biz/AppUserRelationBiz.java
+2
-2
AppUserSellingWaterBiz.java
...ub/wxiaoqi/security/admin/biz/AppUserSellingWaterBiz.java
+2
-7
UserBusinessBiz.java
...om/github/wxiaoqi/security/admin/biz/UserBusinessBiz.java
+33
-34
AppUserSellingWaterMapper.java
...aoqi/security/admin/mapper/AppUserSellingWaterMapper.java
+1
-1
AppPermissionService.java
...aoqi/security/admin/rpc/service/AppPermissionService.java
+4
-4
AppUserSellingWaterMapper.xml
...n/src/main/resources/mapper/AppUserSellingWaterMapper.xml
+18
-13
No files found.
ace-auth/ace-auth-server/src/main/java/com/github/wxiaoqi/security/auth/controller/AuthController.java
View file @
565b5aaf
...
...
@@ -135,9 +135,11 @@ public class AuthController {
return
appAuthService
.
checkBindWechat
(
username
);
}
@RequestMapping
(
value
=
"/wxlogin"
,
method
=
RequestMethod
.
POST
)
public
JSONObject
wxlogin
(
@RequestParam
(
value
=
"openid"
,
defaultValue
=
""
)
String
openid
,
@RequestParam
(
value
=
"isQQ"
,
defaultValue
=
"0"
)
Integer
isQQ
)
throws
Exception
{
public
JSONObject
wxlogin
(
@RequestParam
(
value
=
"openid"
,
defaultValue
=
""
)
String
openid
,
@RequestParam
(
value
=
"isQQ"
,
defaultValue
=
"0"
)
Integer
isQQ
,
@RequestParam
(
value
=
"code"
,
defaultValue
=
""
)
String
code
)
throws
Exception
{
log
.
info
(
openid
+
"----require wxlogin..."
);
JSONObject
data
=
appAuthService
.
wxlogin
(
openid
,
isQQ
);
JSONObject
data
=
appAuthService
.
wxlogin
(
openid
,
isQQ
,
code
);
if
(
data
!=
null
&&
data
.
getInteger
(
"status"
)==
ResultCode
.
SUCCESS_CODE
){
JSONObject
result
=
data
.
getJSONObject
(
"data"
);
if
(
result
==
null
){
...
...
@@ -154,10 +156,11 @@ public class AuthController {
public
JSONObject
login
(
@RequestParam
(
value
=
"username"
,
defaultValue
=
""
)
String
username
,
@RequestParam
(
value
=
"mobilecode"
,
defaultValue
=
""
)
String
mobilecode
,
@RequestParam
(
value
=
"password"
,
defaultValue
=
""
)
String
password
,
@RequestParam
(
value
=
"type"
,
defaultValue
=
"1"
)
Integer
type
)
throws
Exception
{
@RequestParam
(
value
=
"type"
,
defaultValue
=
"1"
)
Integer
type
,
@RequestParam
(
value
=
"code"
,
defaultValue
=
""
)
String
code
)
throws
Exception
{
log
.
info
(
username
+
"----require login..."
);
JSONObject
data
=
appAuthService
.
tlogin
(
username
,
password
,
mobilecode
,
type
);
JSONObject
data
=
appAuthService
.
tlogin
(
username
,
password
,
mobilecode
,
type
,
code
);
if
(
data
!=
null
&&
data
.
getInteger
(
"status"
)==
ResultCode
.
SUCCESS_CODE
){
JSONObject
result
=
data
.
getJSONObject
(
"data"
);
if
(
result
==
null
){
...
...
ace-auth/ace-auth-server/src/main/java/com/github/wxiaoqi/security/auth/feign/IUserService.java
View file @
565b5aaf
...
...
@@ -42,12 +42,15 @@ public interface IUserService {
@RequestMapping
(
value
=
"/api/app/user/checkBindWechat"
,
method
=
RequestMethod
.
POST
)
public
JSONObject
checkBindWechat
(
@RequestParam
(
value
=
"username"
)
String
username
);
@RequestMapping
(
value
=
"/api/app/user/wxlogin"
,
method
=
RequestMethod
.
POST
)
public
JSONObject
wxlogin
(
@RequestParam
(
value
=
"openid"
)
String
openid
,
@RequestParam
(
value
=
"isQQ"
)
Integer
isQQ
);
public
JSONObject
wxlogin
(
@RequestParam
(
value
=
"openid"
)
String
openid
,
@RequestParam
(
value
=
"isQQ"
)
Integer
isQQ
,
@RequestParam
(
value
=
"code"
,
defaultValue
=
""
)
String
code
);
@RequestMapping
(
value
=
"/api/app/user/login"
,
method
=
RequestMethod
.
POST
)
public
JSONObject
login
(
@RequestParam
(
value
=
"username"
)
String
username
,
@RequestParam
(
value
=
"password"
)
String
password
,
@RequestParam
(
value
=
"mobilecode"
)
String
mobilecode
,
@RequestParam
(
value
=
"type"
)
Integer
type
);
@RequestParam
(
value
=
"type"
)
Integer
type
,
@RequestParam
(
value
=
""
)
String
code
);
@RequestMapping
(
value
=
"/api/app/user/reset"
,
method
=
RequestMethod
.
POST
)
public
JSONObject
reset
(
@RequestParam
(
value
=
"username"
)
String
username
,
@RequestParam
(
value
=
"mobilecode"
)
String
mobilecode
,
...
...
ace-auth/ace-auth-server/src/main/java/com/github/wxiaoqi/security/auth/service/AuthService.java
View file @
565b5aaf
...
...
@@ -15,8 +15,8 @@ public interface AuthService {
JSONObject
register
(
String
username
,
String
mobilecode
,
String
password
,
String
code
)
throws
Exception
;
JSONObject
wxregister
(
String
username
,
String
mobilecode
,
String
password
,
String
nickname
,
String
headimgurl
,
String
openid
,
String
unionid
,
Integer
type
,
Integer
isQQ
,
String
code
)
throws
Exception
;
JSONObject
checkBindWechat
(
String
username
)
throws
Exception
;
JSONObject
wxlogin
(
String
openid
,
Integer
isQQ
)
throws
Exception
;
JSONObject
tlogin
(
String
username
,
String
password
,
String
mobilecode
,
Integer
type
)
throws
Exception
;
JSONObject
wxlogin
(
String
openid
,
Integer
isQQ
,
String
code
)
throws
Exception
;
JSONObject
tlogin
(
String
username
,
String
password
,
String
mobilecode
,
Integer
type
,
String
code
)
throws
Exception
;
String
getToken
(
String
username
,
Integer
id
)
throws
Exception
;
JSONObject
reset
(
String
username
,
String
mobilecode
,
String
password
)
throws
Exception
;
...
...
ace-auth/ace-auth-server/src/main/java/com/github/wxiaoqi/security/auth/service/impl/AppAuthServiceImpl.java
View file @
565b5aaf
...
...
@@ -84,13 +84,13 @@ public class AppAuthServiceImpl implements AuthService {
}
@Override
public
JSONObject
wxlogin
(
String
openid
,
Integer
isQQ
)
throws
Exception
{
return
userService
.
wxlogin
(
openid
,
isQQ
);
public
JSONObject
wxlogin
(
String
openid
,
Integer
isQQ
,
String
code
)
throws
Exception
{
return
userService
.
wxlogin
(
openid
,
isQQ
,
code
);
}
@Override
public
JSONObject
tlogin
(
String
username
,
String
password
,
String
mobilecode
,
Integer
type
)
throws
Exception
{
return
userService
.
login
(
username
,
password
,
mobilecode
,
type
);
public
JSONObject
tlogin
(
String
username
,
String
password
,
String
mobilecode
,
Integer
type
,
String
code
)
throws
Exception
{
return
userService
.
login
(
username
,
password
,
mobilecode
,
type
,
code
);
}
@Override
...
...
ace-auth/ace-auth-server/src/main/java/com/github/wxiaoqi/security/auth/service/impl/AuthServiceImpl.java
View file @
565b5aaf
...
...
@@ -82,13 +82,13 @@ public class AuthServiceImpl implements AuthService {
}
@Override
public
JSONObject
wxlogin
(
String
openid
,
Integer
isQQ
)
throws
Exception
{
return
userService
.
wxlogin
(
openid
,
isQQ
);
public
JSONObject
wxlogin
(
String
openid
,
Integer
isQQ
,
String
code
)
throws
Exception
{
return
userService
.
wxlogin
(
openid
,
isQQ
,
code
);
}
@Override
public
JSONObject
tlogin
(
String
username
,
String
password
,
String
mobilecode
,
Integer
type
)
throws
Exception
{
return
userService
.
login
(
username
,
password
,
mobilecode
,
type
);
public
JSONObject
tlogin
(
String
username
,
String
password
,
String
mobilecode
,
Integer
type
,
String
code
)
throws
Exception
{
return
userService
.
login
(
username
,
password
,
mobilecode
,
type
,
code
);
}
@Override
...
...
ace-modules/ace-admin-api/src/main/java/com/github/wxiaoqi/security/admin/bo/UserIncomeBo.java
View file @
565b5aaf
...
...
@@ -16,4 +16,6 @@ public class UserIncomeBo {
private
Integer
userId
;
private
BigDecimal
income
;
private
Long
leagueTime
;
}
ace-modules/ace-admin-api/src/main/java/com/github/wxiaoqi/security/admin/bo/UserTeamMemberBo.java
View file @
565b5aaf
...
...
@@ -25,7 +25,10 @@ public class UserTeamMemberBo {
* 用户名
*/
private
String
userName
;
/**
* 真实名称
*/
private
String
realName
;
/**
* 昵称
*/
...
...
ace-modules/ace-admin-api/src/main/java/com/github/wxiaoqi/security/admin/vo/AppUserPositionTempVo.java
View file @
565b5aaf
...
...
@@ -30,6 +30,8 @@ public class AppUserPositionTempVo {
@ApiModelProperty
(
value
=
"职位名"
)
private
String
positionName
;
private
Integer
positionId
;
@ApiModelProperty
(
value
=
"数据状态 1:已核销 2:未核销"
)
private
Integer
status
;
...
...
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/biz/AppUserPositionTempBiz.java
View file @
565b5aaf
...
...
@@ -103,11 +103,13 @@ public class AppUserPositionTempBiz extends BaseBiz<AppUserPositionTempMapper, A
if
(
StringUtils
.
isNotEmpty
(
appUserPositionTempFindDTO
.
getPhone
()))
{
criteria
.
andEqualTo
(
"phone"
,
appUserPositionTempFindDTO
.
getPhone
());
}
if
(
DataStatus
.
USERED
.
code
==
appUserPositionTempFindDTO
.
getStatus
())
{
criteria
.
andIsNotNull
(
"userId"
);
}
if
(
DataStatus
.
NO_USERED
.
code
==
appUserPositionTempFindDTO
.
getStatus
())
{
criteria
.
andIsNull
(
"userId"
);
if
(
Objects
.
nonNull
(
appUserPositionTempFindDTO
.
getStatus
()))
{
if
(
DataStatus
.
USERED
.
code
==
appUserPositionTempFindDTO
.
getStatus
())
{
criteria
.
andIsNotNull
(
"userId"
);
}
if
(
DataStatus
.
NO_USERED
.
code
==
appUserPositionTempFindDTO
.
getStatus
())
{
criteria
.
andIsNull
(
"userId"
);
}
}
PageDataVO
<
AppUserPositionTemp
>
pageDataVO
=
PageDataVO
.
pageInfo
(
appUserPositionTempFindDTO
.
getPage
(),
appUserPositionTempFindDTO
.
getLimit
(),
()
->
mapper
.
selectByExample
(
example
));
List
<
AppUserPositionTemp
>
data
=
pageDataVO
.
getData
();
...
...
@@ -129,6 +131,7 @@ public class AppUserPositionTempBiz extends BaseBiz<AppUserPositionTempMapper, A
String
postionName
=
postionMap
==
null
?
""
:
postionMap
.
get
(
appUserPositionTemp
.
getPositionId
()).
getName
();
appUserPositionTempVo
.
setPositionName
(
postionName
);
appUserPositionTempVo
.
setStatus
(
appUserPositionTemp
.
getUserId
()
==
null
?
DataStatus
.
NO_USERED
.
code
:
DataStatus
.
USERED
.
code
);
appUserPositionTempVos
.
add
(
appUserPositionTempVo
);
}
dataVO
.
setData
(
appUserPositionTempVos
);
...
...
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/biz/AppUserRelationBiz.java
View file @
565b5aaf
...
...
@@ -242,8 +242,8 @@ public class AppUserRelationBiz extends BaseBiz<AppUserRelationMapper,AppUserRel
return
AopContext
.
currentProxy
()
!=
null
?
(
AppUserRelationBiz
)
AopContext
.
currentProxy
()
:
this
;
}
public
PageDataVO
<
AppUserRelation
>
findMemberPageByLeaderId
(
Integer
leaderId
,
Integer
pageNo
,
Integer
pageSize
)
{
return
PageDataVO
.
pageInfo
(
pageNo
,
pageSize
,
()
->
mapper
.
selectByLeaderId
(
leaderId
)
);
public
List
<
AppUserRelation
>
findMemberPageByLeaderId
(
Integer
leaderId
)
{
return
mapper
.
selectByLeaderId
(
leaderId
);
}
public
InviteMemberVo
findInviteMemberByActivitState
(
Integer
leaderId
,
Integer
state
,
Integer
page
,
Integer
limit
)
{
...
...
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/biz/AppUserSellingWaterBiz.java
View file @
565b5aaf
...
...
@@ -271,13 +271,8 @@ public class AppUserSellingWaterBiz extends BaseBiz<AppUserSellingWaterMapper, A
}
public
Map
<
Integer
,
BigDecimal
>
findMemberIdAndIncomeMapByMemberIds
(
List
<
Integer
>
memberIds
)
{
Map
<
Integer
,
BigDecimal
>
memberIdAndIncomeMap
=
new
HashMap
<>();
List
<
UserIncomeBo
>
userIncomeBos
=
mapper
.
accquireIncomeByMemberIds
(
memberIds
);
if
(
CollectionUtils
.
isNotEmpty
(
userIncomeBos
))
{
memberIdAndIncomeMap
=
userIncomeBos
.
stream
().
collect
(
Collectors
.
toMap
(
UserIncomeBo:
:
getUserId
,
userIncomeBo
->
userIncomeBo
.
getIncome
()
==
null
?
new
BigDecimal
(
0
)
:
userIncomeBo
.
getIncome
()));
}
return
memberIdAndIncomeMap
;
public
PageDataVO
<
UserIncomeBo
>
findMemberIdAndIncomeMapByMemberIds
(
Integer
parentId
,
Integer
pageNo
,
Integer
pageSize
)
{
return
PageDataVO
.
pageInfo
(
pageNo
,
pageSize
,()->
mapper
.
accquireIncomeByMemberIds
(
parentId
));
}
public
SellingWalletPagVo
findSellingWaterPageByWaiting
(
Integer
waiting
,
Integer
userId
,
Integer
pageNo
,
Integer
pageSize
)
{
...
...
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/biz/UserBusinessBiz.java
View file @
565b5aaf
package
com
.
github
.
wxiaoqi
.
security
.
admin
.
biz
;
import
com.github.wxiaoqi.security.admin.bo.PromoteBO
;
import
com.github.wxiaoqi.security.admin.bo.UserIncomeBo
;
import
com.github.wxiaoqi.security.admin.bo.UserTeamMemberBo
;
import
com.github.wxiaoqi.security.admin.entity.AppUserDetail
;
import
com.github.wxiaoqi.security.admin.entity.AppUserLogin
;
...
...
@@ -14,6 +15,7 @@ import org.springframework.transaction.annotation.Transactional;
import
java.math.BigDecimal
;
import
java.util.*
;
import
java.util.function.Function
;
import
java.util.stream.Collectors
;
/**
...
...
@@ -40,12 +42,11 @@ public class UserBusinessBiz {
public
UserTeamMemberVo
findTeamMemberPageByUserId
(
Integer
userId
,
Integer
pageNo
,
Integer
pageSize
)
{
UserTeamMemberVo
userTeamMemberVo
=
new
UserTeamMemberVo
();
//根据用户id去关系表里查询下级
PageDataVO
<
AppUserRelation
>
memberPage
=
appUserRelationBiz
.
findMemberPageByLeaderId
(
userId
,
pageNo
,
pageSize
);
UserTeamMemberVo
userTeamMemberVo
=
new
UserTeamMemberVo
();
List
<
AppUserRelation
>
teamMemberBos
=
memberPage
.
getData
();
if
(
CollectionUtils
.
isEmpty
(
teamMemberBos
))
{
PageDataVO
<
UserIncomeBo
>
dataVO
=
appUserSellingWaterBiz
.
findMemberIdAndIncomeMapByMemberIds
(
userId
,
pageNo
,
pageSize
);
List
<
UserIncomeBo
>
data
=
dataVO
.
getData
();
if
(
CollectionUtils
.
isEmpty
(
data
))
{
userTeamMemberVo
.
setPageNum
(
pageNo
);
userTeamMemberVo
.
setPageSize
(
pageSize
);
userTeamMemberVo
.
setTotalIncome
(
new
BigDecimal
(
0
));
...
...
@@ -53,63 +54,61 @@ public class UserBusinessBiz {
return
userTeamMemberVo
;
}
List
<
Integer
>
memberIds
=
teamMemberBos
.
stream
().
map
(
team
->
team
.
getUserId
()).
collect
(
Collectors
.
toList
());
Map
<
Integer
,
BigDecimal
>
memberIdAndIncomeMap
=
appUserSellingWaterBiz
.
findMemberIdAndIncomeMapByMemberIds
(
memberIds
);
if
(
memberIdAndIncomeMap
==
null
)
{
return
userTeamMemberVo
;
}
Map
<
Integer
,
AppUserLogin
>
userIdAndAppUserLoginMap
=
appUserLoginBiz
.
findUserIdAndUserLoginMapByMemberIds
(
memberIds
);
Map
<
Integer
,
AppUserDetail
>
userIdAndAppUserDetailMap
=
appUserDetailBiz
.
findUserIdAndUserDetailMapByMemberIds
(
memberIds
);
Map
<
Integer
,
UserIncomeBo
>
userIdAndIncomMap
=
data
.
stream
().
collect
(
Collectors
.
toMap
(
UserIncomeBo:
:
getUserId
,
Function
.
identity
()));
List
<
Integer
>
memberIds
=
data
.
stream
().
map
(
UserIncomeBo:
:
getUserId
).
collect
(
Collectors
.
toList
());
Map
<
Integer
,
AppUserLogin
>
userIdAndAppUserLoginMap
=
appUserLoginBiz
.
findUserIdAndUserLoginMapByMemberIds
(
memberIds
);
Map
<
Integer
,
AppUserDetail
>
userIdAndAppUserDetailMap
=
appUserDetailBiz
.
findUserIdAndUserDetailMapByMemberIds
(
memberIds
);
List
<
UserTeamMemberBo
>
userTeamMemberBos
=
new
ArrayList
<>();
UserTeamMemberBo
userTeamMemberBo
;
BigDecimal
totalIncome
=
new
BigDecimal
(
0
);
for
(
AppUserRelation
appUserRelation
:
teamMemberBo
s
)
{
for
(
Integer
memberId
:
memberId
s
)
{
userTeamMemberBo
=
new
UserTeamMemberBo
();
userTeamMemberBo
.
setLeagueTime
(
appUserRelation
.
getBind
Time
());
userTeamMemberBo
.
setUserId
(
appUserRelation
.
getUserId
()
);
userTeamMemberBo
.
setLeagueTime
(
userIdAndIncomMap
.
get
(
memberId
).
getLeague
Time
());
userTeamMemberBo
.
setUserId
(
memberId
);
if
(
userIdAndAppUserLoginMap
!=
null
)
{
AppUserLogin
appUserLogin
=
userIdAndAppUserLoginMap
.
get
(
appUserRelation
.
getUserId
()
);
if
(
appUserLogin
==
null
)
{
if
(
userIdAndAppUserLoginMap
!=
null
)
{
AppUserLogin
appUserLogin
=
userIdAndAppUserLoginMap
.
get
(
memberId
);
if
(
appUserLogin
==
null
)
{
continue
;
}
userTeamMemberBo
.
setUserName
(
appUserLogin
.
getUsername
());
}
if
(
userIdAndAppUserDetailMap
!=
null
){
AppUserDetail
appUserDetail
=
userIdAndAppUserDetailMap
.
get
(
appUserRelation
.
getUserId
());
userTeamMemberBo
.
setHeadUrl
(
appUserDetail
==
null
?
""
:
appUserDetail
.
getHeadimgurl
());
userTeamMemberBo
.
setNickName
(
appUserDetail
==
null
?
""
:
appUserDetail
.
getNickname
());
if
(
userIdAndAppUserDetailMap
!=
null
)
{
AppUserDetail
appUserDetail
=
userIdAndAppUserDetailMap
.
get
(
memberId
);
userTeamMemberBo
.
setHeadUrl
(
appUserDetail
==
null
?
""
:
appUserDetail
.
getHeadimgurl
());
userTeamMemberBo
.
setNickName
(
appUserDetail
==
null
?
""
:
appUserDetail
.
getNickname
());
userTeamMemberBo
.
setRealName
(
appUserDetail
==
null
?
""
:
appUserDetail
.
getRealname
());
}
BigDecimal
income
=
memberIdAndIncomeMap
.
get
(
appUserRelation
.
getUserId
())==
null
?
new
BigDecimal
(
0
):
memberIdAndIncomeMap
.
get
(
appUserRelation
.
getUserId
()
);
BigDecimal
income
=
userIdAndIncomMap
.
get
(
memberId
).
getIncome
()
==
null
?
new
BigDecimal
(
0
)
:
userIdAndIncomMap
.
get
(
memberId
).
getIncome
(
);
userTeamMemberBo
.
setIncome
(
income
);
totalIncome
=
totalIncome
.
add
(
income
);
userTeamMemberBos
.
add
(
userTeamMemberBo
);
}
userTeamMemberVo
.
setPageNum
(
memberPage
.
getPageNum
());
userTeamMemberVo
.
setPageSize
(
memberPage
.
getPageSize
());
userTeamMemberVo
.
setTotalCount
(
memberPage
.
getTotalCount
().
intValue
());
userTeamMemberVo
.
setTotalPage
(
memberPage
.
getTotalPage
());
userTeamMemberBos
.
sort
(
Comparator
.
comparing
(
UserTeamMemberBo:
:
getIncome
).
reversed
());
userTeamMemberVo
.
setPageNum
(
dataVO
.
getPageNum
());
userTeamMemberVo
.
setPageSize
(
dataVO
.
getPageSize
());
userTeamMemberVo
.
setTotalCount
(
dataVO
.
getTotalCount
().
intValue
());
userTeamMemberVo
.
setTotalPage
(
dataVO
.
getTotalPage
());
userTeamMemberVo
.
setUserTeamMemberBos
(
userTeamMemberBos
);
userTeamMemberVo
.
setTotalIncome
(
totalIncome
);
return
userTeamMemberVo
;
}
public
PromoteBO
getPromoteBoByUserId
(
Integer
userId
)
{
public
PromoteBO
getPromoteBoByUserId
(
Integer
userId
)
{
PromoteBO
promoteBO
=
new
PromoteBO
();
Integer
leaderId
=
appUserRelationBiz
.
findLeaderIdByMemberId
(
userId
);
Map
<
Integer
,
Integer
>
memberStateAndCountMap
=
appUserRelationBiz
.
findMemberSateAndCountMapByLeaderId
(
userId
);
Integer
leaderId
=
appUserRelationBiz
.
findLeaderIdByMemberId
(
userId
);
Map
<
Integer
,
Integer
>
memberStateAndCountMap
=
appUserRelationBiz
.
findMemberSateAndCountMapByLeaderId
(
userId
);
if
(
leaderId
!=
0
)
{
Map
<
Integer
,
AppUserLogin
>
userIdAndUserLoginMap
=
appUserLoginBiz
.
findUserIdAndUserLoginMapByMemberIds
(
Arrays
.
asList
(
leaderId
));
Map
<
Integer
,
AppUserDetail
>
userIdAndUserDetailMap
=
appUserDetailBiz
.
findUserIdAndUserDetailMapByMemberIds
(
Arrays
.
asList
(
leaderId
));
if
(!
userIdAndUserLoginMap
.
isEmpty
()){
if
(!
userIdAndUserLoginMap
.
isEmpty
())
{
promoteBO
.
setLeaderUsername
(
userIdAndUserLoginMap
.
get
(
leaderId
).
getUsername
());
}
if
(!
userIdAndUserDetailMap
.
isEmpty
()){
if
(!
userIdAndUserDetailMap
.
isEmpty
())
{
promoteBO
.
setLeaderHeadUrl
(
userIdAndUserDetailMap
.
get
(
leaderId
).
getHeadimgurl
());
}
}
...
...
@@ -117,7 +116,7 @@ public class UserBusinessBiz {
promoteBO
.
setActivatedNumber
(
memberStateAndCountMap
.
get
(
1
));
BigDecimal
totalIncome
=
appUserSellingWaterBiz
.
selectTotalIncomeByUserId
(
userId
);
promoteBO
.
setTotalIncome
(
totalIncome
==
null
?
new
BigDecimal
(
0
):
totalIncome
);
promoteBO
.
setTotalIncome
(
totalIncome
==
null
?
new
BigDecimal
(
0
)
:
totalIncome
);
return
promoteBO
;
}
}
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/mapper/AppUserSellingWaterMapper.java
View file @
565b5aaf
...
...
@@ -17,7 +17,7 @@ import java.util.List;
*/
public
interface
AppUserSellingWaterMapper
extends
Mapper
<
AppUserSellingWater
>
{
List
<
UserIncomeBo
>
accquireIncomeByMemberIds
(
@Param
(
"
memberIds"
)
List
<
Integer
>
memberIds
);
List
<
UserIncomeBo
>
accquireIncomeByMemberIds
(
@Param
(
"
parentId"
)
Integer
parentId
);
BigDecimal
selectTotalIncomeByUserId
(
@Param
(
"userId"
)
Integer
userId
);
}
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/rpc/service/AppPermissionService.java
View file @
565b5aaf
...
...
@@ -316,8 +316,8 @@ public class AppPermissionService {
}*/
//临时会员绑定
insertUserMemberByUserIdAndPhone
(
userid
,
username
);
/
*/
/参加新人活动
jionActivity(userid);
*/
//参加新人活动
jionActivity
(
userid
);
//创建钱包
walletBiz
.
createWalletByUserId
(
appUserLogin
.
getId
());
// 登录结果要做做统一处理
...
...
@@ -950,8 +950,8 @@ public class AppPermissionService {
relationBiz
.
bindByUserId
(
userid
,
small_id
);
//发送短信通知用户
thirdFeign
.
sendCode
(
username
,
password
,
SystemConfig
.
TEMPLATECODE
);
/
* /
/参加新人活动
jionActivity(userid);
*/
//参加新人活动
jionActivity
(
userid
);
// 登录结果要做做统一处理
JSONObject
data
=
autoLogin
(
userid
,
username
,
headimgurl
,
nickname
,
null
,
null
,
2
);
// 到im注册,获取返回结果
...
...
ace-modules/ace-admin/src/main/resources/mapper/AppUserSellingWaterMapper.xml
View file @
565b5aaf
...
...
@@ -4,19 +4,24 @@
<select
id=
"accquireIncomeByMemberIds"
resultType=
"com.github.wxiaoqi.security.admin.bo.UserIncomeBo"
>
SELECT DISTINCT
`source_id`as userId,
IFNULL((( SELECT SUM(commission) FROM `app_user_selling_water` WHERE source_id=ausw.source_id AND `status` = 0 AND
`waiting` = 1 )
- ( SELECT SUM(commission) FROM `app_user_selling_water` WHERE source_id=ausw.source_id AND `status` = 1 AND
`waiting` = 1 )),0) as `income`
FROM
`app_user_selling_water` as ausw
WHERE
source_id in
<foreach
collection=
"memberIds"
item=
"memberId"
open=
"("
close=
")"
separator=
","
>
#{memberId}
</foreach>
SELECT
aur.user_id,
aur.bind_time as `leagueTime`,
ausww.income
FROM
`app_user_relation` AS `aur`
LEFT JOIN (SELECT DISTINCT
`source_id` AS userId,
IFNULL(
(
( SELECT SUM( commission ) FROM `app_user_selling_water` WHERE source_id = ausw.source_id AND `status` = 0 AND `waiting` = 1 ) - ( SELECT SUM( commission ) FROM `app_user_selling_water` WHERE source_id = ausw.source_id AND `status` = 1 AND `waiting` = 1 )
),
0
) AS `income`
FROM
`app_user_selling_water` AS ausw) AS ausww ON ausww.userId=aur.user_id
WHERE aur.parent_id=#{parentId}
ORDER BY ausww.`income` DESC
</select>
<select
id=
"selectTotalIncomeByUserId"
resultType=
"java.math.BigDecimal"
>
...
...
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