| | |
| | | import org.apache.commons.collections.CollectionUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | |
| | | } |
| | | } |
| | | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void wholeBomb() { |
| | | Map<String, WholePriceDataModel> dataModelMap = WholeDataQueue.MAP; |
| | | if (CollUtil.isEmpty(dataModelMap)) { |
| | |
| | | String price = redisUtils.getString(CoinTypeConvert.convertToKey(holdOrderData.getSymbol())); |
| | | BigDecimal newPrice = new BigDecimal(price); |
| | | // BigDecimal newPrice = new BigDecimal("29958.46627789"); |
| | | |
| | | |
| | | BigDecimal rewardRatio = null; |
| | | if (ContractHoldOrderEntity.OPENING_TYPE_MORE == holdOrderData.getOpeningType()) { |
| | |
| | | } |
| | | |
| | | dataModelMap.remove(entry.getKey()); |
| | | System.out.println("触发"); |
| | | 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)); |