1
0
chenendian 1 неделя назад
Родитель
Сommit
549c720ec8

+ 41 - 1
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/controller/cadastre/StorageController.java

@@ -2,6 +2,7 @@ package com.siwei.apply.controller.cadastre;
 
 import com.siwei.apply.domain.res.*;
 import com.siwei.apply.service.cadastre.IZymlService;
+import com.siwei.apply.service.cadastre.impl.StorageServiceImpl;
 import com.siwei.common.core.domain.R;
 import com.siwei.common.core.web.controller.BaseController;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -24,6 +25,9 @@ public class StorageController extends BaseController {
     private IZymlService zymlService;
 
 
+    @Autowired
+    private StorageServiceImpl storageServiceImpl;
+
 
     /**
      * 年度统计
@@ -125,7 +129,6 @@ public class StorageController extends BaseController {
 
                 ProjectSupplyRes projectSupply2 = new ProjectSupplyRes();
 
-
                 projectSupply2.setGdArea((float) (Math.round((220.12f + (float) (Math.random() * 100)) * 100) / 100.0));
                 projectSupply2.setGdType("收回");
                 projectSupply2.setGdUnit("亩");
@@ -155,6 +158,7 @@ public class StorageController extends BaseController {
         }
     }
 
+
     /**
      *
      * 趋势统计
@@ -209,4 +213,40 @@ public class StorageController extends BaseController {
         }
     }
 
+
+
+    /**
+     *
+     * 趋势统计
+     *
+     */
+    @GetMapping("/trendStatistics/getData1")
+    public R<List<TrendStatisticsData>> getData1() {
+        try {
+            List<TrendStatisticsData> areaTrendStatisticsList = storageServiceImpl.getData1();
+            return R.ok(areaTrendStatisticsList);
+        } catch (Exception e) {
+            return R.fail(e.getMessage());
+        }
+    }
+
+
+    @GetMapping("/trendStatistics/getData2")
+    public R<TrendStatisticsRes> getData2() {
+        try {
+            TrendStatisticsRes res = new TrendStatisticsRes();
+            List<Map<String, Object>> areaTrendStatisticsList = new java.util.ArrayList<>(List.of()); // 面积趋势分析list
+
+
+
+            return R.ok(res);
+        } catch (Exception e) {
+            return R.fail(e.getMessage());
+        }
+
+    }
+
+
+
+
 }

+ 3 - 0
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/mapper/GjShijiShouchuMapper.java

@@ -6,10 +6,13 @@ import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
+import java.util.Map;
 
 @Mapper
 public interface GjShijiShouchuMapper {
 
+    List<Map<String, Object>> getStatsByYear();
+
     void add(GjShijiShouchu gjShijiShouchu);
 
     GjShijiShouchu get(@Param("gid") Integer gid);

+ 4 - 1
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/service/cadastre/impl/CadastreManageServiceImpl.java

@@ -743,7 +743,10 @@ public class CadastreManageServiceImpl implements CadastreManageService {
                         map.put(fieldName, null);
                     }*/
 
-                    if (StringUtils.containsIgnoreCase(fieldType, "character")) {
+                    if ("ydyhfl".equalsIgnoreCase(fieldName)) {
+                        map.put(fieldName, null);
+                    }
+                    else if (StringUtils.containsIgnoreCase(fieldType, "character")) {
                         map.put(fieldName, feature.GetFieldAsString(i));
                     } else if (StringUtils.containsIgnoreCase(fieldType, "integer") || StringUtils.containsIgnoreCase(fieldType, "smallint") || StringUtils.containsIgnoreCase(fieldType, "int2") || StringUtils.containsIgnoreCase(fieldType, "int4")) {
                         map.put(fieldName, feature.GetFieldAsInteger(i));

+ 30 - 12
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/service/cadastre/impl/StorageServiceImpl.java

@@ -1,24 +1,16 @@
 package com.siwei.apply.service.cadastre.impl;
 
-import com.siwei.apply.domain.GongdiJihua;
-import com.siwei.apply.domain.LandType;
 import com.siwei.apply.domain.cadastre.LandSupplyReportDTO;
 import com.siwei.apply.domain.res.*;
-import com.siwei.apply.domain.vo.GongdiJihuaFilterVo;
-import com.siwei.apply.domain.vo.LandSupplyProjectVO;
-import com.siwei.apply.domain.vo.LandSupplyReportVO;
-import com.siwei.apply.enums.LandUseTypeEnum;
+
+import com.siwei.apply.mapper.GjShijiShouchuMapper;
 import com.siwei.apply.mapper.GongdiJihuaMapper;
 import com.siwei.apply.mapper.LandTypeMapper;
-import com.siwei.apply.mapper.TdgyMapper;
-import com.siwei.common.core.utils.StringUtils;
 import org.apache.commons.collections4.CollectionUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
-import java.math.BigDecimal;
 import java.util.*;
-import java.util.stream.Collectors;
 
 
 @Service
@@ -28,15 +20,41 @@ public class StorageServiceImpl {
     private GongdiJihuaMapper gongdiJihuaMapper;
 
     @Autowired
-    private TdgyMapper dgyMapper;
+    private GjShijiShouchuMapper gjShijiShouchuMapper;
 
     @Autowired
     private LandTypeMapper landTypeMapper;
 
 
 
+    //统计分析
+    public List<TrendStatisticsData> getData1() {
+        List<Map<String, Object>> statsList = gjShijiShouchuMapper.getStatsByYear();
+        List<TrendStatisticsData> res = new ArrayList<>();
+        if (CollectionUtils.isNotEmpty(statsList)) {
+            for (Map<String, Object> stat : statsList) {
+                TrendStatisticsData data = new TrendStatisticsData();
+                data.setYear(String.valueOf(stat.get("year")));
+                data.setInDataArea(String.valueOf(stat.get("in_data_area")));
+                data.setOutDataArea("0");
+                res.add(data);
+            }
+        }
+        return res;
+    }
+
+
+
+
+
+
+
+
+
+
+
 
-    private LandSupplyReportDTO.CompletedDTO buildCompletedDTO(Double area, Integer count, Integer transfer, Integer allocation, Integer other) {
+    public LandSupplyReportDTO.CompletedDTO buildCompletedDTO(Double area, Integer count, Integer transfer, Integer allocation, Integer other) {
         LandSupplyReportDTO.CompletedDTO completed = new LandSupplyReportDTO.CompletedDTO();
         completed.setArea(area);
         completed.setCount(count);

+ 1 - 1
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/service/impl/ProjectImpl.java

@@ -280,7 +280,7 @@ public class ProjectImpl implements ProjectService {
                     } else if (AloneWorkFlowEnum.NODE_2.getTableName().equalsIgnoreCase(tableName)) {
                         viewField =  currentNode.get("srf") != null ? String.valueOf(currentNode.get("srf")) : "";
                     } else if (AloneWorkFlowEnum.NODE_3.getTableName().equalsIgnoreCase(tableName)) {
-                        viewField = currentNode.get("bdcdyh") != null ? String.valueOf(currentNode.get("bdcdyh")) : "";
+                        viewField = currentNode.get("bdczh") != null ? String.valueOf(currentNode.get("bdczh")) : "";
                     }else if (AloneWorkFlowEnum.NODE_4.getTableName().equalsIgnoreCase(tableName)) {
                         viewField = currentNode.get("zsbh") != null ? String.valueOf(currentNode.get("zsbh")) : "";
                     }else if (AloneWorkFlowEnum.NODE_5.getTableName().equalsIgnoreCase(tableName)) {

+ 9 - 0
siwei-modules/siwei-apply/src/main/resources/mapper/GjShijiShouchuMapper.xml

@@ -124,6 +124,15 @@
         </foreach>
     </delete>
 
+    <select id="getStatsByYear" resultType="map">
+        SELECT
+            COALESCE(CAST(scnd AS VARCHAR), '其它') AS year,
+            ROUND(COALESCE(SUM(CAST(scmj AS NUMERIC)), 0), 2) AS in_data_area
+        FROM vector.gj_shiji_shouchu
+        GROUP BY scnd
+        ORDER BY year
+    </select>
+
     <select id="getByGeomIntersects" resultMap="gjShijiShouchuMap">
         SELECT gid, yqsdw, scmj, scjg, scwh, scsj, mj, scfs, scnd, tdzl, ytdyt, ytdsyqxz, wzfbck, bz, bsm, xzq, dabh, shape_leng, shape_area, "项目名", sccb, "面积_亩", ST_AsEWKT(geom) as geom
         FROM vector.gj_shiji_shouchu

+ 1 - 1
siwei-modules/siwei-apply/src/main/resources/mapper/YdbpDataMapper.xml

@@ -43,7 +43,7 @@
                 #{id}
             </foreach>
         </if>
-        ORDER BY created_at DESC
+        ORDER BY updated_at DESC
         LIMIT #{pageSize} OFFSET #{offset}
     </select>
     <update id="update" parameterType="com.siwei.apply.domain.YdbpData">