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
ebc0dbf0
Commit
ebc0dbf0
authored
3 years ago
by
licc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix sql
parent
70fe96ea
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
50 additions
and
47 deletions
+50
-47
OrderMapper.xml
wisenergy-mapper/src/main/resources/mapper/OrderMapper.xml
+1
-0
DayTaskServiceImpl.java
...ava/cn/wisenergy/service/app/impl/DayTaskServiceImpl.java
+49
-47
No files found.
wisenergy-mapper/src/main/resources/mapper/OrderMapper.xml
View file @
ebc0dbf0
...
...
@@ -124,6 +124,7 @@
<include
refid=
"table"
/>
<where>
user_id=#{userid}
and pay_type
<![CDATA[ <> ]]>
0
</where>
</select>
...
...
This diff is collapsed.
Click to expand it.
wisenergy-service/src/main/java/cn/wisenergy/service/app/impl/DayTaskServiceImpl.java
View file @
ebc0dbf0
...
...
@@ -523,58 +523,60 @@ public class DayTaskServiceImpl implements DayTaskService {
List
<
ProgressPrize
>
addList
=
new
ArrayList
<>();
List
<
ProgressPrize
>
updateList
=
new
ArrayList
<>();
for
(
TeamPerformanceSortVo
teamVo
:
listVo
)
{
String
userId
=
teamVo
.
getTeamPerformance
().
getUserId
();
Integer
userLevel
=
teamVo
.
getTeamPerformance
().
getUserLevel
();
//获取最大进步奖 百分比
MemberPercent
memberPercent
=
memberPercentMapper
.
getByLevelAndType
(
userLevel
,
3
);
//计算收益
double
userTeamPerformance
=
teamVo
.
getTeamPerformance
().
getMonthTeamPerformance
().
doubleValue
();
double
percent
=
memberPercent
.
getPercent
().
doubleValue
();
double
income
=
number
*
3980
*
percent
*
userTeamPerformance
/
total
;
//获取账户信息
AccountInfo
accountInfo
=
accountMapper
.
getByUserId
(
userId
);
//用户月收益 =其他收益+最大进步奖收益
BigDecimal
earningsMonth
=
accountInfo
.
getEarningsMonth
().
add
(
BigDecimal
.
valueOf
(
income
));
accountInfo
.
setEarningsMonth
(
earningsMonth
);
//用户总收益 =其他总收益 + 最大进步奖收益
BigDecimal
earningsTotal
=
accountInfo
.
getEarningsTotal
().
add
(
BigDecimal
.
valueOf
(
income
));
accountInfo
.
setEarningsTotal
(
earningsTotal
);
updateAccountList
.
add
(
accountInfo
);
//最大进步奖信息
ProgressPrize
progressPrize
=
progressPrizeMapper
.
getByUserIdYearMonth
(
userId
,
yearMonth
);
if
(
null
==
progressPrize
)
{
//新增
ProgressPrize
addPrize
=
new
ProgressPrize
();
addPrize
.
setAwardMoney
(
income
);
addPrize
.
setYearMonth
(
yearMonth
);
addPrize
.
setGrowthRate
(
0.0
);
addPrize
.
setUserId
(
userId
);
addList
.
add
(
addPrize
);
}
else
{
progressPrize
.
setGrowthRate
(
teamVo
.
getGrowthRate
());
progressPrize
.
setAwardMoney
(
income
);
if
(
income
>
0
)
{
progressPrize
.
setGrowthRate
(
teamVo
.
getGrowthRate
());
if
(
number
>
0
)
{
for
(
TeamPerformanceSortVo
teamVo
:
listVo
)
{
String
userId
=
teamVo
.
getTeamPerformance
().
getUserId
();
Integer
userLevel
=
teamVo
.
getTeamPerformance
().
getUserLevel
();
//获取最大进步奖 百分比
MemberPercent
memberPercent
=
memberPercentMapper
.
getByLevelAndType
(
userLevel
,
3
);
//计算收益
double
userTeamPerformance
=
teamVo
.
getTeamPerformance
().
getMonthTeamPerformance
().
doubleValue
();
double
percent
=
memberPercent
.
getPercent
().
doubleValue
();
double
income
=
number
*
3980
*
percent
*
userTeamPerformance
/
total
;
//获取账户信息
AccountInfo
accountInfo
=
accountMapper
.
getByUserId
(
userId
);
//用户月收益 =其他收益+最大进步奖收益
BigDecimal
earningsMonth
=
accountInfo
.
getEarningsMonth
().
add
(
BigDecimal
.
valueOf
(
income
));
accountInfo
.
setEarningsMonth
(
earningsMonth
);
//用户总收益 =其他总收益 + 最大进步奖收益
BigDecimal
earningsTotal
=
accountInfo
.
getEarningsTotal
().
add
(
BigDecimal
.
valueOf
(
income
));
accountInfo
.
setEarningsTotal
(
earningsTotal
);
updateAccountList
.
add
(
accountInfo
);
//最大进步奖信息
ProgressPrize
progressPrize
=
progressPrizeMapper
.
getByUserIdYearMonth
(
userId
,
yearMonth
);
if
(
null
==
progressPrize
)
{
//新增
ProgressPrize
addPrize
=
new
ProgressPrize
();
addPrize
.
setAwardMoney
(
income
);
addPrize
.
setYearMonth
(
yearMonth
);
addPrize
.
setGrowthRate
(
0.0
);
addPrize
.
setUserId
(
userId
);
addList
.
add
(
addPrize
);
}
else
{
progressPrize
.
setGrowthRate
(
0.0
);
progressPrize
.
setGrowthRate
(
teamVo
.
getGrowthRate
());
progressPrize
.
setAwardMoney
(
income
);
if
(
income
>
0
)
{
progressPrize
.
setGrowthRate
(
teamVo
.
getGrowthRate
());
}
else
{
progressPrize
.
setGrowthRate
(
0.0
);
}
updateList
.
add
(
progressPrize
);
}
updateList
.
add
(
progressPrize
);
}
}
//获取本月已经存在的最大进步奖列表
List
<
ProgressPrize
>
prizes
=
progressPrizeMapper
.
getByYearMonth
(
yearMonth
);
//修改或保存最大进步奖信息
// flag 1: 日定时任务 2:月定时任务
int
flag
=
1
;
return
accountManager
.
updateOrSavePrize
(
updateAccountList
,
prizes
,
addList
,
updateList
,
flag
);
//获取本月已经存在的最大进步奖列表
List
<
ProgressPrize
>
prizes
=
progressPrizeMapper
.
getByYearMonth
(
yearMonth
);
//修改或保存最大进步奖信息
// flag 1: 日定时任务 2:月定时任务
int
flag
=
1
;
return
accountManager
.
updateOrSavePrize
(
updateAccountList
,
prizes
,
addList
,
updateList
,
flag
);
}
return
true
;
}
private
void
addTeamPerformance
(
List
<
User
>
userList
)
{
...
...
This diff is collapsed.
Click to expand it.
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