Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
D
data-server
Project
Project
Details
Activity
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
licc
data-server
Commits
855c9d0e
Commit
855c9d0e
authored
Jun 19, 2021
by
licc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增返回接口数据
parent
af509b2b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
48 additions
and
14 deletions
+48
-14
UsersMapper.xml
wisenergy-mapper/src/main/resources/mapper/UsersMapper.xml
+8
-4
UserVo.java
...rgy-model/src/main/java/cn/wisenergy/model/vo/UserVo.java
+28
-9
UserServiceImpl.java
...n/java/cn/wisenergy/service/app/impl/UserServiceImpl.java
+12
-1
No files found.
wisenergy-mapper/src/main/resources/mapper/UsersMapper.xml
View file @
855c9d0e
...
...
@@ -154,8 +154,10 @@
</delete>
<select
id=
"getLastUser"
resultType=
"cn.wisenergy.model.vo.UserVo"
>
select u.id as userId,u.parent_id as parentId,a.real_name as realName
from users u left join actives a
select u.id as userId,u.parent_id as parentId,a.real_name as realName,a.id_number as idNumber,a.phone as phone,
a.total_recharge as totalRecharge,a.total_withdrawal as totalWithdrawal,a.rank as rank,a.bottom as bottom,
a.total_people as totalPeople,a.buy_total as buyTotal,a.sale_total as saleTotal
from users u left join user_data a
on u.id=a.user_id
where u.parent_id =#{parentId}
</select>
...
...
@@ -244,8 +246,10 @@ GROUP BY user_id
</select>
<select
id=
"getUserData"
resultType=
"cn.wisenergy.model.vo.UserVo"
>
select u.id as userId,u.parent_id as parentId,a.real_name as realName
from users u left join actives a
select u.id as userId,u.parent_id as parentId,a.real_name as realName,a.id_number as idNumber,a.phone as phone,
a.total_recharge as totalRecharge,a.total_withdrawal as totalWithdrawal,a.rank as rank,a.bottom as bottom,
a.total_people as totalPeople,a.buy_total as buyTotal,a.sale_total as saleTotal
from users u left join user_data a
on u.id=a.user_id
where u.id IN
<foreach
collection=
"list"
index=
"index"
item=
"id"
separator=
","
open=
"("
close=
")"
>
...
...
wisenergy-model/src/main/java/cn/wisenergy/model/vo/UserVo.java
View file @
855c9d0e
...
...
@@ -12,24 +12,43 @@ import java.util.List;
@Data
@ApiModel
(
value
=
"UserVo"
)
public
class
UserVo
{
/**
* 用户id
*/
@ApiModelProperty
(
value
=
"用户id"
,
name
=
"userId"
)
private
Long
userId
;
/**
* 父id
*/
@ApiModelProperty
(
value
=
"父id"
,
name
=
"parentId"
)
private
Integer
parentId
;
/**
* 用户真实名字
*/
@ApiModelProperty
(
value
=
"用户真实名字"
,
name
=
"realName"
)
private
String
realName
;
@ApiModelProperty
(
name
=
"idNumber"
,
value
=
"身份证号"
)
private
String
idNumber
;
@ApiModelProperty
(
name
=
"phone"
,
value
=
"用户手机号"
)
private
String
phone
;
@ApiModelProperty
(
name
=
"totalRecharge"
,
value
=
"充值总额"
)
private
String
totalRecharge
;
@ApiModelProperty
(
name
=
"totalWithdrawal"
,
value
=
"提现总额"
)
private
String
totalWithdrawal
;
@ApiModelProperty
(
name
=
"rank"
,
value
=
"层级"
)
private
Integer
rank
;
@ApiModelProperty
(
name
=
"bottom"
,
value
=
"向下最深层级层级数"
)
private
Integer
bottom
;
@ApiModelProperty
(
name
=
"totalPeople"
,
value
=
"伞下人员总和"
)
private
Integer
totalPeople
;
@ApiModelProperty
(
name
=
"buyTotal"
,
value
=
"otc卖入总额"
)
private
String
buyTotal
;
@ApiModelProperty
(
name
=
"saleTotal"
,
value
=
"otc卖出总额"
)
private
String
saleTotal
;
@ApiModelProperty
(
value
=
"子节点数据"
,
name
=
"childrens"
)
List
<
UserVo
>
children
;
...
...
wisenergy-service/src/main/java/cn/wisenergy/service/app/impl/UserServiceImpl.java
View file @
855c9d0e
...
...
@@ -59,8 +59,19 @@ public class UserServiceImpl extends ServiceImpl<UsersMapper, Users> implements
UserVo
userVo
=
new
UserVo
();
userVo
.
setUserId
(
users
.
getId
());
userVo
.
setParentId
(
users
.
getParentId
());
userVo
.
setRealName
(
null
);
//获取用户统计数据
UserData
userData
=
userDataMapper
.
getByUserId
(
userId
);
userVo
.
setRealName
(
userData
.
getRealName
());
userVo
.
setBuyTotal
(
userData
.
getBuyTotal
().
toString
());
userVo
.
setBottom
(
userData
.
getBottom
());
userVo
.
setIdNumber
(
userData
.
getIdNumber
());
userVo
.
setPhone
(
userData
.
getPhone
());
userVo
.
setRank
(
userData
.
getRank
());
userVo
.
setSaleTotal
(
userData
.
getSaleTotal
().
toString
());
userVo
.
setTotalPeople
(
userData
.
getTotalPeople
());
userVo
.
setTotalRecharge
(
userData
.
getTotalRecharge
().
toString
());
userVo
.
setTotalWithdrawal
(
userData
.
getTotalWithdrawal
().
toString
());
List
<
UserVo
>
list
=
new
ArrayList
<>();
list
.
add
(
userVo
);
return
R
.
ok
(
list
);
...
...
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