|
|
@@ -217,8 +217,6 @@ public class BatchServiceImpl{
|
|
|
return batchTrendReportVO;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-
|
|
|
public List<YdbpData> billProjectList(String year) {
|
|
|
if(StringUtils.isBlank(year)){
|
|
|
throw new ServiceException("年份不能为空");
|
|
|
@@ -249,43 +247,48 @@ public class BatchServiceImpl{
|
|
|
return resList;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
public List<Map<String,Object>> approvalAndNotSupply(String year) {
|
|
|
if (StringUtils.isBlank(year) || "0".equals(year)) {
|
|
|
year = "";
|
|
|
}
|
|
|
|
|
|
List<Map<String,Object>> resList = new ArrayList<>();
|
|
|
- List<Map<String,Object>> singleBatchList = new ArrayList<>();
|
|
|
+
|
|
|
+ List<Map<String,Object>> singleBatchList = ydbpMapper.queryRemainGeomAreaByYearOfYdbp();
|
|
|
List<Map<String,Object>> reportBatchList = ydbpDataMapper.queryRemainGeomAreaByYear();
|
|
|
|
|
|
- Map<String,List<Map<String,Object>>> groupedSingleBatch = new HashMap<>();
|
|
|
- Map<String, List<YdbpData>> groupedReportBatch = new HashMap<>();
|
|
|
+ Map<String,Map<String,Object>> groupedSingleBatch = new HashMap<>();
|
|
|
+ Map<String,Map<String,Object>> groupedReportBatch = new HashMap<>();
|
|
|
+
|
|
|
|
|
|
if(CollectionUtils.isNotEmpty(singleBatchList)) {
|
|
|
groupedSingleBatch = singleBatchList.stream()
|
|
|
- .collect(Collectors.groupingBy(s->{
|
|
|
+ .collect(Collectors.toMap(
|
|
|
+ s -> {
|
|
|
+ Object nfStr = s.get("stat_year");
|
|
|
+ if(nfStr==null || String.valueOf(nfStr).isEmpty()||"1000".equals(String.valueOf(nfStr))){
|
|
|
+ return "其它";
|
|
|
+ }
|
|
|
+ return String.valueOf(nfStr);
|
|
|
+ },
|
|
|
+ s -> s // value直接是当前对象
|
|
|
+ ));
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ if(CollectionUtils.isNotEmpty(reportBatchList)) {
|
|
|
+ groupedReportBatch = reportBatchList.stream()
|
|
|
+ .collect(Collectors.toMap(s->{
|
|
|
Object nfStr = s.get("stat_year");
|
|
|
if(nfStr==null || String.valueOf(nfStr).isEmpty()||"1000".equals(String.valueOf(nfStr))){
|
|
|
return "其它";
|
|
|
}
|
|
|
return String.valueOf(nfStr);
|
|
|
- }));
|
|
|
- }
|
|
|
-
|
|
|
- if(CollectionUtils.isNotEmpty(reportBatchList)) {
|
|
|
-// groupedReportBatch = reportBatchList.stream()
|
|
|
-// .collect(Collectors.groupingBy(s->{
|
|
|
-// String pfDate = "";
|
|
|
-// if(StringUtils.isBlank(pfDate)){
|
|
|
-// return "其它";
|
|
|
-// }
|
|
|
-// pfDate = StringUtils.substring(pfDate,0,4);
|
|
|
-// return pfDate;
|
|
|
-// }));
|
|
|
+ },
|
|
|
+ s->s));
|
|
|
}
|
|
|
|
|
|
- Set<String> yearSet = new LinkedHashSet<>();
|
|
|
+ Set<String> yearSet = new TreeSet<>();
|
|
|
if(MapUtils.isNotEmpty(groupedSingleBatch)) {
|
|
|
yearSet.addAll(groupedSingleBatch.keySet());
|
|
|
}
|
|
|
@@ -294,18 +297,24 @@ public class BatchServiceImpl{
|
|
|
}
|
|
|
|
|
|
for(String yearKey : yearSet){
|
|
|
- Double areaArea = 0d;
|
|
|
- if(groupedSingleBatch.containsKey(yearKey)){
|
|
|
- //Map<Object>ddd = groupedSingleBatch.get(yearKey);
|
|
|
-// areaArea += groupedSingleBatch.get("ddd");
|
|
|
- }
|
|
|
+ Map<String,Object> single = groupedSingleBatch.get(yearKey);
|
|
|
+ Map<String,Object> report = groupedReportBatch.get(yearKey);
|
|
|
+
|
|
|
+ Double singleArea = Objects.nonNull(single) ? (Double)single.get("total_area_mu"):0d;
|
|
|
+ Double reportArea = Objects.nonNull(report) ? (Double) report.get("total_area_mu"):0d;
|
|
|
+
|
|
|
+ Long singleCount = Objects.nonNull(single) ? (Long) single.get("patch_count"):0;
|
|
|
+ Long reportCount = Objects.nonNull(report) ? (Long) report.get("patch_count"):0;
|
|
|
+
|
|
|
Map<String,Object> itemMap = new HashMap<>();
|
|
|
itemMap.put("year",yearKey);
|
|
|
- itemMap.put("singleArea",null);
|
|
|
- itemMap.put("reportArea",null);
|
|
|
+ itemMap.put("area",String.format("%.2f", (singleArea+reportArea)));
|
|
|
+ itemMap.put("count",singleCount+reportCount);
|
|
|
+
|
|
|
resList.add(itemMap);
|
|
|
}
|
|
|
- return null;
|
|
|
+
|
|
|
+ return resList;
|
|
|
}
|
|
|
|
|
|
|