|
|
@@ -2,6 +2,7 @@ package com.siwei.apply.service.cadastre.impl;
|
|
|
|
|
|
import com.siwei.apply.domain.YdbpData;
|
|
|
import com.siwei.apply.domain.res.*;
|
|
|
+import com.siwei.apply.domain.vo.LandSupplyProjectVO;
|
|
|
import com.siwei.apply.mapper.*;
|
|
|
import com.siwei.common.core.utils.StringUtils;
|
|
|
import com.siwei.spatial.api.RemoteSpatialFilesDbService;
|
|
|
@@ -11,6 +12,7 @@ import org.apache.commons.collections4.MapUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
+import java.math.BigDecimal;
|
|
|
import java.util.*;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
@@ -37,6 +39,68 @@ public class BatchServiceImpl{
|
|
|
@Autowired
|
|
|
private YdbpDataMapper ydbpDataMapper;
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * batchType (1-单批次项目,2-报批项目,0-全部)
|
|
|
+ * 获取项目列表
|
|
|
+ * @param year
|
|
|
+ * @param batchType
|
|
|
+ * @param keyWord
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public List<?> projectList(String year, Integer batchType, String keyWord) {
|
|
|
+ List<Object> resList = new ArrayList<>();
|
|
|
+ if (batchType == 1) {
|
|
|
+ return buildSingleProjectList(year, keyWord);
|
|
|
+ } else if (batchType == 2) {
|
|
|
+ return buildReportProjectList(year, keyWord);
|
|
|
+ } else if (batchType == 0) {
|
|
|
+ resList.addAll(buildSingleProjectList(year, keyWord));
|
|
|
+ resList.addAll(buildReportProjectList(year, keyWord));
|
|
|
+ }
|
|
|
+ return resList;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ private List<Map<String,Object>> buildSingleProjectList(String year, String keyWord) {
|
|
|
+ List<Map<String,Object>> singleBatchList = ydbpMapper.getStatisticsList(year,keyWord,true);
|
|
|
+ if (CollectionUtils.isEmpty(singleBatchList)) {
|
|
|
+ return new ArrayList<>();
|
|
|
+ }
|
|
|
+ singleBatchList.forEach(item -> {
|
|
|
+ item.put("projectPropertyId",item.get("project_id") == null ? "" : String.valueOf(item.get("project_id")));
|
|
|
+ Double mj_mu = (Double) item.get("mj_mu");
|
|
|
+ item.put("mj_mu",String.format("%.2f", mj_mu == null ? 0d : mj_mu));
|
|
|
+ });
|
|
|
+ return singleBatchList;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ private List<YdbpData> buildReportProjectList(String year, String keyWord) {
|
|
|
+ List<YdbpData> reportBatchList = ydbpDataMapper.getStatisticsList(year,keyWord,true);
|
|
|
+ if (CollectionUtils.isEmpty(reportBatchList)) {
|
|
|
+ return new ArrayList<>();
|
|
|
+ }
|
|
|
+ reportBatchList.forEach(item -> {
|
|
|
+ item.setProjectPropertyId(item.getId());
|
|
|
+ item.setZsArea(Float.valueOf(String.format("%.2f", item.getZsArea() == null ? 0f : item.getZsArea())));
|
|
|
+ });
|
|
|
+ return reportBatchList;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ *
|
|
|
+ * 获取报批项目详情
|
|
|
+ * @param propertyId
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public YdbpData getReportProject(String propertyId) {
|
|
|
+ return ydbpDataMapper.getById(propertyId);
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 年度统计
|
|
|
* @param year
|
|
|
@@ -48,8 +112,8 @@ public class BatchServiceImpl{
|
|
|
}
|
|
|
|
|
|
List<Map<String,Object>> resList = new ArrayList<>();
|
|
|
- List<Map<String,Object>> singleBatchList = ydbpMapper.getStatisticsList(year);
|
|
|
- List<YdbpData> reportBatchList = ydbpDataMapper.getStatisticsList(year);
|
|
|
+ List<Map<String,Object>> singleBatchList = ydbpMapper.getStatisticsList(year,"",false);
|
|
|
+ List<YdbpData> reportBatchList = ydbpDataMapper.getStatisticsList(year,"",false);
|
|
|
|
|
|
Map<String,List<Map<String,Object>>> groupedSingleBatch = new HashMap<>();
|
|
|
Map<String, List<YdbpData>> groupedReportBatch = new HashMap<>();
|
|
|
@@ -117,8 +181,8 @@ public class BatchServiceImpl{
|
|
|
year="";
|
|
|
}
|
|
|
BatchRateRes res = new BatchRateRes();
|
|
|
- List<Map<String,Object>> singleBatchList = ydbpMapper.getStatisticsList(year);
|
|
|
- List<YdbpData> reportBatchList = ydbpDataMapper.getStatisticsList(year);
|
|
|
+ List<Map<String,Object>> singleBatchList = ydbpMapper.getStatisticsList(year,"",false);
|
|
|
+ List<YdbpData> reportBatchList = ydbpDataMapper.getStatisticsList(year,"",false);
|
|
|
if(CollectionUtils.isNotEmpty(singleBatchList)) {
|
|
|
res.setSingleArea(sumAreaForSingle(singleBatchList));
|
|
|
res.setSingleProjectCount(singleBatchList.size());
|