|
@@ -5,9 +5,11 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
5
|
5
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
6
|
6
|
import com.njyunzhi.invoice.common.BaseController;
|
7
|
7
|
import com.njyunzhi.invoice.common.ResponseBean;
|
|
8
|
+import com.njyunzhi.invoice.mapper.TaInvoicePersonMapper;
|
8
|
9
|
import io.swagger.annotations.Api;
|
9
|
10
|
import io.swagger.annotations.ApiOperation;
|
10
|
11
|
import io.swagger.annotations.ApiParam;
|
|
12
|
+import org.junit.Test;
|
11
|
13
|
import org.slf4j.Logger;
|
12
|
14
|
import org.slf4j.LoggerFactory;
|
13
|
15
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -20,6 +22,8 @@ import com.njyunzhi.invoice.service.ITaInvoicePersonService;
|
20
|
22
|
import com.njyunzhi.invoice.entity.TaInvoicePerson;
|
21
|
23
|
import org.springframework.web.bind.annotation.RestController;
|
22
|
24
|
|
|
25
|
+import java.util.List;
|
|
26
|
+
|
23
|
27
|
/**
|
24
|
28
|
* <p>
|
25
|
29
|
* 报销人员 前端控制器
|
|
@@ -49,14 +53,14 @@ public class TaInvoicePersonController extends BaseController {
|
49
|
53
|
@RequestMapping(value="/admin/taInvoicePerson",method= RequestMethod.GET)
|
50
|
54
|
@ApiOperation(value="列表", notes = "列表", httpMethod = "GET", response = ResponseBean.class)
|
51
|
55
|
public ResponseBean taInvoicePersonList(@ApiParam("页码") @RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
|
52
|
|
- @ApiParam("单页数据量") @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize) throws Exception{
|
53
|
|
-
|
54
|
|
- IPage<TaInvoicePerson> pg = new Page<>(pageNum, pageSize);
|
55
|
|
- QueryWrapper<TaInvoicePerson> queryWrapper = new QueryWrapper<>();
|
56
|
|
- queryWrapper.orderByDesc("create_date");
|
57
|
|
-
|
58
|
|
- IPage<TaInvoicePerson> result = iTaInvoicePersonService.page(pg, queryWrapper);
|
59
|
|
- return ResponseBean.success(result);
|
|
56
|
+ @ApiParam("单页数据量") @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize,
|
|
57
|
+ @ApiParam("报销ID") @RequestParam(value ="invoiceId",defaultValue = "") String invoiceId) throws Exception{
|
|
58
|
+ IPage<TaInvoicePerson> pg = new Page<>(pageNum, pageSize);
|
|
59
|
+ QueryWrapper<TaInvoicePerson> queryWrapper = new QueryWrapper<>();
|
|
60
|
+ queryWrapper.eq("invoice_id", invoiceId);
|
|
61
|
+ queryWrapper.orderByDesc("create_date");
|
|
62
|
+ IPage<TaInvoicePerson> result = iTaInvoicePersonService.page(pg,queryWrapper);
|
|
63
|
+ return ResponseBean.success(result);
|
60
|
64
|
}
|
61
|
65
|
|
62
|
66
|
/**
|
|
@@ -81,7 +85,7 @@ public class TaInvoicePersonController extends BaseController {
|
81
|
85
|
*/
|
82
|
86
|
@RequestMapping(value="/admin/taInvoicePerson/{id}", method= RequestMethod.DELETE)
|
83
|
87
|
@ApiOperation(value="删除", notes = "删除", httpMethod = "DELETE", response = ResponseBean.class)
|
84
|
|
- public ResponseBean taInvoicePersonDelete(@ApiParam("对象ID") @PathVariable Integer id) throws Exception{
|
|
88
|
+ public ResponseBean taInvoicePersonDelete(@ApiParam("对象ID") @PathVariable String id) throws Exception{
|
85
|
89
|
if(iTaInvoicePersonService.removeById(id)){
|
86
|
90
|
return ResponseBean.success("success");
|
87
|
91
|
}else {
|
|
@@ -97,7 +101,7 @@ public class TaInvoicePersonController extends BaseController {
|
97
|
101
|
*/
|
98
|
102
|
@RequestMapping(value="/admin/taInvoicePerson/{id}",method= RequestMethod.PUT)
|
99
|
103
|
@ApiOperation(value="更新", notes = "更新", httpMethod = "PUT", response = ResponseBean.class)
|
100
|
|
- public ResponseBean taInvoicePersonUpdate(@ApiParam("对象ID") @PathVariable Integer id,
|
|
104
|
+ public ResponseBean taInvoicePersonUpdate(@ApiParam("对象ID") @PathVariable String id,
|
101
|
105
|
@ApiParam("更新内容") @RequestBody TaInvoicePerson taInvoicePerson) throws Exception{
|
102
|
106
|
|
103
|
107
|
if (iTaInvoicePersonService.updateById(taInvoicePerson)){
|
|
@@ -113,7 +117,7 @@ public class TaInvoicePersonController extends BaseController {
|
113
|
117
|
*/
|
114
|
118
|
@RequestMapping(value="/admin/taInvoicePerson/{id}",method= RequestMethod.GET)
|
115
|
119
|
@ApiOperation(value="详情", notes = "详情", httpMethod = "GET", response = ResponseBean.class)
|
116
|
|
- public ResponseBean taInvoicePersonGet(@ApiParam("对象ID") @PathVariable Integer id) throws Exception{
|
|
120
|
+ public ResponseBean taInvoicePersonGet(@ApiParam("对象ID") @PathVariable String id) throws Exception{
|
117
|
121
|
return ResponseBean.success(iTaInvoicePersonService.getById(id));
|
118
|
122
|
}
|
119
|
123
|
}
|