|
|
|
@ -9,7 +9,10 @@ import com.hai.config.WxMsgConfig; |
|
|
|
|
import com.hai.dao.HighGasOrderPushMapper; |
|
|
|
|
import com.hai.entity.*; |
|
|
|
|
import com.hai.enum_type.OrderPushType; |
|
|
|
|
import com.hai.enum_type.OrderStatusEnum; |
|
|
|
|
import com.hai.enum_type.RechargePayType; |
|
|
|
|
import com.hai.order.service.OrderService; |
|
|
|
|
import com.hai.order.type.OrderChildStatus; |
|
|
|
|
import com.hai.service.*; |
|
|
|
|
import com.hai.service.impl.OutRechargeOrderServiceImpl; |
|
|
|
|
import io.swagger.annotations.Api; |
|
|
|
@ -47,6 +50,12 @@ public class OrderTelChargeCallbackController { |
|
|
|
|
@Resource |
|
|
|
|
private ApiOrderRecordService apiOrderRecordService; |
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
|
private HighOrderService highOrderService; |
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
|
private OrderService orderService; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@RequestMapping(value = "/rechargeCallbackByJj", method = RequestMethod.POST) |
|
|
|
|
@ApiOperation(value = "尖椒充值回调") |
|
|
|
@ -90,6 +99,7 @@ public class OrderTelChargeCallbackController { |
|
|
|
|
|
|
|
|
|
outRechargeOrderService.updateOrder(rechargeOrder); |
|
|
|
|
outRechargeChildOrderService.updateOrder(childOrder); |
|
|
|
|
orderFinish(rechargeOrder); |
|
|
|
|
|
|
|
|
|
// api商户订单
|
|
|
|
|
if (rechargeOrder.getPayType() == 6) { |
|
|
|
@ -153,6 +163,7 @@ public class OrderTelChargeCallbackController { |
|
|
|
|
|
|
|
|
|
outRechargeOrderService.updateOrder(rechargeOrder); |
|
|
|
|
outRechargeChildOrderService.updateOrder(childOrder); |
|
|
|
|
orderFinish(rechargeOrder); |
|
|
|
|
if (rechargeOrder.getPayType() == 6) { |
|
|
|
|
apiOrderRecord(rechargeOrder); |
|
|
|
|
} |
|
|
|
@ -176,7 +187,7 @@ public class OrderTelChargeCallbackController { |
|
|
|
|
|
|
|
|
|
// 101:充值成功 102: 充值中 103:充值失败 104 未充值
|
|
|
|
|
// 订单支付状态 : 101.待支付 102.已支付 100.已完成 104.已取消 105.已退款
|
|
|
|
|
if (childOrder.getStatus() == 102 && rechargeOrder.getPayStatus() == 102) { |
|
|
|
|
if (childOrder.getStatus() == 102 && rechargeOrder.getPayStatus() == 102) { |
|
|
|
|
|
|
|
|
|
Date rechargeTime = rechargeOrder.getCreateTimed(); |
|
|
|
|
Date currentTime = new Date(); |
|
|
|
@ -194,13 +205,7 @@ public class OrderTelChargeCallbackController { |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
rechargeOrder.setRechargeStatus(203); |
|
|
|
|
childOrder.setStatus(103); |
|
|
|
|
outRechargeOrderService.updateOrder(rechargeOrder); |
|
|
|
|
outRechargeChildOrderService.updateOrder(childOrder); |
|
|
|
|
|
|
|
|
|
outRechargeOrderService.rechargeOrderToRefund(rechargeOrder.getId()); |
|
|
|
|
|
|
|
|
|
outRechargeOrderService.refundOrder(rechargeOrder.getId() , childOrder); |
|
|
|
|
|
|
|
|
|
// 发送充值失败 微信小程序服务通知
|
|
|
|
|
new Thread(() -> { |
|
|
|
@ -215,6 +220,21 @@ public class OrderTelChargeCallbackController { |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 订单完成操作
|
|
|
|
|
private void orderFinish(OutRechargeOrder rechargeOrder) { |
|
|
|
|
HighOrder highOrder = highOrderService.getOrderByOrderNo(rechargeOrder.getOrderNo()); |
|
|
|
|
if (highOrder != null) { |
|
|
|
|
highOrder.setOrderStatus(OrderStatusEnum.type3.getType()); |
|
|
|
|
highOrder.setFinishTime(new Date()); |
|
|
|
|
for (HighChildOrder highChildOrder : highOrder.getHighChildOrderList()) { |
|
|
|
|
highChildOrder.setChildOrderStatus(OrderChildStatus.STATUS3.getNumber()); |
|
|
|
|
highChildOrder.setFinishTime(new Date()); |
|
|
|
|
} |
|
|
|
|
orderService.updateOrderData(highOrder); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void apiOrderRecord(OutRechargeOrder rechargeOrder) { |
|
|
|
|
Map<String, Object> orderMap = new HashMap<>(); |
|
|
|
|
orderMap.put("orderId" , rechargeOrder.getId()); |
|
|
|
|