Browse Source

获取土地详情

gushoubang 10 months ago
parent
commit
7d978415b2

+ 29 - 22
onemap-modules/onemap-apply/pom.xml

@@ -128,28 +128,35 @@
             <artifactId>spring-boot-starter-websocket</artifactId>
         </dependency>
 
-<!--        <dependency>-->
-<!--            <groupId>com.supermap</groupId>-->
-<!--            <artifactId>analyst.spatialanalyst</artifactId>-->
-<!--            <version>11.0</version>-->
-<!--            <scope>system</scope>-->
-<!--            <systemPath>${basedir}/lib/com.supermap.analyst.spatialanalyst.jar</systemPath>-->
-<!--        </dependency>-->
-
-<!--        <dependency>-->
-<!--            <groupId>com.supermap</groupId>-->
-<!--            <artifactId>data</artifactId>-->
-<!--            <version>11.0</version>-->
-<!--            <scope>system</scope>-->
-<!--            <systemPath>${basedir}/lib/com.supermap.data.jar</systemPath>-->
-<!--        </dependency>-->
-<!--        <dependency>-->
-<!--            <groupId>com.supermap</groupId>-->
-<!--            <artifactId>data.conversion</artifactId>-->
-<!--            <version>11.0</version>-->
-<!--            <scope>system</scope>-->
-<!--            <systemPath>${basedir}/lib/com.supermap.data.conversion.jar</systemPath>-->
-<!--        </dependency>-->
+        <!--主要用于在不同类型的对象之间进行属性的自动拷贝-->
+        <dependency>
+            <groupId>net.sf.dozer</groupId>
+            <artifactId>dozer</artifactId>
+            <version>5.5.1</version>
+        </dependency>
+
+        <!--        <dependency>-->
+        <!--            <groupId>com.supermap</groupId>-->
+        <!--            <artifactId>analyst.spatialanalyst</artifactId>-->
+        <!--            <version>11.0</version>-->
+        <!--            <scope>system</scope>-->
+        <!--            <systemPath>${basedir}/lib/com.supermap.analyst.spatialanalyst.jar</systemPath>-->
+        <!--        </dependency>-->
+
+        <!--        <dependency>-->
+        <!--            <groupId>com.supermap</groupId>-->
+        <!--            <artifactId>data</artifactId>-->
+        <!--            <version>11.0</version>-->
+        <!--            <scope>system</scope>-->
+        <!--            <systemPath>${basedir}/lib/com.supermap.data.jar</systemPath>-->
+        <!--        </dependency>-->
+        <!--        <dependency>-->
+        <!--            <groupId>com.supermap</groupId>-->
+        <!--            <artifactId>data.conversion</artifactId>-->
+        <!--            <version>11.0</version>-->
+        <!--            <scope>system</scope>-->
+        <!--            <systemPath>${basedir}/lib/com.supermap.data.conversion.jar</systemPath>-->
+        <!--        </dependency>-->
     </dependencies>
 
     <build>

+ 9 - 0
onemap-modules/onemap-apply/src/main/java/com/onemap/apply/controller/tdgy/TdgyController.java

@@ -27,6 +27,14 @@ public class TdgyController {
         RequestResult requestResult = tdgyService.updateTdgy(updateTdgyVo);
         return requestResult;
     }
+    /**
+     * 获取土地供应详情
+     */
+    @GetMapping("/{id}")
+    public RequestResult getTdgyDetail(@PathVariable Integer id) {
+        RequestResult requestResult = tdgyService.getTdgyDetail(id);
+        return requestResult;
+    }
 
     /**
      * 获取疑似闲置土地
@@ -42,4 +50,5 @@ public class TdgyController {
         RequestResult requestResult = tdgyService.getSuspectedIdleLand(key, xzqh, limit, offset);
         return requestResult;
     }
+
 }

+ 52 - 0
onemap-modules/onemap-apply/src/main/java/com/onemap/apply/domain/tdgy/dto/TdgySjDTO.java

@@ -1,12 +1,64 @@
 package com.onemap.apply.domain.tdgy.dto;
 
 import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+import java.util.Date;
 
 @TableName("tdgy_sj")
+@Data
 public class TdgySjDTO {
     private Integer id;
+    // 项目名称
+    private String xmmc;
+    // 土地坐落
+    private String tdzl;
+    // 出让面积(亩)
+    private String crmj;
+    // 出让面积(公顷)
+    private String crmj_m;
+    // 土地用途
+    private String tdyt;
+    // 容积率
+    private String rjl;
+    // 成交价
+    private String cjj;
+    // 供应类型
+    private String gylx;
+    // 成交日
+    private String cjr;
+    // 批准机关
+    private String pzjg;
+    // 批准文号
+    private String pzwh;
+    // 批准日期
+    private String pzrq;
+    // 行政区划
+    private String xzqh;
+    // 创建时间
+    private Date create_time;
+    // 更新时间
+    private Date update_time;
+    // 1 国有,2集体
+    private String sulx;
+    // 受让方
+    private String srf;
+    // 土地使用权,0出让 1划拨
+    private String tdsyq;
+    // 合同编号
+    private String htbh;
+    // 经办人
+    private String jbr;
+    // 按照一类统计
+    private String zdyt;
+    // 产权证号
+    private String cqzh;
+    // 约定开工时间
     private String ydkgsj;
+    // 约定竣工时间
     private String ydjgsj;
+    // 实际开工时间
     private String sjkgsj;
+    // 是否竣工
     private Boolean sfjg;
 }

+ 44 - 0
onemap-modules/onemap-apply/src/main/java/com/onemap/apply/domain/tdgy/res/TdgySjRes.java

@@ -0,0 +1,44 @@
+package com.onemap.apply.domain.tdgy.res;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import lombok.Data;
+
+/**
+ * 地块详情返回的信息
+ */
+@Data
+public class TdgySjRes {
+    private Integer id;
+    @JsonProperty("项目名称")
+    private String xmmc;
+    @JsonProperty("受让方")
+    private String srf;
+    @JsonProperty("土地坐落")
+    private String tdzl;
+    @JsonProperty("出让面积(亩)")
+    private String crmj;
+    @JsonProperty("出让面积(公顷)")
+    private String crmj_m;
+    @JsonProperty("土地用途")
+    private String tdyt;
+    @JsonProperty("容积率")
+    private String rjl;
+    @JsonProperty("成交价/起始价(万元)")
+    private String cjj;
+    @JsonProperty("成交日期/预计成交日期")
+    private String cjr;
+    @JsonProperty("合同编号")
+    private String htbh;
+    @JsonProperty("批准机关")
+    private String pzjg;
+    @JsonProperty("批准文号")
+    private String pzwh;
+    @JsonProperty("批准日期")
+    private String pzrq;
+    @JsonProperty("行政区划")
+    private String xzqh;
+    @JsonProperty("约定开工时间")
+    private String ydkgsj;
+    @JsonProperty("约定竣工时间")
+    private String ydjgsj;
+}

+ 2 - 0
onemap-modules/onemap-apply/src/main/java/com/onemap/apply/mapper/tdgy/TdgyMapper.java

@@ -14,4 +14,6 @@ public interface TdgyMapper extends BaseMapper<TdgySjDTO> {
                                                    @Param("xzqh") String xzqh,
                                                    @Param("limit") Integer limit,
                                                    @Param("offset") Integer offset);
+
+    String getLandGeometry(@Param("pid") Integer pid);
 }

+ 18 - 3
onemap-modules/onemap-apply/src/main/java/com/onemap/apply/service/impl/tdgy/TdgyServiceImp.java

@@ -1,7 +1,9 @@
 package com.onemap.apply.service.impl.tdgy;
 
 import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
+import org.dozer.DozerBeanMapper;
 import com.onemap.apply.domain.tdgy.dto.TdgySjDTO;
+import com.onemap.apply.domain.tdgy.res.TdgySjRes;
 import com.onemap.apply.domain.tdgy.vo.UpdateTdgyVo;
 import com.onemap.apply.mapper.tdgy.TdgyMapper;
 import com.onemap.apply.service.tdgy.TdgyService;
@@ -21,6 +23,7 @@ public class TdgyServiceImp implements TdgyService {
     @Resource
     private TdgyMapper tdgyMapper;
 
+
     @Slave
     @Override
     public RequestResult updateTdgy(UpdateTdgyVo updateTdgyVo) {
@@ -49,12 +52,24 @@ public class TdgyServiceImp implements TdgyService {
         return RequestResult.success();
     }
 
+    @Slave
+    @Override
+    public RequestResult getTdgyDetail(Integer id) {
+        DozerBeanMapper mapper = new DozerBeanMapper();
+
+        TdgySjDTO tdgySjDTO = tdgyMapper.selectById(id);
+        if (tdgySjDTO == null) {
+            return RequestResult.error("地块不存在");
+        }
+
+        TdgySjRes tdgySjRes = mapper.map(tdgySjDTO, TdgySjRes.class);
+        return RequestResult.success(tdgySjRes);
+    }
+
     @Slave
     @Override
     public RequestResult getSuspectedIdleLand(String key, String xzqh, Integer limit, Integer offset) {
         List<Map<String, Object>> list = tdgyMapper.getSuspectedIdleLand(key, xzqh, limit, offset);
-
-        RequestResult requestResult = RequestResult.success(list);
-        return requestResult;
+        return RequestResult.success(list);
     }
 }

+ 2 - 0
onemap-modules/onemap-apply/src/main/java/com/onemap/apply/service/tdgy/TdgyService.java

@@ -6,5 +6,7 @@ import com.onemap.common.core.web.domain.RequestResult;
 public interface TdgyService {
     RequestResult updateTdgy(UpdateTdgyVo updateTdgyVo);
 
+    RequestResult getTdgyDetail(Integer id);
+
     RequestResult getSuspectedIdleLand(String key, String xzqh, Integer limit, Integer offset);
 }

+ 7 - 0
onemap-modules/onemap-apply/src/main/resources/mapper/postgresql/tdgy/TdgyMapper.xml

@@ -14,4 +14,11 @@
         </if>
         limit #{limit} offset #{offset};
     </select>
+
+    <select id="getLandGeometry" resultType="String">
+        public.st_asewkt(public.st_union(geom))
+        from "TB_TDGY_SJ"
+        WHERE pid=
+        #{pid};
+    </select>
 </mapper>