提交 250dacdf authored 作者: huyufan's avatar huyufan

资金相关

上级 447e261f
......@@ -160,35 +160,45 @@ public class OwnerAccountServiceImpl implements OwnerAccountService {
update.setId(account.getId());
Integer flag = ownerAccountDao.updateAccountCAS(update, now, false);
if (null != flag) {
break;
account = ownerAccountDao.getAccountByOwnerUserNoAndAccountType(param.getOwnerUserNo(), param.getAccountType());
//提现记录
OwnerCaseOut entity = new OwnerCaseOut();
entity.setAccountType(param.getAccountType());
entity.setCaseOutNo(idGenerateSnowFlake.nextId(IdTypeEnum.Type.CASE_OUT.getCode()));
entity.setCaseOutBalance(caseOutBalance);
entity.setOwnerUserNo(param.getOwnerUserNo());
entity.setStatus(OwnerAccountEnum.CaseOutStatus.PENDING_PAYMENT.getCode());
entity.setCaseOutBank(param.getOwnerOpenBank());
entity.setCaseOutBankNumber(param.getOwnerBankAccount());
ownerCaseOutDao.saveEntity(entity);
//插入冻结流水
OwnerRunningWaterRecord runningWaterRecord = new OwnerRunningWaterRecord();
runningWaterRecord.setOwnerUserName(loginUserInfo.getUserName());
runningWaterRecord.setMobile(loginUserInfo.getUserMobile());
runningWaterRecord.setCreateBy(loginUserInfo.getUserName());
runningWaterRecord.setRelationId(entity.getCaseOutNo());
//变动金额
runningWaterRecord.setAlterationBalance(caseOutBalance);
//账户余额
runningWaterRecord.setAccountBalance(account.getAccountBalance());
//冻结金额
runningWaterRecord.setFrozenBalance(caseOutBalance);
//扣除金额
runningWaterRecord.setTakeOutBalance(BigDecimal.ZERO);
runningWaterRecord.setOwnerUserNo(param.getOwnerUserNo());
runningWaterRecord.setAccountType(param.getAccountType());
runningWaterRecord.setRunningWaterType(OwnerAccountEnum.RunningWaterStatus.FROZEN.getCode());
runningWaterRecord.setRunningWaterNo(idGenerateSnowFlake.nextId(IdTypeEnum.Type.CASE_OUT_FROZEN.getCode()));
ownerRunningWaterRecordDao.saveEntity(runningWaterRecord);
return entity.getCaseOutNo();
}
}
//提现记录
OwnerCaseOut entity = new OwnerCaseOut();
entity.setAccountType(param.getAccountType());
entity.setCaseOutNo(idGenerateSnowFlake.nextId(IdTypeEnum.Type.CASE_OUT.getCode()));
entity.setCaseOutBalance(caseOutBalance);
entity.setOwnerUserNo(param.getOwnerUserNo());
entity.setStatus(OwnerAccountEnum.CaseOutStatus.PENDING_PAYMENT.getCode());
entity.setCaseOutBank(param.getOwnerOpenBank());
entity.setCaseOutBankNumber(param.getOwnerBankAccount());
ownerCaseOutDao.saveEntity(entity);
//插入冻结流水
OwnerRunningWaterRecord runningWaterRecord = new OwnerRunningWaterRecord();
runningWaterRecord.setOwnerUserName(loginUserInfo.getUserName());
runningWaterRecord.setMobile(loginUserInfo.getUserMobile());
runningWaterRecord.setCreateBy(loginUserInfo.getUserName());
runningWaterRecord.setRelationId(entity.getCaseOutNo());
runningWaterRecord.setAccountBalance(caseOutBalance);
runningWaterRecord.setOwnerUserNo(param.getOwnerUserNo());
runningWaterRecord.setAccountType(param.getAccountType());
runningWaterRecord.setRunningWaterType(OwnerAccountEnum.RunningWaterStatus.FROZEN.getCode());
runningWaterRecord.setRunningWaterNo(idGenerateSnowFlake.nextId(IdTypeEnum.Type.CASE_OUT_FROZEN.getCode()));
ownerRunningWaterRecordDao.saveEntity(runningWaterRecord);
return entity.getCaseOutNo();
}
@Override
......@@ -208,34 +218,44 @@ public class OwnerAccountServiceImpl implements OwnerAccountService {
update.setId(account.getId());
Integer flag = ownerAccountDao.updateAccountCAS(update, now, false);
if (null != flag) {
break;
//提现记录
OwnerCaseOut entity = new OwnerCaseOut();
entity.setAccountType(param.getAccountType());
entity.setCaseOutNo(idGenerateSnowFlake.nextId(IdTypeEnum.Type.CASE_OUT.getCode()));
entity.setOwnerUserNo(param.getOwnerUserNo());
entity.setStatus(OwnerAccountEnum.CaseOutStatus.PENDING_PAYMENT.getCode());
entity.setCaseOutBank(param.getCaseOutBank());
entity.setCaseOutBankNumber(param.getCaseOutBankNumber());
ownerCaseOutDao.saveEntity(entity);
//插入冻结流水
OwnerRunningWaterRecord runningWaterRecord = new OwnerRunningWaterRecord();
runningWaterRecord.setOwnerUserName(loginUserInfo.getUserName());
runningWaterRecord.setMobile(loginUserInfo.getUserMobile());
runningWaterRecord.setCreateBy(loginUserInfo.getUserName());
runningWaterRecord.setRelationId(entity.getCaseOutNo());
//变动金额
runningWaterRecord.setAlterationBalance(caseOutBalance);
//账户余额
runningWaterRecord.setAccountBalance(account.getAccountBalance());
//冻结金额
runningWaterRecord.setFrozenBalance(caseOutBalance);
//扣除金额
runningWaterRecord.setTakeOutBalance(BigDecimal.ZERO);
runningWaterRecord.setOwnerUserNo(param.getOwnerUserNo());
runningWaterRecord.setAccountType(param.getAccountType());
runningWaterRecord.setRunningWaterType(OwnerAccountEnum.RunningWaterStatus.FROZEN.getCode());
runningWaterRecord.setRunningWaterNo(idGenerateSnowFlake.nextId(IdTypeEnum.Type.CASE_OUT_FROZEN.getCode()));
ownerRunningWaterRecordDao.saveEntity(runningWaterRecord);
return entity.getCaseOutNo();
}
}
//提现记录
OwnerCaseOut entity = new OwnerCaseOut();
entity.setAccountType(param.getAccountType());
entity.setCaseOutNo(idGenerateSnowFlake.nextId(IdTypeEnum.Type.CASE_OUT.getCode()));
entity.setOwnerUserNo(param.getOwnerUserNo());
entity.setStatus(OwnerAccountEnum.CaseOutStatus.PENDING_PAYMENT.getCode());
entity.setCaseOutBank(param.getCaseOutBank());
entity.setCaseOutBankNumber(param.getCaseOutBankNumber());
ownerCaseOutDao.saveEntity(entity);
//插入冻结流水
OwnerRunningWaterRecord runningWaterRecord = new OwnerRunningWaterRecord();
runningWaterRecord.setOwnerUserName(loginUserInfo.getUserName());
runningWaterRecord.setMobile(loginUserInfo.getUserMobile());
runningWaterRecord.setCreateBy(loginUserInfo.getUserName());
runningWaterRecord.setRelationId(entity.getCaseOutNo());
runningWaterRecord.setAccountBalance(caseOutBalance);
runningWaterRecord.setOwnerUserNo(param.getOwnerUserNo());
runningWaterRecord.setAccountType(param.getAccountType());
runningWaterRecord.setRunningWaterType(OwnerAccountEnum.RunningWaterStatus.FROZEN.getCode());
runningWaterRecord.setRunningWaterNo(idGenerateSnowFlake.nextId(IdTypeEnum.Type.CASE_OUT_FROZEN.getCode()));
ownerRunningWaterRecordDao.saveEntity(runningWaterRecord);
return entity.getCaseOutNo();
}
/**
......@@ -254,7 +274,6 @@ public class OwnerAccountServiceImpl implements OwnerAccountService {
entity.setApprovalBy(loginUserInfo.getUserName());
entity.setApprovalTime(LocalDateTime.now());
String ownerName = "";
if (!param.getPassType()) {
entity.setId(param.getId());
entity.setApprovalTurnDown(param.getTurnDownContent());
......@@ -273,28 +292,33 @@ public class OwnerAccountServiceImpl implements OwnerAccountService {
update.setModifiedTime(account.getModifiedTime());
Integer flag = ownerAccountDao.updateAccountCAS(update, now, true);
if (null != flag) {
ownerName = account.getOwnerUserName();
account = ownerAccountDao.getAccountByOwnerUserNoAndAccountType(ownerTopUp.getOwnerUserNo(), param.getAccountType());
entity.setId(param.getId());
entity.setStatus(OwnerAccountEnum.TopUpStatus.APPROVAL_APPROVE.getCode());
ownerTopUpDao.updateEntityByKey(entity);
//需要插入充值流水
OwnerRunningWaterRecord runningWaterRecord = new OwnerRunningWaterRecord();
runningWaterRecord.setOwnerUserName(account.getOwnerUserName());
runningWaterRecord.setMobile(loginUserInfo.getUserMobile());
runningWaterRecord.setCreateBy(loginUserInfo.getUserName());
runningWaterRecord.setRelationId(ownerTopUp.getTopUpNo());
runningWaterRecord.setAlterationBalance(topUpBalance);
runningWaterRecord.setAccountBalance(account.getAccountBalance());
runningWaterRecord.setUsableBalance(account.getUsableBalance());
runningWaterRecord.setFrozenBalance(account.getFrozenBalance());
runningWaterRecord.setOwnerUserNo(ownerTopUp.getOwnerUserNo());
runningWaterRecord.setAccountType(param.getAccountType());
runningWaterRecord.setRunningWaterType(OwnerAccountEnum.RunningWaterStatus.TOP_UP.getCode());
runningWaterRecord.setRunningWaterNo(idGenerateSnowFlake.nextId(IdTypeEnum.Type.TOP_UP_SUCCESS.getCode()));
ownerRunningWaterRecordDao.saveEntity(runningWaterRecord);
break;
}
}
entity.setId(param.getId());
entity.setStatus(OwnerAccountEnum.TopUpStatus.APPROVAL_APPROVE.getCode());
ownerTopUpDao.updateEntityByKey(entity);
//需要插入充值流水
OwnerRunningWaterRecord runningWaterRecord = new OwnerRunningWaterRecord();
runningWaterRecord.setOwnerUserName(ownerName);
runningWaterRecord.setMobile(loginUserInfo.getUserMobile());
runningWaterRecord.setCreateBy(loginUserInfo.getUserName());
runningWaterRecord.setRelationId(ownerTopUp.getTopUpNo());
runningWaterRecord.setAccountBalance(topUpBalance);
runningWaterRecord.setOwnerUserNo(ownerTopUp.getOwnerUserNo());
runningWaterRecord.setAccountType(param.getAccountType());
runningWaterRecord.setRunningWaterType(OwnerAccountEnum.RunningWaterStatus.TOP_UP.getCode());
runningWaterRecord.setRunningWaterNo(idGenerateSnowFlake.nextId(IdTypeEnum.Type.TOP_UP_SUCCESS.getCode()));
ownerRunningWaterRecordDao.saveEntity(runningWaterRecord);
}
}
......@@ -340,6 +364,31 @@ public class OwnerAccountServiceImpl implements OwnerAccountService {
update.setModifiedTime(account.getModifiedTime());
Integer flag = ownerAccountDao.updateOwnerAccountForConfirm(update);
if (flag > 0) {
account = ownerAccountDao.getAccountByOwnerUserNoAndAccountType(ownerCaseOut.getOwnerUserNo(), ownerCaseOut.getAccountType());
//插入提现成功流水
OwnerRunningWaterRecord runningWaterRecord = new OwnerRunningWaterRecord();
runningWaterRecord.setOwnerUserName(loginUserInfo.getUserName());
runningWaterRecord.setMobile(loginUserInfo.getUserMobile());
runningWaterRecord.setCreateBy(loginUserInfo.getUserName());
runningWaterRecord.setRelationId(ownerCaseOut.getCaseOutNo());
//账户余额
runningWaterRecord.setAccountBalance(account.getAccountBalance());
//变动余额
runningWaterRecord.setAlterationBalance(caseOutBalance);
//可用余额
runningWaterRecord.setUsableBalance(account.getUsableBalance());
//扣除金额
runningWaterRecord.setTakeOutBalance(caseOutBalance);
//冻结金额
runningWaterRecord.setFrozenBalance(BigDecimal.ZERO);
runningWaterRecord.setOwnerUserNo(ownerCaseOut.getOwnerUserNo());
runningWaterRecord.setAccountType(ownerCaseOut.getAccountType());
runningWaterRecord.setRunningWaterType(OwnerAccountEnum.RunningWaterStatus.CASE_OUT_SUCCESS.getCode());
runningWaterRecord.setRunningWaterNo(idGenerateSnowFlake.nextId(IdTypeEnum.Type.CASE_OUT_SUCCESS.getCode()));
ownerRunningWaterRecordDao.saveEntity(runningWaterRecord);
break;
}
}
......@@ -350,20 +399,7 @@ public class OwnerAccountServiceImpl implements OwnerAccountService {
entity.setStatus(OwnerAccountEnum.CaseOutStatus.PAID.getCode());
ownerCaseOutDao.updateEntityByKey(entity);
//插入提现成功流水
OwnerRunningWaterRecord runningWaterRecord = new OwnerRunningWaterRecord();
runningWaterRecord.setOwnerUserName(loginUserInfo.getUserName());
runningWaterRecord.setMobile(loginUserInfo.getUserMobile());
runningWaterRecord.setCreateBy(loginUserInfo.getUserName());
runningWaterRecord.setRelationId(ownerCaseOut.getCaseOutNo());
runningWaterRecord.setAccountBalance(caseOutBalance);
runningWaterRecord.setOwnerUserNo(ownerCaseOut.getOwnerUserNo());
runningWaterRecord.setAccountType(ownerCaseOut.getAccountType());
runningWaterRecord.setRunningWaterType(OwnerAccountEnum.RunningWaterStatus.CASE_OUT_SUCCESS.getCode());
runningWaterRecord.setRunningWaterNo(idGenerateSnowFlake.nextId(IdTypeEnum.Type.CASE_OUT_SUCCESS.getCode()));
ownerRunningWaterRecordDao.saveEntity(runningWaterRecord);
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论