Helius
2021-02-03 23a391f7552fbc0fbf474604278ecaa0b208564e
modify
1 files modified
23 ■■■■ changed files
src/main/java/com/xcong/excoin/rabbit/pricequeue/WebsocketPriceService.java 23 ●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/rabbit/pricequeue/WebsocketPriceService.java
@@ -287,8 +287,7 @@
        }
    }
    @Transactional(rollbackFor = Exception.class)
    public synchronized void wholeBomb() {
    public void wholeBomb() {
        Map<String, WholePriceDataModel> dataModelMap = WholeDataQueue.MAP;
        if (CollUtil.isEmpty(dataModelMap)) {
            return;
@@ -339,15 +338,17 @@
                    continue;
                }
                log.info("爆仓啥的:{}", entry.getKey());
                if (entry.getKey() != null) {
                    dataModelMap.remove(entry.getKey());
                    wholePriceData.setEquity(wholePriceData.getBalance().add(totalProfitOrLoss));
                    redisUtils.set(AppContants.WHOLE_BOMB_MAP, JSONObject.toJSONString(dataModelMap));
                    log.info("全仓爆仓触发:{}", JSONObject.toJSONString(wholePriceData));
                    wholePriceData.setPrices(prices);
                    contractHoldOrderDao.updateMemberAllHoldOrderClosingStatus(wholePriceData.getMemberId());
                    orderProducer.sendWholeBomb(JSONObject.toJSONString(wholePriceData));
                synchronized(this) {
                    log.info("爆仓啥的:{}", entry.getKey());
                    if (entry.getKey() != null) {
                        dataModelMap.remove(entry.getKey());
                        wholePriceData.setEquity(wholePriceData.getBalance().add(totalProfitOrLoss));
                        redisUtils.set(AppContants.WHOLE_BOMB_MAP, JSONObject.toJSONString(dataModelMap));
                        log.info("全仓爆仓触发:{}", JSONObject.toJSONString(wholePriceData));
                        wholePriceData.setPrices(prices);
                        contractHoldOrderDao.updateMemberAllHoldOrderClosingStatus(wholePriceData.getMemberId());
                        orderProducer.sendWholeBomb(JSONObject.toJSONString(wholePriceData));
                    }
                }
            }
        }