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
16964532
Commit
16964532
authored
Apr 09, 2021
by
licc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化月度肥料任务
parent
05ea4456
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
10 deletions
+33
-10
DayTaskServiceImpl.java
...ava/cn/wisenergy/service/app/impl/DayTaskServiceImpl.java
+7
-8
MonthTaskServiceImpl.java
...a/cn/wisenergy/service/app/impl/MonthTaskServiceImpl.java
+26
-2
No files found.
wisenergy-service/src/main/java/cn/wisenergy/service/app/impl/DayTaskServiceImpl.java
View file @
16964532
...
@@ -212,7 +212,7 @@ public class DayTaskServiceImpl implements DayTaskService {
...
@@ -212,7 +212,7 @@ public class DayTaskServiceImpl implements DayTaskService {
return
R
.
ok
(
0
,
true
);
return
R
.
ok
(
0
,
true
);
}
}
//如果用户的团队业绩不存在的,新增本月团队业绩
//
6、
如果用户的团队业绩不存在的,新增本月团队业绩
addTeamPerformance
(
userList
);
addTeamPerformance
(
userList
);
boolean
bool
=
monthlyIncome
(
totalMoney
,
userList
);
boolean
bool
=
monthlyIncome
(
totalMoney
,
userList
);
...
@@ -466,18 +466,17 @@ public class DayTaskServiceImpl implements DayTaskService {
...
@@ -466,18 +466,17 @@ public class DayTaskServiceImpl implements DayTaskService {
if
(
null
!=
memberPercent
)
{
if
(
null
!=
memberPercent
)
{
//获取本月团队总金额
//获取本月团队总金额
TeamPerformance
teamPerformance
=
teamPerformanceMapper
.
getByUserIdAndTime
(
user
.
getUserId
(),
yearMonth
);
TeamPerformance
teamPerformance
=
teamPerformanceMapper
.
getByUserIdAndTime
(
user
.
getUserId
(),
yearMonth
);
if
(
null
==
teamPerformance
){
}
//获取该等级团队总金额
//获取该等级团队总金额
Double
teamTotal
=
teamPerformanceMapper
.
countTeamMoney
(
user
.
getUserLevel
(),
yearMonth
);
Double
teamTotal
=
teamPerformanceMapper
.
countTeamMoney
(
user
.
getUserLevel
(),
yearMonth
);
if
(
null
!=
teamPerformance
&&
null
!=
teamTotal
)
{
if
(
null
!=
teamPerformance
&&
null
!=
teamTotal
&&
teamTotal
!=
0
)
{
double
month
=
teamPerformance
.
getMonthTeamPerformance
().
doubleValue
();
double
month
=
teamPerformance
.
getMonthTeamPerformance
().
doubleValue
();
double
percent
=
memberPercent
.
getPercent
().
doubleValue
();
double
percent
=
memberPercent
.
getPercent
().
doubleValue
();
//计算收益
todo
//计算收益
double
teamMoney
=
((
moneyMonth
*
3980
)
+
lastMonthAward
)
*
percent
*
month
;
double
teamMoney
=
((
moneyMonth
*
3980
)
+
lastMonthAward
)
*
percent
*
month
;
DecimalFormat
df
=
new
DecimalFormat
(
"######0.00"
);
double
income
=
teamMoney
/
teamTotal
;
double
income
=
Double
.
parseDouble
(
df
.
format
(
teamMoney
/
teamTotal
));
if
(
income
==
0
)
{
continue
;
}
//获取账户信息
//获取账户信息
AccountInfo
accountInfo
=
accountMapper
.
getByUserId
(
user
.
getUserId
());
AccountInfo
accountInfo
=
accountMapper
.
getByUserId
(
user
.
getUserId
());
...
...
wisenergy-service/src/main/java/cn/wisenergy/service/app/impl/MonthTaskServiceImpl.java
View file @
16964532
...
@@ -193,6 +193,9 @@ public class MonthTaskServiceImpl implements MonthTaskService {
...
@@ -193,6 +193,9 @@ public class MonthTaskServiceImpl implements MonthTaskService {
return
R
.
ok
(
0
,
true
);
return
R
.
ok
(
0
,
true
);
}
}
//6、如果用户的团队业绩不存在的,新增本月团队业绩
addTeamPerformance
(
userList
);
//6、计算收益
//6、计算收益
boolean
bool
=
monthlyIncome
(
totalMoney
,
userList
);
boolean
bool
=
monthlyIncome
(
totalMoney
,
userList
);
if
(!
bool
)
{
if
(!
bool
)
{
...
@@ -558,12 +561,14 @@ public class MonthTaskServiceImpl implements MonthTaskService {
...
@@ -558,12 +561,14 @@ public class MonthTaskServiceImpl implements MonthTaskService {
//获取上月该等级团队总金额
//获取上月该等级团队总金额
Double
teamTotal
=
teamPerformanceMapper
.
countTeamMoney
(
user
.
getUserLevel
(),
lastMonth
);
Double
teamTotal
=
teamPerformanceMapper
.
countTeamMoney
(
user
.
getUserLevel
(),
lastMonth
);
if
(
null
!=
teamPerformance
&&
null
!=
teamTotal
)
{
if
(
null
!=
teamPerformance
&&
null
!=
teamTotal
&&
teamTotal
!=
0
)
{
double
month
=
teamPerformance
.
getMonthTeamPerformance
().
doubleValue
();
double
month
=
teamPerformance
.
getMonthTeamPerformance
().
doubleValue
();
double
percent
=
memberPercent
.
getPercent
().
doubleValue
();
double
percent
=
memberPercent
.
getPercent
().
doubleValue
();
//计算收益
//计算收益
double
income
=
((
moneyMonth
*
3980
)
+
lastMonthAward
)
*
percent
*
month
/
teamTotal
;
double
income
=
((
moneyMonth
*
3980
)
+
lastMonthAward
)
*
percent
*
month
/
teamTotal
;
if
(
income
==
0
)
{
continue
;
}
//获取账户信息
//获取账户信息
AccountInfo
accountInfo
=
accountMapper
.
getByUserId
(
user
.
getUserId
());
AccountInfo
accountInfo
=
accountMapper
.
getByUserId
(
user
.
getUserId
());
BigDecimal
bigDecimal
=
new
BigDecimal
(
income
).
setScale
(
2
,
RoundingMode
.
HALF_UP
);
BigDecimal
bigDecimal
=
new
BigDecimal
(
income
).
setScale
(
2
,
RoundingMode
.
HALF_UP
);
...
@@ -804,4 +809,23 @@ public class MonthTaskServiceImpl implements MonthTaskService {
...
@@ -804,4 +809,23 @@ public class MonthTaskServiceImpl implements MonthTaskService {
}
}
return
true
;
return
true
;
}
}
private
void
addTeamPerformance
(
List
<
User
>
userList
)
{
Date
lastMonth
=
DateUtil
.
getLastMonth
(
new
Date
());
String
yearMonth
=
DateUtil
.
convertDateToStr
(
lastMonth
,
"yyyy-MM"
);
if
(!
CollectionUtils
.
isEmpty
(
userList
))
{
for
(
User
user
:
userList
)
{
//获取团队业绩信息
TeamPerformance
teamPerformance
=
teamPerformanceMapper
.
getByUserIdAndTime
(
user
.
getUserId
(),
yearMonth
);
if
(
null
==
teamPerformance
)
{
TeamPerformance
addTeam
=
new
TeamPerformance
();
addTeam
.
setMonthTeamPerformance
(
new
BigDecimal
(
0
));
addTeam
.
setYearMonth
(
yearMonth
);
addTeam
.
setUserLevel
(
user
.
getUserLevel
());
addTeam
.
setUserId
(
user
.
getUserId
());
teamPerformanceMapper
.
add
(
addTeam
);
}
}
}
}
}
}
\ 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