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
a8586f2d
Commit
a8586f2d
authored
Apr 02, 2021
by
codezwjava
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改月度升级任务执行后若有用户升级进行培育奖收益累加到账户表各收益字段
parent
8bdb8273
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
0 deletions
+33
-0
MonthUserLevelServiceImpl.java
...wisenergy/service/app/impl/MonthUserLevelServiceImpl.java
+33
-0
No files found.
wisenergy-service/src/main/java/cn/wisenergy/service/app/impl/MonthUserLevelServiceImpl.java
View file @
a8586f2d
...
...
@@ -18,6 +18,9 @@ public class MonthUserLevelServiceImpl implements MonthUserLevelService {
@Autowired
private
OrderMapper
orderMapper
;
@Autowired
private
AccountMapper
accountMapper
;
@Autowired
private
CultivatingPrizeMapper
cultivatingPrizeMapper
;
...
...
@@ -652,6 +655,7 @@ public class MonthUserLevelServiceImpl implements MonthUserLevelService {
seedling
=
1
;
cultivatingPrizeInfo
.
setSeedling
(
seedling
);
lastMonthCultivatingPrizeInfoMapper
.
updateById
(
cultivatingPrizeInfo
);
accountAddFromCultivatingPrize
(
inviteUserId
,
cultivatingPrize
);
}
else
{
//3.修改培育奖记录状态 ==2
seedling
=
2
;
...
...
@@ -686,6 +690,7 @@ public class MonthUserLevelServiceImpl implements MonthUserLevelService {
bronzeTree
=
1
;
cultivatingPrizeInfo
.
setBronzeTree
(
bronzeTree
);
lastMonthCultivatingPrizeInfoMapper
.
updateById
(
cultivatingPrizeInfo
);
accountAddFromCultivatingPrize
(
inviteUserId
,
cultivatingPrize
);
}
else
{
//3.修改培育奖记录状态 ==2
bronzeTree
=
2
;
...
...
@@ -720,6 +725,7 @@ public class MonthUserLevelServiceImpl implements MonthUserLevelService {
silverTree
=
1
;
cultivatingPrizeInfo
.
setBronzeTree
(
silverTree
);
lastMonthCultivatingPrizeInfoMapper
.
updateById
(
cultivatingPrizeInfo
);
accountAddFromCultivatingPrize
(
inviteUserId
,
cultivatingPrize
);
}
else
{
//3.修改培育奖记录状态 ==2
silverTree
=
2
;
...
...
@@ -753,6 +759,7 @@ public class MonthUserLevelServiceImpl implements MonthUserLevelService {
goldTree
=
1
;
cultivatingPrizeInfo
.
setGoldTree
(
goldTree
);
lastMonthCultivatingPrizeInfoMapper
.
updateById
(
cultivatingPrizeInfo
);
accountAddFromCultivatingPrize
(
inviteUserId
,
cultivatingPrize
);
}
else
{
//3.修改培育奖记录状态 ==2
goldTree
=
2
;
...
...
@@ -786,6 +793,7 @@ public class MonthUserLevelServiceImpl implements MonthUserLevelService {
farmer
=
1
;
cultivatingPrizeInfo
.
setGoldTree
(
farmer
);
lastMonthCultivatingPrizeInfoMapper
.
updateById
(
cultivatingPrizeInfo
);
accountAddFromCultivatingPrize
(
inviteUserId
,
cultivatingPrize
);
}
else
{
//3.修改培育奖记录状态 ==2
farmer
=
2
;
...
...
@@ -819,6 +827,7 @@ public class MonthUserLevelServiceImpl implements MonthUserLevelService {
forestStart
=
1
;
cultivatingPrizeInfo
.
setGoldTree
(
forestStart
);
lastMonthCultivatingPrizeInfoMapper
.
updateById
(
cultivatingPrizeInfo
);
accountAddFromCultivatingPrize
(
inviteUserId
,
cultivatingPrize
);
}
else
{
//3.修改培育奖记录状态 ==2
forestStart
=
2
;
...
...
@@ -852,6 +861,7 @@ public class MonthUserLevelServiceImpl implements MonthUserLevelService {
partner
=
1
;
cultivatingPrizeInfo
.
setGoldTree
(
partner
);
lastMonthCultivatingPrizeInfoMapper
.
updateById
(
cultivatingPrizeInfo
);
accountAddFromCultivatingPrize
(
inviteUserId
,
cultivatingPrize
);
}
else
{
//3.修改培育奖记录状态 ==2
partner
=
2
;
...
...
@@ -863,4 +873,27 @@ public class MonthUserLevelServiceImpl implements MonthUserLevelService {
}
}
/**
* 月度升级定时任务校准执行完成以后若有下级用户升级成功后
* 需要将用户的培育奖收益与账户表进行累加
*
*/
public
void
accountAddFromCultivatingPrize
(
String
userId
,
BigDecimal
cultivatingPrize
){
AccountInfo
accountMapperByUserId
=
accountMapper
.
getByUserId
(
userId
);
//可提现金额
BigDecimal
extractMoney
=
accountMapperByUserId
.
getExtractMoney
();
//本月收益
BigDecimal
earningsMonth
=
accountMapperByUserId
.
getEarningsMonth
();
//累计收益
BigDecimal
earningsTotal
=
accountMapperByUserId
.
getEarningsTotal
();
accountMapperByUserId
.
setExtractMoney
(
extractMoney
.
add
(
cultivatingPrize
));
accountMapperByUserId
.
setEarningsMonth
(
earningsMonth
.
add
(
cultivatingPrize
));
accountMapperByUserId
.
setEarningsTotal
(
earningsTotal
.
add
(
cultivatingPrize
));
accountMapper
.
edit
(
accountMapperByUserId
);
}
}
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