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
ccf24950
Commit
ccf24950
authored
Mar 19, 2021
by
licc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化设置邀请码
parent
c0576166
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
9 deletions
+13
-9
AccountServiceImpl.java
...ava/cn/wisenergy/service/app/impl/AccountServiceImpl.java
+7
-3
MonthTaskServiceImpl.java
...a/cn/wisenergy/service/app/impl/MonthTaskServiceImpl.java
+4
-4
UserServiceImpl.java
...n/java/cn/wisenergy/service/app/impl/UserServiceImpl.java
+2
-2
No files found.
wisenergy-service/src/main/java/cn/wisenergy/service/app/impl/AccountServiceImpl.java
View file @
ccf24950
...
...
@@ -21,6 +21,7 @@ import org.springframework.util.CollectionUtils;
import
java.math.BigDecimal
;
import
java.math.RoundingMode
;
import
java.text.DecimalFormat
;
import
java.util.*
;
...
...
@@ -397,7 +398,9 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, AccountInfo>
double
month
=
teamPerformance
.
getMonthTeamPerformance
().
doubleValue
();
double
percent
=
memberPercent
.
getPercent
().
doubleValue
();
//计算收益
double
income
=
(
moneyMonth
+
lastMonthAward
)
*
3980
*
percent
*
month
/
teamTotal
;
double
teamMoney
=
(
moneyMonth
+
lastMonthAward
)
*
3980
*
percent
*
month
;
DecimalFormat
df
=
new
DecimalFormat
(
"######0.00"
);
double
income
=
Double
.
parseDouble
(
df
.
format
(
teamMoney
/
teamTotal
));
//获取账户信息
AccountInfo
accountInfo
=
accountMapper
.
getByUserId
(
user
.
getUserId
());
...
...
@@ -405,8 +408,8 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, AccountInfo>
BigDecimal
performanceMonth
=
accountInfo
.
getEarningsMonth
().
add
(
bigDecimal
);
accountInfo
.
setEarningsMonth
(
performanceMonth
);
BigDecimal
performanceTotal
=
accountInfo
.
getEarnings
Month
().
add
(
bigDecimal
);
accountInfo
.
setEarnings
Month
(
performanceTotal
);
BigDecimal
performanceTotal
=
accountInfo
.
getEarnings
Total
().
add
(
bigDecimal
);
accountInfo
.
setEarnings
Total
(
performanceTotal
);
accountInfoList
.
add
(
accountInfo
);
...
...
@@ -526,5 +529,6 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, AccountInfo>
// flag 1: 日定时任务 2:月定时任务
int
flag
=
1
;
return
accountManager
.
updateOrSavePrize
(
listVo
,
updateAccountList
,
prizes
,
flag
);
}
}
wisenergy-service/src/main/java/cn/wisenergy/service/app/impl/MonthTaskServiceImpl.java
View file @
ccf24950
...
...
@@ -320,7 +320,7 @@ public class MonthTaskServiceImpl implements MonthTaskService {
*
* @param totalMoney 月金额总额
* @param userList 用户列表
* @return
* @return
true or false
*/
private
boolean
monthlyIncome
(
BigDecimal
totalMoney
,
List
<
User
>
userList
)
{
//上月
...
...
@@ -373,12 +373,12 @@ public class MonthTaskServiceImpl implements MonthTaskService {
//获取账户信息
AccountInfo
accountInfo
=
accountMapper
.
getByUserId
(
user
.
getUserId
());
BigDecimal
bigDecimal
=
new
BigDecimal
(
income
);
BigDecimal
bigDecimal
=
new
BigDecimal
(
income
)
.
setScale
(
2
,
RoundingMode
.
HALF_UP
)
;
BigDecimal
performanceMonth
=
accountInfo
.
getEarningsMonth
().
add
(
bigDecimal
);
accountInfo
.
setEarningsMonth
(
performanceMonth
.
setScale
(
2
,
RoundingMode
.
HALF_UP
));
BigDecimal
performanceTotal
=
accountInfo
.
getEarnings
Month
().
add
(
bigDecimal
);
accountInfo
.
setEarnings
Month
(
performanceTotal
.
setScale
(
2
,
RoundingMode
.
HALF_UP
));
BigDecimal
performanceTotal
=
accountInfo
.
getEarnings
Total
().
add
(
bigDecimal
);
accountInfo
.
setEarnings
Total
(
performanceTotal
.
setScale
(
2
,
RoundingMode
.
HALF_UP
));
accountInfoList
.
add
(
accountInfo
);
...
...
wisenergy-service/src/main/java/cn/wisenergy/service/app/impl/UserServiceImpl.java
View file @
ccf24950
...
...
@@ -274,8 +274,8 @@ public class UserServiceImpl extends ServiceImpl<UsersMapper, User> implements U
}
//判断用户是否有邀请码 1:无
if
(!
INVITE_CODE
.
equals
(
user
.
get
Invite
Code
()))
{
return
R
.
error
(
"尊敬的用户您好,您的邀请码已存在,不能修改!"
);
if
(!
INVITE_CODE
.
equals
(
user
.
get
BeInvited
Code
()))
{
return
R
.
error
(
"尊敬的用户您好,您的
推荐人
邀请码已存在,不能修改!"
);
}
//2、根据邀请码,获取邀请人信息
...
...
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