Browse Source

3.18 现金免费金币校验

milestone-20260224-现金钱包
huangqizhen 3 weeks ago
parent
commit
1da0deea2c
  1. 27
      src/main/java/com/example/demo/serviceImpl/cash/CashRefundServiceImpl.java

27
src/main/java/com/example/demo/serviceImpl/cash/CashRefundServiceImpl.java

@ -198,45 +198,40 @@ public class CashRefundServiceImpl implements RefundService {
if (cashRecordRefund.getMarket() == null || cashRecordRefund.getMarket().trim().isEmpty()) {
throw new Exception("请选择所属地区");
}
if(cashRecordRefund.getWalletId() != null) {
String payType = cashRecordRefund.getPayType();
Integer wallet = null;
if (payType == null || payType.trim().isEmpty()) {
throw new SystemException("未穿输支付方式");
}
if (payType.equals("Stripe")||payType.equals("PaymentAsia"))
{
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"))
{
if (payType.equals("FirstData") || payType.equals("Grabpay") || payType.equals("Nets") || payType.equals("PayPal") || payType.equals("IOS")) {
wallet = 5;
}
if (payType.equals("Stripe2"))
{
if (payType.equals("Stripe2")) {
wallet = 3;
}
if (payType.equals("Ipay88"))
{
if (payType.equals("Ipay88")) {
wallet = 4;
}
if (payType.equals("E-Transfer"))
{
if (payType.equals("E-Transfer")) {
wallet = 6;
}
if (payType.equals("paysolution"))
{
if (payType.equals("paysolution")) {
wallet = 8;
}
String payType1 = languageTranslationUtil.translate("银行转账", lang);
String payType2 = languageTranslationUtil.translate("现金", lang);
String payType3 = languageTranslationUtil.translate("支票", lang);
String payType4 = languageTranslationUtil.translate("刷卡", lang);
if (payType.equals(payType1)||payType.equals(payType2)||payType.equals(payType3)||payType.equals(payType4)){
wallet=cashRecordRefund.getWalletId();
if (payType.equals(payType1) || payType.equals(payType2) || payType.equals(payType3) || payType.equals(payType4)) {
wallet = cashRecordRefund.getWalletId();
}
UserRegionWallet userRegionWallet = walletMapper.selectWallet(cashRecordRefund.getJwcode(), wallet);
User user = userMapper.selectUserByJwcode(cashRecordRefund.getJwcode());
if (user.getCurrentFreeJune().add(user.getCurrentFreeDecember()).compareTo(BigDecimal.valueOf(cashRecordRefund.getPartRefundFree()))<0){
if (user.getCurrentFreeJune().add(user.getCurrentFreeDecember()).compareTo(BigDecimal.valueOf(cashRecordRefund.getPartRefundFree())) < 0) {
String errorMsg = languageTranslationUtil.translate("用户钱包余额不足", lang);
throw new BusinessException(errorMsg);
}
@ -248,7 +243,7 @@ public class CashRefundServiceImpl implements RefundService {
if (userRegionWallet.getCurrentPermanentGold().compareTo(BigDecimal.valueOf(cashRecordRefund.getPartRefundGold())) < 0) {
throw new BusinessException("用户钱包金币不足");
}
}
CashRecordDone cashRecordDonetwo = new CashRecordDone();
cashRecordDonetwo.setAreaServise(cashRecordRefund.getAreaServise());
cashRefundMapper.addAudit(cashRecordDonetwo);

Loading…
Cancel
Save