|
@@ -624,11 +624,11 @@ public class PaymentServiceImpl implements IPaymentService { |
|
@@ -624,11 +624,11 @@ public class PaymentServiceImpl implements IPaymentService { |
624
|
transfer.setAlipayAccount(account.getAlipayAccount());
|
624
|
transfer.setAlipayAccount(account.getAlipayAccount());
|
625
|
}
|
625
|
}
|
626
|
String alipayAccount = transfer.getAlipayAccount();
|
626
|
String alipayAccount = transfer.getAlipayAccount();
|
627
|
-
|
627
|
+ JSONObject jsonObject = null;
|
628
|
// 转账
|
628
|
// 转账
|
629
|
try {
|
629
|
try {
|
630
|
logger.info("transferMon开始调用阿里接口参数buyerOrderCode={}, alipayAccount={}, transferAmount={}", buyerOrderCode, alipayAccount, transferAmount);
|
630
|
logger.info("transferMon开始调用阿里接口参数buyerOrderCode={}, alipayAccount={}, transferAmount={}", buyerOrderCode, alipayAccount, transferAmount);
|
631
|
- JSONObject jsonObject = alipayService.transferMoney(Long.toString(buyerOrderCode), account.getAlipayId(), account.getAlipayAccount(), transferAmount);
|
631
|
+ jsonObject = alipayService.transferMoney(Long.toString(buyerOrderCode), account.getAlipayId(), account.getAlipayAccount(), transferAmount);
|
632
|
if (jsonObject == null) {
|
632
|
if (jsonObject == null) {
|
633
|
logger.warn("transferMonErr 转账失败 , orderCode is {}", buyerOrderCode);
|
633
|
logger.warn("transferMonErr 转账失败 , orderCode is {}", buyerOrderCode);
|
634
|
transfer.setStatus(3);
|
634
|
transfer.setStatus(3);
|
|
@@ -651,7 +651,12 @@ public class PaymentServiceImpl implements IPaymentService { |
|
@@ -651,7 +651,12 @@ public class PaymentServiceImpl implements IPaymentService { |
651
|
}
|
651
|
}
|
652
|
} catch (Exception e) {
|
652
|
} catch (Exception e) {
|
653
|
logger.warn("transferMonErr 转账失败 , orderCode is {}, msg is {}", buyerOrderCode, e.getMessage());
|
653
|
logger.warn("transferMonErr 转账失败 , orderCode is {}, msg is {}", buyerOrderCode, e.getMessage());
|
654
|
- alarm("转账失败", "ufo.order.transferMon", "订单号:" + buyerOrderCode + "操作类型(" + transferType + ")转账失败,msg=" + e.getMessage());
|
654
|
+ String alarmMsg = "订单号:" + buyerOrderCode + ",操作类型:" + transferCase.getInfo() + ",msg=" + e.getMessage();
|
|
|
655
|
+ if (jsonObject != null) {
|
|
|
656
|
+ alarmMsg += ",阿里返回DETAIL=" + jsonObject.toJSONString();
|
|
|
657
|
+ }
|
|
|
658
|
+ logger.info("transferMonErr 转账失败 , alarmMsg is {}", alarmMsg);
|
|
|
659
|
+ alarm("转账失败", "ufo.order.transferMon", alarmMsg);
|
655
|
transfer.setStatus(3);
|
660
|
transfer.setStatus(3);
|
656
|
if(e instanceof ServiceException) {
|
661
|
if(e instanceof ServiceException) {
|
657
|
throw new ServiceException(((ServiceException) e).getCode(), e.getMessage());
|
662
|
throw new ServiceException(((ServiceException) e).getCode(), e.getMessage());
|
|
@@ -733,9 +738,10 @@ public class PaymentServiceImpl implements IPaymentService { |
|
@@ -733,9 +738,10 @@ public class PaymentServiceImpl implements IPaymentService { |
733
|
logger.info("transAllEarnest参数检查成功!");
|
738
|
logger.info("transAllEarnest参数检查成功!");
|
734
|
|
739
|
|
735
|
// 转账
|
740
|
// 转账
|
|
|
741
|
+ JSONObject jsonObject = null;
|
736
|
try {
|
742
|
try {
|
737
|
logger.info("transAllEarnest开始调用阿里接口参数buyerOrderCode={}, alipayAccount={}, transferAmount={}", orderCode, alipayAccount, amount);
|
743
|
logger.info("transAllEarnest开始调用阿里接口参数buyerOrderCode={}, alipayAccount={}, transferAmount={}", orderCode, alipayAccount, amount);
|
738
|
- JSONObject jsonObject = alipayService.transferMoney(Long.toString(orderCode), alipayId, alipayAccount, amount);
|
744
|
+ jsonObject = alipayService.transferMoney(Long.toString(orderCode), alipayId, alipayAccount, amount);
|
739
|
if (jsonObject == null) {
|
745
|
if (jsonObject == null) {
|
740
|
logger.warn("transAllEarnestErr 转账失败 , orderCode is {}", orderCode);
|
746
|
logger.warn("transAllEarnestErr 转账失败 , orderCode is {}", orderCode);
|
741
|
transfer.setStatus(3);
|
747
|
transfer.setStatus(3);
|
|
@@ -759,7 +765,12 @@ public class PaymentServiceImpl implements IPaymentService { |
|
@@ -759,7 +765,12 @@ public class PaymentServiceImpl implements IPaymentService { |
759
|
}
|
765
|
}
|
760
|
} catch (Exception e) {
|
766
|
} catch (Exception e) {
|
761
|
logger.warn("transAllEarnestErr 转账失败 , orderCode is {}, msg is {}", orderCode, e.getMessage());
|
767
|
logger.warn("transAllEarnestErr 转账失败 , orderCode is {}, msg is {}", orderCode, e.getMessage());
|
762
|
- alarm("转账失败", "ufo.order.transAllEarnest", "订单号:" + orderCode + "操作类型(" + 6 + ")转账失败,msg=" + e.getMessage());
|
768
|
+ String alarmMsg = "订单号:" + orderCode + ",操作类型(商家退出入驻退保证金),msg=" + e.getMessage();
|
|
|
769
|
+ if (jsonObject != null) {
|
|
|
770
|
+ alarmMsg += ",阿里返回DETAIL=" + jsonObject.toJSONString();
|
|
|
771
|
+ }
|
|
|
772
|
+ logger.info("transAllEarnestErr 转账失败 , alarmMsg is {}", alarmMsg);
|
|
|
773
|
+ alarm("转账失败", "ufo.order.transAllEarnest", alarmMsg);
|
763
|
transfer.setStatus(3);
|
774
|
transfer.setStatus(3);
|
764
|
if(e instanceof ServiceException) {
|
775
|
if(e instanceof ServiceException) {
|
765
|
throw new ServiceException(((ServiceException) e).getCode(), e.getMessage());
|
776
|
throw new ServiceException(((ServiceException) e).getCode(), e.getMessage());
|
|
@@ -925,12 +936,13 @@ public class PaymentServiceImpl implements IPaymentService { |
|
@@ -925,12 +936,13 @@ public class PaymentServiceImpl implements IPaymentService { |
925
|
}
|
936
|
}
|
926
|
|
937
|
|
927
|
// '1:买家uid; 2:卖家uid','1:保证金;2:货款;3:补偿款', '1:用户收入; 2:用户支出'
|
938
|
// '1:买家uid; 2:卖家uid','1:保证金;2:货款;3:补偿款', '1:用户收入; 2:用户支出'
|
|
|
939
|
+ PayRefundBo refundBo = null;
|
928
|
try {
|
940
|
try {
|
929
|
if (/* 退货款 */((tradeBills.getUserType() == 1 && tradeBills.getTradeType() == 2 && tradeBills.getIncomeOutcome() == 1)
|
941
|
if (/* 退货款 */((tradeBills.getUserType() == 1 && tradeBills.getTradeType() == 2 && tradeBills.getIncomeOutcome() == 1)
|
930
|
/* 退保证金(普通用户) */
|
942
|
/* 退保证金(普通用户) */
|
931
|
|| (tradeBills.getUserType() == 2 && tradeBills.getTradeType() == 1 && tradeBills.getIncomeOutcome() == 1 && !isMerchantExit))) {
|
943
|
|| (tradeBills.getUserType() == 2 && tradeBills.getTradeType() == 1 && tradeBills.getIncomeOutcome() == 1 && !isMerchantExit))) {
|
932
|
logger.warn("manualDeal人工退款 , tradeBills is {}", tradeBills);
|
944
|
logger.warn("manualDeal人工退款 , tradeBills is {}", tradeBills);
|
933
|
- PayRefundBo refundBo = manualRefund(orderCode, amount);
|
945
|
+ refundBo = manualRefund(orderCode, amount);
|
934
|
if (refundBo.getRefundStatus() == RefundContant.PAYMENT_REFUND_RESULTCODE_SUCCESS) {
|
946
|
if (refundBo.getRefundStatus() == RefundContant.PAYMENT_REFUND_RESULTCODE_SUCCESS) {
|
935
|
// 加新流水
|
947
|
// 加新流水
|
936
|
tradeBills.setDealRelateId(tradeBills.getId());
|
948
|
tradeBills.setDealRelateId(tradeBills.getId());
|
|
@@ -945,8 +957,12 @@ public class PaymentServiceImpl implements IPaymentService { |
|
@@ -945,8 +957,12 @@ public class PaymentServiceImpl implements IPaymentService { |
945
|
}
|
957
|
}
|
946
|
} catch (Exception e) {
|
958
|
} catch (Exception e) {
|
947
|
logger.warn("manualDealErr 退款失败 , tradeBillsId is {}, msg is {}", tradeBillsId, e.getMessage());
|
959
|
logger.warn("manualDealErr 退款失败 , tradeBillsId is {}, msg is {}", tradeBillsId, e.getMessage());
|
948
|
- alarm("人工处理退款失败", "ufo.order.manualDeal",
|
|
|
949
|
- "订单号:" + orderCode + "操作类型(退款)转账失败,流水id=" + tradeBillsId + ",msg=" + e.getMessage());
|
960
|
+ String alarmMsg = "订单号:" + orderCode + ",操作类型(退款),流水id=" + tradeBillsId + ",msg=" + e.getMessage();
|
|
|
961
|
+ if (refundBo != null) {
|
|
|
962
|
+ alarmMsg += ",DETAIL=" + JSON.toJSONString(refundBo);
|
|
|
963
|
+ }
|
|
|
964
|
+ logger.info("manualDealErr 退款失败 , alarmMsg is {}", alarmMsg);
|
|
|
965
|
+ alarm("人工处理退款失败", "ufo.order.manualDeal", alarmMsg );
|
950
|
preSuccess.setDealStatus(0);
|
966
|
preSuccess.setDealStatus(0);
|
951
|
tradeBillsMapper.updateToFailByPrimaryKey(preSuccess);
|
967
|
tradeBillsMapper.updateToFailByPrimaryKey(preSuccess);
|
952
|
if (e instanceof ServiceException) {
|
968
|
if (e instanceof ServiceException) {
|
|
@@ -955,6 +971,7 @@ public class PaymentServiceImpl implements IPaymentService { |
|
@@ -955,6 +971,7 @@ public class PaymentServiceImpl implements IPaymentService { |
955
|
throw new ServiceException(500, "退款失败id=" + tradeBillsId);
|
971
|
throw new ServiceException(500, "退款失败id=" + tradeBillsId);
|
956
|
}
|
972
|
}
|
957
|
}
|
973
|
}
|
|
|
974
|
+ JSONObject jsonObject = null;
|
958
|
try {
|
975
|
try {
|
959
|
OrdersPayTransfer transfer = ordersPayTransferMapper.selectByBuyerOrderCode(orderCode);
|
976
|
OrdersPayTransfer transfer = ordersPayTransferMapper.selectByBuyerOrderCode(orderCode);
|
960
|
if (transfer == null) {
|
977
|
if (transfer == null) {
|
|
@@ -964,7 +981,7 @@ public class PaymentServiceImpl implements IPaymentService { |
|
@@ -964,7 +981,7 @@ public class PaymentServiceImpl implements IPaymentService { |
964
|
throw new ServiceException(400, "转账记录已成功转账,流水id=" + tradeBillsId);
|
981
|
throw new ServiceException(400, "转账记录已成功转账,流水id=" + tradeBillsId);
|
965
|
}
|
982
|
}
|
966
|
|
983
|
|
967
|
- JSONObject jsonObject = alipayService.transferMoney(Long.toString(orderCode), account.getAlipayId(), account.getAlipayAccount(), amount);
|
984
|
+ jsonObject = alipayService.transferMoney(Long.toString(orderCode), account.getAlipayId(), account.getAlipayAccount(), amount);
|
968
|
if (jsonObject == null) {
|
985
|
if (jsonObject == null) {
|
969
|
logger.warn("manualDeal 转账失败 , req is {}", req);
|
986
|
logger.warn("manualDeal 转账失败 , req is {}", req);
|
970
|
throw new ServiceException(500, "转账失败:阿里接口返回null");
|
987
|
throw new ServiceException(500, "转账失败:阿里接口返回null");
|
|
@@ -991,8 +1008,12 @@ public class PaymentServiceImpl implements IPaymentService { |
|
@@ -991,8 +1008,12 @@ public class PaymentServiceImpl implements IPaymentService { |
991
|
}
|
1008
|
}
|
992
|
} catch (Exception e) {
|
1009
|
} catch (Exception e) {
|
993
|
logger.warn("manualDealErr 转账失败 , orderCode is {}, msg is {}", orderCode, e.getMessage());
|
1010
|
logger.warn("manualDealErr 转账失败 , orderCode is {}, msg is {}", orderCode, e.getMessage());
|
994
|
- alarm("人工处理转账失败", "ufo.order.manualDeal",
|
|
|
995
|
- "订单号:" + orderCode + "操作类型(退款)转账失败,流水id=" + tradeBillsId + ",msg=" + e.getMessage());
|
1011
|
+ String alarmMsg = "订单号:" + orderCode + ",操作类型(转账),流水id=" + tradeBillsId + ",msg=" + e.getMessage();
|
|
|
1012
|
+ if (jsonObject != null) {
|
|
|
1013
|
+ alarmMsg += ",阿里返回DETAIL=" + jsonObject.toJSONString();
|
|
|
1014
|
+ }
|
|
|
1015
|
+ logger.info("manualDealErr 转账失败 , alarmMsg is {}", alarmMsg);
|
|
|
1016
|
+ alarm("人工处理转账失败", "ufo.order.manualDeal", alarmMsg);
|
996
|
preSuccess.setDealStatus(0);
|
1017
|
preSuccess.setDealStatus(0);
|
997
|
tradeBillsMapper.updateToFailByPrimaryKey(preSuccess);
|
1018
|
tradeBillsMapper.updateToFailByPrimaryKey(preSuccess);
|
998
|
if (e instanceof ServiceException) {
|
1019
|
if (e instanceof ServiceException) {
|