| | |
| | | package com.oying.modules.sh.rest; |
| | | |
| | | import com.oying.annotation.Log; |
| | | import com.oying.modules.sh.domain.Order; |
| | | import com.oying.modules.sh.domain.request.GeneratorOrder; |
| | | import com.oying.modules.sh.domain.request.StatusOrder; |
| | | import com.oying.modules.sh.domain.request.SubmitOrder; |
| | | import com.oying.modules.sh.service.OrderService; |
| | | import com.oying.modules.sh.domain.dto.OrderQueryCriteria; |
| | |
| | | import io.swagger.annotations.*; |
| | | |
| | | import java.io.IOException; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | |
| | | } |
| | | |
| | | @GetMapping("mini") |
| | | @ApiOperation("小程序:查询订单信息") |
| | | @ApiOperation("小程序:查询订单信息列") |
| | | public ResponseEntity<Object> miniQueryOrder(OrderQueryCriteria criteria) { |
| | | Page<Object> page = new Page<>(criteria.getPage(), criteria.getSize()); |
| | | criteria.setUserId(SecurityUtils.getCurrentUserId()); |
| | | return new ResponseEntity<>(R.success(orderService.queryAll(criteria, page)), HttpStatus.OK); |
| | | } |
| | | |
| | | @PostMapping |
| | | @Log("新增订单信息") |
| | | @ApiOperation("新增订单信息") |
| | | @PreAuthorize("@el.check('order:add')") |
| | | public ResponseEntity<Object> create(@Validated @RequestBody Order order) { |
| | | orderService.create(order); |
| | | return new ResponseEntity<>(R.success(), HttpStatus.CREATED); |
| | | } |
| | | |
| | | @PostMapping("generator") |
| | |
| | | return new ResponseEntity<>(R.success(orderService.generatorOrder(generator)), HttpStatus.CREATED); |
| | | } |
| | | |
| | | @PostMapping("status") |
| | | @Log("更新订单状态") |
| | | @ApiOperation("更新订单状态") |
| | | public ResponseEntity<Object> statusOrder(@Validated @RequestBody StatusOrder statusOrder) { |
| | | orderService.statusOrder(statusOrder); |
| | | return new ResponseEntity<>(R.success(), HttpStatus.CREATED); |
| | | } |
| | | |
| | | @PostMapping("submit") |
| | | @Log("小程序:提交订单") |
| | | @ApiOperation("小程序:提交订单") |
| | | public ResponseEntity<Object> submitOrder(@Validated @RequestBody SubmitOrder submit) { |
| | | return new ResponseEntity<>(R.success(orderService.submitOrder(submit)), HttpStatus.CREATED); |
| | | public ResponseEntity<Object> submitOrder(@Validated @RequestBody SubmitOrder submit, HttpServletRequest request) { |
| | | return new ResponseEntity<>(R.success(orderService.submitOrder(submit, request)), HttpStatus.CREATED); |
| | | } |
| | | |
| | | @DeleteMapping |
| | |
| | | orderService.deleteAll(ids); |
| | | return new ResponseEntity<>(R.success(), HttpStatus.OK); |
| | | } |
| | | |
| | | @Log("用户取消订单") |
| | | @ApiOperation("用户取消订单") |
| | | @PostMapping(value = "/cancel") |
| | | public ResponseEntity<Object> cancel(@RequestParam String orderNum) { |
| | | orderService.cancel(orderNum); |
| | | return new ResponseEntity<>(R.success(), HttpStatus.OK); |
| | | } |
| | | |
| | | @ApiOperation("订单号查询订单") |
| | | @GetMapping(value = "/getByOrderNum") |
| | | public ResponseEntity<Object> getByOrderNum(@RequestParam String orderNum) { |
| | | return new ResponseEntity<>(R.success(orderService.getByOrderNum(orderNum)), HttpStatus.OK); |
| | | } |
| | | } |