...
|
...
|
@@ -624,11 +624,11 @@ public class PaymentServiceImpl implements IPaymentService { |
|
|
transfer.setAlipayAccount(account.getAlipayAccount());
|
|
|
}
|
|
|
String alipayAccount = transfer.getAlipayAccount();
|
|
|
|
|
|
JSONObject jsonObject = null;
|
|
|
// 转账
|
|
|
try {
|
|
|
logger.info("transferMon开始调用阿里接口参数buyerOrderCode={}, alipayAccount={}, transferAmount={}", buyerOrderCode, alipayAccount, transferAmount);
|
|
|
JSONObject jsonObject = alipayService.transferMoney(Long.toString(buyerOrderCode), account.getAlipayId(), account.getAlipayAccount(), transferAmount);
|
|
|
jsonObject = alipayService.transferMoney(Long.toString(buyerOrderCode), account.getAlipayId(), account.getAlipayAccount(), transferAmount);
|
|
|
if (jsonObject == null) {
|
|
|
logger.warn("transferMonErr 转账失败 , orderCode is {}", buyerOrderCode);
|
|
|
transfer.setStatus(3);
|
...
|
...
|
@@ -651,7 +651,12 @@ public class PaymentServiceImpl implements IPaymentService { |
|
|
}
|
|
|
} catch (Exception e) {
|
|
|
logger.warn("transferMonErr 转账失败 , orderCode is {}, msg is {}", buyerOrderCode, e.getMessage());
|
|
|
alarm("转账失败", "ufo.order.transferMon", "订单号:" + buyerOrderCode + "操作类型(" + transferType + ")转账失败,msg=" + e.getMessage());
|
|
|
String alarmMsg = "订单号:" + buyerOrderCode + ",操作类型:" + transferCase.getInfo() + ",msg=" + e.getMessage();
|
|
|
if (jsonObject != null) {
|
|
|
alarmMsg += ",阿里返回DETAIL=" + jsonObject.toJSONString();
|
|
|
}
|
|
|
logger.info("transferMonErr 转账失败 , alarmMsg is {}", alarmMsg);
|
|
|
alarm("转账失败", "ufo.order.transferMon", alarmMsg);
|
|
|
transfer.setStatus(3);
|
|
|
if(e instanceof ServiceException) {
|
|
|
throw new ServiceException(((ServiceException) e).getCode(), e.getMessage());
|
...
|
...
|
@@ -733,9 +738,10 @@ public class PaymentServiceImpl implements IPaymentService { |
|
|
logger.info("transAllEarnest参数检查成功!");
|
|
|
|
|
|
// 转账
|
|
|
JSONObject jsonObject = null;
|
|
|
try {
|
|
|
logger.info("transAllEarnest开始调用阿里接口参数buyerOrderCode={}, alipayAccount={}, transferAmount={}", orderCode, alipayAccount, amount);
|
|
|
JSONObject jsonObject = alipayService.transferMoney(Long.toString(orderCode), alipayId, alipayAccount, amount);
|
|
|
jsonObject = alipayService.transferMoney(Long.toString(orderCode), alipayId, alipayAccount, amount);
|
|
|
if (jsonObject == null) {
|
|
|
logger.warn("transAllEarnestErr 转账失败 , orderCode is {}", orderCode);
|
|
|
transfer.setStatus(3);
|
...
|
...
|
@@ -759,7 +765,12 @@ public class PaymentServiceImpl implements IPaymentService { |
|
|
}
|
|
|
} catch (Exception e) {
|
|
|
logger.warn("transAllEarnestErr 转账失败 , orderCode is {}, msg is {}", orderCode, e.getMessage());
|
|
|
alarm("转账失败", "ufo.order.transAllEarnest", "订单号:" + orderCode + "操作类型(" + 6 + ")转账失败,msg=" + e.getMessage());
|
|
|
String alarmMsg = "订单号:" + orderCode + ",操作类型(商家退出入驻退保证金),msg=" + e.getMessage();
|
|
|
if (jsonObject != null) {
|
|
|
alarmMsg += ",阿里返回DETAIL=" + jsonObject.toJSONString();
|
|
|
}
|
|
|
logger.info("transAllEarnestErr 转账失败 , alarmMsg is {}", alarmMsg);
|
|
|
alarm("转账失败", "ufo.order.transAllEarnest", alarmMsg);
|
|
|
transfer.setStatus(3);
|
|
|
if(e instanceof ServiceException) {
|
|
|
throw new ServiceException(((ServiceException) e).getCode(), e.getMessage());
|
...
|
...
|
@@ -925,12 +936,13 @@ public class PaymentServiceImpl implements IPaymentService { |
|
|
}
|
|
|
|
|
|
// '1:买家uid; 2:卖家uid','1:保证金;2:货款;3:补偿款', '1:用户收入; 2:用户支出'
|
|
|
PayRefundBo refundBo = null;
|
|
|
try {
|
|
|
if (/* 退货款 */((tradeBills.getUserType() == 1 && tradeBills.getTradeType() == 2 && tradeBills.getIncomeOutcome() == 1)
|
|
|
/* 退保证金(普通用户) */
|
|
|
|| (tradeBills.getUserType() == 2 && tradeBills.getTradeType() == 1 && tradeBills.getIncomeOutcome() == 1 && !isMerchantExit))) {
|
|
|
logger.warn("manualDeal人工退款 , tradeBills is {}", tradeBills);
|
|
|
PayRefundBo refundBo = manualRefund(orderCode, amount);
|
|
|
refundBo = manualRefund(orderCode, amount);
|
|
|
if (refundBo.getRefundStatus() == RefundContant.PAYMENT_REFUND_RESULTCODE_SUCCESS) {
|
|
|
// 加新流水
|
|
|
tradeBills.setDealRelateId(tradeBills.getId());
|
...
|
...
|
@@ -945,8 +957,12 @@ public class PaymentServiceImpl implements IPaymentService { |
|
|
}
|
|
|
} catch (Exception e) {
|
|
|
logger.warn("manualDealErr 退款失败 , tradeBillsId is {}, msg is {}", tradeBillsId, e.getMessage());
|
|
|
alarm("人工处理退款失败", "ufo.order.manualDeal",
|
|
|
"订单号:" + orderCode + "操作类型(退款)转账失败,流水id=" + tradeBillsId + ",msg=" + e.getMessage());
|
|
|
String alarmMsg = "订单号:" + orderCode + ",操作类型(退款),流水id=" + tradeBillsId + ",msg=" + e.getMessage();
|
|
|
if (refundBo != null) {
|
|
|
alarmMsg += ",DETAIL=" + JSON.toJSONString(refundBo);
|
|
|
}
|
|
|
logger.info("manualDealErr 退款失败 , alarmMsg is {}", alarmMsg);
|
|
|
alarm("人工处理退款失败", "ufo.order.manualDeal", alarmMsg );
|
|
|
preSuccess.setDealStatus(0);
|
|
|
tradeBillsMapper.updateToFailByPrimaryKey(preSuccess);
|
|
|
if (e instanceof ServiceException) {
|
...
|
...
|
@@ -955,6 +971,7 @@ public class PaymentServiceImpl implements IPaymentService { |
|
|
throw new ServiceException(500, "退款失败id=" + tradeBillsId);
|
|
|
}
|
|
|
}
|
|
|
JSONObject jsonObject = null;
|
|
|
try {
|
|
|
OrdersPayTransfer transfer = ordersPayTransferMapper.selectByBuyerOrderCode(orderCode);
|
|
|
if (transfer == null) {
|
...
|
...
|
@@ -964,7 +981,7 @@ public class PaymentServiceImpl implements IPaymentService { |
|
|
throw new ServiceException(400, "转账记录已成功转账,流水id=" + tradeBillsId);
|
|
|
}
|
|
|
|
|
|
JSONObject jsonObject = alipayService.transferMoney(Long.toString(orderCode), account.getAlipayId(), account.getAlipayAccount(), amount);
|
|
|
jsonObject = alipayService.transferMoney(Long.toString(orderCode), account.getAlipayId(), account.getAlipayAccount(), amount);
|
|
|
if (jsonObject == null) {
|
|
|
logger.warn("manualDeal 转账失败 , req is {}", req);
|
|
|
throw new ServiceException(500, "转账失败:阿里接口返回null");
|
...
|
...
|
@@ -991,8 +1008,12 @@ public class PaymentServiceImpl implements IPaymentService { |
|
|
}
|
|
|
} catch (Exception e) {
|
|
|
logger.warn("manualDealErr 转账失败 , orderCode is {}, msg is {}", orderCode, e.getMessage());
|
|
|
alarm("人工处理转账失败", "ufo.order.manualDeal",
|
|
|
"订单号:" + orderCode + "操作类型(退款)转账失败,流水id=" + tradeBillsId + ",msg=" + e.getMessage());
|
|
|
String alarmMsg = "订单号:" + orderCode + ",操作类型(转账),流水id=" + tradeBillsId + ",msg=" + e.getMessage();
|
|
|
if (jsonObject != null) {
|
|
|
alarmMsg += ",阿里返回DETAIL=" + jsonObject.toJSONString();
|
|
|
}
|
|
|
logger.info("manualDealErr 转账失败 , alarmMsg is {}", alarmMsg);
|
|
|
alarm("人工处理转账失败", "ufo.order.manualDeal", alarmMsg);
|
|
|
preSuccess.setDealStatus(0);
|
|
|
tradeBillsMapper.updateToFailByPrimaryKey(preSuccess);
|
|
|
if (e instanceof ServiceException) {
|
...
|
...
|
|