pull/1121/head
梁宇奇 2025-08-19 21:16:26 +08:00
parent 51905bd85d
commit 28815a25ce
4 changed files with 30 additions and 14 deletions

View File

@ -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);
/**
* 退

View File

@ -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;
}

View File

@ -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, "会员费");
}

View File

@ -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;
}