|
|
@@ -544,6 +544,7 @@ public class CoinServiceImpl implements CoinService {
|
|
|
}
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
|
+ log.error("okx-mix-order error", e);
|
|
|
}
|
|
|
}, 0, 10, TimeUnit.SECONDS);
|
|
|
|
|
|
@@ -647,50 +648,54 @@ public class CoinServiceImpl implements CoinService {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- List<String> monitorTraderList = coinMapper.findMonitorTraderList();
|
|
|
- forkJoinPool5.submit(() -> monitorTraderList.parallelStream().forEach(e -> {
|
|
|
- LocalDateTime endTime = LocalDateTime.now();
|
|
|
- // 交易员当前带单列表
|
|
|
- Map<String, String> paramMap = new LinkedHashMap<>();
|
|
|
-
|
|
|
- String[] split = e.split("\\|");
|
|
|
-
|
|
|
- paramMap.put("traderId", split[0]);
|
|
|
- paramMap.put("pageNo", "1");
|
|
|
- paramMap.put("pageSize", "20");
|
|
|
-
|
|
|
- try {
|
|
|
- JSONObject response = requestApi4Common("/api/mix/v1/trace/report/order/currentList", null, JSONObject.toJSONString(paramMap), JsoupUtil.HTTP_POST, paramMap);
|
|
|
- JSONArray orderList = response.getJSONArray("data");
|
|
|
-
|
|
|
- if (null != orderList) {
|
|
|
- for (int i = 0; i < orderList.size(); i++) {
|
|
|
- JSONObject order = orderList.getJSONObject(i);
|
|
|
- LocalDateTime openTime = DateUtils.longToLocalDateTime(order.getLong("openTime"));
|
|
|
- String trackingNo = order.getString("trackingNo");
|
|
|
- if (Duration.between(openTime, endTime).getSeconds() < 50 && !orderMap.containsKey(trackingNo)) {
|
|
|
- orderMap.put(trackingNo, "1");
|
|
|
-
|
|
|
- String content = "<div class=\"highlight\">交易对:" + order.getString("symbol") + "</div>" +
|
|
|
- "<div>持仓方向:" + InitRunner.publicParamsMap.get("holdSide").getString(order.getString("holdSide")) + "</div>" +
|
|
|
- "<div>杠杆倍数:" + order.getString("leverage") + "</div>" +
|
|
|
- "<div>开仓均价:" + order.getString("openPrice") + "</div>" +
|
|
|
- "<div>止盈价:" + order.getString("takeProfitPrice") + "</div>" +
|
|
|
- "<div>止损价:" + order.getString("stopLossPrice") + "</div>" +
|
|
|
- "<div >交易员:" + split[1] + "</div>" +
|
|
|
- "<div class=\"gray\">开仓时间:" + DateUtils.longToString(order.getLong("openTime")) + "</div>";
|
|
|
- JSONObject params = new JSONObject();
|
|
|
- params.put("title", "BITGET交易员开单报警");
|
|
|
- params.put("logUrl", "https://jav.lvzhiqiang.top/coin/orderDetail/" + order.getString("trackingNo"));
|
|
|
- params.put("btnTxt", "跟单详情");
|
|
|
- SpringUtils.getBean(CoinServiceImpl.class).monitorAlarm4APP_TEXT_CARD(content, params, null);
|
|
|
+ try {
|
|
|
+ List<String> monitorTraderList = coinMapper.findMonitorTraderList();
|
|
|
+ forkJoinPool5.submit(() -> monitorTraderList.parallelStream().forEach(e -> {
|
|
|
+ LocalDateTime endTime = LocalDateTime.now();
|
|
|
+ // 交易员当前带单列表
|
|
|
+ Map<String, String> paramMap = new LinkedHashMap<>();
|
|
|
+
|
|
|
+ String[] split = e.split("\\|");
|
|
|
+
|
|
|
+ paramMap.put("traderId", split[0]);
|
|
|
+ paramMap.put("pageNo", "1");
|
|
|
+ paramMap.put("pageSize", "20");
|
|
|
+
|
|
|
+ try {
|
|
|
+ JSONObject response = requestApi4Common("/api/mix/v1/trace/report/order/currentList", null, JSONObject.toJSONString(paramMap), JsoupUtil.HTTP_POST, paramMap);
|
|
|
+ JSONArray orderList = response.getJSONArray("data");
|
|
|
+
|
|
|
+ if (null != orderList) {
|
|
|
+ for (int i = 0; i < orderList.size(); i++) {
|
|
|
+ JSONObject order = orderList.getJSONObject(i);
|
|
|
+ LocalDateTime openTime = DateUtils.longToLocalDateTime(order.getLong("openTime"));
|
|
|
+ String trackingNo = order.getString("trackingNo");
|
|
|
+ if (Duration.between(openTime, endTime).getSeconds() < 50 && !orderMap.containsKey(trackingNo)) {
|
|
|
+ orderMap.put(trackingNo, "1");
|
|
|
+
|
|
|
+ String content = "<div class=\"highlight\">交易对:" + order.getString("symbol") + "</div>" +
|
|
|
+ "<div>持仓方向:" + InitRunner.publicParamsMap.get("holdSide").getString(order.getString("holdSide")) + "</div>" +
|
|
|
+ "<div>杠杆倍数:" + order.getString("leverage") + "</div>" +
|
|
|
+ "<div>开仓均价:" + order.getString("openPrice") + "</div>" +
|
|
|
+ "<div>止盈价:" + order.getString("takeProfitPrice") + "</div>" +
|
|
|
+ "<div>止损价:" + order.getString("stopLossPrice") + "</div>" +
|
|
|
+ "<div >交易员:" + split[1] + "</div>" +
|
|
|
+ "<div class=\"gray\">开仓时间:" + DateUtils.longToString(order.getLong("openTime")) + "</div>";
|
|
|
+ JSONObject params = new JSONObject();
|
|
|
+ params.put("title", "BITGET交易员开单报警");
|
|
|
+ params.put("logUrl", "https://jav.lvzhiqiang.top/coin/orderDetail/" + order.getString("trackingNo"));
|
|
|
+ params.put("btnTxt", "跟单详情");
|
|
|
+ SpringUtils.getBean(CoinServiceImpl.class).monitorAlarm4APP_TEXT_CARD(content, params, null);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
+ } catch (Exception ex) {
|
|
|
+ log.error("bitget-mix-trader error,param={}", paramMap, ex);
|
|
|
}
|
|
|
- } catch (Exception ex) {
|
|
|
- log.error("bitget-mix-trader error", ex);
|
|
|
- }
|
|
|
- })).join();
|
|
|
+ })).join();
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error("bitget-mix-trader top error", e);
|
|
|
+ }
|
|
|
}, 0, 3, TimeUnit.SECONDS);
|
|
|
|
|
|
// 星球日报新闻快讯监控报警
|
|
|
@@ -745,6 +750,7 @@ public class CoinServiceImpl implements CoinService {
|
|
|
}
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
|
+ log.error("news-odaily top error", e);
|
|
|
}
|
|
|
}, 0, 3, TimeUnit.SECONDS);
|
|
|
|
|
|
@@ -824,6 +830,7 @@ public class CoinServiceImpl implements CoinService {
|
|
|
}
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
|
+ log.error("news-theblockbeats top error", e);
|
|
|
}
|
|
|
}, 0, 3, TimeUnit.SECONDS);
|
|
|
|
|
|
@@ -889,6 +896,7 @@ public class CoinServiceImpl implements CoinService {
|
|
|
}
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
|
+ log.error("upbit-digitalasset-notices top error", e);
|
|
|
}
|
|
|
}, 0, 3, TimeUnit.SECONDS);
|
|
|
|