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
412a09fe
Commit
412a09fe
authored
Apr 08, 2021
by
licc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化最大进步奖
parent
ebc0dbf0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
44 deletions
+46
-44
MonthTaskServiceImpl.java
...a/cn/wisenergy/service/app/impl/MonthTaskServiceImpl.java
+46
-44
No files found.
wisenergy-service/src/main/java/cn/wisenergy/service/app/impl/MonthTaskServiceImpl.java
View file @
412a09fe
...
@@ -739,52 +739,54 @@ public class MonthTaskServiceImpl implements MonthTaskService {
...
@@ -739,52 +739,54 @@ public class MonthTaskServiceImpl implements MonthTaskService {
String
yearMonth
=
DateUtil
.
convertDateToStr
(
lastMonth
,
PATTERN
);
String
yearMonth
=
DateUtil
.
convertDateToStr
(
lastMonth
,
PATTERN
);
List
<
ProgressPrize
>
addList
=
new
ArrayList
<>();
List
<
ProgressPrize
>
addList
=
new
ArrayList
<>();
List
<
ProgressPrize
>
updateList
=
new
ArrayList
<>();
List
<
ProgressPrize
>
updateList
=
new
ArrayList
<>();
if
(
number
>
0
)
{
for
(
TeamPerformanceSortVo
teamPerformanceSortVo
:
listVo
)
{
for
(
TeamPerformanceSortVo
teamPerformanceSortVo
:
listVo
)
{
String
userId
=
teamPerformanceSortVo
.
getTeamPerformance
().
getUserId
();
String
userId
=
teamPerformanceSortVo
.
getTeamPerformance
().
getUserId
();
Integer
userLevel
=
teamPerformanceSortVo
.
getTeamPerformance
().
getUserLevel
();
Integer
userLevel
=
teamPerformanceSortVo
.
getTeamPerformance
().
getUserLevel
();
//获取最大进步奖 百分比
//获取最大进步奖 百分比
MemberPercent
memberPercent
=
memberPercentMapper
.
getByLevelAndType
(
userLevel
,
3
);
MemberPercent
memberPercent
=
memberPercentMapper
.
getByLevelAndType
(
userLevel
,
3
);
//计算收益
//计算收益
double
userTeamPerformance
=
teamPerformanceSortVo
.
getTeamPerformance
().
getMonthTeamPerformance
().
doubleValue
();
double
userTeamPerformance
=
teamPerformanceSortVo
.
getTeamPerformance
().
getMonthTeamPerformance
().
doubleValue
();
double
percent
=
memberPercent
.
getPercent
().
doubleValue
();
double
percent
=
memberPercent
.
getPercent
().
doubleValue
();
double
income
=
number
*
3980
*
percent
*
userTeamPerformance
/
total
;
double
income
=
number
*
3980
*
percent
*
userTeamPerformance
/
total
;
//获取账户信息
//获取账户信息
AccountInfo
accountInfo
=
accountMapper
.
getByUserId
(
userId
);
AccountInfo
accountInfo
=
accountMapper
.
getByUserId
(
userId
);
//用户月收益 =其他收益+最大进步奖收益
//用户月收益 =其他收益+最大进步奖收益
BigDecimal
earningsMonth
=
accountInfo
.
getEarningsMonth
().
add
(
BigDecimal
.
valueOf
(
income
));
BigDecimal
earningsMonth
=
accountInfo
.
getEarningsMonth
().
add
(
BigDecimal
.
valueOf
(
income
));
accountInfo
.
setEarningsMonth
(
earningsMonth
);
accountInfo
.
setEarningsMonth
(
earningsMonth
);
//用户总收益 =其他总收益 + 最大进步奖收益
//用户总收益 =其他总收益 + 最大进步奖收益
BigDecimal
earningsTotal
=
accountInfo
.
getEarningsTotal
().
add
(
BigDecimal
.
valueOf
(
income
));
BigDecimal
earningsTotal
=
accountInfo
.
getEarningsTotal
().
add
(
BigDecimal
.
valueOf
(
income
));
accountInfo
.
setEarningsTotal
(
earningsTotal
);
accountInfo
.
setEarningsTotal
(
earningsTotal
);
updateAccountList
.
add
(
accountInfo
);
updateAccountList
.
add
(
accountInfo
);
//最大进步奖信息
//最大进步奖信息
ProgressPrize
progressPrize
=
progressPrizeMapper
.
getByUserIdYearMonth
(
userId
,
yearMonth
);
ProgressPrize
progressPrize
=
progressPrizeMapper
.
getByUserIdYearMonth
(
userId
,
yearMonth
);
if
(
null
==
progressPrize
)
{
if
(
null
==
progressPrize
)
{
//新增
//新增
ProgressPrize
addPrize
=
new
ProgressPrize
();
ProgressPrize
addPrize
=
new
ProgressPrize
();
addPrize
.
setAwardMoney
(
income
);
addPrize
.
setAwardMoney
(
income
);
addPrize
.
setYearMonth
(
yearMonth
);
addPrize
.
setYearMonth
(
yearMonth
);
addPrize
.
setGrowthRate
(
0.0
);
addPrize
.
setGrowthRate
(
0.0
);
addPrize
.
setUserId
(
userId
);
addPrize
.
setUserId
(
userId
);
addList
.
add
(
addPrize
);
addList
.
add
(
addPrize
);
}
else
{
}
else
{
progressPrize
.
setGrowthRate
(
teamPerformanceSortVo
.
getGrowthRate
());
progressPrize
.
setGrowthRate
(
teamPerformanceSortVo
.
getGrowthRate
());
progressPrize
.
setAwardMoney
(
income
);
progressPrize
.
setAwardMoney
(
income
);
updateList
.
add
(
progressPrize
);
updateList
.
add
(
progressPrize
);
}
}
}
}
//获取本月存在的最大进步奖列表
//获取本月存在的最大进步奖列表
List
<
ProgressPrize
>
prizes
=
progressPrizeMapper
.
getByYearMonth
(
yearMonth
);
List
<
ProgressPrize
>
prizes
=
progressPrizeMapper
.
getByYearMonth
(
yearMonth
);
//修改或保存最大进步奖信息
//修改或保存最大进步奖信息
// flag 1: 日定时任务 2:月定时任务
// flag 1: 日定时任务 2:月定时任务
int
flag
=
2
;
int
flag
=
2
;
return
accountManager
.
updateOrSavePrize
(
updateAccountList
,
prizes
,
addList
,
updateList
,
flag
);
return
accountManager
.
updateOrSavePrize
(
updateAccountList
,
prizes
,
addList
,
updateList
,
flag
);
}
return
true
;
}
}
}
}
\ No newline at end of file
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