ソースを参照

远期房态添加字段

覃浩 2 年 前
コミット
fcd9709932

+ 4 - 2
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/mapper/xml/BusRoomBookingOrdersMapper.xml

@@ -81,7 +81,8 @@
 
 	select l.id as layout_id,l.`name` as layoutName,DATE_FORMAT(lo.arrival_time,'%Y-%m-%d') as enter_date,DATE_FORMAT(lo.due_out_time,'%Y-%m-%d') as leave_date ,lo.settle_type,
     r.id as room_id,(r.`name`) as room_name, lo.id as living_id, living_order_no as order_no,1 as is_living,lo.contact_id,
-cus.id as customer_id,cus.`name` as customer_name,lo.arrival_time,lo.due_out_time
+cus.id as customer_id,cus.`name` as customer_name,lo.arrival_time,lo.due_out_time,
+lo.booking_order_id
     from bus_booking_rooms br inner join bus_rooms_living_order lo
     on br.id = lo.booking_room_id
     inner join ces_rooms r
@@ -99,7 +100,8 @@ cus.id as customer_id,cus.`name` as customer_name,lo.arrival_time,lo.due_out_tim
     UNION ALL
     select l.id as layout_id,l.`name` as layoutName,DATE_FORMAT(lo.arrival_time,'%Y-%m-%d') as enter_date,DATE_FORMAT(lo.due_out_time,'%Y-%m-%d') as leave_date, (-20) as settle_type,
     r.id as room_id,(r.`name`) as room_name, lo.id as living_id, lo.booking_orders_no as order_no , 0 as is_living,lo.contact_id,
-    cus.id as customer_id,cus.`name` as customer_name,lo.arrival_time,lo.due_out_time
+    cus.id as customer_id,cus.`name` as customer_name,lo.arrival_time,lo.due_out_time,
+    lo.id as booking_order_id
     from bus_booking_rooms br inner join bus_room_booking_orders lo
     on br.booking_orders_id = lo.id
     inner join ces_rooms r

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

@@ -1677,7 +1677,7 @@ public class BusRoomBookingOrdersServiceImpl extends ServiceImpl<BusRoomBookingO
                 .eq("living_order_id",order.getId()).eq("room_id",room.getId()).eq("subject_type",FeeSubjectType.MEI_RI_FANG_FEI.getKey()));
 
         // 如果预离时间小于当天 全天房退房时间,默认16:00,则根据全天规则续房为全天房
-        if(order.getDueOutTime().getTime() < DateUtils.parseDatetime(DateUtils.formatDate(new Date())+" " + allDayRule.getEndTime()).getTime()) {
+        if(order.getDueOutTime().getTime() < DateUtils.parseDate(DateUtils.formatDate(new Date())+" " + allDayRule.getEndTime(),"yyyy-MM-dd") .getTime()) {
             Date orderLeave = order.getDueOutTime();
 //            orderLeave.
         }
@@ -1686,7 +1686,11 @@ public class BusRoomBookingOrdersServiceImpl extends ServiceImpl<BusRoomBookingO
             if(!opPrice.isPresent()){
                 BusLivingLayoutDayPrice nPrice = new BusLivingLayoutDayPrice();
                 nPrice.setBookingRoomId(order.getBookingRoomId());
-                nPrice.setDayTime(DateUtils.parseDatetime(s));
+                try {
+                    nPrice.setDayTime(DateUtils.parseDate(s,"yyyy-MM-dd"));
+                } catch (ParseException e) {
+                    e.printStackTrace();
+                }
                 nPrice.setRoomId(bookingRoom.getRoomId());
                 nPrice.setRoomLayoutId(room.getLayoutId());
                 nPrice.setPrice(layout.getMarketPrice());
@@ -1702,14 +1706,22 @@ public class BusRoomBookingOrdersServiceImpl extends ServiceImpl<BusRoomBookingO
                 nFee.setSubjectType(FeeSubjectType.MEI_RI_FANG_FEI.getKey());
                 nFee.setHotelId(order.getHotelId());
                 nFee.setCreateTime(new Date());
-                nFee.setDayTime(DateUtils.parseDatetime(s));
+                try {
+                    nFee.setDayTime(DateUtils.parseDate(s,"yyyy-MM-dd"));
+                } catch (ParseException e) {
+                    e.printStackTrace();
+                }
                 nFee.setRoomId(room.getId());
                 nFee.setFeeType(1);
                 nFee.setPreferentialStatus(1);
                 nFee.setLivingOrderId(order.getId());
-                if(DateUtils.parseDatetime(s).getTime() < new Date().getTime()) {
-                    nFee.setCustorerOrderRemark("夜审房费");
-                    nFee.setSubjectType(FeeSubjectType.YE_SHEN_FANG_FEI.getKey());
+                try {
+                    if(DateUtils.parseDate(s,"yyyy-MM-dd").getTime() < new Date().getTime()) {
+                        nFee.setCustorerOrderRemark("夜审房费");
+                        nFee.setSubjectType(FeeSubjectType.YE_SHEN_FANG_FEI.getKey());
+                    }
+                } catch (ParseException e) {
+                    e.printStackTrace();
                 }
                 feeService.save(nFee);
             }

+ 22 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/test/Test.java

@@ -0,0 +1,22 @@
+package org.jeecg.modules.business.test;
+
+import lombok.SneakyThrows;
+import org.jeecg.common.util.DateUtils;
+
+import java.util.Calendar;
+import java.util.Date;
+import java.util.GregorianCalendar;
+
+public class Test {
+    @SneakyThrows
+    public static void main(String[] args) {
+        Date date = DateUtils.parseDate("2023-04-26","yyyy-MM-dd");
+        Calendar calendar = new GregorianCalendar();
+        calendar.setTime(date);
+        // 把日期往后增加一天,整数  往后推,负数往前移动
+        calendar.add(Calendar.DATE, 1);
+        // 这个时间就是日期往后推一天的结果
+        date = calendar.getTime();
+        System.out.println(DateUtils.formatDate(date));
+    }
+}

+ 1 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/vo/ForwardFangTaiQueryVo.java

@@ -9,6 +9,7 @@ import java.util.Date;
 @Data
 public class ForwardFangTaiQueryVo {
     private String layoutId;
+    private String bookingOrderId;
     private String layoutName;
     private String enterDate;
     private String leaveDate;