无关风月
2025-11-05 193f290729968952aba5bcb949b5d1f572bea304
cloud-server-other/src/main/java/com/dsh/other/service/impl/SiteServiceImpl.java
@@ -281,6 +281,7 @@
            querySiteTimes.setSelectCount(0);
            querySiteTimes.setSelectMaxCount(site.getWalkinCapacity());
            querySiteTimes.setIsReserve(0);
            querySiteTimes.setTimeAfter(0);
            querySiteTimes.setCashPrice(tSitePrice.getCashPrice());
            querySiteTimes.setCoinPrice(tSitePrice.getCoinPrice());
            String temp = tSitePrice.getStartTime().substring(0, tSitePrice.getStartTime().length() - 3) + "-" + tSitePrice.getEndTime().substring(0, tSitePrice.getEndTime().length() - 3);
@@ -313,6 +314,11 @@
                    count++;
                }
            }
            if (querySiteTimes.getSelectable() == 1&&end.before(now)){
                querySiteTimes.setSelectable(0);
                querySiteTimes.setTimeAfter(1);
            }
            querySiteTimes.setSelectCount(count);
            if (flag == 0 &&  querySiteTimes.getSelectable() == 1) {
                // 当前时间段还没有预约
@@ -321,10 +327,19 @@
                System.err.println("预约人数" + count);
                System.err.println("最大散客容纳数" + walkinCapacity);
                if (walkinCapacity <= count) {
                    // 不可预约 也不能散客
                    if (targetAudience==1 && walkinCapacity!=0){
                        // 不可预约
                    System.err.println("不可预约 也不能散客");
                    querySiteTimes.setSelectable(0);
                    querySiteTimes.setIsReserve(0);
                    }else if (targetAudience==2){
                        // 不能散客
                        System.err.println("不可预约 也不能散客");
                        querySiteTimes.setSelectable(0);
                        querySiteTimes.setIsReserve(0);
                    }else{
                        querySiteTimes.setSelectable(1);
                    }
                }else{
                    if (targetAudience==2){
                        // 散客只能预约当前时间段