|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+package api.controller.order;
|
|
|
2
|
+
|
|
|
3
|
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
4
|
+import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
5
|
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
6
|
+import api.controller.BaseController;
|
|
|
7
|
+import api.entity.database.order.WorkOrderVisitLog;
|
|
|
8
|
+import api.entity.input.PageInput;
|
|
|
9
|
+import api.model.AjaxResult;
|
|
|
10
|
+import api.service.order.IWorkOrderVisitLogService;
|
|
|
11
|
+import api.util.annotation.Log;
|
|
|
12
|
+import api.util.enums.BusinessType;
|
|
|
13
|
+import api.util.helper.StringHelper;
|
|
|
14
|
+import io.swagger.annotations.Api;
|
|
|
15
|
+import io.swagger.annotations.ApiOperation;
|
|
|
16
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
17
|
+import org.springframework.web.bind.annotation.*;
|
|
|
18
|
+import java.util.Arrays;
|
|
|
19
|
+
|
|
|
20
|
+@Api(value = "wo_visitlog",tags = "wo_visitlog")
|
|
|
21
|
+@RestController
|
|
|
22
|
+@RequestMapping("/order/workordervisitlog")
|
|
|
23
|
+public class WorkOrderVisitLogController extends BaseController {
|
|
|
24
|
+ @Autowired
|
|
|
25
|
+ private IWorkOrderVisitLogService workordervisitlogService;
|
|
|
26
|
+
|
|
|
27
|
+ @ApiOperation("列表")
|
|
|
28
|
+ @Log(title = "查询wo_visitlog列表",businessType = BusinessType.QUERY)
|
|
|
29
|
+ @GetMapping
|
|
|
30
|
+ public AjaxResult getList(WorkOrderVisitLog input, PageInput pageInput) {
|
|
|
31
|
+ LambdaQueryWrapper<WorkOrderVisitLog> qw = new LambdaQueryWrapper();
|
|
|
32
|
+ qw.eq(input.getVisitId() != null && input.getVisitId() > 0, WorkOrderVisitLog::getVisitId, input.getVisitId());
|
|
|
33
|
+ qw.like(!StringHelper.isEmpty(input.getWorkordercode()), WorkOrderVisitLog::getWorkordercode, input.getWorkordercode());
|
|
|
34
|
+ qw.eq(input.getMyd() != null && input.getMyd() > 0, WorkOrderVisitLog::getMyd, input.getMyd());
|
|
|
35
|
+ qw.like(!StringHelper.isEmpty(input.getContent()), WorkOrderVisitLog::getContent, input.getContent());
|
|
|
36
|
+ qw.like(!StringHelper.isEmpty(input.getCallid()), WorkOrderVisitLog::getCallid, input.getCallid());
|
|
|
37
|
+ qw.eq(input.getCreatetime() != null , WorkOrderVisitLog::getCreatetime, input.getCreatetime());
|
|
|
38
|
+ qw.like(!StringHelper.isEmpty(input.getOperator()), WorkOrderVisitLog::getOperator, input.getOperator());
|
|
|
39
|
+ qw.like(!StringHelper.isEmpty(input.getOperatorname()), WorkOrderVisitLog::getOperatorname, input.getOperatorname());
|
|
|
40
|
+ Page<WorkOrderVisitLog> page = GetPage(pageInput);
|
|
|
41
|
+ if (page != null) {
|
|
|
42
|
+ IPage<WorkOrderVisitLog> iPage = workordervisitlogService.getListPage(page, qw);
|
|
|
43
|
+ return Success("成功", iPage.getRecords(), iPage.getTotal());
|
|
|
44
|
+ } else {
|
|
|
45
|
+ return Success("成功", workordervisitlogService.getList(qw));
|
|
|
46
|
+ }
|
|
|
47
|
+ }
|
|
|
48
|
+
|
|
|
49
|
+ @ApiOperation("详情")
|
|
|
50
|
+ @Log(title = "查询wo_visitlog详情",businessType = BusinessType.QUERY)
|
|
|
51
|
+ @GetMapping("/{id}")
|
|
|
52
|
+ public AjaxResult getInfo(@PathVariable long id) {
|
|
|
53
|
+ return Success("成功", workordervisitlogService.getEntity(id));
|
|
|
54
|
+ }
|
|
|
55
|
+
|
|
|
56
|
+ @ApiOperation("新增")
|
|
|
57
|
+ @Log(title = "新增wo_visitlog",businessType = BusinessType.INSERT)
|
|
|
58
|
+ @PostMapping
|
|
|
59
|
+ public AjaxResult add(@RequestBody WorkOrderVisitLog input) {
|
|
|
60
|
+ boolean result = workordervisitlogService.insert(input);
|
|
|
61
|
+ if (result) {
|
|
|
62
|
+ return Success("成功");
|
|
|
63
|
+ } else {
|
|
|
64
|
+ return Error("新增失败");
|
|
|
65
|
+ }
|
|
|
66
|
+ }
|
|
|
67
|
+
|
|
|
68
|
+ @ApiOperation("编辑")
|
|
|
69
|
+ @Log(title = "编辑wo_visitlog",businessType = BusinessType.UPDATE)
|
|
|
70
|
+ @PutMapping
|
|
|
71
|
+ public AjaxResult edit(@RequestBody WorkOrderVisitLog input) {
|
|
|
72
|
+ boolean result = workordervisitlogService.update(input);
|
|
|
73
|
+ if (result) {
|
|
|
74
|
+ return Success("成功");
|
|
|
75
|
+ } else {
|
|
|
76
|
+ return Error("修改失败");
|
|
|
77
|
+ }
|
|
|
78
|
+ }
|
|
|
79
|
+
|
|
|
80
|
+ @ApiOperation("删除")
|
|
|
81
|
+ @Log(title = "删除wo_visitlog",businessType = BusinessType.DELETE)
|
|
|
82
|
+ @DeleteMapping("/{ids}")
|
|
|
83
|
+ public AjaxResult delete(@PathVariable Long[] ids) {
|
|
|
84
|
+ boolean result = workordervisitlogService.delete(Arrays.asList(ids));
|
|
|
85
|
+ if (result) {
|
|
|
86
|
+ return Success("成功");
|
|
|
87
|
+ } else {
|
|
|
88
|
+ return Error("删除失败");
|
|
|
89
|
+ }
|
|
|
90
|
+ }
|
|
|
91
|
+
|
|
|
92
|
+}
|