| | |
| | | package com.oying.modules.sh.rest; |
| | | |
| | | import com.oying.annotation.Log; |
| | | import com.oying.modules.sh.domain.OrderOperationLog; |
| | | import com.oying.modules.sh.service.OrderOperationLogService; |
| | | import com.oying.modules.sh.domain.dto.OrderOperationLogQueryCriteria; |
| | | 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('orderOperationLog:list')") |
| | | public ResponseEntity<PageResult<OrderOperationLog>> queryOrderOperationLog(OrderOperationLogQueryCriteria criteria){ |
| | | public ResponseEntity<Object> queryOrderOperationLog(OrderOperationLogQueryCriteria criteria) { |
| | | Page<Object> page = new Page<>(criteria.getPage(), criteria.getSize()); |
| | | return new ResponseEntity<>(orderOperationLogService.queryAll(criteria,page),HttpStatus.OK); |
| | | return new ResponseEntity<>(R.success(orderOperationLogService.queryAll(criteria, page)), HttpStatus.OK); |
| | | } |
| | | |
| | | @PostMapping |
| | | @Log("新增订单操作日志") |
| | | @ApiOperation("新增订单操作日志") |
| | | @PreAuthorize("@el.check('orderOperationLog:add')") |
| | | public ResponseEntity<Object> createOrderOperationLog(@Validated @RequestBody OrderOperationLog resources){ |
| | | orderOperationLogService.create(resources); |
| | | return new ResponseEntity<>(HttpStatus.CREATED); |
| | | } |
| | | |
| | | @PutMapping |
| | | @Log("修改订单操作日志") |
| | | @ApiOperation("修改订单操作日志") |
| | | @PreAuthorize("@el.check('orderOperationLog:edit')") |
| | | public ResponseEntity<Object> updateOrderOperationLog(@Validated @RequestBody OrderOperationLog resources){ |
| | | orderOperationLogService.update(resources); |
| | | return new ResponseEntity<>(HttpStatus.NO_CONTENT); |
| | | } |
| | | |
| | | @DeleteMapping |
| | | @Log("删除订单操作日志") |
| | | @ApiOperation("删除订单操作日志") |
| | | @PreAuthorize("@el.check('orderOperationLog:del')") |
| | | public ResponseEntity<Object> deleteOrderOperationLog(@ApiParam(value = "传ID数组[]") @RequestBody List<Long> ids) { |
| | | orderOperationLogService.deleteAll(ids); |
| | | return new ResponseEntity<>(HttpStatus.OK); |
| | | @GetMapping("getByOrderNum") |
| | | @ApiOperation("根据订单号查询订单操作日志") |
| | | @PreAuthorize("@el.check('orderOperationLog:list')") |
| | | public ResponseEntity<Object> queryOrderOperationLog(@RequestParam String orderNum) { |
| | | return new ResponseEntity<>(R.success(orderOperationLogService.getByOrderNum(orderNum)), HttpStatus.OK); |
| | | } |
| | | } |