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/controller/FwDefenseZoneController.java | 57 ++++++++++++++++++++++++++++++++++-----------------------
1 files changed, 34 insertions(+), 23 deletions(-)
diff --git a/drone-service/drone-fw/src/main/java/org/sxkj/fw/area/controller/FwDefenseZoneController.java b/drone-service/drone-fw/src/main/java/org/sxkj/fw/area/controller/FwDefenseZoneController.java
index 7e79f1d..cc0d338 100644
--- a/drone-service/drone-fw/src/main/java/org/sxkj/fw/area/controller/FwDefenseZoneController.java
+++ b/drone-service/drone-fw/src/main/java/org/sxkj/fw/area/controller/FwDefenseZoneController.java
@@ -16,37 +16,38 @@
*/
package org.sxkj.fw.area.controller;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
-import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import lombok.AllArgsConstructor;
-import javax.validation.Valid;
-
-import org.springblade.core.secure.BladeUser;
+import org.springblade.core.boot.ctrl.BladeController;
+import org.springblade.core.excel.util.ExcelUtil;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
+import org.springblade.core.secure.BladeUser;
import org.springblade.core.tool.api.R;
+import org.springblade.core.tool.constant.BladeConstant;
import org.springblade.core.tool.utils.BeanUtil;
+import org.springblade.core.tool.utils.DateUtil;
import org.springblade.core.tool.utils.Func;
-import org.springblade.core.tool.utils.StringUtil;
import org.springframework.web.bind.annotation.*;
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.sxkj.common.utils.GeomUtils;
import org.sxkj.fw.area.dto.FwDefenseZoneDTO;
import org.sxkj.fw.area.entity.FwDefenseZoneEntity;
-import org.sxkj.fw.area.vo.FwDefenseZoneVO;
import org.sxkj.fw.area.excel.FwDefenseZoneExcel;
import org.sxkj.fw.area.service.IFwDefenseZoneService;
-import org.springblade.core.boot.ctrl.BladeController;
-import org.springblade.core.tool.utils.DateUtil;
-import org.springblade.core.excel.util.ExcelUtil;
-import org.springblade.core.tool.constant.BladeConstant;
+import org.sxkj.fw.area.vo.FwAreaDivideVO;
+import org.sxkj.fw.area.vo.FwDefenseZoneVO;
import springfox.documentation.annotations.ApiIgnore;
-import java.util.Map;
-import java.util.List;
-import java.util.Objects;
+
import javax.servlet.http.HttpServletResponse;
+import javax.validation.Valid;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
/**
* 防区管理表 控制器
@@ -77,6 +78,23 @@
return R.fail("数据不存在");
}
return R.data(detail);
+ }
+
+ /**
+ * 根据防区id获取区域列表
+ */
+ @GetMapping("/areaList")
+ @ApiOperationSupport(order = 2)
+ @ApiOperation(value = "区域列表", notes = "传入防区id")
+ public R<List<FwAreaDivideVO>> areaList(@ApiParam(value = "防区id", required = true) @RequestParam Long zoneId) {
+ if (zoneId == null) {
+ return R.fail("防区id不能为空");
+ }
+ List<FwAreaDivideVO> list = fwDefenseZoneService.selectFwAreaDivideListByZoneId(zoneId);
+ if (list == null) {
+ return R.fail("防区不存在");
+ }
+ return R.data(list);
}
// /**
// * 防区管理表 分页
@@ -136,7 +154,7 @@
@ApiOperation(value = "新增或修改", notes = "传入fwDefenseZone")
public R submit(@Valid @RequestBody FwDefenseZoneDTO fwDefenseZone) {
FwDefenseZoneEntity entity = Objects.requireNonNull(BeanUtil.copy(fwDefenseZone, FwDefenseZoneEntity.class));
- if (isGeomInvalid(entity.getGeom())) {
+ if (GeomUtils.isGeomInvalid(entity.getGeom())) {
return R.fail("几何数据格式不正确");
}
return R.status(fwDefenseZoneService.saveOrUpdate(entity));
@@ -170,12 +188,5 @@
ExcelUtil.export(response, "防区管理表数据" + DateUtil.time(), "防区管理表数据表", list, FwDefenseZoneExcel.class);
}
- private boolean isGeomInvalid(String geom) {
- if (StringUtil.isBlank(geom)) {
- return false;
- }
- String upper = geom.trim().toUpperCase();
- return !upper.contains("POLYGON");
- }
}
--
Gitblit v1.9.3