Conflicts: ruoyi-business/src/main/resources/mapper/resource/TResourceLandMapper.xmlmaster
| @@ -14,6 +14,7 @@ import com.ruoyi.common.utils.ServletUtils; | |||||
| import com.ruoyi.common.utils.StringUtils; | import com.ruoyi.common.utils.StringUtils; | ||||
| import com.ruoyi.common.utils.pdf.PdfUtils; | import com.ruoyi.common.utils.pdf.PdfUtils; | ||||
| import com.ruoyi.common.utils.poi.ExcelUtil; | import com.ruoyi.common.utils.poi.ExcelUtil; | ||||
| import com.ruoyi.common.utils.space.SpaceUtils; | |||||
| import com.ruoyi.common.utils.translation.TranslateUtils; | import com.ruoyi.common.utils.translation.TranslateUtils; | ||||
| import com.ruoyi.framework.web.service.TokenService; | import com.ruoyi.framework.web.service.TokenService; | ||||
| import com.ruoyi.resource.domain.TResourceLand; | import com.ruoyi.resource.domain.TResourceLand; | ||||
| @@ -230,6 +231,13 @@ public class TResourceLandController extends BaseController | |||||
| @PostMapping("/update") | @PostMapping("/update") | ||||
| public AjaxResult edit(@RequestBody TResourceLand tResourceLand) | public AjaxResult edit(@RequestBody TResourceLand tResourceLand) | ||||
| { | { | ||||
| if (tResourceLand.getTheGeom() != null && tResourceLand.getTheGeom().substring(0, 1).equals("[")) { | |||||
| //坐标转换 | |||||
| String houseApplyProposedSituations = SpaceUtils.space(tResourceLand.getTheGeom()); | |||||
| tResourceLand.setTheGeom(houseApplyProposedSituations); | |||||
| } else { | |||||
| tResourceLand.setTheGeom(null); | |||||
| } | |||||
| return toAjax(tResourceLandService.updateTResourceLand(tResourceLand)); | return toAjax(tResourceLandService.updateTResourceLand(tResourceLand)); | ||||
| } | } | ||||
| @@ -244,6 +252,12 @@ public class TResourceLandController extends BaseController | |||||
| return toAjax(tResourceLandService.deleteTResourceLandByFids(fids)); | return toAjax(tResourceLandService.deleteTResourceLandByFids(fids)); | ||||
| } | } | ||||
| @Log(title = "空间字段置空", businessType = BusinessType.UPDATE) | |||||
| @GetMapping("/clear/{fid}") | |||||
| public AjaxResult clearTheGeom(@PathVariable("fid") Long fid) { | |||||
| return toAjax(tResourceLandService.clearTheGeom(fid)); | |||||
| } | |||||
| /** | /** | ||||
| * 打印地块属性 | * 打印地块属性 | ||||
| */ | */ | ||||
| @@ -82,6 +82,15 @@ public class SysDeptController extends BaseController { | |||||
| return success(deptService.selectDeptById(deptId)); | return success(deptService.selectDeptById(deptId)); | ||||
| } | } | ||||
| /** | |||||
| * 根据部门编号获取详细信息 | |||||
| */ | |||||
| @PreAuthorize("@ss.hasPermi('system:dept:query')") | |||||
| @GetMapping(value = "/getInfoByCode/{orgCode}") | |||||
| public AjaxResult getInfoByCode(@PathVariable String orgCode) { | |||||
| return success(deptService.selectDeptByOrgCode(orgCode)); | |||||
| } | |||||
| /** | /** | ||||
| * 新增部门 | * 新增部门 | ||||
| */ | */ | ||||
| @@ -82,4 +82,12 @@ public interface TResourceLandMapper | |||||
| * @return 结果 | * @return 结果 | ||||
| */ | */ | ||||
| public int deleteTResourceLandByFids(Long[] fids); | public int deleteTResourceLandByFids(Long[] fids); | ||||
| /** | |||||
| * 清空theGeom字段 | |||||
| * | |||||
| * @param fid | |||||
| * @return | |||||
| */ | |||||
| public int clearTheGeom(Long fid); | |||||
| } | } | ||||
| @@ -92,4 +92,12 @@ public interface ITResourceLandService | |||||
| * @return 结果 | * @return 结果 | ||||
| */ | */ | ||||
| public int deleteTResourceLandByFid(Long fid); | public int deleteTResourceLandByFid(Long fid); | ||||
| /** | |||||
| * 清空theGeom字段 | |||||
| * | |||||
| * @param fid | |||||
| * @return | |||||
| */ | |||||
| public int clearTheGeom(Long fid); | |||||
| } | } | ||||
| @@ -232,4 +232,15 @@ public class TResourceLandServiceImpl implements ITResourceLandService | |||||
| { | { | ||||
| return tResourceLandMapper.deleteTResourceLandByFid(fid); | return tResourceLandMapper.deleteTResourceLandByFid(fid); | ||||
| } | } | ||||
| /** | |||||
| * 清空theGeom字段 | |||||
| * | |||||
| * @param fid | |||||
| * @return | |||||
| */ | |||||
| @Override | |||||
| public int clearTheGeom(Long fid) { | |||||
| return tResourceLandMapper.clearTheGeom(fid); | |||||
| } | |||||
| } | } | ||||
| @@ -0,0 +1,61 @@ | |||||
| package com.ruoyi.common.utils.space; | |||||
| import java.util.ArrayList; | |||||
| /** | |||||
| * author:Administrator | |||||
| * date2021/7/16 | |||||
| * | |||||
| * @description; | |||||
| */ | |||||
| public class SpaceUtils { | |||||
| //面坐标装换 | |||||
| public static String space(String theGeom){ | |||||
| //判断获取到数据是否是地图画质坐标,画制坐标第一位传入是:[ 否:M | |||||
| if((theGeom != null && theGeom.startsWith("[") && theGeom !="")) { | |||||
| //删除无用坐标数组括号 | |||||
| String theGeom_left = theGeom.replaceAll("\\[", ""); | |||||
| String theGeom_right = theGeom_left.replaceAll("]", ""); | |||||
| String theGeomZb = null; | |||||
| ArrayList theGeomList = new ArrayList(); | |||||
| //按照逗号拆分传入数组 | |||||
| String[] theGeomListLists = theGeom_right.split(","); | |||||
| int bb = theGeomListLists.length - 1; //数组循环少循环一次 否则数组越界 | |||||
| for (int i = 0; i < bb; i++) { | |||||
| //前一位与后一位数组拼接 | |||||
| theGeomZb = theGeomListLists[i] + " " + theGeomListLists[++i]; | |||||
| theGeomList.add(theGeomZb); | |||||
| } | |||||
| //拼接需要保存坐标MULTIPOLYGON | |||||
| String startMultipolygon = "MULTIPOLYGON((("; | |||||
| String endMultipolygon = ")))"; | |||||
| String allMultipolygon = startMultipolygon + theGeomList + endMultipolygon; | |||||
| allMultipolygon = allMultipolygon.replaceAll("\\[", ""); | |||||
| allMultipolygon = allMultipolygon.replaceAll("]", ""); | |||||
| return theGeom =allMultipolygon; | |||||
| } else { | |||||
| //没有编辑图像则 the_geom空间数据不更新 | |||||
| return theGeom =null; | |||||
| } | |||||
| } | |||||
| //点坐标装换 | |||||
| public static String point(String theGeom){ | |||||
| //判断获取到数据是否是地图画质坐标,画制坐标第一位传入是:[ 否:M | |||||
| if((theGeom != null && theGeom.startsWith("[") && theGeom !="")) { | |||||
| //删除无用坐标数组括号 | |||||
| //坐标转换 | |||||
| String theGeom_left = theGeom.replaceAll("\\[", ""); | |||||
| String theGeom_right = theGeom_left.replaceAll("]", ""); | |||||
| String pointMap = theGeom_right.replaceAll(",", " "); | |||||
| String point = "POINT(" + pointMap + ")"; | |||||
| return point; | |||||
| }else { | |||||
| //没有编辑图像则 the_geom空间数据不更新 | |||||
| return null; | |||||
| } | |||||
| } | |||||
| } | |||||