소스 검색

入住单结账状态

qh 2 년 전
부모
커밋
2b27aa8d85

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

@@ -202,5 +202,9 @@ public class BusRoomsLivingOrder implements Serializable {
     @TableField(exist = false)
     @TableField(exist = false)
     private Boolean isTeam;
     private Boolean isTeam;
 
 
+    @Excel(name = "结账类型", width = 15)
+    @ApiModelProperty(value = "结账类型")
+    private Integer settleType;
+
 
 
 }
 }

+ 53 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/enums/SettleTypeEnum.java

@@ -0,0 +1,53 @@
+package org.jeecg.modules.business.enums;
+
+import org.jeecg.common.system.vo.DictModel;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public enum SettleTypeEnum {
+    UN_LEAVE(-1,"正常入住"),
+    SETTLE_LEAVE(1,"结账退房"),
+    UN_SETTLE_LEAVE(2,"未结退房");
+
+    Integer key;
+
+    String title;
+
+    SettleTypeEnum(Integer key, String title){
+        this.key = key;
+        this.title = title;
+    }
+    public Integer getKey() {
+        return key;
+    }
+
+    public String getTitle() {
+        return title;
+    }
+
+    /**
+     * 获取字典数据
+     * @return
+     */
+    public static List<DictModel> getDictList(){
+        List<DictModel> list = new ArrayList<>();
+        DictModel dictModel = null;
+        for(CouponsEventEnum e: CouponsEventEnum.values()){
+            dictModel = new DictModel();
+            dictModel.setValue(e.key.toString());
+            dictModel.setText(e.title);
+            list.add(dictModel);
+        }
+        return list;
+    }
+
+    public static SettleTypeEnum val(Integer key){
+        for(SettleTypeEnum bld: values()){
+            if(bld.key .equals(key)){
+                return bld;
+            }
+        }
+        return null;
+    }
+}

+ 9 - 1
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/service/impl/BusRoomBookingOrdersServiceImpl.java

@@ -1045,6 +1045,8 @@ public class BusRoomBookingOrdersServiceImpl extends ServiceImpl<BusRoomBookingO
             Optional<BusRoomsLivingOrder> opMainRoomOrder = livingOrders.stream().filter(s->s.getBookingRoomId().equals(mainRoom.getId())).findFirst();
             Optional<BusRoomsLivingOrder> opMainRoomOrder = livingOrders.stream().filter(s->s.getBookingRoomId().equals(mainRoom.getId())).findFirst();
             if(!opMainRoomOrder.isPresent()) throw new JeecgBootException("没有找到主房订单");
             if(!opMainRoomOrder.isPresent()) throw new JeecgBootException("没有找到主房订单");
             BusRoomsLivingOrder mainRoomOrder = opMainRoomOrder.get();
             BusRoomsLivingOrder mainRoomOrder = opMainRoomOrder.get();
+            livingOrders.forEach(s->s.setSettleType(SettleTypeEnum.SETTLE_LEAVE.getKey()));
+            roomsLivingOrderService.updateBatchById(livingOrders);
             if(livingOrders.size() > 0) {
             if(livingOrders.size() > 0) {
                List<BusOrderFee> feeItems = getLivingOrderFee(bookingOrderId).stream().filter(
                List<BusOrderFee> feeItems = getLivingOrderFee(bookingOrderId).stream().filter(
                        s->s.getPreferentialStatus().equals(1)// 找到未结账的
                        s->s.getPreferentialStatus().equals(1)// 找到未结账的
@@ -1085,7 +1087,8 @@ public class BusRoomBookingOrdersServiceImpl extends ServiceImpl<BusRoomBookingO
 
 
         BusRoomsLivingOrder mainRoomOrder = livingOrder;
         BusRoomsLivingOrder mainRoomOrder = livingOrder;
 
 
-
+        livingOrder.setSettleType(SettleTypeEnum.SETTLE_LEAVE.getKey());
+        roomsLivingOrderService.updateById(livingOrder);
         List<BusOrderFee> feeItems = getLivingOrderFees(livingOrderId).stream().filter(
         List<BusOrderFee> feeItems = getLivingOrderFees(livingOrderId).stream().filter(
                 s->s.getPreferentialStatus().equals(1)// 找到未结账的
                 s->s.getPreferentialStatus().equals(1)// 找到未结账的
         ).collect(Collectors.toList());
         ).collect(Collectors.toList());
@@ -1156,6 +1159,8 @@ public class BusRoomBookingOrdersServiceImpl extends ServiceImpl<BusRoomBookingO
                 s.setLivingOrderId(null);
                 s.setLivingOrderId(null);
                 s.setRoomStatus(RoomStatusEnum.EMPTY_DIRTY.getKey());
                 s.setRoomStatus(RoomStatusEnum.EMPTY_DIRTY.getKey());
             });
             });
+            bookingLivings.forEach(s->s.setSettleType(SettleTypeEnum.SETTLE_LEAVE.getKey()));
+            roomsLivingOrderService.updateBatchById(bookingLivings);
             roomsService.updateBatchById(rooms);
             roomsService.updateBatchById(rooms);
         } else if(livingOrderId != null && !livingOrderId.isEmpty()) {
         } else if(livingOrderId != null && !livingOrderId.isEmpty()) {
             BusRoomsLivingOrder livingOrder = roomsLivingOrderService.getById(livingOrderId);
             BusRoomsLivingOrder livingOrder = roomsLivingOrderService.getById(livingOrderId);
@@ -1167,6 +1172,9 @@ public class BusRoomBookingOrdersServiceImpl extends ServiceImpl<BusRoomBookingO
             if(room == null) throw new JeecgBootException("未找到订单信息");
             if(room == null) throw new JeecgBootException("未找到订单信息");
             room.setLivingOrderId(null);
             room.setLivingOrderId(null);
             room.setRoomStatus(RoomStatusEnum.EMPTY_DIRTY.getKey());
             room.setRoomStatus(RoomStatusEnum.EMPTY_DIRTY.getKey());
+
+            livingOrder.setSettleType(SettleTypeEnum.SETTLE_LEAVE.getKey());
+            roomsLivingOrderService.updateById(livingOrder);
             roomsService.updateById(room);
             roomsService.updateById(room);
         } else throw new JeecgBootException("参数错误");
         } else throw new JeecgBootException("参数错误");
         return true;
         return true;