Forráskód Böngészése

项目兼容0类型

chenendian 1 hónapja
szülő
commit
0c5fa6c2a0

+ 11 - 1
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/controller/cadastre/SupplyController.java

@@ -1,6 +1,7 @@
 package com.siwei.apply.controller.cadastre;
 
 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.LandSupplyProjectVO;
@@ -17,7 +18,6 @@ import org.apache.commons.collections4.CollectionUtils;
 import org.apache.poi.ss.usermodel.*;
 import org.apache.poi.ss.util.CellRangeAddress;
 import org.apache.poi.xssf.usermodel.XSSFWorkbook;
-import org.gdal.ogr.*;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
@@ -548,6 +548,16 @@ public class SupplyController extends BaseController {
     }
 
 
+    @GetMapping("/landTypeList")
+    public R<List<LandType>> getLandTypeList() {
+        try {
+            return R.ok(supplyService.getLandTypeList());
+        } catch (Exception e) {
+            e.printStackTrace();
+            return R.fail(e.getMessage());
+        }
+    }
+
 
 
 

+ 3 - 0
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/service/cadastre/ISupplyService.java

@@ -2,6 +2,7 @@ package com.siwei.apply.service.cadastre;
 
 
 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.SupplyYearStatisticsRes;
 import com.siwei.apply.domain.res.TrendStatisticsRes;
@@ -28,4 +29,6 @@ public interface ISupplyService {
 
     GongdiJihua getPlanProject(String id);
 
+    List<LandType> getLandTypeList();
+
 }

+ 50 - 0
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/service/cadastre/impl/SupplyServiceImpl.java

@@ -192,6 +192,11 @@ public class SupplyServiceImpl implements ISupplyService {
     @Override
     public TrendStatisticsRes trendStatistics(String landType) {
 
+
+
+
+
+
         List<TdgyStatisticsRes> completeList = dgyMapper.getListByYear(null, landType, null, null);
 
         TrendStatisticsRes res = new TrendStatisticsRes();
@@ -536,6 +541,43 @@ public class SupplyServiceImpl implements ISupplyService {
                  vo.setGeom(item.getGeom());
                  return vo;
              }).collect(Collectors.toList());
+        } else if(supplyType == 0){
+
+            GongdiJihuaFilterVo filterVo = new GongdiJihuaFilterVo();
+            filterVo.setYear(year);
+            filterVo.setPageSize(100000);
+
+            List<GongdiJihua> planList = gongdiJihuaMapper.getList(filterVo);
+            List<LandSupplyProjectVO> resList1 = planList.stream().map(item -> {
+                LandSupplyProjectVO vo = new LandSupplyProjectVO();
+                vo.setProjectPropertyId(String.valueOf(item.getGid()));
+                vo.setProjectName(item.getXmmc());
+                vo.setCompanyName("暂无");
+                vo.setSupplyMethod(item.getGyfs());
+                vo.setSupplyType(supplyType.toString());
+                vo.setGeom(item.getGeom());
+                return vo;
+            }).collect(Collectors.toList());
+
+
+            List<TdgyStatisticsRes> completeList = dgyMapper.getListByYear(year, null, null, null);
+            List<LandSupplyProjectVO> resList2 = completeList.stream().map(item -> {
+                LandSupplyProjectVO vo = new LandSupplyProjectVO();
+                vo.setProjectPropertyId(item.getProjectId());
+                vo.setProjectName(item.getXmmc());
+                vo.setCompanyName(item.getCompany());
+                vo.setSupplyMethod(item.getGyfs());
+                vo.setSupplyType(supplyType.toString());
+                vo.setNodeId(item.getNodeId());
+                vo.setGeom(item.getGeom());
+                return vo;
+            }).collect(Collectors.toList());
+            if(CollectionUtils.isNotEmpty(resList1)) {
+                resList.addAll(resList1);
+            }
+            if(CollectionUtils.isNotEmpty(resList2)) {
+                resList.addAll(resList2);
+            }
         }
         return resList;
     }
@@ -551,6 +593,14 @@ public class SupplyServiceImpl implements ISupplyService {
 
 
 
+    @Override
+    public List<LandType> getLandTypeList() {
+        // 获取所有一级分类
+        List<LandType> landTypeList = landTypeMapper.selectFirstLevel();
+        return landTypeList;
+    }
+
+
 
     private LandSupplyReportDTO.TotalDTO buildTotalDTO(Map<String, Object> summary) {
         LandSupplyReportDTO.TotalDTO total = new LandSupplyReportDTO.TotalDTO();