|
|
@@ -4,13 +4,13 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.template.common.utils.DateUtil;
|
|
|
import com.template.mapper.HouseOrderMapper;
|
|
|
-import com.template.model.vo.*;
|
|
|
import com.template.model.pojo.*;
|
|
|
import com.template.model.result.PageUtils;
|
|
|
+import com.template.model.vo.*;
|
|
|
import com.template.services.*;
|
|
|
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
@@ -60,11 +60,12 @@ public class HouseOrderServiceImpl extends ServiceImpl<HouseOrderMapper, HouseOr
|
|
|
|
|
|
DateTimeFormatter dateTimeFormatter2 = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
|
|
DateTimeFormatter dateTimeFormatter1 = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
|
|
- LocalDate state = LocalDateTime.parse(liveTime, dateTimeFormatter1).toLocalDate();
|
|
|
- LocalDate end = LocalDateTime.parse(leaveTime, dateTimeFormatter1).toLocalDate();
|
|
|
- LocalDateTime stateTime = LocalDateTime.parse(liveTime, dateTimeFormatter1);
|
|
|
- LocalDateTime endTime = LocalDateTime.parse(leaveTime, dateTimeFormatter1);
|
|
|
|
|
|
+ LocalDateTime stateTime = LocalDateTime.parse(liveTime,dateTimeFormatter1);
|
|
|
+ LocalDateTime endTime = LocalDateTime.parse(leaveTime,dateTimeFormatter1);
|
|
|
+
|
|
|
+ LocalDate state = stateTime.toLocalDate();
|
|
|
+ LocalDate end = endTime.toLocalDate();
|
|
|
// 获取这段时间内的所有改价记录
|
|
|
List<HousePrice> housePrices = housePriceService.housePrice(stateTime, endTime, houseId);
|
|
|
|
|
|
@@ -112,50 +113,64 @@ public class HouseOrderServiceImpl extends ServiceImpl<HouseOrderMapper, HouseOr
|
|
|
BigDecimal totalPrice = new BigDecimal(0);
|
|
|
for (int i = 0; i < until; i++) {
|
|
|
LocalDate localDate1 = state.plusDays(i);
|
|
|
+ List<HousePrice> housePrices1=housePriceService.getDatePrice(localDate1,houseId);
|
|
|
+// LocalDate localDate2 = state.plusDays(i+1);
|
|
|
+// List<HousePrice> housePrices = housePriceService.housePrice(localDate1, localDate2, houseId);
|
|
|
if (ObjectUtils.isNotEmpty(scheduleList)) {
|
|
|
for (ClassSchedule classSchedule : scheduleList) {
|
|
|
String dateTime = classSchedule.getDateTime();
|
|
|
LocalDate parse = LocalDate.parse(dateTime, dateTimeFormatter2);
|
|
|
if (!localDate1.equals(parse)) {
|
|
|
- if (ObjectUtils.isNotEmpty(housePrices)) {
|
|
|
- for (HousePrice housePrice : housePrices) {
|
|
|
- String setDate = housePrice.getSetDate();
|
|
|
- String[] split = setDate.split(",");
|
|
|
- Date startDate = DateUtil.parseDateOnly(split[0]);
|
|
|
- Date endDate = DateUtil.parseDateOnly(split[1]);
|
|
|
- Date date1 = Date.from(localDate1.atStartOfDay().atZone(ZoneId.systemDefault()).toInstant());
|
|
|
- // 判断当前时间是否在[startTime, endTime]区间
|
|
|
- assert startDate != null;
|
|
|
- boolean effectiveDate = DateUtil.isEffectiveDate(date1, startDate, endDate);
|
|
|
- if (effectiveDate) {
|
|
|
- BigDecimal price = housePrice.getPrice();
|
|
|
- totalPrice = totalPrice.add(price);
|
|
|
- } else {
|
|
|
- totalPrice = totalPrice.add(roomPrice);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- } else {
|
|
|
- if (ObjectUtils.isNotEmpty(housePrices)) {
|
|
|
- for (HousePrice housePrice : housePrices) {
|
|
|
- String setDate = housePrice.getSetDate();
|
|
|
- String[] split = setDate.split(",");
|
|
|
- Date startDate = DateUtil.parseDateOnly(split[0]);
|
|
|
- Date endDate = DateUtil.parseDateOnly(split[1]);
|
|
|
- Date date1 = Date.from(localDate1.atStartOfDay().atZone(ZoneId.systemDefault()).toInstant());
|
|
|
- // 判断当前时间是否在[startTime, endTime]区间
|
|
|
- assert startDate != null;
|
|
|
- boolean effectiveDate = DateUtil.isEffectiveDate(date1, startDate, endDate);
|
|
|
- if (effectiveDate) {
|
|
|
+ if (ObjectUtils.isNotEmpty(housePrices1)) {
|
|
|
+ HousePrice housePrice = housePrices1.get(housePrices1.size() - 1);
|
|
|
BigDecimal price = housePrice.getPrice();
|
|
|
totalPrice = totalPrice.add(price);
|
|
|
- } else {
|
|
|
+ }else {
|
|
|
totalPrice = totalPrice.add(roomPrice);
|
|
|
}
|
|
|
+// for (HousePrice housePrice : housePrices1) {
|
|
|
+// String setDate = housePrice.getSetDate();
|
|
|
+// String[] split = setDate.split(",");
|
|
|
+// Date startDate = DateUtil.parseDateOnly(split[0]);
|
|
|
+// Date endDate = DateUtil.parseDateOnly(split[1]);
|
|
|
+// Date date1 = Date.from(localDate1.atStartOfDay().atZone(ZoneId.systemDefault()).toInstant());
|
|
|
+// // 判断当前时间是否在[startTime, endTime]区间
|
|
|
+// assert startDate != null;
|
|
|
+// boolean effectiveDate = DateUtil.isEffectiveDate(date1, startDate, endDate);
|
|
|
+// if (effectiveDate) {
|
|
|
+// BigDecimal price = housePrice.getPrice();
|
|
|
+// totalPrice = totalPrice.add(price);
|
|
|
+// } else {
|
|
|
+// totalPrice = totalPrice.add(roomPrice);
|
|
|
+// }
|
|
|
+// }
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if (ObjectUtils.isNotEmpty(housePrices1)) {
|
|
|
+ if (ObjectUtils.isNotEmpty(housePrices1)) {
|
|
|
+ HousePrice housePrice = housePrices1.get(housePrices1.size() - 1);
|
|
|
+ BigDecimal price = housePrice.getPrice();
|
|
|
+ totalPrice = totalPrice.add(price);
|
|
|
+ }
|
|
|
+// for (HousePrice housePrice : housePrices1) {
|
|
|
+// String setDate = housePrice.getSetDate();
|
|
|
+// String[] split = setDate.split(",");
|
|
|
+// Date startDate = DateUtil.parseDateOnly(split[0]);
|
|
|
+// Date endDate = DateUtil.parseDateOnly(split[1]);
|
|
|
+// Date date1 = Date.from(localDate1.atStartOfDay().atZone(ZoneId.systemDefault()).toInstant());
|
|
|
+// // 判断当前时间是否在[startTime, endTime]区间
|
|
|
+// assert startDate != null;
|
|
|
+// boolean effectiveDate = DateUtil.isEffectiveDate(date1, startDate, endDate);
|
|
|
+// if (effectiveDate) {
|
|
|
+// BigDecimal price = housePrice.getPrice();
|
|
|
+// totalPrice = totalPrice.add(price);
|
|
|
+// } else {
|
|
|
+// totalPrice = totalPrice.add(roomPrice);
|
|
|
+// }
|
|
|
+// }
|
|
|
} else {
|
|
|
totalPrice = totalPrice.add(roomPrice);
|
|
|
}
|
|
|
@@ -322,4 +337,9 @@ public class HouseOrderServiceImpl extends ServiceImpl<HouseOrderMapper, HouseOr
|
|
|
public List<ReportStatisticsExportVo> reportStatisticsExport(String s, String keyWord, String startTime, String endTime) {
|
|
|
return houseOrderMapper.reportStatisticsExport(s,keyWord,startTime,endTime);
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public List<String> payHouseOrderUser(LocalDateTime start, LocalDateTime end) {
|
|
|
+ return houseOrderMapper.payHouseOrderUser(start,end);
|
|
|
+ }
|
|
|
}
|