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
d4d97cc7
Commit
d4d97cc7
authored
Mar 02, 2021
by
licc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
最大进步奖 最终优化2
parent
77cea5c4
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
6 deletions
+33
-6
MonthTotalRevenueVo.java
.../main/java/cn/wisenergy/model/vo/MonthTotalRevenueVo.java
+18
-0
AccountService.java
...rc/main/java/cn/wisenergy/service/app/AccountService.java
+2
-0
AccountServiceImpl.java
...ava/cn/wisenergy/service/app/impl/AccountServiceImpl.java
+13
-6
No files found.
wisenergy-model/src/main/java/cn/wisenergy/model/vo/MonthTotalRevenueVo.java
0 → 100644
View file @
d4d97cc7
package
cn
.
wisenergy
.
model
.
vo
;
import
io.swagger.annotations.ApiModel
;
import
lombok.Data
;
/**
* @author 86187
* @ Description: 当月总收益Vo
* @ Author : 86187
* @ Date : 2021/3/2 10:59
*/
@Data
@ApiModel
(
"MonthTotalRevenueVo"
)
public
class
MonthTotalRevenueVo
{
private
String
userId
;
private
Double
balance
;
}
wisenergy-service/src/main/java/cn/wisenergy/service/app/AccountService.java
View file @
d4d97cc7
...
...
@@ -52,4 +52,6 @@ public interface AccountService {
* @return true or false
*/
R
<
Boolean
>
progressPrizeCount
();
}
wisenergy-service/src/main/java/cn/wisenergy/service/app/impl/AccountServiceImpl.java
View file @
d4d97cc7
...
...
@@ -399,21 +399,28 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, AccountInfo>
//要更新的账户列表
List
<
AccountInfo
>
updateAccountList
=
new
ArrayList
<>();
for
(
TeamPerformanceSortVo
sortVo
:
listVo
)
{
String
userId
=
sortVo
.
getTeamPerformance
().
getUserId
();
Integer
userLevel
=
sortVo
.
getTeamPerformance
().
getUserLevel
();
BigDecimal
sum
=
new
BigDecimal
(
0
);
for
(
int
i
=
0
;
i
<
listVo
.
size
();
i
++)
{
String
userId
=
listVo
.
get
(
i
).
getTeamPerformance
().
getUserId
();
Integer
userLevel
=
listVo
.
get
(
i
).
getTeamPerformance
().
getUserLevel
();
//获取最大进步奖 百分比
MemberPercent
memberPercent
=
memberPercentMapper
.
getByLevelAndType
(
userLevel
,
3
);
//计算收益
double
userTeamPerformance
=
sortVo
.
getTeamPerformance
().
getMonthTeamPerformance
().
doubleValue
();
double
userTeamPerformance
=
listVo
.
get
(
i
)
.
getTeamPerformance
().
getMonthTeamPerformance
().
doubleValue
();
double
percent
=
memberPercent
.
getPercent
().
doubleValue
();
double
income
=
number
*
3980
*
percent
*
userTeamPerformance
/
total
;
//获取账户信息
AccountInfo
accountInfo
=
accountMapper
.
getByUserId
(
userId
);
BigDecimal
bigDecimal
=
accountInfo
.
getEarningsMonth
().
add
(
new
BigDecimal
(
income
));
BigDecimal
bigDecimal
;
if
(
i
==
listVo
.
size
()
-
1
)
{
bigDecimal
=
new
BigDecimal
(
total
).
subtract
(
sum
);
}
else
{
bigDecimal
=
accountInfo
.
getEarningsMonth
().
add
(
new
BigDecimal
(
income
));
sum
=
sum
.
add
(
new
BigDecimal
(
income
));
}
accountInfo
.
setEarningsMonth
(
bigDecimal
);
updateAccountList
.
add
(
accountInfo
);
}
...
...
@@ -424,6 +431,6 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, AccountInfo>
List
<
ProgressPrize
>
prizes
=
progressPrizeMapper
.
getByYearMonth
(
yearMonth
);
//修改或保存最大进步奖信息
accountManager
.
updateOrSavePrize
(
listVo
,
updateAccountList
,
prizes
);
accountManager
.
updateOrSavePrize
(
listVo
,
updateAccountList
,
prizes
);
}
}
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