|
|
@@ -3,6 +3,8 @@ package com.txz.cif.service.impl;
|
|
|
import cn.hutool.core.collection.CollUtil;
|
|
|
import cn.hutool.core.collection.CollectionUtil;
|
|
|
import cn.hutool.core.date.DateUtil;
|
|
|
+import cn.hutool.json.JSONObject;
|
|
|
+import cn.hutool.json.JSONUtil;
|
|
|
import com.txz.cif.configurer.LocalUtil;
|
|
|
import com.txz.cif.constants.MyConstants;
|
|
|
import com.txz.cif.core.AbstractService;
|
|
|
@@ -359,7 +361,8 @@ public class FlowServiceImpl extends AbstractService<Flow> implements FlowServic
|
|
|
|
|
|
@Override
|
|
|
public Result withdraw(WithdrawParam param) {
|
|
|
-
|
|
|
+// log.error("withdraw : " + JSONUtil.toJsonStr(param));
|
|
|
+
|
|
|
Account account = accountService.getAccount(param.getUserId(), param.getAccountType());
|
|
|
if (account == null) {
|
|
|
return Result.genFailResult(LocalUtil.get("account.not.found"));
|
|
|
@@ -384,7 +387,7 @@ public class FlowServiceImpl extends AbstractService<Flow> implements FlowServic
|
|
|
.type(3)
|
|
|
.build();
|
|
|
saveUseGeneratedKeys(flow);
|
|
|
-
|
|
|
+// log.error("withdraw flowId: " + flow.getId() + " amount :"+param.getAmount().subtract(param.getFee()).toPlainString());
|
|
|
// 借 :客户资金账户xx元 客户账号(负债类:贷方账户)-钱
|
|
|
accountService.deal(AccountFlow.builder().accountId(account.getId()).amount(flow.getAmount())
|
|
|
.bizId(flow.getBizId()).aliases(account.getAliases()).transTime(param.getTransTime())
|
|
|
@@ -414,18 +417,19 @@ public class FlowServiceImpl extends AbstractService<Flow> implements FlowServic
|
|
|
.bizId(param.getBizId()).type(6)
|
|
|
.build();
|
|
|
saveUseGeneratedKeys(flow2);
|
|
|
+// log.error("withdraw flowId2: " + flow2.getId());
|
|
|
// 借:个人账户钱包(贷) -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());
|
|
|
+ .flowType(6).type(1).bizType(flow2.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());
|
|
|
+ .flowType(6).type(2).bizType(flow2.getBizType()).flowId(flow2.getId()).build());
|
|
|
|
|
|
return Result.genSuccessResult();
|
|
|
}
|