|
|
@@ -59,14 +59,15 @@ public class WorkOrderBaseController extends BaseController {
|
|
59
|
59
|
private UserMapper userMapper;
|
|
60
|
60
|
@Autowired
|
|
61
|
61
|
private IWorkOrderOperateLogService workorderoperatelogService;
|
|
62
|
|
-
|
|
|
62
|
+ @Autowired
|
|
|
63
|
+ private IRoleService roleService;
|
|
63
|
64
|
@Autowired
|
|
64
|
65
|
private ISysAccessoriesService sysaccessoriesService;
|
|
65
|
66
|
|
|
66
|
67
|
@ApiOperation("列表")
|
|
67
|
68
|
@Log(title = "查询wo_workorderbase列表", businessType = BusinessType.QUERY)
|
|
68
|
69
|
@GetMapping
|
|
69
|
|
- @Anonymous
|
|
|
70
|
+
|
|
70
|
71
|
|
|
71
|
72
|
public AjaxResult getList(WorkOrderBase input, PageInput pageInput) {
|
|
72
|
73
|
LambdaQueryWrapper<WorkOrderBase> qw = new LambdaQueryWrapper();
|
|
|
@@ -79,14 +80,21 @@ public class WorkOrderBaseController extends BaseController {
|
|
79
|
80
|
qw.like(!StringHelper.isEmpty(input.getDealuser()), WorkOrderBase::getDealuser, input.getDealuser());
|
|
80
|
81
|
qw.like(!StringHelper.isEmpty(input.getSource()), WorkOrderBase::getSource, input.getSource());
|
|
81
|
82
|
|
|
|
83
|
+ qw.eq(!StringHelper.isEmpty(input.getCustomerno()), WorkOrderBase::getCustomerno, input.getCustomerno());
|
|
|
84
|
+
|
|
82
|
85
|
qw.eq(WorkOrderBase::getIsdelete, 0);
|
|
83
|
86
|
|
|
|
87
|
+ LambdaQueryWrapper<Role> qwrole = new LambdaQueryWrapper();
|
|
|
88
|
+ qwrole.in(Role::getRoleId,CurrentUser().getRoleIds());
|
|
|
89
|
+ List<Role> roleList= roleService.getList(qwrole);
|
|
84
|
90
|
|
|
85
|
|
- List<Role> roleList= CurrentUser().getRoles();
|
|
86
|
91
|
|
|
87
|
|
- if(!(roleList.stream().anyMatch(o -> o.getRoleKey().equals("GLY")) || roleList.stream().anyMatch(o -> o.getRoleKey().equals("ZXKF"))))
|
|
|
92
|
+ if(!(roleList.stream().anyMatch(o -> o.getRoleKey().equals("admin")) || roleList.stream().anyMatch(o -> o.getRoleKey().equals("ZXKF"))))
|
|
88
|
93
|
{
|
|
89
|
|
- qw.eq(!StringHelper.isEmpty(CurrentUser().getUserName()), WorkOrderBase::getCreateuser, CurrentUser().getUserName());
|
|
|
94
|
+
|
|
|
95
|
+ qw.eq(WorkOrderBase::getCreateuser, CurrentUser().getUserName())
|
|
|
96
|
+ .or()
|
|
|
97
|
+ .eq(WorkOrderBase::getDealuser, CurrentUser().getUserName());
|
|
90
|
98
|
}
|
|
91
|
99
|
|
|
92
|
100
|
|
|
|
@@ -173,7 +181,7 @@ public class WorkOrderBaseController extends BaseController {
|
|
173
|
181
|
|
|
174
|
182
|
//判断手机号存在不customer,不存在就添加新用户
|
|
175
|
183
|
LambdaQueryWrapper<Customer> qw = new LambdaQueryWrapper<>();
|
|
176
|
|
- qw.eq(Customer::getCustomerPhone, input.getCallnum());
|
|
|
184
|
+ qw.eq(Customer::getCustomerNo, input.getCustomerno());
|
|
177
|
185
|
qw.eq(Customer::getFIsdelete, 0);
|
|
178
|
186
|
Customer record = customerService.getEntity(qw);
|
|
179
|
187
|
if (record == null) {
|
|
|
@@ -183,6 +191,8 @@ public class WorkOrderBaseController extends BaseController {
|
|
183
|
191
|
customer.setType(1L);
|
|
184
|
192
|
customer.setFIsdelete(0L);
|
|
185
|
193
|
customer.setFCreatetime(currentDate);
|
|
|
194
|
+ customer.setCustomerNo(input.getCustomerno());
|
|
|
195
|
+
|
|
186
|
196
|
boolean customerresult = customerService.insert(customer);
|
|
187
|
197
|
}
|
|
188
|
198
|
return Success("成功",input.getWorkorderId());
|
|
|
@@ -333,7 +343,7 @@ public class WorkOrderBaseController extends BaseController {
|
|
333
|
343
|
boolean logresult = addlog("留言创建了工单", 1L, "", input.getWorkordercode(),"");
|
|
334
|
344
|
//判断手机号存在不customer,不存在就添加新用户
|
|
335
|
345
|
LambdaQueryWrapper<Customer> qw = new LambdaQueryWrapper<>();
|
|
336
|
|
- qw.eq(Customer::getCustomerPhone, input.getCallnum());
|
|
|
346
|
+ qw.eq(Customer::getCustomerNo, input.getCustomerno());
|
|
337
|
347
|
qw.eq(Customer::getFIsdelete, 0);
|
|
338
|
348
|
Customer record = customerService.getEntity(qw);
|
|
339
|
349
|
if (record == null) {
|
|
|
@@ -343,7 +353,7 @@ public class WorkOrderBaseController extends BaseController {
|
|
343
|
353
|
customer.setCustomerPhone(input.getCallnum());
|
|
344
|
354
|
customer.setFIsdelete(0L);
|
|
345
|
355
|
customer.setFCreatetime(currentDate);
|
|
346
|
|
-
|
|
|
356
|
+ customer.setCustomerNo(input.getCustomerno());
|
|
347
|
357
|
|
|
348
|
358
|
boolean customerresult = customerService.insert(customer);
|
|
349
|
359
|
}
|