|
|
@@ -371,7 +371,7 @@ public class FlowServiceImpl extends AbstractService<Flow> implements FlowServic
|
|
|
|
|
|
Date today = DateUtil.date();
|
|
|
Flow flow = Flow.builder()
|
|
|
- .amount(param.getAmount())
|
|
|
+ .amount(param.getAmount().subtract(param.getFee()))
|
|
|
.bizType(param.getBizType())
|
|
|
.userId(param.getUserId())
|
|
|
.bizNo(param.getBizNo())
|
|
|
@@ -397,6 +397,36 @@ public class FlowServiceImpl extends AbstractService<Flow> implements FlowServic
|
|
|
.bizNo(flow.getBizNo()).balance(innerCapitalAccount.getBalance().subtract(flow.getAmount()))
|
|
|
.freezeAmount(innerCapitalAccount.getFreezeAmount()).userId(flow.getUserId())
|
|
|
.flowType(3).type(1).bizType(param.getBizType()).flowId(flow.getId()).build());
|
|
|
+ Account innerIncomeAccount = accountService.findById(MyConstants.INNER_INCOME);
|
|
|
+ if (innerIncomeAccount == null) {
|
|
|
+ return Result.genFailResult(LocalUtil.get("account.not.found"));
|
|
|
+ }
|
|
|
+ // 提现手续费收入
|
|
|
+ Flow flow2 = Flow.builder().amount(param.getFee()).bizType(BizTypeEnum.WITHDRAWAL_FEE.getKey())
|
|
|
+ .userId(param.getUserId())
|
|
|
+ .bizNo(param.getBizNo())
|
|
|
+ .createTime(today)
|
|
|
+ .updateTime(today)
|
|
|
+ .transTime(param.getTransTime())
|
|
|
+ .debitAccount(account.getId())
|
|
|
+ .creditAccount(MyConstants.INNER_INCOME)
|
|
|
+ .createUser(param.getUserId() + "")
|
|
|
+ .bizId(param.getBizId()).type(6)
|
|
|
+ .build();
|
|
|
+ saveUseGeneratedKeys(flow2);
|
|
|
+ // 借:个人账户钱包(贷) -500元
|
|
|
+ accountService.deal(AccountFlow.builder().accountId(account.getId()).amount(flow2.getAmount())
|
|
|
+ .bizId(flow2.getBizId()).aliases(account.getAliases()).transTime(param.getTransTime())
|
|
|
+ .bizNo(flow2.getBizNo()).balance(account.getBalance().subtract(flow2.getAmount()))
|
|
|
+ .freezeAmount(account.getFreezeAmount()).userId(flow2.getUserId())
|
|
|
+ .flowType(6).type(1).bizType(param.getBizType()).flowId(flow2.getId()).build());
|
|
|
+ // 贷:平台主营收入(贷) +500元
|
|
|
+ accountService.deal(AccountFlow.builder().accountId(MyConstants.INNER_INCOME).amount(flow2.getAmount())
|
|
|
+ .bizId(flow2.getBizId()).aliases(innerIncomeAccount.getAliases()).transTime(param.getTransTime())
|
|
|
+ .bizNo(flow2.getBizNo()).balance(innerIncomeAccount.getBalance().add(flow2.getAmount()))
|
|
|
+ .freezeAmount(innerIncomeAccount.getFreezeAmount()).userId(flow2.getUserId())
|
|
|
+ .flowType(6).type(2).bizType(param.getBizType()).flowId(flow2.getId()).build());
|
|
|
+
|
|
|
return Result.genSuccessResult();
|
|
|
}
|
|
|
|