提交 8e25bb5e authored 作者: jiangwenye's avatar jiangwenye

Merge remote-tracking branch 'origin/v5.5_settlement_20231011' into v5.5_settlement_20231011

......@@ -160,10 +160,7 @@ 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());
......@@ -175,13 +172,22 @@ public class OwnerAccountServiceImpl implements OwnerAccountService {
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.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());
......@@ -190,6 +196,10 @@ public class OwnerAccountServiceImpl implements OwnerAccountService {
return entity.getCaseOutNo();
}
}
}
@Override
@Transactional(rollbackFor = Exception.class)
......@@ -208,10 +218,6 @@ 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());
......@@ -228,7 +234,17 @@ public class OwnerAccountServiceImpl implements OwnerAccountService {
runningWaterRecord.setMobile(loginUserInfo.getUserMobile());
runningWaterRecord.setCreateBy(loginUserInfo.getUserName());
runningWaterRecord.setRelationId(entity.getCaseOutNo());
runningWaterRecord.setAccountBalance(caseOutBalance);
//变动金额
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());
......@@ -237,6 +253,10 @@ public class OwnerAccountServiceImpl implements OwnerAccountService {
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();
break;
}
}
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(ownerName);
runningWaterRecord.setOwnerUserName(account.getOwnerUserName());
runningWaterRecord.setMobile(loginUserInfo.getUserMobile());
runningWaterRecord.setCreateBy(loginUserInfo.getUserName());
runningWaterRecord.setRelationId(ownerTopUp.getTopUpNo());
runningWaterRecord.setAccountBalance(topUpBalance);
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;
}
}
}
}
......@@ -340,16 +364,7 @@ public class OwnerAccountServiceImpl implements OwnerAccountService {
update.setModifiedTime(account.getModifiedTime());
Integer flag = ownerAccountDao.updateOwnerAccountForConfirm(update);
if (flag > 0) {
break;
}
}
//更新提现状态
OwnerCaseOut entity = new OwnerCaseOut();
entity.setId(ownerCaseOut.getId());
entity.setStatus(OwnerAccountEnum.CaseOutStatus.PAID.getCode());
ownerCaseOutDao.updateEntityByKey(entity);
account = ownerAccountDao.getAccountByOwnerUserNoAndAccountType(ownerCaseOut.getOwnerUserNo(), ownerCaseOut.getAccountType());
//插入提现成功流水
OwnerRunningWaterRecord runningWaterRecord = new OwnerRunningWaterRecord();
runningWaterRecord.setOwnerUserName(loginUserInfo.getUserName());
......@@ -357,13 +372,34 @@ public class OwnerAccountServiceImpl implements OwnerAccountService {
runningWaterRecord.setCreateBy(loginUserInfo.getUserName());
runningWaterRecord.setRelationId(ownerCaseOut.getCaseOutNo());
runningWaterRecord.setAccountBalance(caseOutBalance);
//账户余额
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;
}
}
//更新提现状态
OwnerCaseOut entity = new OwnerCaseOut();
entity.setId(ownerCaseOut.getId());
entity.setStatus(OwnerAccountEnum.CaseOutStatus.PAID.getCode());
ownerCaseOutDao.updateEntityByKey(entity);
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论