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
ed42d163
Commit
ed42d163
authored
Mar 22, 2021
by
licc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化月度任务接口
parent
b3765080
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
10 deletions
+37
-10
TradeRecord.java
...del/src/main/java/cn/wisenergy/model/app/TradeRecord.java
+3
-2
AccountServiceImpl.java
...ava/cn/wisenergy/service/app/impl/AccountServiceImpl.java
+19
-5
MonthTaskServiceImpl.java
...a/cn/wisenergy/service/app/impl/MonthTaskServiceImpl.java
+15
-3
No files found.
wisenergy-model/src/main/java/cn/wisenergy/model/app/TradeRecord.java
View file @
ed42d163
...
...
@@ -32,9 +32,10 @@ public class TradeRecord implements Serializable {
private
String
userId
;
/**
* 交易记录类型 1:提现 2:订单返佣 3:订单下单 4:月度肥料 5:培育奖 6:工资奖励 7:进步奖
* 交易记录类型 1:提现 2:订单返佣 3:订单下单 4:月度肥料 5:培育奖 6:工资奖励 7:进步奖
8:运营中心补贴
*/
@ApiModelProperty
(
name
=
"tradeType"
,
value
=
"交易类型 1:提现 2:订单返佣 3:订单下单 4:月度肥料 5:培育奖 6:工资 7:进步奖"
)
@ApiModelProperty
(
name
=
"tradeType"
,
value
=
"交易类型 1:提现 2:订单返佣 3:订单下单 4:月度肥料 5:培育奖 "
+
"6:工资 7:进步奖 8:运营中心补贴"
)
private
Integer
tradeType
;
/**
...
...
wisenergy-service/src/main/java/cn/wisenergy/service/app/impl/AccountServiceImpl.java
View file @
ed42d163
...
...
@@ -62,6 +62,9 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, AccountInfo>
@Autowired
private
MonthManureMapper
monthManureMapper
;
@Autowired
private
LastAccountMapper
lastAccountMapper
;
private
static
final
String
PATTERN
=
"yyyy-MM"
;
private
static
final
Integer
TWENTY
=
20
;
...
...
@@ -286,7 +289,7 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, AccountInfo>
BigDecimal
earningsMonth
=
accountInfo
.
getEarningsMonth
().
add
(
BigDecimal
.
valueOf
(
income
));
accountInfo
.
setEarningsMonth
(
earningsMonth
);
//用户总收益 =其他总收益 +
earningsMonth
//用户总收益 =其他总收益 +
最大进步奖收益
BigDecimal
earningsTotal
=
accountInfo
.
getEarningsTotal
().
add
(
BigDecimal
.
valueOf
(
income
));
accountInfo
.
setEarningsTotal
(
earningsTotal
);
accountInfoList
.
add
(
accountInfo
);
...
...
@@ -319,7 +322,7 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, AccountInfo>
//更新账户信息,添加交易流水记录
boolean
bool
=
accountManager
.
updateAccountAddRecordAddPrize
(
accountInfoList
,
tradeRecordList
,
addPrizeList
,
updatePrizeList
);
addPrizeList
,
updatePrizeList
);
if
(!
bool
)
{
return
R
.
ok
(
1
,
false
);
}
...
...
@@ -414,14 +417,25 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, AccountInfo>
//获取账户信息
AccountInfo
accountInfo
=
accountMapper
.
getByUserId
(
user
.
getUserId
());
BigDecimal
bigDecimal
=
new
BigDecimal
(
income
);
BigDecimal
performanceMonth
=
accountInfo
.
getEarningsMonth
().
add
(
bigDecimal
);
//获取用户本月收益=可提现金额+ 本月肥料收益
BigDecimal
performanceMonth
=
accountInfo
.
getExtractMoney
().
add
(
bigDecimal
);
accountInfo
.
setEarningsMonth
(
performanceMonth
);
BigDecimal
performanceTotal
=
accountInfo
.
getEarningsTotal
().
add
(
bigDecimal
);
//获取用户上月总收益
LastMonthAccount
lastMonthAccount
=
lastAccountMapper
.
getByUserIdAndTime
(
user
.
getUserId
(),
yearMonthTime
);
BigDecimal
lastTotalMonth
;
if
(
null
==
lastMonthAccount
||
null
==
lastMonthAccount
.
getEarningsTotal
())
{
lastTotalMonth
=
new
BigDecimal
(
"0.00"
);
}
else
{
lastTotalMonth
=
lastMonthAccount
.
getEarningsTotal
();
}
//用户总收益=上月总收益+本月收益
BigDecimal
performanceTotal
=
lastTotalMonth
.
add
(
performanceMonth
);
accountInfo
.
setEarningsTotal
(
performanceTotal
);
accountInfoList
.
add
(
accountInfo
);
//5、添加交易流水记录
TradeRecord
tradeRecord
=
new
TradeRecord
();
tradeRecord
.
setUserId
(
user
.
getUserId
());
...
...
wisenergy-service/src/main/java/cn/wisenergy/service/app/impl/MonthTaskServiceImpl.java
View file @
ed42d163
...
...
@@ -449,10 +449,22 @@ public class MonthTaskServiceImpl implements MonthTaskService {
//获取账户信息
AccountInfo
accountInfo
=
accountMapper
.
getByUserId
(
user
.
getUserId
());
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
.
getEarningsTotal
().
add
(
bigDecimal
);
//获取用户上月月收益=可提现金额+ 上月肥料收益
BigDecimal
performanceMonth
=
accountInfo
.
getExtractMoney
().
add
(
bigDecimal
);
accountInfo
.
setEarningsMonth
(
performanceMonth
);
//获取用户上上月总收益
LastMonthAccount
lastMonthAccount
=
lastAccountMapper
.
getByUserIdAndTime
(
user
.
getUserId
(),
yearMonthTime
);
BigDecimal
lastTotalMonth
;
if
(
null
==
lastMonthAccount
||
null
==
lastMonthAccount
.
getEarningsTotal
())
{
lastTotalMonth
=
new
BigDecimal
(
"0.00"
);
}
else
{
lastTotalMonth
=
lastMonthAccount
.
getEarningsTotal
();
}
//用户总收益=上上月总收益+上月收益
BigDecimal
performanceTotal
=
lastTotalMonth
.
add
(
performanceMonth
);
accountInfo
.
setEarningsTotal
(
performanceTotal
.
setScale
(
2
,
RoundingMode
.
HALF_UP
));
accountInfoList
.
add
(
accountInfo
);
...
...
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