本文整理汇总了Java中sample.model.master.SelfFiAccount类的典型用法代码示例。如果您正苦于以下问题:Java SelfFiAccount类的具体用法?Java SelfFiAccount怎么用?Java SelfFiAccount使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
SelfFiAccount类属于sample.model.master包,在下文中一共展示了SelfFiAccount类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: withdraw
import sample.model.master.SelfFiAccount; //导入依赖的package包/类
/**
* 出金依頼をします。
* low: repAccount よりも FiAccount や SelfFiAccount を引数にとる方が良いのですがひとまずこれで。
*/
public static CashInOut withdraw(final OrmRepository rep, final OrmRepository repAccount, final BusinessDayHandler day, final RegCashOut p) {
DomainHelper dh = rep.dh();
TimePoint now = dh.time().tp();
// low: 発生日は締め時刻等の兼ね合いで営業日と異なるケースが多いため、別途DB管理される事が多い
LocalDate eventDay = day.day();
// low: 実際は各金融機関/通貨の休日を考慮しての T+N 算出が必要
LocalDate valueDay = day.day(3);
// 事前審査
Validator.validate((v) -> {
v.verifyField(0 < p.getAbsAmount().signum(), "absAmount", DomainErrorKeys.AbsAmountZero);
boolean canWithdraw = Asset.by(p.getAccountId()).canWithdraw(rep, p.getCurrency(), p.getAbsAmount(),
valueDay);
v.verifyField(canWithdraw, "absAmount", AssetErrorKeys.CashInOutWithdrawAmount);
});
// 出金依頼情報を登録
FiAccount acc = FiAccount.load(repAccount, p.getAccountId(), Remarks.CashOut, p.getCurrency());
SelfFiAccount selfAcc = SelfFiAccount.load(repAccount, Remarks.CashOut, p.getCurrency());
String updateActor = dh.actor().getId();
return p.create(now, eventDay, valueDay, acc, selfAcc, updateActor).save(rep);
}
示例2: create
import sample.model.master.SelfFiAccount; //导入依赖的package包/类
public CashInOut create(final TimePoint now, LocalDate eventDay, LocalDate valueDay, final FiAccount acc,
final SelfFiAccount selfAcc, String updActor) {
CashInOut m = new CashInOut();
m.setAccountId(accountId);
m.setCurrency(currency);
m.setAbsAmount(absAmount);
m.setWithdrawal(true);
m.setRequestDay(now.getDay());
m.setRequestDate(now.getDate());
m.setEventDay(eventDay);
m.setValueDay(valueDay);
m.setTargetFiCode(acc.getFiCode());
m.setTargetFiAccountId(acc.getFiAccountId());
m.setSelfFiCode(selfAcc.getFiCode());
m.setSelfFiAccountId(selfAcc.getFiAccountId());
m.setStatusType(ActionStatusType.Unprocessed);
return m;
}
示例3: withdraw
import sample.model.master.SelfFiAccount; //导入依赖的package包/类
/** 出金依頼をします。 */
public static CashInOut withdraw(final OrmRepository rep, final BusinessDayHandler day, final RegCashOut p) {
DomainHelper dh = rep.dh();
TimePoint now = dh.time().tp();
// low: 発生日は締め時刻等の兼ね合いで営業日と異なるケースが多いため、別途DB管理される事が多い
LocalDate eventDay = day.day();
// low: 実際は各金融機関/通貨の休日を考慮しての T+N 算出が必要
LocalDate valueDay = day.day(3);
// 事前審査
Validator.validate((v) -> {
v.verifyField(0 < p.getAbsAmount().signum(), "absAmount", DomainErrorKeys.AbsAmountZero);
boolean canWithdraw = Asset.by(p.getAccountId()).canWithdraw(rep, p.getCurrency(), p.getAbsAmount(),
valueDay);
v.verifyField(canWithdraw, "absAmount", AssetErrorKeys.CashInOutWithdrawAmount);
});
// 出金依頼情報を登録
FiAccount acc = FiAccount.load(rep, p.getAccountId(), Remarks.CashOut, p.getCurrency());
SelfFiAccount selfAcc = SelfFiAccount.load(rep, Remarks.CashOut, p.getCurrency());
String updateActor = dh.actor().getId();
return p.create(now, eventDay, valueDay, acc, selfAcc, updateActor).save(rep);
}
示例4: withdraw
import sample.model.master.SelfFiAccount; //导入依赖的package包/类
/** 出金依頼をします。 */
public static CashInOut withdraw(final JpaRepository rep, final RegCashOut p) {
DomainHelper dh = rep.dh();
TimePoint now = dh.time().tp();
// low: 発生日は締め時刻等の兼ね合いで営業日と異なるケースが多いため、別途DB管理される事が多い
String eventDay = now.getDay();
// low: 実際は各金融機関/通貨の休日を考慮しての T+N 算出が必要
String valueDay = dh.time().dayPlus(3);
// 事前審査
Validator v = new Validator();
v.verifyField(0 < p.getAbsAmount().signum(), "absAmount", "error.domain.AbsAmount.zero");
boolean canWithdraw = Asset.by(p.getAccountId()).canWithdraw(rep, p.getCurrency(), p.getAbsAmount(), valueDay);
v.verifyField(canWithdraw, "absAmount", "error.CashInOut.withdrawAmount");
// 出金依頼情報を登録
String uid = dh.uid().generate(CashInOut.class.getSimpleName());
FiAccount acc = FiAccount.load(rep, p.getAccountId(), Remarks.CashOut, p.getCurrency());
SelfFiAccount selfAcc = SelfFiAccount.load(rep, Remarks.CashOut, p.getCurrency());
String updateActor = dh.actor().getId();
return p.create(now, uid, eventDay, valueDay, acc, selfAcc, updateActor).save(rep);
}
示例5: setupPreset
import sample.model.master.SelfFiAccount; //导入依赖的package包/类
@Override
protected void setupPreset() {
targetEntities(Account.class, FiAccount.class, SelfFiAccount.class,
CashInOut.class, Cashflow.class, CashBalance.class);
}
示例6: selfFiAcc
import sample.model.master.SelfFiAccount; //导入依赖的package包/类
/** 自社金融機関口座の簡易生成 */
public SelfFiAccount selfFiAcc(String category, String currency) {
return new SelfFiAccount(null, category, currency, category + "-" + currency, "xxxxxx");
}
示例7: create
import sample.model.master.SelfFiAccount; //导入依赖的package包/类
public CashInOut create(final TimePoint now, String id, String eventDay, String valueDay, final FiAccount acc,
final SelfFiAccount selfAcc, String updActor) {
return new CashInOut(id, accountId, currency, absAmount, true, now, eventDay, valueDay, acc.getFiCode(),
acc.getFiAccountId(), selfAcc.getFiCode(), selfAcc.getFiAccountId(), ActionStatusType.UNPROCESSED,
updActor, now.getDate(), null);
}