From 1bfbc52da47b22f00a1c1f5f670c30f70d999873 Mon Sep 17 00:00:00 2001
From: linwei <872216696@qq.com>
Date: Mon, 02 Feb 2026 18:18:09 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
drone-service/drone-fw/src/main/java/org/sxkj/fw/area/controller/FwDefenseZoneController.java | 67 ++++++++++++++++++++-------------
1 files changed, 40 insertions(+), 27 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 9196505..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,38 +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.wrapper.FwDefenseZoneWrapper;
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;
/**
* 防区管理表 控制器
@@ -73,8 +73,28 @@
if (id == null) {
return R.fail("主键不能为空");
}
- FwDefenseZoneEntity detail = fwDefenseZoneService.getById(id);
- return R.data(FwDefenseZoneWrapper.build().entityVO(detail));
+ FwDefenseZoneVO detail = fwDefenseZoneService.selectFwDefenseZoneDetail(id);
+ if (detail == null) {
+ 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);
}
// /**
// * 防区管理表 分页
@@ -93,7 +113,7 @@
@GetMapping("/page")
@ApiOperationSupport(order = 3)
@ApiOperation(value = "分页", notes = "传入fwDefenseZone")
- public R<IPage<FwDefenseZoneVO>> page(FwDefenseZoneVO fwDefenseZone, Query query) {
+ public R<IPage<FwDefenseZoneVO>> page(FwDefenseZoneDTO fwDefenseZone, Query query) {
IPage<FwDefenseZoneVO> pages = fwDefenseZoneService.selectFwDefenseZonePage(Condition.getPage(query), fwDefenseZone);
return R.data(pages);
}
@@ -134,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));
@@ -168,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