彭雪彬
2025-07-14 c1d20b425b10e8ba59f102dd1ab413055883eed0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
package com.oying.modules.sh.rest;
 
import com.oying.modules.sh.service.OrderOperationLogService;
import com.oying.modules.sh.domain.dto.OrderOperationLogQueryCriteria;
import com.oying.utils.R;
import lombok.RequiredArgsConstructor;
 
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.security.access.prepost.PreAuthorize;
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
 * @date 2025-06-11
 **/
@RestController
@RequiredArgsConstructor
@Api(tags = "SH:订单操作日志")
@RequestMapping("/api/orderOperationLog")
public class OrderOperationLogController {
 
    private final OrderOperationLogService orderOperationLogService;
 
    @ApiOperation("导出数据")
    @GetMapping(value = "/download")
    @PreAuthorize("@el.check('orderOperationLog:list')")
    public void exportOrderOperationLog(HttpServletResponse response, OrderOperationLogQueryCriteria criteria) throws IOException {
        orderOperationLogService.download(orderOperationLogService.queryAll(criteria), response);
    }
 
    @GetMapping
    @ApiOperation("查询订单操作日志")
    @PreAuthorize("@el.check('orderOperationLog:list')")
    public ResponseEntity<Object> queryOrderOperationLog(OrderOperationLogQueryCriteria criteria) {
        Page<Object> page = new Page<>(criteria.getPage(), criteria.getSize());
        return new ResponseEntity<>(R.success(orderOperationLogService.queryAll(criteria, page)), 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);
    }
}