流水记录优化
This commit is contained in:
1 parent
dcd8eadd20
commit
abdafd5c9d
11 files changed
+238
-28
No files matched your search
@@ -47,7 +47,10 @@ public class TronPaymentTask {
|
||||
log.warn("无法读取 TRON 全局网络配置,跳过本轮支付扫描:{}", e.getMessage());
|
||||
return;
|
||||
}
|
||||
for (UsdtOrdersPlus order : orders.list(new LambdaQueryWrapper<UsdtOrdersPlus>().eq(UsdtOrdersPlus::getStatus, 1))) {
|
||||
for (UsdtOrdersPlus order : orders.list(new LambdaQueryWrapper<UsdtOrdersPlus>()
|
||||
.eq(UsdtOrdersPlus::getStatus, 1)
|
||||
.and(wrapper -> wrapper.isNull(UsdtOrdersPlus::getBlockTransactionId)
|
||||
.or().eq(UsdtOrdersPlus::getBlockTransactionId, "")))) {
|
||||
if (order.getToken() == null || order.getActualAmount() == null) continue;
|
||||
try {
|
||||
String url = tron.tronscanApiUrl() + "/v1/accounts/" + order.getToken() + "/transactions/trc20?limit=200&only_confirmed=true&contract_address=" + tron.contractAddress();
|
||||
@@ -63,7 +66,17 @@ public class TronPaymentTask {
|
||||
if (value.compareTo(order.getActualAmount().setScale(6, RoundingMode.DOWN)) != 0) continue;
|
||||
String hash = tx.getString("transaction_id");
|
||||
if (hash == null || hash.trim().isEmpty()) continue;
|
||||
if (ledgerPostingService.settlePaidOrder(order.getId(), hash)) {
|
||||
if (!ledgerPostingService.recordDetectedPayment(order.getId(), hash)) {
|
||||
log.warn("记录链上支付交易失败,订单ID={}", order.getId());
|
||||
break;
|
||||
}
|
||||
try {
|
||||
if (ledgerPostingService.settlePaidOrder(order.getId(), hash)) {
|
||||
break;
|
||||
}
|
||||
} catch (RuntimeException settlementException) {
|
||||
log.error("支付订单账务结算失败,订单ID={},原因={}",
|
||||
order.getId(), settlementException.getMessage());
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user