|
|
|
|
@ -51,6 +51,7 @@ public class DeviceController {
|
|
|
|
|
private JobService jobService;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@PostMapping("/create")
|
|
|
|
|
@Operation(summary = "创建物联设备")
|
|
|
|
|
@PreAuthorize("@ss.hasPermission('iot:device:create')")
|
|
|
|
|
@ -120,6 +121,40 @@ public class DeviceController {
|
|
|
|
|
return success(list);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@GetMapping("/noUsedlist")
|
|
|
|
|
@Operation(summary = "获得未关联设备台账列表")
|
|
|
|
|
@PreAuthorize("@ss.hasPermission('mes:device-ledger:query')")
|
|
|
|
|
public CommonResult<List<DeviceRespVO>> getDeviceLedgerListByNoUsed() {
|
|
|
|
|
DevicePageReqVO pageReqVO = new DevicePageReqVO();
|
|
|
|
|
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
|
|
|
|
List<DeviceRespVO> list = deviceService.getDevicePage(pageReqVO).getList();
|
|
|
|
|
List<Long> ids = deviceService.deviceLedgerList();
|
|
|
|
|
List<DeviceRespVO> filteredList = list.stream()
|
|
|
|
|
.filter(device -> !ids.contains(device.getId()))
|
|
|
|
|
.collect(Collectors.toList());
|
|
|
|
|
return success(filteredList);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@GetMapping("/noUsedlist2")
|
|
|
|
|
@Operation(summary = "获得未关联设备台账列表")
|
|
|
|
|
@PreAuthorize("@ss.hasPermission('mes:device-ledger:query')")
|
|
|
|
|
public CommonResult<List<DeviceRespVO>> getDeviceLedgerList2ByNoUsed(@RequestParam("id") Long id) {
|
|
|
|
|
DevicePageReqVO pageReqVO = new DevicePageReqVO();
|
|
|
|
|
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
|
|
|
|
List<DeviceRespVO> list = deviceService.getDevicePage(pageReqVO).getList();
|
|
|
|
|
List<Long> ids = deviceService.deviceLedgerList();
|
|
|
|
|
|
|
|
|
|
List<DeviceRespVO> filteredList = list.stream()
|
|
|
|
|
.filter(device -> {
|
|
|
|
|
if (id != null && id.equals(device.getId())) {
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
return !ids.contains(device.getId());
|
|
|
|
|
})
|
|
|
|
|
.collect(Collectors.toList());
|
|
|
|
|
return success(filteredList);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@PostMapping("/connect")
|
|
|
|
|
@Operation(summary = "连接")
|
|
|
|
|
// @PreAuthorize("@ss.hasPermission('iot:device:create')")
|
|
|
|
|
|