|
@@ -1,19 +1,27 @@
|
|
|
package com.nokia.financeapi.service.house;
|
|
|
|
|
|
+import com.google.gson.Gson;
|
|
|
+import com.google.gson.reflect.TypeToken;
|
|
|
import com.nokia.financeapi.common.R;
|
|
|
import com.nokia.financeapi.dao.house.AreaDao;
|
|
|
import com.nokia.financeapi.dao.house.HouseResourceMapMapper;
|
|
|
import com.nokia.financeapi.pojo.dto.GetBuildingAreaStatDto;
|
|
|
import com.nokia.financeapi.pojo.dto.GetBuildingMapDto;
|
|
|
+import com.nokia.financeapi.pojo.dto.GetBuildingRepairStatDto;
|
|
|
+import com.nokia.financeapi.pojo.dto.GetHouseNoticeDto;
|
|
|
import com.nokia.financeapi.pojo.dto.GetLandBuildingStatDto;
|
|
|
import com.nokia.financeapi.pojo.po.AreaPo;
|
|
|
import com.nokia.financeapi.pojo.vo.GetBuildingAreaStatVo;
|
|
|
import com.nokia.financeapi.pojo.vo.GetBuildingMapVo;
|
|
|
+import com.nokia.financeapi.pojo.vo.GetBuildingRepairStatVo;
|
|
|
+import com.nokia.financeapi.pojo.vo.GetHouseNoticeVo;
|
|
|
import com.nokia.financeapi.pojo.vo.GetLandBuildingStatVo;
|
|
|
+import com.nokia.financeapi.pojo.vo.GetRentOutStatVo;
|
|
|
import com.nokia.financeapi.pojo.vo.TreeAreaVo;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.util.StringUtils;
|
|
|
|
|
|
+import javax.validation.Valid;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.HashMap;
|
|
|
import java.util.List;
|
|
@@ -30,14 +38,17 @@ public class HouseResourceMapService {
|
|
|
}
|
|
|
|
|
|
public R<GetBuildingAreaStatVo> getBuildingAreaStat(GetBuildingAreaStatDto dto) {
|
|
|
- return R.ok(houseResourceMapMapper.getBuildingAreaStat(dto));
|
|
|
+ GetBuildingAreaStatVo vo = houseResourceMapMapper.getBuildingAreaStat(dto);
|
|
|
+ return R.ok(vo);
|
|
|
}
|
|
|
|
|
|
public R<List<GetLandBuildingStatVo>> getLandBuildingStat(GetLandBuildingStatDto dto) {
|
|
|
if (StringUtils.hasText(dto.getCity())) {
|
|
|
- return R.ok(houseResourceMapMapper.getDistrictLandBuildingStat(dto));
|
|
|
+ List<GetLandBuildingStatVo> vo = houseResourceMapMapper.getDistrictLandBuildingStat(dto);
|
|
|
+ return R.ok(vo);
|
|
|
}
|
|
|
- return R.ok(houseResourceMapMapper.getCityLandBuildingStat());
|
|
|
+ List<GetLandBuildingStatVo> vo = houseResourceMapMapper.getCityLandBuildingStat();
|
|
|
+ return R.ok(vo);
|
|
|
}
|
|
|
|
|
|
public R<TreeAreaVo> treeArea() {
|
|
@@ -106,4 +117,105 @@ public class HouseResourceMapService {
|
|
|
List<GetBuildingMapVo> vo = houseResourceMapMapper.getBuildingByCoordinate(dto);
|
|
|
return R.ok(vo);
|
|
|
}
|
|
|
+
|
|
|
+ public R<List<GetBuildingRepairStatVo>> getBuildingRepairStat(@Valid GetBuildingRepairStatDto dto) {
|
|
|
+ if (StringUtils. hasText(dto.getCity())) {
|
|
|
+ List<GetBuildingRepairStatVo> vo = houseResourceMapMapper.getDistrictRepairStat(dto);
|
|
|
+ return R.ok(vo);
|
|
|
+ }
|
|
|
+ List<GetBuildingRepairStatVo> vo = houseResourceMapMapper.getCityRepairStat();
|
|
|
+ return R.ok(vo);
|
|
|
+ }
|
|
|
+
|
|
|
+ public R<List<GetHouseNoticeVo>> getNotice(GetHouseNoticeDto dto) {
|
|
|
+ if (!StringUtils.hasText(dto.getCity())) {
|
|
|
+ dto.setCity("全省");
|
|
|
+ }
|
|
|
+ List<GetHouseNoticeVo> vo = houseResourceMapMapper.getNotice(dto);
|
|
|
+ return R.ok(vo);
|
|
|
+ }
|
|
|
+
|
|
|
+ public R<List<GetRentOutStatVo>> getRentOutStat() {
|
|
|
+ String s = """
|
|
|
+[
|
|
|
+ {
|
|
|
+ "unit": "石家庄",
|
|
|
+ "income": "1058.74",
|
|
|
+ "finishingRate": 57.00
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "unit": "唐山",
|
|
|
+ "income": "1214.61",
|
|
|
+ "finishingRate": "55.30"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "unit": "秦皇岛",
|
|
|
+ "income": "402.7",
|
|
|
+ "finishingRate": "63.70"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "unit": "邯郸",
|
|
|
+ "income": "508.25",
|
|
|
+ "finishingRate": "52.20"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "unit": "邢台",
|
|
|
+ "income": "441.54",
|
|
|
+ "finishingRate": "57.70"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "unit": "保定",
|
|
|
+ "income": "1361.7",
|
|
|
+ "finishingRate": "68.70"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "unit": "张家口",
|
|
|
+ "income": "534.46",
|
|
|
+ "finishingRate": "45.40"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "unit": "承德",
|
|
|
+ "income": "480.68",
|
|
|
+ "finishingRate": "49.40"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "unit": "廊坊",
|
|
|
+ "income": "490.37",
|
|
|
+ "finishingRate": "53.00"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "unit": "沧州",
|
|
|
+ "income": "1008.13",
|
|
|
+ "finishingRate": "54.20"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "unit": "衡水",
|
|
|
+ "income": "368.94",
|
|
|
+ "finishingRate": "52.60"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "unit": "雄安",
|
|
|
+ "income": "28.52",
|
|
|
+ "finishingRate": "66.20"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "unit": "传输局",
|
|
|
+ "income": "269.96",
|
|
|
+ "finishingRate": "52.10"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "unit": "省本部",
|
|
|
+ "income": "1044.94",
|
|
|
+ "finishingRate": "62.10"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "unit": "全省",
|
|
|
+ "income": "9213.54",
|
|
|
+ "finishingRate": "56.60"
|
|
|
+ }
|
|
|
+]
|
|
|
+ """;
|
|
|
+ return R.ok(new Gson().fromJson(s, new TypeToken<List<GetRentOutStatVo>>() {
|
|
|
+ }.getType()));
|
|
|
+ }
|
|
|
}
|