...
|
...
|
@@ -578,7 +578,7 @@ public class PaymentServiceImpl implements IPaymentService { |
|
|
} else if (transferChancelSelector.isTransferWithAlipayExceedMillionTransfer()) {//超过百万,使用更大额度的接口
|
|
|
transfer.setInterfaceType(INTERFACE_TYPE_TRANSFER_WHEN_EXCEED_MILLION);
|
|
|
ordersPayTransferMapper.updateByPrimaryKeySelective(transfer);
|
|
|
transferWithAlipayExceedMillionTransfer(logTag, record, buyerOrderCode, account, transferAmount, transfer);
|
|
|
transferWithAlipayExceedMillionTransfer(logTag, record, buyerOrderCode, account, transferAmount, transfer,false);
|
|
|
} else {
|
|
|
transfer.setInterfaceType(INTERFACE_TYPE_TRANSFER_NON_EXCEED_MILLION);
|
|
|
ordersPayTransferMapper.updateByPrimaryKeySelective(transfer);
|
...
|
...
|
@@ -829,7 +829,7 @@ public class PaymentServiceImpl implements IPaymentService { |
|
|
|
|
|
private void doManualDeal(Integer tradeBillsId, ManualDealRequest req) {
|
|
|
throwServiceExceptionIf(tradeBillsId == null || tradeBillsId < 1, "流水Id不合法");
|
|
|
throwServiceExceptionIf(req.getOperateUid() == null || req.getOperateUid() < 1, "客服uid不合法");
|
|
|
throwServiceExceptionIf(req.getOperateUid() == null || req.getOperateUid() < 0, "客服uid不合法");
|
|
|
throwServiceExceptionIf(StringUtils.isBlank(req.getOperateUname()), "客服名称不合法");
|
|
|
TradeBills tradeBills = tradeBillsMapper.selectByPrimaryKey(tradeBillsId);
|
|
|
throwServiceExceptionIf(tradeBills == null, "流水不存在");
|
...
|
...
|
@@ -838,16 +838,9 @@ public class PaymentServiceImpl implements IPaymentService { |
|
|
// 是否处理过的
|
|
|
throwServiceExceptionIf(Objects.nonNull(tradeBillsMapper.selectByDealRelateId(tradeBillsId)), "该流水已经处理过");
|
|
|
|
|
|
|
|
|
String logTag = String.format("manual deal orderCode is %s tradeBillId is %s uid is %s", tradeBills.getOrderCode(), tradeBillsId, tradeBills.getUid());
|
|
|
BigDecimal amount = null;
|
|
|
try {
|
|
|
amount = new BigDecimal(req.getAmount()).setScale(2, BigDecimal.ROUND_HALF_DOWN);
|
|
|
} catch (Exception e) {
|
|
|
throwServiceException("转账金额不合法");
|
|
|
}
|
|
|
throwServiceExceptionIf(amount.compareTo(new BigDecimal("0.1")) < 0, "转账金额小于0.1");
|
|
|
throwServiceExceptionIf(tradeBills.getAmount().compareTo(amount) != 0, "转账金额有误");
|
|
|
|
|
|
|
|
|
throwServiceExceptionIf(tradeBills.getTradeStatus() == HK_AMOUNT_WAIT_PAYMENT.getCode()
|
|
|
|| tradeBills.getTradeStatus() == YOHO_STORE_AMOUNT_WAIT_PAYMENT.getCode(), "该流不可操作:待结算");
|
|
|
|
...
|
...
|
@@ -867,8 +860,16 @@ public class PaymentServiceImpl implements IPaymentService { |
|
|
tradeBills.setPayType(optMarkPaidPayType(req.getSceneId()).get());
|
|
|
markPaid(logTag, tradeBills, lockKey);
|
|
|
}
|
|
|
BigDecimal amount = null;
|
|
|
try {
|
|
|
amount = new BigDecimal(req.getAmount()).setScale(2, BigDecimal.ROUND_HALF_DOWN);
|
|
|
} catch (Exception e) {
|
|
|
throwServiceException("转账金额不合法");
|
|
|
}
|
|
|
throwServiceExceptionIf(amount.compareTo(new BigDecimal("0.1")) < 0, "转账金额小于0.1");
|
|
|
throwServiceExceptionIf(tradeBills.getAmount().compareTo(amount) != 0, "转账金额有误");
|
|
|
// 退求购定金、货款、普通用户退保证金
|
|
|
else if (isRefundGoodsMoneyOrDepositMoneyTradeBills(tradeBills) || isRefundEarnestMoneyTradeBills(tradeBills)) {
|
|
|
if (isRefundGoodsMoneyOrDepositMoneyTradeBills(tradeBills) || isRefundEarnestMoneyTradeBills(tradeBills)) {
|
|
|
refund(logTag, tradeBills, amount, lockKey);
|
|
|
}
|
|
|
// 转账
|
...
|
...
|
@@ -981,7 +982,7 @@ public class PaymentServiceImpl implements IPaymentService { |
|
|
if (transferChancelSelector.isTransferWithWallet(interfaceType)) {
|
|
|
transferWithWalletAndAddSuccessTradeBills(logTag, tradeBills, orderCode, account, amount, transfer);
|
|
|
} else if (transferChancelSelector.isTransferWithAlipayExceedMillionTransfer(interfaceType)) {
|
|
|
transferWithAlipayExceedMillionTransfer(logTag, tradeBills, orderCode, account, amount, transfer);
|
|
|
transferWithAlipayExceedMillionTransfer(logTag, tradeBills, orderCode, account, amount, transfer,true);
|
|
|
} else {
|
|
|
transferWithAlipayTransferAndAddSuccessTradeBills(logTag, tradeBills, orderCode, account, amount, transfer);
|
|
|
}
|
...
|
...
|
@@ -1111,7 +1112,8 @@ public class PaymentServiceImpl implements IPaymentService { |
|
|
long orderCode,
|
|
|
AuthorizeResultRespVO account,
|
|
|
BigDecimal amount,
|
|
|
OrdersPayTransfer transfer) {
|
|
|
OrdersPayTransfer transfer,
|
|
|
boolean isCheckTransferStatus) {
|
|
|
String businessId = transfer.getId() + "_" + tradeBills.getId();
|
|
|
TransferResult transferResult = alipayService.newAlipayExceedMillionTransfer(account.getUid())
|
|
|
.transferOrderCode(Long.toString(orderCode))
|
...
|
...
|
@@ -1121,6 +1123,7 @@ public class PaymentServiceImpl implements IPaymentService { |
|
|
.businessId(businessId)
|
|
|
.userName(account.getCertName())
|
|
|
.riskWatcher(Arrays.asList((uid, aar) -> shoppingRiskWatchDog.checkAlipayBlackUser(uid, aar)))
|
|
|
.withTransferStatusQueryInterceptIf(isCheckTransferStatus)
|
|
|
.transfer();
|
|
|
// success to wait
|
|
|
if (transferResult.getCode() == 200) {
|
...
|
...
|
|