Browse Source

占压地块面积统计地价

sugb 8 months ago
parent
commit
48f3d07b77

+ 2 - 1
jeecg-boot-module-gis/src/main/java/org/jeecg/modules/geoAnalysis/entity/GeoAnalysis.java

@@ -7,8 +7,9 @@ import java.io.Serializable;
 @Data
 //没有指定id 致使启动有警告提示
 public class GeoAnalysis implements Serializable {
+    private String id; //sugb 添加id 避免警告
     private String type;
     private String afieldcname;
     private Result result;
-    private String id; //sugb 添加id 避免警告
+
 }

+ 46 - 0
jeecg-boot-module-gis/src/main/java/org/jeecg/modules/geoAnalysis/entity/QcJzxx.java

@@ -0,0 +1,46 @@
+package org.jeecg.modules.geoAnalysis.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+import org.jeecgframework.poi.excel.annotation.Excel;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+
+/**
+ * @Description: qc_jzxx
+ * @Author: sugb
+ * @Date:   2024-09-09
+ * @Version: V1.0
+ */
+@Data
+@TableName("qc_jzxx")
+@Accessors(chain = true)
+@EqualsAndHashCode(callSuper = false)
+@ApiModel(value="qc_jzxx对象", description="qc_jzxx")
+public class QcJzxx implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+	/**id*/
+	@TableId(type = IdType.ASSIGN_ID)
+    @ApiModelProperty(value = "id")
+    private String id;
+	/**政府规划用途*/
+	@Excel(name = "政府规划用途", width = 15)
+    @ApiModelProperty(value = "政府规划用途")
+    private String zfghyt;
+	/**价值(单位亩)*/
+	@Excel(name = "价值(单位亩)", width = 15)
+    @ApiModelProperty(value = "价值(单位亩)")
+    private Float jz;
+	/**备注*/
+	@Excel(name = "备注", width = 15)
+    @ApiModelProperty(value = "备注")
+    private String remark;
+}

+ 4 - 0
jeecg-boot-module-gis/src/main/java/org/jeecg/modules/geoAnalysis/entity/Result.java

@@ -11,4 +11,8 @@ public class Result {
     private String area;
     private String atableenam;
     private String info;
+    private String dkbh;
+    private String zfghyt;
+    private Float tdjz;
+    private String remark;
 }

+ 1 - 0
jeecg-boot-module-gis/src/main/java/org/jeecg/modules/geoAnalysis/mapper/GeoAnalysisMapper.java

@@ -18,6 +18,7 @@ import java.util.Map;
  * @Version: V1.0
  */
 public interface GeoAnalysisMapper extends BaseMapper<GeoAnalysis> {
+    //统计占压情况
     List<HashMap<String, Object>> DrawMap(HashMap map);
 
     List<HashMap<String, Object>> DrawMapByShape(HashMap map);

+ 19 - 0
jeecg-boot-module-gis/src/main/java/org/jeecg/modules/geoAnalysis/mapper/QcJzxxMapper.java

@@ -0,0 +1,19 @@
+package org.jeecg.modules.geoAnalysis.mapper;
+
+import java.util.List;
+
+import org.apache.ibatis.annotations.Param;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.jeecg.modules.geoAnalysis.entity.QcJzxx;
+
+/**
+ * @Description: qc_jzxx
+ * @Author: jeecg-boot
+ * @Date:   2024-09-09
+ * @Version: V1.0
+ */
+public interface QcJzxxMapper extends BaseMapper<QcJzxx> {
+
+    //根据地块编号获取地块类型,单价
+    QcJzxx queryDkInfo(@Param("dkbh") String dkbh);
+}

+ 3 - 3
jeecg-boot-module-gis/src/main/java/org/jeecg/modules/geoAnalysis/mapper/xml/GeoAnalysisMapper.xml

@@ -13,14 +13,14 @@
           and atableename = #{atableename}
     </select>
     <select id="DrawMap" resultType="hashmap" parameterType="hashmap">
-
-        select objectid, ST_AsText(e.info) info, AREA, ${DLMC}
+        select objectid, ST_AsText(e.info) info, AREA, ${DLMC},dkbh
         from (
                  select objectid,
                         st_intersection(a.geom, st_geomfromtext(#{shape}, 4490))                    info,
                         st_area(st_intersection(a.geom,
                                                 st_geomfromtext(#{shape}, 4490)), false) * 0.0001 AS AREA,
-                        ${DLMC}
+                        ${DLMC},
+                        dkbh
                  from ${table} a
                  where ST_Intersects(a.geom, st_geomfromtext(
                          #{shape}, 4490)) = 'true') e

+ 11 - 0
jeecg-boot-module-gis/src/main/java/org/jeecg/modules/geoAnalysis/mapper/xml/QcJzxxMapper.xml

@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="org.jeecg.modules.geoAnalysis.mapper.QcJzxxMapper">
+
+    <select id="queryDkInfo" resultType="org.jeecg.modules.geoAnalysis.entity.QcJzxx">
+        SELECT a.*
+        from qc_jzxx as a
+                 JOIN qc_ssgqzysytdqk_gzv as qc ON a.zfghyt = qc.zfghyt_code
+        where qc.dkbh = #{dkbh}
+    </select>
+</mapper>

+ 32 - 19
jeecg-boot-module-gis/src/main/java/org/jeecg/modules/geoAnalysis/service/impl/GeoAnalysisServiceImpl.java

@@ -20,8 +20,10 @@ import org.geotools.feature.simple.SimpleFeatureBuilder;
 import org.geotools.referencing.crs.DefaultGeographicCRS;
 import org.jeecg.modules.commonQueryConfig.entity.CommonQueryConfig;
 import org.jeecg.modules.geoAnalysis.entity.GeoAnalysis;
+import org.jeecg.modules.geoAnalysis.entity.QcJzxx;
 import org.jeecg.modules.geoAnalysis.entity.ZYFXPZB;
 import org.jeecg.modules.geoAnalysis.mapper.GeoAnalysisMapper;
+import org.jeecg.modules.geoAnalysis.mapper.QcJzxxMapper;
 import org.jeecg.modules.geoAnalysis.service.IGeoAnlysisService;
 import org.jeecg.modules.gis.lochistory.entity.LocHistory;
 import org.jeecg.modules.gis.lochistory.mapper.LocHistoryMapper;
@@ -57,7 +59,17 @@ import java.util.*;
 public class GeoAnalysisServiceImpl extends ServiceImpl<GeoAnalysisMapper, GeoAnalysis> implements IGeoAnlysisService {
     @Autowired
     GeoAnalysisMapper geoAnalysisMapper;
+    @Autowired
+    QcJzxxMapper qcJzxxMapper;
 
+    //if (map.get("info") instanceof Clob) {
+    //    Clob clob = (Clob) map.get("info");
+    //    try {
+    //        result.setInfo(clob.getSubString((long) 1, (int) clob.length()));
+    //    } catch (SQLException throwables) {
+    //        throwables.printStackTrace();
+    //    }
+    //}
 
     @Override
     public ArrayList<GeoAnalysis> DrawMap(List<ZYFXPZB> zyfxpzb, String shape) {
@@ -73,23 +85,34 @@ public class GeoAnalysisServiceImpl extends ServiceImpl<GeoAnalysisMapper, GeoAn
             hashMap.put("table", atableenam);
             hashMap.put("DLMC", afieldename);
             List<HashMap<String, Object>> hashMaps = geoAnalysisMapper.DrawMap(hashMap);
-            System.out.println(hashMaps);
+            //遍历处理
             for (HashMap<String, Object> map : hashMaps) {
                 GeoAnalysis analysis = new GeoAnalysis();
                 org.jeecg.modules.geoAnalysis.entity.Result result = new org.jeecg.modules.geoAnalysis.entity.Result();
                 analysis.setType(atablecname);
+                //解析
                 result.setArea(format.format(new BigDecimal(map.get("area").toString())));
                 result.setTypes(map.get(afieldename).toString());
                 result.setObjectid(map.get("objectid").toString());
                 result.setInfo(map.get("info").toString());
-//                if (map.get("info") instanceof Clob) {
-//                    Clob clob = (Clob) map.get("info");
-//                    try {
-//                        result.setInfo(clob.getSubString((long) 1, (int) clob.length()));
-//                    } catch (SQLException throwables) {
-//                        throwables.printStackTrace();
-//                    }
-//                }
+                //增加地块编号
+                if (null!=map.get("dkbh")){
+                    result.setDkbh(map.get("dkbh").toString());
+                    //根据zfghyt判断价值,单位(亩),地块可能涉及到多块
+                    QcJzxx qcJzxx=qcJzxxMapper.queryDkInfo(result.getDkbh());
+                    if (null!=qcJzxx){
+                        //计算地块和土地面积价值 面积单位是公顷, 地块价值面积单位是亩
+                        //类型
+                        result.setZfghyt(qcJzxx.getZfghyt());
+                        //价值计算公顷转换成亩
+                        try{
+                            Float f=Float.parseFloat(result.getArea());
+                            result.setTdjz(f*15*qcJzxx.getJz());
+                        }catch (Exception e){
+                            result.setRemark("土地价值无法计算");
+                        }
+                    }
+                }
                 result.setAtableenam(atableenam);
                 analysis.setResult(result);
                 analysis.setAfieldcname(afieldcname);
@@ -98,7 +121,6 @@ public class GeoAnalysisServiceImpl extends ServiceImpl<GeoAnalysisMapper, GeoAn
         }
         return list;
     }
-
     @Override
     public ZYFXPZB SelectByTbs(String MTABLENAME, String atableename) {
         return geoAnalysisMapper.SelectByTbs(MTABLENAME, atableename);
@@ -133,15 +155,6 @@ public class GeoAnalysisServiceImpl extends ServiceImpl<GeoAnalysisMapper, GeoAn
                         result.setArea(format.format(new BigDecimal(hashMap.get("area").toString())));
                         result.setObjectid(hashMap.get("objectid").toString());
                         result.setInfo(hashMap.get("info").toString());
-//                        if (hashMap.get("info") instanceof Clob) {
-//                            Clob clob = (Clob) hashMap.get("info");
-//                            try {
-//                                result.setInfo(clob.getSubString((long) 1, (int) clob.length()));
-//                            } catch (SQLException throwables) {
-//                                throwables.printStackTrace();
-//                            }
-//                        }
-
                         result.setAtableenam(zyfxpzb1.getATABLEENAME());
                         analysis.setResult(result);
                         list.add(analysis);

+ 1 - 1
jeecg-boot-module-system/src/main/resources/application-dev.yml

@@ -1,5 +1,5 @@
 server:
-  port: 8080
+  port: 8088
   tomcat:
     max-swallow-size: -1
   error: