Helius
2021-02-03 0002f4d59b5a40457258291ef95b6bddd7fc2153
modify
1 files modified
22 ■■■■ changed files
src/main/java/com/xcong/excoin/rabbit/pricequeue/WebsocketPriceService.java 22 ●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/rabbit/pricequeue/WebsocketPriceService.java
@@ -288,7 +288,7 @@
    }
    @Transactional(rollbackFor = Exception.class)
    public void wholeBomb() {
    public synchronized void wholeBomb() {
        Map<String, WholePriceDataModel> dataModelMap = WholeDataQueue.MAP;
        if (CollUtil.isEmpty(dataModelMap)) {
            return;
@@ -339,17 +339,15 @@
                    continue;
                }
                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));
                    }
                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));
                }
            }
        }