...
|
...
|
@@ -689,6 +689,7 @@ public class PaymentServiceImpl implements IPaymentService { |
|
|
logger.info("transferMon开始调用阿里接口参数buyerOrderCode={}, alipayAccount={}, transferAmount={}", buyerOrderCode, alipayAccount, transferAmount);
|
|
|
|
|
|
if(exceedMillion()) {
|
|
|
transfer.setTransferType(2);
|
|
|
Map<String, String> mapResult = transferWhenExceedMillion(transfer.getId(), record, buyerOrderCode, account, transferAmount, now);
|
|
|
String resultStr = JSON.toJSONString(mapResult);
|
|
|
jsonObject = JSON.parseObject(resultStr);
|
...
|
...
|
@@ -700,6 +701,7 @@ public class PaymentServiceImpl implements IPaymentService { |
|
|
}
|
|
|
}
|
|
|
|
|
|
transfer.setTransferType(1);
|
|
|
jsonObject = alipayService.transferMoney(Long.toString(buyerOrderCode), account.getAlipayId(), account.getAlipayAccount(), transferAmount);
|
|
|
if (jsonObject == null) {
|
|
|
logger.warn("transferMonErr 转账失败 , orderCode is {}", buyerOrderCode);
|
...
|
...
|
@@ -718,6 +720,7 @@ public class PaymentServiceImpl implements IPaymentService { |
|
|
transfer.setAlipayTradeId(orderId);
|
|
|
transfer.setStatus(1);
|
|
|
} else if(exceedMillion(jsonObject)) {
|
|
|
transfer.setTransferType(2);
|
|
|
Map<String, String> mapResult = transferWhenExceedMillion(transfer.getId(), record, buyerOrderCode, account, transferAmount, now);
|
|
|
String resultStr = JSON.toJSONString(mapResult);
|
|
|
jsonObject = JSON.parseObject(resultStr);
|
...
|
...
|
@@ -813,6 +816,7 @@ public class PaymentServiceImpl implements IPaymentService { |
|
|
logger.info("transAllEarnest开始调用阿里接口参数buyerOrderCode={}, alipayAccount={}, transferAmount={}", orderCode, account, amount);
|
|
|
|
|
|
if(exceedMillion()) {
|
|
|
transfer.setTransferType(2);
|
|
|
Map<String, String> mapResult = transferWhenExceedMillion(transfer.getId(), record, orderCode, aliPayAccount, amount, now);
|
|
|
String resultStr = JSON.toJSONString(mapResult);
|
|
|
jsonObject = JSON.parseObject(resultStr);
|
...
|
...
|
@@ -824,6 +828,7 @@ public class PaymentServiceImpl implements IPaymentService { |
|
|
}
|
|
|
}
|
|
|
|
|
|
transfer.setTransferType(1);
|
|
|
jsonObject = alipayService.transferMoney(Long.toString(orderCode), aliPayAccount.getAlipayId(), aliPayAccount.getAlipayAccount(), amount);
|
|
|
if (jsonObject == null) {
|
|
|
logger.warn("transAllEarnestErr 转账失败 , orderCode is {}", orderCode);
|
...
|
...
|
@@ -843,6 +848,7 @@ public class PaymentServiceImpl implements IPaymentService { |
|
|
transfer.setStatus(1);
|
|
|
return true;
|
|
|
} else if(exceedMillion(jsonObject)) {
|
|
|
transfer.setTransferType(2);
|
|
|
Map<String, String> mapResult = transferWhenExceedMillion(transfer.getId(), record, orderCode, aliPayAccount, amount, now);
|
|
|
String resultStr = JSON.toJSONString(mapResult);
|
|
|
jsonObject = JSON.parseObject(resultStr);
|
...
|
...
|
@@ -1069,6 +1075,7 @@ public class PaymentServiceImpl implements IPaymentService { |
|
|
}
|
|
|
}
|
|
|
JSONObject jsonObject = null;
|
|
|
Integer transferType = null;
|
|
|
try {
|
|
|
OrdersPayTransfer transfer = ordersPayTransferMapper.selectByBuyerOrderCode(orderCode);
|
|
|
if (transfer == null) {
|
...
|
...
|
@@ -1077,17 +1084,15 @@ public class PaymentServiceImpl implements IPaymentService { |
|
|
if (transfer == null || transfer.getStatus() == 1) {
|
|
|
throw new ServiceException(400, "转账记录已成功转账,流水id=" + tradeBillsId);
|
|
|
}
|
|
|
transferType = transfer.getInterfaceType();
|
|
|
if (transferType == null || transferType < 1 || transferType > 2) {
|
|
|
throw new ServiceException(400, "转账记录接口类型有误,流水id=" + tradeBillsId);
|
|
|
}
|
|
|
|
|
|
if(exceedMillion()) {
|
|
|
Map<String, String> mapResult = transferWhenExceedMillion(transfer.getId(), preSuccess, orderCode, account, amount, now);
|
|
|
String resultStr = JSON.toJSONString(mapResult);
|
|
|
jsonObject = JSON.parseObject(resultStr);
|
|
|
if(!StringUtils.equals("T", mapResult.get("is_success"))) {
|
|
|
throw new ServiceException(500, "转账失败:返回={}" + resultStr);
|
|
|
} else {
|
|
|
if (transferType == 2) {
|
|
|
transferWhenExceedMillion(transfer.getId(), preSuccess, orderCode, account, amount, now);
|
|
|
return;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
jsonObject = alipayService.transferMoney(Long.toString(orderCode), account.getAlipayId(), account.getAlipayAccount(), amount);
|
|
|
if (jsonObject == null) {
|
...
|
...
|
@@ -1116,21 +1121,15 @@ public class PaymentServiceImpl implements IPaymentService { |
|
|
transferSuccess.setStatus(1);
|
|
|
transferSuccess.setUpdateTime(now);
|
|
|
ordersPayTransferMapper.updateByPrimaryKeySelective(transferSuccess);
|
|
|
} else if(exceedMillion(jsonObject)) {
|
|
|
Map<String, String> mapResult = transferWhenExceedMillion(transfer.getId(), tradeBills, orderCode, account, amount, now);
|
|
|
String resultStr = JSON.toJSONString(mapResult);
|
|
|
jsonObject = JSON.parseObject(resultStr);
|
|
|
if(!StringUtils.equals("T", mapResult.get("is_success"))) {
|
|
|
throw new ServiceException(500, "转账失败:返回={}" + resultStr);
|
|
|
} else {
|
|
|
return;
|
|
|
}
|
|
|
} else {
|
|
|
logger.warn("manualDealErr 返回code或者order_id不是成功状态,code={}, orderId={}", code, orderId);
|
|
|
// 上报
|
|
|
throw new ServiceException(500, "转账失败:返回code="+code+",order_id="+orderId);
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
|
if (transferType != null && transferType == 2) {
|
|
|
return;
|
|
|
}
|
|
|
logger.warn("manualDealErr 转账失败 , orderCode is {}, msg is {}", orderCode, e.getMessage());
|
|
|
String alarmMsg = "订单号:" + orderCode + ",操作类型(转账),流水id=" + tradeBillsId + ",msg=" + e.getMessage();
|
|
|
if (jsonObject != null) {
|
...
|
...
|
|