From b3edfcbd0267cf66d4a908d47dbe5d97533dcb33 Mon Sep 17 00:00:00 2001
From: xiebin <vip_xiaobin810@163.com>
Date: Fri, 30 Jan 2026 09:47:37 +0800
Subject: [PATCH] update-场景管理

---
 drone-service/drone-fw/src/main/java/org/sxkj/fw/area/service/impl/FwPoliceStationServiceImpl.java |   41 ++++++++++++++++++++++++++++++++++++-----
 1 files changed, 36 insertions(+), 5 deletions(-)

diff --git a/drone-service/drone-fw/src/main/java/org/sxkj/fw/area/service/impl/FwPoliceStationServiceImpl.java b/drone-service/drone-fw/src/main/java/org/sxkj/fw/area/service/impl/FwPoliceStationServiceImpl.java
index 4ab5ffd..8fb7c3f 100644
--- a/drone-service/drone-fw/src/main/java/org/sxkj/fw/area/service/impl/FwPoliceStationServiceImpl.java
+++ b/drone-service/drone-fw/src/main/java/org/sxkj/fw/area/service/impl/FwPoliceStationServiceImpl.java
@@ -17,6 +17,7 @@
 package org.sxkj.fw.area.service.impl;
 
 import org.springblade.core.secure.utils.AuthUtil;
+import org.springblade.core.tool.utils.StringUtil;
 import org.sxkj.common.utils.HeaderUtils;
 import org.sxkj.fw.area.entity.FwPoliceStationEntity;
 import org.sxkj.fw.area.vo.FwPoliceStationVO;
@@ -44,6 +45,11 @@
 		return page.setRecords(baseMapper.selectFwPoliceStationPage(page, fwPoliceStation));
 	}
 
+	@Override
+	public List<FwPoliceStationVO> selectFwPoliceStationList() {
+		return baseMapper.selectFwPoliceStationList();
+	}
+
 
 	@Override
 	public List<FwPoliceStationExcel> exportFwPoliceStation(Wrapper<FwPoliceStationEntity> queryWrapper) {
@@ -52,6 +58,12 @@
 		//	fwPoliceStation.setTypeName(DictCache.getValue(DictEnum.YES_NO, FwPoliceStation.getType()));
 		//});
 		return fwPoliceStationList;
+	}
+
+	@Override
+	public List<FwPoliceStationVO> selectByPolygons(List<String> polygons) {
+		// 仅做空间过滤,具体坐标规则由 SQL 处理
+		return baseMapper.selectByPolygons(polygons);
 	}
 
 	@Override
@@ -77,20 +89,39 @@
 	}
 
 	private void fillCreateFields(FwPoliceStationEntity fwPoliceStation) {
+		// 创建/更新基础审计字段统一设置
 		Long userId = AuthUtil.getUserId();
-		Long deptId = Long.valueOf(AuthUtil.getDeptId());
-		String areaCode = HeaderUtils.getAreaCode();
+		String deptIdStr = AuthUtil.getDeptId();
+		Long deptId = null;
+		if (StringUtil.isNotBlank(deptIdStr)) {
+			try {
+				deptId = Long.valueOf(deptIdStr);
+			} catch (NumberFormatException ignored) {
+				deptId = null;
+			}
+		}
+//		String areaCode = HeaderUtils.getAreaCode();
+//		if (StringUtil.isBlank(areaCode)) {
+//			areaCode = fwPoliceStation.getAreaCode();
+//		}
 		Date now = new Date();
 		fwPoliceStation.setCreateUser(userId);
 		fwPoliceStation.setUpdateUser(userId);
-		fwPoliceStation.setCreateDept(deptId);
-		fwPoliceStation.setAreaCode(areaCode);
+		if (deptId != null) {
+			fwPoliceStation.setCreateDept(deptId);
+		}
+//		if (StringUtil.isNotBlank(areaCode)) {
+//			fwPoliceStation.setAreaCode(areaCode);
+//		}
 		fwPoliceStation.setCreateTime(now);
 		fwPoliceStation.setUpdateTime(now);
 	}
 
 	private void fillUpdateFields(FwPoliceStationEntity fwPoliceStation) {
-		fwPoliceStation.setUpdateUser(AuthUtil.getUserId());
+		Long userId = AuthUtil.getUserId();
+		if (userId != null) {
+			fwPoliceStation.setUpdateUser(userId);
+		}
 		fwPoliceStation.setUpdateTime(new Date());
 	}
 

--
Gitblit v1.9.3