|
|
@@ -10,6 +10,7 @@ import common.utils.http.MyPaginate;
|
|
|
import modules.tx.TxService;
|
|
|
import modules.tx.transfer.TransferService;
|
|
|
|
|
|
+import java.math.BigDecimal;
|
|
|
import java.util.List;
|
|
|
|
|
|
public class HistoryService {
|
|
|
@@ -27,6 +28,22 @@ public class HistoryService {
|
|
|
}
|
|
|
|
|
|
public List<Record> findByChainId(int chainId, MyPaginate p, JSONObject conditionMap) throws Exception {
|
|
|
- return txService.findByChainId(chainId, p, conditionMap, History.class, HistoryTransfer.class);
|
|
|
+ List<Record> records = txService.findByChainId(chainId, p, conditionMap, History.class, HistoryTransfer.class);
|
|
|
+
|
|
|
+ // 2022-12-19 410: *history 页面的timestamp,不读*history 的timestamp,读pending 的timestamp
|
|
|
+ putPendingTimestamp(records);
|
|
|
+
|
|
|
+ return records;
|
|
|
+ }
|
|
|
+
|
|
|
+ private void putPendingTimestamp(List<Record> records) {
|
|
|
+ for (Record historyTxData : records) {
|
|
|
+ int chainId = historyTxData.getInt("chainId");
|
|
|
+ String hash = historyTxData.getStr("hash");
|
|
|
+
|
|
|
+ BigDecimal timestamp = Db.template("pending.findTimestamp", chainId, hash).queryBigDecimal();
|
|
|
+
|
|
|
+ historyTxData.put("timestamp", timestamp);
|
|
|
+ }
|
|
|
}
|
|
|
}
|