2024-02-14 12:10:15 +08:00
|
|
|
package com.ai.da.controller;
|
|
|
|
|
|
|
|
|
|
import com.ai.da.common.enums.OrderStatusEnum;
|
2024-03-15 15:38:56 +08:00
|
|
|
import com.ai.da.common.response.PageBaseResponse;
|
2024-02-14 12:10:15 +08:00
|
|
|
import com.ai.da.common.response.Response;
|
2024-02-20 10:35:50 +08:00
|
|
|
import com.ai.da.mapper.primary.entity.OrderInfo;
|
2024-03-15 15:38:56 +08:00
|
|
|
import com.ai.da.model.dto.QueryPageByTimeDTO;
|
2024-02-14 12:10:15 +08:00
|
|
|
import com.ai.da.service.OrderInfoService;
|
|
|
|
|
import io.swagger.annotations.Api;
|
|
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
2024-03-15 15:38:56 +08:00
|
|
|
import javax.validation.Valid;
|
2024-02-14 12:10:15 +08:00
|
|
|
|
|
|
|
|
@CrossOrigin //开放前端的跨域访问
|
|
|
|
|
@Api(tags = "商品订单管理")
|
|
|
|
|
@RestController
|
|
|
|
|
@RequestMapping("/api/order-info")
|
|
|
|
|
public class OrderInfoController {
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
private OrderInfoService orderInfoService;
|
|
|
|
|
|
|
|
|
|
@ApiOperation("订单列表")
|
2024-03-15 15:38:56 +08:00
|
|
|
@PostMapping("/list")
|
|
|
|
|
public Response<PageBaseResponse<OrderInfo>> list(@Valid @RequestBody QueryPageByTimeDTO queryPageByTimeDTO){
|
|
|
|
|
PageBaseResponse<OrderInfo> orderByAccountId = orderInfoService.getOrderByPage(queryPageByTimeDTO);
|
2024-03-01 17:31:26 +08:00
|
|
|
// List<OrderInfo> list = orderInfoService.listOrderByCreateTimeDesc();
|
|
|
|
|
return Response.success(orderByAccountId);
|
2024-02-14 12:10:15 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 查询本地订单状态
|
|
|
|
|
* @param orderNo
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
@ApiOperation("查询本地订单状态")
|
|
|
|
|
@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,"支付中......");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|