|
|
@@ -1,16 +1,24 @@
|
|
|
package com.siwei.apply.service.cadastre.impl;
|
|
|
|
|
|
+import com.siwei.apply.domain.GongdiJihua;
|
|
|
import com.siwei.apply.domain.cadastre.LandSupplyReportDTO;
|
|
|
import com.siwei.apply.domain.res.*;
|
|
|
|
|
|
+import com.siwei.apply.domain.vo.GongdiJihuaFilterVo;
|
|
|
+import com.siwei.apply.domain.vo.LandSupplyProjectVO;
|
|
|
import com.siwei.apply.mapper.GjShijiShouchuMapper;
|
|
|
import com.siwei.apply.mapper.GongdiJihuaMapper;
|
|
|
import com.siwei.apply.mapper.LandTypeMapper;
|
|
|
+import com.siwei.apply.mapper.TdgyMapper;
|
|
|
+import com.siwei.common.core.utils.StringUtils;
|
|
|
import org.apache.commons.collections4.CollectionUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
+import java.math.BigDecimal;
|
|
|
import java.util.*;
|
|
|
+import java.util.concurrent.atomic.AtomicInteger;
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
@Service
|
|
|
@@ -25,7 +33,8 @@ public class StorageServiceImpl {
|
|
|
@Autowired
|
|
|
private LandTypeMapper landTypeMapper;
|
|
|
|
|
|
-
|
|
|
+ @Autowired
|
|
|
+ private TdgyMapper dgyMapper;
|
|
|
|
|
|
//统计分析
|
|
|
public List<TrendStatisticsData> getData1() {
|
|
|
@@ -60,8 +69,117 @@ public class StorageServiceImpl {
|
|
|
}
|
|
|
|
|
|
|
|
|
+ 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);
|
|
|
+ AtomicInteger i= new AtomicInteger();
|
|
|
+ resList = planList.stream().map(item -> {
|
|
|
+ LandSupplyProjectVO vo = new LandSupplyProjectVO();
|
|
|
+ vo.setProjectPropertyId(String.valueOf(item.getGid()));
|
|
|
+ vo.setProjectName(item.getXmmc());
|
|
|
+ vo.setCompanyName("暂无");
|
|
|
+ if(i.incrementAndGet()/5 == 0){
|
|
|
+ vo.setSupplyMethod("收购");
|
|
|
+ }else {
|
|
|
+ vo.setSupplyMethod("征地");
|
|
|
+ }
|
|
|
+ vo.setSupplyType(supplyType.toString());
|
|
|
+ vo.setDateType(supplyType.toString());
|
|
|
+ vo.setGeom(item.getGeom());
|
|
|
+ String area = String.format("%.2f", item.getMjMu() == null ? BigDecimal.ZERO : item.getMjMu());
|
|
|
+ vo.setArea(area);
|
|
|
+ vo.setYear(item.getGysj());
|
|
|
+ return vo;
|
|
|
+ }).collect(Collectors.toList());
|
|
|
+ }else if(supplyType == 2){
|
|
|
+ //这里合并两部分数据
|
|
|
+ List<TdgyStatisticsRes> completeList = new ArrayList<>();
|
|
|
+ List<TdgyStatisticsRes> completeBusinessStatusList = dgyMapper.getListByYear(null, null, null, null);
|
|
|
+ List<TdgyStatisticsRes> completeSjgdList = dgyMapper.getSjgdListByYear(null, null, null, null);
|
|
|
+ if(CollectionUtils.isNotEmpty(completeBusinessStatusList)){
|
|
|
+ completeList.addAll(completeBusinessStatusList);
|
|
|
+ }
|
|
|
+ if(CollectionUtils.isNotEmpty(completeSjgdList)){
|
|
|
+ completeList.addAll(completeSjgdList);
|
|
|
+ }
|
|
|
|
|
|
-
|
|
|
+ AtomicInteger i= new AtomicInteger();
|
|
|
+ resList = completeList.stream().map(item -> {
|
|
|
+ LandSupplyProjectVO vo = new LandSupplyProjectVO();
|
|
|
+ vo.setProjectPropertyId(item.getProjectId());
|
|
|
+ vo.setProjectName(item.getXmmc());
|
|
|
+ vo.setCompanyName(item.getCompany());
|
|
|
+ if(i.incrementAndGet()/5 == 0){
|
|
|
+ vo.setSupplyMethod("收购");
|
|
|
+ }else {
|
|
|
+ vo.setSupplyMethod("征地");
|
|
|
+ }
|
|
|
+ vo.setSupplyType(supplyType.toString());
|
|
|
+ vo.setDateType(supplyType.toString());
|
|
|
+ if(StringUtils.isBlank(item.getProjectId())){
|
|
|
+ vo.setDateType("3");
|
|
|
+ }
|
|
|
+ vo.setNodeId(item.getNodeId());
|
|
|
+ vo.setGeom(item.getGeom());
|
|
|
+ vo.setYear(item.getGysj());
|
|
|
+ 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("1");
|
|
|
+ vo.setDateType("1");
|
|
|
+ vo.setGeom(item.getGeom());
|
|
|
+ return vo;
|
|
|
+ }).collect(Collectors.toList());
|
|
|
+ //这里合并两部分数据
|
|
|
+ List<TdgyStatisticsRes> completeList = new ArrayList<>();
|
|
|
+ List<TdgyStatisticsRes> completeBusinessStatusList = dgyMapper.getListByYear(year, null, null, null);
|
|
|
+ List<TdgyStatisticsRes> completeSjgdList = dgyMapper.getSjgdListByYear(year, null, null, null);
|
|
|
+ if(CollectionUtils.isNotEmpty(completeBusinessStatusList)){
|
|
|
+ completeList.addAll(completeBusinessStatusList);
|
|
|
+ }
|
|
|
+ if(CollectionUtils.isNotEmpty(completeSjgdList)){
|
|
|
+ completeList.addAll(completeSjgdList);
|
|
|
+ }
|
|
|
+ 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("2");
|
|
|
+ vo.setDateType("2");
|
|
|
+ if(StringUtils.isBlank(item.getProjectId())){
|
|
|
+ vo.setDateType("3");
|
|
|
+ }
|
|
|
+ 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;
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|