Commit 855c9d0e authored by licc's avatar licc

新增返回接口数据

parent af509b2b
......@@ -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=")">
......
......@@ -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;
......
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment