Browse Source

关于增加所有权类型

chenendian 4 days ago
parent
commit
541e1a3e80

+ 6 - 6
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/controller/cadastre/ParcelAnalysisController.java

@@ -33,10 +33,10 @@ public class ParcelAnalysisController extends BaseController {
      * 通过地籍代码获取年度统计数据
      *
      */
-    @GetMapping("/zd/{djzqdm}")
-    public R<List<Zdjbxx>> getZDList(@PathVariable String djzqdm) {
+    @GetMapping("/zd/{type}/{djzqdm}")
+    public R<List<Zdjbxx>> getZDList(@PathVariable String djzqdm,@PathVariable String type) {
         try {
-            List<Zdjbxx> res =  parcelService.zdList(djzqdm);
+            List<Zdjbxx> res =  parcelService.zdList(djzqdm,type);
             return R.ok(res);
         } catch (Exception e) {
             e.printStackTrace();
@@ -65,10 +65,10 @@ public class ParcelAnalysisController extends BaseController {
      * 通过地籍代码获取年度统计数据
      *
      */
-    @GetMapping("/statistics/{djzqdm}")
-    public R<ParcelStatisticsRes> getStatistics(@PathVariable String djzqdm) {
+    @GetMapping("/statistics/{type}/{djzqdm}")
+    public R<ParcelStatisticsRes> getStatistics(@PathVariable String djzqdm,@PathVariable String type) {
         try {
-            ParcelStatisticsRes res =  parcelService.statistics(djzqdm);
+            ParcelStatisticsRes res =  parcelService.statistics(djzqdm,type);
             return R.ok(res);
         } catch (Exception e) {
             e.printStackTrace();

+ 4 - 0
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/domain/cadastre/ParcelStatisticsRes.java

@@ -2,6 +2,7 @@ package com.siwei.apply.domain.cadastre;
 
 import lombok.Data;
 import java.util.List;
+import java.util.Map;
 
 /**
  *
@@ -41,6 +42,9 @@ public class ParcelStatisticsRes {
     }
 
 
+
+
+
     /**
      * 权利类型所有权
      */

+ 2 - 2
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/service/cadastre/IParcelService.java

@@ -9,9 +9,9 @@ public interface IParcelService {
 
     List<Map<String, Object>> djzqList();
 
-    ParcelStatisticsRes statistics(String djzqdm);
+    ParcelStatisticsRes statistics(String djzqdm,String type);
 
-    List<Zdjbxx> zdList(String djzqdm);
+    List<Zdjbxx> zdList(String djzqdm,String type);
 
     ZdqlReportVO getZdqlReport();
 

+ 7 - 2
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/service/cadastre/impl/HouseServiceImpl.java

@@ -490,7 +490,7 @@ public class HouseServiceImpl implements IHouselService {
         List<HouseStatisticsRes.FwjsnfDTO> result = new ArrayList<>();
         
         // 定义年份区间
-        String[] labels = {"1960年之前", "1961年-1969年", "1970年-1979年", "1980年-1989年", "1990年-1999年", "2000年-2009年", "2010年-2019年", "2020年之后"};
+        String[] labels = {"1960年之前", "1961年-1969年", "1970年-1979年", "1980年-1989年", "1990年-1999年", "2000年-2009年", "2010年-2019年", "2020年之后","未知"};
         int[] counts = new int[labels.length];
 
         for (Zrz zrz : zrzList) {
@@ -507,6 +507,8 @@ public class HouseServiceImpl implements IHouselService {
                 else if (year >= 2000 && year <= 2009) counts[5]++;
                 else if (year >= 2010 && year <= 2019) counts[6]++;
                 else if (year >= 2020) counts[7]++;
+            }else{
+                counts[8]++;
             }
         }
 
@@ -619,7 +621,7 @@ public class HouseServiceImpl implements IHouselService {
     private List<HouseStatisticsAreaRes.FwjsnfDTO> getJsnfAreaStatistics(List<Zrz> zrzList) {
         List<HouseStatisticsAreaRes.FwjsnfDTO> result = new ArrayList<>();
 
-        String[] labels = {"1960年之前", "1961年-1969年", "1970年-1979年", "1980年-1989年", "1990年-1999年", "2000年-2009年", "2010年-2019年", "2020年之后"};
+        String[] labels = {"1960年之前", "1961年-1969年", "1970年-1979年", "1980年-1989年", "1990年-1999年", "2000年-2009年", "2010年-2019年", "2020年之后","未知"};
         double[] areas = new double[labels.length];
 
         for (Zrz zrz : zrzList) {
@@ -637,6 +639,9 @@ public class HouseServiceImpl implements IHouselService {
                 else if (year >= 2000 && year <= 2009) areas[5] += area;
                 else if (year >= 2010 && year <= 2019) areas[6] += area;
                 else if (year >= 2020) areas[7] += area;
+            }else {
+                // 如果没有建设日期,归为“未知”类别
+                areas[8] += convertAreaToMu(zrz.getScjzmj());
             }
         }
 

+ 59 - 4
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/service/cadastre/impl/ParcelServiceImpl.java

@@ -29,29 +29,49 @@ public class ParcelServiceImpl implements IParcelService {
 
 
     @Override
-    public List<Zdjbxx> zdList(String djzqdm) {
+    public List<Zdjbxx> zdList(String djzqdm,String type) {
         if(StringUtils.isBlank(djzqdm) || djzqdm.matches("[0]+")){
             djzqdm = "";
         }
         if(StringUtils.isNotBlank(djzqdm) && djzqdm.length() != 12){
             throw new ServiceException("地籍代码长度必须为12位");
         }
-        return zdjbxxMapper.getListByDjzqdm(djzqdm);
+        List<Zdjbxx> zdjbxxListAll = zdjbxxMapper.getListByDjzqdm(djzqdm);
+        List<Zdjbxx> zdjbxxList = new ArrayList<>();
+
+        // 这里区分所有权和使用权
+        if("1".equals(type)){
+            zdjbxxMapper.getDictByType("A6","所有权").forEach(item -> {
+                String value = item.get("value").toString();
+                List<Zdjbxx> filterList = zdjbxxListAll.stream().filter(zd-> StringUtils.isBlank(zd.getQllx()) || !value.equals(zd.getQllx())).collect(Collectors.toList());
+                zdjbxxList.addAll(filterList);
+            });
+        }else if("2".equals(type)){
+            zdjbxxMapper.getDictByType("A6","所有权").forEach(item -> {
+                String value = item.get("value").toString();
+                List<Zdjbxx> filterList = zdjbxxListAll.stream().filter(zd-> StringUtils.isNotBlank(zd.getQllx())).filter(zd -> value.equals(zd.getQllx())).collect(Collectors.toList());
+                zdjbxxList.addAll(filterList);
+            });
+        }
+        return zdjbxxList;
     }
 
 
+
     @Override
     public List<Map<String, Object>> djzqList() {
         return zdjbxxMapper.getDjzqWithDjqList();
     }
 
     /**
+     * type 1,使用权数据多。
+     * type 2,所有权数据少。
      * 地籍统计
      * @param djzqdm
      * @return
      */
     @Override
-    public ParcelStatisticsRes statistics(String djzqdm) {
+    public ParcelStatisticsRes statistics(String djzqdm,String type) {
 
         if(StringUtils.isBlank(djzqdm) || djzqdm.matches("[0]+")){
             djzqdm = "";
@@ -62,7 +82,24 @@ public class ParcelServiceImpl implements IParcelService {
         }
 
         ParcelStatisticsRes res = new ParcelStatisticsRes();
-        List<Zdjbxx> zdjbxxList = zdjbxxMapper.getListByDjzqdm(djzqdm);
+        List<Zdjbxx> zdjbxxListAll = zdjbxxMapper.getListByDjzqdm(djzqdm);
+
+        List<Zdjbxx> zdjbxxList = new ArrayList<>();
+        // 这里区分所有权和使用权
+        if("1".equals(type)){
+            zdjbxxMapper.getDictByType("A6","所有权").forEach(item -> {
+                String value = item.get("value").toString();
+                List<Zdjbxx> filterList = zdjbxxListAll.stream().filter(zd-> StringUtils.isBlank(zd.getQllx()) || !value.equals(zd.getQllx())).collect(Collectors.toList());
+                zdjbxxList.addAll(filterList);
+            });
+        }else if("2".equals(type)){
+            zdjbxxMapper.getDictByType("A6","所有权").forEach(item -> {
+                String value = item.get("value").toString();
+                List<Zdjbxx> filterList = zdjbxxListAll.stream().filter(zd-> StringUtils.isNotBlank(zd.getQllx())).filter(zd -> value.equals(zd.getQllx())).collect(Collectors.toList());
+                zdjbxxList.addAll(filterList);
+            });
+        }
+
         List<ParcelStatisticsRes.DetailDTO> detailList = new ArrayList<>();
         List<ParcelStatisticsRes.TdytDTO> tdytStatisticsList = new ArrayList<>();
         List<ParcelStatisticsRes.QlxzDTO> qlxzStatisticsList = new ArrayList<>(); // 权利性质统计
@@ -120,12 +157,25 @@ public class ParcelServiceImpl implements IParcelService {
             zdjbxxMapper.getDictByType("A7",null).forEach(item -> {
                 String name = item.get("name").toString();
                 String value = item.get("value").toString();
+
+                //ddd
                 List<Zdjbxx> filterList = zdjbxxList.stream().filter(zd-> StringUtils.isNotBlank(zd.getQlxz())).filter(zd -> value.equals(zd.getQlxz())).collect(Collectors.toList());
                 if(CollectionUtils.isNotEmpty(filterList)){
                     qlxzGroupedByYtMap.put(name, filterList);
                 }
+
+
+
             });
 
+
+
+
+
+
+
+
+
             //这里遍历map,然后进行统计数据;
             if(MapUtils.isNotEmpty(qlxzGroupedByYtMap)){
                 for(Map.Entry<String, List<Zdjbxx>> entry : qlxzGroupedByYtMap.entrySet()){
@@ -149,6 +199,11 @@ public class ParcelServiceImpl implements IParcelService {
             res.setQlxzStatisticsList(qlxzStatisticsList);
 
 
+
+
+
+
+
             //-------------------------------------------第四部分:  权利类型-所有权统计--------------------------------
             Map<String,List<Zdjbxx>> qllxSuoYouGroupedByYtMap = new LinkedHashMap<>();
             zdjbxxMapper.getDictByType("A6","所有权").forEach(item -> {