@Override
  protected List<AccountDelta> caculateFill(
      AccountDeltaCaculatorParameter parameter, String securityTypeCode, BigDecimal balance) {
    List<AccountDelta> result = new LinkedList<AccountDelta>();
    if (SecurityTypeConsts.CURRENCY.equals(securityTypeCode)) {
      result.add(createAccountDelta(balance, AccountTypeConsts.POSITION));
      // 回购到期是日初做的,需要知道,日初的日期(t0Day)
      Date t1Day = businessDayService.getBusinessDayDefault(parameter.getT0Day(), 1);
      result.add(accountDeltaFactory.create(AccountTypeConsts.AVAILABLE, balance, t1Day));
      return result;
    }

    if (SecurityTypeConsts.REPO.equals(securityTypeCode)) {
      Date theoryDay = parameter.getBusinessDay();
      result.add(
          accountDeltaFactory.create(AccountTypeConsts.POSITION, balance.negate(), theoryDay));
    }
    return result;
  }
예제 #2
0
 private BasketQueryResult getBasket(BaseConfig config) {
   Date businessDay = businessDayServiceImpl.getBusinessDay(SH_EXCHANGE_CODE, 0);
   BasketQueryResult basket =
       basketQuery.findBasketByfundIdAndDate(config.getSecurityId(), businessDay);
   return basket;
 }