OrderController.java
3.26 KB
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
package com.order.erp.controller;
import com.order.erp.common.annotation.AnonymousAccess;
import com.order.erp.common.constant.ServerResult;
import com.order.erp.common.excel4j.exceptions.Excel4JException;
import com.order.erp.domain.vo.order.*;
import com.order.erp.service.order.OrderBaseInfoService;
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;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
/**
* 订单基础信息表(OrderBaseInfo)表控制层
*
* @author makejava
* @since 2023-09-08 15:26:43
*/
@RestController
@RequestMapping("/order/erp/order")
public class OrderController {
/**
* 服务对象
*/
@Resource
private OrderBaseInfoService orderBaseInfoService;
/**
* 分页查询
*
* @param orderBaseInfoQueryVO 查询条件
* @return 查询结果
*/
@PostMapping("/list_by_page")
@AnonymousAccess
public ServerResult listByPage(@RequestBody @Validated OrderBaseInfoQueryVO orderBaseInfoQueryVO) {
return orderBaseInfoService.listByPage(orderBaseInfoQueryVO);
}
/**
* 导出订单
*
* @param orderBaseInfoQueryVO 查询条件
* @return 查询结果
*/
@PostMapping("/export")
@AnonymousAccess
public ServerResult export(HttpServletResponse response, @RequestBody @Validated OrderBaseInfoQueryVO orderBaseInfoQueryVO) throws IOException, Excel4JException {
return orderBaseInfoService.export(response, orderBaseInfoQueryVO);
}
/**
* 通过主键查询单条数据
*
* @param orderBaseInfoQueryVO 查询条件
* @return 单条数据
*/
@PostMapping("/query_by_id")
public ServerResult queryById(@RequestBody OrderBaseInfoQueryVO orderBaseInfoQueryVO) {
return orderBaseInfoService.queryById(orderBaseInfoQueryVO);
}
/**
* 新增数据
*
* @param orderAddVO 数据VO
* @return 新增结果
*/
@PostMapping("/add")
@AnonymousAccess
public ServerResult add(@RequestBody OrderAddVO orderAddVO) {
return orderBaseInfoService.add(orderAddVO);
}
/**
* 字段解锁申请
*
* @param fieldVO 查询条件
* @return 查询结果
*/
@PostMapping("/field_unlock_apply")
@AnonymousAccess
public ServerResult fieldUnlockApply(@RequestBody @Validated OrderUnlockFieldApplyVO fieldVO) {
return orderBaseInfoService.fieldUnlockApply(fieldVO);
}
/**
* 编辑数据
*
* @param updateVO 数据VO
* @return 编辑结果
*/
@PostMapping("/edit")
public ServerResult edit(@RequestBody OrderUpdateVO updateVO) {
return orderBaseInfoService.edit(updateVO);
}
/**
* 删除数据
*
* @param orderBaseInfoQueryVO 查询条件
* @return 删除是否成功
*/
@PostMapping("/delete_by_id")
public ServerResult deleteById(@RequestBody OrderBaseInfoQueryVO orderBaseInfoQueryVO) {
return orderBaseInfoService.deleteById(orderBaseInfoQueryVO);
}
}