From 5ffef9d17c009c3ebc5d3997d8b356842bcc759f Mon Sep 17 00:00:00 2001
From: linwei <872216696@qq.com>
Date: Sat, 17 Jan 2026 11:08:16 +0800
Subject: [PATCH] 面校验工具类优化
---
drone-service/drone-fw/src/main/java/org/sxkj/fw/area/controller/FwDefenseZoneController.java | 10 ++--------
1 files changed, 2 insertions(+), 8 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 8235ecb..b31cc36 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
@@ -33,6 +33,7 @@
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.FwAreaDivideVO;
@@ -154,7 +155,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));
@@ -188,12 +189,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