覃浩 %!s(int64=2) %!d(string=hai) anos
pai
achega
5d4a078f4c

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

@@ -1848,13 +1848,20 @@ public class BusRoomBookingOrdersServiceImpl extends ServiceImpl<BusRoomBookingO
         livingLayoutDayPriceService.remove(Wrappers.<BusLivingLayoutDayPrice>query()
         livingLayoutDayPriceService.remove(Wrappers.<BusLivingLayoutDayPrice>query()
                 .ge("day_time", DateUtils.formatDate(new Date()))
                 .ge("day_time", DateUtils.formatDate(new Date()))
                 .eq("living_order_id",info.getLivingOrderId()));
                 .eq("living_order_id",info.getLivingOrderId()));
-        info.getDayPrices().forEach(s-> {
-            if(new Date().getTime() < s.getDayTime().getTime()) return;
-            if(s.getId() == null || s.getId().isEmpty()){
-                livingLayoutDayPriceService.save(s);
-            } else {
-                livingLayoutDayPriceService.updateById(s);
+
+        info.getDayPrices().stream().forEach(s-> {
+            long stamp1 = 0;
+            long stamp2 = 0;
+            try{
+                stamp1 = DateUtils.parseDate(DateUtils.formatDate(s.getDayTime()) ,"yyyy-MM-dd").getTime();
+                stamp2 = DateUtils.parseDate(DateUtils.formatDate(new Date()) ,"yyyy-MM-dd").getTime();
+
+            } catch(Exception error) {
+                error.printStackTrace();
             }
             }
+            if(stamp1 == 0 || stamp2 == 0 || stamp1 < stamp2) return;
+            s.setId(null);
+            livingLayoutDayPriceService.save(s);
             if(DateUtils.formatDate(new Date()).equals(DateUtils.formatDate(s.getDayTime()))){
             if(DateUtils.formatDate(new Date()).equals(DateUtils.formatDate(s.getDayTime()))){
                 // 修改当日房价 产生的当日房费账单也要改
                 // 修改当日房价 产生的当日房费账单也要改
                 BusOrderFee fee = feeService.getOne(Wrappers.<BusOrderFee>query()
                 BusOrderFee fee = feeService.getOne(Wrappers.<BusOrderFee>query()