|
|
|
@ -195,6 +195,45 @@ public class CashRefundServiceImpl implements RefundService { |
|
|
|
if (cashRecordRefund.getMarket() == null || cashRecordRefund.getMarket().trim().isEmpty()) { |
|
|
|
throw new Exception("请选择所属地区"); |
|
|
|
} |
|
|
|
String payType = cashRecordRefund.getPayType(); |
|
|
|
Integer wallet = null; |
|
|
|
if (payType == null || payType.trim().isEmpty()) { |
|
|
|
throw new SystemException("未穿输支付方式"); |
|
|
|
} |
|
|
|
if (payType.equals("Stripe")||payType.equals("PaymentAsia")) |
|
|
|
{ |
|
|
|
wallet = 2; |
|
|
|
} |
|
|
|
if (payType.equals("FirstData")||payType.equals("Grabpay")||payType.equals("Nets")||payType.equals("PayPal")||payType.equals("IOS")) |
|
|
|
{ |
|
|
|
wallet = 5; |
|
|
|
} |
|
|
|
if (payType.equals("Stripe2")) |
|
|
|
{ |
|
|
|
wallet = 3; |
|
|
|
} |
|
|
|
if (payType.equals("iPay88")) |
|
|
|
{ |
|
|
|
wallet = 4; |
|
|
|
} |
|
|
|
if (payType.equals("E-Transfer")) |
|
|
|
{ |
|
|
|
wallet = 6; |
|
|
|
} |
|
|
|
if (payType.equals("paysolution")) |
|
|
|
{ |
|
|
|
wallet = 8; |
|
|
|
} |
|
|
|
UserRegionWallet userRegionWallet = walletMapper.selectWallet(cashRecordRefund.getJwcode(), wallet); |
|
|
|
|
|
|
|
if (userRegionWallet == null) { |
|
|
|
//初始化钱包 |
|
|
|
walletMapper.insert(new UserRegionWallet(null, cashRecordRefund.getJwcode(), wallet, BigDecimal.ZERO, new Date(), new Date())); |
|
|
|
log.warn("用户钱包不存在,已初始化钱包"); |
|
|
|
} |
|
|
|
if (userRegionWallet.getCurrentPermanentGold().compareTo(BigDecimal.valueOf(cashRecordRefund.getPermanentGold())) < 0) { |
|
|
|
throw new BusinessException("用户钱包金币不足"); |
|
|
|
} |
|
|
|
|
|
|
|
CashRecordDone cashRecordDonetwo = new CashRecordDone(); |
|
|
|
cashRecordDonetwo.setAreaServise(cashRecordRefund.getAreaServise()); |
|
|
|
@ -465,7 +504,7 @@ public class CashRefundServiceImpl implements RefundService { |
|
|
|
for (UserWalletRecord userWalletRecord : userWalletList){ |
|
|
|
userRegionWallet.setJwcode(userWalletRecord.getJwcode()); |
|
|
|
userRegionWallet.setWalletId(userWalletRecord.getWalletId()); |
|
|
|
userRegionWallet.setCurrentPermanentGold(BigDecimal.valueOf(userWalletRecord.getAmount())); |
|
|
|
userRegionWallet.setCurrentPermanentGold(BigDecimal.valueOf(-(userGoldRecord.getFreeDecember()+userGoldRecord.getFreeJune()+userGoldRecord.getPermanentGold()))); |
|
|
|
walletService.updateUserGoldRecord(userRegionWallet); |
|
|
|
walletService.updateUserWalletRecord(userWalletRecord.getId()); |
|
|
|
UserWalletRecord userWalletRecord1 = new UserWalletRecord(); |
|
|
|
@ -761,7 +800,9 @@ public class CashRefundServiceImpl implements RefundService { |
|
|
|
UserRegionWallet userRegionWallet = walletMapper.selectWallet(cashRecordRefund.getJwcode(), wallet); |
|
|
|
|
|
|
|
if (userRegionWallet == null) { |
|
|
|
throw new BusinessException("该用户钱包不存在"); |
|
|
|
//初始化钱包 |
|
|
|
walletMapper.insert(new UserRegionWallet(null, cashRecordRefund.getJwcode(), wallet, BigDecimal.ZERO, new Date(), new Date())); |
|
|
|
log.warn("用户钱包不存在,已初始化钱包"); |
|
|
|
} |
|
|
|
if (userRegionWallet.getCurrentPermanentGold().compareTo(BigDecimal.valueOf(cashRecordRefund.getPermanentGold())) < 0) { |
|
|
|
throw new BusinessException("用户钱包金币不足"); |
|
|
|
|