Pārlūkot izejas kodu

Merge branch 'master' of http://218.59.175.43:3000/zhangzl/rongxin.api

 Conflicts:
	ruoyi-business/src/main/resources/mapper/resource/TResourceLandMapper.xml
master
张泽亮 pirms 1 nedēļas
vecāks
revīzija
92c74cb372
6 mainītis faili ar 111 papildinājumiem un 0 dzēšanām
  1. +14
    -0
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/resource/TResourceLandController.java
  2. +9
    -0
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDeptController.java
  3. +8
    -0
      ruoyi-business/src/main/java/com/ruoyi/resource/mapper/TResourceLandMapper.java
  4. +8
    -0
      ruoyi-business/src/main/java/com/ruoyi/resource/service/ITResourceLandService.java
  5. +11
    -0
      ruoyi-business/src/main/java/com/ruoyi/resource/service/impl/TResourceLandServiceImpl.java
  6. +61
    -0
      ruoyi-common/src/main/java/com/ruoyi/common/utils/space/SpaceUtils.java

+ 14
- 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/resource/TResourceLandController.java Parādīt failu

@@ -14,6 +14,7 @@ import com.ruoyi.common.utils.ServletUtils;
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.framework.web.service.TokenService;
import com.ruoyi.resource.domain.TResourceLand;
@@ -230,6 +231,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));
}

@@ -244,6 +252,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));
}

/**
* 打印地块属性
*/


+ 9
- 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDeptController.java Parādīt failu

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

/**
* 新增部门
*/


+ 8
- 0
ruoyi-business/src/main/java/com/ruoyi/resource/mapper/TResourceLandMapper.java Parādīt failu

@@ -82,4 +82,12 @@ public interface TResourceLandMapper
* @return 结果
*/
public int deleteTResourceLandByFids(Long[] fids);

/**
* 清空theGeom字段
*
* @param fid
* @return
*/
public int clearTheGeom(Long fid);
}

+ 8
- 0
ruoyi-business/src/main/java/com/ruoyi/resource/service/ITResourceLandService.java Parādīt failu

@@ -92,4 +92,12 @@ public interface ITResourceLandService
* @return 结果
*/
public int deleteTResourceLandByFid(Long fid);

/**
* 清空theGeom字段
*
* @param fid
* @return
*/
public int clearTheGeom(Long fid);
}

+ 11
- 0
ruoyi-business/src/main/java/com/ruoyi/resource/service/impl/TResourceLandServiceImpl.java Parādīt failu

@@ -232,4 +232,15 @@ public class TResourceLandServiceImpl implements ITResourceLandService
{
return tResourceLandMapper.deleteTResourceLandByFid(fid);
}

/**
* 清空theGeom字段
*
* @param fid
* @return
*/
@Override
public int clearTheGeom(Long fid) {
return tResourceLandMapper.clearTheGeom(fid);
}
}

+ 61
- 0
ruoyi-common/src/main/java/com/ruoyi/common/utils/space/SpaceUtils.java Parādīt failu

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

Notiek ielāde…
Atcelt
Saglabāt