| | |
| | | */ |
| | | package org.sxkj.fw.device.service.impl; |
| | | |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | | import org.sxkj.fw.cockpit.vo.AlarmStatisticsVO; |
| | | import org.sxkj.fw.cockpit.vo.DeviceStatisticsVO; |
| | | import org.sxkj.fw.common.GenericConverter; |
| | |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.tool.utils.StringUtil; |
| | | import org.sxkj.system.cache.SysCache; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | |
| | | |
| | | @Override |
| | | public IPage<FwDeviceVO> selectFwDevicePageVo(FwDevicePageParam fwDevice, Query query) { |
| | | IPage<FwDeviceEntity> pages = selectFwDevicePage(Condition.getPage(query), GenericConverter.convert(fwDevice, FwDeviceDTO.class)); |
| | | 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); |
| | | IPage<FwDeviceVO> result = FwDeviceWrapper.build().pageVO(pages); |
| | | List<FwDeviceVO> records = result.getRecords(); |
| | | if (records != null && !records.isEmpty()) { |
| | |
| | | |
| | | /** |
| | | * 获取设备列表 |
| | | * |
| | | * @param page |
| | | * @param fwDevice |
| | | * @return |
| | |
| | | |
| | | /** |
| | | * 设备类型统计 |
| | | * |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<DeviceStatisticsVO> statisticalDeviceType() { |
| | | return baseMapper.statisticalDeviceType(); |
| | | public List<DeviceStatisticsVO> statisticalDeviceType(List<Long> deptList) { |
| | | return baseMapper.statisticalDeviceType(deptList); |
| | | } |
| | | |
| | | /** |
| | | * 设备统计 - 按类型统计 |
| | | * |
| | | * @return 统计数据 |
| | | */ |
| | | @Override |
| | | public List<DeviceTypeStatisticsVO> getDeviceTypeStatistics() { |
| | | return baseMapper.getDeviceTypeStatistics(); |
| | | List<Long> deptList = SysCache.getDeptChildIds(Long.valueOf(AuthUtil.getDeptId())); |
| | | return baseMapper.getDeviceTypeStatistics(deptList); |
| | | } |
| | | |
| | | @Override |
| | | public List<DeviceStatisticsVO> getDeviceOutStatistics(String effectiveRangeKmIsNotNull) { |
| | | return baseMapper.getDeviceOutStatistics(effectiveRangeKmIsNotNull); |
| | | List<Long> deptList = SysCache.getDeptChildIds(Long.valueOf(AuthUtil.getDeptId())); |
| | | return baseMapper.getDeviceOutStatistics(effectiveRangeKmIsNotNull, deptList); |
| | | } |
| | | |
| | | @Override |
| | | public List<DeviceStatisticsVO> getDeviceManufacturerStatistics() { |
| | | return baseMapper.getDeviceManufacturerStatistics(); |
| | | List<Long> deptList = SysCache.getDeptChildIds(Long.valueOf(AuthUtil.getDeptId())); |
| | | deptList.addAll(deptList); |
| | | return baseMapper.getDeviceManufacturerStatistics(deptList); |
| | | } |
| | | |
| | | /** |
| | | * 设备属性统计 |
| | | * |
| | | * @return |
| | | */ |
| | | @Override |
| | | public AlarmStatisticsVO statisticalDeviceAtt() { |
| | | return baseMapper.statisticalDeviceAtt(); |
| | | public AlarmStatisticsVO statisticalDeviceAtt(List<Long> deptList) { |
| | | return baseMapper.statisticalDeviceAtt(deptList); |
| | | } |
| | | |
| | | @Override |
| | |
| | | |
| | | /** |
| | | * 保存或更新设备信息 |
| | | * |
| | | * @param fwDeviceEntity |
| | | * @return |
| | | */ |