|
|
@@ -5,6 +5,7 @@ import com.siwei.apply.domain.LandType;
|
|
|
import com.siwei.apply.domain.cadastre.*;
|
|
|
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;
|
|
|
@@ -389,20 +390,14 @@ public class SupplyServiceImpl implements ISupplyService {
|
|
|
|
|
|
|
|
|
|
|
|
-
|
|
|
-
|
|
|
@Override
|
|
|
public LandSupplyReportVO getTdgyPurposeReport(String startYear, String endYear){
|
|
|
- List<TdgyStatisticsRes> completeList2 = dgyMapper.getListByYear(null, null, startYear, endYear);
|
|
|
-
|
|
|
- SupplyYearStatisticsRes res = new SupplyYearStatisticsRes();
|
|
|
- GongdiJihuaFilterVo filterVo = new GongdiJihuaFilterVo();
|
|
|
- filterVo.setPageSize(100000);
|
|
|
- List<GongdiJihua> completeList = gongdiJihuaMapper.getList(filterVo);
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
+ List<TdgyStatisticsRes> completeList = dgyMapper.getListByYear(null, null, startYear, endYear);
|
|
|
|
|
|
+// SupplyYearStatisticsRes res = new SupplyYearStatisticsRes();
|
|
|
+// GongdiJihuaFilterVo filterVo = new GongdiJihuaFilterVo();
|
|
|
+// filterVo.setPageSize(100000);
|
|
|
+// List<GongdiJihua> completeList = gongdiJihuaMapper.getList(filterVo);
|
|
|
|
|
|
if (CollectionUtils.isEmpty(completeList)) {
|
|
|
return new LandSupplyReportVO();
|
|
|
@@ -417,7 +412,7 @@ public class SupplyServiceImpl implements ISupplyService {
|
|
|
|
|
|
// 2. 统计年份并排序
|
|
|
Set<Integer> yearSet = new TreeSet<>();
|
|
|
- for (GongdiJihua item : completeList) {
|
|
|
+ for (TdgyStatisticsRes item : completeList) {
|
|
|
if (item.getGysj() != null) {
|
|
|
yearSet.add(item.getGysj().getYear() + 1900);
|
|
|
}
|
|
|
@@ -428,10 +423,10 @@ public class SupplyServiceImpl implements ISupplyService {
|
|
|
// Map<一级分类名称, Map<供应方式, Map<年份, 面积汇总>>>
|
|
|
Map<String, Map<String, Map<String, Double>>> stats = new HashMap<>();
|
|
|
|
|
|
- for (GongdiJihua item : completeList) {
|
|
|
+ for (TdgyStatisticsRes item : completeList) {
|
|
|
if (item.getGysj() == null || item.getTdyt() == null || item.getTdyt().length() < 2) continue;
|
|
|
- String firstLevelCode = LandUseTypeEnum.getCodeByName(item.getTdyt());
|
|
|
- //String firstLevelCode = item.getTdyt().substring(0, 2);
|
|
|
+ //String firstLevelCode = LandUseTypeEnum.getCodeByName(item.getTdyt());
|
|
|
+ String firstLevelCode = item.getTdyt().substring(0, 2);
|
|
|
String parentName = codeToFirstName.getOrDefault(firstLevelCode, "其他");
|
|
|
String year = String.valueOf(item.getGysj().getYear() + 1900);
|
|
|
String gyfs = "划拨".equals(item.getGyfs()) ? "划拨" : ("出让".equals(item.getGyfs()) ? "出让" : "其他");
|
|
|
@@ -460,7 +455,7 @@ public class SupplyServiceImpl implements ISupplyService {
|
|
|
|
|
|
// 总计数据
|
|
|
LandSupplyReportVO.CategoryData totalData = new LandSupplyReportVO.CategoryData();
|
|
|
- Map<String, Double> totalYearData = new HashMap<>();
|
|
|
+ Map<String, Double> totalYearData = new LinkedHashMap<>();
|
|
|
double grandTotal = 0.0;
|
|
|
for (Integer y : report.getYears()) {
|
|
|
String yearStr = String.valueOf(y);
|
|
|
@@ -485,7 +480,7 @@ public class SupplyServiceImpl implements ISupplyService {
|
|
|
|
|
|
private LandSupplyReportVO.CategoryData buildCategoryData(Map<String, Double> yearCounts, List<Integer> years) {
|
|
|
LandSupplyReportVO.CategoryData data = new LandSupplyReportVO.CategoryData();
|
|
|
- Map<String, Double> yearData = new HashMap<>();
|
|
|
+ Map<String, Double> yearData = new LinkedHashMap<>();
|
|
|
double total = 0.0;
|
|
|
for (Integer y : years) {
|
|
|
String yearStr = String.valueOf(y);
|
|
|
@@ -499,9 +494,43 @@ public class SupplyServiceImpl implements ISupplyService {
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
+ /**
|
|
|
+ * 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.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.setGeom(item.getGeom());
|
|
|
+ return vo;
|
|
|
+ }).collect(Collectors.toList());
|
|
|
+ }
|
|
|
+ return resList;
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|