pull/1121/head
parent
51905bd85d
commit
28815a25ce
|
|
@ -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);
|
||||
|
||||
/**
|
||||
* 退回会员费
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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, "会员费");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue