drone-service/drone-fw/src/main/java/org/sxkj/fw/area/service/impl/FwAreaDivideExtServiceImpl.java
@@ -61,6 +61,7 @@ if (fwAreaDivideExtList == null || fwAreaDivideExtList.isEmpty()) { return true; } // 批量入库扩展面,geomJson 直接写入 return baseMapper.insertBatchWithGeom(fwAreaDivideExtList) > 0; } drone-service/drone-fw/src/main/java/org/sxkj/fw/area/service/impl/FwAreaDivideServiceImpl.java
@@ -263,6 +263,7 @@ return false; } if (fwAreaDivideExtList != null && !fwAreaDivideExtList.isEmpty()) { // 由扩展面类型key去重生成主表areaTypeKeys String areaTypeKeys = buildAreaTypeKeys(fwAreaDivideExtList); if (StringUtil.isNotBlank(areaTypeKeys)) { fwAreaDivide.setAreaTypeKeys(areaTypeKeys); @@ -372,14 +373,26 @@ if (fwAreaDivideExtList == null || fwAreaDivideExtList.isEmpty()) { return null; } // 保持输入顺序,去重后拼接 Set<String> keySet = new LinkedHashSet<>(); for (FwAreaDivideExtEntity ext : fwAreaDivideExtList) { if (ext == null) { continue; } String key = ext.getAreaTypeKey(); if (StringUtil.isNotBlank(key)) { keySet.add(key); if (StringUtil.isBlank(key)) { continue; } // 兼容前端传入逗号分隔的类型key String[] keyArray = key.split(","); for (String item : keyArray) { if (item == null) { continue; } String value = item.trim(); if (StringUtil.isNotBlank(value)) { keySet.add(value); } } } if (keySet.isEmpty()) { drone-service/drone-fw/src/main/java/org/sxkj/fw/area/service/impl/FwDefenseSceneServiceImpl.java
@@ -78,6 +78,7 @@ areaIdSet.addAll(parseIdList(record.getAreaDivideIds())); } // 汇总场景关联的区域与设备,便于统计设备数量 Map<Long, BigDecimal> areaSizeMap = new HashMap<>(); Map<Long, List<Long>> areaDeviceMap = new HashMap<>(); Set<Long> deviceIdSet = new HashSet<>(); @@ -96,6 +97,7 @@ Map<Long, String> deviceTypeMap = new HashMap<>(); if (!deviceIdSet.isEmpty()) { // 批量拉取设备类型,降低循环查询成本 List<FwDeviceEntity> deviceList = fwDeviceService.listByIds(deviceIdSet); for (FwDeviceEntity device : deviceList) { if (device == null || device.getId() == null) { @@ -168,6 +170,7 @@ if (areaIds == null || areaIds.isEmpty()) { return 0; } // 面积按平方米整数返回 BigDecimal total = BigDecimal.ZERO; for (Long areaId : areaIds) { BigDecimal areaSize = areaSizeMap.get(areaId); drone-service/drone-fw/src/main/java/org/sxkj/fw/area/service/impl/FwDefenseZoneServiceImpl.java
@@ -80,6 +80,7 @@ if (zoneId == null) { return Collections.emptyList(); } // 防区不存在时直接返回空结果 Integer exists = baseMapper.selectDefenseZoneExists(zoneId); if (exists == null || exists == 0) { return null; @@ -95,6 +96,7 @@ if (records == null || records.isEmpty()) { return; } // 组装防区-场景-区域-设备的统计链路 Set<Long> sceneIdSet = new HashSet<>(); Map<Long, List<Long>> zoneSceneMap = new HashMap<>(); for (FwDefenseZoneVO record : records) { @@ -127,6 +129,7 @@ } Map<Long, List<Long>> areaDeviceMap = new HashMap<>(); if (!sceneAreaIdSet.isEmpty()) { // 预加载区域关联的设备ID集合 List<FwAreaDivideEntity> areaList = fwAreaDivideService.listByIds(sceneAreaIdSet); for (FwAreaDivideEntity area : areaList) { if (area == null || area.getId() == null) { drone-service/drone-fw/src/main/java/org/sxkj/fw/area/service/impl/FwPoliceStationServiceImpl.java
@@ -62,6 +62,7 @@ @Override public List<FwPoliceStationVO> selectByPolygons(List<String> polygons) { // 仅做空间过滤,具体坐标规则由 SQL 处理 return baseMapper.selectByPolygons(polygons); } @@ -88,6 +89,7 @@ } private void fillCreateFields(FwPoliceStationEntity fwPoliceStation) { // 创建/更新基础审计字段统一设置 Long userId = AuthUtil.getUserId(); String deptIdStr = AuthUtil.getDeptId(); Long deptId = null; drone-service/drone-fw/src/main/java/org/sxkj/fw/device/service/impl/FwDeviceMaintainPlanServiceImpl.java
@@ -50,6 +50,7 @@ @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)); @@ -71,7 +72,7 @@ return; } // 构建更新条件 // 批量把计划调整为未维护状态 LambdaUpdateWrapper<FwDeviceMaintainPlanEntity> updateWrapper = new LambdaUpdateWrapper<>(); updateWrapper.in(FwDeviceMaintainPlanEntity::getId, planIds) .set(FwDeviceMaintainPlanEntity::getMaintainStatus, 0); // 未维护状态 drone-service/drone-fw/src/main/java/org/sxkj/fw/device/service/impl/FwDeviceMaintainRecordServiceImpl.java
@@ -65,7 +65,7 @@ // 维护时间 Date maintainTime = entity.getMaintainTime(); // 查询计划的规则 // 关联查询维护计划,缺失则不允许保存记录 FwDeviceMaintainPlanEntity fwDeviceMaintainPlan = fwDeviceMaintainPlanService.getById(entity.getPlanId()); if (null == fwDeviceMaintainPlan) { return false; @@ -74,7 +74,7 @@ // 验证维护时间是否符合计划周期 boolean isInCycle = validateMaintainTimeInCycle(maintainTime, fwDeviceMaintainPlan); // 在当前周期内修改计划维修状态 // 在计划周期内才更新计划的维护状态 if (isInCycle) { updatePlanMaintainStatus(fwDeviceMaintainPlan, maintainTime); } drone-service/drone-fw/src/main/java/org/sxkj/fw/device/service/impl/FwDevicePerShareServiceImpl.java
@@ -38,12 +38,14 @@ @Override public IPage<FwDevicePerShareVO> selectFwDevicePerSharePage(IPage<FwDevicePerShareVO> page, FwDevicePerShareVO fwDevicePerShare) { // 分页查询直接透传到 Mapper return page.setRecords(baseMapper.selectFwDevicePerSharePage(page, fwDevicePerShare)); } @Override public List<FwDevicePerShareExcel> exportFwDevicePerShare(Wrapper<FwDevicePerShareEntity> queryWrapper) { // 导出不做额外转换,保持与导出字段一致 List<FwDevicePerShareExcel> fwDevicePerShareList = baseMapper.exportFwDevicePerShare(queryWrapper); //fwDevicePerShareList.forEach(fwDevicePerShare -> { // fwDevicePerShare.setTypeName(DictCache.getValue(DictEnum.YES_NO, FwDevicePerShare.getType())); drone-service/drone-fw/src/main/java/org/sxkj/fw/device/service/impl/FwDeviceServiceImpl.java
@@ -67,6 +67,7 @@ @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); @@ -77,6 +78,7 @@ .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()); @@ -135,18 +137,21 @@ */ @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); } @@ -179,6 +184,7 @@ */ @Override public boolean saveOrUpdateDevice(FwDeviceEntity fwDeviceEntity) { // 无效范围时清空坐标,避免显示无意义位置 if (fwDeviceEntity.getEffectiveRangeKm() == null || fwDeviceEntity.getEffectiveRangeKm().compareTo(BigDecimal.ZERO) == 0) { fwDeviceEntity.setLatitude(""); fwDeviceEntity.setLongitude("");