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
02cbc7e2
Commit
02cbc7e2
authored
Mar 12, 2021
by
licc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
月度最大进步奖接口自测优化
parent
aed47833
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
6 deletions
+15
-6
AccountServiceImpl.java
...ava/cn/wisenergy/service/app/impl/AccountServiceImpl.java
+15
-6
No files found.
wisenergy-service/src/main/java/cn/wisenergy/service/app/impl/AccountServiceImpl.java
View file @
02cbc7e2
...
...
@@ -5,10 +5,7 @@ import cn.wisenergy.common.utils.R;
import
cn.wisenergy.mapper.*
;
import
cn.wisenergy.model.app.*
;
import
cn.wisenergy.model.enums.MemberPercentEnum
;
import
cn.wisenergy.model.enums.RebateStatusEnum
;
import
cn.wisenergy.model.enums.TradeRecordEnum
;
import
cn.wisenergy.model.enums.TradeStatusEnum
;
import
cn.wisenergy.model.enums.*
;
import
cn.wisenergy.model.vo.TeamPerformanceSortVo
;
import
cn.wisenergy.service.Manager.PublicManager
;
import
cn.wisenergy.service.app.AccountService
;
...
...
@@ -272,6 +269,11 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, AccountInfo>
List
<
AccountInfo
>
accountInfoList
=
new
ArrayList
<>();
List
<
TradeRecord
>
tradeRecordList
=
new
ArrayList
<>();
for
(
TeamPerformance
user
:
list
)
{
//用户是普通用户的,不计算最大进步奖
if
(
user
.
getUserLevel
().
equals
(
UserLevelEnum
.
NORMAL_USER
.
getCode
()))
{
continue
;
}
//获取最大进步奖 百分比
MemberPercent
memberPercent
=
memberPercentMapper
.
getByLevelAndType
(
user
.
getUserLevel
(),
3
);
...
...
@@ -279,11 +281,18 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, AccountInfo>
double
userTeamPerformance
=
user
.
getMonthTeamPerformance
().
doubleValue
();
double
percent
=
memberPercent
.
getPercent
().
doubleValue
();
double
income
=
number
*
3980
*
percent
*
userTeamPerformance
/
twentyTotal
;
double
income
=
Math
.
floor
(
number
*
3980
*
percent
*
userTeamPerformance
/
twentyTotal
)
;
//获取账户信息
AccountInfo
accountInfo
=
accountMapper
.
getByUserId
(
user
.
getUserId
());
accountInfo
.
setEarningsMonth
(
new
BigDecimal
(
income
));
//用户月收益 =其他收益+最大进步奖收益
BigDecimal
earningsMonth
=
accountInfo
.
getEarningsMonth
().
add
(
BigDecimal
.
valueOf
(
income
));
accountInfo
.
setEarningsMonth
(
earningsMonth
);
//用户总收益 =其他总收益 + earningsMonth
BigDecimal
earningsTotal
=
accountInfo
.
getEarningsTotal
().
add
(
BigDecimal
.
valueOf
(
income
));
accountInfo
.
setEarningsTotal
(
earningsTotal
);
accountInfoList
.
add
(
accountInfo
);
//添加交易流水记录
...
...
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