gqx пре 2 година
родитељ
комит
f118097ec4

+ 8 - 5
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/controller/BusRoomBookingOrdersController.java

@@ -1,9 +1,6 @@
 package org.jeecg.modules.business.controller;
 
-import java.util.Arrays;
-import java.util.Date;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 import java.util.stream.Collectors;
 import java.io.IOException;
 import java.io.UnsupportedEncodingException;
@@ -482,7 +479,13 @@ public class BusRoomBookingOrdersController extends JeecgController<BusRoomBooki
 	 	return Result.OK();
 	 }
 
-
+	 @ApiOperation(value="根据手机号查询入住历史列表", notes="根据手机号查询入住历史列表")
+	 @RequestMapping(value = "/ruzhu-history-list",method = RequestMethod.GET)
+	 public Result<IPage<HashMap<String, Object>>> ruZhuHistoryList(			  @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+																				 @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,@RequestParam(name = "hotelId") String hotelId,@RequestParam(name = "phone") String phone) {
+		 Page<HashMap<String, Object>> page = new Page<HashMap<String, Object>>(pageNo, pageSize);
+		 return Result.OK(service.ruZhuHistoryList(page, hotelId, phone));
+	 }
 
 
 

+ 25 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/mapper/BusRoomBookingOrdersMapper.java

@@ -1,15 +1,19 @@
 package org.jeecg.modules.business.mapper;
 
 import java.util.Date;
+import java.util.HashMap;
 import java.util.List;
 
+import cn.hutool.core.date.DateTime;
 import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Select;
 import org.jeecg.modules.business.dto.TodayBookingQueryDto;
 import org.jeecg.modules.business.entity.BusBookingRooms;
 import org.jeecg.modules.business.entity.BusRoomBookingOrders;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.jeecg.modules.business.entity.BusRoomPayType;
 import org.jeecg.modules.business.vo.*;
 import org.jeecg.modules.rooms.entity.CesRooms;
 import org.springframework.format.annotation.DateTimeFormat;
@@ -41,4 +45,25 @@ public interface BusRoomBookingOrdersMapper extends BaseMapper<BusRoomBookingOrd
     IPage<KeLiItemVo> getKeBooking(IPage<KeLiItemVo> page,String thirdUserId, String hotelId,String keyw,Integer status);
     @Select("SELECT o.id from bus_room_booking_orders o inner join bus_booking_rooms br on o.id = br.booking_orders_id inner join ces_room_layout l on l.id = br.room_layout_id where l.hotel_id = #{hotelId} and o.arrival_time >= now() and o.arrival_time <= DATE_ADD(o.arrival_time,interval 1 day)")
     List<BusRoomBookingOrders> countTodayYD(String hotelId);
+
+
+    /**
+     * 根据手机号查询入住历史列表
+     * @param page
+     * @param hotelId
+     * @param phone
+     * @return
+     */
+    @Select("<script>select o.due_out_time,r.name as room_name,layout.name as layout_name,ldp.price,bc.`name`,bc.phone,bc.cert_no, case ifnull(card.id,'0') when '0' then '否' else '是' end as huiyuan from bus_rooms_living_order o inner join bus_customer bc on bc.id=o.contact_id\n" +
+            "left join bus_booking_rooms br on br.id=o.booking_room_id\n" +
+            "left join ces_rooms r on r.id=br.room_id\n" +
+            "left join ces_room_layout layout on layout.id=r.layout_id\n" +
+            "left join (select living_order_id,max(price) as price from bus_living_layout_day_price group by living_order_id) ldp on ldp.living_order_id=o.id\n" +
+            "left join bus_member_card card on card.mobile=bc.phone\n"+
+            "where 1=1" +
+            "<if test='hotelId != null and hotelId !=\"\"'> and o.hotel_id = '${hotelId}' </if>" +
+            "<if test='phone != null and phone !=\"\"'> and bc.phone = '${phone}' </if>" +
+            "</script>")
+    public List<HashMap<String, Object>> ruZhuHistoryList(Page<HashMap<String, Object>> page, @Param("hotelId") String hotelId, @Param("phone") String phone);
+
 }

+ 37 - 9
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/service/IBusRoomBookingOrdersService.java

@@ -15,6 +15,7 @@ import org.jeecg.modules.rooms.entity.CesRooms;
 
 import java.math.BigDecimal;
 import java.util.Date;
+import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
@@ -41,7 +42,8 @@ public interface IBusRoomBookingOrdersService extends IService<BusRoomBookingOrd
     String batchOrderSave(BatchOrderSavaDto item);
 
     Boolean setBatchOrderStatus(BusBookingBatch batchOrder);
-    String bookingToLive(String bookingRoomId, List<BusLivingCustomer> customers, String hotelId,Boolean bookingLiving);
+
+    String bookingToLive(String bookingRoomId, List<BusLivingCustomer> customers, String hotelId, Boolean bookingLiving);
 
     String customerLiving(BookingOrderSaveDto livingData, Boolean isTeam, String hotelId);
 
@@ -51,26 +53,52 @@ public interface IBusRoomBookingOrdersService extends IService<BusRoomBookingOrd
 
     Boolean syncDayRoomOrder(String hotelId);
 
-    BigDecimal getOrderFeeTotal(String livingOrderId,String bookingOrderId);
+    BigDecimal getOrderFeeTotal(String livingOrderId, String bookingOrderId);
+
     Boolean settleBillCheckOut(List<BusOrderFee> settleFees, String bookingOrderId);
-    Boolean continueLiving(BusOrderFee settleFee, Date dueOutTime,String livingOrderId,String hotelId);
+
+    Boolean continueLiving(BusOrderFee settleFee, Date dueOutTime, String livingOrderId, String hotelId);
+
     Boolean livingSettleBillCheckOut(List<BusOrderFee> settleFees, String livingOrderId);
+
     Boolean partialSettle(PartialSettleVo param);
+
     Boolean splitLiving(String livingOrderId);
+
     Boolean leaveNotSettle(String bookingOrderId, String livingOrderId);
 
-    IPage<RoomLivingQueryVo> getLivingPageData(Integer status,String keyw, Page<RoomLivingQueryVo> page,String hotelId);
-    IPage<KeLiItemVo> getLivingOrderKL(Integer status,String keyw,String hotelId,String thirdUserId, Page<KeLiItemVo> page);
-    IPage<KeLiItemVo> getBookingOrderKL(Integer status,String keyw,String hotelId,String thirdUserId, Page<KeLiItemVo> page);
-    Boolean setLivingOrderFee(List<BusOrderFee> fees,String livingOrderId,String hotelId);
-    Boolean unionOrder(String roomId,String targetRoomId, String bookingOrderId, String hotelId);
+    IPage<RoomLivingQueryVo> getLivingPageData(Integer status, String keyw, Page<RoomLivingQueryVo> page, String hotelId);
+
+    IPage<KeLiItemVo> getLivingOrderKL(Integer status, String keyw, String hotelId, String thirdUserId, Page<KeLiItemVo> page);
+
+    IPage<KeLiItemVo> getBookingOrderKL(Integer status, String keyw, String hotelId, String thirdUserId, Page<KeLiItemVo> page);
+
+    Boolean setLivingOrderFee(List<BusOrderFee> fees, String livingOrderId, String hotelId);
+
+    Boolean unionOrder(String roomId, String targetRoomId, String bookingOrderId, String hotelId);
+
     Boolean mergeOrder(String livingRoomId, List<String> livingOrderId);
-    ForwardFangTaiVo forwardFangTai(String start, String end, String hotelId,Boolean isContainLeave);
+
+    ForwardFangTaiVo forwardFangTai(String start, String end, String hotelId, Boolean isContainLeave);
+
     RiLiFangTaiResultVo riliFangTai(String start, String end, String hotelId);
+
     Boolean updateOrderInfo(Integer type, UpdateOrderInfoDto info);
+
     Boolean updateOrderPrice(UpdateOrderPriceDto info);
+
     void syncDayOrderFee();
+
     void syncDayOrderFeeItem(BusRoomsLivingOrder order, CesAllDayPriceRule allDayRule);
+
     List<BusRoomBookingOrders> countTodayYD(String hotelId);
 
+    /**
+     * 根据手机号查询入住历史列表
+     * @param page
+     * @param hotelId
+     * @param phone
+     * @return
+     */
+    Page<HashMap<String, Object>> ruZhuHistoryList(Page<HashMap<String, Object>> page,  String hotelId, String phone);
 }

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

@@ -1,5 +1,7 @@
 package org.jeecg.modules.business.service.impl;
 
+import cn.hutool.core.date.DateTime;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
@@ -2248,4 +2250,15 @@ public class BusRoomBookingOrdersServiceImpl extends ServiceImpl<BusRoomBookingO
         batchDto.setBookingDicWay(order.getBookingDicWay());
         batchDto.setBookingStatus(order.getBookingStatus());
     }
+
+    /**
+     * 根据手机号查询入住历史列表
+     * @param hotelId
+     * @param phone
+     * @return
+     */
+    public Page<HashMap<String, Object>> ruZhuHistoryList(Page<HashMap<String, Object>> page,  String hotelId, String phone) {
+        return page.setRecords(this.baseMapper.ruZhuHistoryList(page, hotelId, phone));
+    }
+
 }