Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
S
shop-Mall
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
shop-Mall
Commits
89927325
Commit
89927325
authored
Mar 12, 2021
by
licc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
月度最大进步奖接口自测优化1
parent
02cbc7e2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
10 deletions
+30
-10
AccountServiceImpl.java
...ava/cn/wisenergy/service/app/impl/AccountServiceImpl.java
+2
-1
MonthTaskServiceImpl.java
...a/cn/wisenergy/service/app/impl/MonthTaskServiceImpl.java
+28
-9
No files found.
wisenergy-service/src/main/java/cn/wisenergy/service/app/impl/AccountServiceImpl.java
View file @
89927325
...
...
@@ -300,7 +300,8 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, AccountInfo>
tradeRecord
.
setUserId
(
user
.
getUserId
());
tradeRecord
.
setTradeType
(
TradeRecordEnum
.
PROGRESS_PRIZE
.
getCode
());
tradeRecord
.
setTradeNo
(
null
);
tradeRecord
.
setStatus
(
TradeStatusEnum
.
ALREADY_SETTLE_ACCOUNTS
.
getCode
());
tradeRecord
.
setStatus
(
TradeStatusEnum
.
NO_SETTLE_ACCOUNTS
.
getCode
());
tradeRecord
.
setMoney
(
BigDecimal
.
valueOf
(
income
));
tradeRecordList
.
add
(
tradeRecord
);
}
...
...
wisenergy-service/src/main/java/cn/wisenergy/service/app/impl/MonthTaskServiceImpl.java
View file @
89927325
...
...
@@ -114,7 +114,14 @@ public class MonthTaskServiceImpl implements MonthTaskService {
String
userId
=
entity
.
getKey
();
//1)、统计当前用户月度业绩
double
userCount
=
entity
.
getValue
();
tempMap
.
put
(
userId
,
userCount
);
//key 存在 当前用户团队绩效 + 上级用户团队绩效
if
(
tempMap
.
containsKey
(
entity
.
getKey
()))
{
double
teamMoney
=
userCount
+
tempMap
.
get
(
entity
.
getKey
());
tempMap
.
put
(
entity
.
getKey
(),
teamMoney
);
}
else
{
//key 不存在,加入集合 当前用户团队绩效
tempMap
.
put
(
entity
.
getKey
(),
userCount
);
}
//2)、获取当前用户的上级用户列表
List
<
User
>
userList
=
accountService
.
getByList
(
userId
);
...
...
@@ -126,11 +133,11 @@ public class MonthTaskServiceImpl implements MonthTaskService {
//3)、统计当前用户的上级用户团队绩效
//key 存在 当前用户团队绩效 + 上级用户团队绩效
if
(
tempMap
.
containsKey
(
userInfo
.
getUserId
()))
{
double
teamMoney
=
userCount
+
m
ap
.
get
(
userInfo
.
getUserId
());
m
ap
.
put
(
userInfo
.
getUserId
(),
teamMoney
);
double
teamMoney
=
userCount
+
tempM
ap
.
get
(
userInfo
.
getUserId
());
tempM
ap
.
put
(
userInfo
.
getUserId
(),
teamMoney
);
}
else
{
//key 不存在,加入集合 当前用户团队绩效
m
ap
.
put
(
userInfo
.
getUserId
(),
userCount
);
tempM
ap
.
put
(
userInfo
.
getUserId
(),
userCount
);
}
}
}
...
...
@@ -151,7 +158,6 @@ public class MonthTaskServiceImpl implements MonthTaskService {
performance
.
setMonthTeamPerformance
(
BigDecimal
.
valueOf
(
entity
.
getValue
()));
performance
.
setUserLevel
(
user
.
getUserLevel
());
performance
.
setYearMonth
(
yearMonth
);
teamPerformanceMapper
.
add
(
performance
);
addList
.
add
(
performance
);
}
else
{
teamPerformance
.
setMonthTeamPerformance
(
BigDecimal
.
valueOf
(
entity
.
getValue
()));
...
...
@@ -160,8 +166,8 @@ public class MonthTaskServiceImpl implements MonthTaskService {
}
//4、更新账户月度绩效
boolean
updateBool
=
accountManager
.
updateAccountPerformanceMonth
(
addList
,
updateList
);
if
(!
updateBool
)
{
boolean
updateBool
=
accountManager
.
updateAccountPerformanceMonth
(
addList
,
updateList
);
if
(!
updateBool
)
{
return
R
.
ok
(
1
,
false
);
}
...
...
@@ -214,6 +220,11 @@ public class MonthTaskServiceImpl implements MonthTaskService {
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
);
...
...
@@ -221,11 +232,18 @@ public class MonthTaskServiceImpl implements MonthTaskService {
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
);
//添加交易流水记录
...
...
@@ -234,6 +252,7 @@ public class MonthTaskServiceImpl implements MonthTaskService {
tradeRecord
.
setTradeType
(
TradeRecordEnum
.
PROGRESS_PRIZE
.
getCode
());
tradeRecord
.
setTradeNo
(
null
);
tradeRecord
.
setStatus
(
TradeStatusEnum
.
ALREADY_SETTLE_ACCOUNTS
.
getCode
());
tradeRecord
.
setMoney
(
BigDecimal
.
valueOf
(
income
));
tradeRecordList
.
add
(
tradeRecord
);
}
...
...
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