|
@@ -12,6 +12,7 @@ import com.xy.dto.DeviceStatusDto;
|
|
|
import com.xy.dto.DeviceSysinfoDto;
|
|
|
import com.xy.entity.DeviceInfo;
|
|
|
import com.xy.entity.SysDictRedis;
|
|
|
+import com.xy.error.CommRuntimeException;
|
|
|
import com.xy.mapper.DeviceInfoMapper;
|
|
|
import com.xy.mapper.entity.DeviceInfoQueryPage;
|
|
|
import com.xy.utils.*;
|
|
@@ -129,8 +130,8 @@ public class DeviceInfoServiceImpl extends ServiceImpl<DeviceInfoMapper, DeviceI
|
|
|
return R.ok();
|
|
|
}
|
|
|
|
|
|
- @ApiOperation("分页查询")
|
|
|
@PostMapping("page")
|
|
|
+ @ApiOperation("分页查询")
|
|
|
public R<PageBean<DeviceInfoDto.Vo2>> page(@RequestBody DeviceInfoDto.Page page) {
|
|
|
//数据鉴权
|
|
|
boolean authByData = AuthorizeUtils.authByData(AuthorizeUtils.getSysId(), AuthorizeUtils.getUri());
|
|
@@ -142,6 +143,15 @@ public class DeviceInfoServiceImpl extends ServiceImpl<DeviceInfoMapper, DeviceI
|
|
|
}
|
|
|
}
|
|
|
//查询数据
|
|
|
+ return nearbyPage(page);
|
|
|
+ }
|
|
|
+
|
|
|
+ @PostMapping("nearbyPage")
|
|
|
+ @ApiOperation("附近设备分页查询")
|
|
|
+ public R<PageBean<DeviceInfoDto.Vo2>> nearbyPage(@RequestBody DeviceInfoDto.Page page) {
|
|
|
+ if (!Emptys.check(page.getLon()) || !Emptys.check(page.getLat())) {
|
|
|
+ throw new CommRuntimeException("经纬度不能为空");
|
|
|
+ }
|
|
|
IPage<DeviceInfoQueryPage> iPage = baseMapper.queryPage(toIPage(page.getPage()), page);
|
|
|
return R.ok(toPageBean(DeviceInfoDto.Vo2.class, iPage));
|
|
|
}
|