|
@@ -770,9 +770,35 @@ public class IotDeviceController {
|
|
|
@GetMapping("/map")
|
|
@GetMapping("/map")
|
|
|
@Operation(summary = "查询地图设备")
|
|
@Operation(summary = "查询地图设备")
|
|
|
public CommonResult<List<IotDeviceDO>> getMap(@Valid IotDevicePageReqVO pageReqVO){
|
|
public CommonResult<List<IotDeviceDO>> getMap(@Valid IotDevicePageReqVO pageReqVO){
|
|
|
- List<IotDeviceDO> mapDevice = iotDeviceService.getMapDevice(pageReqVO);
|
|
|
|
|
- List<IotDeviceDO> collect = mapDevice.stream().filter(e -> Objects.nonNull(e.getLng()) && Objects.nonNull(e.getLat())).collect(Collectors.toList());
|
|
|
|
|
- return CommonResult.success(collect);
|
|
|
|
|
|
|
+ if ("ly".equals(pageReqVO.getSource())){
|
|
|
|
|
+ //获取数采yf里面的设备
|
|
|
|
|
+ DevicePageReqVO devicePageReqVO = new DevicePageReqVO();
|
|
|
|
|
+ devicePageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
|
|
|
|
+ //连油设备
|
|
|
|
|
+ devicePageReqVO.setProductId(649L);
|
|
|
|
|
+ List<String> codes = yfDeviceService.getDevicePage(devicePageReqVO).getList().stream().map(YfDeviceDO::getSerialNumber).collect(Collectors.toList());
|
|
|
|
|
+ List<IotDeviceDO> iotDeviceDOS;
|
|
|
|
|
+ Long deptId = null;
|
|
|
|
|
+ if (Objects.isNull(pageReqVO.getDeptId())) {
|
|
|
|
|
+ deptId = SecurityFrameworkUtils.getLoginUserDeptId();
|
|
|
|
|
+ }else {
|
|
|
|
|
+ deptId = pageReqVO.getDeptId();
|
|
|
|
|
+ }
|
|
|
|
|
+ Set<Long> ids;
|
|
|
|
|
+ ids = deptService.getChildDeptIdListFromCache(deptId);
|
|
|
|
|
+ ids.add(deptId);
|
|
|
|
|
+ IotDevicePageReqVO reqVO = new IotDevicePageReqVO();
|
|
|
|
|
+ reqVO.setDeptIds(new ArrayList<>(ids));
|
|
|
|
|
+ List<IotDeviceDO> devicesByDepts = iotDeviceService.getDevicesByDepts(reqVO);
|
|
|
|
|
+ iotDeviceDOS = devicesByDepts.stream().filter(e -> codes.contains(e.getDeviceCode())).collect(Collectors.toList());
|
|
|
|
|
+ return success(iotDeviceDOS);
|
|
|
|
|
+ } else{
|
|
|
|
|
+ List<IotDeviceDO> mapDevice = iotDeviceService.getMapDevice(pageReqVO);
|
|
|
|
|
+ List<IotDeviceDO> collect = mapDevice.stream().filter(e -> Objects.nonNull(e.getLng()) && Objects.nonNull(e.getLat())).collect(Collectors.toList());
|
|
|
|
|
+ return success(collect);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@PermitAll
|
|
@PermitAll
|