|
|
@@ -1,14 +1,17 @@
|
|
|
package com.siwei.apply.service.cadastre.impl;
|
|
|
|
|
|
+import com.siwei.apply.domain.cadastre.LandStorageReportDTO;
|
|
|
import com.siwei.apply.domain.cadastre.LandSupplyReportDTO;
|
|
|
import com.siwei.apply.domain.res.*;
|
|
|
import com.siwei.apply.domain.vo.LandSupplyProjectVO;
|
|
|
import com.siwei.apply.mapper.GjShijiShouchuMapper;
|
|
|
import com.siwei.apply.mapper.GjShouchuJihuaMapper;
|
|
|
import com.siwei.common.core.utils.StringUtils;
|
|
|
+import com.siwei.system.api.domain.SysDictData;
|
|
|
import org.apache.commons.collections4.CollectionUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
+import org.springframework.web.bind.annotation.RequestParam;
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
import java.math.RoundingMode;
|
|
|
@@ -24,6 +27,65 @@ public class StorageServiceImpl {
|
|
|
@Autowired
|
|
|
private GjShouchuJihuaMapper gjShouchuJihuaMapper;
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+ //统计分析
|
|
|
+ public LandStorageReportDTO stroageProgress(String startTime,String endTime) {
|
|
|
+ LandStorageReportDTO report = new LandStorageReportDTO();
|
|
|
+ report.setTitle("收储进度分析报表");
|
|
|
+ report.setStatTimeRange(startTime + " 至 " + endTime);
|
|
|
+
|
|
|
+ String year = "2025";
|
|
|
+ List<LandStorageReportDTO.DetailDTO> details = new ArrayList<>();
|
|
|
+ List<TdgyStatisticsRes> completeList = gjShijiShouchuMapper.gjShijiShouchuListByYear(year, null, null, null);
|
|
|
+ Map<String, List<TdgyStatisticsRes>> completeMap = completeList.stream().collect(Collectors.groupingBy(TdgyStatisticsRes::getTdyt));
|
|
|
+ // 这里处理计划数据
|
|
|
+ List<TdgyStatisticsRes> planList = gjShouchuJihuaMapper.getPlanListByYear(year, null);
|
|
|
+ Set<String> categorySet = completeMap.keySet();
|
|
|
+ Map<String, List<TdgyStatisticsRes>> groupedPlan = planList.stream()
|
|
|
+ .collect(Collectors.groupingBy(
|
|
|
+ s -> {
|
|
|
+ String tdyt = s.getTdyt();
|
|
|
+ if (categorySet.contains(tdyt)) {
|
|
|
+ return tdyt;
|
|
|
+ }
|
|
|
+ return "其它";
|
|
|
+ }
|
|
|
+ ));
|
|
|
+
|
|
|
+
|
|
|
+ for(String category : categorySet){
|
|
|
+ LandStorageReportDTO.DetailDTO tmpDetailDTO = new LandStorageReportDTO.DetailDTO();
|
|
|
+ List<TdgyStatisticsRes> categoryPlanList = groupedPlan.get(category);
|
|
|
+ LandStorageReportDTO.PlanDTO plan = new LandStorageReportDTO.PlanDTO();
|
|
|
+ plan.setCount(categoryPlanList.size());
|
|
|
+ double totalArea = categoryPlanList.stream().mapToDouble(item -> item.getMjMu().doubleValue()).sum();
|
|
|
+ plan.setArea(totalArea);
|
|
|
+ plan.setCost(0F);
|
|
|
+ tmpDetailDTO.setPlan(plan);
|
|
|
+
|
|
|
+ List<TdgyStatisticsRes> categoryCompleteList = completeMap.get(category);
|
|
|
+ LandStorageReportDTO.CompletedDTO complete = new LandStorageReportDTO.CompletedDTO();
|
|
|
+ complete.setCost(0f);
|
|
|
+ totalArea = categoryCompleteList.stream().mapToDouble(item -> item.getMjMu().doubleValue()).sum();
|
|
|
+ complete.setArea(totalArea);
|
|
|
+ complete.setCount(categoryCompleteList.size());
|
|
|
+ complete.setMethod1(null);
|
|
|
+ tmpDetailDTO.setCompleted(complete);
|
|
|
+ tmpDetailDTO.setCategory(category);
|
|
|
+ tmpDetailDTO.setProgress(String.valueOf(categoryCompleteList.size()/categoryPlanList.size()));
|
|
|
+ details.add(tmpDetailDTO);
|
|
|
+ }
|
|
|
+ report.setDetails(details);
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
//统计分析
|
|
|
public List<TrendStatisticsData> getData1() {
|
|
|
List<Map<String, Object>> statsList = gjShijiShouchuMapper.getStatsByYear();
|