|
|
|
@ -13,10 +13,7 @@ import com.example.demo.domain.vo.coin.Result; |
|
|
|
import com.example.demo.exception.SystemException; |
|
|
|
import com.example.demo.mapper.cash.CashCollectionMapper; |
|
|
|
import com.example.demo.mapper.cash.CashRefundMapper; |
|
|
|
import com.example.demo.mapper.coin.AuditMapper; |
|
|
|
import com.example.demo.mapper.coin.MarketMapper; |
|
|
|
import com.example.demo.mapper.coin.OperationLogMapper; |
|
|
|
import com.example.demo.mapper.coin.RefundMapper; |
|
|
|
import com.example.demo.mapper.coin.*; |
|
|
|
import com.example.demo.service.Wallet.WalletService; |
|
|
|
import com.example.demo.service.cash.RefundService; |
|
|
|
import com.example.demo.service.coin.TranslationService; |
|
|
|
@ -71,6 +68,8 @@ public class CashRefundServiceImpl implements RefundService { |
|
|
|
private WalletService walletService; |
|
|
|
@Autowired |
|
|
|
private TranslationService translationService; |
|
|
|
@Autowired |
|
|
|
private WalletMapper walletMapper; |
|
|
|
|
|
|
|
@Override |
|
|
|
public PageInfo<CashRecordDTO> select(Integer pageNum, Integer pageSize, CashRecordDTO cashRecordDTO) { |
|
|
|
@ -714,8 +713,8 @@ public class CashRefundServiceImpl implements RefundService { |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
@Transactional |
|
|
|
public void addOnline(CashRecordRefund cashRecordRefund) { |
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
public void addOnline(CashRecordRefund cashRecordRefund,String lang) { |
|
|
|
try { |
|
|
|
if (cashRecordRefund.getJwcode() == null) { |
|
|
|
throw new BusinessException("未输入精网号"); |
|
|
|
@ -730,6 +729,43 @@ public class CashRefundServiceImpl implements RefundService { |
|
|
|
throw new BusinessException("请选择所属地区"); |
|
|
|
} |
|
|
|
|
|
|
|
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) { |
|
|
|
throw new BusinessException("该用户钱包不存在"); |
|
|
|
} |
|
|
|
if (userRegionWallet.getCurrentPermanentGold().compareTo(BigDecimal.valueOf(cashRecordRefund.getPermanentGold())) < 0) { |
|
|
|
throw new BusinessException("用户钱包金币不足"); |
|
|
|
} |
|
|
|
CashRecordDone cashRecordDonetwo = new CashRecordDone(); |
|
|
|
cashRecordDonetwo.setAreaServise(cashRecordRefund.getAreaServise()); |
|
|
|
cashRefundMapper.addAudit(cashRecordDonetwo); |
|
|
|
|