|
@@ -4,9 +4,11 @@ import com.nokia.financeapi.common.R;
|
|
import com.nokia.financeapi.dao.house.AreaDao;
|
|
import com.nokia.financeapi.dao.house.AreaDao;
|
|
import com.nokia.financeapi.dao.house.HouseResourceMapMapper;
|
|
import com.nokia.financeapi.dao.house.HouseResourceMapMapper;
|
|
import com.nokia.financeapi.pojo.dto.GetBuildingAreaStatDto;
|
|
import com.nokia.financeapi.pojo.dto.GetBuildingAreaStatDto;
|
|
|
|
+import com.nokia.financeapi.pojo.dto.GetBuildingMapDto;
|
|
import com.nokia.financeapi.pojo.dto.GetLandBuildingStatDto;
|
|
import com.nokia.financeapi.pojo.dto.GetLandBuildingStatDto;
|
|
import com.nokia.financeapi.pojo.po.AreaPo;
|
|
import com.nokia.financeapi.pojo.po.AreaPo;
|
|
import com.nokia.financeapi.pojo.vo.GetBuildingAreaStatVo;
|
|
import com.nokia.financeapi.pojo.vo.GetBuildingAreaStatVo;
|
|
|
|
+import com.nokia.financeapi.pojo.vo.GetBuildingMapVo;
|
|
import com.nokia.financeapi.pojo.vo.GetLandBuildingStatVo;
|
|
import com.nokia.financeapi.pojo.vo.GetLandBuildingStatVo;
|
|
import com.nokia.financeapi.pojo.vo.TreeAreaVo;
|
|
import com.nokia.financeapi.pojo.vo.TreeAreaVo;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
@@ -75,11 +77,33 @@ public class HouseResourceMapService {
|
|
*/
|
|
*/
|
|
private Map<Integer, List<AreaPo>> getAreaParentMap(List<AreaPo> areas) {
|
|
private Map<Integer, List<AreaPo>> getAreaParentMap(List<AreaPo> areas) {
|
|
Map<Integer, List<AreaPo>> parentMap = new HashMap<>();
|
|
Map<Integer, List<AreaPo>> parentMap = new HashMap<>();
|
|
- for (AreaPo t : areas)
|
|
|
|
- {
|
|
|
|
|
|
+ for (AreaPo t : areas) {
|
|
parentMap.putIfAbsent(t.getParentId(), new ArrayList<>());
|
|
parentMap.putIfAbsent(t.getParentId(), new ArrayList<>());
|
|
parentMap.get(t.getParentId()).add(t);
|
|
parentMap.get(t.getParentId()).add(t);
|
|
}
|
|
}
|
|
return parentMap;
|
|
return parentMap;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ public R<List<GetBuildingMapVo>> getBuildingMap(GetBuildingMapDto dto) {
|
|
|
|
+ Integer endDate = dto.getEndDate();
|
|
|
|
+ // 账期为空则取最新的账期
|
|
|
|
+ if (dto.getEndDate() == null) {
|
|
|
|
+ endDate = houseResourceMapMapper.getBuildingMonthMaxDate();
|
|
|
|
+ }
|
|
|
|
+ if (endDate == null) {
|
|
|
|
+ return R.ok();
|
|
|
|
+ }
|
|
|
|
+ dto.setEndDate(endDate);
|
|
|
|
+// LocalDate endLocalDate = LocalDate.parse(endDate + "01", DateTimeFormatter.ofPattern("yyyyMMdd"));
|
|
|
|
+// LocalDate startLocalDate = endLocalDate.withDayOfYear(1);
|
|
|
|
+// Integer startDate = Integer.valueOf(startLocalDate.format(DateTimeFormatter.ofPattern("yyyyMM")));
|
|
|
|
+ // 坐标为空根据区县获取建筑
|
|
|
|
+ if (dto.getLeftLng() == null || dto.getRightLng() == null || dto.getLeftLat() == null || dto.getRightLat() == null) {
|
|
|
|
+ List<GetBuildingMapVo> vo = houseResourceMapMapper.getBuildingByDistrict(dto);
|
|
|
|
+ return R.ok(vo);
|
|
|
|
+ }
|
|
|
|
+ // 查询坐标范围内的建筑
|
|
|
|
+ List<GetBuildingMapVo> vo = houseResourceMapMapper.getBuildingByCoordinate(dto);
|
|
|
|
+ return R.ok(vo);
|
|
|
|
+ }
|
|
}
|
|
}
|