| | |
| | | import org.sxkj.fw.cockpit.vo.DeviceStatisticsVO; |
| | | import org.sxkj.fw.common.GenericConverter; |
| | | import org.sxkj.fw.device.dto.FwDeviceDTO; |
| | | import org.sxkj.fw.device.dto.FwDevicePolygonQueryDTO; |
| | | import org.sxkj.fw.device.entity.FwDeviceEntity; |
| | | import org.sxkj.fw.device.param.FwDevicePageParam; |
| | | import org.sxkj.fw.device.vo.CockpitFwDeviceVO; |
| | |
| | | @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<FwDeviceEntity> selectFwDeviceList(Integer isAreaSelect, Long areaId, Integer status, Integer isTrack) { |
| | | return baseMapper.selectFwDeviceList(isAreaSelect, areaId, status, isTrack); |
| | | } |
| | | |
| | | @Override |
| | | public List<FwDeviceEntity> selectFwDeviceListByPolygons(FwDevicePolygonQueryDTO query) { |
| | | return baseMapper.selectFwDeviceListByPolygons(query); |
| | | } |
| | | |
| | | |
| | |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<DeviceStatisticsVO> statisticalDeviceType(List<Long> deptList) { |
| | | return baseMapper.statisticalDeviceType(deptList); |
| | | public List<DeviceStatisticsVO> statisticalDeviceType(List<Long> deptList,String currentDeptId) { |
| | | return baseMapper.statisticalDeviceType(deptList,currentDeptId); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @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); |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | @Override |
| | | public AlarmStatisticsVO statisticalDeviceAtt(List<Long> deptList) { |
| | | return baseMapper.statisticalDeviceAtt(deptList); |
| | | public AlarmStatisticsVO statisticalDeviceAtt(List<Long> deptList, String currentDeptId) { |
| | | return baseMapper.statisticalDeviceAtt(deptList, currentDeptId); |
| | | } |
| | | |
| | | @Override |
| | |
| | | */ |
| | | @Override |
| | | public boolean saveOrUpdateDevice(FwDeviceEntity fwDeviceEntity) { |
| | | // 无效范围时清空坐标,避免显示无意义位置 |
| | | if (fwDeviceEntity.getEffectiveRangeKm() == null || fwDeviceEntity.getEffectiveRangeKm().compareTo(BigDecimal.ZERO) == 0) { |
| | | fwDeviceEntity.setLatitude(""); |
| | | fwDeviceEntity.setLongitude(""); |