Blame view

src/main/java/com/order/erp/controller/OrderController.java 3.75 KB
“谢茂盛” authored
1
2
3
4
package com.order.erp.controller;

import com.order.erp.common.annotation.AnonymousAccess;
import com.order.erp.common.constant.ServerResult;
5
import com.order.erp.common.excel4j.exceptions.Excel4JException;
6
7
8
9
import com.order.erp.domain.vo.order.OrderAddVO;
import com.order.erp.domain.vo.order.OrderBaseInfoQueryVO;
import com.order.erp.domain.vo.order.OrderUnlockFieldApplyVO;
import com.order.erp.domain.vo.order.OrderUpdateVO;
“谢茂盛” authored
10
import com.order.erp.service.order.OrderBaseInfoService;
谢茂盛 authored
11
12
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
“谢茂盛” authored
13
14
15
16
17
18
19
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
20
21
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
“谢茂盛” authored
22
23
24
25
26
27
28

/**
 * 订单基础信息表(OrderBaseInfo)表控制层
 *
 * @author makejava
 * @since 2023-09-08 15:26:43
 */
谢茂盛 authored
29
@Api(tags = "订单管理")
“谢茂盛” authored
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
@RestController
@RequestMapping("/order/erp/order")
public class OrderController {
    /**
     * 服务对象
     */
    @Resource
    private OrderBaseInfoService orderBaseInfoService;

    /**
     * 分页查询
     *
     * @param orderBaseInfoQueryVO 查询条件
     * @return 查询结果
     */
    @PostMapping("/list_by_page")
谢茂盛 authored
46
    @ApiOperation("分页查询")
“谢茂盛” authored
47
48
49
50
51
52
    @AnonymousAccess
    public ServerResult listByPage(@RequestBody @Validated OrderBaseInfoQueryVO orderBaseInfoQueryVO) {
        return orderBaseInfoService.listByPage(orderBaseInfoQueryVO);
    }

    /**
53
54
55
56
57
     * 导出订单
     *
     * @param orderBaseInfoQueryVO 查询条件
     * @return 查询结果
     */
58
    @PostMapping(value = "/export")
谢茂盛 authored
59
    @ApiOperation("导出订单")
60
    @AnonymousAccess
61
62
    public void export(HttpServletResponse response, @RequestBody @Validated OrderBaseInfoQueryVO orderBaseInfoQueryVO) throws IOException, Excel4JException {
        orderBaseInfoService.export(response, orderBaseInfoQueryVO);
63
64
65
    }

    /**
“谢茂盛” authored
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
     * 通过主键查询单条数据
     *
     * @param orderBaseInfoQueryVO 查询条件
     * @return 单条数据
     */
    @PostMapping("/query_by_id")
    public ServerResult queryById(@RequestBody OrderBaseInfoQueryVO orderBaseInfoQueryVO) {
        return orderBaseInfoService.queryById(orderBaseInfoQueryVO);
    }

    /**
     * 新增数据
     *
     * @param orderAddVO 数据VO
     * @return 新增结果
     */
    @PostMapping("/add")
谢茂盛 authored
83
    @ApiOperation("新增数据")
“谢茂盛” authored
84
85
86
87
88
89
    @AnonymousAccess
    public ServerResult add(@RequestBody OrderAddVO orderAddVO) {
        return orderBaseInfoService.add(orderAddVO);
    }

    /**
“谢茂盛” authored
90
91
92
93
94
95
     * 字段解锁申请
     *
     * @param fieldVO 查询条件
     * @return 查询结果
     */
    @PostMapping("/field_unlock_apply")
谢茂盛 authored
96
    @ApiOperation("字段解锁申请")
“谢茂盛” authored
97
98
99
100
101
102
103
    @AnonymousAccess
    public ServerResult fieldUnlockApply(@RequestBody @Validated OrderUnlockFieldApplyVO fieldVO) {
        return orderBaseInfoService.fieldUnlockApply(fieldVO);
    }


    /**
“谢茂盛” authored
104
105
     * 编辑数据
     *
106
     * @param updateVO 数据VO
“谢茂盛” authored
107
108
     * @return 编辑结果
     */
谢茂盛 authored
109
    @ApiOperation("编辑数据")
“谢茂盛” authored
110
    @PostMapping("/edit")
111
112
    public ServerResult edit(@RequestBody OrderUpdateVO updateVO) {
        return orderBaseInfoService.edit(updateVO);
“谢茂盛” authored
113
114
115
116
117
118
119
120
    }

    /**
     * 删除数据
     *
     * @param orderBaseInfoQueryVO 查询条件
     * @return 删除是否成功
     */
谢茂盛 authored
121
    @ApiOperation("删除数据")
“谢茂盛” authored
122
123
124
125
126
127
128
    @PostMapping("/delete_by_id")
    public ServerResult deleteById(@RequestBody OrderBaseInfoQueryVO orderBaseInfoQueryVO) {
        return orderBaseInfoService.deleteById(orderBaseInfoQueryVO);
    }

}