drone-service/drone-fw/src/main/java/org/sxkj/fw/area/dto/FwAreaDivideDTO.java
@@ -29,6 +29,8 @@ import java.math.BigDecimal; import java.time.LocalDateTime; import java.io.Serializable; import java.util.List; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; @@ -120,6 +122,9 @@ @ApiModelProperty(value = "区域编码") private String areaCode; @ApiModelProperty(value = "机构id集合") private List<Long> deptList; drone-service/drone-fw/src/main/java/org/sxkj/fw/area/dto/FwAreaDivideStatisticsDTO.java
@@ -18,6 +18,8 @@ import java.util.Date; import java.io.Serializable; import java.util.List; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import com.fasterxml.jackson.databind.annotation.JsonSerialize; @@ -103,4 +105,7 @@ */ @ApiModelProperty(value = "删除标志(0存在 1删除)") private Integer isDeleted; @ApiModelProperty(value = "部门id集合") private List<Long> deptList; } drone-service/drone-fw/src/main/java/org/sxkj/fw/area/mapper/FwAreaDivideMapper.xml
@@ -73,8 +73,10 @@ ad.update_time, ad.status, ad.is_deleted from ja_fw_area_divide ad left join ja_fw_police_station ps on ps.id = ad.police_station_id and ps.is_deleted = 0 from ja_fw_area_divide ad left join ja_fw_police_station ps on ps.id = ad.police_station_id and ps.is_deleted = 0 <where> ad.is_deleted = 0 <if test="param2.id != null and param2.id != ''"> @@ -118,6 +120,12 @@ </if> <if test="param2.areaCode != null and param2.areaCode != ''"> and ad.area_code = #{param2.areaCode} </if> <if test="param2.deptList != null and param2.deptList.size > 0"> and ad.create_dept in <foreach collection="param2.deptList" item="deptId" open="(" separator="," close=")"> #{deptId} </foreach> </if> </where> </select> @@ -373,6 +381,12 @@ <if test="param2.areaCode != null and param2.areaCode != ''"> and ad.area_code = #{param2.areaCode} </if> <if test="param2.deptList != null and param2.deptList.size > 0"> and ad.create_dept in <foreach collection="param2.deptList" item="deptId" open="(" separator="," close=")"> #{deptId} </foreach> </if> </where> ) stats </select> drone-service/drone-fw/src/main/java/org/sxkj/fw/area/mapper/FwDefenseSceneMapper.xml
@@ -25,7 +25,10 @@ <select id="selectFwDefenseScenePage" resultMap="fwDefenseSceneResultMap"> select * from ja_fw_defense_scene select * from ja_fw_defense_scene <where> and is_deleted = 0 <if test="param2.id != null and param2.id != ''"> @@ -79,6 +82,12 @@ <if test="param2.status != null and param2.status != ''"> and status = #{param2.status} </if> <if test="param2.deptList != null and param2.deptList.size > 0"> and create_dept in <foreach collection="param2.deptList" item="deptId" open="(" separator="," close=")"> #{deptId} </foreach> </if> </where> </select> drone-service/drone-fw/src/main/java/org/sxkj/fw/area/service/impl/FwAreaDivideServiceImpl.java
@@ -32,6 +32,8 @@ import com.baomidou.mybatisplus.core.conditions.Wrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import org.springblade.core.mp.base.BaseServiceImpl; import org.sxkj.system.cache.SysCache; import java.util.ArrayList; import java.util.HashMap; import java.util.HashSet; @@ -52,6 +54,8 @@ @Override public IPage<FwAreaDivideVO> selectFwAreaDividePage(IPage<FwAreaDivideVO> page, FwAreaDivideDTO fwAreaDivide) { List<Long> deptList = SysCache.getDeptChildIds(Long.valueOf(AuthUtil.getDeptId())); fwAreaDivide.setDeptList(deptList); return page.setRecords(baseMapper.selectFwAreaDividePage(page, fwAreaDivide)); } @@ -163,6 +167,8 @@ @Override public IPage<FwAreaDivideStatisticsVO> selectFwAreaDivideStatisticsPage(IPage<FwAreaDivideStatisticsVO> page, FwAreaDivideStatisticsDTO fwAreaDivideStatistics) { List<Long> deptList = SysCache.getDeptChildIds(Long.valueOf(AuthUtil.getDeptId())); fwAreaDivideStatistics.setDeptList(deptList); return page.setRecords(baseMapper.selectFwAreaDivideStatisticsPage(page, fwAreaDivideStatistics)); } drone-service/drone-fw/src/main/java/org/sxkj/fw/area/service/impl/FwDefenseSceneServiceImpl.java
@@ -33,6 +33,8 @@ import com.baomidou.mybatisplus.core.conditions.Wrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import org.springblade.core.mp.base.BaseServiceImpl; import org.sxkj.system.cache.SysCache; import java.math.BigDecimal; import java.math.RoundingMode; import java.util.ArrayList; @@ -63,6 +65,8 @@ @Override public IPage<FwDefenseSceneVO> selectFwDefenseScenePage(IPage<FwDefenseSceneVO> page, FwDefenseSceneVO fwDefenseScene) { List<Long> deptList = SysCache.getDeptChildIds(Long.valueOf(AuthUtil.getDeptId())); fwDefenseScene.setDeptList(deptList); IPage<FwDefenseSceneVO> result = page.setRecords(baseMapper.selectFwDefenseScenePage(page, fwDefenseScene)); List<FwDefenseSceneVO> records = result.getRecords(); if (records == null || records.isEmpty()) { drone-service/drone-fw/src/main/java/org/sxkj/fw/area/vo/FwDefenseSceneVO.java
@@ -18,6 +18,8 @@ import java.util.Date; import java.io.Serializable; import java.util.List; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import com.fasterxml.jackson.databind.annotation.JsonSerialize; @@ -130,4 +132,8 @@ */ @ApiModelProperty(value = "状态(0正常 1停用)") private Integer status; @ApiModelProperty(value = "部门列表") private List<Long> deptList; } drone-service/drone-fw/src/main/java/org/sxkj/fw/cockpit/service/impl/CockpitServiceImpl.java
@@ -2,6 +2,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import org.springblade.core.secure.utils.AuthUtil; import org.springframework.stereotype.Service; import org.sxkj.fw.cockpit.service.ICockpitService; import org.sxkj.fw.cockpit.vo.AlarmStatisticsVO; @@ -17,6 +18,7 @@ import org.sxkj.fw.record.entity.FwDroneAlarmRecordEntity; import org.sxkj.fw.record.service.IFwDroneAlarmRecordService; import org.sxkj.fw.record.vo.FwDroneAlarmRecordVO; import org.sxkj.system.cache.SysCache; import javax.annotation.Resource; import java.util.List; @@ -42,12 +44,15 @@ @Override public IPage<CockpitFwDeviceVO> selectCockpitDevicePage(IPage<CockpitFwDeviceVO> page, FwDeviceDTO fwDevice) { List<Long> deptList = SysCache.getDeptChildIds(Long.valueOf(AuthUtil.getDeptId())); fwDevice.setDeptList(deptList); return fwDeviceService.selectCockpitDevicePage(page, fwDevice); } @Override public List<DeviceStatisticsVO> statisticalDeviceType() { return fwDeviceService.statisticalDeviceType(); List<Long> deptList = SysCache.getDeptChildIds(Long.valueOf(AuthUtil.getDeptId())); return fwDeviceService.statisticalDeviceType(deptList); } @Override @@ -91,10 +96,11 @@ @Override public AlarmStatisticsVO statisticsAlarmsAndDeviceRecords() { List<Long> deptList = SysCache.getDeptChildIds(Long.valueOf(AuthUtil.getDeptId())); // 设备统计 AlarmStatisticsVO alarmStatisticsVO = fwDeviceService.statisticalDeviceAtt(); AlarmStatisticsVO alarmStatisticsVO = fwDeviceService.statisticalDeviceAtt(deptList); // 告警统计 AlarmStatisticsVO alarmStatistics = fwDroneAlarmRecordService.alarmTypeStatistics(); AlarmStatisticsVO alarmStatistics = fwDroneAlarmRecordService.alarmTypeStatistics(deptList); alarmStatisticsVO.setHistoryAlarmCount(alarmStatistics.getHistoryAlarmCount()); alarmStatisticsVO.setRealTimeAlarmCount(alarmStatistics.getRealTimeAlarmCount()); return alarmStatisticsVO; drone-service/drone-fw/src/main/java/org/sxkj/fw/detection/mapper/FwEffectEvalMapper.xml
@@ -31,7 +31,10 @@ <select id="selectFwEffectEvalPage" resultMap="fwEffectEvalResultMap"> select * from ja_fw_effect_eval select * from ja_fw_effect_eval <where> is_deleted = 0 <if test="param2.deviceName != null and param2.deviceName != ''"> @@ -43,6 +46,12 @@ <if test="param2.counterEffect != null and param2.counterEffect != ''"> and counter_effect = #{param2.counterEffect} </if> <if test="param2.deptList != null and param2.deptList.size > 0"> and create_dept in <foreach collection="param2.deptList" item="deptId" open="(" separator="," close=")"> #{deptId} </foreach> </if> </where> </select> drone-service/drone-fw/src/main/java/org/sxkj/fw/detection/mapper/FwTaskScheduleMapper.xml
@@ -64,11 +64,16 @@ ad.latitude as device_latitude, ad.area_name, dz.zone_name as defense_zone_name from ja_fw_task_schedule ts left join ja_fw_device d on d.id = ts.device_id left join ja_fw_area_divide ad on ad.id = ts.area_divide_id left join ja_fw_defense_scene ds on ds.id = ts.defense_scene_id left join ja_fw_defense_zone dz on dz.is_deleted = 0 from ja_fw_task_schedule ts left join ja_fw_device d on d.id = ts.device_id left join ja_fw_area_divide ad on ad.id = ts.area_divide_id left join ja_fw_defense_scene ds on ds.id = ts.defense_scene_id left join ja_fw_defense_zone dz on dz.is_deleted = 0 and dz.defense_scene_ids is not null and dz.defense_scene_ids != '' and find_in_set(ds.id, replace(dz.defense_scene_ids, ' ', '')) @@ -86,6 +91,12 @@ <if test="param2.status != null and param2.status != ''"> and d.status = #{param2.status} </if> <if test="param2.deptList != null and param2.deptList.size > 0"> and ts.create_dept in <foreach collection="param2.deptList" item="deptId" open="(" separator="," close=")"> #{deptId} </foreach> </if> </where> </select> drone-service/drone-fw/src/main/java/org/sxkj/fw/detection/param/FwEffectEvalParam.java
@@ -4,6 +4,7 @@ import lombok.Data; import java.io.Serializable; import java.util.List; /** * 反制效果评估表 参数类 @@ -41,4 +42,7 @@ @ApiModelProperty(value = "反制方式:1.信号干扰/2.诱导驱离/无") private String counterWay; @ApiModelProperty(value = "部门ID") private List<Long> deptList; } drone-service/drone-fw/src/main/java/org/sxkj/fw/detection/param/FwTaskSchedulePageParam.java
@@ -4,6 +4,7 @@ import lombok.Data; import java.io.Serializable; import java.util.List; /** * 任务调度记录表 分页参数 @@ -39,4 +40,10 @@ */ @ApiModelProperty(value = "设备状态") private Integer status; /** * 部门id */ @ApiModelProperty(value = "部门id") private List<Long> deptList; } drone-service/drone-fw/src/main/java/org/sxkj/fw/detection/service/impl/FwEffectEvalServiceImpl.java
@@ -16,6 +16,7 @@ */ package org.sxkj.fw.detection.service.impl; import org.springblade.core.secure.utils.AuthUtil; import org.sxkj.fw.detection.entity.FwEffectEvalEntity; import org.sxkj.fw.detection.param.FwEffectEvalParam; import org.sxkj.fw.detection.vo.FwEffectEvalVO; @@ -26,6 +27,8 @@ import com.baomidou.mybatisplus.core.conditions.Wrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import org.springblade.core.mp.base.BaseServiceImpl; import org.sxkj.system.cache.SysCache; import java.util.List; /** @@ -39,6 +42,8 @@ @Override public IPage<FwEffectEvalVO> selectFwEffectEvalPage(IPage<FwEffectEvalVO> page, FwEffectEvalParam fwEffectEval) { List<Long> deptList = SysCache.getDeptChildIds(Long.valueOf(AuthUtil.getDeptId())); fwEffectEval.setDeptList(deptList); return page.setRecords(baseMapper.selectFwEffectEvalPage(page, fwEffectEval)); } drone-service/drone-fw/src/main/java/org/sxkj/fw/detection/service/impl/FwTaskScheduleServiceImpl.java
@@ -16,6 +16,7 @@ */ package org.sxkj.fw.detection.service.impl; import org.springblade.core.secure.utils.AuthUtil; import org.sxkj.fw.detection.entity.FwTaskScheduleEntity; import org.sxkj.fw.detection.excel.FwTaskScheduleExcel; import org.sxkj.fw.detection.param.FwTaskSchedulePageParam; @@ -26,6 +27,8 @@ import com.baomidou.mybatisplus.core.conditions.Wrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import org.springblade.core.mp.base.BaseServiceImpl; import org.sxkj.system.cache.SysCache; import java.util.List; /** @@ -39,6 +42,8 @@ @Override public IPage<FwTaskScheduleVO> selectFwTaskSchedulePage(IPage<FwTaskScheduleVO> page, FwTaskSchedulePageParam fwTaskSchedule) { List<Long> deptList = SysCache.getDeptChildIds(Long.valueOf(AuthUtil.getDeptId())); fwTaskSchedule.setDeptList(deptList); return page.setRecords(baseMapper.selectFwTaskSchedulePage(page, fwTaskSchedule)); } drone-service/drone-fw/src/main/java/org/sxkj/fw/device/dto/FwDeviceDTO.java
@@ -143,9 +143,8 @@ @ApiModelProperty(value = "经度") private String longitude; @ApiModelProperty(value = "部门id") private List<Long> deptList; /** @@ -178,4 +177,5 @@ */ @ApiModelProperty(value = "删除标志(0存在 1删除)") private Integer isDeleted; } drone-service/drone-fw/src/main/java/org/sxkj/fw/device/dto/FwDeviceMaintainPlanDTO.java
@@ -64,6 +64,8 @@ @ApiModelProperty(value = "所属部门") private Long belongDept; @ApiModelProperty(value = "部门id") private List<Long> deptList; drone-service/drone-fw/src/main/java/org/sxkj/fw/device/dto/FwDeviceScrapDTO.java
@@ -25,6 +25,8 @@ import lombok.Data; import lombok.EqualsAndHashCode; import java.io.Serializable; import java.util.List; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; @@ -73,6 +75,8 @@ private Long belongDept; @ApiModelProperty(value = "部门列表") private List<Long> deptList; drone-service/drone-fw/src/main/java/org/sxkj/fw/device/mapper/FwDeviceMaintainPlanMapper.xml
@@ -54,10 +54,12 @@ <select id="selectFwDeviceMaintainPlanPage" resultMap="fwDeviceMaintainPlanResultMap"> select <include refid="deviceFields"/>,a.* <include refid="deviceFields"/>, a.* from ja_fw_device_maintain_plan a left join ja_fw_device b on (a.device_id = b.id) left join ja_fw_device b on (a.device_id = b.id) <where> a.is_deleted = 0 <if test="param2.deviceId != null and param2.deviceId != ''"> @@ -72,6 +74,12 @@ <if test="param2.belongDept != null and param2.belongDept != ''"> and belong_dept = #{param2.belongDept} </if> <if test="param2.deptList != null and param2.deptList.size > 0"> and a.create_dept in <foreach collection="param2.deptList" item="deptId" open="(" separator="," close=")"> #{deptId} </foreach> </if> </where> </select> drone-service/drone-fw/src/main/java/org/sxkj/fw/device/mapper/FwDeviceMapper.java
@@ -69,31 +69,31 @@ * 设备统计 - 驾驶舱使用 * @return 统计数据 */ List<DeviceStatisticsVO> statisticalDeviceType(); List<DeviceStatisticsVO> statisticalDeviceType(List<Long> deptList); /** * 设备统计 - 按类型统计 * @return 统计数据 */ List<DeviceTypeStatisticsVO> getDeviceTypeStatistics(); List<DeviceTypeStatisticsVO> getDeviceTypeStatistics(List<Long> deptList); /** * 设备出库去向统计 * @return 统计数据 */ List<DeviceStatisticsVO> getDeviceOutStatistics(String effectiveRangeKmIsNotNull); List<DeviceStatisticsVO> getDeviceOutStatistics(String effectiveRangeKmIsNotNull,List<Long> deptList); /** * 设备生产厂商统计 * @return 统计数据 */ List<DeviceStatisticsVO> getDeviceManufacturerStatistics(); List<DeviceStatisticsVO> getDeviceManufacturerStatistics(List<Long> deptList); /** * 告警统计 * @return */ AlarmStatisticsVO statisticalDeviceAtt(); AlarmStatisticsVO statisticalDeviceAtt(List<Long> deptList); /** * 获取设备列表 drone-service/drone-fw/src/main/java/org/sxkj/fw/device/mapper/FwDeviceMapper.xml
@@ -39,7 +39,10 @@ <select id="selectFwDevicePage" resultMap="fwDeviceResultMap"> select * from ja_fw_device select * from ja_fw_device <where> is_deleted = 0 <if test="param2.id != null and param2.id != ''"> @@ -87,6 +90,12 @@ </if> <if test="param2.isTrack != null and param2.isTrack == 2"> and (SELECT COUNT(*) FROM ja_fw_device_track tmp WHERE ja_fw_device.id = tmp.device_id) = 0 </if> <if test="param2.deptList != null and param2.deptList.size > 0"> and create_dept in <foreach collection="param2.deptList" item="deptId" open="(" separator="," close=")"> #{deptId} </foreach> </if> </where> </select> @@ -175,6 +184,12 @@ AND status != 3 AND effective_range_km is not null AND effective_range_km > 0 <if test="deptList != null and deptList.size > 0"> and create_dept in <foreach collection="deptList" item="deptId" open="(" separator="," close=")"> #{deptId} </foreach> </if> UNION ALL -- 合并拆分的反制部分 @@ -195,6 +210,12 @@ AND device_type = '3' AND effective_range_km is not null AND effective_range_km > 0 <if test="deptList != null and deptList.size > 0"> and create_dept in <foreach collection="deptList" item="deptId" open="(" separator="," close=")"> #{deptId} </foreach> </if> ) AS temp GROUP BY split_device_type ORDER BY split_device_type @@ -202,13 +223,22 @@ <!-- 获取设备类型统计数据 --> <select id="getDeviceTypeStatistics" resultType="org.sxkj.fw.device.vo.DeviceTypeStatisticsVO"> SELECT a.device_type,b.dict_value AS device_type_value,count(*) device_count, (SELECT COUNT(*) FROM ja_fw_device where is_deleted = 0) as total_devices FROM ja_fw_device a LEFT JOIN blade_dict_biz b ON ( a.device_type = b.dict_key AND b.code = 'deviceType' AND b.parent_id != 0 ) where a.is_deleted = 0 SELECT a.device_type, b.dict_value AS device_type_value, count(*) device_count, (SELECT COUNT(*) FROM ja_fw_device where is_deleted = 0) as total_devices FROM ja_fw_device a LEFT JOIN blade_dict_biz b ON (a.device_type = b.dict_key AND b.code = 'deviceType' AND b.parent_id != 0) where a.is_deleted = 0 <if test="deptList != null and deptList.size > 0"> and a.create_dept in <foreach collection="deptList" item="deptId" open="(" separator="," close=")"> #{deptId} </foreach> </if> group by a.device_type,b.dict_value </select> @@ -245,8 +275,14 @@ <if test="effectiveRangeKmIsNotNull != null and effectiveRangeKmIsNotNull == 2"> and (d.effective_range_km is null or d.effective_range_km = 0) </if> <if test="deptList != null and deptList.size > 0"> and d.create_dept in <foreach collection="deptList" item="deptId" open="(" separator="," close=")"> #{deptId} </foreach> </if> GROUP BY t.out_target; t.out_target </select> <!-- 设备生产厂商统计 --> @@ -258,6 +294,12 @@ ja_fw_device WHERE is_deleted = 0 <if test="deptList != null and deptList.size > 0"> and create_dept in <foreach collection="deptList" item="deptId" open="(" separator="," close=")"> #{deptId} </foreach> </if> GROUP BY manufacturer </select> @@ -266,15 +308,89 @@ <select id="statisticalDeviceAtt" resultType="org.sxkj.fw.cockpit.vo.AlarmStatisticsVO"> SELECT -- 设备统计总数 (SELECT COUNT(*) FROM ja_fw_device WHERE is_deleted = 0 and effective_range_km is not null and effective_range_km > 0) AS deviceCount, (SELECT COUNT(*) FROM ja_fw_device WHERE is_deleted = 0 and effective_range_km is not null and effective_range_km > 0 <if test="deptList != null and deptList.size > 0"> and create_dept in <foreach collection="deptList" item="deptId" open="(" separator="," close=")"> #{deptId} </foreach> </if> ) AS deviceCount, -- 无线电设备数量 (SELECT COUNT(*) FROM ja_fw_device WHERE is_deleted = 0 AND device_att = '1' and effective_range_km is not null and effective_range_km > 0) AS radioCount, (SELECT COUNT(*) FROM ja_fw_device WHERE is_deleted = 0 AND device_att = '1' and effective_range_km is not null and effective_range_km > 0 <if test="deptList != null and deptList.size > 0"> and create_dept in <foreach collection="deptList" item="deptId" open="(" separator="," close=")"> #{deptId} </foreach> </if> ) AS radioCount, -- 光电设备数量 (SELECT COUNT(*) FROM ja_fw_device WHERE is_deleted = 0 AND device_att = '2'and effective_range_km is not null and effective_range_km > 0) AS opticalCount, (SELECT COUNT(*) FROM ja_fw_device WHERE is_deleted = 0 AND device_att = '2' and effective_range_km is not null and effective_range_km > 0 <if test="deptList != null and deptList.size > 0"> and create_dept in <foreach collection="deptList" item="deptId" open="(" separator="," close=")"> #{deptId} </foreach> </if> ) AS opticalCount, -- 雷达设备数量 (SELECT COUNT(*) FROM ja_fw_device WHERE is_deleted = 0 AND device_att = '3' and effective_range_km is not null and effective_range_km > 0) AS radarCount, (SELECT COUNT(*) FROM ja_fw_device WHERE is_deleted = 0 AND device_att = '3' and effective_range_km is not null and effective_range_km > 0 <if test="deptList != null and deptList.size > 0"> and create_dept in <foreach collection="deptList" item="deptId" open="(" separator="," close=")"> #{deptId} </foreach> </if> ) AS radarCount, -- 设备告警 (SELECT COUNT(*) FROM ja_fw_device WHERE is_deleted = 0 AND status in ('1', '2', '3' ) and effective_range_km is not null and effective_range_km > 0) AS deviceAlarmCount; (SELECT COUNT(*) FROM ja_fw_device WHERE is_deleted = 0 AND status in ('1', '2', '3' ) and effective_range_km is not null and effective_range_km > 0 <if test="deptList != null and deptList.size > 0"> and create_dept in <foreach collection="deptList" item="deptId" open="(" separator="," close=")"> #{deptId} </foreach> </if> ) AS deviceAlarmCount </select> <select id="selectCockpitDevicePage" resultType="org.sxkj.fw.device.vo.CockpitFwDeviceVO"> @@ -326,6 +442,12 @@ <if test="param2.belongDept != null and param2.belongDept != ''"> and d.belong_dept = #{param2.belongDept} </if> <if test="param2.deptList != null and param2.deptList.size > 0"> and d.create_dept in <foreach collection="param2.deptList" item="deptId" open="(" separator="," close=")"> #{deptId} </foreach> </if> <if test="param2.deviceStatusList != null and param2.deviceStatusList != ''"> and d.status in <foreach item="item" collection="param2.deviceStatusList" separator="," open="(" close=")" index=""> drone-service/drone-fw/src/main/java/org/sxkj/fw/device/mapper/FwDeviceScrapMapper.xml
@@ -71,6 +71,12 @@ <if test="param2.belongDept != null and param2.belongDept != ''"> and belong_dept = #{param2.belongDept} </if> <if test="param2.deptList != null and param2.deptList.size > 0"> and a.create_dept in <foreach collection="param2.deptList" item="deptId" open="(" separator="," close=")"> #{deptId} </foreach> </if> </where> </select> drone-service/drone-fw/src/main/java/org/sxkj/fw/device/service/IFwDeviceService.java
@@ -80,7 +80,7 @@ * 设备类型统计 * @return */ List<DeviceStatisticsVO> statisticalDeviceType(); List<DeviceStatisticsVO> statisticalDeviceType(List<Long> deptList); /** * 设备统计 - 按类型统计 @@ -104,7 +104,7 @@ * 设备报警统计 * @return */ AlarmStatisticsVO statisticalDeviceAtt(); AlarmStatisticsVO statisticalDeviceAtt(List<Long> deptList); /** * 驾驶舱获取设备列表 drone-service/drone-fw/src/main/java/org/sxkj/fw/device/service/impl/FwDeviceMaintainPlanServiceImpl.java
@@ -18,6 +18,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import org.springblade.core.secure.utils.AuthUtil; import org.sxkj.fw.device.dto.FwDeviceMaintainPlanDTO; import org.sxkj.fw.device.entity.FwDeviceMaintainPlanEntity; import org.sxkj.fw.device.vo.FwDeviceMaintainPlanVO; @@ -28,6 +29,8 @@ import com.baomidou.mybatisplus.core.conditions.Wrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import org.springblade.core.mp.base.BaseServiceImpl; import org.sxkj.system.cache.SysCache; import java.util.List; /** @@ -47,6 +50,8 @@ @Override public IPage<FwDeviceMaintainPlanVO> selectFwDeviceMaintainPlanPage(IPage<FwDeviceMaintainPlanVO> page, FwDeviceMaintainPlanDTO fwDeviceMaintainPlan) { List<Long> deptList = SysCache.getDeptChildIds(Long.valueOf(AuthUtil.getDeptId())); fwDeviceMaintainPlan.setDeptList(deptList); return page.setRecords(baseMapper.selectFwDeviceMaintainPlanPage(page, fwDeviceMaintainPlan)); } drone-service/drone-fw/src/main/java/org/sxkj/fw/device/service/impl/FwDeviceScrapServiceImpl.java
@@ -20,6 +20,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import lombok.AllArgsConstructor; import org.springblade.core.mp.base.BaseServiceImpl; import org.springblade.core.secure.utils.AuthUtil; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.sxkj.fw.device.dto.FwDeviceScrapDTO; @@ -31,6 +32,7 @@ import org.sxkj.fw.device.service.IFwDeviceService; import org.sxkj.fw.device.vo.FwDeviceScrapVO; import org.sxkj.fw.device.wrapper.FwDeviceScrapWrapper; import org.sxkj.system.cache.SysCache; import java.util.Collections; import java.util.List; @@ -67,6 +69,8 @@ @Override public IPage<FwDeviceScrapVO> selectFwDeviceScrapPage(IPage<FwDeviceScrapVO> page, FwDeviceScrapDTO fwDeviceScrap) { List<Long> deptList = SysCache.getDeptChildIds(Long.valueOf(AuthUtil.getDeptId())); fwDeviceScrap.setDeptList(deptList); return page.setRecords(baseMapper.selectFwDeviceScrapPage(page, fwDeviceScrap)); } drone-service/drone-fw/src/main/java/org/sxkj/fw/device/service/impl/FwDeviceServiceImpl.java
@@ -16,6 +16,7 @@ */ 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; @@ -37,6 +38,7 @@ 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; @@ -63,7 +65,10 @@ @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()) { @@ -97,6 +102,7 @@ /** * 获取设备列表 * * @param page * @param fwDevice * @return @@ -108,39 +114,46 @@ /** * 设备类型统计 * * @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 @@ -155,6 +168,7 @@ /** * 保存或更新设备信息 * * @param fwDeviceEntity * @return */ drone-service/drone-fw/src/main/java/org/sxkj/fw/record/dto/FwDroneAlarmRecordDTO.java
@@ -26,6 +26,8 @@ import java.time.LocalTime; import java.util.Date; import java.io.Serializable; import java.util.List; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; @@ -148,4 +150,7 @@ @ApiModelProperty(value = "当前用户id") private Long currentUserId; @ApiModelProperty(value = "部门id") private List<Long> deptList; } drone-service/drone-fw/src/main/java/org/sxkj/fw/record/dto/FwDroneFlightRecordDTO.java
@@ -23,6 +23,8 @@ import java.time.LocalTime; import java.util.Date; import java.io.Serializable; import java.util.List; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; @@ -89,4 +91,7 @@ @ApiModelProperty(value = "区域名称") private String areaName; @ApiModelProperty(value = "部门ID") private List<Long> deptList; } drone-service/drone-fw/src/main/java/org/sxkj/fw/record/mapper/FwDroneAlarmRecordMapper.java
@@ -58,5 +58,5 @@ * 告警类型统计 * @return */ AlarmStatisticsVO alarmTypeStatistics(); AlarmStatisticsVO alarmTypeStatistics(List<Long> deptList); } drone-service/drone-fw/src/main/java/org/sxkj/fw/record/mapper/FwDroneAlarmRecordMapper.xml
@@ -117,6 +117,12 @@ <if test="param2.areaName != null and param2.areaName != ''"> and dar.area_name like CONCAT('%', #{param2.areaName}, '%') </if> <if test="param2.deptList != null and param2.deptList.size > 0"> and dar.create_dept in <foreach collection="param2.deptList" item="deptId" open="(" separator="," close=")"> #{deptId} </foreach> </if> </where> order by favorited desc </select> @@ -145,7 +151,15 @@ SELECT COUNT(CASE WHEN alarm_type = 1 THEN 1 END) AS realTimeAlarmCount, COUNT(CASE WHEN alarm_type = 2 THEN 2 END) AS historyAlarmCount FROM ja_fw_drone_alarm_record WHERE is_deleted = 0 FROM ja_fw_drone_alarm_record WHERE is_deleted = 0 <if test="deptList != null and deptList.size > 0"> and create_dept in <foreach collection="deptList" item="deptId" open="(" separator="," close=")"> #{deptId} </foreach> </if> </select> </mapper> drone-service/drone-fw/src/main/java/org/sxkj/fw/record/mapper/FwDroneFlightRecordMapper.xml
@@ -56,6 +56,12 @@ <if test="param2.areaName != null and param2.areaName != ''"> and dfr.area_name like CONCAT('%', #{param2.areaName}, '%') </if> <if test="param2.deptList != null and param2.deptList.size > 0"> and dfr.create_dept in <foreach collection="param2.deptList" item="deptId" open="(" separator="," close=")"> #{deptId} </foreach> </if> </where> </select> drone-service/drone-fw/src/main/java/org/sxkj/fw/record/service/IFwDroneAlarmRecordService.java
@@ -56,5 +56,5 @@ * * @return */ AlarmStatisticsVO alarmTypeStatistics(); AlarmStatisticsVO alarmTypeStatistics(List<Long> deptList); } drone-service/drone-fw/src/main/java/org/sxkj/fw/record/service/impl/FwDroneAlarmRecordServiceImpl.java
@@ -29,6 +29,7 @@ import com.baomidou.mybatisplus.core.conditions.Wrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import org.springblade.core.mp.base.BaseServiceImpl; import org.sxkj.system.cache.SysCache; import java.util.List; @@ -44,6 +45,8 @@ @Override public IPage<FwDroneAlarmRecordVO> selectFwDroneAlarmRecordPage(IPage<FwDroneAlarmRecordVO> page, FwDroneAlarmRecordDTO fwDroneAlarmRecord) { fwDroneAlarmRecord.setCurrentUserId(AuthUtil.getUserId()); List<Long> deptList = SysCache.getDeptChildIds(Long.valueOf(AuthUtil.getDeptId())); fwDroneAlarmRecord.setDeptList(deptList); return page.setRecords(baseMapper.selectFwDroneAlarmRecordPage(page, fwDroneAlarmRecord)); } @@ -60,7 +63,7 @@ * @return */ @Override public AlarmStatisticsVO alarmTypeStatistics() { return baseMapper.alarmTypeStatistics(); public AlarmStatisticsVO alarmTypeStatistics(List<Long> deptList) { return baseMapper.alarmTypeStatistics(deptList); } } drone-service/drone-fw/src/main/java/org/sxkj/fw/record/service/impl/FwDroneFlightRecordServiceImpl.java
@@ -16,6 +16,7 @@ */ package org.sxkj.fw.record.service.impl; import org.springblade.core.secure.utils.AuthUtil; import org.sxkj.fw.record.dto.FwDroneFlightRecordDTO; import org.sxkj.fw.record.entity.FwDroneFlightRecordEntity; import org.sxkj.fw.record.param.FwDroneFlightRecordExportParam; @@ -27,6 +28,7 @@ import com.baomidou.mybatisplus.core.conditions.Wrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import org.springblade.core.mp.base.BaseServiceImpl; import org.sxkj.system.cache.SysCache; import java.util.List; import java.util.Map; @@ -43,6 +45,8 @@ @Override public IPage<FwDroneFlightRecordVO> selectFwDroneFlightRecordPage(IPage<FwDroneFlightRecordVO> page, FwDroneFlightRecordDTO fwDroneFlightRecord) { List<Long> deptList = SysCache.getDeptChildIds(Long.valueOf(AuthUtil.getDeptId())); fwDroneFlightRecord.setDeptList(deptList); return page.setRecords(baseMapper.selectFwDroneFlightRecordPage(page, fwDroneFlightRecord)); }