From 2326029f50a2e90a8a9b75e0a4ce82ce36cba5b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A2=A8=E5=A4=A7=E5=8F=94?= <494979559@qq.com> Date: Sat, 27 Jul 2024 17:59:09 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=B4=E6=97=B6=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ruoyi/ss/account/domain/SmAccount.java | 4 +- .../ss/account/domain/SmAccountQuery.java | 5 + .../ruoyi/ss/account/domain/SmAccountVO.java | 15 +++ .../ruoyi/ss/account/domain/SmAccountVo.java | 11 -- .../ss/account/domain/enums/AccountType.java | 3 +- .../ss/account/mapper/SmAccountMapper.java | 8 +- .../ss/account/mapper/SmAccountMapper.xml | 45 ++++---- .../ss/account/service/ISmAccountService.java | 12 +- .../service/impl/SmAccountServiceImpl.java | 34 +++--- .../impl/TransactionBillServiceImpl.java | 6 +- .../controller/app/AppAccountController.java | 3 - .../web/controller/ss/AccountController.java | 107 ++++++++++++++++++ 12 files changed, 186 insertions(+), 67 deletions(-) create mode 100644 smart-switch-service/src/main/java/com/ruoyi/ss/account/domain/SmAccountVO.java delete mode 100644 smart-switch-service/src/main/java/com/ruoyi/ss/account/domain/SmAccountVo.java create mode 100644 smart-switch-web/src/main/java/com/ruoyi/web/controller/ss/AccountController.java diff --git a/smart-switch-service/src/main/java/com/ruoyi/ss/account/domain/SmAccount.java b/smart-switch-service/src/main/java/com/ruoyi/ss/account/domain/SmAccount.java index 94e9ea71..5896a239 100644 --- a/smart-switch-service/src/main/java/com/ruoyi/ss/account/domain/SmAccount.java +++ b/smart-switch-service/src/main/java/com/ruoyi/ss/account/domain/SmAccount.java @@ -2,8 +2,10 @@ package com.ruoyi.ss.account.domain; import com.fasterxml.jackson.annotation.JsonProperty; import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.annotation.Sensitive; import com.ruoyi.common.core.domain.BaseEntity; import com.ruoyi.common.core.domain.ValidGroup; +import com.ruoyi.common.enums.DesensitizedType; import com.ruoyi.common.utils.RegexpUtils; import com.ruoyi.common.valid.EnumValid; import com.ruoyi.common.valid.bank.BankCardInfo; @@ -73,7 +75,7 @@ public class SmAccount extends BaseEntity * 数据脱敏 */ public void desensitization() { - if (this.accountNo != null) { + if (this.accountNo != null && AccountType.BANK_CARD.getType().equals(this.accountType)) { this.accountNo = StringUtils.substring(this.accountNo, 0, 4) + "****" + StringUtils.substring(this.accountNo, this.accountNo.length() - 4, this.accountNo.length()); diff --git a/smart-switch-service/src/main/java/com/ruoyi/ss/account/domain/SmAccountQuery.java b/smart-switch-service/src/main/java/com/ruoyi/ss/account/domain/SmAccountQuery.java index 50566032..47f9baab 100644 --- a/smart-switch-service/src/main/java/com/ruoyi/ss/account/domain/SmAccountQuery.java +++ b/smart-switch-service/src/main/java/com/ruoyi/ss/account/domain/SmAccountQuery.java @@ -1,5 +1,6 @@ package com.ruoyi.ss.account.domain; +import io.swagger.annotations.ApiModelProperty; import lombok.Data; /** @@ -8,4 +9,8 @@ import lombok.Data; */ @Data public class SmAccountQuery extends SmAccount { + + @ApiModelProperty("用户名称") + private String userName; + } diff --git a/smart-switch-service/src/main/java/com/ruoyi/ss/account/domain/SmAccountVO.java b/smart-switch-service/src/main/java/com/ruoyi/ss/account/domain/SmAccountVO.java new file mode 100644 index 00000000..7af31f2b --- /dev/null +++ b/smart-switch-service/src/main/java/com/ruoyi/ss/account/domain/SmAccountVO.java @@ -0,0 +1,15 @@ +package com.ruoyi.ss.account.domain; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * @author wjh + * 2024/3/27 + */ +@Data +public class SmAccountVO extends SmAccount { + + @ApiModelProperty("用户名称") + private String userName; +} diff --git a/smart-switch-service/src/main/java/com/ruoyi/ss/account/domain/SmAccountVo.java b/smart-switch-service/src/main/java/com/ruoyi/ss/account/domain/SmAccountVo.java deleted file mode 100644 index 45863a9c..00000000 --- a/smart-switch-service/src/main/java/com/ruoyi/ss/account/domain/SmAccountVo.java +++ /dev/null @@ -1,11 +0,0 @@ -package com.ruoyi.ss.account.domain; - -import lombok.Data; - -/** - * @author wjh - * 2024/3/27 - */ -@Data -public class SmAccountVo extends SmAccount { -} diff --git a/smart-switch-service/src/main/java/com/ruoyi/ss/account/domain/enums/AccountType.java b/smart-switch-service/src/main/java/com/ruoyi/ss/account/domain/enums/AccountType.java index 82be9da6..92674ca5 100644 --- a/smart-switch-service/src/main/java/com/ruoyi/ss/account/domain/enums/AccountType.java +++ b/smart-switch-service/src/main/java/com/ruoyi/ss/account/domain/enums/AccountType.java @@ -16,7 +16,8 @@ public enum AccountType { BANK_CARD("1", "个人银行卡"), WECHAT("2", "微信"), - ALIPAY("3", "支付宝"); + ALIPAY("3", "支付宝"), + OFFLINE_IMAGE("4", "线下图片"); private final String type; diff --git a/smart-switch-service/src/main/java/com/ruoyi/ss/account/mapper/SmAccountMapper.java b/smart-switch-service/src/main/java/com/ruoyi/ss/account/mapper/SmAccountMapper.java index 203d1950..7d306c7d 100644 --- a/smart-switch-service/src/main/java/com/ruoyi/ss/account/mapper/SmAccountMapper.java +++ b/smart-switch-service/src/main/java/com/ruoyi/ss/account/mapper/SmAccountMapper.java @@ -2,7 +2,7 @@ package com.ruoyi.ss.account.mapper; import com.ruoyi.ss.account.domain.SmAccount; import com.ruoyi.ss.account.domain.SmAccountQuery; -import com.ruoyi.ss.account.domain.SmAccountVo; +import com.ruoyi.ss.account.domain.SmAccountVO; import org.apache.ibatis.annotations.Param; import java.util.List; @@ -21,7 +21,7 @@ public interface SmAccountMapper * @param accountId 用户账户主键 * @return 用户账户 */ - public SmAccountVo selectSmAccountByAccountId(Long accountId); + public SmAccountVO selectSmAccountByAccountId(Long accountId); /** * 查询用户账户列表 @@ -29,7 +29,7 @@ public interface SmAccountMapper * @param smAccount 用户账户 * @return 用户账户集合 */ - public List selectSmAccountList(SmAccountQuery smAccount); + public List selectSmAccountList(SmAccountQuery smAccount); /** * 新增用户账户 @@ -68,7 +68,7 @@ public interface SmAccountMapper * @param accountNo 账号 * @param accountType 类型 */ - SmAccountVo selectByAccountNo(@Param("accountNo") String accountNo, @Param("accountType") String accountType); + SmAccountVO selectByAccountNo(@Param("accountNo") String accountNo, @Param("accountType") String accountType); /** * 为用户设置默认的账户 diff --git a/smart-switch-service/src/main/java/com/ruoyi/ss/account/mapper/SmAccountMapper.xml b/smart-switch-service/src/main/java/com/ruoyi/ss/account/mapper/SmAccountMapper.xml index 04985d71..22c6ac3c 100644 --- a/smart-switch-service/src/main/java/com/ruoyi/ss/account/mapper/SmAccountMapper.xml +++ b/smart-switch-service/src/main/java/com/ruoyi/ss/account/mapper/SmAccountMapper.xml @@ -4,40 +4,45 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - - - - - - - - - - + - - select account_id, user_id, account_type, name, id_card, account_no, mobile, create_time, create_by, card_info, is_default from sm_account + select + sa.account_id, + sa.user_id, + sa.account_type, + sa.name, + sa.id_card, + sa.account_no, + sa.mobile, + sa.create_time, + sa.create_by, + sa.card_info, + sa.is_default, + su.user_name as user_name + from sm_account sa + left join sm_user su on su.user_id = sa.user_id