|
|
@@ -549,20 +549,72 @@ public class StorageServiceImpl {
|
|
|
if ("0".equals(year)) {
|
|
|
year = null;
|
|
|
}
|
|
|
+
|
|
|
+ //出库数据(供应数据)
|
|
|
+ List<TdgyStatisticsRes> completeSjgdList = tdgyMapper.getSjgdListByYear(year, null, null, null);
|
|
|
+ List<Tdgy> tdgyList = tdgyMapper.getTdgyList(year,year);
|
|
|
+ //这里获取实际供地数据:根据年份进行分组:
|
|
|
+
|
|
|
+ Map<String,Double> outDataAreaMap = new TreeMap<>();
|
|
|
+ //这里获取实际供地数据:根据年份进行分组:
|
|
|
+ if(CollectionUtils.isNotEmpty(completeSjgdList)){
|
|
|
+ for (TdgyStatisticsRes item : completeSjgdList) {
|
|
|
+ String tdyt = item.getTdyt();
|
|
|
+ Double area = item.getMjMu() == null ? 0D : item.getMjMu().doubleValue();
|
|
|
+ outDataAreaMap.merge(tdyt, area, Double::sum);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(CollectionUtils.isNotEmpty(tdgyList)){
|
|
|
+ for (Tdgy item : tdgyList) {
|
|
|
+ String tdyt = item.getTdyt();
|
|
|
+ Double area = item.getGdArea() == null ? 0D : item.getGdArea().doubleValue();
|
|
|
+ outDataAreaMap.merge(tdyt, area, Double::sum);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ //这里code -name
|
|
|
+ Map<String,Double> tmpOutDataAreaMap = new TreeMap<>();
|
|
|
+ if(MapUtils.isNotEmpty(outDataAreaMap)){
|
|
|
+ Set<String> tdytCodeSet = outDataAreaMap.keySet();
|
|
|
+ for(String code : tdytCodeSet){
|
|
|
+ String category = getTdytByCode(code);
|
|
|
+ if(StringUtils.isBlank(category)){
|
|
|
+ category = "未知"+code;
|
|
|
+ }
|
|
|
+ tmpOutDataAreaMap.put(category,outDataAreaMap.get(code));
|
|
|
+ }
|
|
|
+ outDataAreaMap = tmpOutDataAreaMap;
|
|
|
+ }
|
|
|
+
|
|
|
+ //入库数据
|
|
|
List<Map<String, Object>> statsList = gjShijiShouchuMapper.getStatsByYearAndUse(year);
|
|
|
List<TrendUseStatisticsData> res = new ArrayList<>();
|
|
|
if (CollectionUtils.isNotEmpty(statsList)) {
|
|
|
for (Map<String, Object> stat : statsList) {
|
|
|
TrendUseStatisticsData data = new TrendUseStatisticsData();
|
|
|
- data.setUseName(convertCategory(String.valueOf(stat.get("use_name"))));
|
|
|
+ String category = convertCategory(String.valueOf(stat.get("use_name")));
|
|
|
+ data.setUseName(category);
|
|
|
data.setInDataArea(String.valueOf(stat.get("in_data_area")));
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
data.setOutDataArea("0");
|
|
|
+ if(outDataAreaMap.containsKey(category)) {
|
|
|
+ data.setOutDataArea(String.format("%.2f",outDataAreaMap.remove(category)));
|
|
|
+ }
|
|
|
+ res.add(data);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ //如果年份交差情况,剩余的补全
|
|
|
+ if(MapUtils.isNotEmpty(outDataAreaMap)){
|
|
|
+ for (Map.Entry<String, Double> entry : outDataAreaMap.entrySet()) {
|
|
|
+ TrendUseStatisticsData data = new TrendUseStatisticsData();
|
|
|
+ String category = entry.getKey();
|
|
|
+ data.setUseName(category);
|
|
|
+ data.setOutDataArea(String.format("%.2f",entry.getValue()));
|
|
|
+ data.setInDataArea("0");
|
|
|
res.add(data);
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
return res;
|
|
|
}
|
|
|
|
|
|
@@ -570,6 +622,7 @@ public class StorageServiceImpl {
|
|
|
|
|
|
|
|
|
|
|
|
+
|
|
|
public List<Map<String, Object>> landStock(String year) {
|
|
|
if(StringUtils.isBlank(year)||"0".equals(year)){
|
|
|
year = null;
|
|
|
@@ -611,8 +664,6 @@ public class StorageServiceImpl {
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
-
|
|
|
public List<LandSupplyProjectVO> inOutProjectList(String year, Integer supplyType,String useType) {
|
|
|
List<LandSupplyProjectVO> resList = new ArrayList<>();
|
|
|
if (supplyType == 1||supplyType == 0) {//入库
|
|
|
@@ -656,7 +707,7 @@ public class StorageServiceImpl {
|
|
|
vo.setArea(String.format("%.2f", item.getMjMu() == null ? BigDecimal.ZERO : item.getMjMu()));
|
|
|
vo.setUseType(category);
|
|
|
resList.add(vo);
|
|
|
- }//
|
|
|
+ }// end for
|
|
|
}
|
|
|
|
|
|
if(CollectionUtils.isNotEmpty(tdgyList)){
|
|
|
@@ -686,7 +737,6 @@ public class StorageServiceImpl {
|
|
|
if(StringUtils.isNotBlank(useType)){ //这里通过用途计算
|
|
|
resList = resList.stream().filter(s->s.getUseType().equals(useType)).collect(Collectors.toList());
|
|
|
}
|
|
|
-
|
|
|
return resList;
|
|
|
}
|
|
|
|