|
|
@@ -36,7 +36,7 @@ public class ParcelServiceImpl implements IParcelService {
|
|
|
if(StringUtils.isNotBlank(djzqdm) && djzqdm.length() != 12){
|
|
|
throw new ServiceException("地籍代码长度必须为12位");
|
|
|
}
|
|
|
- List<Zdjbxx> zdjbxxListAll = zdjbxxMapper.getListByDjzqdm(djzqdm);
|
|
|
+ List<Zdjbxx> zdjbxxListAll = zdjbxxMapper.getListByDjzqdm(djzqdm,null);
|
|
|
List<Zdjbxx> zdjbxxList = new ArrayList<>();
|
|
|
|
|
|
// 这里区分所有权和使用权
|
|
|
@@ -81,23 +81,11 @@ public class ParcelServiceImpl implements IParcelService {
|
|
|
}
|
|
|
|
|
|
ParcelStatisticsRes res = new ParcelStatisticsRes();
|
|
|
- List<Zdjbxx> zdjbxxListAll = zdjbxxMapper.getListByDjzqdm(djzqdm);
|
|
|
+ List<Zdjbxx> zdjbxxListAll = zdjbxxMapper.getListByDjzqdm(djzqdm,type);
|
|
|
|
|
|
List<Zdjbxx> zdjbxxList = new ArrayList<>();
|
|
|
+ zdjbxxList.addAll(zdjbxxListAll);
|
|
|
// 这里区分所有权和使用权
|
|
|
- if("1".equals(type)){
|
|
|
- zdjbxxMapper.getDictByType("A6","所有权").forEach(item -> {
|
|
|
- String value = item.get("value").toString();
|
|
|
- List<Zdjbxx> filterList = zdjbxxListAll.stream().filter(zd-> StringUtils.isBlank(zd.getQllx()) || !value.equals(zd.getQllx())).collect(Collectors.toList());
|
|
|
- zdjbxxList.addAll(filterList);
|
|
|
- });
|
|
|
- }else if("2".equals(type)){
|
|
|
- zdjbxxMapper.getDictByType("A6","所有权").forEach(item -> {
|
|
|
- String value = item.get("value").toString();
|
|
|
- List<Zdjbxx> filterList = zdjbxxListAll.stream().filter(zd-> StringUtils.isNotBlank(zd.getQllx())).filter(zd -> value.equals(zd.getQllx())).collect(Collectors.toList());
|
|
|
- zdjbxxList.addAll(filterList);
|
|
|
- });
|
|
|
- }
|
|
|
|
|
|
List<ParcelStatisticsRes.DetailDTO> detailList = new ArrayList<>();
|
|
|
List<ParcelStatisticsRes.TdytDTO> tdytStatisticsList = new ArrayList<>();
|
|
|
@@ -127,6 +115,7 @@ public class ParcelServiceImpl implements IParcelService {
|
|
|
|
|
|
//第二部分,主要填充tdytStatisticsList这个对象,统计查询出来的地籍数据的土地用途统计、
|
|
|
//获取所有一级分类
|
|
|
+ List<Zdjbxx> otherList = new ArrayList<>();
|
|
|
List<LandType> landTypeList = landTypeMapper.selectFirstLevel();
|
|
|
Map<String,List<Zdjbxx>> groupedByYtMap = new LinkedHashMap<>();
|
|
|
landTypeList.forEach(item -> {
|
|
|
@@ -135,8 +124,21 @@ public class ParcelServiceImpl implements IParcelService {
|
|
|
List<Zdjbxx> filterList = zdjbxxList.stream().filter(zd-> StringUtils.isNotBlank(zd.getYt())).filter(zd -> value.equals(zd.getYt().substring(0,2))).collect(Collectors.toList());
|
|
|
if(CollectionUtils.isNotEmpty(filterList)){
|
|
|
groupedByYtMap.put(name, filterList);
|
|
|
+ otherList.addAll(filterList);
|
|
|
}
|
|
|
});
|
|
|
+ //这里兼容其它类型
|
|
|
+ if(CollectionUtils.isNotEmpty(otherList)){
|
|
|
+ Set<Integer> bsmExtraSet = otherList.stream()
|
|
|
+ .map(Zdjbxx::getBsm)
|
|
|
+ .collect(Collectors.toSet());
|
|
|
+ List<Zdjbxx> extraList = zdjbxxList.stream()
|
|
|
+ .filter(item -> item.getBsm() != null && !bsmExtraSet.contains(item.getBsm()))
|
|
|
+ .collect(Collectors.toList());
|
|
|
+ if(CollectionUtils.isNotEmpty(extraList)){
|
|
|
+ groupedByYtMap.put("其它", extraList);
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
//这里遍历map,然后进行统计数据;
|
|
|
if(MapUtils.isNotEmpty(groupedByYtMap)){
|
|
|
@@ -154,6 +156,7 @@ public class ParcelServiceImpl implements IParcelService {
|
|
|
res.setTdytStatisticsList(tdytStatisticsList);
|
|
|
|
|
|
//------------------------------------------第三部分,权利性质统计和权利类型统计,这里需要根据查询出来的地籍数据中的权利性质和权利类型进行统计,统计出每种权利性质和权利类型-------------------------------
|
|
|
+ otherList.clear();
|
|
|
Map<String,List<Zdjbxx>> qlxzGroupedByYtMap = new LinkedHashMap<>();
|
|
|
zdjbxxMapper.getDictByType("A7",null).forEach(item -> {
|
|
|
String name = item.get("name").toString();
|
|
|
@@ -161,9 +164,23 @@ public class ParcelServiceImpl implements IParcelService {
|
|
|
List<Zdjbxx> filterList = zdjbxxList.stream().filter(zd-> StringUtils.isNotBlank(zd.getQlxz())).filter(zd -> value.equals(zd.getQlxz())).collect(Collectors.toList());
|
|
|
if(CollectionUtils.isNotEmpty(filterList)){
|
|
|
qlxzGroupedByYtMap.put(name+"|"+value, filterList);
|
|
|
+ otherList.addAll(filterList);
|
|
|
}
|
|
|
});
|
|
|
|
|
|
+ //这里兼容其它类型
|
|
|
+ if(CollectionUtils.isNotEmpty(otherList)){
|
|
|
+ Set<Integer> bsmExtraSet = otherList.stream()
|
|
|
+ .map(Zdjbxx::getBsm)
|
|
|
+ .collect(Collectors.toSet());
|
|
|
+ List<Zdjbxx> extraList = zdjbxxList.stream()
|
|
|
+ .filter(item -> item.getBsm() != null && !bsmExtraSet.contains(item.getBsm()))
|
|
|
+ .collect(Collectors.toList());
|
|
|
+ if(CollectionUtils.isNotEmpty(extraList)){
|
|
|
+ qlxzGroupedByYtMap.put("其它"+"|"+999, extraList);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
List<ParcelStatisticsRes.QlxzDTO> gy_qlxzStatisticsList = new ArrayList<>(); // 权利性质统计
|
|
|
List<ParcelStatisticsRes.QlxzDTO> jt_qlxzStatisticsList = new ArrayList<>(); // 权利性质统计
|
|
|
List<ParcelStatisticsRes.QlxzDTO> wz_qlxzStatisticsList = new ArrayList<>(); // 权利性质统计
|
|
|
@@ -178,11 +195,7 @@ public class ParcelServiceImpl implements IParcelService {
|
|
|
totalArea += convertAreaToMu(zd.getZdmj(), zd.getMjdw());
|
|
|
}
|
|
|
String[] arr = entry.getKey().split("\\|");
|
|
|
- if(arr[1].equals("100") || arr[1].equals("200")) {
|
|
|
- qlxzDTO.setQlxzmc(arr[0]);
|
|
|
- qlxzDTO.setQlxzmj(String.format("%.2f", totalArea));
|
|
|
- wz_qlxzStatisticsList.add(qlxzDTO);
|
|
|
- }else if(arr[1].startsWith("1")) {
|
|
|
+ if(arr[1].startsWith("1")) {
|
|
|
qlxzDTO.setQlxzmc(arr[0]);
|
|
|
qlxzDTO.setQlxzmj(String.format("%.2f", totalArea));
|
|
|
gy_qlxzStatisticsList.add(qlxzDTO);
|
|
|
@@ -190,6 +203,10 @@ public class ParcelServiceImpl implements IParcelService {
|
|
|
qlxzDTO.setQlxzmc(arr[0]);
|
|
|
qlxzDTO.setQlxzmj(String.format("%.2f", totalArea));
|
|
|
jt_qlxzStatisticsList.add(qlxzDTO);
|
|
|
+ }else {
|
|
|
+ qlxzDTO.setQlxzmc(arr[0]);
|
|
|
+ qlxzDTO.setQlxzmj(String.format("%.2f", totalArea));
|
|
|
+ wz_qlxzStatisticsList.add(qlxzDTO);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -588,7 +605,7 @@ public class ParcelServiceImpl implements IParcelService {
|
|
|
@Override
|
|
|
public List<ParcelStatisticsRes.QlxzDTO> getZdqlxzReport(){
|
|
|
List<ParcelStatisticsRes.QlxzDTO> resList = new ArrayList<>();
|
|
|
- List<Zdjbxx> zdjbxxList = zdjbxxMapper.getListByDjzqdm(null);
|
|
|
+ List<Zdjbxx> zdjbxxList = zdjbxxMapper.getListByDjzqdm(null,null);
|
|
|
Map<String,List<Zdjbxx>> qlxzGroupedByYtMap = new LinkedHashMap<>();
|
|
|
zdjbxxMapper.getDictByType("A7",null).forEach(item -> {
|
|
|
String name = item.get("name").toString();
|