gqx 2 éve
szülő
commit
68f9ebf538

+ 51 - 0
jeecg-mall-api/src/main/java/org/jeecg/modules/bus/controller/HotelController.java

@@ -501,6 +501,7 @@ public class HotelController extends WebConfig {
                 if (cesRooms != null) {
                     busHotel = busHotelService.getById(cesRooms.getHotelId());
                     busHotel.setRoomName(cesRooms.getName());
+                    busHotel.setLivingOrder(busRoomsLivingOrder);
                 }
             }
         }
@@ -930,4 +931,54 @@ public class HotelController extends WebConfig {
         mallOrderGoods.setDetailList(list);
         return Result.OK(mallOrderGoods);
     }
+
+    /**
+     * 获取入住订单费用账单(结账界面费用展示)
+     * @param bookingOrderId
+     * @return
+     */
+    @ApiOperation(value="获取入住订单费用账单(结账界面费用展示)", notes="获取入住订单费用账单(结账界面费用展示)")
+    @RequestMapping(value = "/living-fees",method = RequestMethod.GET)
+    @ApiVersion(group = ApiVersionConstant.FAP_MALLAPI101)
+    @ApiLogin
+    public Result<List<BusOrderFee>> getLivingOrderFees(String bookingOrderId) {
+        if (bookingOrderId == null || bookingOrderId.isEmpty()) throw new JeecgBootException("参数错误");
+        List<BusOrderFee> list = busRoomBookingOrdersService.getLivingOrderFee(bookingOrderId);
+        HashMap<String, BigDecimal> obj = new HashMap<String, BigDecimal>();
+        obj.put("xf", BigDecimal.ZERO);
+        obj.put("sk", BigDecimal.ZERO);
+        if (list != null && list.size() > 0) {
+            List<BusOrderFee> xfList = list.stream().filter(t -> t.getFeeType().equals(1)).collect(Collectors.toList());
+            if (xfList != null && xfList.size() > 0) {
+                BigDecimal sum = BigDecimal.ZERO;
+                for (BusOrderFee busOrderFee : xfList) {
+                    sum = sum.add(busOrderFee.getMoney());
+                }
+                obj.put("xf", sum);
+            }
+            List<BusOrderFee> skList = list.stream().filter(t -> t.getFeeType().equals(2)).collect(Collectors.toList());
+            if (skList != null && skList.size() > 0) {
+                BigDecimal sum = BigDecimal.ZERO;
+                for (BusOrderFee busOrderFee : skList) {
+                    sum = sum.add(busOrderFee.getMoney());
+                }
+                obj.put("sk", sum);
+            }
+        }
+        return Result.ok();
+    }
+
+    /**
+     * 单房一键结账
+     * @param livingOrderId
+     * @return
+     */
+    @ApiOperation(value="单房一键结账", notes="单房一键结账")
+    @RequestMapping(value = "/living-settle-checkout",method = RequestMethod.POST)
+    @ApiVersion(group = ApiVersionConstant.FAP_MALLAPI101)
+    @ApiLogin
+    public Result<Boolean> livingSettleBillCheckOut(@RequestBody List<BusOrderFee> fees, String livingOrderId) {
+        Boolean isOk = busRoomBookingOrdersService.livingSettleBillCheckOut(fees,livingOrderId);
+        return Result.OK(isOk);
+    }
 }

+ 4 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/entity/BusHotel.java

@@ -286,4 +286,8 @@ public class BusHotel implements Serializable {
     @ApiModelProperty(value = "房号")
     @TableField(exist = false)
     private String roomName;
+
+    @ApiModelProperty(value = "入住订单信息")
+    @TableField(exist = false)
+    private  BusRoomsLivingOrder livingOrder;
 }