|
@@ -1,18 +1,18 @@
|
|
|
package com.siwei.apply.service.cadastre.impl;
|
|
package com.siwei.apply.service.cadastre.impl;
|
|
|
|
|
|
|
|
|
|
+import com.siwei.apply.domain.LandType;
|
|
|
import com.siwei.apply.domain.Tdgy;
|
|
import com.siwei.apply.domain.Tdgy;
|
|
|
import com.siwei.apply.domain.cadastre.LandStorageInOutReportDTO;
|
|
import com.siwei.apply.domain.cadastre.LandStorageInOutReportDTO;
|
|
|
import com.siwei.apply.domain.cadastre.LandStorageReportDTO;
|
|
import com.siwei.apply.domain.cadastre.LandStorageReportDTO;
|
|
|
import com.siwei.apply.domain.cadastre.LandSupplyReportDTO;
|
|
import com.siwei.apply.domain.cadastre.LandSupplyReportDTO;
|
|
|
import com.siwei.apply.domain.res.*;
|
|
import com.siwei.apply.domain.res.*;
|
|
|
import com.siwei.apply.domain.vo.LandSupplyProjectVO;
|
|
import com.siwei.apply.domain.vo.LandSupplyProjectVO;
|
|
|
-import com.siwei.apply.mapper.GjShijiShouchuMapper;
|
|
|
|
|
-import com.siwei.apply.mapper.GjShouchuJihuaMapper;
|
|
|
|
|
-import com.siwei.apply.mapper.GongdiJihuaMapper;
|
|
|
|
|
-import com.siwei.apply.mapper.TdgyMapper;
|
|
|
|
|
|
|
+import com.siwei.apply.mapper.*;
|
|
|
|
|
+import com.siwei.apply.service.NodeLandService;
|
|
|
import com.siwei.common.core.constant.SecurityConstants;
|
|
import com.siwei.common.core.constant.SecurityConstants;
|
|
|
import com.siwei.common.core.domain.R;
|
|
import com.siwei.common.core.domain.R;
|
|
|
import com.siwei.common.core.exception.ServiceException;
|
|
import com.siwei.common.core.exception.ServiceException;
|
|
|
|
|
+import com.siwei.common.core.utils.DateUtils;
|
|
|
import com.siwei.common.core.utils.StringUtils;
|
|
import com.siwei.common.core.utils.StringUtils;
|
|
|
import com.siwei.spatial.api.RemoteSpatialFilesDbService;
|
|
import com.siwei.spatial.api.RemoteSpatialFilesDbService;
|
|
|
import com.siwei.spatial.api.domain.file.TGeomDb;
|
|
import com.siwei.spatial.api.domain.file.TGeomDb;
|
|
@@ -29,6 +29,8 @@ import java.math.RoundingMode;
|
|
|
import java.util.*;
|
|
import java.util.*;
|
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
|
+import static com.siwei.apply.service.third.impl.DealExcelServiceImpl.allLandTypeList;
|
|
|
|
|
+
|
|
|
@Slf4j
|
|
@Slf4j
|
|
|
@Service
|
|
@Service
|
|
|
public class StorageServiceImpl {
|
|
public class StorageServiceImpl {
|
|
@@ -64,6 +66,11 @@ public class StorageServiceImpl {
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private GongdiJihuaMapper gongdiJihuaMapper;
|
|
private GongdiJihuaMapper gongdiJihuaMapper;
|
|
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private LandTypeMapper landTypeMapper;
|
|
|
|
|
+
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private NodeLandService nodeLandService;
|
|
|
|
|
|
|
|
|
|
|
|
|
public LandStorageInOutReportDTO inOutDetails() {
|
|
public LandStorageInOutReportDTO inOutDetails() {
|
|
@@ -473,7 +480,7 @@ public class StorageServiceImpl {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- //第二部分,计算供地
|
|
|
|
|
|
|
+ //第二部分,计算入库
|
|
|
List<Map<String, Object>> statsList = gjShijiShouchuMapper.getStatsByYear();
|
|
List<Map<String, Object>> statsList = gjShijiShouchuMapper.getStatsByYear();
|
|
|
if (CollectionUtils.isNotEmpty(statsList)) {
|
|
if (CollectionUtils.isNotEmpty(statsList)) {
|
|
|
for (Map<String, Object> stat : statsList) {
|
|
for (Map<String, Object> stat : statsList) {
|
|
@@ -549,6 +556,9 @@ public class StorageServiceImpl {
|
|
|
TrendUseStatisticsData data = new TrendUseStatisticsData();
|
|
TrendUseStatisticsData data = new TrendUseStatisticsData();
|
|
|
data.setUseName(convertCategory(String.valueOf(stat.get("use_name"))));
|
|
data.setUseName(convertCategory(String.valueOf(stat.get("use_name"))));
|
|
|
data.setInDataArea(String.valueOf(stat.get("in_data_area")));
|
|
data.setInDataArea(String.valueOf(stat.get("in_data_area")));
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
data.setOutDataArea("0");
|
|
data.setOutDataArea("0");
|
|
|
res.add(data);
|
|
res.add(data);
|
|
|
}
|
|
}
|
|
@@ -556,6 +566,10 @@ public class StorageServiceImpl {
|
|
|
return res;
|
|
return res;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
public List<Map<String, Object>> landStock(String year) {
|
|
public List<Map<String, Object>> landStock(String year) {
|
|
|
if(StringUtils.isBlank(year)||"0".equals(year)){
|
|
if(StringUtils.isBlank(year)||"0".equals(year)){
|
|
|
year = null;
|
|
year = null;
|
|
@@ -596,6 +610,88 @@ public class StorageServiceImpl {
|
|
|
return res;
|
|
return res;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ public List<LandSupplyProjectVO> inOutProjectList(String year, Integer supplyType,String useType) {
|
|
|
|
|
+ List<LandSupplyProjectVO> resList = new ArrayList<>();
|
|
|
|
|
+ if (supplyType == 1||supplyType == 0) {//入库
|
|
|
|
|
+ List<TdgyStatisticsRes> completeList = gjShijiShouchuMapper.gjShijiShouchuListByYear(year, null, null, null, null, null);
|
|
|
|
|
+ if (CollectionUtils.isNotEmpty(completeList)) {
|
|
|
|
|
+ for (TdgyStatisticsRes item : completeList) {
|
|
|
|
|
+ LandSupplyProjectVO vo = new LandSupplyProjectVO();
|
|
|
|
|
+ String category = convertCategory(item.getTdyt());
|
|
|
|
|
+ vo.setProjectPropertyId(item.getProjectId());
|
|
|
|
|
+ vo.setNodeId(item.getNodeId());
|
|
|
|
|
+ vo.setProjectName(item.getXmmc());
|
|
|
|
|
+ vo.setCompanyName("暂无");
|
|
|
|
|
+ vo.setSupplyMethod(item.getGyfs());
|
|
|
|
|
+ vo.setSupplyType("1");
|
|
|
|
|
+ vo.setDateType("1");
|
|
|
|
|
+ vo.setGeom(item.getGeom());
|
|
|
|
|
+ vo.setYear(item.getGysj());
|
|
|
|
|
+ vo.setArea(String.format("%.2f", item.getMjMu() == null ? BigDecimal.ZERO : item.getMjMu()));
|
|
|
|
|
+ vo.setUseType(category);
|
|
|
|
|
+ resList.add(vo);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ if (supplyType == 2||supplyType == 0) {//这里计算供地,用两部分数据进行实例化
|
|
|
|
|
+ List<TdgyStatisticsRes> completeSjgdList = tdgyMapper.getSjgdListByYear(year, null, null, null);
|
|
|
|
|
+ List<Tdgy> tdgyList = tdgyMapper.getTdgyList(year,year);
|
|
|
|
|
+ //这里获取实际供地数据:根据年份进行分组:
|
|
|
|
|
+ if(CollectionUtils.isNotEmpty(completeSjgdList)){
|
|
|
|
|
+ for (TdgyStatisticsRes item : completeSjgdList) {
|
|
|
|
|
+ LandSupplyProjectVO vo = new LandSupplyProjectVO();
|
|
|
|
|
+ String category = getTdytByCode(item.getTdyt());
|
|
|
|
|
+ vo.setProjectPropertyId(item.getProjectId());
|
|
|
|
|
+ vo.setNodeId(item.getNodeId());
|
|
|
|
|
+ vo.setProjectName(item.getXmmc());
|
|
|
|
|
+ vo.setCompanyName("暂无");
|
|
|
|
|
+ vo.setSupplyMethod(item.getGyfs());
|
|
|
|
|
+ vo.setSupplyType("2");
|
|
|
|
|
+ vo.setDateType("2");
|
|
|
|
|
+ vo.setGeom(item.getGeom());
|
|
|
|
|
+ vo.setYear(item.getGysj());
|
|
|
|
|
+ vo.setArea(String.format("%.2f", item.getMjMu() == null ? BigDecimal.ZERO : item.getMjMu()));
|
|
|
|
|
+ vo.setUseType(category);
|
|
|
|
|
+ resList.add(vo);
|
|
|
|
|
+ }//
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if(CollectionUtils.isNotEmpty(tdgyList)){
|
|
|
|
|
+ for (Tdgy item : tdgyList) {
|
|
|
|
|
+ LandSupplyProjectVO vo = new LandSupplyProjectVO();
|
|
|
|
|
+ String category = getTdytByCode(item.getTdyt());
|
|
|
|
|
+ vo.setProjectPropertyId(item.getProjectId());
|
|
|
|
|
+ vo.setNodeId(item.getId());
|
|
|
|
|
+ vo.setProjectName("");
|
|
|
|
|
+ vo.setCompanyName("暂无");
|
|
|
|
|
+ vo.setSupplyMethod(item.getGdType());
|
|
|
|
|
+ vo.setSupplyType("2");
|
|
|
|
|
+ vo.setDateType("2");
|
|
|
|
|
+ List<Map<String, String>> geomDetailsList= nodeLandService.selectTGeomDbDetailsByNodeId(item.getId());
|
|
|
|
|
+ if(CollectionUtils.isNotEmpty(geomDetailsList)){
|
|
|
|
|
+ String geoms = geomDetailsList.stream().map(s->s.get("geom")).collect(Collectors.joining(","));
|
|
|
|
|
+ vo.setGeom(geoms);
|
|
|
|
|
+ }
|
|
|
|
|
+ vo.setYear(DateUtils.parseDate(item.getHbcrhtDate()));
|
|
|
|
|
+ vo.setArea(String.format("%.2f", item.getGdArea() == null ? BigDecimal.ZERO : item.getGdArea()));
|
|
|
|
|
+ vo.setUseType(category);
|
|
|
|
|
+ resList.add(vo);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if(StringUtils.isNotBlank(useType)){ //这里通过用途计算
|
|
|
|
|
+ resList = resList.stream().filter(s->s.getUseType().equals(useType)).collect(Collectors.toList());
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ return resList;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
public List<LandSupplyProjectVO> projectList(String year, Integer supplyType) {
|
|
public List<LandSupplyProjectVO> projectList(String year, Integer supplyType) {
|
|
|
return projectList(year, supplyType, null);
|
|
return projectList(year, supplyType, null);
|
|
|
}
|
|
}
|
|
@@ -788,7 +884,7 @@ public class StorageServiceImpl {
|
|
|
|
|
|
|
|
private String convertCategory(String category) {
|
|
private String convertCategory(String category) {
|
|
|
if (category == null || category.equals("未知") || category.equals("null") || category.trim().isEmpty()) {
|
|
if (category == null || category.equals("未知") || category.equals("null") || category.trim().isEmpty()) {
|
|
|
- return "其他";
|
|
|
|
|
|
|
+ return "其它";
|
|
|
}
|
|
}
|
|
|
return category;
|
|
return category;
|
|
|
}
|
|
}
|
|
@@ -1014,5 +1110,18 @@ public class StorageServiceImpl {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ public String getTdytByCode(String code) {
|
|
|
|
|
+ String name = "";
|
|
|
|
|
+ List<LandType> all = landTypeMapper.selectAll();
|
|
|
|
|
+ // 转换为节点
|
|
|
|
|
+ Optional<LandType> filterRes = all.stream().filter(s -> s.getCode().equalsIgnoreCase(code)).findFirst();
|
|
|
|
|
+ if (filterRes.isPresent()) {
|
|
|
|
|
+ name = filterRes.get().getName();
|
|
|
|
|
+ }
|
|
|
|
|
+ return name;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
|
|
|
}
|
|
}
|