|
|
@ -77,19 +77,21 @@ public class TuanYouController { |
|
|
|
HighOrder order = highOrderService.getOrderByOrderNo(object.getString("thirdOrderNo")); |
|
|
|
HighOrder order = highOrderService.getOrderByOrderNo(object.getString("thirdOrderNo")); |
|
|
|
|
|
|
|
|
|
|
|
// 订单状态:1 待支付 2 已支付 3.已完成 4. 已退款 5.已取消 6.退款中 7.拒绝退款
|
|
|
|
// 订单状态:1 待支付 2 已支付 3.已完成 4. 已退款 5.已取消 6.退款中 7.拒绝退款
|
|
|
|
if (order != null && order.getOrderStatus() == 6) { |
|
|
|
if (order != null) { |
|
|
|
// 退单结果 true:成功 false:失败
|
|
|
|
if (order.getOrderStatus() == 2 || order.getOrderStatus() == 6) { |
|
|
|
if (object.getBoolean("refundResult") == true && order != null) { |
|
|
|
// 退单结果 true:成功 false:失败
|
|
|
|
OrderRefundModel orderRefundModel = WxOrderConfig.orderToRefund(order.getPaySerialNo(), order.getPayRealPrice(), order.getPayRealPrice()); |
|
|
|
if (object.getBoolean("refundResult") == true && order != null) { |
|
|
|
if(orderRefundModel.getResult_code().equals("SUCCESS")) { |
|
|
|
OrderRefundModel orderRefundModel = WxOrderConfig.orderToRefund(order.getPaySerialNo(), order.getPayRealPrice(), order.getPayRealPrice()); |
|
|
|
order.setOrderStatus(4); |
|
|
|
if(orderRefundModel.getResult_code().equals("SUCCESS")) { |
|
|
|
order.setRefundTime(new Date()); |
|
|
|
order.setOrderStatus(4); |
|
|
|
|
|
|
|
order.setRefundTime(new Date()); |
|
|
|
|
|
|
|
highOrderService.updateOrderDetail(order); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} else if (!object.getBoolean("refundResult") == true && order != null) { |
|
|
|
|
|
|
|
order.setOrderStatus(7); |
|
|
|
|
|
|
|
order.setRefusalRefundContent(object.getString("refundFailReason")); |
|
|
|
highOrderService.updateOrderDetail(order); |
|
|
|
highOrderService.updateOrderDetail(order); |
|
|
|
} |
|
|
|
} |
|
|
|
} else if (!object.getBoolean("refundResult") == true && order != null) { |
|
|
|
|
|
|
|
order.setOrderStatus(7); |
|
|
|
|
|
|
|
order.setRefusalRefundContent(object.getString("refundFailReason")); |
|
|
|
|
|
|
|
highOrderService.updateOrderDetail(order); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
response.setCharacterEncoding("UTF-8"); |
|
|
|
response.setCharacterEncoding("UTF-8"); |
|
|
|