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
b6f8a32c
Commit
b6f8a32c
authored
Jun 29, 2020
by
xuxin
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/staging' into staging
parents
6d435a63
1aa2659e
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
27 additions
and
16 deletions
+27
-16
SmsUtils.java
...va/com/edgec/browserbackend/account/service/SmsUtils.java
+1
-1
PaymentServiceImpl.java
...owserbackend/account/service/impl/PaymentServiceImpl.java
+15
-8
IpResourceServiceImpl.java
...erbackend/browser/service/Impl/IpResourceServiceImpl.java
+6
-4
Trans.java
...ain/java/com/edgec/browserbackend/common/utils/Trans.java
+5
-3
No files found.
src/main/java/com/edgec/browserbackend/account/service/SmsUtils.java
View file @
b6f8a32c
...
...
@@ -44,7 +44,7 @@ public class SmsUtils {
if
(
response
.
getHttpStatus
()
==
200
&&
response
.
getData
().
contains
(
"OK"
))
{
return
randomCode
;
}
else
{
log
.
error
(
"fail to send sms {}
"
,
response
.
getData
()
);
log
.
error
(
"fail to send sms {}
for user {}"
,
response
.
getData
(),
phone
);
throw
new
ClientRequestException
(
AccountErrorCode
.
OTPSENDFAILS
,
AccountErrorCode
.
OTPSENDFAILS
.
getReason
());
}
}
catch
(
ServerException
e
)
{
...
...
src/main/java/com/edgec/browserbackend/account/service/impl/PaymentServiceImpl.java
View file @
b6f8a32c
...
...
@@ -230,7 +230,7 @@ public class PaymentServiceImpl implements PaymentService {
boolean
isVpsClient
=
true
;
AlipayConfig
alipayConfig
=
isVpsClient
?
new
VpsAlipayConfig
()
:
new
Cloudam
AlipayConfig
();
AlipayConfig
alipayConfig
=
new
Vps
AlipayConfig
();
AlipayClient
alipayClient
=
new
DefaultAlipayClient
(
alipayConfig
.
getURL
(),
alipayConfig
.
getAPPID
(),
alipayConfig
.
getAPP_PRIVATE_KEY
(),
"json"
,
alipayConfig
.
getCHARSET
(),
alipayConfig
.
getALIPAY_PUBLIC_KEY
(),
alipayConfig
.
getSIGN_TYPE
());
...
...
@@ -689,9 +689,12 @@ public class PaymentServiceImpl implements PaymentService {
balance
=
new
UserBalance
();
balance
.
setUsername
(
byTradeNo
.
getUsername
());
}
balance
.
setBalanced
(
balance
.
getBalanced
()
+
byTradeNo
.
getAmount
());
userBalanceRepository
.
save
(
balance
);
// 充值返现
PayBack
payBack
=
payBackRepository
.
findByPay
(
byTradeNo
.
getAmount
());
if
(
payBack
==
null
)
payBack
=
new
PayBack
();
balance
.
setBalanced
(
balance
.
getBalanced
()
+
byTradeNo
.
getAmount
()
+
payBack
.
getBack
());
balance
=
userBalanceRepository
.
save
(
balance
);
}
result
.
setBalance
(
Math
.
round
(
balance
.
getBalanced
()));
...
...
@@ -732,7 +735,7 @@ public class PaymentServiceImpl implements PaymentService {
boolean
isVpsClient
=
true
;
AlipayConfig
alipayConfig
=
isVpsClient
?
new
VpsAlipayConfig
()
:
new
Cloudam
AlipayConfig
();
AlipayConfig
alipayConfig
=
new
Vps
AlipayConfig
();
AlipayClient
alipayClient
=
new
DefaultAlipayClient
(
alipayConfig
.
getURL
(),
alipayConfig
.
getAPPID
(),
alipayConfig
.
getAPP_PRIVATE_KEY
(),
"json"
,
alipayConfig
.
getCHARSET
(),
alipayConfig
.
getALIPAY_PUBLIC_KEY
(),
alipayConfig
.
getSIGN_TYPE
());
...
...
@@ -753,13 +756,17 @@ public class PaymentServiceImpl implements PaymentService {
boolean
b
=
userPaymentRepository
.
updatePaymentResult
(
byTradeNo
,
true
);
if
(
b
)
{
if
(
balance
==
null
)
{
balance
=
new
UserBalance
();
balance
.
setUsername
(
byTradeNo
.
getUsername
());
}
balance
.
setBalanced
(
balance
.
getBalanced
()
+
byTradeNo
.
getAmount
());
userBalanceRepository
.
save
(
balance
);
// 充值返现
PayBack
payBack
=
payBackRepository
.
findByPay
(
byTradeNo
.
getAmount
());
if
(
payBack
==
null
)
payBack
=
new
PayBack
();
balance
.
setBalanced
(
balance
.
getBalanced
()
+
byTradeNo
.
getAmount
()
+
payBack
.
getBack
());
balance
=
userBalanceRepository
.
save
(
balance
);
}
result
.
setBalance
(
Math
.
round
(
balance
.
getBalanced
()));
...
...
src/main/java/com/edgec/browserbackend/browser/service/Impl/IpResourceServiceImpl.java
View file @
b6f8a32c
...
...
@@ -17,6 +17,7 @@ import com.edgec.browserbackend.browser.service.IpResourceService;
import
com.edgec.browserbackend.common.commons.error.ClientRequestException
;
import
com.edgec.browserbackend.common.commons.utils.NotifyUtils
;
import
com.edgec.browserbackend.common.utils.FileUtil
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.jetbrains.annotations.NotNull
;
import
org.jetbrains.annotations.Nullable
;
...
...
@@ -538,7 +539,7 @@ public class IpResourceServiceImpl implements IpResourceService {
// 获取当前用户的 ip 资及未使用的 ip资源
dealIpResourceByGroup
(
ipResources
,
notUsed
,
account
,
username
,
groupType
);
if
(
notUsed
!=
null
)
{
if
(
CollectionUtils
.
isNotEmpty
(
notUsed
)
)
{
ipResources
.
addAll
(
notUsed
);
}
...
...
@@ -865,9 +866,10 @@ public class IpResourceServiceImpl implements IpResourceService {
notUsed
=
ipResourceRepository
.
findByOwnerInAndStatusInAndIsDeletedAndBind
(
accountNameList
,
Arrays
.
asList
(
0
,
2
,
4
,
8
),
false
,
false
);
break
;
}
ipResourceList
.
addAll
(
ipResources
);
notUsedList
.
addAll
(
notUsed
);
if
(
CollectionUtils
.
isNotEmpty
(
ipResources
))
ipResourceList
.
addAll
(
ipResources
);
if
(
CollectionUtils
.
isNotEmpty
(
notUsed
))
notUsedList
.
addAll
(
notUsed
);
}
@NotNull
...
...
src/main/java/com/edgec/browserbackend/common/utils/Trans.java
View file @
b6f8a32c
...
...
@@ -93,13 +93,15 @@ public class Trans {
HttpEntity
entry
=
response
.
getEntity
();
return
EntityUtils
.
toString
(
entry
,
Charsets
.
UTF_8
);
}
catch
(
ClientProtocolException
e
)
{
logger
.
error
(
e
.
getMessage
(),
e
);
logger
.
error
(
"ClientProtocolException"
);
return
""
;
}
catch
(
IOException
e
)
{
logger
.
error
(
e
.
getMessage
(),
e
);
// logger.error(e.getMessage(), e);
logger
.
error
(
"IOException"
);
return
""
;
}
catch
(
Exception
e
)
{
logger
.
error
(
e
.
getMessage
(),
e
);
// logger.error(e.getMessage(), e);
logger
.
error
(
"Exception"
);
return
""
;
}
finally
{
httpGet
.
releaseConnection
();
...
...
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