Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
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
6640e265
Commit
6640e265
authored
Jun 16, 2021
by
cq990612
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改user业务逻辑
parent
96afd609
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
16 deletions
+21
-16
UsersMapper.xml
wisenergy-mapper/src/main/resources/mapper/UsersMapper.xml
+2
-2
TestUserServiceImpl.java
...va/cn/wisenergy/service/app/impl/TestUserServiceImpl.java
+19
-14
No files found.
wisenergy-mapper/src/main/resources/mapper/UsersMapper.xml
View file @
6640e265
...
@@ -215,8 +215,8 @@ WHERE
...
@@ -215,8 +215,8 @@ WHERE
u.rank,
u.rank,
a.id_number,
a.id_number,
u.phone,
u.phone,
if(ur.totalRecharge is NULL,0
.00
, round(ur.totalRecharge,2)) 'totalRecharge',
if(ur.totalRecharge is NULL,0, round(ur.totalRecharge,2)) 'totalRecharge',
if(uw.totalWithdrawal is NULL,0
.00
,round(uw.totalWithdrawal,2)) 'totalWithdrawal',
if(uw.totalWithdrawal is NULL,0,round(uw.totalWithdrawal,2)) 'totalWithdrawal',
u.parent_id,
u.parent_id,
aa.real_name 'parentName'
aa.real_name 'parentName'
FROM users u
FROM users u
...
...
wisenergy-service/src/main/java/cn/wisenergy/service/app/impl/TestUserServiceImpl.java
View file @
6640e265
...
@@ -2,10 +2,7 @@ package cn.wisenergy.service.app.impl;
...
@@ -2,10 +2,7 @@ package cn.wisenergy.service.app.impl;
import
cn.wisenergy.common.enums.RespCodeEnum
;
import
cn.wisenergy.common.enums.RespCodeEnum
;
import
cn.wisenergy.common.utils.exception.BaseCustomException
;
import
cn.wisenergy.common.utils.exception.BaseCustomException
;
import
cn.wisenergy.mapper.ActivesMapper
;
import
cn.wisenergy.mapper.*
;
import
cn.wisenergy.mapper.UserRechargeMapper
;
import
cn.wisenergy.mapper.UserWithdrawsMapper
;
import
cn.wisenergy.mapper.UsersMapper
;
import
cn.wisenergy.model.app.Actives
;
import
cn.wisenergy.model.app.Actives
;
import
cn.wisenergy.model.app.Users
;
import
cn.wisenergy.model.app.Users
;
import
cn.wisenergy.model.dto.UserSimpleInfoDto
;
import
cn.wisenergy.model.dto.UserSimpleInfoDto
;
...
@@ -38,15 +35,21 @@ public class TestUserServiceImpl implements TestUserService {
...
@@ -38,15 +35,21 @@ public class TestUserServiceImpl implements TestUserService {
@Autowired
@Autowired
private
ActivesMapper
activesMapper
;
private
ActivesMapper
activesMapper
;
@Autowired
private
UsdtOrderDetailsMapper
usdtOrderDetailsMapper
;
private
final
String
MONEYISEMPTY
=
"0"
;
/**
/**
* 查询下级用户的基本信息
* 查询下级用户的基本信息
*
* @param userId 用户id
* @param userId 用户id
* @return
* @return
*/
*/
@Override
@Override
public
List
<
UserSimpleInfoDto
>
getDownUserInfoById
(
Long
userId
)
{
public
List
<
UserSimpleInfoDto
>
getDownUserInfoById
(
Long
userId
)
{
log
.
info
(
"TestUserServiceImpl[]getDownUserInfoById[]input.param.userId:"
+
userId
);
log
.
info
(
"TestUserServiceImpl[]getDownUserInfoById[]input.param.userId:"
+
userId
);
long
startTime
=
System
.
currentTimeMillis
();
long
startTime
=
System
.
currentTimeMillis
();
// 1.判断用户是否存在
// 1.判断用户是否存在
userIsEmpty
(
userId
);
userIsEmpty
(
userId
);
// 2.获取用户伞下所有用户的信息
// 2.获取用户伞下所有用户的信息
...
@@ -56,6 +59,7 @@ public class TestUserServiceImpl implements TestUserService {
...
@@ -56,6 +59,7 @@ public class TestUserServiceImpl implements TestUserService {
/**
/**
* 查询用户详细信息
* 查询用户详细信息
*
* @param userId 用户id
* @param userId 用户id
* @return
* @return
*/
*/
...
@@ -71,24 +75,25 @@ public class TestUserServiceImpl implements TestUserService {
...
@@ -71,24 +75,25 @@ public class TestUserServiceImpl implements TestUserService {
// 4.查询用户充值和提现总额
// 4.查询用户充值和提现总额
Double
totalRecharge
=
userRechargeMapper
.
getTotalRecharge
(
userId
);
Double
totalRecharge
=
userRechargeMapper
.
getTotalRecharge
(
userId
);
Double
totalWithdrawal
=
userWithdrawsMapper
.
getTotalWithdrawal
(
userId
);
Double
totalWithdrawal
=
userWithdrawsMapper
.
getTotalWithdrawal
(
userId
);
// 5.计算OTC买入卖出
Double
buyTotal
=
usdtOrderDetailsMapper
.
getBuyTotal
(
userId
);
Double
saleTotal
=
usdtOrderDetailsMapper
.
getSaleTotal
(
userId
);
// 5.将查询出来的信息整合到dto类
// 5.将查询出来的信息整合到dto类
BeanUtils
.
copyProperties
(
user
,
userInfoDto
);
BeanUtils
.
copyProperties
(
user
,
userInfoDto
);
if
(
null
!=
userInfo
)
{
if
(
null
!=
userInfo
)
{
BeanUtils
.
copyProperties
(
userInfo
,
userInfoDto
);
BeanUtils
.
copyProperties
(
userInfo
,
userInfoDto
);
}
if
(
null
!=
totalRecharge
)
{
userInfoDto
.
setTotalRecharge
(
totalRecharge
.
toString
());
}
if
(
null
!=
totalWithdrawal
)
{
userInfoDto
.
setTotalWithdrawal
(
totalWithdrawal
.
toString
());
}
}
userInfoDto
.
setTotalRecharge
(
totalRecharge
==
null
?
MONEYISEMPTY
:
totalRecharge
.
toString
());
userInfoDto
.
setTotalWithdrawal
(
totalWithdrawal
==
null
?
MONEYISEMPTY
:
totalWithdrawal
.
toString
());
userInfoDto
.
setBuyTotal
(
buyTotal
==
null
?
MONEYISEMPTY
:
buyTotal
.
toString
());
userInfoDto
.
setSaleTotal
(
saleTotal
==
null
?
MONEYISEMPTY
:
saleTotal
.
toString
());
return
userInfoDto
;
return
userInfoDto
;
}
}
/**
/**
* 判断用户是否存在,存在并返回user信息
* 判断用户是否存在,存在并返回user信息
*
* @param userId
* @param userId
* @return
* @return
*/
*/
...
...
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