| | |
| | | JSONArray dataArray = response.getJSONArray("data"); |
| | | if (dataArray == null || dataArray.isEmpty()) { |
| | | log.info("账户持仓频道数据为空,已当前价买入,并且初始化网格"); |
| | | JSONObject posData = new JSONObject(); |
| | | processPositionData(posData, redisUtils); |
| | | return; |
| | | } |
| | | |
| | | for (int i = 0; i < dataArray.size(); i++) { |
| | | JSONObject posData = dataArray.getJSONObject(i); |
| | | String instId = posData.getString("instId"); |
| | | |
| | | if (!CoinEnums.HE_YUE.getCode().equals(instId)) { |
| | | continue; |
| | | } |
| | | if (CoinEnums.HE_YUE.getCode().equals(instId)) { |
| | | log.info("查询到账户{}持仓数据",CoinEnums.HE_YUE.getCode()); |
| | | String mgnMode = posData.getString("mgnMode"); |
| | | String posSide = posData.getString("posSide"); |
| | | String pos = posData.getString("pos"); |
| | |
| | | last, idxPx, bePx, realizedPnl, settledPnl, |
| | | markPx |
| | | ); |
| | | |
| | | processPositionData(posData, redisUtils); |
| | | } |
| | | } |
| | | } catch (Exception e) { |
| | | log.error("处理持仓频道推送数据失败", e); |
| | | } |