| | |
| | | String connId = MallUtils.getOrderNum(ACCOUNTWS_CHANNEL); |
| | | JSONObject jsonObject = WsParamBuild.buildJsonObject(connId, option, argsArray); |
| | | webSocketClient.send(jsonObject.toJSONString()); |
| | | // log.info("发送账户频道:{}", option); |
| | | } catch (Exception e) { |
| | | log.error("订阅账户频道构建失败", e); |
| | | } |
| | | } |
| | | |
| | | public static void initEvent(JSONObject response, String accountName) { |
| | | // log.info("订阅成功: {}", response.getJSONObject("arg")); |
| | | JSONObject arg = response.getJSONObject("arg"); |
| | | initParam(arg, accountName); |
| | | } |
| | |
| | | public static void handleEvent(JSONObject response, String accountName) { |
| | | |
| | | |
| | | // log.info("开始执行AccountWs......{}",ACCOUNTWS_CHANNEL); |
| | | try { |
| | | JSONArray dataArray = response.getJSONArray("data"); |
| | | if (dataArray == null || dataArray.isEmpty()) { |
| | |
| | | String total_order_usdtpecent = InstrumentsWs.getAccountMap(accountName).get(CoinEnums.TOTAL_ORDER_USDTPECENT.name()); |
| | | BigDecimal total_order_usdt_factor = WsMapBuild.parseBigDecimalSafe(total_order_usdtpecent); |
| | | BigDecimal totalOrderUsdt = cashBalDecimal.multiply(total_order_usdt_factor).setScale(2, RoundingMode.DOWN); |
| | | totalOrderUsdt = totalOrderUsdt.divide(new BigDecimal("2"), RoundingMode.DOWN); |
| | | WsMapBuild.saveStringToMap(accountMap, CoinEnums.TOTAL_ORDER_USDT.name(), String.valueOf(totalOrderUsdt)); |
| | | |
| | | /** |