| | |
| | | import com.oying.modules.sh.domain.Order; |
| | | import com.oying.modules.sh.service.OrderService; |
| | | import com.oying.modules.sh.domain.dto.OrderQueryCriteria; |
| | | import com.oying.utils.R; |
| | | import lombok.RequiredArgsConstructor; |
| | | |
| | | import java.util.List; |
| | | |
| | | import org.springframework.http.HttpStatus; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | 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; |
| | | import com.oying.utils.PageResult; |
| | | |
| | | /** |
| | | * @author lixin |
| | | * @date 2025-06-11 |
| | | **/ |
| | | * @author lixin |
| | | * @date 2025-06-11 |
| | | **/ |
| | | @RestController |
| | | @RequiredArgsConstructor |
| | | @Api(tags = "SH:订单信息") |
| | |
| | | @GetMapping |
| | | @ApiOperation("查询订单信息") |
| | | @PreAuthorize("@el.check('order:list')") |
| | | public ResponseEntity<PageResult<Order>> queryOrder(OrderQueryCriteria criteria){ |
| | | public ResponseEntity<Object> queryOrder(OrderQueryCriteria criteria) { |
| | | Page<Object> page = new Page<>(criteria.getPage(), criteria.getSize()); |
| | | return new ResponseEntity<>(orderService.queryAll(criteria,page),HttpStatus.OK); |
| | | return new ResponseEntity<>(R.success(orderService.queryAll(criteria, page)), HttpStatus.OK); |
| | | } |
| | | |
| | | @PostMapping |
| | | @Log("新增订单信息") |
| | | @ApiOperation("新增订单信息") |
| | | @PreAuthorize("@el.check('order:add')") |
| | | public ResponseEntity<Object> createOrder(@Validated @RequestBody Order resources){ |
| | | public ResponseEntity<Object> createOrder(@Validated @RequestBody Order resources) { |
| | | orderService.create(resources); |
| | | return new ResponseEntity<>(HttpStatus.CREATED); |
| | | return new ResponseEntity<>(R.success(), HttpStatus.CREATED); |
| | | } |
| | | |
| | | @PutMapping |
| | | @Log("修改订单信息") |
| | | @ApiOperation("修改订单信息") |
| | | @PreAuthorize("@el.check('order:edit')") |
| | | public ResponseEntity<Object> updateOrder(@Validated @RequestBody Order resources){ |
| | | public ResponseEntity<Object> updateOrder(@Validated @RequestBody Order resources) { |
| | | orderService.update(resources); |
| | | return new ResponseEntity<>(HttpStatus.NO_CONTENT); |
| | | return new ResponseEntity<>(R.success(), HttpStatus.NO_CONTENT); |
| | | } |
| | | |
| | | @DeleteMapping |
| | |
| | | @PreAuthorize("@el.check('order:del')") |
| | | public ResponseEntity<Object> deleteOrder(@ApiParam(value = "传ID数组[]") @RequestBody List<Long> ids) { |
| | | orderService.deleteAll(ids); |
| | | return new ResponseEntity<>(HttpStatus.OK); |
| | | return new ResponseEntity<>(R.success(), HttpStatus.OK); |
| | | } |
| | | } |