|
|
@@ -61,8 +61,8 @@ public class HouseOrderServiceImpl extends ServiceImpl<HouseOrderMapper, HouseOr
|
|
|
DateTimeFormatter dateTimeFormatter2 = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
|
|
DateTimeFormatter dateTimeFormatter1 = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
|
|
|
|
|
- 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();
|
|
|
@@ -113,7 +113,7 @@ 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);
|
|
|
+ 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)) {
|
|
|
@@ -125,7 +125,7 @@ public class HouseOrderServiceImpl extends ServiceImpl<HouseOrderMapper, HouseOr
|
|
|
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) {
|
|
|
@@ -209,23 +209,24 @@ public class HouseOrderServiceImpl extends ServiceImpl<HouseOrderMapper, HouseOr
|
|
|
long hours = duration.toHours();
|
|
|
|
|
|
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(stateTime.atZone(ZoneId.systemDefault()).toInstant());
|
|
|
- // 判断当前时间是否在[startTime, endTime]区间
|
|
|
- assert startDate != null;
|
|
|
- boolean effectiveDate = DateUtil.isEffectiveDate(date1, startDate, endDate);
|
|
|
- if (effectiveDate) {
|
|
|
- BigDecimal price = housePrice.getPrice();
|
|
|
- BigDecimal totalPrice = price;
|
|
|
- priceVo.setTotalPrice(totalPrice);
|
|
|
- priceVo.setPrice(price);
|
|
|
- return priceVo;
|
|
|
- }
|
|
|
- }
|
|
|
+ HousePrice housePrice = housePrices.get(housePrices.size() - 1);
|
|
|
+// 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(stateTime.atZone(ZoneId.systemDefault()).toInstant());
|
|
|
+// // 判断当前时间是否在[startTime, endTime]区间
|
|
|
+// assert startDate != null;
|
|
|
+// boolean effectiveDate = DateUtil.isEffectiveDate(date1, startDate, endDate);
|
|
|
+// if (effectiveDate) {
|
|
|
+ BigDecimal price = housePrice.getPrice();
|
|
|
+ BigDecimal totalPrice = price;
|
|
|
+ priceVo.setTotalPrice(totalPrice);
|
|
|
+ priceVo.setPrice(price);
|
|
|
+ return priceVo;
|
|
|
+// }
|
|
|
+// }
|
|
|
|
|
|
}
|
|
|
BigDecimal totalPrice = roomPrice;
|
|
|
@@ -242,66 +243,75 @@ public class HouseOrderServiceImpl extends ServiceImpl<HouseOrderMapper, HouseOr
|
|
|
|
|
|
// 获取这断时间内的上 8 9节课的老师
|
|
|
LambdaQueryWrapper<ClassSchedule> wrapperCS = new LambdaQueryWrapper<>();
|
|
|
- wrapperCS.eq(ClassSchedule::getJsgh,cardNumber)
|
|
|
+ wrapperCS.eq(ClassSchedule::getJsgh, cardNumber)
|
|
|
.between(ClassSchedule::getDateTime, state, end);
|
|
|
List<ClassSchedule> scheduleList = classScheduleService.list(wrapperCS);
|
|
|
|
|
|
BigDecimal totalPrice = new BigDecimal(0);
|
|
|
for (int i = 0; i < until; i++) {
|
|
|
LocalDate localDate1 = state.plusDays(i);
|
|
|
+ List<HousePrice> housePrices1 = housePriceService.getDatePrice(localDate1, 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 {
|
|
|
totalPrice = totalPrice.add(roomPrice);
|
|
|
}
|
|
|
+// 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(housePrices1)) {
|
|
|
+ HousePrice housePrice = housePrices1.get(housePrices1.size() - 1);
|
|
|
+ BigDecimal price = housePrice.getPrice();
|
|
|
+ totalPrice = totalPrice.add(price);
|
|
|
+// 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 {
|
|
|
totalPrice = totalPrice.add(roomPrice);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
priceVo.setTotalPrice(totalPrice);
|
|
|
- BigDecimal price =new BigDecimal(0);
|
|
|
- if (totalPrice.doubleValue()>0) {
|
|
|
- price = totalPrice.divide(new BigDecimal(until), 2, BigDecimal.ROUND_HALF_UP);
|
|
|
+ BigDecimal price = new BigDecimal(0);
|
|
|
+ if (totalPrice.doubleValue() > 0) {
|
|
|
+ price = totalPrice.divide(new BigDecimal(until), 2, BigDecimal.ROUND_HALF_UP);
|
|
|
}
|
|
|
|
|
|
priceVo.setPrice(price);
|
|
|
@@ -310,14 +320,14 @@ public class HouseOrderServiceImpl extends ServiceImpl<HouseOrderMapper, HouseOr
|
|
|
|
|
|
@Override
|
|
|
public PageUtils<HouseOrderPageListVo> pageList(int page, int size, String keyWord, String houseType, String orderStatus, String payPriceStartTime, String payPriceEndTime, String refundStartTime, String refundEndTime, String cancelStartTime, String cancelEndTime, String liveStartTime, String liveEndTime, String leaveStartTime, String leaveEndTime) {
|
|
|
- Page<HouseOrderPageListVo> pageVo = new Page<>(page,size);
|
|
|
- IPage<HouseOrderPageListVo> result=houseOrderMapper.pageList(pageVo,keyWord,houseType,orderStatus,payPriceStartTime,payPriceEndTime,refundStartTime,refundEndTime,cancelStartTime,cancelEndTime,liveStartTime,liveEndTime,leaveStartTime,leaveEndTime);
|
|
|
+ Page<HouseOrderPageListVo> pageVo = new Page<>(page, size);
|
|
|
+ IPage<HouseOrderPageListVo> result = houseOrderMapper.pageList(pageVo, keyWord, houseType, orderStatus, payPriceStartTime, payPriceEndTime, refundStartTime, refundEndTime, cancelStartTime, cancelEndTime, liveStartTime, liveEndTime, leaveStartTime, leaveEndTime);
|
|
|
return new PageUtils(result);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public List<QueryExportVo> queryExport(String keyWord, String houseType, String orderStatus, String payPriceStartTime, String payPriceEndTime, String refundStartTime, String refundEndTime, String cancelStartTime, String cancelEndTime, String liveStartTime, String liveEndTime, String leaveStartTime, String leaveEndTime) {
|
|
|
- return houseOrderMapper.queryExport(keyWord,houseType,orderStatus,payPriceStartTime,payPriceEndTime,refundStartTime,refundEndTime,cancelStartTime,cancelEndTime,liveStartTime,liveEndTime,leaveStartTime,leaveEndTime);
|
|
|
+ return houseOrderMapper.queryExport(keyWord, houseType, orderStatus, payPriceStartTime, payPriceEndTime, refundStartTime, refundEndTime, cancelStartTime, cancelEndTime, liveStartTime, liveEndTime, leaveStartTime, leaveEndTime);
|
|
|
|
|
|
}
|
|
|
|
|
|
@@ -329,17 +339,17 @@ public class HouseOrderServiceImpl extends ServiceImpl<HouseOrderMapper, HouseOr
|
|
|
@Override
|
|
|
public PageUtils<ReportStatisticsVo> reportStatisticsPage(String s, String keyWord, String startTime, String endTime, int page, int size) {
|
|
|
Page<ReportStatisticsVo> pageVo = new Page<>(page, size);
|
|
|
- IPage<ReportStatisticsVo> result=houseOrderMapper.reportStatisticsPage(pageVo,s,keyWord,startTime,endTime);
|
|
|
+ IPage<ReportStatisticsVo> result = houseOrderMapper.reportStatisticsPage(pageVo, s, keyWord, startTime, endTime);
|
|
|
return new PageUtils(result);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public List<ReportStatisticsExportVo> reportStatisticsExport(String s, String keyWord, String startTime, String endTime) {
|
|
|
- return houseOrderMapper.reportStatisticsExport(s,keyWord,startTime,endTime);
|
|
|
+ return houseOrderMapper.reportStatisticsExport(s, keyWord, startTime, endTime);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public List<String> payHouseOrderUser(LocalDateTime start, LocalDateTime end) {
|
|
|
- return houseOrderMapper.payHouseOrderUser(start,end);
|
|
|
+ return houseOrderMapper.payHouseOrderUser(start, end);
|
|
|
}
|
|
|
}
|