|
|
@@ -17,6 +17,7 @@ import com.siwei.spatial.api.domain.file.TGeomDb;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.commons.collections4.CollectionUtils;
|
|
|
import org.apache.commons.collections4.MapUtils;
|
|
|
+import org.apache.commons.lang3.ArrayUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
@@ -251,14 +252,10 @@ public class StorageServiceImpl {
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
//统计分析
|
|
|
public LandStorageReportDTO stroageProgress(String startYear, String endYear) {
|
|
|
LandStorageReportDTO report = new LandStorageReportDTO();
|
|
|
|
|
|
- startYear = "2025";
|
|
|
- endYear = "2026";
|
|
|
-
|
|
|
report.setTitle("收储进度分析报表");
|
|
|
report.setStatTimeRange(startYear + " 至 " + endYear);
|
|
|
|
|
|
@@ -487,6 +484,7 @@ public class StorageServiceImpl {
|
|
|
Map<String, Object> planSummary = gjShouchuJihuaMapper.getPlanSummaryByYear(year);
|
|
|
List<TdgyStatisticsRes> completeList = gjShijiShouchuMapper.gjShijiShouchuListByYear(year, null, null, null, null, null);
|
|
|
BigDecimal planArea = toBigDecimal(planSummary == null ? null : planSummary.get("plan_area"));
|
|
|
+ BigDecimal planCost = toBigDecimal(planSummary == null ? null : planSummary.get("plan_cost"));
|
|
|
int planCount = toInteger(planSummary == null ? null : planSummary.get("plan_project_count"));
|
|
|
BigDecimal completeArea = sumArea(completeList);
|
|
|
int completeCount = CollectionUtils.isEmpty(completeList) ? 0 : completeList.size();
|
|
|
@@ -499,9 +497,10 @@ public class StorageServiceImpl {
|
|
|
storageRate.setPlanArea(planArea.floatValue());
|
|
|
storageRate.setCompleteArea(completeArea.floatValue());
|
|
|
storageRate.setGdUnit("亩");
|
|
|
- storageRate.setEstimatedCost(0f);
|
|
|
- storageRate.setExpenditureCost(0f);
|
|
|
-
|
|
|
+ storageRate.setEstimatedCost(planCost.floatValue());
|
|
|
+ //完成成本
|
|
|
+ BigDecimal completeCost = sumCost(completeList);
|
|
|
+ storageRate.setExpenditureCost(completeCost.floatValue());
|
|
|
res.setStorageRate(storageRate);
|
|
|
res.setLandUseStatisticsList(buildLandUseStatistics(year));
|
|
|
res.setProjectSupplyList(buildMethodStatistics(year));
|
|
|
@@ -617,16 +616,29 @@ public class StorageServiceImpl {
|
|
|
|
|
|
private List<ProjectSupplyRes> buildMethodStatistics(String year) {
|
|
|
List<Map<String, Object>> planStats = gjShouchuJihuaMapper.getPlanStatsByMethod(year);
|
|
|
+ List<Map<String, Object>> completeStats = gjShijiShouchuMapper.getCompleteStatsByMethod(year);
|
|
|
+ String[] category = {"征收","收回","收购","其他"};
|
|
|
List<ProjectSupplyRes> res = new ArrayList<>();
|
|
|
- if (CollectionUtils.isNotEmpty(planStats)) {
|
|
|
+ for(String cate : category){
|
|
|
+ ProjectSupplyRes item = new ProjectSupplyRes();
|
|
|
+ item.setGdUnit("亩");
|
|
|
+ item.setGdType(cate);
|
|
|
+ item.setPlanArea(0f);
|
|
|
+ item.setCompleteArea(0f);
|
|
|
+
|
|
|
for (Map<String, Object> stat : planStats) {
|
|
|
- ProjectSupplyRes item = new ProjectSupplyRes();
|
|
|
- item.setGdType(convertCategory(String.valueOf(stat.get("category"))));
|
|
|
- item.setGdUnit("亩");
|
|
|
- Float area = toBigDecimal(stat.get("plan_area")).floatValue();
|
|
|
- item.setGdArea(area);
|
|
|
- item.setPlanArea(area);
|
|
|
- item.setCompleteArea(0f);
|
|
|
+ if(String.valueOf(stat.get("category")).equals(cate)){
|
|
|
+ Float area = toBigDecimal(stat.get("plan_area")).floatValue();
|
|
|
+ item.setPlanArea(area);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ for (Map<String, Object> stat : completeStats) {
|
|
|
+ if(String.valueOf(stat.get("category")).equals(cate)){
|
|
|
+ Float area = toBigDecimal(stat.get("complate_area")).floatValue();
|
|
|
+ item.setCompleteArea(area);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(item.getPlanArea()>0 || item.getCompleteArea()>0){
|
|
|
res.add(item);
|
|
|
}
|
|
|
}
|
|
|
@@ -651,6 +663,19 @@ public class StorageServiceImpl {
|
|
|
return sum.setScale(2, RoundingMode.HALF_UP);
|
|
|
}
|
|
|
|
|
|
+ private BigDecimal sumCost(List<TdgyStatisticsRes> list) {
|
|
|
+ BigDecimal sum = BigDecimal.ZERO;
|
|
|
+ if (CollectionUtils.isNotEmpty(list)) {
|
|
|
+ for (TdgyStatisticsRes item : list) {
|
|
|
+ sum = sum.add(item.getCost() == null ? BigDecimal.ZERO : item.getCost());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return sum.setScale(2, RoundingMode.HALF_UP);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
private Integer toRoundedInt(Object value) {
|
|
|
return toBigDecimal(value).setScale(0, RoundingMode.HALF_UP).intValue();
|
|
|
}
|