Authored by LUOXC

REFACTOR

... ... @@ -45,7 +45,7 @@ public abstract class AbsGoodsServiceOrderService implements IGoodsService {
OrderCodeGenerator orderCodeGenerator;
@Autowired
private TransferChancelSelector alipayTransferChancelSelector;
private TransferChancelSelector transferChancelSelector;
@Autowired
TransferService transferService;
... ... @@ -89,8 +89,8 @@ public abstract class AbsGoodsServiceOrderService implements IGoodsService {
executorService.execute(() -> {
// 只返4单
int DEFAULT_REBATE_CNT = alipayTransferChancelSelector.getDepositRebateOrderCnt();
BigDecimal rebate = new BigDecimal(alipayTransferChancelSelector.getDepositRebateAmount());
int DEFAULT_REBATE_CNT = transferChancelSelector.getDepositRebateOrderCnt();
BigDecimal rebate = new BigDecimal(transferChancelSelector.getDepositRebateAmount());
depositCodeList.stream().forEach(depositCode -> {
... ...
... ... @@ -88,7 +88,7 @@ public class AppraiseOrderService extends AbsGoodsServiceOrderService implements
OrderCodeGenerator orderCodeGenerator;
@Autowired
private TransferChancelSelector alipayTransferChancelSelector;
private TransferChancelSelector transferChancelSelector;
@Autowired
TransferService transferService;
... ...
... ... @@ -152,7 +152,7 @@ public class PaymentServiceImpl implements IPaymentService {
BuyerOrderPayDiffTimeHandler buyerOrderPayDiffTimeHandler;
@Autowired
private TransferChancelSelector alipayTransferChancelSelector;
private TransferChancelSelector transferChancelSelector;
@Autowired
private TradeBillsService tradeBillsService;
... ... @@ -522,11 +522,11 @@ public class PaymentServiceImpl implements IPaymentService {
try {
logger.info("{}, transfer alipayAccount={}, transferAmount={}", logTag, alipayAccount, transferAmount);
if (alipayTransferChancelSelector.isTransferWithWallet(record)) {
if (transferChancelSelector.isTransferWithWallet(record)) {
transfer.setInterfaceType(INTERFACE_TYPE_TRANSFER_WALLET);
ordersPayTransferMapper.updateByPrimaryKeySelective(transfer);
transferWithWallet(logTag, record, buyerOrderCode, account, transferAmount, transfer);
} else if (alipayTransferChancelSelector.isTransferWithAlipayExceedMillionTransfer()) {
} else if (transferChancelSelector.isTransferWithAlipayExceedMillionTransfer()) {
transfer.setInterfaceType(INTERFACE_TYPE_TRANSFER_WHEN_EXCEED_MILLION);
ordersPayTransferMapper.updateByPrimaryKeySelective(transfer);
transferWithAlipayExceedMillionTransfer(logTag, record, buyerOrderCode, account, transferAmount, transfer);
... ... @@ -609,7 +609,7 @@ public class PaymentServiceImpl implements IPaymentService {
boolean exceedMillionAndSuccess = false;
transfer.setUpdateTime(now);
try {
if (alipayTransferChancelSelector.isTransferWithWallet(record)) {
if (transferChancelSelector.isTransferWithWallet(record)) {
transfer.setInterfaceType(INTERFACE_TYPE_TRANSFER_WALLET);
ordersPayTransferMapper.updateByPrimaryKeySelective(transfer);
TransferResult transferResult = walletTransferService.transfer(logTag, record);
... ... @@ -625,7 +625,7 @@ public class PaymentServiceImpl implements IPaymentService {
logger.info("{}, transfer start", logTag);
shoppingRiskWatchDog.checkAlipayBlackUser(aliPayAccount.getUid(), aliPayAccount);
shoppingRiskWatchDog.checkManualStopAlipayTransfer();
if (alipayTransferChancelSelector.isTransferWithAlipayExceedMillionTransfer()) {
if (transferChancelSelector.isTransferWithAlipayExceedMillionTransfer()) {
transfer.setInterfaceType(INTERFACE_TYPE_TRANSFER_WHEN_EXCEED_MILLION);
ordersPayTransferMapper.updateByPrimaryKeySelective(transfer);
Map<String, String> mapResult = transferWhenExceedMillion(transfer.getId(), record, orderCode, aliPayAccount, amount, now);
... ... @@ -659,7 +659,7 @@ public class PaymentServiceImpl implements IPaymentService {
transfer.setAlipayTradeId(orderId);
transfer.setStatus(1);
return true;
} else if (alipayTransferChancelSelector.isExceedMillion(jsonObject)) {
} else if (transferChancelSelector.isExceedMillion(jsonObject)) {
transfer.setInterfaceType(INTERFACE_TYPE_TRANSFER_WHEN_EXCEED_MILLION);
ordersPayTransferMapper.updateByPrimaryKeySelective(transfer);
Map<String, String> mapResult = transferWhenExceedMillion(transfer.getId(), record, orderCode, aliPayAccount, amount, now);
... ... @@ -916,9 +916,9 @@ public class PaymentServiceImpl implements IPaymentService {
400, "转账记录已成功转账,请不要重复操作。");
Integer interfaceType = transfer.getInterfaceType();
logger.info("{}, transfer channel router {}", logTag, interfaceType);
if (alipayTransferChancelSelector.isTransferWithWallet(interfaceType)) {
if (transferChancelSelector.isTransferWithWallet(interfaceType)) {
transferWithWalletAndAddSuccessTradeBills(logTag, tradeBills, orderCode, account, amount, transfer);
} else if (alipayTransferChancelSelector.isTransferWithAlipayExceedMillionTransfer(interfaceType)) {
} else if (transferChancelSelector.isTransferWithAlipayExceedMillionTransfer(interfaceType)) {
transferWithAlipayExceedMillionTransfer(logTag, tradeBills, orderCode, account, amount, transfer);
} else {
transferWithAlipayTransferAndAddSuccessTradeBills(logTag, tradeBills, orderCode, account, amount, transfer);
... ... @@ -1031,7 +1031,7 @@ public class PaymentServiceImpl implements IPaymentService {
transferSuccess.setUpdateTime(DateUtil.getCurrentTimeSecond());
ordersPayTransferMapper.updateByPrimaryKeySelective(transferSuccess);
} else {
alipayTransferChancelSelector.isExceedMillion(transferResult);
transferChancelSelector.isExceedMillion(transferResult);
logger.warn("{}, transfer fail {}", logTag, transferResult);
recordTransferFailResult(transfer, transferResult);
throwServiceException(transferResult.getCode(), transferResult.getMsg());
... ...
... ... @@ -45,7 +45,7 @@ public class ShoppingRiskWatchDog {
private AlipayBlackUserMapper alipayBlackUserMapper;
@Autowired
TransferChancelSelector alipayTransferChancelSelector;
TransferChancelSelector transferChancelSelector;
public void checkWaitingPayCnt(int uid){
logger.info("in ShoppingRiskWatchDog.checkWaitingPayCnt uid {}", uid);
... ... @@ -101,7 +101,7 @@ public class ShoppingRiskWatchDog {
public void checkManualStopAlipayTransfer(){
if (alipayTransferChancelSelector.isStopTransferWithAlipay()){
if (transferChancelSelector.isStopTransferWithAlipay()){
logger.warn("stop manual transfer");
throw new UfoServiceException(442, "已关闭手动打款");
}
... ...