|
|
@@ -7,7 +7,6 @@ import com.siwei.apply.domain.cadastre.ParcelStatisticsRes;
|
|
|
import com.siwei.apply.domain.cadastre.Zdjbxx;
|
|
|
import com.siwei.apply.domain.res.*;
|
|
|
import com.siwei.apply.domain.vo.GongdiJihuaFilterVo;
|
|
|
-import com.siwei.apply.domain.vo.LandSupplyProjectVO;
|
|
|
import com.siwei.apply.domain.vo.LandSupplyReportVO;
|
|
|
import com.siwei.apply.enums.LandUseTypeEnum;
|
|
|
import com.siwei.apply.mapper.GongdiJihuaMapper;
|
|
|
@@ -15,6 +14,7 @@ import com.siwei.apply.mapper.LandTypeMapper;
|
|
|
import com.siwei.apply.mapper.TdgyMapper;
|
|
|
import com.siwei.apply.mapper.cadastre.ZdjbxxMapper;
|
|
|
import com.siwei.apply.service.cadastre.IParcelService;
|
|
|
+import com.siwei.common.core.exception.ServiceException;
|
|
|
import org.apache.commons.collections4.CollectionUtils;
|
|
|
import org.apache.commons.collections4.MapUtils;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
@@ -40,13 +40,11 @@ public class ParcelServiceImpl implements IParcelService {
|
|
|
@Autowired
|
|
|
private LandTypeMapper landTypeMapper;
|
|
|
|
|
|
-
|
|
|
@Override
|
|
|
- public Object GetList(String param) {
|
|
|
- return null;
|
|
|
+ public List<Map<String, Object>> djzqList() {
|
|
|
+ return zdjbxxMapper.getDjzqWithDjqList();
|
|
|
}
|
|
|
|
|
|
-
|
|
|
/**
|
|
|
* 地籍统计
|
|
|
* @param djzqdm
|
|
|
@@ -54,17 +52,22 @@ public class ParcelServiceImpl implements IParcelService {
|
|
|
*/
|
|
|
@Override
|
|
|
public ParcelStatisticsRes statistics(String djzqdm) {
|
|
|
+
|
|
|
+ if(StringUtils.isBlank(djzqdm) || djzqdm.matches("[0]+")){
|
|
|
+ djzqdm = "";
|
|
|
+ }
|
|
|
+
|
|
|
+ if(StringUtils.isNotBlank(djzqdm) && djzqdm.length() !=12){
|
|
|
+ throw new ServiceException("地籍代码长度必须为12位");
|
|
|
+ }
|
|
|
+
|
|
|
ParcelStatisticsRes res = new ParcelStatisticsRes();
|
|
|
List<Zdjbxx> zdjbxxList = zdjbxxMapper.getListByDjzqdm(djzqdm);
|
|
|
-
|
|
|
List<ParcelStatisticsRes.DetailDTO> detailList = new ArrayList<>();
|
|
|
List<ParcelStatisticsRes.TdytDTO> tdytStatisticsList = new ArrayList<>();
|
|
|
List<ParcelStatisticsRes.QlxzDTO> qlxzStatisticsList = new ArrayList<>(); // 权利性质统计
|
|
|
List<ParcelStatisticsRes.QllxSuoyouquanDTO> qllxSuoyouquanStatisticsList= new ArrayList<>(); // 权利类型所有权统计
|
|
|
- List<ParcelStatisticsRes.QllxShiyongquanDTO> qllxShiyongquanStatisticsList= new ArrayList<>(); // 权利类型使用权统计
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
+ List<ParcelStatisticsRes.QllxShiyongquanDTO> qllxShiyongquanStatisticsList = new ArrayList<>(); // 权利类型使用权统计
|
|
|
|
|
|
if (CollectionUtils.isNotEmpty(zdjbxxList)) {
|
|
|
List<Zdjbxx> registeredList = new ArrayList<>();
|
|
|
@@ -79,9 +82,9 @@ public class ParcelServiceImpl implements IParcelService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- detailList.add(buildDetailDTO(registeredList, "0"));
|
|
|
+ detailList.add(buildDetailDTO(registeredList, "1"));
|
|
|
detailList.add(buildDetailDTO(unregisteredList, "2"));
|
|
|
- detailList.add(buildDetailDTO(zdjbxxList, "1"));
|
|
|
+ detailList.add(buildDetailDTO(zdjbxxList, "0"));
|
|
|
res.setLandNumStatisticsList(detailList);
|
|
|
|
|
|
//todo 第二部分,主要填充tdytStatisticsList这个对象,统计查询出来的地籍数据的土地用途统计、
|
|
|
@@ -111,12 +114,13 @@ public class ParcelServiceImpl implements IParcelService {
|
|
|
}
|
|
|
}
|
|
|
res.setTdytStatisticsList(tdytStatisticsList);
|
|
|
- //todo 第三部分,权利性质统计和权利类型统计,这里需要根据查询出来的地籍数据中的权利性质和权利类型进行统计,统计出每种权利性质和权利类型的面积占比,然后填充到qlxzStatisticsList、qllxSuoyouquanStatisticsList、qllxShiyongquanStatisticsList这三个对象中
|
|
|
+
|
|
|
+ //------------------------------------------第三部分,权利性质统计和权利类型统计,这里需要根据查询出来的地籍数据中的权利性质和权利类型进行统计,统计出每种权利性质和权利类型-------------------------------
|
|
|
Map<String,List<Zdjbxx>> qlxzGroupedByYtMap = new LinkedHashMap<>();
|
|
|
- zdjbxxMapper.getDictByType("A7").forEach(item -> {
|
|
|
+ zdjbxxMapper.getDictByType("A7",null).forEach(item -> {
|
|
|
String name = item.get("name").toString();
|
|
|
String value = item.get("value").toString();
|
|
|
- List<Zdjbxx> filterList = zdjbxxList.stream().filter(zd-> StringUtils.isNotBlank(zd.getYt())).filter(zd -> value.equals(zd.getYt().substring(0,2))).collect(Collectors.toList());
|
|
|
+ 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);
|
|
|
}
|
|
|
@@ -145,42 +149,91 @@ public class ParcelServiceImpl implements IParcelService {
|
|
|
res.setQlxzStatisticsList(qlxzStatisticsList);
|
|
|
|
|
|
|
|
|
- //todo 第四部分:
|
|
|
- qllxSuoyouquanStatisticsList.add(null);
|
|
|
-
|
|
|
+ //-------------------------------------------第四部分: 权利类型-所有权统计--------------------------------
|
|
|
+ Map<String,List<Zdjbxx>> qllxSuoYouGroupedByYtMap = new LinkedHashMap<>();
|
|
|
+ zdjbxxMapper.getDictByType("A6","所有权").forEach(item -> {
|
|
|
+ String name = item.get("name").toString();
|
|
|
+ String value = item.get("value").toString();
|
|
|
+ List<Zdjbxx> filterList = zdjbxxList.stream().filter(zd-> StringUtils.isNotBlank(zd.getQllx())).filter(zd -> value.equals(zd.getQllx())).collect(Collectors.toList());
|
|
|
+ if(CollectionUtils.isNotEmpty(filterList)){
|
|
|
+ qllxSuoYouGroupedByYtMap.put(name, filterList);
|
|
|
+ }
|
|
|
+ });
|
|
|
|
|
|
+ //这里遍历map,然后进行统计数据;
|
|
|
+ if(MapUtils.isNotEmpty(qllxSuoYouGroupedByYtMap)){
|
|
|
+ for(Map.Entry<String, List<Zdjbxx>> entry : qllxSuoYouGroupedByYtMap.entrySet()){
|
|
|
+ ParcelStatisticsRes.QllxSuoyouquanDTO qllxSuoyouquanDTO = getQllxSuoyouquanDTO(entry);
|
|
|
+ qllxSuoyouquanStatisticsList.add(qllxSuoyouquanDTO);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ res.setQllxSuoyouquanStatisticsList(qllxSuoyouquanStatisticsList);
|
|
|
|
|
|
+ //-------------------------------------------第五部分----------------------------------
|
|
|
|
|
|
+ //todo 第五部分:
|
|
|
+ Map<String,List<Zdjbxx>> qllxShiYongGroupedByYtMap = new LinkedHashMap<>();
|
|
|
+ zdjbxxMapper.getDictByType("A6","使用权").forEach(item -> {
|
|
|
+ String name = item.get("name").toString();
|
|
|
+ String value = item.get("value").toString();
|
|
|
+ List<Zdjbxx> filterList = zdjbxxList.stream().filter(zd-> StringUtils.isNotBlank(zd.getQllx())).filter(zd -> value.equals(zd.getQllx())).collect(Collectors.toList());
|
|
|
+ if(CollectionUtils.isNotEmpty(filterList)){
|
|
|
+ qllxShiYongGroupedByYtMap.put(name, filterList);
|
|
|
+ }
|
|
|
+ });
|
|
|
|
|
|
+ //这里遍历map,然后进行统计数据;
|
|
|
+ if(MapUtils.isNotEmpty(qllxShiYongGroupedByYtMap)){
|
|
|
+ for(Map.Entry<String, List<Zdjbxx>> entry : qllxShiYongGroupedByYtMap.entrySet()){
|
|
|
+ ParcelStatisticsRes.QllxShiyongquanDTO qllxShiyongquanDTO = getQllxShiyongquanDTO(entry);
|
|
|
+ qllxShiyongquanStatisticsList.add(qllxShiyongquanDTO);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ res.setQllxShiyongquanStatisticsList(qllxShiyongquanStatisticsList);
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
return res;
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+ private ParcelStatisticsRes.QllxSuoyouquanDTO getQllxSuoyouquanDTO(Map.Entry<String, List<Zdjbxx>> entry) {
|
|
|
+ ParcelStatisticsRes.QllxSuoyouquanDTO qllxSuoyouquanDTO = new ParcelStatisticsRes.QllxSuoyouquanDTO();
|
|
|
+ qllxSuoyouquanDTO.setQllxsyqmc(entry.getKey());
|
|
|
+ double totalArea = 0.0;
|
|
|
+ for(Zdjbxx zd : entry.getValue()) {
|
|
|
+ totalArea += convertAreaToMu(zd.getZdmj(), zd.getMjdw());
|
|
|
+ }
|
|
|
+ if(entry.getKey().contains("国有") && entry.getKey().contains("国家")){
|
|
|
+ qllxSuoyouquanDTO.setQllx("100");
|
|
|
+ }else if(entry.getKey().contains("集体")){
|
|
|
+ qllxSuoyouquanDTO.setQllx("200");
|
|
|
+ }else {
|
|
|
+ qllxSuoyouquanDTO.setQllx("0");
|
|
|
+ }
|
|
|
+ qllxSuoyouquanDTO.setQllxsyqmj(String.format("%.2f", totalArea));
|
|
|
+ return qllxSuoyouquanDTO;
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
|
|
-
|
|
|
-
|
|
|
+ private ParcelStatisticsRes.QllxShiyongquanDTO getQllxShiyongquanDTO(Map.Entry<String, List<Zdjbxx>> entry) {
|
|
|
+ ParcelStatisticsRes.QllxShiyongquanDTO qllxShiyongquanDTO = new ParcelStatisticsRes.QllxShiyongquanDTO();
|
|
|
+ qllxShiyongquanDTO.setQllxsyqmc(entry.getKey());
|
|
|
+ double totalArea = 0.0;
|
|
|
+ for(Zdjbxx zd : entry.getValue()) {
|
|
|
+ totalArea += convertAreaToMu(zd.getZdmj(), zd.getMjdw());
|
|
|
+ }
|
|
|
+ if(entry.getKey().contains("国有") && entry.getKey().contains("国家")){
|
|
|
+ qllxShiyongquanDTO.setQllx("100");
|
|
|
+ }else if(entry.getKey().contains("集体")){
|
|
|
+ qllxShiyongquanDTO.setQllx("200");
|
|
|
+ }else {
|
|
|
+ qllxShiyongquanDTO.setQllx("0");
|
|
|
+ }
|
|
|
+ qllxShiyongquanDTO.setQllxsyqmj(String.format("%.2f", totalArea));
|
|
|
+ return qllxShiyongquanDTO;
|
|
|
+ }
|
|
|
|
|
|
|
|
|
private ParcelStatisticsRes.DetailDTO buildDetailDTO(List<Zdjbxx> zdjbxxList, String djzt) {
|
|
|
@@ -558,98 +611,6 @@ public class ParcelServiceImpl implements IParcelService {
|
|
|
}
|
|
|
|
|
|
|
|
|
- /**
|
|
|
- * supplyType (1-计划,2-完成)
|
|
|
- * @param year
|
|
|
- * @param supplyType
|
|
|
- * @return
|
|
|
- */
|
|
|
- @Override
|
|
|
- public List<LandSupplyProjectVO> projectList(String year, Integer supplyType) {
|
|
|
- List<LandSupplyProjectVO> resList = new ArrayList<>();
|
|
|
- if(supplyType== 1){
|
|
|
- GongdiJihuaFilterVo filterVo = new GongdiJihuaFilterVo();
|
|
|
- filterVo.setYear(year);
|
|
|
- filterVo.setPageSize(100000);
|
|
|
- List<GongdiJihua> planList = gongdiJihuaMapper.getList(filterVo);
|
|
|
- resList = planList.stream().map(item -> {
|
|
|
- LandSupplyProjectVO vo = new LandSupplyProjectVO();
|
|
|
- vo.setProjectPropertyId(String.valueOf(item.getGid()));
|
|
|
- vo.setProjectName(item.getXmmc());
|
|
|
- vo.setCompanyName("暂无");
|
|
|
- vo.setSupplyMethod(item.getGyfs());
|
|
|
- vo.setSupplyType(supplyType.toString());
|
|
|
- vo.setGeom(item.getGeom());
|
|
|
- return vo;
|
|
|
- }).collect(Collectors.toList());
|
|
|
- }else if(supplyType == 2){
|
|
|
- List<TdgyStatisticsRes> completeList = dgyMapper.getListByYear(year, null, null, null);
|
|
|
- resList = completeList.stream().map(item -> {
|
|
|
- LandSupplyProjectVO vo = new LandSupplyProjectVO();
|
|
|
- vo.setProjectPropertyId(item.getProjectId());
|
|
|
- vo.setProjectName(item.getXmmc());
|
|
|
- vo.setCompanyName(item.getCompany());
|
|
|
- vo.setSupplyMethod(item.getGyfs());
|
|
|
- vo.setSupplyType(supplyType.toString());
|
|
|
- vo.setNodeId(item.getNodeId());
|
|
|
- vo.setGeom(item.getGeom());
|
|
|
- return vo;
|
|
|
- }).collect(Collectors.toList());
|
|
|
- } else if(supplyType == 0){
|
|
|
-
|
|
|
- GongdiJihuaFilterVo filterVo = new GongdiJihuaFilterVo();
|
|
|
- filterVo.setYear(year);
|
|
|
- filterVo.setPageSize(100000);
|
|
|
-
|
|
|
- List<GongdiJihua> planList = gongdiJihuaMapper.getList(filterVo);
|
|
|
- List<LandSupplyProjectVO> resList1 = planList.stream().map(item -> {
|
|
|
- LandSupplyProjectVO vo = new LandSupplyProjectVO();
|
|
|
- vo.setProjectPropertyId(String.valueOf(item.getGid()));
|
|
|
- vo.setProjectName(item.getXmmc());
|
|
|
- vo.setCompanyName("暂无");
|
|
|
- vo.setSupplyMethod(item.getGyfs());
|
|
|
- vo.setSupplyType(supplyType.toString());
|
|
|
- vo.setGeom(item.getGeom());
|
|
|
- return vo;
|
|
|
- }).collect(Collectors.toList());
|
|
|
-
|
|
|
-
|
|
|
- List<TdgyStatisticsRes> completeList = dgyMapper.getListByYear(year, null, null, null);
|
|
|
- List<LandSupplyProjectVO> resList2 = completeList.stream().map(item -> {
|
|
|
- LandSupplyProjectVO vo = new LandSupplyProjectVO();
|
|
|
- vo.setProjectPropertyId(item.getProjectId());
|
|
|
- vo.setProjectName(item.getXmmc());
|
|
|
- vo.setCompanyName(item.getCompany());
|
|
|
- vo.setSupplyMethod(item.getGyfs());
|
|
|
- vo.setSupplyType(supplyType.toString());
|
|
|
- vo.setNodeId(item.getNodeId());
|
|
|
- vo.setGeom(item.getGeom());
|
|
|
- return vo;
|
|
|
- }).collect(Collectors.toList());
|
|
|
- if(CollectionUtils.isNotEmpty(resList1)) {
|
|
|
- resList.addAll(resList1);
|
|
|
- }
|
|
|
- if(CollectionUtils.isNotEmpty(resList2)) {
|
|
|
- resList.addAll(resList2);
|
|
|
- }
|
|
|
- }
|
|
|
- return resList;
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- public GongdiJihua getPlanProject(String id) {
|
|
|
- return null;
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- @Override
|
|
|
- public List<LandType> getLandTypeList() {
|
|
|
- // 获取所有一级分类
|
|
|
- List<LandType> landTypeList = landTypeMapper.selectFirstLevel();
|
|
|
- return landTypeList;
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
|
|
|
private LandSupplyReportDTO.TotalDTO buildTotalDTO(Map<String, Object> summary) {
|
|
|
LandSupplyReportDTO.TotalDTO total = new LandSupplyReportDTO.TotalDTO();
|