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
6d435a63
Commit
6d435a63
authored
Jun 29, 2020
by
xuxin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加代码注释
parent
28818ddf
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
13 additions
and
8 deletions
+13
-8
AccountController.java
.../browserbackend/account/controller/AccountController.java
+4
-1
Account.java
...java/com/edgec/browserbackend/account/domain/Account.java
+6
-0
AccountRepositoryCustomImpl.java
...ckend/account/repository/AccountRepositoryCustomImpl.java
+0
-2
UserPaymentRepositoryCustomImpl.java
...d/account/repository/UserPaymentRepositoryCustomImpl.java
+1
-4
PaymentServiceImpl.java
...owserbackend/account/service/impl/PaymentServiceImpl.java
+0
-0
PaymentTask.java
...va/com/edgec/browserbackend/browser/task/PaymentTask.java
+2
-1
No files found.
src/main/java/com/edgec/browserbackend/account/controller/AccountController.java
View file @
6d435a63
...
...
@@ -248,13 +248,16 @@ public class AccountController {
}
/**
* 账户充值
*
使用微信进行
账户充值
*/
@RequestMapping
(
path
=
"/0xwxpayputorder/{amount}"
,
method
=
RequestMethod
.
GET
)
public
UserPaymentDto
wechatPayCallback
(
Principal
principal
,
@PathVariable
int
amount
)
{
return
paymentService
.
wxPutPayOrder
(
principal
.
getName
(),
amount
);
}
/**
* 使用微信进行账户充值成功后,微信会调用该接口
*/
@RequestMapping
(
path
=
"/0xwxpaycallback/{tradno}"
,
method
=
RequestMethod
.
GET
)
public
String
wechatPayCallback
(
@PathVariable
String
tradno
)
{
return
paymentService
.
wechatPayCallback
(
tradno
);
...
...
src/main/java/com/edgec/browserbackend/account/domain/Account.java
View file @
6d435a63
...
...
@@ -67,8 +67,14 @@ public class Account {
*/
private
int
permission
=
-
1
;
/**
* 注册成功后,当前用户的邀请码,用于邀请别人获取佣金
*/
private
Promotion
promotion
;
/**
* 注册时,其他用户给当前用户的邀请码
*/
private
String
promotionCode
;
private
String
comment
;
...
...
src/main/java/com/edgec/browserbackend/account/repository/AccountRepositoryCustomImpl.java
View file @
6d435a63
...
...
@@ -59,8 +59,6 @@ public class AccountRepositoryCustomImpl implements AccountRepositoryCustom {
basicQuery
.
addCriteria
(
where
(
"promotion.code"
).
is
(
code
).
and
(
"parent"
).
exists
(
false
));
Account
account
=
mongoTemplate
.
findOne
(
basicQuery
,
Account
.
class
);
if
(
account
==
null
)
return
null
;
return
account
;
}
}
src/main/java/com/edgec/browserbackend/account/repository/UserPaymentRepositoryCustomImpl.java
View file @
6d435a63
...
...
@@ -24,10 +24,7 @@ public class UserPaymentRepositoryCustomImpl implements UserPaymentRepositoryCus
update
.
set
(
"succeed"
,
result
);
UpdateResult
operation
=
mongoTemplate
.
updateFirst
(
basicQuery
,
update
,
UserPayment
.
class
);
if
(
operation
.
getModifiedCount
()
<
1
)
return
false
;
else
return
true
;
return
operation
.
getModifiedCount
()
>=
1
;
}
}
src/main/java/com/edgec/browserbackend/account/service/impl/PaymentServiceImpl.java
View file @
6d435a63
This diff is collapsed.
Click to expand it.
src/main/java/com/edgec/browserbackend/browser/task/PaymentTask.java
View file @
6d435a63
...
...
@@ -32,6 +32,7 @@ public class PaymentTask {
long
now
=
System
.
currentTimeMillis
();
Date
date_5min
=
new
Date
(
now
-
5
*
60
*
1000
);
Date
date_10min
=
new
Date
(
now
-
10
*
60
*
1000
);
// 查找 5-10 分钟内 支付状态为 false 的订单
List
<
UserPayment
>
unfinishedPayments
=
userPaymentRepository
.
findAllByPaymentDateBetweenAndSucceed
(
ZonedDateTime
.
ofInstant
(
date_10min
.
toInstant
(),
ZoneId
.
systemDefault
()),
ZonedDateTime
.
ofInstant
(
date_5min
.
toInstant
(),
ZoneId
.
systemDefault
()),
...
...
@@ -41,8 +42,8 @@ public class PaymentTask {
unfinishedPayments
.
forEach
(
payment
->
{
PaymentMethod
paymentMethod
=
payment
.
getPaymentMethod
();
try
{
// 自动调用 微信或者支付宝的支付接口来确认 支付状态
if
(
PaymentMethod
.
WECHAT
.
equals
(
paymentMethod
))
{
paymentService
.
wxCheckOrderStatus
(
payment
.
getTradeNo
());
}
...
...
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