From 28815a25ce0893e02dd1c67407f4acdd163cc00b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A2=81=E5=AE=87=E5=A5=87?= Date: Tue, 19 Aug 2025 21:16:26 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ruoyi/xkt/service/IAssetService.java | 15 ++++++++--- .../service/impl/AdvertRoundServiceImpl.java | 2 +- .../xkt/service/impl/AssetServiceImpl.java | 25 +++++++++++++------ .../service/impl/StoreMemberServiceImpl.java | 2 +- 4 files changed, 30 insertions(+), 14 deletions(-) diff --git a/xkt/src/main/java/com/ruoyi/xkt/service/IAssetService.java b/xkt/src/main/java/com/ruoyi/xkt/service/IAssetService.java index 8ce3e9e7f..8856b764d 100644 --- a/xkt/src/main/java/com/ruoyi/xkt/service/IAssetService.java +++ b/xkt/src/main/java/com/ruoyi/xkt/service/IAssetService.java @@ -106,14 +106,22 @@ public interface IAssetService { */ boolean isRechargeSuccess(String finBillNo); + /** + * 校验支付密码 + * + * @param storeId + * @param transactionPassword + * @return + */ + boolean checkTransactionPassword(Long storeId, String transactionPassword); + /** * 支付推广费 * * @param storeId * @param amount - * @param transactionPassword */ - void payAdvertFee(Long storeId, BigDecimal amount, String transactionPassword); + void payAdvertFee(Long storeId, BigDecimal amount); /** * 退回推广费 @@ -128,9 +136,8 @@ public interface IAssetService { * * @param storeId * @param amount - * @param transactionPassword */ - void payVipFee(Long storeId, BigDecimal amount, String transactionPassword); + void payVipFee(Long storeId, BigDecimal amount); /** * 退回会员费 diff --git a/xkt/src/main/java/com/ruoyi/xkt/service/impl/AdvertRoundServiceImpl.java b/xkt/src/main/java/com/ruoyi/xkt/service/impl/AdvertRoundServiceImpl.java index 8d74e6f39..8aea14ebc 100644 --- a/xkt/src/main/java/com/ruoyi/xkt/service/impl/AdvertRoundServiceImpl.java +++ b/xkt/src/main/java/com/ruoyi/xkt/service/impl/AdvertRoundServiceImpl.java @@ -683,7 +683,7 @@ public class AdvertRoundServiceImpl implements IAdvertRoundService { this.noticeService.createSingleNotice(SecurityUtils.getUserId(), successTitle, NoticeType.NOTICE.getValue(), NoticeOwnerType.SYSTEM.getValue(), minPriceAdvert.getStoreId(), UserNoticeType.ADVERT.getValue(), successContent); // 扣除推广费 - assetService.payAdvertFee(createDTO.getStoreId(), createDTO.getPayPrice(), createDTO.getTransactionPassword()); + assetService.payAdvertFee(createDTO.getStoreId(), createDTO.getPayPrice()); } return 1; } diff --git a/xkt/src/main/java/com/ruoyi/xkt/service/impl/AssetServiceImpl.java b/xkt/src/main/java/com/ruoyi/xkt/service/impl/AssetServiceImpl.java index 86ca4e37d..bb68a66aa 100644 --- a/xkt/src/main/java/com/ruoyi/xkt/service/impl/AssetServiceImpl.java +++ b/xkt/src/main/java/com/ruoyi/xkt/service/impl/AssetServiceImpl.java @@ -253,9 +253,24 @@ public class AssetServiceImpl implements IAssetService { && EFinBillStatus.SUCCESS.getValue().equals(financeBill.getBillStatus()); } + @Override + public boolean checkTransactionPassword(Long storeId, String transactionPassword) { + if (storeId == null || transactionPassword == null) { + return false; + } + InternalAccount internalAccount = internalAccountService.getAccountAndCheck(storeId, EAccountOwnerType.STORE); + if (internalAccount == null) { + throw new ServiceException("档口账户未创建"); + } + if (StrUtil.isEmpty(internalAccount.getTransactionPassword())) { + throw new ServiceException("请先设置支付密码"); + } + return StrUtil.equals(SecureUtil.md5(transactionPassword), internalAccount.getTransactionPassword()); + } + @Transactional(rollbackFor = Exception.class) @Override - public void payAdvertFee(Long storeId, BigDecimal amount, String transactionPassword) { + public void payAdvertFee(Long storeId, BigDecimal amount) { Assert.notNull(storeId); Assert.notNull(amount); InternalAccount internalAccount = internalAccountService.getAccountAndCheck(storeId, EAccountOwnerType.STORE); @@ -265,9 +280,6 @@ public class AssetServiceImpl implements IAssetService { if (StrUtil.isEmpty(internalAccount.getTransactionPassword())) { throw new ServiceException("请先设置支付密码"); } - if (!StrUtil.equals(SecureUtil.md5(transactionPassword), internalAccount.getTransactionPassword())) { - throw new ServiceException("支付密码错误"); - } financeBillService.createInternalTransferBill(Constants.PLATFORM_INTERNAL_ACCOUNT_ID, internalAccount.getId(), amount, EFinBillSrcType.ADVERT_PAID.getValue(), null, null, null, "推广费"); } @@ -286,7 +298,7 @@ public class AssetServiceImpl implements IAssetService { @Transactional(rollbackFor = Exception.class) @Override - public void payVipFee(Long storeId, BigDecimal amount, String transactionPassword) { + public void payVipFee(Long storeId, BigDecimal amount) { Assert.notNull(storeId); Assert.notNull(amount); InternalAccount internalAccount = internalAccountService.getAccountAndCheck(storeId, EAccountOwnerType.STORE); @@ -296,9 +308,6 @@ public class AssetServiceImpl implements IAssetService { if (StrUtil.isEmpty(internalAccount.getTransactionPassword())) { throw new ServiceException("请先设置支付密码"); } - if (!StrUtil.equals(SecureUtil.md5(transactionPassword), internalAccount.getTransactionPassword())) { - throw new ServiceException("支付密码错误"); - } financeBillService.createInternalTransferBill(Constants.PLATFORM_INTERNAL_ACCOUNT_ID, internalAccount.getId(), amount, EFinBillSrcType.VIP_PAID.getValue(), null, null, null, "会员费"); } diff --git a/xkt/src/main/java/com/ruoyi/xkt/service/impl/StoreMemberServiceImpl.java b/xkt/src/main/java/com/ruoyi/xkt/service/impl/StoreMemberServiceImpl.java index a72436bb8..aae01f0de 100644 --- a/xkt/src/main/java/com/ruoyi/xkt/service/impl/StoreMemberServiceImpl.java +++ b/xkt/src/main/java/com/ruoyi/xkt/service/impl/StoreMemberServiceImpl.java @@ -76,7 +76,7 @@ public class StoreMemberServiceImpl implements IStoreMemberService { this.noticeService.createSingleNotice(SecurityUtils.getUserId(), "购买会员成功!", NoticeType.NOTICE.getValue(), NoticeOwnerType.SYSTEM.getValue(), createDTO.getStoreId(), UserNoticeType.SYSTEM_MSG.getValue(), "恭喜您!购买:实力质造 会员成功!"); // 扣除会员费 - assetService.payVipFee(createDTO.getStoreId(), createDTO.getPayPrice(), createDTO.getTransactionPassword()); + assetService.payVipFee(createDTO.getStoreId(), createDTO.getPayPrice()); return count; }