吉安感知网项目-后端
linwei
2026-02-03 d18ef72c533fe6b18d487bcd9fd333c63ca50f04
反无驾驶舱优化
15 files modified
1 files added
231 ■■■■■ changed files
drone-service/drone-fw/src/main/java/org/sxkj/fw/cockpit/service/impl/CockpitServiceImpl.java 30 ●●●● patch | view | raw | blame | history
drone-service/drone-fw/src/main/java/org/sxkj/fw/common/FwBaseInfo.java 22 ●●●●● patch | view | raw | blame | history
drone-service/drone-fw/src/main/java/org/sxkj/fw/device/controller/FwDeviceController.java 15 ●●●●● patch | view | raw | blame | history
drone-service/drone-fw/src/main/java/org/sxkj/fw/device/dto/FwDeviceDTO.java 15 ●●●● patch | view | raw | blame | history
drone-service/drone-fw/src/main/java/org/sxkj/fw/device/dto/FwDeviceTrackDTO.java 6 ●●●●● patch | view | raw | blame | history
drone-service/drone-fw/src/main/java/org/sxkj/fw/device/entity/FwDeviceTrackEntity.java 6 ●●●●● patch | view | raw | blame | history
drone-service/drone-fw/src/main/java/org/sxkj/fw/device/mapper/FwDeviceMapper.java 13 ●●●● patch | view | raw | blame | history
drone-service/drone-fw/src/main/java/org/sxkj/fw/device/mapper/FwDeviceMapper.xml 64 ●●●●● patch | view | raw | blame | history
drone-service/drone-fw/src/main/java/org/sxkj/fw/device/service/IFwDeviceService.java 13 ●●●● patch | view | raw | blame | history
drone-service/drone-fw/src/main/java/org/sxkj/fw/device/service/impl/FwDeviceServiceImpl.java 17 ●●●●● patch | view | raw | blame | history
drone-service/drone-fw/src/main/java/org/sxkj/fw/device/service/impl/FwDeviceTrackServiceImpl.java 2 ●●● patch | view | raw | blame | history
drone-service/drone-fw/src/main/java/org/sxkj/fw/record/dto/FwDroneAlarmRecordDTO.java 5 ●●●● patch | view | raw | blame | history
drone-service/drone-fw/src/main/java/org/sxkj/fw/record/mapper/FwDroneAlarmRecordMapper.java 2 ●●● patch | view | raw | blame | history
drone-service/drone-fw/src/main/java/org/sxkj/fw/record/mapper/FwDroneAlarmRecordMapper.xml 8 ●●●● patch | view | raw | blame | history
drone-service/drone-fw/src/main/java/org/sxkj/fw/record/service/IFwDroneAlarmRecordService.java 2 ●●● patch | view | raw | blame | history
drone-service/drone-fw/src/main/java/org/sxkj/fw/record/service/impl/FwDroneAlarmRecordServiceImpl.java 11 ●●●● patch | view | raw | blame | history
drone-service/drone-fw/src/main/java/org/sxkj/fw/cockpit/service/impl/CockpitServiceImpl.java
@@ -4,6 +4,7 @@
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;
@@ -47,14 +48,10 @@
    @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.setCurrentDeptId(AuthUtil.getDeptId());
            Dept dept = SysCache.getDept(Long.valueOf(AuthUtil.getDeptId()));
            Region byCode = RegionCache.getByCode(dept.getAreaCode());
            fwDevice.setRegionCode(HeaderUtils.formatAreaCode(byCode.getCode()));
            fwDevice.setCurrentDeptId(AuthUtil.getDeptId());
        IPage<CockpitFwDeviceVO> cockpitFwDeviceVOIPage = fwDeviceService.selectCockpitDevicePage(page, fwDevice);
        return cockpitFwDeviceVOIPage;
    }
@@ -64,8 +61,7 @@
        // 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
@@ -112,23 +108,27 @@
        // 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);
    }
}
drone-service/drone-fw/src/main/java/org/sxkj/fw/common/FwBaseInfo.java
New file
@@ -0,0 +1,22 @@
package org.sxkj.fw.common;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
@Data
public class FwBaseInfo {
    @ApiModelProperty(value = "部门集合",hidden = true)
    private List<Long> deptList;
    @ApiModelProperty(value = "部门id",hidden = true)
    private String currentDeptId;
    @ApiModelProperty(value = "区域名称")
    private String regionName;
    @ApiModelProperty(value = "区域编码")
    private String regionCode;
}
drone-service/drone-fw/src/main/java/org/sxkj/fw/device/controller/FwDeviceController.java
@@ -127,6 +127,7 @@
    public R submit(@Valid @RequestBody FwDeviceDTO fwDevice) {
        return R.status(fwDeviceService.saveOrUpdateDevice(FwDeviceWrapper.build().entityDTO(fwDevice)));
    }
    /**
     * 设备表 新增或修改
     */
@@ -134,7 +135,7 @@
    @ApiOperationSupport(order = 4)
    @ApiOperation(value = "修改设备出入库状态", notes = "传入fwDevice")
    public R updateTrackStatus(@ApiParam(value = "", required = true) @RequestParam Long deviceId) {
        return R.status(fwDeviceService.updateTrackStatusByDeviceId(deviceId,0,""));
        return R.status(fwDeviceService.updateTrackStatusByDeviceId(deviceId, 0, "", ""));
    }
    /**
@@ -149,6 +150,7 @@
    /**
     * 设备类型统计
     *
     * @return 统计数据
     */
    @GetMapping("/statisticalDeviceType")
@@ -160,6 +162,7 @@
    /**
     * 设备出库去向统计
     *
     * @return 统计数据
     */
    @GetMapping("/statisticalDeviceOut")
@@ -174,6 +177,7 @@
    /**
     * 设备生产厂商统计
     *
     * @return 统计数据
     */
    @GetMapping("/statisticalDeviceManufacturer")
@@ -185,8 +189,9 @@
    /**
     * 查询非本部门区域的设备
     *
     * @param regionCode 区域编码,用于查询不在该区域内的设备
     * @param deptId 机构ID,用于限定查询范围
     * @param deptId     机构ID,用于限定查询范围
     * @return 设备列表
     */
    @GetMapping("/nonDeptAreaDevices")
@@ -197,8 +202,8 @@
        @ApiImplicitParam(name = "deptId", value = "机构ID", paramType = "query", dataType = "string", required = true)
    })
    public R<List<FwDeviceVO>> getNonDeptAreaDevices(
            @ApiParam(value = "区域编码", required = true) @RequestParam String regionCode,
            @ApiParam(value = "机构ID", required = true) @RequestParam String deptId) {
        @ApiParam(value = "区域编码", required = true) @RequestParam String regionCode,
        @ApiParam(value = "机构ID", required = true) @RequestParam String deptId) {
        return R.data(fwDeviceService.getNonDeptAreaDevices(regionCode, deptId));
    }
@@ -225,7 +230,7 @@
    @ApiIgnore
    public void exportFwDevice(@ApiIgnore @RequestParam Map<String, Object> fwDevice, BladeUser bladeUser, HttpServletResponse response) {
        QueryWrapper<FwDeviceEntity> queryWrapper = Condition.getQueryWrapper(fwDevice, FwDeviceEntity.class);
        //if (!AuthUtil.isAdministrator()) {
        // if (!AuthUtil.isAdministrator()) {
        //    queryWrapper.lambda().eq(FwDevice::getTenantId, bladeUser.getTenantId());
        //}
        queryWrapper.lambda().eq(FwDeviceEntity::getIsDeleted, BladeConstant.DB_NOT_DELETED);
drone-service/drone-fw/src/main/java/org/sxkj/fw/device/dto/FwDeviceDTO.java
@@ -19,12 +19,13 @@
import java.util.Date;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotEmpty;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import org.sxkj.fw.common.FwBaseInfo;
/**
 * 设备表 数据传输对象实体类
@@ -33,7 +34,7 @@
 * @since 2026-01-08
 */
@Data
public class FwDeviceDTO implements Serializable {
public class FwDeviceDTO extends FwBaseInfo implements Serializable {
    private static final long serialVersionUID = 1L;
@@ -143,13 +144,6 @@
    @ApiModelProperty(value = "经度")
    private String longitude;
    @ApiModelProperty(value = "部门集合",hidden = true)
    private List<Long> deptList;
    // 当前用户部门id
    @ApiModelProperty(value = "部门id",hidden = true)
    private String currentDeptId;
    /**
     * 创建人
     */
@@ -180,8 +174,5 @@
     */
    @ApiModelProperty(value = "删除标志(0存在 1删除)")
    private Integer isDeleted;
    // setRegionName
    @ApiModelProperty(value = "区域名称")
    private String regionName;
}
drone-service/drone-fw/src/main/java/org/sxkj/fw/device/dto/FwDeviceTrackDTO.java
@@ -55,6 +55,12 @@
     */
    @ApiModelProperty(value = "出库去向")
    private String outTarget;
    /**
     * 出库去向
     */
    @ApiModelProperty(value = "出库去向编码")
    private String outTargetCode;
    /**
     * 用途
     */
drone-service/drone-fw/src/main/java/org/sxkj/fw/device/entity/FwDeviceTrackEntity.java
@@ -52,6 +52,12 @@
     */
    @ApiModelProperty(value = "出库去向")
    private String outTarget;
    /**
     * 出库去向
     */
    @ApiModelProperty(value = "出库去向编码")
    private String outTargetCode;
    /**
     * 用途
     */
drone-service/drone-fw/src/main/java/org/sxkj/fw/device/mapper/FwDeviceMapper.java
@@ -79,7 +79,7 @@
     * 设备统计 - 驾驶舱使用
     * @return 统计数据
     */
    List<DeviceStatisticsVO> statisticalDeviceType(String regionName, String currentDeptId);
    List<DeviceStatisticsVO> statisticalDeviceType(String regionCode, String currentDeptId);
    /**
     * 设备统计 - 按类型统计
@@ -103,7 +103,7 @@
     * 告警统计
     * @return
     */
    AlarmStatisticsVO statisticalDeviceAtt(String regionName, String currentDeptId);
    AlarmStatisticsVO statisticalDeviceAtt(String regionCode, String currentDeptId);
    /**
     * 获取设备列表
@@ -120,7 +120,7 @@
     * @param trackStatus 出入库状态
     * @return 影响行数
     */
    int updateTrackStatusByDeviceId(@Param("deviceId") Long deviceId, @Param("trackStatus") Integer trackStatus, @Param("outTarget") String outTarget);
    int updateTrackStatusByDeviceId(@Param("deviceId") Long deviceId, @Param("trackStatus") Integer trackStatus, @Param("outTarget") String outTarget, @Param("outTargetCode") String outTargetCode);
    /**
     * 查询非本部门区域的设备
@@ -129,4 +129,11 @@
     * @return 设备列表
     */
    List<FwDeviceVO> selectNonDeptAreaDevices(@Param("regionName") String regionName, @Param("currentDeptId") String currentDeptId);
    /**
     *
     * @param fwDeviceDTO
     * @return
     */
    List<DeviceStatisticsVO> getDeviceStatistics(FwDeviceDTO fwDeviceDTO);
}
drone-service/drone-fw/src/main/java/org/sxkj/fw/device/mapper/FwDeviceMapper.xml
@@ -250,8 +250,8 @@
                d.is_deleted = 0
                AND d.is_enabled = 1
                AND status != 3
            <if test="regionName != null and regionName != ''">
                and (d.final_outbound_area = #{regionName}
            <if test="regionCode != null and regionCode != ''">
                and (d.final_outbound_area_code like concat(#{regionCode}, '%')
                <!-- 或者设备是共享给当前部门的 -->
                <if test="currentDeptId != null and currentDeptId != '' ">
                    or d.id in (
@@ -281,8 +281,8 @@
                AND is_enabled = 1
                AND status != 3
                AND device_type = '3'
            <if test="regionName != null and regionName != ''">
                and (d.final_outbound_area = #{regionName}
            <if test="regionCode != null and regionCode != ''">
                and (d.final_outbound_area_code like concat(#{regionCode}, '%')
                <!-- 或者设备是共享给当前部门的 -->
                <if test="currentDeptId != null and currentDeptId != '' ">
                    or d.id in (
@@ -338,10 +338,6 @@
            d.is_deleted = 0
            AND d.is_enabled = 1
            AND d.final_outbound_area IS NOT NULL
        <!-- <if test="effectiveRangeKmIsNotNull != null and effectiveRangeKmIsNotNull == 1"> -->
        <!--     and d.effective_range_km is not null -->
        <!--     and d.effective_range_km > 0 -->
        <!-- </if> -->
        <if test="effectiveRangeKmIsNotNull != null and effectiveRangeKmIsNotNull == 2">
            and (d.effective_range_km is null or d.effective_range_km = 0)
        </if>
@@ -393,8 +389,8 @@
             WHERE
                 d.is_deleted = 0
               and d.is_enabled = 1
                <if test="regionName != null and regionName != ''">
                    and (d.final_outbound_area = #{regionName}
                <if test="regionCode != null and regionCode != ''">
                    and (d.final_outbound_area_code like concat(#{regionCode},'%')
                    <!-- 或者设备是共享给当前部门的 -->
                    <if test="currentDeptId != null and currentDeptId != '' ">
                        or d.id in (
@@ -415,8 +411,8 @@
                 d.is_deleted = 0
               and d.is_enabled = 1
               AND device_att = '1'
                <if test="regionName != null and regionName != ''">
                and (d.final_outbound_area = #{regionName}
            <if test="regionCode != null and regionCode != ''">
                and (d.final_outbound_area_code like concat(#{regionCode},'%')
                <!-- 或者设备是共享给当前部门的 -->
                    <if test="currentDeptId != null and currentDeptId != '' ">
                        or d.id in (
@@ -436,8 +432,8 @@
             WHERE d.is_deleted = 0
               and d.is_enabled = 1
               AND device_att = '2'
            <if test="regionName != null and regionName != ''">
                and (d.final_outbound_area = #{regionName}
            <if test="regionCode != null and regionCode != ''">
                and (d.final_outbound_area_code like concat(#{regionCode},'%')
                <!-- 或者设备是共享给当前部门的 -->
                <if test="currentDeptId != null and currentDeptId != '' ">
                    or d.id in (
@@ -456,8 +452,8 @@
             WHERE d.is_deleted = 0
               and d.is_enabled = 1
               AND device_att = '3'
                <if test="regionName != null and regionName != ''">
                    and (d.final_outbound_area = #{regionName}
            <if test="regionCode != null and regionCode != ''">
                and (d.final_outbound_area_code like concat(#{regionCode},'%')
                    <!-- 或者设备是共享给当前部门的 -->
                    <if test="currentDeptId != null and currentDeptId != '' ">
                        or d.id in (
@@ -476,8 +472,8 @@
             WHERE d.is_deleted = 0
               and d.is_enabled = 1
               AND status in ('1', '2', '3' )
                <if test="regionName != null and regionName != ''">
                    and (d.final_outbound_area = #{regionName}
            <if test="regionCode != null and regionCode != ''">
                and (d.final_outbound_area_code like concat(#{regionCode},'%')
                    <!-- 或者设备是共享给当前部门的 -->
                    <if test="currentDeptId != null and currentDeptId != '' ">
                        or d.id in (
@@ -499,8 +495,8 @@
        <where>
            d.is_deleted = 0
            and d.is_enabled = 1
            <if test="param2.regionName != null and param2.regionName != ''">
                and (d.final_outbound_area = #{param2.regionName}
            <if test="param2.regionCode != null and param2.regionCode != ''">
                and (d.final_outbound_area_code like concat(#{param2.regionCode},'%')
                <!-- 或者设备是共享给当前部门的 -->
                <if test="param2.currentDeptId != null and param2.currentDeptId != '' ">
                    or d.id in (
@@ -563,7 +559,8 @@
        update
            ja_fw_device
        set track_status = #{trackStatus},
            final_outbound_area = #{outTarget}
            final_outbound_area = #{outTarget},
            final_outbound_area_code = #{outTargetCode}
        where id = #{deviceId}
          and is_deleted = 0
    </update>
@@ -592,4 +589,29 @@
          AND d.final_outbound_area != #{regionName}
    </select>
    <select id="getDeviceStatistics" resultType="org.sxkj.fw.cockpit.vo.DeviceStatisticsVO">
        SELECT
            d.final_outbound_area AS type,
            COUNT(*) AS count
        FROM
            ja_fw_device d
        WHERE
            d.is_deleted = 0
        AND d.is_enabled = 1
        AND d.final_outbound_area IS NOT NULL
        <if test="regionCode != null and regionCode != ''">
            and ( d.final_outbound_area_code like concat(#{regionCode},'%')
            <if test="currentDeptId != null and currentDeptId != '' ">
                or d.id in (
                SELECT device_id FROM ja_fw_device_per_share
                WHERE loan_to_dept_id = #{currentDeptId}
                AND is_deleted = 0
                )
            </if>
            )
        </if>
        GROUP BY
        d.final_outbound_area
    </select>
</mapper>
drone-service/drone-fw/src/main/java/org/sxkj/fw/device/service/IFwDeviceService.java
@@ -89,7 +89,7 @@
     * 设备类型统计
     * @return
     */
    List<DeviceStatisticsVO> statisticalDeviceType(String regionName, String currentDeptId);
    List<DeviceStatisticsVO> statisticalDeviceType(String regionCode, String currentDeptId);
    /**
     * 设备统计 - 按类型统计
@@ -113,7 +113,7 @@
     * 设备报警统计
     * @return
     */
    AlarmStatisticsVO statisticalDeviceAtt(String regionName, String currentDeptId);
    AlarmStatisticsVO statisticalDeviceAtt(String regionCode, String currentDeptId);
    /**
     * 驾驶舱获取设备列表
@@ -153,7 +153,7 @@
     * @param trackStatus 出入库状态
     * @return 是否更新成功
     */
    boolean updateTrackStatusByDeviceId(Long deviceId, Integer trackStatus, String outTarget);
    boolean updateTrackStatusByDeviceId(Long deviceId, Integer trackStatus, String outTarget, String outTargetCode);
    /**
     * 查询非本部门区域的设备
@@ -163,4 +163,11 @@
     * @return 设备列表
     */
    List<FwDeviceVO> getNonDeptAreaDevices(String regionCode, String deptId);
    /**
     *
     * @param fwDeviceDTO
     * @return
     */
    List<DeviceStatisticsVO> getDeviceStatistics(FwDeviceDTO fwDeviceDTO);
}
drone-service/drone-fw/src/main/java/org/sxkj/fw/device/service/impl/FwDeviceServiceImpl.java
@@ -130,8 +130,8 @@
     * @return
     */
    @Override
    public List<DeviceStatisticsVO> statisticalDeviceType(String regionName, String currentDeptId) {
        return baseMapper.statisticalDeviceType(regionName, currentDeptId);
    public List<DeviceStatisticsVO> statisticalDeviceType(String regionCode, String currentDeptId) {
        return baseMapper.statisticalDeviceType(regionCode, currentDeptId);
    }
    /**
@@ -167,8 +167,8 @@
     * @return
     */
    @Override
    public AlarmStatisticsVO statisticalDeviceAtt(String regionName, String currentDeptId) {
        return baseMapper.statisticalDeviceAtt(regionName, currentDeptId);
    public AlarmStatisticsVO statisticalDeviceAtt(String regionCode, String currentDeptId) {
        return baseMapper.statisticalDeviceAtt(regionCode, currentDeptId);
    }
    @Override
@@ -198,8 +198,8 @@
    }
    @Override
    public boolean updateTrackStatusByDeviceId(Long deviceId, Integer trackStatus, String outTarget) {
        return baseMapper.updateTrackStatusByDeviceId(deviceId, trackStatus, outTarget) > 0;
    public boolean updateTrackStatusByDeviceId(Long deviceId, Integer trackStatus, String outTarget, String outTargetCode) {
        return baseMapper.updateTrackStatusByDeviceId(deviceId, trackStatus, outTarget, outTargetCode) > 0;
    }
    /**
@@ -218,4 +218,9 @@
        List<FwDeviceVO> deviceList = baseMapper.selectNonDeptAreaDevices(regionName, deptId);
        return deviceList;
    }
    @Override
    public List<DeviceStatisticsVO> getDeviceStatistics(FwDeviceDTO fwDeviceDTO) {
        return baseMapper.getDeviceStatistics(fwDeviceDTO);
    }
}
drone-service/drone-fw/src/main/java/org/sxkj/fw/device/service/impl/FwDeviceTrackServiceImpl.java
@@ -64,7 +64,7 @@
    public boolean saveOrUpdateFwDeviceTrack(FwDeviceTrackEntity fwDeviceTrackEntity) {
        boolean b = saveOrUpdate(fwDeviceTrackEntity);
        if (b) {
            return fwDeviceService.updateTrackStatusByDeviceId(fwDeviceTrackEntity.getDeviceId(), 1, fwDeviceTrackEntity.getOutTarget());
            return fwDeviceService.updateTrackStatusByDeviceId(fwDeviceTrackEntity.getDeviceId(), 1, fwDeviceTrackEntity.getOutTarget(),fwDeviceTrackEntity.getOutTargetCode());
        }
        return false;
    }
drone-service/drone-fw/src/main/java/org/sxkj/fw/record/dto/FwDroneAlarmRecordDTO.java
@@ -159,7 +159,10 @@
    // 当前用户部门ID
    @ApiModelProperty(value = "当前用户部门ID",hidden = true)
    private String currentDeptId;
    // regionName
    @ApiModelProperty(value = "regionName",hidden = true)
    private String regionName;
    @ApiModelProperty(value = "regionCode",hidden = true)
    private String regionCode;
}
drone-service/drone-fw/src/main/java/org/sxkj/fw/record/mapper/FwDroneAlarmRecordMapper.java
@@ -58,5 +58,5 @@
     * 告警类型统计
     * @return
     */
    AlarmStatisticsVO alarmTypeStatistics(String regionName, String currentDeptId);
    AlarmStatisticsVO alarmTypeStatistics(String regionCode, String currentDeptId);
}
drone-service/drone-fw/src/main/java/org/sxkj/fw/record/mapper/FwDroneAlarmRecordMapper.xml
@@ -57,8 +57,8 @@
        <where>
                dar.is_deleted = 0
                and d.is_enabled = 1
            <if test="param2.regionName != null and param2.regionName != ''">
                and (d.final_outbound_area = #{param2.regionName}
            <if test="param2.regionCode != null and param2.regionCode != ''">
                and (d.final_outbound_area_code like CONCAT(#{param2.regionCode}, '%')
                <!-- 或者设备是共享给当前部门的 -->
                <if test="param2.currentDeptId != null and param2.currentDeptId != '' ">
                    or dar.device_id in (
@@ -173,8 +173,8 @@
        WHERE dar.is_deleted = 0
            AND d.is_deleted = 0
            and d.is_enabled = 1
        <if test="regionName != null and regionName != ''">
            and (d.final_outbound_area = #{regionName}
        <if test="regionCode != null and regionCode != ''">
            and (d.final_outbound_area_code like CONCAT(#{regionCode}, '%')
            <!-- 或者设备是共享给当前部门的 -->
            <if test="currentDeptId != null and currentDeptId != '' ">
                or dar.device_id in (
drone-service/drone-fw/src/main/java/org/sxkj/fw/record/service/IFwDroneAlarmRecordService.java
@@ -56,5 +56,5 @@
     *
     * @return
     */
    AlarmStatisticsVO alarmTypeStatistics(String regionName, String currentDeptId);
    AlarmStatisticsVO alarmTypeStatistics(String regionCode, String currentDeptId);
}
drone-service/drone-fw/src/main/java/org/sxkj/fw/record/service/impl/FwDroneAlarmRecordServiceImpl.java
@@ -17,6 +17,7 @@
package org.sxkj.fw.record.service.impl;
import org.springblade.core.secure.utils.AuthUtil;
import org.sxkj.common.utils.HeaderUtils;
import org.sxkj.fw.cockpit.vo.AlarmStatisticsVO;
import org.sxkj.fw.record.dto.FwDroneAlarmRecordDTO;
import org.sxkj.fw.record.entity.FwDroneAlarmRecordEntity;
@@ -56,13 +57,13 @@
        Dept dept = SysCache.getDept(Long.valueOf(AuthUtil.getDeptId()));
        // 3. 查询不在这些部门区域内的设备
        Region byCode = RegionCache.getByCode(dept.getAreaCode());
        String regionName = byCode.getName();
        fwDroneAlarmRecord.setRegionName(regionName);
        fwDroneAlarmRecord.setRegionName(byCode.getName());
        fwDroneAlarmRecord.setCurrentDeptId(AuthUtil.getDeptId());
        fwDroneAlarmRecord.setRegionCode(HeaderUtils.formatAreaCode(byCode.getCode()));
        // 获取当前部门及其子部门列表
        // List<Long> deptList = SysCache.getDeptChildIds(Long.valueOf(AuthUtil.getDeptId()));
        // fwDroneAlarmRecord.setDeptList(deptList);
        // 获取共享给当前部门的设备编号列表
        fwDroneAlarmRecord.setCurrentDeptId(AuthUtil.getDeptId());
        // 执行查询
        return page.setRecords(baseMapper.selectFwDroneAlarmRecordPage(page, fwDroneAlarmRecord));
    }
@@ -80,7 +81,7 @@
     * @return
     */
    @Override
    public AlarmStatisticsVO alarmTypeStatistics(String regionName, String currentDeptId) {
        return baseMapper.alarmTypeStatistics(regionName, currentDeptId);
    public AlarmStatisticsVO alarmTypeStatistics(String regionCode, String currentDeptId) {
        return baseMapper.alarmTypeStatistics(regionCode, currentDeptId);
    }
}