Commit 097722cad794e7b5c414fe9788a1073d68fece6d

Authored by 黄 x
1 parent bca733ad

fix: device page query param

... ... @@ -221,6 +221,19 @@ public class TkDeviceController extends BaseController {
221 221 if (getCurrentUser().isCustomerUser()) {
222 222 queryMap.put("customerId", getCurrentUser().getCustomerId().toString());
223 223 }
  224 + DeviceState deviceState =
  225 + null != queryMap.get("deviceState")
  226 + && StringUtils.isNotEmpty(queryMap.get("deviceState").toString())
  227 + ? DeviceState.valueOf(queryMap.get("deviceState").toString())
  228 + : null;
  229 + if (deviceState != null) {
  230 + if (!deviceState.equals(DeviceState.INACTIVE)) {
  231 + queryMap.put("deviceState", deviceState.equals(DeviceState.ONLINE));
  232 + } else {
  233 + queryMap.put("activeState", DeviceState.INACTIVE);
  234 + queryMap.remove("deviceState");
  235 + }
  236 + }
224 237 return tkdeviceService.page(getCurrentUser().getCurrentTenantId(), queryMap);
225 238 }
226 239
... ...