Bläddra i källkod

联调修改合前端联调,统计中划拨,出让其它取值为面积不是个数

chenendian 1 månad sedan
förälder
incheckning
5e477fce14

+ 46 - 9
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/controller/cadastre/SupplyController.java

@@ -93,9 +93,6 @@ public class SupplyController extends BaseController {
 
 
 
-    // todo  当前方法为导出excel的方法, 导出代码逻辑可用参考 (public void exportPurposeReport(HttpServletResponse response, @RequestParam String startYear, @RequestParam String endYear) 方法。可用自行定义一个新的ExcelVo类来适配供应用途分析报表的数据结构,或者直接使用LandSupplyReportDTO中的数据来生成Excel文件。
-    //  最终前端下载的excel文件程呈现的效果见参考图片
-    //  根据需求,完善当前方法,当前方法可以任意命名,参数也可以根据需要调整,主要是实现根据时间范围查询土地供应统计报表数据,并将数据导出成Excel文件供前端下载。
     @PostMapping("/progress/export")
     public void exportProgressReport(HttpServletResponse response, @RequestParam String startTime, @RequestParam String endTime) {
         try {
@@ -189,9 +186,9 @@ public class SupplyController extends BaseController {
                     if (detail.getPlan() != null) {
                         dataRow.createCell(colIndex++).setCellValue(detail.getPlan().getArea() != null ? detail.getPlan().getArea() : 0.0);
                         dataRow.createCell(colIndex++).setCellValue(detail.getPlan().getCount() != null ? detail.getPlan().getCount() : 0);
-                        dataRow.createCell(colIndex++).setCellValue(detail.getPlan().getTransfer() != null ? detail.getPlan().getTransfer() : 0.0);
-                        dataRow.createCell(colIndex++).setCellValue(detail.getPlan().getAllocation() != null ? detail.getPlan().getAllocation() : 0.0);
-                        dataRow.createCell(colIndex++).setCellValue(detail.getPlan().getOther() != null ? detail.getPlan().getOther() : 0.0);
+                        dataRow.createCell(colIndex++).setCellValue(detail.getPlan().getTransfer() != null ? detail.getPlan().getTransfer() : 0);
+                        dataRow.createCell(colIndex++).setCellValue(detail.getPlan().getAllocation() != null ? detail.getPlan().getAllocation() : 0);
+                        dataRow.createCell(colIndex++).setCellValue(detail.getPlan().getOther() != null ? detail.getPlan().getOther() : 0);
                     } else {
                         colIndex += 5;
                     }
@@ -199,9 +196,9 @@ public class SupplyController extends BaseController {
                     if (detail.getCompleted() != null) {
                         dataRow.createCell(colIndex++).setCellValue(detail.getCompleted().getArea() != null ? detail.getCompleted().getArea() : 0.0);
                         dataRow.createCell(colIndex++).setCellValue(detail.getCompleted().getCount() != null ? detail.getCompleted().getCount() : 0);
-                        dataRow.createCell(colIndex++).setCellValue(detail.getCompleted().getTransfer() != null ? detail.getCompleted().getTransfer() : 0.0);
-                        dataRow.createCell(colIndex++).setCellValue(detail.getCompleted().getAllocation() != null ? detail.getCompleted().getAllocation() : 0.0);
-                        dataRow.createCell(colIndex++).setCellValue(detail.getCompleted().getOther() != null ? detail.getCompleted().getOther() : 0.0);
+                        dataRow.createCell(colIndex++).setCellValue(detail.getCompleted().getTransfer() != null ? detail.getCompleted().getTransfer() : 0);
+                        dataRow.createCell(colIndex++).setCellValue(detail.getCompleted().getAllocation() != null ? detail.getCompleted().getAllocation() : 0);
+                        dataRow.createCell(colIndex++).setCellValue(detail.getCompleted().getOther() != null ? detail.getCompleted().getOther() : 0);
                     } else {
                         colIndex += 5;
                     }
@@ -216,6 +213,46 @@ public class SupplyController extends BaseController {
                 }
             }
 
+            if (res.getSummary() != null && res.getSummary().getTotal() != null) {
+                LandSupplyReportDTO.TotalDTO total = res.getSummary().getTotal();
+                Row totalRow = sheet.createRow(rowIndex++);
+                
+                Cell typeCell = totalRow.createCell(0);
+                typeCell.setCellValue("合计");
+                typeCell.setCellStyle(dataStyle);
+                
+                Cell rateCell = totalRow.createCell(1);
+                rateCell.setCellValue(total.getSupplyRate() != null ? total.getSupplyRate() : "0%");
+                rateCell.setCellStyle(rateStyle);
+                
+                int colIndex = 2;
+                if (total.getPlan() != null) {
+                    totalRow.createCell(colIndex++).setCellValue(total.getPlan().getArea() != null ? total.getPlan().getArea() : 0.0);
+                    totalRow.createCell(colIndex++).setCellValue(total.getPlan().getCount() != null ? total.getPlan().getCount() : 0);
+                    totalRow.createCell(colIndex++).setCellValue(total.getPlan().getTransfer() != null ? total.getPlan().getTransfer() : 0);
+                    totalRow.createCell(colIndex++).setCellValue(total.getPlan().getAllocation() != null ? total.getPlan().getAllocation() : 0);
+                    totalRow.createCell(colIndex++).setCellValue(total.getPlan().getOther() != null ? total.getPlan().getOther() : 0);
+                } else {
+                    colIndex += 5;
+                }
+                
+                if (total.getCompleted() != null) {
+                    totalRow.createCell(colIndex++).setCellValue(total.getCompleted().getArea() != null ? total.getCompleted().getArea() : 0.0);
+                    totalRow.createCell(colIndex++).setCellValue(total.getCompleted().getCount() != null ? total.getCompleted().getCount() : 0);
+                    totalRow.createCell(colIndex++).setCellValue(total.getCompleted().getTransfer() != null ? total.getCompleted().getTransfer() : 0);
+                    totalRow.createCell(colIndex++).setCellValue(total.getCompleted().getAllocation() != null ? total.getCompleted().getAllocation() : 0);
+                    totalRow.createCell(colIndex++).setCellValue(total.getCompleted().getOther() != null ? total.getCompleted().getOther() : 0);
+                }
+                
+                for (int i = 0; i <= 11; i++) {
+                    if (totalRow.getCell(i) == null) {
+                        totalRow.createCell(i).setCellStyle(dataStyle);
+                    } else {
+                        totalRow.getCell(i).setCellStyle(dataStyle);
+                    }
+                }
+            }
+
             for (int i = 0; i <= 11; i++) {
                 sheet.autoSizeColumn(i);
             }

+ 6 - 6
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/domain/cadastre/LandSupplyReportDTO.java

@@ -36,18 +36,18 @@ public class LandSupplyReportDTO {
         private Double area;
         private Integer count;
         /** 供地方式(出让)的数据 */
-        private Double transfer;
+        private Integer transfer;
         /** 供地方式(划拨)数据 */
-        private Double allocation;
-        private Double other;
+        private Integer allocation;
+        private Integer other;
     }
 
     @Data
     public static class CompletedDTO {
         private Double area;
         private Integer count;
-        private Double transfer;
-        private Double allocation;
-        private Double other;
+        private Integer transfer;
+        private Integer allocation;
+        private Integer other;
     }
 }

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

@@ -6,9 +6,7 @@ import com.siwei.apply.domain.cadastre.LandSupplyReportDTO;
 import com.siwei.apply.domain.res.SupplyYearStatisticsRes;
 import com.siwei.apply.domain.res.TrendStatisticsRes;
 import com.siwei.apply.domain.vo.LandSupplyProjectVO;
-import com.siwei.apply.domain.vo.LandSupplyPurposeReportVO;
 import com.siwei.apply.domain.vo.LandSupplyReportVO;
-import com.siwei.common.core.domain.R;
 
 import java.util.List;
 
@@ -17,7 +15,7 @@ public interface ISupplyService {
     Object GetList(String param);
 
     LandSupplyReportDTO getTdgyReport(String startTime,String endTime); //  supplyService.getTdgyReport(startTime,endTime);
-    LandSupplyReportDTO getTdgyReport222(String startTime,String endTime); //  supplyService.getTdgyReport(startTime,endTime);
+    //LandSupplyReportDTO getTdgyReport222(String startTime,String endTime); //  supplyService.getTdgyReport(startTime,endTime);
 
 
     SupplyYearStatisticsRes yearStatistics(String year);

+ 34 - 68
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/service/cadastre/impl/SupplyServiceImpl.java

@@ -283,24 +283,24 @@ public class SupplyServiceImpl implements ISupplyService {
                 d.setPlan(new LandSupplyReportDTO.PlanDTO());
                 d.getPlan().setArea(0.0);
                 d.getPlan().setCount(0);
-                d.getPlan().setTransfer(0.0);
-                d.getPlan().setAllocation(0.0);
-                d.getPlan().setOther(0.0);
+                d.getPlan().setTransfer(0);
+                d.getPlan().setAllocation(0);
+                d.getPlan().setOther(0);
                 d.setCompleted(new LandSupplyReportDTO.CompletedDTO());
                 d.getCompleted().setArea(0.0);
                 d.getCompleted().setCount(0);
-                d.getCompleted().setTransfer(0.0);
-                d.getCompleted().setAllocation(0.0);
-                d.getCompleted().setOther(0.0);
+                d.getCompleted().setTransfer(0);
+                d.getCompleted().setAllocation(0);
+                d.getCompleted().setOther(0);
                 return d;
             });
 
             LandSupplyReportDTO.PlanDTO plan = detail.getPlan();
             plan.setArea(plan.getArea() + toDouble(landTypeStat.get("planmu")));
             plan.setCount(plan.getCount() + toInteger(landTypeStat.get("plancount")));
-            plan.setTransfer(plan.getTransfer() + toDouble(landTypeStat.get("plantransfer")));
-            plan.setAllocation(plan.getAllocation() + toDouble(landTypeStat.get("planallocation")));
-            plan.setOther(plan.getOther() + toDouble(landTypeStat.get("planother")));
+            plan.setTransfer(plan.getTransfer() + toInteger(landTypeStat.get("plantransfer")));
+            plan.setAllocation(plan.getAllocation() + toInteger(landTypeStat.get("planallocation")));
+            plan.setOther(plan.getOther() + toInteger(landTypeStat.get("planother")));
         }
 
         // 2. 统计完成数据并按一级分类归类
@@ -319,15 +319,15 @@ public class SupplyServiceImpl implements ISupplyService {
                     d.setPlan(new LandSupplyReportDTO.PlanDTO());
                     d.getPlan().setArea(0.0);
                     d.getPlan().setCount(0);
-                    d.getPlan().setTransfer(0.0);
-                    d.getPlan().setAllocation(0.0);
-                    d.getPlan().setOther(0.0);
+                    d.getPlan().setTransfer(0);
+                    d.getPlan().setAllocation(0);
+                    d.getPlan().setOther(0);
                     d.setCompleted(new LandSupplyReportDTO.CompletedDTO());
                     d.getCompleted().setArea(0.0);
                     d.getCompleted().setCount(0);
-                    d.getCompleted().setTransfer(0.0);
-                    d.getCompleted().setAllocation(0.0);
-                    d.getCompleted().setOther(0.0);
+                    d.getCompleted().setTransfer(0);
+                    d.getCompleted().setAllocation(0);
+                    d.getCompleted().setOther(0);
                     return d;
                 });
 
@@ -338,15 +338,19 @@ public class SupplyServiceImpl implements ISupplyService {
                 
                 String gyfs = item.getGyfs();
                 if ("出让".equals(gyfs)) {
-                    completed.setTransfer(completed.getTransfer() + area);
+                    int transfer = completed.getTransfer()+1;
+                    completed.setTransfer(transfer);
                 } else if ("划拨".equals(gyfs)) {
-                    completed.setAllocation(completed.getAllocation() + area);
+                    int allocation = completed.getAllocation()+1;
+                    completed.setAllocation(allocation);
                 } else {
-                    completed.setOther(completed.getOther() + area);
+                    int other = completed.getOther()+1;
+                    completed.setOther(other);
                 }
             }
         }
 
+
         // 3. 构建 Summary
         LandSupplyReportDTO.SummaryDTO summary = new LandSupplyReportDTO.SummaryDTO();
         LandSupplyReportDTO.TotalDTO total = buildTotalDTO(planSummary);
@@ -354,12 +358,10 @@ public class SupplyServiceImpl implements ISupplyService {
         // 重新计算 Total 的 Completed 部分,因为之前 buildTotalDTO 填充的是 0
         if (CollectionUtils.isNotEmpty(completeList)) {
             double totalArea = completeList.stream().filter(g -> g.getMjMu() != null).mapToDouble(g -> g.getMjMu().doubleValue()).sum();
-            double totalTransfer = completeList.stream().filter(g -> "出让".equals(g.getGyfs()) && g.getMjMu() != null).mapToDouble(g -> g.getMjMu().doubleValue()).sum();
-            double totalAllocation = completeList.stream().filter(g -> "划拨".equals(g.getGyfs()) && g.getMjMu() != null).mapToDouble(g -> g.getMjMu().doubleValue()).sum();
-            double totalOther = totalArea - totalTransfer - totalAllocation;
-            
-            total.setCompleted(buildCompletedDTO(totalArea, completeList.size(), totalTransfer, totalAllocation, totalOther));
-            
+            long totalTransfer = completeList.stream().filter(g -> "出让".equals(g.getGyfs())).count();
+            long totalAllocation = completeList.stream().filter(g -> "划拨".equals(g.getGyfs()) ).count();
+            long totalOther =  completeList.size() - totalTransfer - totalAllocation;
+            total.setCompleted(buildCompletedDTO(totalArea, completeList.size(), (int) totalTransfer,  (int) totalAllocation,  (int) totalOther));
             double planArea = total.getPlan().getArea();
             if (planArea > 0) {
                 total.setSupplyRate(String.format("%.2f%%", (totalArea / planArea) * 100));
@@ -548,34 +550,6 @@ public class SupplyServiceImpl implements ISupplyService {
     }
 
 
-    @Override
-    public LandSupplyReportDTO getTdgyReport222(String startTime, String endTime) {
-        LandSupplyReportDTO report = new LandSupplyReportDTO();
-        report.setTitle("土地供应统计报表");
-        report.setStatTimeRange(startTime + " 至 " + endTime);
-
-        Map<String, Object> planSummary = gongdiJihuaMapper.getPlanSummaryByTimeRange(startTime, endTime);
-        List<Map<String, Object>> planStatsByLandType = gongdiJihuaMapper.getPlanStatsByLandType(startTime, endTime);
-        //List<Map<String, Object>> planStatsBySupplyMode = gongdiJihuaMapper.getPlanStatsBySupplyMode(startTime, endTime);
-
-        LandSupplyReportDTO.SummaryDTO summary = new LandSupplyReportDTO.SummaryDTO();
-        LandSupplyReportDTO.TotalDTO total = buildTotalDTO(planSummary);
-        summary.setTotal(total);
-        report.setSummary(summary);
-
-        List<LandSupplyReportDTO.DetailDTO> details = new ArrayList<>();
-        for (Map<String, Object> landTypeStat : planStatsByLandType) {
-            LandSupplyReportDTO.DetailDTO detail = new LandSupplyReportDTO.DetailDTO();
-            detail.setCategory(convertCategory((String) landTypeStat.get("category")));
-            detail.setSupplyRate("0%");
-            detail.setPlan(buildPlanDTO(landTypeStat));
-            detail.setCompleted(new LandSupplyReportDTO.CompletedDTO());
-            details.add(detail);
-        }
-        report.setDetails(details);
-
-        return report;
-    }
 
 
     private LandSupplyReportDTO.TotalDTO buildTotalDTO(Map<String, Object> summary) {
@@ -585,33 +559,25 @@ public class SupplyServiceImpl implements ISupplyService {
         LandSupplyReportDTO.PlanDTO plan = new LandSupplyReportDTO.PlanDTO();
         plan.setArea(toDouble(summary.get("planmu")));
         plan.setCount(toInteger(summary.get("plancount")));
-        plan.setTransfer(toDouble(summary.get("plantransfer")));
-        plan.setAllocation(toDouble(summary.get("planallocation")));
-        plan.setOther(toDouble(summary.get("planother")));
+        plan.setTransfer(toInteger(summary.get("plantransfer")));
+        plan.setAllocation(toInteger(summary.get("planallocation")));
+        plan.setOther(toInteger(summary.get("planother")));
         total.setPlan(plan);
 
         LandSupplyReportDTO.CompletedDTO completed = new LandSupplyReportDTO.CompletedDTO();
         completed.setArea(0.0);
         completed.setCount(0);
-        completed.setTransfer(0.0);
-        completed.setAllocation(0.0);
-        completed.setOther(0.0);
+        completed.setTransfer(0);
+        completed.setAllocation(0);
+        completed.setOther(0);
         total.setCompleted(completed);
 
         return total;
     }
 
-    private LandSupplyReportDTO.PlanDTO buildPlanDTO(Map<String, Object> stat) {
-        LandSupplyReportDTO.PlanDTO plan = new LandSupplyReportDTO.PlanDTO();
-        plan.setArea(toDouble(stat.get("planmu")));
-        plan.setCount(toInteger(stat.get("plancount")));
-        plan.setTransfer(toDouble(stat.get("plantransfer")));
-        plan.setAllocation(toDouble(stat.get("planallocation")));
-        plan.setOther(toDouble(stat.get("planother")));
-        return plan;
-    }
 
-    private LandSupplyReportDTO.CompletedDTO buildCompletedDTO(Double area, Integer count, Double transfer, Double allocation, Double other) {
+
+    private 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);

+ 6 - 6
siwei-modules/siwei-apply/src/main/resources/one_code_index_v1.json

@@ -14,8 +14,8 @@
     "children": [
       {
         "id": "1",
-        "label": "用地预审与选址意见书",
-        "title": "用地预审与选址意见书",
+        "label": "用地预审与选址意见书许可范围",
+        "title": "用地预审与选址意见书许可范围",
         "type": "wms",
         "url": "http://192.168.60.220:8090/geoserver/c_one_code/wms?service=WMS&version=1.1.0&request=GetMap&layers=c_one_code%3Ac_one_code_ydysyxz&bbox=115.81535941350508%2C28.80663797957737%2C115.95003761461436%2C28.93561402541765&width=768&height=735&srs=EPSG%3A4326&styles=&format=application/openlayers",
         "source": "",
@@ -84,8 +84,8 @@
       },
       {
         "id": "6",
-        "label": "建设用地规划许可",
-        "title": "建设用地规划许可",
+        "label": "建设用地规划许可地块",
+        "title": "建设用地规划许可地块",
         "type": "wms",
         "url": "http://192.168.60.220:8090/geoserver/c_one_code/wms?service=WMS&version=1.1.0&request=GetMap&layers=c_one_code%3Ac_one_code_jsgcghxk&bbox=115.81535941350508%2C28.80663797957737%2C115.95003761461436%2C28.93561402541765&width=768&height=735&srs=EPSG%3A4326&styles=&format=application/openlayers",
         "source": "t_jsydghxk",
@@ -98,8 +98,8 @@
       },
       {
         "id": "7",
-        "label": "建设工程规划许可",
-        "title": "建设工程规划许可",
+        "label": "建设工程规划许可地块",
+        "title": "建设工程规划许可地块",
         "type": "wms",
         "url": "http://192.168.60.220:8090/geoserver/c_one_code/wms?service=WMS&version=1.1.0&request=GetMap&layers=c_one_code%3Ac_one_code_jsydghxk&bbox=115.81535941350508%2C28.80663797957737%2C115.95003761461436%2C28.93561402541765&width=768&height=735&srs=EPSG%3A4326&styles=&format=application/openlayers",
         "source": "t_jsgcghxk",