|
|
@ -10,6 +10,7 @@ import com.hai.entity.*; |
|
|
|
import com.hai.order.service.OrderPaySuccessService; |
|
|
|
import com.hai.order.service.OrderPaySuccessService; |
|
|
|
import com.hai.order.service.OrderService; |
|
|
|
import com.hai.order.service.OrderService; |
|
|
|
import com.hai.order.type.OrderPayType; |
|
|
|
import com.hai.order.type.OrderPayType; |
|
|
|
|
|
|
|
import com.hai.order.type.OrderStatus; |
|
|
|
import com.hai.service.pay.NotifyService; |
|
|
|
import com.hai.service.pay.NotifyService; |
|
|
|
import io.swagger.annotations.Api; |
|
|
|
import io.swagger.annotations.Api; |
|
|
|
import io.swagger.annotations.ApiOperation; |
|
|
|
import io.swagger.annotations.ApiOperation; |
|
|
@ -65,10 +66,16 @@ public class OrderPayNotifyController { |
|
|
|
|
|
|
|
|
|
|
|
// 处理业务
|
|
|
|
// 处理业务
|
|
|
|
log.info("开始处理业务"); |
|
|
|
log.info("开始处理业务"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 查询交易订单
|
|
|
|
|
|
|
|
HighOrder order = orderService.getOrderDetailByNo(map.get("out_trade_no")); |
|
|
|
|
|
|
|
if (order != null && order.getOrderStatus().equals(OrderStatus.STATUS1.getNumber())) { |
|
|
|
|
|
|
|
// 处理订单业务
|
|
|
|
paySuccessService.orderPaySuccessHandle(map.get("out_trade_no"), |
|
|
|
paySuccessService.orderPaySuccessHandle(map.get("out_trade_no"), |
|
|
|
OrderPayType.PAY_TYPE2, map.get("out_trade_no"), |
|
|
|
OrderPayType.PAY_TYPE2, map.get("out_trade_no"), |
|
|
|
new BigDecimal(map.get("total_fee")).divide(new BigDecimal("100")), |
|
|
|
new BigDecimal(map.get("total_fee")).divide(new BigDecimal("100")), |
|
|
|
null); |
|
|
|
null); |
|
|
|
|
|
|
|
} |
|
|
|
log.info("处理业务完成"); |
|
|
|
log.info("处理业务完成"); |
|
|
|
|
|
|
|
|
|
|
|
BufferedOutputStream out = new BufferedOutputStream(response.getOutputStream()); |
|
|
|
BufferedOutputStream out = new BufferedOutputStream(response.getOutputStream()); |
|
|
@ -96,16 +103,15 @@ public class OrderPayNotifyController { |
|
|
|
|
|
|
|
|
|
|
|
// 查询订单信息
|
|
|
|
// 查询订单信息
|
|
|
|
HighOrder order = orderService.getOrderDetailByNo(body.getString("tradetrace")); |
|
|
|
HighOrder order = orderService.getOrderDetailByNo(body.getString("tradetrace")); |
|
|
|
if (order == null) { |
|
|
|
if (order != null && order.getOrderStatus().equals(OrderStatus.STATUS1.getNumber())) { |
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.NOT_FOUND_ORDER, ""); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
log.info("开始处理业务"); |
|
|
|
log.info("开始处理业务"); |
|
|
|
// 异步处理业务
|
|
|
|
// 处理订单业务
|
|
|
|
paySuccessService.orderPaySuccessHandle(order.getOrderNo(), |
|
|
|
paySuccessService.orderPaySuccessHandle(order.getOrderNo(), |
|
|
|
OrderPayType.PAY_TYPE5, |
|
|
|
OrderPayType.PAY_TYPE5, |
|
|
|
body.getString("wtorderid"), |
|
|
|
body.getString("wtorderid"), |
|
|
|
order.getPayPrice(), |
|
|
|
order.getPayPrice(), |
|
|
|
null); |
|
|
|
null); |
|
|
|
|
|
|
|
} |
|
|
|
log.info("处理业务完成"); |
|
|
|
log.info("处理业务完成"); |
|
|
|
} |
|
|
|
} |
|
|
|
BufferedOutputStream out = new BufferedOutputStream(response.getOutputStream()); |
|
|
|
BufferedOutputStream out = new BufferedOutputStream(response.getOutputStream()); |
|
|
|