| | |
| | | package com.oying.modules.sh.rest; |
| | | |
| | | import com.oying.annotation.Log; |
| | | import com.oying.exception.BadRequestException; |
| | | 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; |
| | |
| | | return new ResponseEntity<>(R.success(orderService.queryAll(criteria, page)), HttpStatus.OK); |
| | | } |
| | | |
| | | @GetMapping("app") |
| | | @ApiOperation("APP:查询订单信息") |
| | | @PreAuthorize("@el.check('order:list')") |
| | | public ResponseEntity<Object> appQueryOrder(OrderQueryCriteria criteria) { |
| | | if (criteria.getStoreId() == null) { |
| | | throw new BadRequestException("请选择门店"); |
| | | } |
| | | Page<Object> page = new Page<>(criteria.getPage(), criteria.getSize()); |
| | | return new ResponseEntity<>(R.success(orderService.queryAll(criteria, page)), HttpStatus.OK); |
| | | } |
| | | |
| | | @GetMapping("mini") |
| | | @ApiOperation("小程序:查询订单信息列") |
| | | public ResponseEntity<Object> miniQueryOrder(OrderQueryCriteria criteria) { |
| | |
| | | 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") |
| | | @Log("小程序:生成确认订单") |
| | | @ApiOperation("小程序:生成确认订单") |
| | |
| | | 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("小程序:提交订单") |