| @@ -12,6 +12,7 @@ import com.ruoyi.common.enums.BusinessType; | |||
| import com.ruoyi.common.utils.StringUtils; | |||
| import com.ruoyi.common.utils.pdf.PdfUtils; | |||
| import com.ruoyi.common.utils.poi.ExcelUtil; | |||
| import com.ruoyi.common.utils.space.SpaceUtils; | |||
| import com.ruoyi.common.utils.translation.TranslateUtils; | |||
| import com.ruoyi.resource.domain.TResourceLand; | |||
| import com.ruoyi.resource.domain.TResourceOperation; | |||
| @@ -184,6 +185,13 @@ public class TResourceLandController extends BaseController | |||
| @PostMapping("/update") | |||
| 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)); | |||
| } | |||
| @@ -198,6 +206,12 @@ public class TResourceLandController extends BaseController | |||
| 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)); | |||
| } | |||
| /** | |||
| * 根据部门编号获取详细信息 | |||
| */ | |||
| @PreAuthorize("@ss.hasPermi('system:dept:query')") | |||
| @GetMapping(value = "/getInfoByCode/{orgCode}") | |||
| public AjaxResult getInfoByCode(@PathVariable String orgCode) { | |||
| return success(deptService.selectDeptByOrgCode(orgCode)); | |||
| } | |||
| /** | |||
| * 新增部门 | |||
| */ | |||
| @@ -79,4 +79,12 @@ public interface TResourceLandMapper | |||
| * @return 结果 | |||
| */ | |||
| public int deleteTResourceLandByFids(Long[] fids); | |||
| /** | |||
| * 清空theGeom字段 | |||
| * | |||
| * @param fid | |||
| * @return | |||
| */ | |||
| public int clearTheGeom(Long fid); | |||
| } | |||
| @@ -89,4 +89,12 @@ public interface ITResourceLandService | |||
| * @return 结果 | |||
| */ | |||
| public int deleteTResourceLandByFid(Long fid); | |||
| /** | |||
| * 清空theGeom字段 | |||
| * | |||
| * @param fid | |||
| * @return | |||
| */ | |||
| public int clearTheGeom(Long fid); | |||
| } | |||
| @@ -226,4 +226,15 @@ public class TResourceLandServiceImpl implements ITResourceLandService | |||
| { | |||
| return tResourceLandMapper.deleteTResourceLandByFid(fid); | |||
| } | |||
| /** | |||
| * 清空theGeom字段 | |||
| * | |||
| * @param fid | |||
| * @return | |||
| */ | |||
| @Override | |||
| public int clearTheGeom(Long fid) { | |||
| return tResourceLandMapper.clearTheGeom(fid); | |||
| } | |||
| } | |||
| @@ -35,7 +35,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | |||
| </resultMap> | |||
| <sql id="selectTResourceLandVo"> | |||
| select fid, BSM, YSDM, DKBM, DKMC, SYQXZ, DKLB, TDLYLX, DLDJ, TDYT, SFJBNT, DKDZ, DKXZ, DKNZ, DKBZ, DKBZXX, ZJRXM, SCMJ, SCMJM, the_geom, survey_status, import_code, dept_name, create_by, create_time, update_by, update_time from t_resource_land | |||
| select fid, BSM, YSDM, DKBM, DKMC, SYQXZ, DKLB, TDLYLX, DLDJ, TDYT, SFJBNT, DKDZ, DKXZ, DKNZ, DKBZ, DKBZXX, ZJRXM, SCMJ, SCMJM, ST_AsGeoJSON(the_geom) as the_geom, survey_status, import_code, dept_name, create_by, create_time, update_by, update_time from t_resource_land | |||
| </sql> | |||
| <select id="selectTResourceLandList" parameterType="TResourceLand" resultMap="TResourceLandResult"> | |||
| @@ -118,7 +118,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | |||
| <if test="zjrxm != null">#{zjrxm},</if> | |||
| <if test="scmj != null">#{scmj},</if> | |||
| <if test="scmjm != null">#{scmjm},</if> | |||
| <if test="theGeom != null">#{theGeom},</if> | |||
| <if test="theGeom != null">ST_GEOMFROMTEXT(#{theGeom}),</if> | |||
| <if test="surveyStatus != null and surveyStatus != ''">#{surveyStatus},</if> | |||
| <if test="importCode != null and importCode != ''">#{importCode},</if> | |||
| <if test="deptName != null">#{deptName},</if> | |||
| @@ -180,7 +180,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | |||
| #{item.zjrxm}, | |||
| #{item.scmj}, | |||
| #{item.scmjm}, | |||
| #{item.theGeom}, | |||
| ST_GEOMFROMTEXT(#{item.theGeom}), | |||
| #{item.surveyStatus}, | |||
| #{item.importCode}, | |||
| #{item.deptName}, | |||
| @@ -213,7 +213,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | |||
| <if test="zjrxm != null">ZJRXM = #{zjrxm},</if> | |||
| <if test="scmj != null">SCMJ = #{scmj},</if> | |||
| <if test="scmjm != null">SCMJM = #{scmjm},</if> | |||
| <if test="theGeom != null">the_geom = #{theGeom},</if> | |||
| <if test="theGeom != null">the_geom = ST_GEOMFROMTEXT(#{theGeom}),</if> | |||
| <if test="surveyStatus != null and surveyStatus != ''">survey_status = #{surveyStatus},</if> | |||
| <if test="importCode != null and importCode != ''">import_code = #{importCode},</if> | |||
| <if test="deptName != null">dept_name = #{deptName},</if> | |||
| @@ -248,7 +248,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | |||
| <if test="item.zjrxm != null">ZJRXM = #{item.zjrxm},</if> | |||
| <if test="item.scmj != null">SCMJ = #{item.scmj},</if> | |||
| <if test="item.scmjm != null">SCMJM = #{item.scmjm},</if> | |||
| <if test="item.theGeom != null">the_geom = #{item.theGeom},</if> | |||
| <if test="item.theGeom != null">the_geom = ST_GEOMFROMTEXT(#{item.theGeom}),</if> | |||
| <if test="item.surveyStatus != null and item.surveyStatus != ''">survey_status = #{item.surveyStatus},</if> | |||
| <if test="item.importCode != null and item.importCode != ''">import_code = #{item.importCode},</if> | |||
| <if test="item.deptName != null">dept_name = #{item.deptName},</if> | |||
| @@ -271,4 +271,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | |||
| #{fid} | |||
| </foreach> | |||
| </delete> | |||
| <update id="clearTheGeom" parameterType="Long"> | |||
| update t_resource_land set the_geom = null where fid = #{fid} | |||
| </update> | |||
| </mapper> | |||
| @@ -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; | |||
| } | |||
| } | |||
| } | |||