|
@@ -1033,7 +1033,13 @@ public class BusRoomBookingOrdersServiceImpl extends ServiceImpl<BusRoomBookingO
|
|
|
|
|
|
|
|
Optional<BusRoomsLivingOrder> opLivingOrder=livingOrders.stream().filter(a->a.getId().equals(s.getLivingOrderId())).findFirst();
|
|
Optional<BusRoomsLivingOrder> opLivingOrder=livingOrders.stream().filter(a->a.getId().equals(s.getLivingOrderId())).findFirst();
|
|
|
if(opLivingOrder.isPresent()) {
|
|
if(opLivingOrder.isPresent()) {
|
|
|
- vo.getLivingData().setLivingOrder(opLivingOrder.get());
|
|
|
|
|
|
|
+ BusRoomsLivingOrder livingOrder = opLivingOrder.get();
|
|
|
|
|
+ Map<String,BigDecimal> feeMap = getRoomOrderFees(livingOrder.getId());
|
|
|
|
|
+ livingOrder.setXiaoFei(feeMap.get("xf"));
|
|
|
|
|
+ livingOrder.setShouKuan(feeMap.get("sk"));
|
|
|
|
|
+ vo.getLivingData().setLivingOrder(livingOrder);
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
Optional<BusLivingCustomer> opLivingCustomer = livingCustomers.stream().filter(a->a.getLivingOrderId().equals(opLivingOrder.get().getId())).findFirst();
|
|
Optional<BusLivingCustomer> opLivingCustomer = livingCustomers.stream().filter(a->a.getLivingOrderId().equals(opLivingOrder.get().getId())).findFirst();
|
|
|
if(opLivingCustomer.isPresent()) {
|
|
if(opLivingCustomer.isPresent()) {
|
|
|
vo.getLivingData().setLivingCustomers(opLivingCustomer.get());
|
|
vo.getLivingData().setLivingCustomers(opLivingCustomer.get());
|
|
@@ -1047,6 +1053,25 @@ public class BusRoomBookingOrdersServiceImpl extends ServiceImpl<BusRoomBookingO
|
|
|
return roomVos;
|
|
return roomVos;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ private Map<String, BigDecimal> getRoomOrderFees(String livingOrderId) {
|
|
|
|
|
+ List<BusOrderFee> fees = feeService.list(Wrappers.<BusOrderFee>query()
|
|
|
|
|
+ .eq("living_order_id",livingOrderId).eq("preferential_status",1));
|
|
|
|
|
+ List<BusOrderFee> xiaofeiList = fees.stream().filter(s->s.getFeeType().equals(1)).collect(Collectors.toList());
|
|
|
|
|
+ List<BusOrderFee> shoukuanList = fees.stream().filter(s->s.getFeeType().equals(2)).collect(Collectors.toList());
|
|
|
|
|
+ final BigDecimal[] xiaoFeiTotal = {new BigDecimal(0)};
|
|
|
|
|
+ final BigDecimal[] shouKuanTotal = {new BigDecimal(0)};
|
|
|
|
|
+ xiaofeiList.forEach(s->{
|
|
|
|
|
+ xiaoFeiTotal[0] = xiaoFeiTotal[0].add(s.getMoney());
|
|
|
|
|
+ });
|
|
|
|
|
+ shoukuanList.forEach(s->{
|
|
|
|
|
+ shouKuanTotal[0] = shouKuanTotal[0].add(s.getMoney());
|
|
|
|
|
+ });
|
|
|
|
|
+ Map<String,BigDecimal> items = new HashMap<>();
|
|
|
|
|
+ items.put("xf",xiaoFeiTotal[0]);
|
|
|
|
|
+ items.put("sk",shouKuanTotal[0]);
|
|
|
|
|
+ return items;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
@Override
|
|
@Override
|
|
|
public List<BusOrderFee> getLivingOrderFee(String orderId) {
|
|
public List<BusOrderFee> getLivingOrderFee(String orderId) {
|
|
|
List<BusRoomsLivingOrder> livingOrders = roomsLivingOrderService.list(Wrappers.<BusRoomsLivingOrder>query().eq("booking_order_id",orderId));
|
|
List<BusRoomsLivingOrder> livingOrders = roomsLivingOrderService.list(Wrappers.<BusRoomsLivingOrder>query().eq("booking_order_id",orderId));
|
|
@@ -1747,6 +1772,15 @@ public class BusRoomBookingOrdersServiceImpl extends ServiceImpl<BusRoomBookingO
|
|
|
}
|
|
}
|
|
|
Date finalCurrDate = currDate;
|
|
Date finalCurrDate = currDate;
|
|
|
dayStrs.forEach(s->{
|
|
dayStrs.forEach(s->{
|
|
|
|
|
+ try {
|
|
|
|
|
+ // 如果是当天还没有到退房时间 就不计算当天房费
|
|
|
|
|
+ if(s.equals(DateUtils.formatDate(finalCurrDate)) && (order.getDueOutTime().getTime() < DateUtils.parseDate(DateUtils.formatDate(new Date())+" " + allDayRule.getEndTime(),"yyyy-MM-dd HH:mm:ss") .getTime())){
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ } catch (ParseException e) {
|
|
|
|
|
+ e.printStackTrace();
|
|
|
|
|
+ }
|
|
|
Optional<BusLivingLayoutDayPrice> opPrice = dayPrices.stream().filter(a-> DateUtils.formatDate(a.getDayTime()).equals(s)).findFirst();
|
|
Optional<BusLivingLayoutDayPrice> opPrice = dayPrices.stream().filter(a-> DateUtils.formatDate(a.getDayTime()).equals(s)).findFirst();
|
|
|
if(!opPrice.isPresent()){
|
|
if(!opPrice.isPresent()){
|
|
|
BusLivingLayoutDayPrice nPrice = new BusLivingLayoutDayPrice();
|
|
BusLivingLayoutDayPrice nPrice = new BusLivingLayoutDayPrice();
|