本文整理汇总了Java中nl.strohalm.cyclos.entities.accounts.transactions.ScheduledPaymentQuery.setStatusGroup方法的典型用法代码示例。如果您正苦于以下问题:Java ScheduledPaymentQuery.setStatusGroup方法的具体用法?Java ScheduledPaymentQuery.setStatusGroup怎么用?Java ScheduledPaymentQuery.setStatusGroup使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类nl.strohalm.cyclos.entities.accounts.transactions.ScheduledPaymentQuery
的用法示例。
在下文中一共展示了ScheduledPaymentQuery.setStatusGroup方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: searchScheduledPayments
import nl.strohalm.cyclos.entities.accounts.transactions.ScheduledPaymentQuery; //导入方法依赖的package包/类
private ScheduledPaymentsResultPage searchScheduledPayments(final MemberAccount account, final SearchScheduledPaymentParams params) {
Member member = memberService.loadByIdOrPrincipal(params.getMemberId(), null, params.getMemberPrincipal());
// Convert the params to a TransferQuery
ScheduledPaymentQuery query = new ScheduledPaymentQuery();
queryHelper.fill(params, query);
query.setOwner(account.getOwner());
query.setMember(member);
query.setPeriod(Period.between(params.getBeginDate(), params.getEndDate()));
query.setSearchType(params.getIncoming() ? SearchType.INCOMING : SearchType.OUTGOING);
if (params.getStatus() == null) {
query.setStatusGroup(StatusGroup.OPEN);
} else {
query.setStatusGroup(StatusGroup.valueOf(params.getStatus().name()));
}
// Execute the search
List<ScheduledPayment> scheduledPayments = scheduledPaymentService.search(query);
return toScheduledResultPage(scheduledPayments);
}
示例2: prepareForm
import nl.strohalm.cyclos.entities.accounts.transactions.ScheduledPaymentQuery; //导入方法依赖的package包/类
@Override
protected QueryParameters prepareForm(final ActionContext context) {
final SearchScheduledPaymentsForm form = context.getForm();
final HttpServletRequest request = context.getRequest();
final ScheduledPaymentQuery query = getDataBinder().readFromString(form.getQuery());
query.fetch(ScheduledPayment.Relationships.TRANSFERS, RelationshipHelper.nested(Payment.Relationships.FROM, MemberAccount.Relationships.MEMBER), RelationshipHelper.nested(Payment.Relationships.TO, MemberAccount.Relationships.MEMBER));
// Account owner
AccountOwner owner = null;
if (form.getMemberId() > 0) {
owner = (Member) elementService.load(form.getMemberId());
request.setAttribute("memberId", form.getMemberId());
} else {
// An admin or member or an operator searching his own scheduled payments
owner = context.getAccountOwner();
}
query.setOwner(owner);
List<? extends AccountType> accountTypes;
if (context.isAdmin() && owner instanceof SystemAccountOwner) {
final SystemAccountTypeQuery satq = new SystemAccountTypeQuery();
accountTypes = accountTypeService.search(satq);
} else {
final MemberAccountTypeQuery matq = new MemberAccountTypeQuery();
matq.setOwner((Member) owner);
accountTypes = accountTypeService.search(matq);
}
request.setAttribute("accountTypes", accountTypes);
if (query.getMember() != null) {
final Member member = elementService.load(query.getMember().getId(), Element.Relationships.USER);
query.setMember(member);
}
if (query.getStatusList() == null) {
query.setStatusGroup(ScheduledPaymentQuery.StatusGroup.OPEN);
form.setQuery("statusGroup", ScheduledPaymentQuery.StatusGroup.OPEN);
}
RequestHelper.storeEnum(request, ScheduledPaymentQuery.SearchType.class, "searchTypes");
RequestHelper.storeEnum(request, ScheduledPaymentQuery.StatusGroup.class, "statusGroups");
request.setAttribute("accountOwner", owner);
return query;
}