| | |
| | | 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; |
| | |
| | | @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)); |
| | |
| | | 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"); |
| | | } |
| | | |
| | | } |