Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
B
browser-backend
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
Administrator
browser-backend
Commits
9ec882e0
Commit
9ec882e0
authored
Mar 30, 2020
by
renjie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
费用明细增加余额
parent
2f215f01
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
33 additions
and
6 deletions
+33
-6
Promotion.java
...va/com/edgec/browserbackend/account/domain/Promotion.java
+12
-0
UserPrePaidBilling.java
...gec/browserbackend/account/domain/UserPrePaidBilling.java
+10
-0
AccountServiceImpl.java
...owserbackend/account/service/impl/AccountServiceImpl.java
+1
-0
PaymentServiceImpl.java
...owserbackend/account/service/impl/PaymentServiceImpl.java
+10
-6
No files found.
src/main/java/com/edgec/browserbackend/account/domain/Promotion.java
View file @
9ec882e0
package
com
.
edgec
.
browserbackend
.
account
.
domain
;
import
com.fasterxml.jackson.annotation.JsonIgnoreProperties
;
/**
* @Desc
* @Author jason
* @CreateTime 2020/3/12 3:14 下午
**/
@JsonIgnoreProperties
(
ignoreUnknown
=
true
)
public
class
Promotion
{
private
String
code
;
private
int
invitedUsers
;
private
int
commission
;
private
boolean
isSale
;
public
int
getCommission
()
{
return
commission
;
...
...
@@ -33,4 +37,12 @@ public class Promotion {
public
void
setCode
(
String
code
)
{
this
.
code
=
code
;
}
public
boolean
isSale
()
{
return
isSale
;
}
public
void
setSale
(
boolean
sale
)
{
isSale
=
sale
;
}
}
src/main/java/com/edgec/browserbackend/account/domain/UserPrePaidBilling.java
View file @
9ec882e0
...
...
@@ -50,6 +50,8 @@ public class UserPrePaidBilling {
private
String
administrator
;
private
float
balanced
;
private
List
<
DeductionRecord
>
deductionRecords
=
new
ArrayList
<>();
public
float
getRate
()
{
...
...
@@ -199,4 +201,12 @@ public class UserPrePaidBilling {
public
void
setAdministrator
(
String
administrator
)
{
this
.
administrator
=
administrator
;
}
public
float
getBalanced
()
{
return
balanced
;
}
public
void
setBalanced
(
float
balanced
)
{
this
.
balanced
=
balanced
;
}
}
src/main/java/com/edgec/browserbackend/account/service/impl/AccountServiceImpl.java
View file @
9ec882e0
...
...
@@ -252,6 +252,7 @@ public class AccountServiceImpl implements AccountService {
int
year
=
lastmonth
.
getYear
();
bill
.
setYear
(
year
);
bill
.
setMonth
(
monthValue
);
bill
.
setBalanced
(
userBalance
.
getBalanced
());
prePaidBillingRepository
.
save
(
bill
);
}
...
...
src/main/java/com/edgec/browserbackend/account/service/impl/PaymentServiceImpl.java
View file @
9ec882e0
...
...
@@ -160,6 +160,10 @@ public class PaymentServiceImpl implements PaymentService {
balance
.
setUsername
(
byTradeNo
.
getUsername
());
}
PayBack
payBack
=
payBackRepository
.
findByPay
(
byTradeNo
.
getAmount
());
if
(
payBack
==
null
)
payBack
=
new
PayBack
();
if
(
chargeType
==
0
)
{
UserPrePaidBilling
bill
=
new
UserPrePaidBilling
();
Account
account
=
accountRepository
.
findByName
(
byTradeNo
.
getUsername
());
...
...
@@ -178,6 +182,7 @@ public class PaymentServiceImpl implements PaymentService {
bill
.
setStatus
(
BillStatus
.
PAID
);
bill
.
setPrepaid
(
true
);
bill
.
setTimestamp
(
Instant
.
now
().
toEpochMilli
());
bill
.
setBalanced
(
balance
.
getBalanced
()
+
byTradeNo
.
getAmount
()
+
payBack
.
getBack
());
final
YearMonth
lastmonth
=
YearMonth
.
now
();
...
...
@@ -189,9 +194,6 @@ public class PaymentServiceImpl implements PaymentService {
userPrePaidBillingRepository
.
save
(
bill
);
}
PayBack
payBack
=
payBackRepository
.
findByPay
(
byTradeNo
.
getAmount
());
if
(
payBack
==
null
)
payBack
=
new
PayBack
();
balance
.
setBalanced
(
balance
.
getBalanced
()
+
byTradeNo
.
getAmount
()
+
payBack
.
getBack
());
userBalanceRepository
.
save
(
balance
);
}
...
...
@@ -274,6 +276,10 @@ public class PaymentServiceImpl implements PaymentService {
balance
.
setUsername
(
byTradeNo
.
getUsername
());
}
PayBack
payBack
=
payBackRepository
.
findByPay
(
byTradeNo
.
getAmount
());
if
(
payBack
==
null
)
payBack
=
new
PayBack
();
if
(
chargeType
==
0
)
{
UserPrePaidBilling
bill
=
new
UserPrePaidBilling
();
Account
account
=
accountRepository
.
findByName
(
byTradeNo
.
getUsername
());
...
...
@@ -292,6 +298,7 @@ public class PaymentServiceImpl implements PaymentService {
bill
.
setStatus
(
BillStatus
.
PAID
);
bill
.
setPrepaid
(
true
);
bill
.
setTimestamp
(
Instant
.
now
().
toEpochMilli
());
bill
.
setBalanced
(
balance
.
getBalanced
()
+
byTradeNo
.
getAmount
()
+
payBack
.
getBack
());
final
YearMonth
lastmonth
=
YearMonth
.
now
();
...
...
@@ -301,9 +308,6 @@ public class PaymentServiceImpl implements PaymentService {
bill
.
setMonth
(
monthValue
);
}
PayBack
payBack
=
payBackRepository
.
findByPay
(
byTradeNo
.
getAmount
());
if
(
payBack
==
null
)
payBack
=
new
PayBack
();
balance
.
setBalanced
(
balance
.
getBalanced
()
+
byTradeNo
.
getAmount
()
+
payBack
.
getBack
());
userBalanceRepository
.
save
(
balance
);
}
...
...
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