From 5df7e1b117d15f3ac1cf398ce2b0c17290774ade Mon Sep 17 00:00:00 2001 From: xin <1099200748@qq.com> Date: Mon, 14 Jul 2025 21:07:01 +0800 Subject: [PATCH] 订单流程 --- oying-system/src/main/java/com/oying/modules/sh/rest/OrderProductSnapshotController.java | 42 ++++-------------------------------------- 1 files changed, 4 insertions(+), 38 deletions(-) diff --git a/oying-system/src/main/java/com/oying/modules/sh/rest/OrderProductSnapshotController.java b/oying-system/src/main/java/com/oying/modules/sh/rest/OrderProductSnapshotController.java index 24bdc0d..4530653 100644 --- a/oying-system/src/main/java/com/oying/modules/sh/rest/OrderProductSnapshotController.java +++ b/oying-system/src/main/java/com/oying/modules/sh/rest/OrderProductSnapshotController.java @@ -3,10 +3,8 @@ import com.oying.annotation.Log; import com.oying.modules.sh.domain.OrderProductSnapshot; import com.oying.modules.sh.service.OrderProductSnapshotService; -import com.oying.modules.sh.domain.dto.OrderProductSnapshotQueryCriteria; +import com.oying.utils.R; import lombok.RequiredArgsConstructor; - -import java.util.List; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; @@ -14,11 +12,6 @@ import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; import io.swagger.annotations.*; - -import java.io.IOException; -import javax.servlet.http.HttpServletResponse; - -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; /** * @author lixin @@ -32,28 +25,10 @@ private final OrderProductSnapshotService orderProductSnapshotService; - @ApiOperation("导出数据") - @GetMapping(value = "/download") - @PreAuthorize("@el.check('orderProductSnapshot:list')") - public void exportOrderProductSnapshot(HttpServletResponse response, OrderProductSnapshotQueryCriteria criteria) throws IOException { - orderProductSnapshotService.download(orderProductSnapshotService.queryAll(criteria), response); - } - @GetMapping - @ApiOperation("查询订单商品快照") - @PreAuthorize("@el.check('orderProductSnapshot:list')") - public ResponseEntity<Object> queryOrderProductSnapshot(OrderProductSnapshotQueryCriteria criteria) { - Page<Object> page = new Page<>(criteria.getPage(), criteria.getSize()); - return new ResponseEntity<>(orderProductSnapshotService.queryAll(criteria, page), HttpStatus.OK); - } - - @PostMapping - @Log("新增订单商品快照") - @ApiOperation("新增订单商品快照") - @PreAuthorize("@el.check('orderProductSnapshot:add')") - public ResponseEntity<Object> createOrderProductSnapshot(@Validated @RequestBody OrderProductSnapshot resources) { - orderProductSnapshotService.create(resources); - return new ResponseEntity<>(HttpStatus.CREATED); + @ApiOperation("根据订单号查询订单商品快照") + public ResponseEntity<Object> queryOrderProductSnapshot(@RequestParam String orderNum) { + return new ResponseEntity<>(R.success(orderProductSnapshotService.queryOrderProductSnapshot(orderNum)), HttpStatus.OK); } @PutMapping @@ -63,14 +38,5 @@ public ResponseEntity<Object> updateOrderProductSnapshot(@Validated @RequestBody OrderProductSnapshot resources) { orderProductSnapshotService.update(resources); return new ResponseEntity<>(HttpStatus.NO_CONTENT); - } - - @DeleteMapping - @Log("删除订单商品快照") - @ApiOperation("删除订单商品快照") - @PreAuthorize("@el.check('orderProductSnapshot:del')") - public ResponseEntity<Object> deleteOrderProductSnapshot(@ApiParam(value = "传ID数组[]") @RequestBody List<Long> ids) { - orderProductSnapshotService.deleteAll(ids); - return new ResponseEntity<>(HttpStatus.OK); } } -- Gitblit v1.9.3