| | |
| | | |
| | | if (CollUtil.isNotEmpty(holdOrderEntities)) { |
| | | BigDecimal totalProfitOrLess = BigDecimal.ZERO; |
| | | String currentPrice = null; |
| | | Map<String, Object> priceMap = new HashMap<>(); |
| | | for (ContractHoldOrderEntity holdOrderEntity : holdOrderEntities) { |
| | | if (symbol.equalsIgnoreCase(holdOrderEntity.getSymbol())) { |
| | | currentPrice = price; |
| | | } else { |
| | | currentPrice = redisUtils.getString(CoinTypeConvert.convertToKey(holdOrderEntity.getSymbol())); |
| | | } |
| | | String currentPrice = redisUtils.getString(CoinTypeConvert.convertToKey(holdOrderEntity.getSymbol())); |
| | | priceMap.put(holdOrderEntity.getSymbol(), currentPrice); |
| | | |
| | | BigDecimal lotNumber = cacheSettingUtils.getSymbolSku(holdOrderEntity.getSymbol()); |
| | | BigDecimal profitOrLess = CalculateUtil.calOrderProfitOrLess(holdOrderEntity.getOpeningType(), new BigDecimal(currentPrice), holdOrderEntity.getOpeningPrice(), lotNumber, holdOrderEntity.getSymbolCntSale(), memberEntity.getIsProfit()); |
| | | totalProfitOrLess = totalProfitOrLess.add(profitOrLess); |
| | |
| | | String content = JSONObject.toJSONString(list); |
| | | |
| | | String key = AppContants.WHOLE_BOMB_PREFIX + memberId; |
| | | String value = redisUtils.getString(key); |
| | | if (StrUtil.isBlank(value)) { |
| | | Map<Object, Object> value = redisUtils.hmget(key); |
| | | if (value == null) { |
| | | orderProducer.sendWholeBomb(content); |
| | | contractHoldOrderDao.updateMemberAllHoldOrderClosingStatus(memberId); |
| | | |
| | | redisUtils.set(key, memberId); |
| | | redisUtils.hmset(key, priceMap); |
| | | } |
| | | } |
| | | } |