当前位置: 首页>>代码示例>>Java>>正文


Java Period.setUseTime方法代码示例

本文整理汇总了Java中nl.strohalm.cyclos.utils.Period.setUseTime方法的典型用法代码示例。如果您正苦于以下问题:Java Period.setUseTime方法的具体用法?Java Period.setUseTime怎么用?Java Period.setUseTime使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在nl.strohalm.cyclos.utils.Period的用法示例。


在下文中一共展示了Period.setUseTime方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getEnabledPeriod

import nl.strohalm.cyclos.utils.Period; //导入方法依赖的package包/类
public Period getEnabledPeriod() {
    final Period period = Period.between(enabledSince, disabledSince);
    period.setUseTime(true);
    return period;
}
 
开发者ID:crypto-coder,项目名称:open-cyclos,代码行数:6,代码来源:RateParameters.java

示例2: next

import nl.strohalm.cyclos.utils.Period; //导入方法依赖的package包/类
@Override
public MembersReportVO next() {
    final MembersReportVO membersReportVO = new MembersReportVO();

    final Member member = membersIterator.next();
    membersReportVO.setMember(member);
    // Calendar date = null;
    Period period = null;
    if (dto.getPeriod() != null) {
        period = Period.exact(dto.getPeriod());
        period.setUseTime(true);
    }

    if (dto.isAds()) {
        final Map<Ad.Status, Integer> ads = adService.getNumberOfAds(period != null ? period.getEnd() : null, member);
        membersReportVO.setAds(ads);
    }

    if (dto.isGivenReferences()) {
        final Map<Reference.Level, Integer> givenReferences = referenceService.countReferencesHistoryByLevel(Reference.Nature.GENERAL, member, period, false);
        membersReportVO.setGivenReferences(givenReferences);
    }

    if (dto.isReceivedReferences()) {
        final Map<Reference.Level, Integer> receivedReferences = referenceService.countReferencesHistoryByLevel(Reference.Nature.GENERAL, member, period, true);
        membersReportVO.setReceivedReferences(receivedReferences);
    }

    if (dto.isAccountsInformation()) {
        final Map<AccountType, BigDecimal> accountsCreditsMap = new HashMap<AccountType, BigDecimal>();
        final Map<AccountType, BigDecimal> accountsUpperCreditsMap = new HashMap<AccountType, BigDecimal>();
        final Map<AccountType, BigDecimal> accountsBalancesMap = new HashMap<AccountType, BigDecimal>();
        for (final AccountType accountType : accountTypes) {
            final AccountDTO accountDto = new AccountDTO();
            accountDto.setType(accountType);
            accountDto.setOwner(member);

            try {
                final Account account = accountService.getAccount(accountDto, (Relationship[]) null);
                if (dto.isAccountsCredits()) {
                    final BigDecimal creditLimit = account.getCreditLimit();
                    accountsCreditsMap.put(accountType, creditLimit);
                }
                if (dto.isAccountsUpperCredits()) {
                    final BigDecimal upperCreditLimit = account.getUpperCreditLimit();
                    accountsUpperCreditsMap.put(accountType, upperCreditLimit);
                }
                if (dto.isAccountsBalances()) {
                    final BigDecimal balance = accountService.getBalance(new AccountDateDTO(account, dto.getPeriod()));
                    accountsBalancesMap.put(accountType, balance);
                }
            } catch (final EntityNotFoundException e) {
                // the member doesn't have the account of the given type, just ignore it
            }
        }
        membersReportVO.setAccountsCredits(accountsCreditsMap);
        membersReportVO.setAccountsUpperCredits(accountsUpperCreditsMap);
        membersReportVO.setAccountsBalances(accountsBalancesMap);
    }
    return membersReportVO;
}
 
开发者ID:crypto-coder,项目名称:open-cyclos,代码行数:62,代码来源:MembersListReportVOIterator.java


注:本文中的nl.strohalm.cyclos.utils.Period.setUseTime方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。