|
|
@@ -3366,7 +3366,6 @@ public class HouseOrderController implements HouseOrderAPI {
|
|
|
LocalDateTime stateTime = LocalDateTime.parse(liveTime, dateTimeFormatter1);
|
|
|
LocalDateTime endTime = LocalDateTime.parse(leaveTime, dateTimeFormatter1);
|
|
|
long day = stateTime.toLocalDate().until(endTime.toLocalDate(), ChronoUnit.DAYS);
|
|
|
- System.out.println("day = " + day);
|
|
|
if (day > 2) {
|
|
|
return CommonResult.fail("超过限制的时间段");
|
|
|
}
|
|
|
@@ -3641,6 +3640,7 @@ public class HouseOrderController implements HouseOrderAPI {
|
|
|
|
|
|
// 计算一个月内每个人的免费入住所消费的水电
|
|
|
@Scheduled(cron = "0 0 1 1 * ? ")
|
|
|
+// @Scheduled(cron = "0 0/1 * * * ?")
|
|
|
public void payHouseOrder() {
|
|
|
// 获取免费的额度
|
|
|
SubsidySetup subsidySetup = subsidySetupService.list(new LambdaQueryWrapper<>()).get(0);
|
|
|
@@ -3652,6 +3652,9 @@ public class HouseOrderController implements HouseOrderAPI {
|
|
|
BigDecimal waterPrice = new BigDecimal(2.1);
|
|
|
BigDecimal electricPrice = new BigDecimal(0.62);
|
|
|
|
|
|
+ water=water.multiply(waterPrice);
|
|
|
+ electric=electric.multiply(electricPrice);
|
|
|
+
|
|
|
DateTimeFormatter dateTimeFormatter1 = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
|
|
|
|
|
// 计算上个免费的订单
|
|
|
@@ -3660,7 +3663,8 @@ public class HouseOrderController implements HouseOrderAPI {
|
|
|
|
|
|
LambdaQueryWrapper<HouseOrder> wrapper = new LambdaQueryWrapper<>();
|
|
|
wrapper.between(HouseOrder::getLeaveTime, start, end)
|
|
|
- .eq(HouseOrder::getPayPrice, 0);
|
|
|
+ .eq(HouseOrder::getPayPrice, 0)
|
|
|
+ .eq(HouseOrder::getOrderStatus,8);
|
|
|
List<HouseOrder> list = houseOrderService.list(wrapper);
|
|
|
|
|
|
|
|
|
@@ -3698,12 +3702,12 @@ public class HouseOrderController implements HouseOrderAPI {
|
|
|
BigDecimal payPrice = new BigDecimal(0);
|
|
|
// 总额度大于免费额度
|
|
|
if (waterTotal.subtract(water).doubleValue() > 0) {
|
|
|
- BigDecimal totalWaterPrice = (waterTotal.subtract(water)).multiply(waterPrice);
|
|
|
+ BigDecimal totalWaterPrice = waterCostTotal.subtract(water);
|
|
|
payPrice = payPrice.add(totalWaterPrice);
|
|
|
}
|
|
|
|
|
|
if (electricTotal.subtract(electric).doubleValue() > 0) {
|
|
|
- BigDecimal totalElectricPrice = (electricTotal.subtract(electric)).multiply(electricPrice);
|
|
|
+ BigDecimal totalElectricPrice = electricCostTotal.subtract(electric);
|
|
|
payPrice = payPrice.add(totalElectricPrice);
|
|
|
}
|
|
|
if (payPrice.doubleValue() > 0) {
|
|
|
@@ -3746,11 +3750,8 @@ public class HouseOrderController implements HouseOrderAPI {
|
|
|
houseOrders.add(houseOrder);
|
|
|
}
|
|
|
|
|
|
- houseOrderService.saveBatch(houseOrders);
|
|
|
-
|
|
|
-
|
|
|
}
|
|
|
-
|
|
|
+ houseOrderService.saveBatch(houseOrders);
|
|
|
}
|
|
|
|
|
|
|