|
|
@@ -142,22 +142,25 @@ public class CoinServiceImpl implements CoinService {
|
|
|
// 全部历史委托监控
|
|
|
Map<String, String> paramMap = new LinkedHashMap<>();
|
|
|
paramMap.put("productType", "umcbl");
|
|
|
- paramMap.put("startTime", String.valueOf(DateUtils.localDateTimeToMilliseconds(endTime.minusSeconds(10))));
|
|
|
+ paramMap.put("startTime", String.valueOf(DateUtils.localDateTimeToMilliseconds(endTime.minusMinutes(1))));
|
|
|
paramMap.put("endTime", String.valueOf(DateUtils.localDateTimeToMilliseconds(endTime)));
|
|
|
paramMap.put("pageSize", "100");
|
|
|
|
|
|
String signQueryString = paramMap.entrySet().stream().map(e -> e.getKey() + "=" + e.getValue()).collect(Collectors.joining("&"));
|
|
|
- JSONObject response = requestApi4Common("/api/mix/v1/order/historyProductType", signQueryString, null, JsoupUtil.HTTP_GET, paramMap);
|
|
|
- JSONArray orderList = response.getJSONObject("data").getJSONArray("orderList");
|
|
|
-
|
|
|
- for (int i = 0; i < orderList.size(); i++) {
|
|
|
- JSONObject order = orderList.getJSONObject(i);
|
|
|
- LocalDateTime cTime = DateUtils.longToLocalDateTime(order.getLong("cTime"));
|
|
|
- String orderId = order.getString("orderId");
|
|
|
- if (Duration.between(cTime, endTime).getSeconds() < 5 && !orderMap.containsKey(orderId)) {
|
|
|
- orderMap.put(orderId, "1");
|
|
|
- SpringUtils.getBean(CoinServiceImpl.class).monitorAlarm(order);
|
|
|
+ try {
|
|
|
+ JSONObject response = requestApi4Common("/api/mix/v1/order/historyProductType", signQueryString, null, JsoupUtil.HTTP_GET, paramMap);
|
|
|
+ JSONArray orderList = response.getJSONObject("data").getJSONArray("orderList");
|
|
|
+
|
|
|
+ for (int i = 0; i < orderList.size(); i++) {
|
|
|
+ JSONObject order = orderList.getJSONObject(i);
|
|
|
+ LocalDateTime cTime = DateUtils.longToLocalDateTime(order.getLong("cTime"));
|
|
|
+ String orderId = order.getString("orderId");
|
|
|
+ if (Duration.between(cTime, endTime).getSeconds() < 50 && !orderMap.containsKey(orderId)) {
|
|
|
+ orderMap.put(orderId, "1");
|
|
|
+ SpringUtils.getBean(CoinServiceImpl.class).monitorAlarm(order);
|
|
|
+ }
|
|
|
}
|
|
|
+ } catch (Exception e) {
|
|
|
}
|
|
|
}
|
|
|
}, 0, 2000);
|