fix: 自测功能优化。

This commit is contained in:
tianyongbao
2024-05-13 17:56:41 +08:00
parent 09360021b7
commit 7fee1a1045
4 changed files with 57 additions and 6 deletions

View File

@@ -1,9 +1,9 @@
package com.ruoyi.invest.domain.vo;
import com.ruoyi.invest.domain.Accounts;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import io.swagger.annotations.ApiModel;
/**
* 记账账户Vo对象 accounts
*
@@ -17,4 +17,22 @@ public class AccountsVo extends Accounts
@ApiModelProperty(value="银行卡名称卡号)")
private String nameCode;
/** 账单日 */
@ApiModelProperty(value="账单日)")
private int billDate;
/** 还款日 */
@ApiModelProperty(value="还款日)")
private int payDate;
@ApiModelProperty(value="账单日)")
private String billDateName;
@ApiModelProperty(value="还款日)")
private String payDateName;
/** 储蓄卡类型1I类卡,2:II类卡 */
@ApiModelProperty(value="储蓄卡类型1I类卡,2:II类卡")
private String debitType;
}

View File

@@ -73,6 +73,12 @@ public class AccountsServiceImpl implements IAccountsService
}else {
accounts.setNameCode(typeName+accounts.getName());
}
if(!"null".equals(String.valueOf(accounts.getBillDate()))) {
accounts.setBillDateName(accounts.getBillDate()+"");
}
if(!"null".equals(String.valueOf(accounts.getPayDate()))) {
accounts.setPayDateName(accounts.getPayDate()+"");
}
}
return accountsList;
}

View File

@@ -527,7 +527,7 @@ public class AccountsTransferRecordServiceImpl implements IAccountsTransferRecor
BankCardLendVo debitCardVo=bankCardLendMapper.selectBankCardLendById(accountsTransferRecord.getInAccountId());
//实际入账金额
accountsTransferRecord.setActualAmount(accountsTransferRecord.getAmount());
accountsTransferRecord.setActualAmount(accountsTransferRecord.getAmount()+accountsTransferRecord.getCommission());
//借贷余额计算
AccountsVo lendAccount=accountsMapper.selectAccountsById(lendVo.getId());
@@ -581,9 +581,9 @@ public class AccountsTransferRecordServiceImpl implements IAccountsTransferRecor
AccountsVo debitAccount=accountsMapper.selectAccountsById(debitCardVo.getId());
//1表示借款2表示还款
if(accountsTransferRecord.getDealType().equals("1")){
debitAccount.setBalance(debitAccount.getBalance()+accountsTransferRecord.getActualAmount());
debitAccount.setBalance(debitAccount.getBalance()+accountsTransferRecord.getAmount());
}else if(accountsTransferRecord.getDealType().equals("2")){
debitAccount.setBalance(debitAccount.getBalance()-accountsTransferRecord.getActualAmount()-accountsTransferRecord.getCommission());
debitAccount.setBalance(debitAccount.getBalance()-accountsTransferRecord.getActualAmount());
}
debitAccount.setAvailableLimit(debitAccount.getBalance());
debitAccount.setUpdateTime(accountsTransferRecord.getCreateTime());
@@ -593,7 +593,7 @@ public class AccountsTransferRecordServiceImpl implements IAccountsTransferRecor
dealRecord.setAccountId(debitAccount.getAccountId());
dealRecord.setId(IdWorker.getId());
//支出金额
dealRecord.setAmount(accountsTransferRecord.getAmount()+accountsTransferRecord.getCommission());
dealRecord.setAmount(accountsTransferRecord.getActualAmount());
//实时余额
dealRecord.setCurrentBalance(debitAccount.getBalance());
//1储蓄卡2 信用卡3 网贷4 人情5 投资账户

View File

@@ -20,10 +20,37 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="remark" column="remark" />
<result property="accountId" column="account_id" />
<result property="state" column="state" />
<result property="billDate" column="bill_date" />
<result property="payDate" column="pay_date" />
<result property="creditLimit" column="credit_limit" />
<result property="debitType" column="debit_type" />
</resultMap>
<sql id="selectAccountsVo">
select a.id, a.name, a.type, a.code, a.balance, a.credit_limit, a.available_limit, a.create_by, a.create_time, a.update_by, a.update_time, a.del_flag, a.remark, a.account_id, a.state from accounts a
select
a.id,
a.name,
a.type,
a.code,
a.balance,
a.credit_limit,
a.available_limit,
a.create_by,
a.create_time,
a.update_by,
a.update_time,
a.del_flag,
a.remark,
a.account_id,
a.state,
bcl.bill_date ,
bcl.pay_date ,
bcl.credit_limit ,
bcl.debit_type
from
accounts a
left join bank_card_lend bcl on
bcl.id = a.id
</sql>
<select id="selectAccountsList" parameterType="AccountsDto" resultMap="AccountsResult">