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
28818ddf
Commit
28818ddf
authored
Jun 29, 2020
by
xuxin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改
parent
3dbb5ad4
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
153 additions
and
175 deletions
+153
-175
AccountController.java
.../browserbackend/account/controller/AccountController.java
+3
-0
UserPayment.java
.../com/edgec/browserbackend/account/domain/UserPayment.java
+5
-66
UserPrePaidBilling.java
...gec/browserbackend/account/domain/UserPrePaidBilling.java
+4
-0
EmailServiceImpl.java
...browserbackend/account/service/impl/EmailServiceImpl.java
+4
-2
PaymentServiceImpl.java
...owserbackend/account/service/impl/PaymentServiceImpl.java
+43
-26
UserLackMoneyServiceImpl.java
...ackend/account/service/impl/UserLackMoneyServiceImpl.java
+7
-3
IpBuyResultDto.java
.../com/edgec/browserbackend/browser/dto/IpBuyResultDto.java
+32
-32
RenewIpResultDto.java
...om/edgec/browserbackend/browser/dto/RenewIpResultDto.java
+26
-26
PaymentTask.java
...va/com/edgec/browserbackend/browser/task/PaymentTask.java
+23
-18
Trans.java
...ain/java/com/edgec/browserbackend/common/utils/Trans.java
+2
-2
FGLWxConfig.java
...main/java/com/edgec/browserbackend/wxpay/FGLWxConfig.java
+4
-0
No files found.
src/main/java/com/edgec/browserbackend/account/controller/AccountController.java
View file @
28818ddf
...
@@ -247,6 +247,9 @@ public class AccountController {
...
@@ -247,6 +247,9 @@ public class AccountController {
return
resultDto
;
return
resultDto
;
}
}
/**
* 账户充值
*/
@RequestMapping
(
path
=
"/0xwxpayputorder/{amount}"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
path
=
"/0xwxpayputorder/{amount}"
,
method
=
RequestMethod
.
GET
)
public
UserPaymentDto
wechatPayCallback
(
Principal
principal
,
@PathVariable
int
amount
)
{
public
UserPaymentDto
wechatPayCallback
(
Principal
principal
,
@PathVariable
int
amount
)
{
return
paymentService
.
wxPutPayOrder
(
principal
.
getName
(),
amount
);
return
paymentService
.
wxPutPayOrder
(
principal
.
getName
(),
amount
);
...
...
src/main/java/com/edgec/browserbackend/account/domain/UserPayment.java
View file @
28818ddf
...
@@ -2,12 +2,16 @@ package com.edgec.browserbackend.account.domain;
...
@@ -2,12 +2,16 @@ package com.edgec.browserbackend.account.domain;
import
com.edgec.browserbackend.account.service.SmsUtils
;
import
com.edgec.browserbackend.account.service.SmsUtils
;
import
com.fasterxml.jackson.annotation.JsonIgnoreProperties
;
import
com.fasterxml.jackson.annotation.JsonIgnoreProperties
;
import
lombok.Getter
;
import
lombok.Setter
;
import
org.springframework.data.annotation.Id
;
import
org.springframework.data.annotation.Id
;
import
org.springframework.data.mongodb.core.mapping.Document
;
import
org.springframework.data.mongodb.core.mapping.Document
;
import
java.text.SimpleDateFormat
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
import
java.util.Date
;
@Getter
@Setter
@Document
(
collection
=
"userpayment"
)
@Document
(
collection
=
"userpayment"
)
@JsonIgnoreProperties
(
ignoreUnknown
=
true
)
@JsonIgnoreProperties
(
ignoreUnknown
=
true
)
public
class
UserPayment
{
public
class
UserPayment
{
...
@@ -15,7 +19,7 @@ public class UserPayment {
...
@@ -15,7 +19,7 @@ public class UserPayment {
@Id
@Id
private
String
id
;
private
String
id
;
private
String
tradeNo
=
new
SimpleDateFormat
(
"yyyyMMddHHmmss"
).
format
(
new
Date
())
+
SmsUtils
.
createRandom
(
true
,
4
);
private
String
tradeNo
=
new
SimpleDateFormat
(
"yyyyMMddHHmmss"
).
format
(
new
Date
())
+
SmsUtils
.
createRandom
(
true
,
4
);
private
String
username
;
private
String
username
;
...
@@ -28,69 +32,4 @@ public class UserPayment {
...
@@ -28,69 +32,4 @@ public class UserPayment {
private
PaymentMethod
paymentMethod
;
private
PaymentMethod
paymentMethod
;
private
String
transId
;
private
String
transId
;
public
String
getId
()
{
return
id
;
}
public
void
setId
(
String
id
)
{
this
.
id
=
id
;
}
public
String
getTradeNo
()
{
return
tradeNo
;
}
public
void
setTradeNo
(
String
tradeNo
)
{
this
.
tradeNo
=
tradeNo
;
}
public
String
getUsername
()
{
return
username
;
}
public
void
setUsername
(
String
username
)
{
this
.
username
=
username
;
}
public
int
getAmount
()
{
return
amount
;
}
public
void
setAmount
(
int
amount
)
{
this
.
amount
=
amount
;
}
public
boolean
isSucceed
()
{
return
succeed
;
}
public
void
setSucceed
(
boolean
succeed
)
{
this
.
succeed
=
succeed
;
}
public
Date
getPaymentDate
()
{
return
paymentDate
;
}
public
void
setPaymentDate
(
Date
paymentDate
)
{
this
.
paymentDate
=
paymentDate
;
}
public
PaymentMethod
getPaymentMethod
()
{
return
paymentMethod
;
}
public
void
setPaymentMethod
(
PaymentMethod
paymentMethod
)
{
this
.
paymentMethod
=
paymentMethod
;
}
public
String
getTransId
()
{
return
transId
;
}
public
void
setTransId
(
String
transId
)
{
this
.
transId
=
transId
;
}
}
}
src/main/java/com/edgec/browserbackend/account/domain/UserPrePaidBilling.java
View file @
28818ddf
...
@@ -62,4 +62,8 @@ public class UserPrePaidBilling {
...
@@ -62,4 +62,8 @@ public class UserPrePaidBilling {
private
List
<
DeductionRecord
>
deductionRecords
=
new
ArrayList
<>();
private
List
<
DeductionRecord
>
deductionRecords
=
new
ArrayList
<>();
public
void
addDeductionRecord
(
DeductionRecord
record
)
{
this
.
deductionRecords
.
add
(
record
);
}
}
}
src/main/java/com/edgec/browserbackend/account/service/impl/EmailServiceImpl.java
View file @
28818ddf
...
@@ -37,18 +37,20 @@ public class EmailServiceImpl implements EmailService {
...
@@ -37,18 +37,20 @@ public class EmailServiceImpl implements EmailService {
context
.
setVariable
(
"code"
,
code
);
context
.
setVariable
(
"code"
,
code
);
context
.
setVariable
(
"time"
,
ZonedDateTime
.
ofInstant
(
Instant
.
now
(),
ZoneId
.
systemDefault
()).
format
(
DateTimeFormatter
.
ofPattern
(
"uuuu-MM-dd HH:mm:ss"
)));
context
.
setVariable
(
"time"
,
ZonedDateTime
.
ofInstant
(
Instant
.
now
(),
ZoneId
.
systemDefault
()).
format
(
DateTimeFormatter
.
ofPattern
(
"uuuu-MM-dd HH:mm:ss"
)));
String
emailContent
=
templateEngine
.
process
(
"reset"
,
context
);
String
emailContent
=
templateEngine
.
process
(
"reset"
,
context
);
sendHtmlMail
(
email
,
"Cloudam云端软件 | 密码重置"
,
emailContent
);
sendHtmlMail
(
email
,
"Cloudam云端软件 | 密码重置"
,
emailContent
);
}
}
@Override
public
void
sendEmailVerification
(
String
username
,
String
email
,
String
code
)
{
public
void
sendEmailVerification
(
String
username
,
String
email
,
String
code
)
{
Context
context
=
new
Context
();
Context
context
=
new
Context
();
context
.
setVariable
(
"id"
,
username
);
context
.
setVariable
(
"id"
,
username
);
context
.
setVariable
(
"code"
,
code
);
context
.
setVariable
(
"code"
,
code
);
context
.
setVariable
(
"time"
,
ZonedDateTime
.
ofInstant
(
Instant
.
now
(),
ZoneId
.
systemDefault
()).
format
(
DateTimeFormatter
.
ofPattern
(
"uuuu-MM-dd HH:mm:ss"
)));
context
.
setVariable
(
"time"
,
ZonedDateTime
.
ofInstant
(
Instant
.
now
(),
ZoneId
.
systemDefault
()).
format
(
DateTimeFormatter
.
ofPattern
(
"uuuu-MM-dd HH:mm:ss"
)));
String
emailContent
=
templateEngine
.
process
(
"verification"
,
context
);
String
emailContent
=
templateEngine
.
process
(
"verification"
,
context
);
sendHtmlMail
(
email
,
"Cloudam云端软件 | 注册邮箱验证"
,
emailContent
);
sendHtmlMail
(
email
,
"Cloudam云端软件 | 注册邮箱验证"
,
emailContent
);
}
}
@Override
public
void
sendHtmlMail
(
String
to
,
String
subject
,
String
content
)
{
public
void
sendHtmlMail
(
String
to
,
String
subject
,
String
content
)
{
MimeMessage
message
=
mailSender
.
createMimeMessage
();
MimeMessage
message
=
mailSender
.
createMimeMessage
();
try
{
try
{
...
...
src/main/java/com/edgec/browserbackend/account/service/impl/PaymentServiceImpl.java
View file @
28818ddf
...
@@ -26,6 +26,7 @@ import com.edgec.browserbackend.common.commons.error.ClientRequestException;
...
@@ -26,6 +26,7 @@ import com.edgec.browserbackend.common.commons.error.ClientRequestException;
import
com.edgec.browserbackend.wxpay.*
;
import
com.edgec.browserbackend.wxpay.*
;
import
com.google.gson.Gson
;
import
com.google.gson.Gson
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.jetbrains.annotations.NotNull
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
@@ -412,44 +413,32 @@ public class PaymentServiceImpl implements PaymentService {
...
@@ -412,44 +413,32 @@ public class PaymentServiceImpl implements PaymentService {
@Override
@Override
public
UserPaymentDto
wxPutPayOrder
(
String
username
,
int
amount
)
{
public
UserPaymentDto
wxPutPayOrder
(
String
username
,
int
amount
)
{
Account
byName
=
accountService
.
findByName
(
username
);
Account
byName
=
accountService
.
findByName
(
username
);
if
(
byName
==
null
)
if
(
byName
.
getPermission
()
<
4
)
{
throw
new
ClientRequestException
(
AccountErrorCode
.
NAMENOTEXIST
,
"account does not exist: "
+
username
);
if
(
byName
.
getPermission
()
<
4
)
throw
new
ClientRequestException
(
AccountErrorCode
.
NOPERMISSION
,
"account does not have permission: "
+
username
);
throw
new
ClientRequestException
(
AccountErrorCode
.
NOPERMISSION
,
"account does not have permission: "
+
username
);
}
boolean
isVpsClient
=
true
;
UserPayment
internalOrder
=
new
UserPayment
();
internalOrder
.
setAmount
(
amount
);
internalOrder
.
setPaymentMethod
(
PaymentMethod
.
WECHAT
);
internalOrder
.
setSucceed
(
false
);
internalOrder
.
setUsername
(
username
);
try
{
try
{
// 创建并封装 UserPayment 信息
UserPayment
internalOrder
=
getUserPayment
(
username
,
amount
);
// 回调的url
String
notifyUrl
=
AccountController
.
WECHAT_PAY_CALLBACK_URL
+
internalOrder
.
getTradeNo
();
String
notifyUrl
=
AccountController
.
WECHAT_PAY_CALLBACK_URL
+
internalOrder
.
getTradeNo
();
// 获取微信支付的配置信息
boolean
isVpsClient
=
true
;
WXPayConfig
ourWxPayConfig
=
isVpsClient
?
new
FGLWxConfig
()
:
new
CloudamWxConfig
();
WXPayConfig
ourWxPayConfig
=
isVpsClient
?
new
FGLWxConfig
()
:
new
CloudamWxConfig
();
WXPay
wxPay
=
new
WXPay
(
ourWxPayConfig
);
Map
<
String
,
String
>
data
=
new
HashMap
<>();
// 封装请求 微信支付 的数据
data
.
put
(
"appid"
,
ourWxPayConfig
.
getAppID
());
Map
<
String
,
String
>
data
=
encapsulateDataMap
(
amount
,
internalOrder
,
notifyUrl
,
ourWxPayConfig
);
data
.
put
(
"mch_id"
,
ourWxPayConfig
.
getMchID
());
//商户号
data
.
put
(
"body"
,
ourWxPayConfig
.
getBody
());
data
.
put
(
"trade_type"
,
"NATIVE"
);
//NATIVE 扫码支付
data
.
put
(
"notify_url"
,
notifyUrl
);
//回调地址
data
.
put
(
"spbill_create_ip"
,
"127.0.0.1"
);
//终端ip
data
.
put
(
"total_fee"
,
""
+
amount
*
100
);
//订单总金额
data
.
put
(
"fee_type"
,
"CNY"
);
//默认人民币
data
.
put
(
"out_trade_no"
,
internalOrder
.
getTradeNo
());
//交易号
data
.
put
(
"nonce_str"
,
internalOrder
.
getTradeNo
());
// 随机字符串小于32位
String
s
=
WXPayUtil
.
generateSignature
(
data
,
ourWxPayConfig
.
getKey
());
//签名
data
.
put
(
"sign"
,
s
);
// 调用微信支付接口,并返回支付结果
WXPay
wxPay
=
new
WXPay
(
ourWxPayConfig
);
Map
<
String
,
String
>
respData
=
wxPay
.
unifiedOrder
(
data
);
Map
<
String
,
String
>
respData
=
wxPay
.
unifiedOrder
(
data
);
if
(
respData
.
get
(
"return_code"
).
equals
(
"SUCCESS"
)
&&
respData
.
get
(
"result_code"
).
equals
(
"SUCCESS"
))
{
if
(
respData
.
get
(
"return_code"
).
equals
(
"SUCCESS"
)
&&
respData
.
get
(
"result_code"
).
equals
(
"SUCCESS"
))
{
// 若微信支付成功,则将支付信息保存到
userPaymentRepository
.
save
(
internalOrder
);
userPaymentRepository
.
save
(
internalOrder
);
UserPaymentDto
result
=
new
UserPaymentDto
();
UserPaymentDto
result
=
new
UserPaymentDto
();
result
.
setTradeNo
(
internalOrder
.
getTradeNo
());
result
.
setTradeNo
(
internalOrder
.
getTradeNo
());
...
@@ -843,4 +832,32 @@ public class PaymentServiceImpl implements PaymentService {
...
@@ -843,4 +832,32 @@ public class PaymentServiceImpl implements PaymentService {
return
result
;
return
result
;
}
}
@NotNull
private
UserPayment
getUserPayment
(
String
username
,
int
amount
)
{
UserPayment
internalOrder
=
new
UserPayment
();
internalOrder
.
setAmount
(
amount
);
internalOrder
.
setPaymentMethod
(
PaymentMethod
.
WECHAT
);
internalOrder
.
setSucceed
(
false
);
internalOrder
.
setUsername
(
username
);
return
internalOrder
;
}
@NotNull
private
Map
<
String
,
String
>
encapsulateDataMap
(
int
amount
,
UserPayment
internalOrder
,
String
notifyUrl
,
WXPayConfig
ourWxPayConfig
)
throws
Exception
{
Map
<
String
,
String
>
data
=
new
HashMap
<>();
data
.
put
(
"appid"
,
ourWxPayConfig
.
getAppID
());
data
.
put
(
"mch_id"
,
ourWxPayConfig
.
getMchID
());
//商户号
data
.
put
(
"body"
,
ourWxPayConfig
.
getBody
());
data
.
put
(
"trade_type"
,
"NATIVE"
);
//NATIVE 扫码支付
data
.
put
(
"notify_url"
,
notifyUrl
);
//回调地址
data
.
put
(
"spbill_create_ip"
,
"127.0.0.1"
);
//终端ip
data
.
put
(
"total_fee"
,
""
+
amount
*
100
);
//订单总金额
data
.
put
(
"fee_type"
,
"CNY"
);
//默认人民币
data
.
put
(
"out_trade_no"
,
internalOrder
.
getTradeNo
());
//交易号
data
.
put
(
"nonce_str"
,
internalOrder
.
getTradeNo
());
// 随机字符串小于32位
String
s
=
WXPayUtil
.
generateSignature
(
data
,
ourWxPayConfig
.
getKey
());
//签名
data
.
put
(
"sign"
,
s
);
return
data
;
}
}
}
src/main/java/com/edgec/browserbackend/account/service/impl/UserLackMoneyServiceImpl.java
View file @
28818ddf
...
@@ -30,9 +30,13 @@ public class UserLackMoneyServiceImpl implements UserLackMoneyService {
...
@@ -30,9 +30,13 @@ public class UserLackMoneyServiceImpl implements UserLackMoneyService {
//用户名,欠费金额,账单Id,账单总数
//用户名,欠费金额,账单Id,账单总数
String
username
=
billings
.
get
(
0
).
getUsername
();
String
username
=
billings
.
get
(
0
).
getUsername
();
float
totalUnpaid
=
billings
.
stream
().
filter
(
x
->
x
.
getStatus
()
==
BillStatus
.
UNPAID
)
float
totalUnpaid
=
billings
.
stream
().
filter
(
x
->
x
.
getStatus
()
==
BillStatus
.
UNPAID
)
.
map
(
x
->
x
.
getTotal
()
-
(
x
.
getDeductionRecords
()
!=
null
?
(
x
.
getDeductionRecords
().
stream
().
collect
(
Collectors
.
summingDouble
(
.
map
(
DeductionRecord:
:
getDeductionAmount
x
->
x
.
getTotal
()
-
(
)).
longValue
())
:
(
0
))).
collect
(
Collectors
.
summingDouble
(
Float:
:
floatValue
)).
floatValue
();
x
.
getDeductionRecords
()
!=
null
?
(
x
.
getDeductionRecords
().
stream
().
collect
(
Collectors
.
summingDouble
(
DeductionRecord:
:
getDeductionAmount
)).
longValue
())
:
(
0
)
)
)
.
collect
(
Collectors
.
summingDouble
(
Float:
:
floatValue
))
.
floatValue
();
List
<
String
>
ids
=
billings
.
stream
().
filter
(
x
->
x
.
getStatus
()
==
BillStatus
.
UNPAID
).
map
(
UserPrePaidBilling:
:
getId
).
collect
(
Collectors
.
toList
());
List
<
String
>
ids
=
billings
.
stream
().
filter
(
x
->
x
.
getStatus
()
==
BillStatus
.
UNPAID
).
map
(
UserPrePaidBilling:
:
getId
).
collect
(
Collectors
.
toList
());
int
billsAmount
=
(
int
)
billings
.
stream
().
filter
(
x
->
x
.
getStatus
()
==
BillStatus
.
UNPAID
).
count
();
int
billsAmount
=
(
int
)
billings
.
stream
().
filter
(
x
->
x
.
getStatus
()
==
BillStatus
.
UNPAID
).
count
();
...
...
src/main/java/com/edgec/browserbackend/browser/dto/IpBuyResultDto.java
View file @
28818ddf
...
@@ -4,14 +4,44 @@ import java.util.ArrayList;
...
@@ -4,14 +4,44 @@ import java.util.ArrayList;
import
java.util.List
;
import
java.util.List
;
public
class
IpBuyResultDto
{
public
class
IpBuyResultDto
{
private
String
errorCode
=
""
;
private
String
errorCode
=
""
;
private
String
requestid
=
""
;
private
String
requestid
=
""
;
private
int
balance
=
0
;
private
int
balance
=
0
;
private
List
<
IPData
>
iplist
=
new
ArrayList
<>();
private
List
<
IPData
>
iplist
=
new
ArrayList
<>();
public
static
class
IPData
{
private
String
ip
;
private
String
validTill
;
public
IPData
(
String
ip
,
String
validTill
)
{
this
.
ip
=
ip
;
this
.
validTill
=
validTill
;
}
public
IPData
()
{
}
public
String
getIp
()
{
return
ip
;
}
public
void
setIp
(
String
ip
)
{
this
.
ip
=
ip
;
}
public
String
getValidTill
()
{
return
validTill
;
}
public
void
setValidTill
(
String
validTill
)
{
this
.
validTill
=
validTill
;
}
}
public
String
getErrorCode
()
{
public
String
getErrorCode
()
{
return
errorCode
;
return
errorCode
;
}
}
...
@@ -43,34 +73,4 @@ public class IpBuyResultDto {
...
@@ -43,34 +73,4 @@ public class IpBuyResultDto {
public
void
setIplist
(
List
<
IPData
>
iplist
)
{
public
void
setIplist
(
List
<
IPData
>
iplist
)
{
this
.
iplist
=
iplist
;
this
.
iplist
=
iplist
;
}
}
public
static
class
IPData
{
private
String
ip
;
private
String
validTill
;
public
IPData
(
String
ip
,
String
validTill
)
{
this
.
ip
=
ip
;
this
.
validTill
=
validTill
;
}
public
IPData
()
{
}
public
String
getIp
()
{
return
ip
;
}
public
void
setIp
(
String
ip
)
{
this
.
ip
=
ip
;
}
public
String
getValidTill
()
{
return
validTill
;
}
public
void
setValidTill
(
String
validTill
)
{
this
.
validTill
=
validTill
;
}
}
}
}
src/main/java/com/edgec/browserbackend/browser/dto/RenewIpResultDto.java
View file @
28818ddf
...
@@ -4,36 +4,12 @@ import java.util.ArrayList;
...
@@ -4,36 +4,12 @@ import java.util.ArrayList;
import
java.util.List
;
import
java.util.List
;
public
class
RenewIpResultDto
{
public
class
RenewIpResultDto
{
private
String
errorCode
=
""
;
private
String
errorCode
=
""
;
private
int
balance
=
0
;
private
int
balance
=
0
;
private
List
<
IpBuyResultDto
.
IPData
>
iplist
=
new
ArrayList
<>();
private
List
<
IpBuyResultDto
.
IPData
>
iplist
=
new
ArrayList
<>();
public
String
getErrorCode
()
{
return
errorCode
;
}
public
void
setErrorCode
(
String
errorCode
)
{
this
.
errorCode
=
errorCode
;
}
public
int
getBalance
()
{
return
balance
;
}
public
void
setBalance
(
int
balance
)
{
this
.
balance
=
balance
;
}
public
List
<
IpBuyResultDto
.
IPData
>
getIplist
()
{
return
iplist
;
}
public
void
setIplist
(
List
<
IpBuyResultDto
.
IPData
>
iplist
)
{
this
.
iplist
=
iplist
;
}
public
static
class
IPData
{
public
static
class
IPData
{
private
String
ip
;
private
String
ip
;
private
String
validTill
;
private
String
validTill
;
...
@@ -44,7 +20,6 @@ public class RenewIpResultDto {
...
@@ -44,7 +20,6 @@ public class RenewIpResultDto {
}
}
public
IPData
()
{
public
IPData
()
{
}
}
public
String
getIp
()
{
public
String
getIp
()
{
...
@@ -64,4 +39,28 @@ public class RenewIpResultDto {
...
@@ -64,4 +39,28 @@ public class RenewIpResultDto {
}
}
}
}
public
String
getErrorCode
()
{
return
errorCode
;
}
public
void
setErrorCode
(
String
errorCode
)
{
this
.
errorCode
=
errorCode
;
}
public
int
getBalance
()
{
return
balance
;
}
public
void
setBalance
(
int
balance
)
{
this
.
balance
=
balance
;
}
public
List
<
IpBuyResultDto
.
IPData
>
getIplist
()
{
return
iplist
;
}
public
void
setIplist
(
List
<
IpBuyResultDto
.
IPData
>
iplist
)
{
this
.
iplist
=
iplist
;
}
}
}
\ No newline at end of file
src/main/java/com/edgec/browserbackend/browser/task/PaymentTask.java
View file @
28818ddf
...
@@ -33,24 +33,28 @@ public class PaymentTask {
...
@@ -33,24 +33,28 @@ public class PaymentTask {
Date
date_5min
=
new
Date
(
now
-
5
*
60
*
1000
);
Date
date_5min
=
new
Date
(
now
-
5
*
60
*
1000
);
Date
date_10min
=
new
Date
(
now
-
10
*
60
*
1000
);
Date
date_10min
=
new
Date
(
now
-
10
*
60
*
1000
);
List
<
UserPayment
>
unfinishedPayments
=
userPaymentRepository
.
findAllByPaymentDateBetweenAndSucceed
(
List
<
UserPayment
>
unfinishedPayments
=
userPaymentRepository
.
findAllByPaymentDateBetweenAndSucceed
(
ZonedDateTime
.
ofInstant
(
date_10min
.
toInstant
(),
ZoneId
.
systemDefault
())
ZonedDateTime
.
ofInstant
(
date_10min
.
toInstant
(),
ZoneId
.
systemDefault
()),
,
ZonedDateTime
.
ofInstant
(
date_5min
.
toInstant
(),
ZoneId
.
systemDefault
()),
false
);
ZonedDateTime
.
ofInstant
(
date_5min
.
toInstant
(),
ZoneId
.
systemDefault
()),
false
);
if
(
unfinishedPayments
!=
null
&&
unfinishedPayments
.
size
()
>
0
)
{
if
(
unfinishedPayments
!=
null
&&
!
unfinishedPayments
.
isEmpty
())
{
unfinishedPayments
.
stream
().
forEach
(
payment
->
{
unfinishedPayments
.
forEach
(
PaymentMethod
paymentMethod
=
payment
.
getPaymentMethod
();
payment
->
{
PaymentMethod
paymentMethod
=
payment
.
getPaymentMethod
();
try
{
if
(
PaymentMethod
.
WECHAT
.
equals
(
paymentMethod
))
{
try
{
paymentService
.
wxCheckOrderStatus
(
payment
.
getTradeNo
());
if
(
PaymentMethod
.
WECHAT
.
equals
(
paymentMethod
))
{
}
else
if
(
PaymentMethod
.
ALIPAY
.
equals
(
paymentMethod
))
{
paymentService
.
wxCheckOrderStatus
(
payment
.
getTradeNo
());
paymentService
.
aliCheckOrderStatus
(
payment
.
getTradeNo
());
}
if
(
PaymentMethod
.
ALIPAY
.
equals
(
paymentMethod
))
{
paymentService
.
aliCheckOrderStatus
(
payment
.
getTradeNo
());
}
}
catch
(
Exception
e
)
{
log
.
error
(
"checkPayments"
,
e
);
}
}
}
}
catch
(
Exception
e
)
{
);
log
.
error
(
"checkPayments"
,
e
);
}
});
}
}
}
}
}
}
\ No newline at end of file
src/main/java/com/edgec/browserbackend/common/utils/Trans.java
View file @
28818ddf
...
@@ -56,8 +56,8 @@ public class Trans {
...
@@ -56,8 +56,8 @@ public class Trans {
* @param args
* @param args
*/
*/
public
static
void
main
(
String
[]
args
)
{
public
static
void
main
(
String
[]
args
)
{
String
url
=
"http
://free.ipwhois.io/json/
"
;
String
url
=
"http
s://china-merchant.wish.com/login
"
;
Trans
trans
=
new
Trans
(
"
112.74.47.217"
,
20001
,
"fangguanlianbrowser"
,
"5D753F36QKqI
aA1"
);
Trans
trans
=
new
Trans
(
"
8.210.96.188"
,
"WC5w4M5jkdz1
aA1"
);
String
rs
=
trans
.
get
(
url
);
String
rs
=
trans
.
get
(
url
);
System
.
out
.
println
(
rs
);
System
.
out
.
println
(
rs
);
}
}
...
...
src/main/java/com/edgec/browserbackend/wxpay/FGLWxConfig.java
View file @
28818ddf
...
@@ -18,10 +18,12 @@ public class FGLWxConfig extends WXPayConfig {
...
@@ -18,10 +18,12 @@ public class FGLWxConfig extends WXPayConfig {
return
"acdkgjef237ckgSriEICRe2408sdjEDC"
;
return
"acdkgjef237ckgSriEICRe2408sdjEDC"
;
}
}
@Override
public
int
getHttpConnectTimeoutMs
()
{
public
int
getHttpConnectTimeoutMs
()
{
return
8000
;
return
8000
;
}
}
@Override
public
int
getHttpReadTimeoutMs
()
{
public
int
getHttpReadTimeoutMs
()
{
return
10000
;
return
10000
;
}
}
...
@@ -35,10 +37,12 @@ public class FGLWxConfig extends WXPayConfig {
...
@@ -35,10 +37,12 @@ public class FGLWxConfig extends WXPayConfig {
public
IWXPayDomain
getWXPayDomain
()
{
public
IWXPayDomain
getWXPayDomain
()
{
IWXPayDomain
iwxPayDomain
=
new
IWXPayDomain
()
{
IWXPayDomain
iwxPayDomain
=
new
IWXPayDomain
()
{
@Override
public
void
report
(
String
domain
,
long
elapsedTimeMillis
,
Exception
ex
)
{
public
void
report
(
String
domain
,
long
elapsedTimeMillis
,
Exception
ex
)
{
}
}
@Override
public
DomainInfo
getDomain
(
WXPayConfig
config
)
{
public
DomainInfo
getDomain
(
WXPayConfig
config
)
{
return
new
IWXPayDomain
.
DomainInfo
(
WXPayConstants
.
DOMAIN_API
,
true
);
return
new
IWXPayDomain
.
DomainInfo
(
WXPayConstants
.
DOMAIN_API
,
true
);
}
}
...
...
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