|
|
@@ -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);
|