Showing
1 changed file
with
10 additions
and
2 deletions
@@ -210,8 +210,13 @@ public class TkDeviceController extends BaseController { | @@ -210,8 +210,13 @@ public class TkDeviceController extends BaseController { | ||
210 | @PreAuthorize("@check.checkPermissions({'TENANT_ADMIN','CUSTOMER_USER'},{})") | 210 | @PreAuthorize("@check.checkPermissions({'TENANT_ADMIN','CUSTOMER_USER'},{})") |
211 | @PostMapping(params = {PAGE_SIZE, PAGE}) | 211 | @PostMapping(params = {PAGE_SIZE, PAGE}) |
212 | @ApiOperation("查询") | 212 | @ApiOperation("查询") |
213 | - public TkPageData<DeviceDTO> pageDevice(@RequestBody Map<String,Object> queryMap) | 213 | + public TkPageData<DeviceDTO> pageDevice( |
214 | + @RequestParam(PAGE_SIZE) int pageSize, | ||
215 | + @RequestParam(PAGE) int page, | ||
216 | + @RequestBody Map<String, Object> queryMap) | ||
214 | throws ThingsboardException { | 217 | throws ThingsboardException { |
218 | + queryMap.put(PAGE, page); | ||
219 | + queryMap.put(PAGE_SIZE, pageSize); | ||
215 | // 如果当前用户是客户 | 220 | // 如果当前用户是客户 |
216 | if (getCurrentUser().isCustomerUser()) { | 221 | if (getCurrentUser().isCustomerUser()) { |
217 | queryMap.put("customerId", getCurrentUser().getCustomerId().toString()); | 222 | queryMap.put("customerId", getCurrentUser().getCustomerId().toString()); |
@@ -442,7 +447,10 @@ public class TkDeviceController extends BaseController { | @@ -442,7 +447,10 @@ public class TkDeviceController extends BaseController { | ||
442 | DeviceProfileId deviceProfileId = | 447 | DeviceProfileId deviceProfileId = |
443 | new DeviceProfileId(UUID.fromString(deviceDTO.getProfileId())); | 448 | new DeviceProfileId(UUID.fromString(deviceDTO.getProfileId())); |
444 | 449 | ||
445 | - CustomerId customerId = StringUtils.isBlank(deviceDTO.getCustomerId())?null:new CustomerId(UUID.fromString(deviceDTO.getCustomerId())); | 450 | + CustomerId customerId = |
451 | + StringUtils.isBlank(deviceDTO.getCustomerId()) | ||
452 | + ? null | ||
453 | + : new CustomerId(UUID.fromString(deviceDTO.getCustomerId())); | ||
446 | 454 | ||
447 | tbDevice.setAdditionalInfo(additionalInfo); | 455 | tbDevice.setAdditionalInfo(additionalInfo); |
448 | tbDevice.setCustomerId(customerId); | 456 | tbDevice.setCustomerId(customerId); |