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
fcd5b3de
Commit
fcd5b3de
authored
Mar 16, 2021
by
licc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化月定时任务
parent
cf86cd18
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
10 deletions
+12
-10
AccountServiceImpl.java
...ava/cn/wisenergy/service/app/impl/AccountServiceImpl.java
+3
-0
MonthTaskServiceImpl.java
...a/cn/wisenergy/service/app/impl/MonthTaskServiceImpl.java
+9
-10
No files found.
wisenergy-service/src/main/java/cn/wisenergy/service/app/impl/AccountServiceImpl.java
View file @
fcd5b3de
...
...
@@ -348,6 +348,9 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, AccountInfo>
if
(
null
!=
user
&&
!
StringUtils
.
isBlank
(
user
.
getBeInvitedCode
()))
{
User
userInfo
=
usersMapper
.
getByBeInvitedCode
(
user
.
getBeInvitedCode
());
if
(
null
!=
userInfo
)
{
if
(
userInfo
.
getBeInvitedCode
().
equals
(
userInfo
.
getInviteCode
())){
return
;
}
getUser
(
list
,
userInfo
.
getUserId
());
}
}
...
...
wisenergy-service/src/main/java/cn/wisenergy/service/app/impl/MonthTaskServiceImpl.java
View file @
fcd5b3de
...
...
@@ -81,8 +81,7 @@ public class MonthTaskServiceImpl implements MonthTaskService {
return
R
.
ok
(
0
,
true
);
}
Date
date
=
new
Date
();
String
yearMonth
=
DateUtil
.
convertDateToStr
(
date
,
PATTERN
);
String
yearMonth
=
DateUtil
.
convertDateToStr
(
lastMonth
,
PATTERN
);
//计算上月所有订单成交额
BigDecimal
totalMoney
=
new
BigDecimal
(
0
);
...
...
@@ -328,17 +327,17 @@ public class MonthTaskServiceImpl implements MonthTaskService {
private
boolean
monthlyIncome
(
BigDecimal
totalMoney
,
List
<
User
>
userList
)
{
double
total
=
totalMoney
.
doubleValue
();
Date
date
=
new
Date
();
String
year
Month
=
DateUtil
.
convertDateToStr
(
date
,
PATTERN
);
String
last
Month
=
DateUtil
.
convertDateToStr
(
date
,
PATTERN
);
//当月所有人订单成交总金额/3980/12 向下取整
double
moneyMonth
=
Math
.
floor
(
total
/
3980
/
12
);
List
<
AccountInfo
>
accountInfoList
=
new
ArrayList
<>();
List
<
TradeRecord
>
tradeRecordList
=
new
ArrayList
<>();
//获取上月未分配完的奖金
//获取上
上
月未分配完的奖金
double
lastMonthAward
;
Date
last
=
DateUtil
.
getLastMonth
(
new
Date
()
);
String
yearMonthTime
=
DateUtil
.
convertDateToStr
(
last
,
PATTERN
);
Date
last
AndLast
=
DateUtil
.
convertStrToDate
(
lastMonth
,
"yyyy-MM-dd"
);
String
yearMonthTime
=
DateUtil
.
convertDateToStr
(
last
AndLast
,
PATTERN
);
MonthManure
monthManure
=
monthManureMapper
.
queryByTime
(
yearMonthTime
);
if
(
null
==
monthManure
)
{
lastMonthAward
=
0.00
;
...
...
@@ -356,11 +355,11 @@ public class MonthTaskServiceImpl implements MonthTaskService {
MemberPercent
memberPercent
=
memberPercentMapper
.
getByLevelAndType
(
user
.
getUserLevel
(),
MemberPercentEnum
.
MONTH_MANURE
.
getCode
());
if
(
null
!=
memberPercent
)
{
//获取
本
月团队总金额
TeamPerformance
teamPerformance
=
teamPerformanceMapper
.
getByUserIdAndTime
(
user
.
getUserId
(),
year
Month
);
//获取
上月
月团队总金额
TeamPerformance
teamPerformance
=
teamPerformanceMapper
.
getByUserIdAndTime
(
user
.
getUserId
(),
last
Month
);
//获取该等级团队总金额
Double
teamTotal
=
teamPerformanceMapper
.
countTeamMoney
(
user
.
getUserLevel
(),
year
Month
);
//获取
上月
该等级团队总金额
Double
teamTotal
=
teamPerformanceMapper
.
countTeamMoney
(
user
.
getUserLevel
(),
last
Month
);
if
(
null
!=
teamPerformance
&&
null
!=
teamTotal
)
{
double
month
=
teamPerformance
.
getMonthTeamPerformance
().
doubleValue
();
double
percent
=
memberPercent
.
getPercent
().
doubleValue
();
...
...
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