|
|
@@ -29,29 +29,49 @@ public class ParcelServiceImpl implements IParcelService {
|
|
|
|
|
|
|
|
|
@Override
|
|
|
- public List<Zdjbxx> zdList(String djzqdm) {
|
|
|
+ public List<Zdjbxx> zdList(String djzqdm,String type) {
|
|
|
if(StringUtils.isBlank(djzqdm) || djzqdm.matches("[0]+")){
|
|
|
djzqdm = "";
|
|
|
}
|
|
|
if(StringUtils.isNotBlank(djzqdm) && djzqdm.length() != 12){
|
|
|
throw new ServiceException("地籍代码长度必须为12位");
|
|
|
}
|
|
|
- return zdjbxxMapper.getListByDjzqdm(djzqdm);
|
|
|
+ List<Zdjbxx> zdjbxxListAll = zdjbxxMapper.getListByDjzqdm(djzqdm);
|
|
|
+ List<Zdjbxx> zdjbxxList = new ArrayList<>();
|
|
|
+
|
|
|
+ // 这里区分所有权和使用权
|
|
|
+ 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);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ return zdjbxxList;
|
|
|
}
|
|
|
|
|
|
|
|
|
+
|
|
|
@Override
|
|
|
public List<Map<String, Object>> djzqList() {
|
|
|
return zdjbxxMapper.getDjzqWithDjqList();
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
+ * type 1,使用权数据多。
|
|
|
+ * type 2,所有权数据少。
|
|
|
* 地籍统计
|
|
|
* @param djzqdm
|
|
|
* @return
|
|
|
*/
|
|
|
@Override
|
|
|
- public ParcelStatisticsRes statistics(String djzqdm) {
|
|
|
+ public ParcelStatisticsRes statistics(String djzqdm,String type) {
|
|
|
|
|
|
if(StringUtils.isBlank(djzqdm) || djzqdm.matches("[0]+")){
|
|
|
djzqdm = "";
|
|
|
@@ -62,7 +82,24 @@ public class ParcelServiceImpl implements IParcelService {
|
|
|
}
|
|
|
|
|
|
ParcelStatisticsRes res = new ParcelStatisticsRes();
|
|
|
- List<Zdjbxx> zdjbxxList = zdjbxxMapper.getListByDjzqdm(djzqdm);
|
|
|
+ List<Zdjbxx> zdjbxxListAll = zdjbxxMapper.getListByDjzqdm(djzqdm);
|
|
|
+
|
|
|
+ List<Zdjbxx> zdjbxxList = new ArrayList<>();
|
|
|
+ // 这里区分所有权和使用权
|
|
|
+ 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<>();
|
|
|
List<ParcelStatisticsRes.QlxzDTO> qlxzStatisticsList = new ArrayList<>(); // 权利性质统计
|
|
|
@@ -120,12 +157,25 @@ public class ParcelServiceImpl implements IParcelService {
|
|
|
zdjbxxMapper.getDictByType("A7",null).forEach(item -> {
|
|
|
String name = item.get("name").toString();
|
|
|
String value = item.get("value").toString();
|
|
|
+
|
|
|
+ //ddd
|
|
|
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, filterList);
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
});
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
//这里遍历map,然后进行统计数据;
|
|
|
if(MapUtils.isNotEmpty(qlxzGroupedByYtMap)){
|
|
|
for(Map.Entry<String, List<Zdjbxx>> entry : qlxzGroupedByYtMap.entrySet()){
|
|
|
@@ -149,6 +199,11 @@ public class ParcelServiceImpl implements IParcelService {
|
|
|
res.setQlxzStatisticsList(qlxzStatisticsList);
|
|
|
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
//-------------------------------------------第四部分: 权利类型-所有权统计--------------------------------
|
|
|
Map<String,List<Zdjbxx>> qllxSuoYouGroupedByYtMap = new LinkedHashMap<>();
|
|
|
zdjbxxMapper.getDictByType("A6","所有权").forEach(item -> {
|