Toggle navigation
Toggle navigation
This project
Loading...
Sign in
jiujian
/
client-customer-order-api
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
zhuyifan
2025-06-13 16:53:27 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
757cfeeda7b38cc56c92921453841f00ad699715
757cfeed
1 parent
69fd05a2
fix(payment): 修复支付回调中的时间格式转换问题
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
3 deletions
src/main/java/com/infoloop/tianting/service/client/PayServiceClient.java
src/main/java/com/infoloop/tianting/service/client/PayServiceClient.java
View file @
757cfee
...
...
@@ -54,8 +54,10 @@ import java.net.URLEncoder;
import
java.nio.charset.StandardCharsets
;
import
java.text.MessageFormat
;
import
java.text.ParseException
;
import
java.time.Instant
;
import
java.time.LocalDate
;
import
java.time.LocalDateTime
;
import
java.time.ZoneOffset
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.stream.Collectors
;
...
...
@@ -161,6 +163,7 @@ public class PayServiceClient {
log
.
error
(
"Order not found, orderId: {}"
,
orderId
);
return
false
;
}
log
.
info
(
"Order callback, orderId: {}"
,
orderId
);
final
var
transType
=
paymentCallbackResult
.
getTransType
();
if
(
transType
.
equals
(
"00"
))
{
...
...
@@ -205,12 +208,18 @@ public class PayServiceClient {
orderServiceRpcClient
.
updateClientCustomerOrderPaymentResult
(
orderById
,
build
);
log
.
info
(
"callback updateClientCustomerOrder result: {}"
,
updateResponse
.
getIsUpdated
());
if
(
updateResponse
.
getIsUpdated
())
{
String
createdAt
=
Instant
.
ofEpochMilli
(
orderById
.
getCreatedAt
())
.
atZone
(
ZoneOffset
.
UTC
)
.
format
(
DateUtil
.
Y_M_D_H_M_S
);
String
payTimed
=
Instant
.
ofEpochMilli
(
orderById
.
getPayTime
())
.
atZone
(
ZoneOffset
.
UTC
)
.
format
(
DateUtil
.
Y_M_D_H_M_S
);
final
var
orderPaymentSuccessData
=
OrderPaymentSuccessData
.
builder
()
.
orderId
(
orderById
.
getId
())
.
orderCode
(
orderById
.
getOrderCode
())
.
createTime
(
DateUtil
.
formatDate
(
orderById
.
getCreatedAt
(),
DateUtil
.
Y_M_D_H_M_S
)
)
.
payTime
(
DateUtil
.
formatDate
(
orderById
.
getPayTime
(),
DateUtil
.
Y_M_D_H_M_S
)
)
.
createTime
(
createdAt
)
.
payTime
(
payTimed
)
.
build
();
final
var
data
=
SocketMessage
.<
OrderPaymentSuccessData
>
builder
()
...
...
@@ -340,7 +349,9 @@ public class PayServiceClient {
String
appId
=
businessConfig
.
getPayClientId
();
// 构建paycontent
String
payTime
=
DateUtil
.
formatDate
(
orderById
.
getPayTime
(),
DateUtil
.
YMDHMS
);
String
payTime
=
Instant
.
ofEpochMilli
(
orderById
.
getPayTime
())
.
atZone
(
ZoneOffset
.
UTC
)
.
format
(
DateUtil
.
YMDHMS
);
BigDecimal
price
=
new
BigDecimal
(
orderById
.
getPayPrice
())
...
...
Please
register
or
login
to post a comment