private boolean isLessThanZero(PositionAccountDeltaEvent accountDelta, String accountType) { String portfolioId = accountDelta.getPortfolioId(); String accountId = accountDelta.getAccountId(); String positionAccountType = accountDelta.getPositionAccountType(); String securityId = accountDelta.getSecurityId(); BigDecimal outValue = positionAccountCheckDao.findAccount( portfolioId, accountId, positionAccountType, securityId, LongShortConsts.LONG); BigDecimal realValue = positionAccountCheckDao.findAccount( portfolioId, accountId, accountType, securityId, LongShortConsts.LONG); BigDecimal willValue = BigDecimalUtil.minus(realValue, BigDecimalUtil.add(outValue, accountDelta.getBalance())); if (BigDecimalUtil.compareTo(willValue, BigDecimal.ZERO) < 0) { return true; } return false; }