From 74756c657109a4e48dd6c0b4d8959cdab89b33a9 Mon Sep 17 00:00:00 2001
From: xiebin <vip_xiaobin810@163.com>
Date: Wed, 28 Jan 2026 20:10:29 +0800
Subject: [PATCH] update-区域划分表结构调整

---
 drone-service/drone-fw/src/main/java/org/sxkj/fw/area/service/impl/FwPoliceStationServiceImpl.java |   34 +++++++++++++++++++++++++++++-----
 1 files changed, 29 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..c9aae7c 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;
@@ -42,6 +43,11 @@
 	@Override
 	public IPage<FwPoliceStationVO> selectFwPoliceStationPage(IPage<FwPoliceStationVO> page, FwPoliceStationVO fwPoliceStation) {
 		return page.setRecords(baseMapper.selectFwPoliceStationPage(page, fwPoliceStation));
+	}
+
+	@Override
+	public List<FwPoliceStationVO> selectFwPoliceStationList() {
+		return baseMapper.selectFwPoliceStationList();
 	}
 
 
@@ -78,19 +84,37 @@
 
 	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