53 lines
1.8 KiB
Java
53 lines
1.8 KiB
Java
package com.ai.da.controller;
|
|
|
|
import com.ai.da.common.enums.OrderStatusEnum;
|
|
import com.ai.da.common.response.PageBaseResponse;
|
|
import com.ai.da.common.response.Response;
|
|
import com.ai.da.model.dto.QueryPageByTimeDTO;
|
|
import com.ai.da.model.vo.OrderListVO;
|
|
import com.ai.da.service.OrderInfoService;
|
|
import com.ai.da.service.PaymentInfoService;
|
|
import io.swagger.v3.oas.annotations.Operation;
|
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
import jakarta.annotation.Resource;
|
|
import jakarta.validation.Valid;
|
|
|
|
@CrossOrigin //开放前端的跨域访问
|
|
@Tag(name = "商品订单管理")
|
|
@RestController
|
|
@RequestMapping("/api/order-info")
|
|
public class OrderInfoController {
|
|
|
|
@Resource
|
|
private OrderInfoService orderInfoService;
|
|
|
|
@Resource
|
|
private PaymentInfoService paymentInfoService;
|
|
|
|
@Operation(summary = "订单列表")
|
|
@PostMapping("/list")
|
|
public Response<PageBaseResponse<OrderListVO>> list(@Valid @RequestBody QueryPageByTimeDTO queryPageByTimeDTO){
|
|
PageBaseResponse<OrderListVO> orderByAccountId = paymentInfoService.getPaymentInfo(queryPageByTimeDTO);
|
|
// List<OrderInfo> list = orderInfoService.listOrderByCreateTimeDesc();
|
|
return Response.success(orderByAccountId);
|
|
}
|
|
|
|
/**
|
|
* 查询本地订单状态
|
|
* @param orderNo
|
|
* @return
|
|
*/
|
|
@Operation(summary = "查询本地订单状态")
|
|
@GetMapping("/query-order-status/{orderNo}")
|
|
public Response<String> queryOrderStatus(@PathVariable String orderNo){
|
|
String orderStatus = orderInfoService.getOrderStatus(orderNo);
|
|
if(OrderStatusEnum.SUCCESS.getType().equals(orderStatus)){
|
|
return Response.success("支付成功"); //支付成功
|
|
}
|
|
return Response.success(101,"支付中......");
|
|
}
|
|
|
|
}
|