| | |
| | | import com.oying.annotation.Log; |
| | | import com.oying.modules.sh.domain.OrderReturnProductSnapshot; |
| | | import com.oying.modules.sh.service.OrderReturnProductSnapshotService; |
| | | import com.oying.modules.sh.domain.dto.OrderReturnProductSnapshotQueryCriteria; |
| | | 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.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 |
| | |
| | | |
| | | private final OrderReturnProductSnapshotService orderReturnProductSnapshotService; |
| | | |
| | | @ApiOperation("导出数据") |
| | | @GetMapping(value = "/download") |
| | | @PreAuthorize("@el.check('orderReturnProductSnapshot:list')") |
| | | public void exportOrderReturnProductSnapshot(HttpServletResponse response, OrderReturnProductSnapshotQueryCriteria criteria) throws IOException { |
| | | orderReturnProductSnapshotService.download(orderReturnProductSnapshotService.queryAll(criteria), response); |
| | | } |
| | | |
| | | @GetMapping |
| | | @ApiOperation("查询退款订单商品快照") |
| | | @PreAuthorize("@el.check('orderReturnProductSnapshot:list')") |
| | | public ResponseEntity<Object> queryOrderReturnProductSnapshot(OrderReturnProductSnapshotQueryCriteria criteria) { |
| | | Page<Object> page = new Page<>(criteria.getPage(), criteria.getSize()); |
| | | return new ResponseEntity<>(R.success(orderReturnProductSnapshotService.queryAll(criteria, page)), HttpStatus.OK); |
| | | } |
| | | |
| | | @PostMapping |
| | | @Log("新增退款订单商品快照") |
| | | @ApiOperation("新增退款订单商品快照") |
| | | @PreAuthorize("@el.check('orderReturnProductSnapshot:add')") |
| | | public ResponseEntity<Object> createOrderReturnProductSnapshot(@Validated @RequestBody OrderReturnProductSnapshot resources) { |
| | | orderReturnProductSnapshotService.create(resources); |
| | | return new ResponseEntity<>(R.success(), HttpStatus.CREATED); |
| | | public ResponseEntity<Object> queryOrderReturnProductSnapshot(@RequestParam String returnNum) { |
| | | return new ResponseEntity<>(R.success(orderReturnProductSnapshotService.queryOrderReturnProductSnapshot(returnNum)), HttpStatus.OK); |
| | | } |
| | | |
| | | @PutMapping |
| | |
| | | public ResponseEntity<Object> updateOrderReturnProductSnapshot(@Validated @RequestBody OrderReturnProductSnapshot resources) { |
| | | orderReturnProductSnapshotService.update(resources); |
| | | return new ResponseEntity<>(R.success(), HttpStatus.NO_CONTENT); |
| | | } |
| | | |
| | | @DeleteMapping |
| | | @Log("删除退款订单商品快照") |
| | | @ApiOperation("删除退款订单商品快照") |
| | | @PreAuthorize("@el.check('orderReturnProductSnapshot:del')") |
| | | public ResponseEntity<Object> deleteOrderReturnProductSnapshot(@ApiParam(value = "传ID数组[]") @RequestBody List<Long> ids) { |
| | | orderReturnProductSnapshotService.deleteAll(ids); |
| | | return new ResponseEntity<>(R.success(), HttpStatus.OK); |
| | | } |
| | | } |