| | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | | import org.springframework.stereotype.Service; |
| | | import org.sxkj.common.utils.HeaderUtils; |
| | | import org.sxkj.fw.cockpit.service.ICockpitService; |
| | | import org.sxkj.fw.cockpit.vo.AlarmStatisticsVO; |
| | | import org.sxkj.fw.cockpit.vo.DeviceStatisticsVO; |
| | |
| | | |
| | | @Override |
| | | public IPage<CockpitFwDeviceVO> selectCockpitDevicePage(IPage<CockpitFwDeviceVO> page, FwDeviceDTO fwDevice) { |
| | | // List<Long> deptList = SysCache.getDeptChildIds(Long.valueOf(AuthUtil.getDeptId())); |
| | | // fwDevice.setDeptList(deptList); |
| | | // fwDevice.setCurrentDeptId(AuthUtil.getDeptId()); |
| | | Dept dept = SysCache.getDept(Long.valueOf(AuthUtil.getDeptId())); |
| | | Region byCode = RegionCache.getByCode(dept.getAreaCode()); |
| | | String regionName = byCode.getName(); |
| | | fwDevice.setRegionName(regionName); |
| | | fwDevice.setRegionCode(HeaderUtils.formatAreaCode(byCode.getCode())); |
| | | fwDevice.setCurrentDeptId(AuthUtil.getDeptId()); |
| | | IPage<CockpitFwDeviceVO> cockpitFwDeviceVOIPage = fwDeviceService.selectCockpitDevicePage(page, fwDevice); |
| | | return cockpitFwDeviceVOIPage; |
| | |
| | | // List<Long> deptList = SysCache.getDeptChildIds(Long.valueOf(AuthUtil.getDeptId())); |
| | | Dept dept = SysCache.getDept(Long.valueOf(AuthUtil.getDeptId())); |
| | | Region byCode = RegionCache.getByCode(dept.getAreaCode()); |
| | | String regionName = byCode.getName(); |
| | | return fwDeviceService.statisticalDeviceType(regionName, AuthUtil.getDeptId()); |
| | | return fwDeviceService.statisticalDeviceType(HeaderUtils.formatAreaCode(byCode.getCode()), AuthUtil.getDeptId()); |
| | | } |
| | | |
| | | @Override |
| | |
| | | // List<Long> deptList = SysCache.getDeptChildIds(Long.valueOf(AuthUtil.getDeptId())); |
| | | Dept dept = SysCache.getDept(Long.valueOf(AuthUtil.getDeptId())); |
| | | Region byCode = RegionCache.getByCode(dept.getAreaCode()); |
| | | String regionName = byCode.getName(); |
| | | String regionCode = HeaderUtils.formatAreaCode(byCode.getCode()); |
| | | // 设备统计 |
| | | AlarmStatisticsVO alarmStatisticsVO = fwDeviceService.statisticalDeviceAtt(regionName, AuthUtil.getDeptId()); |
| | | AlarmStatisticsVO alarmStatisticsVO = fwDeviceService.statisticalDeviceAtt(regionCode, AuthUtil.getDeptId()); |
| | | // 告警统计 |
| | | AlarmStatisticsVO alarmStatistics = fwDroneAlarmRecordService.alarmTypeStatistics(regionName, AuthUtil.getDeptId()); |
| | | AlarmStatisticsVO alarmStatistics = fwDroneAlarmRecordService.alarmTypeStatistics(regionCode, AuthUtil.getDeptId()); |
| | | alarmStatisticsVO.setHistoryAlarmCount(alarmStatistics.getHistoryAlarmCount()); |
| | | alarmStatisticsVO.setRealTimeAlarmCount(alarmStatistics.getRealTimeAlarmCount()); |
| | | return alarmStatisticsVO; |
| | | } |
| | | |
| | | /** |
| | | * |
| | | * @param effectiveRangeKmIsNotNull |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<DeviceStatisticsVO> getDeviceOutStatistics(String effectiveRangeKmIsNotNull) { |
| | | return fwDeviceService.getDeviceOutStatistics(effectiveRangeKmIsNotNull); |
| | | FwDeviceDTO fwDeviceDTO = new FwDeviceDTO(); |
| | | Dept dept = SysCache.getDept(Long.valueOf(AuthUtil.getDeptId())); |
| | | Region byCode = RegionCache.getByCode(dept.getAreaCode()); |
| | | fwDeviceDTO.setCurrentDeptId(AuthUtil.getDeptId()); |
| | | fwDeviceDTO.setRegionCode(HeaderUtils.formatAreaCode(byCode.getCode())); |
| | | return fwDeviceService.getDeviceStatistics(fwDeviceDTO); |
| | | } |
| | | } |