彭雪彬
2025-07-22 ce7bf2e6ff801146d2ee02825b23d186e110c523
oying-system/src/main/java/com/oying/modules/sh/rest/OrderAddressSnapshotController.java
@@ -3,11 +3,8 @@
import com.oying.annotation.Log;
import com.oying.modules.sh.domain.OrderAddressSnapshot;
import com.oying.modules.sh.service.OrderAddressSnapshotService;
import com.oying.modules.sh.domain.dto.OrderAddressSnapshotQueryCriteria;
import com.oying.utils.R;
import lombok.RequiredArgsConstructor;
import java.util.List;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
@@ -15,11 +12,6 @@
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
@@ -33,28 +25,10 @@
    private final OrderAddressSnapshotService orderAddressSnapshotService;
    @ApiOperation("导出数据")
    @GetMapping(value = "/download")
    @PreAuthorize("@el.check('orderAddressSnapshot:list')")
    public void exportOrderAddressSnapshot(HttpServletResponse response, OrderAddressSnapshotQueryCriteria criteria) throws IOException {
        orderAddressSnapshotService.download(orderAddressSnapshotService.queryAll(criteria), response);
    }
    @GetMapping
    @ApiOperation("查询订单地址快照")
    @PreAuthorize("@el.check('orderAddressSnapshot:list')")
    public ResponseEntity<Object> queryOrderAddressSnapshot(OrderAddressSnapshotQueryCriteria criteria) {
        Page<Object> page = new Page<>(criteria.getPage(), criteria.getSize());
        return new ResponseEntity<>(R.success(orderAddressSnapshotService.queryAll(criteria, page)), HttpStatus.OK);
    }
    @PostMapping
    @Log("新增订单地址快照")
    @ApiOperation("新增订单地址快照")
    @PreAuthorize("@el.check('orderAddressSnapshot:add')")
    public ResponseEntity<Object> createOrderAddressSnapshot(@Validated @RequestBody OrderAddressSnapshot resources) {
        orderAddressSnapshotService.create(resources);
        return new ResponseEntity<>(R.success(), HttpStatus.CREATED);
    @ApiOperation("根据订单号查询订单地址快照")
    public ResponseEntity<Object> queryByOrderNum(@RequestParam String orderNum) {
        return new ResponseEntity<>(R.success(orderAddressSnapshotService.queryByOrderNum(orderNum)), HttpStatus.OK);
    }
    @PutMapping
@@ -64,14 +38,5 @@
    public ResponseEntity<Object> updateOrderAddressSnapshot(@Validated @RequestBody OrderAddressSnapshot resources) {
        orderAddressSnapshotService.update(resources);
        return new ResponseEntity<>(R.success(), HttpStatus.NO_CONTENT);
    }
    @DeleteMapping
    @Log("删除订单地址快照")
    @ApiOperation("删除订单地址快照")
    @PreAuthorize("@el.check('orderAddressSnapshot:del')")
    public ResponseEntity<Object> deleteOrderAddressSnapshot(@ApiParam(value = "传ID数组[]") @RequestBody List<Long> ids) {
        orderAddressSnapshotService.deleteAll(ids);
        return new ResponseEntity<>(R.success(), HttpStatus.OK);
    }
}