| | |
| | | @Override |
| | | public IPage<FwDeviceVO> selectFwDevicePageVo(FwDevicePageParam fwDevice, Query query) { |
| | | FwDeviceDTO fwDeviceDTO = GenericConverter.convert(fwDevice, FwDeviceDTO.class); |
| | | // 按当前部门及下级部门范围过滤数据 |
| | | List<Long> deptList = SysCache.getDeptChildIds(Long.valueOf(AuthUtil.getDeptId())); |
| | | fwDeviceDTO.setDeptList(deptList); |
| | | IPage<FwDeviceEntity> pages = selectFwDevicePage(Condition.getPage(query), fwDeviceDTO); |
| | |
| | | .map(FwDeviceVO::getId) |
| | | .filter(id -> id != null) |
| | | .collect(Collectors.toList()); |
| | | // 批量补充设备关联场景名称 |
| | | Map<Long, String> sceneNameMap = selectSceneNameByDeviceIds(deviceIds); |
| | | for (FwDeviceVO record : records) { |
| | | String sceneName = sceneNameMap.get(record.getId()); |
| | |
| | | */ |
| | | @Override |
| | | public List<DeviceTypeStatisticsVO> getDeviceTypeStatistics() { |
| | | // 统计范围限定在当前部门及下级部门 |
| | | List<Long> deptList = SysCache.getDeptChildIds(Long.valueOf(AuthUtil.getDeptId())); |
| | | return baseMapper.getDeviceTypeStatistics(deptList); |
| | | } |
| | | |
| | | @Override |
| | | public List<DeviceStatisticsVO> getDeviceOutStatistics(String effectiveRangeKmIsNotNull) { |
| | | // 统计范围限定在当前部门及下级部门 |
| | | List<Long> deptList = SysCache.getDeptChildIds(Long.valueOf(AuthUtil.getDeptId())); |
| | | return baseMapper.getDeviceOutStatistics(effectiveRangeKmIsNotNull, deptList); |
| | | } |
| | | |
| | | @Override |
| | | public List<DeviceStatisticsVO> getDeviceManufacturerStatistics() { |
| | | // 统计范围限定在当前部门及下级部门 |
| | | List<Long> deptList = SysCache.getDeptChildIds(Long.valueOf(AuthUtil.getDeptId())); |
| | | return baseMapper.getDeviceManufacturerStatistics(deptList); |
| | | } |
| | |
| | | */ |
| | | @Override |
| | | public boolean saveOrUpdateDevice(FwDeviceEntity fwDeviceEntity) { |
| | | // 无效范围时清空坐标,避免显示无意义位置 |
| | | if (fwDeviceEntity.getEffectiveRangeKm() == null || fwDeviceEntity.getEffectiveRangeKm().compareTo(BigDecimal.ZERO) == 0) { |
| | | fwDeviceEntity.setLatitude(""); |
| | | fwDeviceEntity.setLongitude(""); |