fix:账户交易记录,增加类别子类字段,用于日常支出统计明细。
This commit is contained in:
@@ -69,6 +69,11 @@ public class AccountsDealRecord extends BaseEntity
|
|||||||
@Excel(name = "当前余额")
|
@Excel(name = "当前余额")
|
||||||
private Double currentBalance;
|
private Double currentBalance;
|
||||||
|
|
||||||
|
/** 交易类别 */
|
||||||
|
@ApiModelProperty(value="交易子类别)")
|
||||||
|
@Excel(name = "交易子类别")
|
||||||
|
private String childCategory;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||||
@@ -87,6 +92,7 @@ public class AccountsDealRecord extends BaseEntity
|
|||||||
.append("dealCategory", getDealCategory())
|
.append("dealCategory", getDealCategory())
|
||||||
.append("transferRecordId", getTransferRecordId())
|
.append("transferRecordId", getTransferRecordId())
|
||||||
.append("currentBalance", getCurrentBalance())
|
.append("currentBalance", getCurrentBalance())
|
||||||
|
.append("childCategory", getChildCategory())
|
||||||
.toString();
|
.toString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -61,4 +61,8 @@ public class AccountsDealRecordDto extends BaseEntity implements Serializable
|
|||||||
@ApiModelProperty(value="信用卡账单")
|
@ApiModelProperty(value="信用卡账单")
|
||||||
private String creditBill;
|
private String creditBill;
|
||||||
|
|
||||||
|
/** 交易子类别 */
|
||||||
|
@ApiModelProperty(value="交易子类别")
|
||||||
|
private String childCategory;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,4 +24,6 @@ public class AccountsDealRecordVo extends AccountsDealRecord
|
|||||||
|
|
||||||
private String dealCategoryName;
|
private String dealCategoryName;
|
||||||
|
|
||||||
|
private String childCategoryName;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package com.ruoyi.invest.service.impl;
|
|||||||
import com.ruoyi.common.core.utils.DateUtils;
|
import com.ruoyi.common.core.utils.DateUtils;
|
||||||
import com.ruoyi.common.core.utils.IdWorker;
|
import com.ruoyi.common.core.utils.IdWorker;
|
||||||
import com.ruoyi.common.core.utils.StringUtils;
|
import com.ruoyi.common.core.utils.StringUtils;
|
||||||
|
import com.ruoyi.common.security.utils.DictUtils;
|
||||||
import com.ruoyi.common.security.utils.SecurityUtils;
|
import com.ruoyi.common.security.utils.SecurityUtils;
|
||||||
import com.ruoyi.invest.domain.AccountsDealRecord;
|
import com.ruoyi.invest.domain.AccountsDealRecord;
|
||||||
import com.ruoyi.invest.domain.dto.AccountsDealRecordDto;
|
import com.ruoyi.invest.domain.dto.AccountsDealRecordDto;
|
||||||
@@ -55,6 +56,18 @@ public class AccountsDealRecordServiceImpl implements IAccountsDealRecordService
|
|||||||
public List<AccountsDealRecordVo> selectAccountsDealRecordList(AccountsDealRecordDto accountsDealRecordDto)
|
public List<AccountsDealRecordVo> selectAccountsDealRecordList(AccountsDealRecordDto accountsDealRecordDto)
|
||||||
{
|
{
|
||||||
List<AccountsDealRecordVo> list=accountsDealRecordMapper.selectAccountsDealRecordList(accountsDealRecordDto);
|
List<AccountsDealRecordVo> list=accountsDealRecordMapper.selectAccountsDealRecordList(accountsDealRecordDto);
|
||||||
|
//修改子类别
|
||||||
|
for (AccountsDealRecordVo accountDeal : list) {
|
||||||
|
if(accountDeal.getDealCategory().equals("1")){
|
||||||
|
String childCategoryName = DictUtils.getDictLabel("daily_expenses", accountDeal.getChildCategory());
|
||||||
|
accountDeal.setChildCategoryName(childCategoryName);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
String childCategoryName = DictUtils.getDictLabel("deal_category", accountDeal.getChildCategory());
|
||||||
|
accountDeal.setChildCategoryName(childCategoryName);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -195,6 +195,7 @@ public class AccountsTransferRecordServiceImpl implements IAccountsTransferRecor
|
|||||||
creditDeal.setDealType("2");
|
creditDeal.setDealType("2");
|
||||||
//POS机刷卡
|
//POS机刷卡
|
||||||
creditDeal.setDealCategory("5");
|
creditDeal.setDealCategory("5");
|
||||||
|
creditDeal.setChildCategory(creditDeal.getDealCategory());
|
||||||
//POS机名称+商户名称
|
//POS机名称+商户名称
|
||||||
creditDeal.setName(pos.getName()+"-"+pos.getMerchantName());
|
creditDeal.setName(pos.getName()+"-"+pos.getMerchantName());
|
||||||
creditDeal.setRemark("交易商户:"+pos.getName()+"-"+pos.getMerchantName());
|
creditDeal.setRemark("交易商户:"+pos.getName()+"-"+pos.getMerchantName());
|
||||||
@@ -222,6 +223,7 @@ public class AccountsTransferRecordServiceImpl implements IAccountsTransferRecor
|
|||||||
creditDeal.setDealType("1");
|
creditDeal.setDealType("1");
|
||||||
//POS机刷卡
|
//POS机刷卡
|
||||||
creditDeal.setDealCategory("5");
|
creditDeal.setDealCategory("5");
|
||||||
|
creditDeal.setChildCategory(creditDeal.getDealCategory());
|
||||||
//POS机名称+信用卡+商户名称
|
//POS机名称+信用卡+商户名称
|
||||||
creditDeal.setName(pos.getName()+"-"+creditAccount.getName()+"("+ StringUtils.getLastNumberChars(3,creditAccount.getCode())+")"+"-"+pos.getMerchantName());
|
creditDeal.setName(pos.getName()+"-"+creditAccount.getName()+"("+ StringUtils.getLastNumberChars(3,creditAccount.getCode())+")"+"-"+pos.getMerchantName());
|
||||||
creditDeal.setRemark("刷卡金额");
|
creditDeal.setRemark("刷卡金额");
|
||||||
@@ -244,6 +246,7 @@ public class AccountsTransferRecordServiceImpl implements IAccountsTransferRecor
|
|||||||
creditDeal.setDealType("2");
|
creditDeal.setDealType("2");
|
||||||
//POS机刷卡手续费
|
//POS机刷卡手续费
|
||||||
creditDeal.setDealCategory("13");
|
creditDeal.setDealCategory("13");
|
||||||
|
creditDeal.setChildCategory(creditDeal.getDealCategory());
|
||||||
//POS机名称+信用卡+商户名称
|
//POS机名称+信用卡+商户名称
|
||||||
creditDeal.setName(pos.getName()+"-"+creditAccount.getName()+"("+ StringUtils.getLastNumberChars(3,creditAccount.getCode())+")"+"-"+pos.getMerchantName());
|
creditDeal.setName(pos.getName()+"-"+creditAccount.getName()+"("+ StringUtils.getLastNumberChars(3,creditAccount.getCode())+")"+"-"+pos.getMerchantName());
|
||||||
creditDeal.setRemark("刷卡手续费");
|
creditDeal.setRemark("刷卡手续费");
|
||||||
@@ -294,6 +297,7 @@ public class AccountsTransferRecordServiceImpl implements IAccountsTransferRecor
|
|||||||
creditDeal.setDealType("1");
|
creditDeal.setDealType("1");
|
||||||
//信用卡还款6,0账单还款12
|
//信用卡还款6,0账单还款12
|
||||||
creditDeal.setDealCategory(accountsTransferRecord.getDealType());
|
creditDeal.setDealCategory(accountsTransferRecord.getDealType());
|
||||||
|
creditDeal.setChildCategory(creditDeal.getDealCategory());
|
||||||
//储蓄卡还款至信用卡
|
//储蓄卡还款至信用卡
|
||||||
creditDeal.setName(debitCardVo.getName()+"("+StringUtils.getLastNumberChars(3,debitCardVo.getCode())+")还款至"+creditVo.getName()+"("+StringUtils.getLastNumberChars(3,creditVo.getCode())+")");
|
creditDeal.setName(debitCardVo.getName()+"("+StringUtils.getLastNumberChars(3,debitCardVo.getCode())+")还款至"+creditVo.getName()+"("+StringUtils.getLastNumberChars(3,creditVo.getCode())+")");
|
||||||
creditDeal.setRemark("信用卡还款");
|
creditDeal.setRemark("信用卡还款");
|
||||||
@@ -325,6 +329,7 @@ public class AccountsTransferRecordServiceImpl implements IAccountsTransferRecor
|
|||||||
creditDeal.setDealType("2");
|
creditDeal.setDealType("2");
|
||||||
//信用卡还款
|
//信用卡还款
|
||||||
creditDeal.setDealCategory("6");
|
creditDeal.setDealCategory("6");
|
||||||
|
creditDeal.setChildCategory(creditDeal.getDealCategory());
|
||||||
//储蓄卡还款至信用卡
|
//储蓄卡还款至信用卡
|
||||||
creditDeal.setName(debitCardVo.getName()+"("+StringUtils.getLastNumberChars(3,debitCardVo.getCode())+")还款至"+creditVo.getName()+"("+StringUtils.getLastNumberChars(3,creditVo.getCode())+")");
|
creditDeal.setName(debitCardVo.getName()+"("+StringUtils.getLastNumberChars(3,debitCardVo.getCode())+")还款至"+creditVo.getName()+"("+StringUtils.getLastNumberChars(3,creditVo.getCode())+")");
|
||||||
creditDeal.setRemark("信用卡还款");
|
creditDeal.setRemark("信用卡还款");
|
||||||
@@ -394,6 +399,7 @@ public class AccountsTransferRecordServiceImpl implements IAccountsTransferRecor
|
|||||||
}
|
}
|
||||||
//投资账户转账
|
//投资账户转账
|
||||||
dealRecord.setDealCategory("7");
|
dealRecord.setDealCategory("7");
|
||||||
|
dealRecord.setChildCategory(dealRecord.getDealCategory());
|
||||||
dealRecord.setRemark("投资账户转账");
|
dealRecord.setRemark("投资账户转账");
|
||||||
dealRecord.setCreateBy(SecurityUtils.getUsername());
|
dealRecord.setCreateBy(SecurityUtils.getUsername());
|
||||||
dealRecord.setCreateTime(accountsTransferRecord.getCreateTime());
|
dealRecord.setCreateTime(accountsTransferRecord.getCreateTime());
|
||||||
@@ -434,6 +440,7 @@ public class AccountsTransferRecordServiceImpl implements IAccountsTransferRecor
|
|||||||
}
|
}
|
||||||
//投资账户转账
|
//投资账户转账
|
||||||
dealRecord.setDealCategory("7");
|
dealRecord.setDealCategory("7");
|
||||||
|
dealRecord.setChildCategory(dealRecord.getDealCategory());
|
||||||
dealRecord.setRemark("投资账户转账");
|
dealRecord.setRemark("投资账户转账");
|
||||||
dealRecord.setCreateBy(SecurityUtils.getUsername());
|
dealRecord.setCreateBy(SecurityUtils.getUsername());
|
||||||
dealRecord.setCreateTime(accountsTransferRecord.getCreateTime());
|
dealRecord.setCreateTime(accountsTransferRecord.getCreateTime());
|
||||||
@@ -479,6 +486,7 @@ public class AccountsTransferRecordServiceImpl implements IAccountsTransferRecor
|
|||||||
creditDeal.setDealType("2");
|
creditDeal.setDealType("2");
|
||||||
//储蓄卡转账
|
//储蓄卡转账
|
||||||
creditDeal.setDealCategory("8");
|
creditDeal.setDealCategory("8");
|
||||||
|
creditDeal.setChildCategory(creditDeal.getDealCategory());
|
||||||
//储蓄卡转账
|
//储蓄卡转账
|
||||||
creditDeal.setName(outDebitCardVo.getName()+"("+StringUtils.getLastNumberChars(3,outDebitCardVo.getCode())+")转账至"+inDebitCardVo.getName()+"("+StringUtils.getLastNumberChars(3,inDebitCardVo.getCode())+")");
|
creditDeal.setName(outDebitCardVo.getName()+"("+StringUtils.getLastNumberChars(3,outDebitCardVo.getCode())+")转账至"+inDebitCardVo.getName()+"("+StringUtils.getLastNumberChars(3,inDebitCardVo.getCode())+")");
|
||||||
creditDeal.setRemark("储蓄卡转账");
|
creditDeal.setRemark("储蓄卡转账");
|
||||||
@@ -508,6 +516,7 @@ public class AccountsTransferRecordServiceImpl implements IAccountsTransferRecor
|
|||||||
creditDeal.setDealType("1");
|
creditDeal.setDealType("1");
|
||||||
//储蓄卡转账
|
//储蓄卡转账
|
||||||
creditDeal.setDealCategory("8");
|
creditDeal.setDealCategory("8");
|
||||||
|
creditDeal.setChildCategory(creditDeal.getDealCategory());
|
||||||
//储蓄卡转账
|
//储蓄卡转账
|
||||||
creditDeal.setName(outDebitCardVo.getName()+"("+StringUtils.getLastNumberChars(3,outDebitCardVo.getCode())+")转账至"+inDebitCardVo.getName()+"("+StringUtils.getLastNumberChars(3,inDebitCardVo.getCode())+")");
|
creditDeal.setName(outDebitCardVo.getName()+"("+StringUtils.getLastNumberChars(3,outDebitCardVo.getCode())+")转账至"+inDebitCardVo.getName()+"("+StringUtils.getLastNumberChars(3,inDebitCardVo.getCode())+")");
|
||||||
creditDeal.setRemark("储蓄卡转账");
|
creditDeal.setRemark("储蓄卡转账");
|
||||||
@@ -578,6 +587,7 @@ public class AccountsTransferRecordServiceImpl implements IAccountsTransferRecor
|
|||||||
}
|
}
|
||||||
//借贷
|
//借贷
|
||||||
dealRecord.setDealCategory("9");
|
dealRecord.setDealCategory("9");
|
||||||
|
dealRecord.setChildCategory(dealRecord.getDealCategory());
|
||||||
dealRecord.setRemark("借贷记账");
|
dealRecord.setRemark("借贷记账");
|
||||||
dealRecord.setCreateBy(SecurityUtils.getUsername());
|
dealRecord.setCreateBy(SecurityUtils.getUsername());
|
||||||
dealRecord.setCreateTime(accountsTransferRecord.getCreateTime());
|
dealRecord.setCreateTime(accountsTransferRecord.getCreateTime());
|
||||||
@@ -616,6 +626,7 @@ public class AccountsTransferRecordServiceImpl implements IAccountsTransferRecor
|
|||||||
dealRecord.setName(lendVo.getName()+"("+StringUtils.getLastNumberChars(3,lendVo.getCode())+")借款至"+debitCardVo.getName()+"("+StringUtils.getLastNumberChars(3,debitCardVo.getCode())+")");
|
dealRecord.setName(lendVo.getName()+"("+StringUtils.getLastNumberChars(3,lendVo.getCode())+")借款至"+debitCardVo.getName()+"("+StringUtils.getLastNumberChars(3,debitCardVo.getCode())+")");
|
||||||
//借贷账户转账
|
//借贷账户转账
|
||||||
dealRecord.setDealCategory("9");
|
dealRecord.setDealCategory("9");
|
||||||
|
dealRecord.setChildCategory(dealRecord.getDealCategory());
|
||||||
dealRecord.setCreateBy(SecurityUtils.getUsername());
|
dealRecord.setCreateBy(SecurityUtils.getUsername());
|
||||||
dealRecord.setCreateTime(accountsTransferRecord.getCreateTime());
|
dealRecord.setCreateTime(accountsTransferRecord.getCreateTime());
|
||||||
//重新计算余额
|
//重新计算余额
|
||||||
@@ -632,6 +643,7 @@ public class AccountsTransferRecordServiceImpl implements IAccountsTransferRecor
|
|||||||
|
|
||||||
//借贷账户转账
|
//借贷账户转账
|
||||||
dealRecord.setDealCategory("9");
|
dealRecord.setDealCategory("9");
|
||||||
|
dealRecord.setChildCategory(dealRecord.getDealCategory());
|
||||||
dealRecord.setCreateBy(SecurityUtils.getUsername());
|
dealRecord.setCreateBy(SecurityUtils.getUsername());
|
||||||
dealRecord.setCreateTime(accountsTransferRecord.getCreateTime());
|
dealRecord.setCreateTime(accountsTransferRecord.getCreateTime());
|
||||||
//重新计算余额
|
//重新计算余额
|
||||||
@@ -655,6 +667,7 @@ public class AccountsTransferRecordServiceImpl implements IAccountsTransferRecor
|
|||||||
dealInterest.setName(debitCardVo.getName()+"("+StringUtils.getLastNumberChars(3,debitCardVo.getCode())+")还款至"+lendVo.getName()+"("+StringUtils.getLastNumberChars(3,lendVo.getCode())+")");
|
dealInterest.setName(debitCardVo.getName()+"("+StringUtils.getLastNumberChars(3,debitCardVo.getCode())+")还款至"+lendVo.getName()+"("+StringUtils.getLastNumberChars(3,lendVo.getCode())+")");
|
||||||
//借贷账户转账利息
|
//借贷账户转账利息
|
||||||
dealInterest.setDealCategory("15");
|
dealInterest.setDealCategory("15");
|
||||||
|
dealInterest.setChildCategory(dealInterest.getDealCategory());
|
||||||
dealInterest.setCreateBy(SecurityUtils.getUsername());
|
dealInterest.setCreateBy(SecurityUtils.getUsername());
|
||||||
Date currentDate = accountsTransferRecord.getCreateTime();
|
Date currentDate = accountsTransferRecord.getCreateTime();
|
||||||
long millis = currentDate.getTime(); // 获取当前时间的毫秒数
|
long millis = currentDate.getTime(); // 获取当前时间的毫秒数
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<result property="accountName" column="account_name" />
|
<result property="accountName" column="account_name" />
|
||||||
<result property="transferRecordId" column="transfer_record_id" />
|
<result property="transferRecordId" column="transfer_record_id" />
|
||||||
<result property="currentBalance" column="current_balance" />
|
<result property="currentBalance" column="current_balance" />
|
||||||
|
<result property="childCategory" column="child_category" />
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<sql id="selectAccountsDealRecordVo">
|
<sql id="selectAccountsDealRecordVo">
|
||||||
@@ -40,6 +41,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
a.remark,
|
a.remark,
|
||||||
a.deal_category,
|
a.deal_category,
|
||||||
a.current_balance,
|
a.current_balance,
|
||||||
|
a.child_category,
|
||||||
CONCAT(a2."name", '(', right(a2.code, 4), ')') as account_name
|
CONCAT(a2."name", '(', right(a2.code, 4), ')') as account_name
|
||||||
from
|
from
|
||||||
accounts_deal_record a
|
accounts_deal_record a
|
||||||
@@ -56,7 +58,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<if test="accountId != null and accountId != ''"> and a.account_id = #{accountId}</if>
|
<if test="accountId != null and accountId != ''"> and a.account_id = #{accountId}</if>
|
||||||
<if test="dealType != null and dealType != ''"> and a.deal_type = #{dealType}</if>
|
<if test="dealType != null and dealType != ''"> and a.deal_type = #{dealType}</if>
|
||||||
<if test="dealCategory != null and dealCategory != ''"> and a.deal_category = #{dealCategory}</if>
|
<if test="dealCategory != null and dealCategory != ''"> and a.deal_category = #{dealCategory}</if>
|
||||||
|
<if test="childCategory != null and childCategory != ''"> and a.child_category = #{childCategory}</if>
|
||||||
<if test="endTime!=null and endTime !=''">
|
<if test="endTime!=null and endTime !=''">
|
||||||
and #{endTime}>=to_char(a.create_time, 'yyyy-MM-dd')
|
and #{endTime}>=to_char(a.create_time, 'yyyy-MM-dd')
|
||||||
</if>
|
</if>
|
||||||
@@ -102,6 +104,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<if test="dealCategory != null and dealCategory != ''">deal_category,</if>
|
<if test="dealCategory != null and dealCategory != ''">deal_category,</if>
|
||||||
<if test="transferRecordId != null and transferRecordId != ''">transfer_record_id,</if>
|
<if test="transferRecordId != null and transferRecordId != ''">transfer_record_id,</if>
|
||||||
<if test="currentBalance != null">current_balance,</if>
|
<if test="currentBalance != null">current_balance,</if>
|
||||||
|
<if test="childCategory != null">child_category,</if>
|
||||||
</trim>
|
</trim>
|
||||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
<if test="id != null">#{id},</if>
|
<if test="id != null">#{id},</if>
|
||||||
@@ -119,6 +122,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<if test="dealCategory != null and dealCategory != ''">#{dealCategory},</if>
|
<if test="dealCategory != null and dealCategory != ''">#{dealCategory},</if>
|
||||||
<if test="transferRecordId != null and transferRecordId != ''">#{transferRecordId},</if>
|
<if test="transferRecordId != null and transferRecordId != ''">#{transferRecordId},</if>
|
||||||
<if test="currentBalance != null">#{currentBalance},</if>
|
<if test="currentBalance != null">#{currentBalance},</if>
|
||||||
|
<if test="childCategory != null">#{childCategory},</if>
|
||||||
</trim>
|
</trim>
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
@@ -139,6 +143,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<if test="dealCategory != null and dealCategory != ''">deal_category = #{dealCategory},</if>
|
<if test="dealCategory != null and dealCategory != ''">deal_category = #{dealCategory},</if>
|
||||||
<if test="transferRecordId != null and transferRecordId != ''">transfer_record_id = #{transferRecordId},</if>
|
<if test="transferRecordId != null and transferRecordId != ''">transfer_record_id = #{transferRecordId},</if>
|
||||||
<if test="currentBalance != null ">current_balance = #{currentBalance},</if>
|
<if test="currentBalance != null ">current_balance = #{currentBalance},</if>
|
||||||
|
<if test="childCategory != null ">child_category = #{childCategory},</if>
|
||||||
</trim>
|
</trim>
|
||||||
where id = #{id}
|
where id = #{id}
|
||||||
</update>
|
</update>
|
||||||
|
|||||||
Reference in New Issue
Block a user