|
@@ -7,21 +7,26 @@ 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.GetBuildingMapDto;
|
|
|
|
+import com.nokia.financeapi.pojo.dto.GetBuildingOptionsDto;
|
|
import com.nokia.financeapi.pojo.dto.GetBuildingRepairStatDto;
|
|
import com.nokia.financeapi.pojo.dto.GetBuildingRepairStatDto;
|
|
import com.nokia.financeapi.pojo.dto.GetHouseNoticeDto;
|
|
import com.nokia.financeapi.pojo.dto.GetHouseNoticeDto;
|
|
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.GetBuildingMapVo;
|
|
|
|
+import com.nokia.financeapi.pojo.vo.GetBuildingOptionsVo;
|
|
import com.nokia.financeapi.pojo.vo.GetBuildingRepairStatVo;
|
|
import com.nokia.financeapi.pojo.vo.GetBuildingRepairStatVo;
|
|
import com.nokia.financeapi.pojo.vo.GetHouseNoticeVo;
|
|
import com.nokia.financeapi.pojo.vo.GetHouseNoticeVo;
|
|
import com.nokia.financeapi.pojo.vo.GetLandBuildingStatVo;
|
|
import com.nokia.financeapi.pojo.vo.GetLandBuildingStatVo;
|
|
import com.nokia.financeapi.pojo.vo.GetRentOutStatVo;
|
|
import com.nokia.financeapi.pojo.vo.GetRentOutStatVo;
|
|
import com.nokia.financeapi.pojo.vo.TreeAreaVo;
|
|
import com.nokia.financeapi.pojo.vo.TreeAreaVo;
|
|
|
|
+import com.nokia.financeapi.service.common.file.FileService;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.util.StringUtils;
|
|
import org.springframework.util.StringUtils;
|
|
|
|
|
|
import javax.validation.Valid;
|
|
import javax.validation.Valid;
|
|
|
|
+import java.time.LocalDate;
|
|
|
|
+import java.time.format.DateTimeFormatter;
|
|
import java.util.ArrayList;
|
|
import java.util.ArrayList;
|
|
import java.util.HashMap;
|
|
import java.util.HashMap;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
@@ -31,10 +36,12 @@ import java.util.Map;
|
|
public class HouseResourceMapService {
|
|
public class HouseResourceMapService {
|
|
private final HouseResourceMapMapper houseResourceMapMapper;
|
|
private final HouseResourceMapMapper houseResourceMapMapper;
|
|
private final AreaDao areaDao;
|
|
private final AreaDao areaDao;
|
|
|
|
+ private final FileService fileService;
|
|
|
|
|
|
- public HouseResourceMapService(HouseResourceMapMapper houseResourceMapMapper, AreaDao areaDao) {
|
|
|
|
|
|
+ public HouseResourceMapService(HouseResourceMapMapper houseResourceMapMapper, AreaDao areaDao, FileService fileService) {
|
|
this.houseResourceMapMapper = houseResourceMapMapper;
|
|
this.houseResourceMapMapper = houseResourceMapMapper;
|
|
this.areaDao = areaDao;
|
|
this.areaDao = areaDao;
|
|
|
|
+ this.fileService = fileService;
|
|
}
|
|
}
|
|
|
|
|
|
public R<GetBuildingAreaStatVo> getBuildingAreaStat(GetBuildingAreaStatDto dto) {
|
|
public R<GetBuildingAreaStatVo> getBuildingAreaStat(GetBuildingAreaStatDto dto) {
|
|
@@ -105,9 +112,10 @@ public class HouseResourceMapService {
|
|
return R.ok();
|
|
return R.ok();
|
|
}
|
|
}
|
|
dto.setEndDate(endDate);
|
|
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")));
|
|
|
|
|
|
+ LocalDate endLocalDate = LocalDate.parse(endDate + "01", DateTimeFormatter.ofPattern("yyyyMMdd"));
|
|
|
|
+ LocalDate startLocalDate = endLocalDate.withDayOfYear(1);
|
|
|
|
+ Integer startDate = Integer.valueOf(startLocalDate.format(DateTimeFormatter.ofPattern("yyyyMM")));
|
|
|
|
+ dto.setStartDate(startDate);
|
|
// 坐标为空根据区县获取建筑
|
|
// 坐标为空根据区县获取建筑
|
|
if (dto.getLeftLng() == null || dto.getRightLng() == null || dto.getLeftLat() == null || dto.getRightLat() == null) {
|
|
if (dto.getLeftLng() == null || dto.getRightLng() == null || dto.getLeftLat() == null || dto.getRightLat() == null) {
|
|
List<GetBuildingMapVo> vo = houseResourceMapMapper.getBuildingByDistrict(dto);
|
|
List<GetBuildingMapVo> vo = houseResourceMapMapper.getBuildingByDistrict(dto);
|
|
@@ -207,15 +215,33 @@ public class HouseResourceMapService {
|
|
"unit": "省本部",
|
|
"unit": "省本部",
|
|
"income": "1044.94",
|
|
"income": "1044.94",
|
|
"finishingRate": "62.10"
|
|
"finishingRate": "62.10"
|
|
- },
|
|
|
|
- {
|
|
|
|
- "unit": "全省",
|
|
|
|
- "income": "9213.54",
|
|
|
|
- "finishingRate": "56.60"
|
|
|
|
}
|
|
}
|
|
]
|
|
]
|
|
""";
|
|
""";
|
|
return R.ok(new Gson().fromJson(s, new TypeToken<List<GetRentOutStatVo>>() {
|
|
return R.ok(new Gson().fromJson(s, new TypeToken<List<GetRentOutStatVo>>() {
|
|
}.getType()));
|
|
}.getType()));
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ public R<List<GetBuildingOptionsVo>> getBuildingOptions(GetBuildingOptionsDto 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")));
|
|
|
|
+ dto.setStartDate(startDate);
|
|
|
|
+ List<GetBuildingOptionsVo> vo = houseResourceMapMapper.getBuildingOptions(dto);
|
|
|
|
+ vo.forEach(t -> {
|
|
|
|
+ if (StringUtils.hasText(t.getBuildingImg())) {
|
|
|
|
+ t.setBuildingImg(fileService.getBucket() + t.getBuildingImg());
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ return R.ok(vo);
|
|
|
|
+ }
|
|
}
|
|
}
|