|
|
@@ -1,8 +1,12 @@
|
|
1
|
1
|
package api.controller.order;
|
|
2
|
2
|
|
|
|
3
|
+import api.entity.database.system.SysAccessories;
|
|
3
|
4
|
import api.entity.database.system.User;
|
|
4
|
5
|
|
|
|
6
|
+import api.entity.view.order.WorkOrderOperateLogView;
|
|
5
|
7
|
import api.mapper.system.UserMapper;
|
|
|
8
|
+import api.service.system.IConfigService;
|
|
|
9
|
+import api.service.system.ISysAccessoriesService;
|
|
6
|
10
|
import com.alibaba.fastjson2.JSON;
|
|
7
|
11
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
8
|
12
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
@@ -22,6 +26,7 @@ import org.springframework.web.bind.annotation.*;
|
|
22
|
26
|
|
|
23
|
27
|
import java.util.ArrayList;
|
|
24
|
28
|
import java.util.Arrays;
|
|
|
29
|
+import java.util.HashMap;
|
|
25
|
30
|
import java.util.List;
|
|
26
|
31
|
|
|
27
|
32
|
@Api(value = "wo_operatelog",tags = "wo_operatelog")
|
|
|
@@ -30,10 +35,12 @@ import java.util.List;
|
|
30
|
35
|
public class WorkOrderOperateLogController extends BaseController {
|
|
31
|
36
|
@Autowired
|
|
32
|
37
|
private IWorkOrderOperateLogService workorderoperatelogService;
|
|
33
|
|
-
|
|
|
38
|
+ @Autowired
|
|
|
39
|
+ private ISysAccessoriesService sysaccessoriesService;
|
|
34
|
40
|
@Autowired
|
|
35
|
41
|
private UserMapper userMapper;
|
|
36
|
|
-
|
|
|
42
|
+ @Autowired
|
|
|
43
|
+ private IConfigService configService;
|
|
37
|
44
|
@ApiOperation("列表")
|
|
38
|
45
|
@Log(title = "查询wo_operatelog列表", businessType = BusinessType.QUERY)
|
|
39
|
46
|
@GetMapping
|
|
|
@@ -48,14 +55,30 @@ public class WorkOrderOperateLogController extends BaseController {
|
|
48
|
55
|
qw.eq(WorkOrderOperateLog::getIsdelete, 0);
|
|
49
|
56
|
qw.orderByDesc(WorkOrderOperateLog::getOperationtime);
|
|
50
|
57
|
Page<WorkOrderOperateLog> page = GetPage(pageInput);
|
|
|
58
|
+
|
|
|
59
|
+
|
|
51
|
60
|
if (page != null) {
|
|
52
|
61
|
IPage<WorkOrderOperateLog> iPage = workorderoperatelogService.getListPage(page, qw);
|
|
53
|
62
|
|
|
54
|
|
- return Success("成功", iPage.getRecords(), iPage.getTotal());
|
|
55
|
|
- } else {
|
|
|
63
|
+ List<WorkOrderOperateLog> returnlist = iPage.getRecords();
|
|
|
64
|
+ List<WorkOrderOperateLogView> logViews = new ArrayList<>();
|
|
|
65
|
+ //处理数据
|
|
|
66
|
+ if (returnlist != null && returnlist.size() > 0) {
|
|
|
67
|
+ for (WorkOrderOperateLog log : returnlist) {
|
|
|
68
|
+
|
|
|
69
|
+ WorkOrderOperateLogView ov = trans(log);
|
|
|
70
|
+
|
|
|
71
|
+
|
|
|
72
|
+ logViews.add(ov);
|
|
|
73
|
+ }
|
|
|
74
|
+ }
|
|
56
|
75
|
|
|
|
76
|
+ return Success("成功", logViews, iPage.getTotal());
|
|
|
77
|
+ } else {
|
|
57
|
78
|
return Success("成功", workorderoperatelogService.getList(qw));
|
|
58
|
79
|
}
|
|
|
80
|
+
|
|
|
81
|
+
|
|
59
|
82
|
}
|
|
60
|
83
|
|
|
61
|
84
|
@ApiOperation("详情")
|
|
|
@@ -77,6 +100,28 @@ public class WorkOrderOperateLogController extends BaseController {
|
|
77
|
100
|
}
|
|
78
|
101
|
}
|
|
79
|
102
|
|
|
|
103
|
+ public WorkOrderOperateLogView trans(WorkOrderOperateLog orderBase) {
|
|
|
104
|
+
|
|
|
105
|
+ WorkOrderOperateLogView ov = JSON.parseObject(JSON.toJSONString(orderBase), WorkOrderOperateLogView.class);
|
|
|
106
|
+
|
|
|
107
|
+ if (!StringHelper.isEmpty(orderBase.getFile())) {
|
|
|
108
|
+ String captchaEnabled = configService.selectCaptchaEnabled("FileUrl");
|
|
|
109
|
+ LambdaQueryWrapper<SysAccessories> qw = new LambdaQueryWrapper<>();
|
|
|
110
|
+ qw.in(SysAccessories::getFileid, orderBase.getFile());
|
|
|
111
|
+ List<SysAccessories> accessoriesList = sysaccessoriesService.getList(qw);
|
|
|
112
|
+ if (accessoriesList != null && accessoriesList.stream().count() > 0) {
|
|
|
113
|
+ HashMap<String, String> fileInfo = new HashMap<String, String>();
|
|
|
114
|
+ for (SysAccessories accessories : accessoriesList
|
|
|
115
|
+ ) {
|
|
|
116
|
+ fileInfo.put(accessories.getOriname(), accessories.getFileurl());
|
|
|
117
|
+ }
|
|
|
118
|
+ ov.setFileurl(fileInfo);
|
|
|
119
|
+ }
|
|
|
120
|
+
|
|
|
121
|
+ }
|
|
|
122
|
+ return ov;
|
|
|
123
|
+ }
|
|
|
124
|
+
|
|
80
|
125
|
}
|
|
81
|
126
|
|
|
82
|
127
|
|